Skip to content

Commit db533c7

Browse files
authored
Merge pull request #502 from liuliu-dev/update-deps-ci-fix-errors
bump deps, fix lint, errors, ci
2 parents 6bd0dc0 + 218f87d commit db533c7

25 files changed

Lines changed: 10935 additions & 10508 deletions

.eslintrc.js

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,35 @@
11
module.exports = {
22
env: {
3+
browser: true,
4+
es2021: true,
35
node: true,
4-
"jest/globals": true,
6+
jest: true,
57
},
68
extends: [
7-
"airbnb-base",
8-
"airbnb-typescript/base",
9-
"plugin:@typescript-eslint/recommended",
9+
"eslint:recommended",
10+
"@typescript-eslint/recommended",
11+
"plugin:react/recommended",
12+
"plugin:react-hooks/recommended",
1013
"prettier",
11-
"plugin:jest-dom/recommended",
12-
"plugin:testing-library/react",
13-
"plugin:css-modules/recommended",
1414
],
1515
parser: "@typescript-eslint/parser",
1616
parserOptions: {
1717
ecmaFeatures: {
1818
jsx: true,
1919
},
20-
project: "./tsconfig.json",
20+
ecmaVersion: "latest",
21+
sourceType: "module",
22+
},
23+
plugins: ["react", "react-hooks", "@typescript-eslint"],
24+
settings: {
25+
react: {
26+
version: "detect",
27+
},
2128
},
22-
plugins: [
23-
"@typescript-eslint",
24-
"jest",
25-
"jest-dom",
26-
"testing-library",
27-
"css-modules",
28-
],
2929
rules: {
30-
"@typescript-eslint/no-unused-vars": [
31-
"error",
32-
{
33-
argsIgnorePattern: "^_",
34-
varsIgnorePattern: "^_",
35-
},
36-
],
37-
"@typescript-eslint/no-use-before-define": [
38-
"error",
39-
{
40-
functions: false,
41-
classes: false,
42-
},
43-
],
44-
"import/prefer-default-export": "off",
45-
"no-use-before-define": [
46-
"error",
47-
{
48-
functions: false,
49-
classes: false,
50-
},
51-
],
30+
"react/react-in-jsx-scope": "off",
31+
"react/prop-types": "off",
32+
"no-unused-vars": "off", // Turn off base rule for TypeScript
33+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
5234
},
53-
overrides: [
54-
{
55-
files: ["*test.ts?(x)"],
56-
rules: {
57-
"@typescript-eslint/no-var-requires": "off",
58-
},
59-
},
60-
],
6135
};

.github/workflows/github-ci.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
name: Run CI on commit-graph
22
on:
33
pull_request:
4-
paths:
5-
- "/"
4+
push:
5+
branches: [main]
66
workflow_dispatch:
77

88
jobs:
99
ci:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
13+
uses: actions/checkout@v4
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
1516
with:
16-
node-version: "18"
17-
- name: Run the "npm ci" command
18-
run: npm ci
19-
- name: Run the "npm run build" command
20-
run: npm run build
21-
- name: Run the "npm test" command
22-
run: npm test
17+
node-version: "22"
18+
- name: Enable Corepack
19+
run: corepack enable
20+
- name: Install dependencies
21+
run: yarn install --immutable
22+
- name: Lint
23+
run: yarn lint
24+
- name: Type check
25+
run: yarn compile
26+
- name: Test
27+
run: yarn test
28+
- name: Build
29+
run: yarn build

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# dependencies
22
/node_modules
33

