Skip to content

Commit 01a5546

Browse files
authored
Merge pull request #4 from DTStack/feat/devops
Feat/devops
2 parents c3ef199 + 819d93f commit 01a5546

File tree

30 files changed

+1378
-166
lines changed

30 files changed

+1378
-166
lines changed

.czrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "./node_modules/@commitlint/cz-commitlint"
3+
}

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
setup:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Install Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
22+
- uses: pnpm/action-setup@v2
23+
name: Install pnpm
24+
id: pnpm-install
25+
with:
26+
version: 6
27+
run_install: false
28+
29+
- name: Get pnpm version
30+
id: pnpm-version
31+
shell: bash
32+
run: |
33+
echo "PNPM_VERSION=$(pnpm --version)" >> $GITHUB_OUTPUT
34+
35+
- name: Get pnpm store directory
36+
id: pnpm-cache
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
40+
41+
- name: Install dependencies
42+
run: pnpm install
43+
44+
- name: Run Units Test Of Core
45+
run: pnpm core test
46+
47+
- name: Run Prettier Of Core
48+
run: pnpm core prettier
49+
50+
- name: Run Prettier Of Playground
51+
run: pnpm playground prettier
52+
53+
- name: Run check-types Of Core
54+
run: pnpm core check-types

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.lintstagedrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
'*.{js,jsx,less,ts,tsx}': ['prettier --write'],
3+
'*.{ts,tsx}': ['prettier --parser=typescript --write'],
4+
};

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"printWidth": 80,
66
"overrides": [
77
{
8-
"files": ".prettierrc",
8+
"files": "**/.prettierrc",
99
"options": { "parser": "json" }
1010
}
1111
]

commitlint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat',
9+
'fix',
10+
'docs',
11+
'style',
12+
'refactor',
13+
'test',
14+
'build',
15+
'ci',
16+
'chore',
17+
],
18+
],
19+
'scope-case': [0, 'always', 'camel-case'],
20+
'scope-empty': [2, 'never'],
21+
'scope-enum': [2, 'always', ['core', 'playground', 'base']],
22+
},
23+
};

package.json

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,47 @@
11
{
22
"name": "dt-form-renderer",
33
"version": "0.0.1",
4-
"description": "Render Interaction Form by JSON",
5-
"main": "jest.config.js",
4+
"description": "Render Interaction Form Via JSON",
5+
"author": "Hayden",
6+
"homepage": "https://github.com/DTStack/dt-form-renderer#readme",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/DTStack/dt-form-renderer.git"
10+
},
11+
"bugs": {
12+
"url": "https://github.com/DTStack/dt-form-renderer/issues"
13+
},
14+
"scripts": {
15+
"prepare": "husky install",
16+
"start": "pnpm core build && pnpm i && pnpm playground start",
17+
"deploy": "pnpm core build && pnpm i && pnpm playground deploy",
18+
"core": "pnpm --filter ./packages/core",
19+
"playground": "pnpm --filter ./packages/playground"
20+
},
621
"dependencies": {
22+
"@dt-form-renderer/core": "workspace:./packages/core",
723
"antd": "4.24.8",
824
"react": "17.x",
925
"react-dom": "17.x"
1026
},
1127
"devDependencies": {
28+
"@commitlint/cli": "^17.6.3",
29+
"@commitlint/config-conventional": "^17.6.3",
30+
"@commitlint/cz-commitlint": "^17.5.0",
31+
"@swc/core": "^1.2.177",
32+
"@swc/jest": "0.2.24",
1233
"@types/jest": "^28.1.2",
1334
"@types/react": "^17.0.0",
1435
"@types/react-dom": "^17.0.0",
36+
"commitizen": "^4.3.0",
37+
"husky": "^8.0.3",
1538
"jest": "^27.4.3",
16-
"jest-resolve": "^27.4.2",
39+
"jest-environment-jsdom": "^27.4.3",
40+
"jest-resolve": "^27.4.3",
1741
"jest-watch-typeahead": "^1.0.0",
42+
"lint-staged": "^10.0.7",
1843
"prettier": "^2.2.0",
19-
"ts-jest": "^28.0.8",
2044
"typescript": "^4.7.4"
2145
},
22-
"scripts": {
23-
"test": "echo \"Error: no test specified\" && exit 1",
24-
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less}'",
25-
"core": "pnpm --filter ./packages/core",
26-
"playground": "pnpm --filter ./packages/playground",
27-
"build": "pnpm core build",
28-
"start": "pnpm core build && pnpm i && pnpm playground start",
29-
"deploy": "pnpm core build && pnpm i && pnpm playground deploy"
30-
},
31-
"repository": {
32-
"type": "git",
33-
"url": "git+https://github.com/DTStack/dt-form-renderer.git"
34-
},
35-
"author": "Hayden",
36-
"license": "ISC",
37-
"bugs": {
38-
"url": "https://github.com/DTStack/dt-form-renderer/issues"
39-
},
40-
"homepage": "https://github.com/DTStack/dt-form-renderer#readme"
46+
"license": "ISC"
4147
}

packages/core/.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.html
5+
**/package.json
6+
**/lib
7+
**/dist
8+
**/esm
9+
node_modules

packages/core/jest.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
module.exports = {
55
coveragePathIgnorePatterns: ['/node_modules/'],
6-
globals: {
7-
window: {},
8-
},
6+
globals: {},
97
testEnvironment: 'jsdom',
8+
testEnvironmentOptions: {},
109
testPathIgnorePatterns: ['/node_modules/'],
1110
transform: {
12-
'^.+\\.(t|j)sx?$': 'ts-jest',
11+
'^.+\\.(t|j)sx?$': '@swc/jest',
1312
},
1413
testMatch: [
1514
'**/__tests__/**/(*.)+(spec|test).[jt]s?(x)',

0 commit comments

Comments
 (0)