Skip to content

Commit f70b766

Browse files
authored
chore: setup rush environments (#1)
* chore: setup rush enviroments * chore: setup common ci process * chore: setup common plugins * chore: setup git hooks * chore: upgrade node version in ci * chore: remove ts check step
1 parent 4b29732 commit f70b766

File tree

117 files changed

+24842
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+24842
-6
lines changed

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Don't allow people to merge changes to these generated files, because the result
2+
# may be invalid. You need to run "rush update" again.
3+
pnpm-lock.yaml merge=ours
4+
shrinkwrap.yaml merge=binary
5+
npm-shrinkwrap.json merge=binary
6+
yarn.lock merge=binary
7+
# 不做自动解决冲突,暴露冲突后由开发者自行 rush pull-idl 做更新
8+
# packages/arch/idl/bam.log.json merge=ours
9+
10+
# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
11+
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
12+
# may also require a special configuration to allow comments in JSON.
13+
#
14+
# For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088
15+
#
16+
*.json linguist-language=JSON-with-Comments

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# should be optimize as increment build & test
2+
name: CI
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
include:
15+
- NodeVersion: 20.14.x
16+
NodeVersionDisplayName: 20
17+
OS: ubuntu-latest
18+
name: Node.js v${{ matrix.NodeVersionDisplayName }} (${{ matrix.OS }})
19+
runs-on: ${{ matrix.OS }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 1
24+
25+
- name: Config Git User
26+
# should be turn to ci user
27+
run: |
28+
git config --local user.name "tecvan"
29+
git config --local user.email "[email protected]"
30+
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.NodeVersion }}
34+
35+
- name: Install Dependencies
36+
run: node common/scripts/install-run-rush.js install
37+
38+
- name: Build
39+
run: node common/scripts/install-run-rush.js build --verbose
40+
41+
- name: Test:cov
42+
run: node common/scripts/install-run-rush.js test:cov --verbose
43+
44+
- name: Upload coverage reports
45+
uses: codecov/codecov-action@v4
46+
with:
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
fail_ci_if_error: true
49+
verbose: true
50+
51+
- name: Lint
52+
# for current stage, we got so much lint error, so we have to ignore it
53+
# TODO: it should be fixed ASAP
54+
continue-on-error: true
55+
run: node common/scripts/install-run-rush.js lint --verbose
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PR Common Checks
2+
on:
3+
pull_request:
4+
types: [opened, edited, synchronize, reopened]
5+
6+
jobs:
7+
common-checks:
8+
name: PR Common Checks
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 1
14+
15+
- name: Config Git User
16+
run: |
17+
git config --local user.name "tecvan"
18+
git config --local user.email "[email protected]"
19+
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 20.14.x
23+
24+
- name: Install Dependencies
25+
run: node common/scripts/install-run-rush.js install
26+
27+
# PR Title Format Check
28+
- name: Check PR Title Format
29+
if: ${{ !contains(github.event.pull_request.title, 'WIP') && !contains(github.event.pull_request.title, 'wip') }}
30+
env:
31+
PR_TITLE: ${{ github.event.pull_request.title }}
32+
run: |
33+
node common/scripts/install-run-rush.js update-autoinstaller --name rush-commitlint && \
34+
pushd common/autoinstallers/rush-commitlint && \
35+
echo "$PR_TITLE" | npx commitlint --config commitlint.config.js && \
36+
popd
37+
38+
# Add more common checks here
39+
# For example: file size checks, specific file format validations, etc.

.gitignore

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ web_modules/
7474

7575
# dotenv environment variable files
7676
.env
77+
.env.development
7778
.env.development.local
7879
.env.test.local
7980
.env.production.local
@@ -90,6 +91,7 @@ out
9091
# Nuxt.js build / generate output
9192
.nuxt
9293
dist
94+
dist_dev
9395

9496
# Gatsby files
9597
.cache/
@@ -104,12 +106,6 @@ dist
104106
.temp
105107
.cache
106108

107-
# vitepress build output
108-
**/.vitepress/dist
109-
110-
# vitepress cache directory
111-
**/.vitepress/cache
112-
113109
# Docusaurus cache and generated files
114110
.docusaurus
115111