4+
# Yarn Berry
5+
.yarn/*
6+
!.yarn/patches
7+
!.yarn/plugins
8+
!.yarn/releases
9+
!.yarn/sdks
10+
!.yarn/versions
11+
412
# next.js
513
/.next/
614
.env.*.local
@@ -9,6 +17,9 @@
917
# rollup cache
1018
/.rollup.cache/
1119

20+
# TypeScript build cache
21+
tsconfig.tsbuildinfo
22+
1223
#logs
1324
./storybook.log
1425

.storybook/main.ts

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
1-
import type { StorybookConfig } from "@storybook/nextjs";
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
2+
23
const config: StorybookConfig = {
34
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
5+
addons: ["@storybook/addon-webpack5-compiler-swc"],
46
framework: {
5-
name: "@storybook/nextjs",
7+
name: "@storybook/react-webpack5",
68
options: {},
79
},
8-
docs: {
9-
autodocs: "tag",
10+
webpackFinal: async config => {
11+
// Remove ALL existing CSS rules (including Storybook's implicit one)
12+
config.module!.rules = (config.module?.rules ?? []).filter(rule => {
13+
if (!rule || typeof rule !== "object") return true;
14+
if (rule.test instanceof RegExp && rule.test.test("test.css")) {
15+
return false;
16+
}
17+
return true;
18+
});
19+
20+
// Add our own CSS rules with proper CSS modules support
21+
config.module!.rules.push(
22+
{
23+
test: /\.css$/,
24+
exclude: /\.module\.css$/,
25+
sideEffects: true,
26+
use: ["style-loader", "css-loader"],
27+
},
28+
{
29+
test: /\.module\.css$/,
30+
use: [
31+
"style-loader",
32+
{
33+
loader: "css-loader",
34+
options: {
35+
importLoaders: 1,
36+
modules: {
37+
localIdentName: "[folder]_[local]__[hash:base64:5]",
38+
namedExport: false,
39+
},
40+
},
41+
},
42+
],
43+
},
44+
);
45+
return config;
1046
},
1147
};
1248
export default config;

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

eslint.config.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const js = require("@eslint/js");
2+
const tseslint = require("typescript-eslint");
3+
const react = require("eslint-plugin-react");
4+
5+
module.exports = tseslint.config(
6+
js.configs.recommended,
7+
...tseslint.configs.recommended,
8+
{
9+
files: ["src/**/*.{ts,tsx}"],
10+
plugins: {
11+
react,
12+
},
13+
languageOptions: {
14+
ecmaVersion: "latest",
15+
sourceType: "module",
16+
parserOptions: {
17+
ecmaFeatures: {
18+
jsx: true,
19+
},
20+
},
21+
},
22+
settings: {
23+
react: {
24+
version: "detect",
25+
},
26+
},
27+
rules: {
28+
"react/react-in-jsx-scope": "off",
29+
"react/prop-types": "off",
30+
"@typescript-eslint/ban-ts-comment": "off",
31+
"@typescript-eslint/no-unused-vars": [
32+
"error",
33+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
34+
],
35+
},
36+
},
37+
{
38+
ignores: ["dist/", "node_modules/", "storybook-static/"],
39+
},
40+
);

