Skip to content

Commit

Permalink
feat: init project
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed May 15, 2024
0 parents commit 533d90e
Show file tree
Hide file tree
Showing 44 changed files with 25,144 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelogrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@yuntijs/lint').changelog;
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@yuntijs/lint').commitlint;
21 changes: 21 additions & 0 deletions .dumi/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const FILTER_PATHS = ['umdjs/xx/xx'];

export function patchRoutes({ routes, routeComponents }) {
Object.keys(routes).forEach(key => {
console.log('key', key);
if (FILTER_PATHS.includes(key) || key.toUpperCase().endsWith('/README')) {
delete routes[key];
delete routeComponents[key];
}
});
}

export function patchClientRoutes({ routes }) {
const i = routes?.[0]?.children?.findIndex(route => route.id === 'DocLayout');
if (i === -1 || !routes[0].children[i]?.children?.length) return;
const filterRoute = routes[0].children[i].children.filter(
item => !(item.id.toUpperCase().endsWith('/README') || FILTER_PATHS.includes(item.id))
);
routes[0].children[i].children = filterRoute;
routes[0].children[i].routes = filterRoute;
}
7 changes: 7 additions & 0 deletions .dumi/global.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
body {
#root {
overflow: auto;
width: 100%;
height: 100%;
}
}
4 changes: 4 additions & 0 deletions .dumi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": ["**/*"]
}
63 changes: 63 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { defineConfig } from 'dumi';
import { readdirSync } from 'fs';
import { join } from 'path';

const PUBLIC_PATH = '/umdjs/';
const isProduction = process.env.NODE_ENV === 'production';

const headPkgList: string[] = [];
const pkgDirList = readdirSync(join(__dirname, 'packages')).filter(
pkg => !pkg.includes('.') && !headPkgList.includes(pkg)
);
const pkgs = {
//
};
export const alias = pkgDirList.reduce((pre, name) => {
pre[`@umdjs/${pkgs[name]}`] = join(__dirname, 'packages', name, 'src');
return {
...pre,
};
}, {});

export default defineConfig({
alias,
// autoAlias: true,
base: isProduction ? PUBLIC_PATH : '/',
resolve: {
docDirs: ['docs'],
atomDirs: [{ type: 'packages', dir: 'packages' }],
},
favicons: [`${PUBLIC_PATH}img/favicon.png`],
publicPath: PUBLIC_PATH,
outputPath: `./dist${PUBLIC_PATH}`,
themeConfig: {
name: 'UMDjs',
logo: `${PUBLIC_PATH}img/logo.svg`,
nav: [
{ title: 'Development', link: '/guide' },
{ title: 'Packages', link: '/packages' },
],
},
ignoreMomentLocale: true,
mfsu: {
strategy: 'normal',
shared: {
react: {
singleton: true,
},
},
},
// 默认重定向到子包的 src 文件夹
monorepoRedirect: {
peerDeps: true,
useRootProject: true,
},
lessLoader: {
javascriptEnabled: true,
strictMath: false,
math: 'parens-division',
modifyVars: {
// '@ant-prefix': PREFIX_CLS,
},
},
});
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
35 changes: 35 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Eslintignore for YuntiJS
################################################################

# dependencies
node_modules

# ci
.coverage
coverage

# test
jest*
_test_
__test__

# umi
.umi
.umi-production
.umi-test
.dumi/tmp*

# production
dist
es
lib
logs

# files generated by yunti lowcode
packages/console/**/*.jsx
packages/console/**/*.js

# misc
# add other ignore file below
packages/server/public
packages/k8s-client/docs
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@yuntijs/lint').eslint;
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/1_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: '🐛 反馈缺陷 Bug Report'
description: '反馈一个问题缺陷 | Report an bug'
title: '[Bug] '
labels: '🐛 Bug'
body:
- type: dropdown
attributes:
label: '💻 系统环境 | Operating System'
options:
- Windows
- macOS
- Ubuntu
- Other Linux
- Other
validations:
required: true
- type: textarea
attributes:
label: '🐛 问题描述 | Bug Description'
description: A clear and concise description of the bug.
validations:
required: true
- type: textarea
attributes:
label: '🚦 期望结果 | Expected Behavior'
description: A clear and concise description of what you expected to happen.
- type: textarea
attributes:
label: '📷 复现步骤 | Recurrence Steps'
description: A clear and concise description of how to recurrence.
- type: textarea
attributes:
label: '📝 补充信息 | Additional Information'
description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/2_feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: '🌠 功能需求 Feature Request'
description: '需求或建议 | Suggest an idea'
title: '[Request] '
labels: '🌠 Feature Request'
body:
- type: textarea
attributes:
label: '🥰 需求描述 | Feature Description'
description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
validations:
required: true
- type: textarea
attributes:
label: '🧐 解决方案 | Proposed Solution'
description: Describe the solution you'd like in a clear and concise manner.
validations:
required: true
- type: textarea
attributes:
label: '📝 补充信息 | Additional Information'
description: Add any other context about the problem here.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/3_question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: '😇 疑问或帮助 Help Wanted'
description: '疑问或需要帮助 | Need help'
title: '[Question] '
labels: '😇 Help Wanted'
body:
- type: textarea
attributes:
label: '🧐 问题描述 | Proposed Solution'
description: A clear and concise description of the proplem.
validations:
required: true
- type: textarea
attributes:
label: '📝 补充信息 | Additional Information'
description: Add any other context about the problem here.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/4_other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: '📝 其他 Other'
about: '其他问题 | Other issues'
title: ''
labels: ''
assignees: ''
---
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#### 💻 变更类型 | Change Type

<!-- For change type, change [ ] to [x]. -->

- [ ] ✨ feat
- [ ] 🐛 fix
- [ ] 💄 style
- [ ] 🔨 chore
- [ ] 📝 docs

#### 🔀 变更说明 | Description of Change

<!-- Thank you for your Pull Request. Please provide a description above. -->

#### 📝 补充信息 | Additional Information

<!-- Add any other context about the Pull Request here. -->
32 changes: 32 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dependabot Auto Merge
on:
pull_request_target:
types: [labeled, edited]

jobs:
merge:
if: contains(github.event.pull_request.labels.*.name, 'dependencies')
name: Dependabot Auto Merge
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js v18.x
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install pnpm v8.x
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install deps
run: pnpm i

- name: Merge
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
command: merge
target: minor
github-token: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/deploy-ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy to GitHub Pages

on:
# https://docs.github.com/zh/actions/using-workflows/events-that-trigger-workflows#workflow_run
workflow_run:
workflows:
- 'Build and Release'
types:
- completed

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js v20.x
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm v9.x
uses: pnpm/action-setup@v2
with:
version: 9

- name: Install deps
run: pnpm install

- name: Build website
run: npm run build:docs

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./dist/umdjs
Loading

0 comments on commit 533d90e

Please sign in to comment.