@@ -134,3 +130,43 @@ dist
134130
.yarn/build-state.yml
135131
.yarn/install-state.gz
136132
.pnp.*
133+
134+
# Temp file
135+
*.xlsx
136+
137+
138+
node_modules
139+
140+
.eslintcache
141+
142+
common/temp
143+
144+
# OS X temporary files
145+
.DS_Store
146+
147+
# IntelliJ IDEA project files; if you want to commit IntelliJ settings, this recipe may be helpful:
148+
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
149+
.idea/
150+
*.iml
151+
152+
common/autoinstallers/*/.npmrc
153+
154+
**/.rush/temp/
155+
*.lock
156+
157+
# Heft temporary files
158+
.cache
159+
.heft
160+
161+
.vercel/output
162+
rush-logs
163+
dist
164+
165+
*.tsbuildinfo
166+
167+
# Temp file
168+
examples/coze-js-node/tmp/
169+
examples/coze-js-node/src/config/config.ts
170+
171+
!examples/coze-js-web/src/lib/wavtools/dist
172+
packages/chat-sdk/.env.development

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/hydrogen

.prettierignore

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Logs
2+
*.log
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Runtime data
8+
*.pid
9+
*.seed
10+
*.pid.lock
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# nyc test coverage
19+
.nyc_output
20+
21+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22+
.grunt
23+
24+
# Bower dependency directory (https://bower.io/)
25+
bower_components
26+
27+
# node-waf configuration
28+
.lock-wscript
29+
30+
# Compiled binary addons (https://nodejs.org/api/addons.html)
31+
build/Release
32+
33+
# Dependency directories
34+
node_modules/
35+
jspm_packages/
36+
37+
# Optional npm cache directory
38+
.npm
39+
40+
# Optional eslint cache
41+
.eslintcache
42+
43+
# Optional REPL history
44+
.node_repl_history
45+
46+
# Output of 'npm pack'
47+
*.tgz
48+
49+
# Yarn Integrity file
50+
.yarn-integrity
51+
52+
# dotenv environment variables file
53+
.env
54+
55+
# next.js build output
56+
.next
57+
58+
# OS X temporary files
59+
.DS_Store
60+
61+
# Rush temporary files
62+
common/deploy/
63+
common/temp/
64+
common/autoinstallers/*/.npmrc
65+
common/changes/
66+
common/scripts/
67+
common/config/**/pnpm-lock.yaml
68+
common/_templates/
69+
**/.rush/temp/
70+
71+
# Heft
72+
.heft
73+
74+
# PIA temp files
75+
.pia
76+
77+
# Build assets
78+
dist
79+
packages/speedy-plugin-pia/lib
80+
81+
# Rush files
82+
CHANGELOG.*
83+
84+
# Emo files
85+
.eden-mono
86+
87+
# Package manager files
88+
pnpm-lock.yaml
89+
yarn.lock
90+
package-lock.json
91+
shrinkwrap.json
92+
.pnpm-store/
93+
94+
# Build outputs
95+
lib
96+
apps/bot/routes_metadata/nestedRoutes.json
97+
98+
# Prettier reformats code blocks inside Markdown, which affects rendered output
99+
*.md
100+
101+
vendors/**/index.d.ts
102+
vendors/**/index.js
103+
104+
tests/configs/src/errors/**
105+
106+
apps/bot/src/typing/env/**

.prettierrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Do not modify this file
2+
module.exports = {
3+
...require('./config/eslint-config/.prettierrc.js'),
4+
};

.vscode/extensions.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"recommendations": [
3+
"editorconfig.editorconfig",
4+
"esbenp.prettier-vscode",
5+
"streetsidesoftware.code-spell-checker",
6+
"codezombiech.gitignore",
7+
"aaron-bond.better-comments",
8+
"mikestead.dotenv",
9+
"stylelint.vscode-stylelint"
10+
],
11+
"unwantedRecommendations": [
12+
"nucllear.vscode-extension-auto-import",
13+
"steoates.autoimport"
14+
]
15+
}

0 commit comments

Comments
 (0)