package.json

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,69 +21,76 @@
2121
"react"
2222
],
2323
"scripts": {
24-
"dev": "next dev",
2524
"build": "rollup -c --bundleConfigAsCjs",
26-
"start": "next start",
27-
"lint": "next lint",
28-
"storybook": "storybook dev -p 6006",
25+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
26+
"compile": "tsc --noEmit",
27+
"lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
28+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css}\"",
29+
"storybook": "storybook dev",
2930
"build-storybook": "storybook build",
30-
"test": "jest",
31+
"test": "jest --testPathIgnorePatterns=\"computePosition\\.test\\.ts\" --passWithNoTests",
3132
"yalc:publish": "npm run build && yalc publish",
3233
"yalc:push": "npm run build && yalc push",
33-
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css}\"",
34-
"ci": "npm-run-all prettier lint test build",
34+
"ci": "npm-run-all lint:fix lint test build",
3535
"deploy-storybook": "gh-pages -d storybook-static"
3636
},
3737
"jest": {
38-
"transform": {
39-
".(ts|tsx)": "ts-jest"
40-
},
38+
"preset": "ts-jest",
39+
"testEnvironment": "jsdom",
40+
"setupFilesAfterEnv": [
41+
"@testing-library/jest-dom"
42+
],
4143
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
4244
"moduleFileExtensions": [
4345
"ts",
4446
"tsx",
4547
"js"
46-
]
48+
],
49+
"moduleNameMapper": {
50+
"\\.(css|less|scss)$": "identity-obj-proxy"
51+
}
4752
},
4853
"dependencies": {
49-
"@dolthub/react-components": "^0.2.7",
50-
"@dolthub/react-hooks": "^0.1.7",
51-
"@dolthub/web-utils": "^0.1.5",
52-
"@rollup/plugin-typescript": "12.3.0",
53-
"classnames": "^2.3.2",
5454
"react": ">=18.0.0",
55-
"react-copy-to-clipboard": "^5.1.0",
5655
"react-dom": ">=18.0.0",
57-
"react-icons": "^5.3.0",
56+
"react-icons": "^5.6.0",
5857
"react-infinite-scroller": "^1.2.6",
59-
"react-tooltip": "^5.26.3",
58+
"react-tooltip": "^5.30.0",
6059
"reactjs-popup": "^2.0.6"
6160
},
6261
"devDependencies": {
63-
"@rollup/plugin-commonjs": "^29.0.0",
64-
"@rollup/plugin-node-resolve": "^16.0.0",
62+
"@eslint/js": "^10.0.1",
63+
"@rollup/plugin-commonjs": "^29.0.2",
64+
"@rollup/plugin-node-resolve": "^16.0.3",
6565
"@rollup/plugin-terser": "^0.4.4",
66-
"@storybook/nextjs": "^8.0.0",
67-
"@storybook/react": "^8.0.0",
68-
"@types/react": "^18.2.57",
66+
"@rollup/plugin-typescript": "12.3.0",
67+
"@storybook/addon-webpack5-compiler-swc": "^4.0.3",
68+
"@storybook/react": "^10",
69+
"@storybook/react-webpack5": "^10",
70+
"@testing-library/dom": "^10.4.1",
71+
"@testing-library/jest-dom": "^6.9.1",
72+
"@testing-library/react": "^16.3.2",
73+
"@types/jest": "^30.0.0",
74+
"@types/react": "^19.2.14",
6975
"@types/react-infinite-scroller": "^1.2.5",
70-
"@typescript-eslint/eslint-plugin": "8.32.1",
71-
"@typescript-eslint/parser": "8.53.0",
72-
"eslint-config-airbnb-base": "latest",
73-
"eslint-config-airbnb-typescript": "latest",
74-
"eslint-config-prettier": "^10.0.1",
75-
"gh-pages": "^6.1.1",
76-
"jest": "^30.2.0",
77-
"next": "^15.1.7",
76+
"eslint": "^10",
77+
"eslint-config-prettier": "^10.1.8",
78+
"eslint-plugin-react": "^7.37.5",
79+
"gh-pages": "^6.3.0",
80+
"identity-obj-proxy": "^3.0.0",
81+
"jest": "^30.3.0",
82+
"jest-environment-jsdom": "^30.3.0",
7883
"npm-run-all": "^4.1.5",
79-
"prettier": "^3.2.5",
80-
"rollup": "^4.12.0",
81-
"rollup-plugin-dts": "^6.1.0",
84+
"postcss": "^8.5.8",
85+
"prettier": "^3.8.1",
86+
"rollup": "^4.60.0",
87+
"rollup-plugin-dts": "^6.4.1",
8288
"rollup-plugin-peer-deps-external": "^2.2.4",
8389
"rollup-plugin-postcss": "^4.0.2",
84-
"storybook": "8.6.15",
85-
"ts-jest": "^29.1.2",
90+
"storybook": "^10",
91+
"ts-jest": "^29.4.6",
8692
"typescript": "^5.4.2",
93+
"typescript-eslint": "^8.57.2",
8794
"yalc": "^1.0.0-pre.53"
8895
},
8996
"peerDependencies": {
@@ -93,8 +100,5 @@
93100
"main": "dist/cjs/index.js",
94101
"module": "dist/esm/index.js",
95102
"types": "dist/index.d.ts",
96-
"resolutions": {
97-
"cross-spawn": "^7.0.5",
98-
"wrap-ansi/string-width": "^4.2.0"
99-
}
103+
"packageManager": "yarn@4.13.0"
100104
}

0 commit comments

Comments
 (0)