Skip to content

Commit 759e0af

Browse files
committed
modify github actions & test
1 parent 31d48dd commit 759e0af

14 files changed

+4718
-2773
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Config helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# We recommend you to keep these unchanged
9+
indent_style = space
10+
indent_size = 4
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
quote_type = single
16+
max_line_length = 120
17+
18+
[*.md]
19+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Describe the big picture of your changes here to communicate to the maintainers
22

33
The best way to propose a feature is to open an issue first and discuss your ideas there before implementing them.
44

5-
Always follow the [contribution guidelines](https://github.com/imagine10255/acrool-react-grid/blob/master/CONTRIBUTING.md) when submitting a pull request.
5+
Always follow the [contribution guidelines](https://github.com/imagine10255/acrool-react-table/blob/master/CONTRIBUTING.md) when submitting a pull request.

.github/workflows/deploy.yml renamed to .github/workflows/test-on-release.yml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
1-
name: Deploy Storybook to Pages
1+
name: Test on Release
22

33
on:
44
push:
55
branches:
6-
- storybook
6+
- main
7+
- develop
78
tags:
89
- 'v[0-9]+.[0-9]+.[0-9]+'
10+
pull_request:
11+
branches:
12+
- main
13+
- develop
914

1015
jobs:
16+
test:
17+
if: github.event_name == 'push' || github.event_name == 'pull_request'
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '20'
27+
cache: 'yarn'
28+
29+
- name: Install dependencies
30+
run: yarn install --frozen-lockfile
31+
32+
- name: Run tests
33+
run: yarn test
34+
1135
deploy:
36+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
37+
needs: test
1238
runs-on: ubuntu-latest
1339

1440
defaults:
@@ -19,16 +45,19 @@ jobs:
1945
- name: Checkout repository
2046
uses: actions/checkout@v3
2147

48+
- name: Wait for npm publish
49+
run: sleep 30 # 延遲30秒,可根據實際情況調整
50+
2251
- name: Set up Node.js
2352
uses: actions/setup-node@v3
2453
with:
25-
node-version: '18'
54+
node-version: '20'
2655

2756
- name: Replace local links with actual versions
2857
run: |
2958
sed -i 's#"@acrool/react-dropdown": "link:.."#"@acrool/react-dropdown": "latest"#' package.json
30-
sed -i 's#"react": "link:../node_modules/react"#"react": "^18.0.0"#' package.json
31-
sed -i 's#"react-dom": "link:../node_modules/react-dom"#"react-dom": "^18.0.0"#' package.json
59+
sed -i 's#"react": "link:../node_modules/react"#"react": "^19.1.0"#' package.json
60+
sed -i 's#"react-dom": "link:../node_modules/react-dom"#"react-dom": "^19.1.0"#' package.json
3261
3362
- name: Install dependencies
3463
run: yarn install

__tests__/utils.spec.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
2+
import react from 'eslint-plugin-react';
3+
import tsparser from '@typescript-eslint/parser';
4+
import stylisticTs from '@stylistic/eslint-plugin-ts';
5+
6+
7+
export default [
8+
{
9+
ignores: [
10+
],
11+
},
12+
{
13+
files: ["**/*.ts", "**/*.tsx"],
14+
15+
languageOptions: {
16+
parser: tsparser,
17+
},
18+
19+
plugins: {
20+
"simple-import-sort": simpleImportSort,
21+
'@stylistic/ts': stylisticTs,
22+
react
23+
},
24+
25+
rules: {
26+
quotes: ["warn", "single"],
27+
"simple-import-sort/imports": "warn",
28+
semi: ["warn", "always"],
29+
indent: ["warn", 4],
30+
"object-curly-spacing": ["warn", "never"],
31+
"jsx-a11y/alt-text": "off",
32+
"jsx-a11y/anchor-is-valid": "off",
33+
"import/first": "off",
34+
"import/no-anonymous-default-export": "off",
35+
"react-hooks/exhaustive-deps": "off",
36+
"no-useless-escape": "off",
37+
"react/jsx-boolean-value": "warn",
38+
"@typescript-eslint/no-unused-vars": "off",
39+
"@stylistic/ts/member-delimiter-style": ["warn", {
40+
multiline: {
41+
delimiter: "comma",
42+
requireLast: true,
43+
},
44+
singleline: {
45+
delimiter: "comma",
46+
requireLast: false,
47+
},
48+
overrides: {
49+
interface: {
50+
multiline: {
51+
delimiter: "none",
52+
requireLast: false,
53+
},
54+
},
55+
},
56+
}],
57+
},
58+
},
59+
];

example/package.json

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
{
2-
"name": "example",
3-
"private": true,
4-
"version": "0.0.0",
5-
"type": "module",
6-
"scripts": {
7-
"storybook": "storybook dev -p 6006",
8-
"build-storybook": "storybook build",
9-
"pages:dev": "wrangler pages dev --proxy 3000 -- yarn dev",
10-
"pages:deploy": "NODE_VERSION=18 yarn build-storybook && wrangler pages deploy ./storybook-static --project-name=acrool-react-dropdown --branch main"
11-
},
12-
"resolutions": {
13-
"styled-components": "6.1.17"
14-
},
15-
"dependencies": {
16-
"@acrool/js-utils": "^3.2.15",
17-
"@acrool/react-grid": "^6.0.2",
18-
"@acrool/react-picker": "1.0.1-alpha.0",
19-
"@acrool/react-dropdown": "link:..",
20-
"@swc/core": "^1.3.68",
21-
"@swc/plugin-styled-components": "6.8.2",
22-
"@types/dom-to-image": "^2.6.7",
23-
"dom-to-image": "^2.6.0",
24-
"react": "link:../node_modules/react",
25-
"react-dom": "link:../node_modules/react-dom",
26-
"framer-motion": "12.7.4",
27-
"styled-components": "6.1.17",
28-
"sass": "^1.77.1",
29-
"@chromatic-com/storybook": "^1.5.0",
30-
"@emotion/is-prop-valid": "^1.2.2",
31-
"@storybook/addon-essentials": "^8.1.10",
32-
"@storybook/addon-interactions": "^8.1.10",
33-
"@storybook/addon-links": "^8.1.10",
34-
"@storybook/addon-onboarding": "^8.1.10",
35-
"@storybook/blocks": "^8.1.10",
36-
"@storybook/react": "^8.1.10",
37-
"@storybook/react-vite": "^8.1.10",
38-
"@storybook/test": "^8.1.10",
39-
"@types/react": "^19.1.2",
40-
"@types/react-dom": "^19.1.2",
41-
"@vitejs/plugin-react-swc": "^3.0.0",
42-
"storybook": "^8.1.10",
43-
"storybook-dark-mode": "^4.0.2",
44-
"typescript": "^5.2.2",
45-
"vite": "^5.2.0",
46-
"vite-plugin-svgr": "^4.2.0",
47-
"wrangler": "3.26.0"
48-
}
2+
"name": "example",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"storybook": "storybook dev -p 6006",
8+
"build-storybook": "storybook build",
9+
"pages:dev": "wrangler pages dev --proxy 3000 -- yarn dev",
10+
"pages:deploy": "NODE_VERSION=20 yarn build-storybook && wrangler pages deploy ./storybook-static --project-name=acrool-react-dropdown --branch main"
11+
},
12+
"resolutions": {
13+
"styled-components": "6.1.17"
14+
},
15+
"dependencies": {
16+
"@acrool/js-utils": "^3.2.20",
17+
"@acrool/react-grid": "^6.0.5",
18+
"@acrool/react-picker": "1.1.3",
19+
"@acrool/react-dropdown": "link:..",
20+
"@chromatic-com/storybook": "^1.5.0",
21+
"@emotion/is-prop-valid": "^1.2.2",
22+
"@storybook/addon-essentials": "^8.1.10",
23+
"@storybook/addon-interactions": "^8.1.10",
24+
"@storybook/addon-links": "^8.1.10",
25+
"@storybook/addon-onboarding": "^8.1.10",
26+
"@storybook/blocks": "^8.1.10",
27+
"@storybook/react": "^8.1.10",
28+
"@storybook/react-vite": "^8.1.10",
29+
"@storybook/test": "^8.1.10",
30+
"@swc/core": "^1.3.68",
31+
"@swc/plugin-styled-components": "^6.8.2",
32+
"@types/dom-to-image": "^2.6.7",
33+
"@types/react": "^19.1.2",
34+
"@types/react-dom": "^19.1.2",
35+
"@vitejs/plugin-react-swc": "^3.0.0",
36+
"dom-to-image": "^2.6.0",
37+
"react": "link:../node_modules/react",
38+
"react-dom": "link:../node_modules/react-dom",
39+
"sass": "^1.77.1",
40+
"storybook": "^8.1.10",
41+
"storybook-dark-mode": "^4.0.2",
42+
"styled-components": "6.1.17",
43+
"typescript": "^5.2.2",
44+
"vite": "^6.3.4",
45+
"vite-plugin-svgr": "^4.2.0",
46+
"wrangler": "4.14.4"
47+
}
4948
}

0 commit comments

Comments
 (0)