Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/preview is too large #65

Merged
merged 6 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/warm-dryers-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'svg-to-component-preview': patch
'svg-to-component-parse': patch
'svg-to-component-cli': patch
---

chore: update dependencies
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# npm exec commitlint -- --edit "$1"
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# npm run lint:ts && npm exec lint-staged
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
],
"devDependencies": {
"@changesets/changelog-git": "^0.2.0",
"@changesets/cli": "^2",
"@commitlint/cli": "^18",
"@commitlint/config-conventional": "^18",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@taoliujun/eslint-config": "^2.1.0",
"@types/jest": "^29.5.11",
"husky": "^8",
"@types/jest": "^29.5.12",
"husky": "^9.0.10",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15",
"lint-staged": "^15.2.2",
"ts-jest": "^29.1.2",
"typescript": "^5"
"typescript": "^5.3.3"
},
"scripts": {
"changelog": "npm exec changeset add",
Expand All @@ -30,8 +30,8 @@
"build:md": "cp -f ./README.zh_CN.md ./README.md",
"lint": "pnpm run -r lint",
"lint:ts": "pnpm run -r lint:ts",
"prepare": "husky install",
"prepare": "husky",
"test": "pnpm run -r test",
"test:coverage": "pnpm run -r test:coverage"
}
}
}
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"chalk": "^4.1.2",
"commander": "^11.1.0",
"commander": "^12.0.0",
"fast-glob": "^3.3.2",
"lodash": "^4.17.21",
"progress": "^2.0.3",
Expand All @@ -47,8 +47,8 @@
},
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/lodash": "^4.14.195",
"@types/node": "^20",
"@types/lodash": "^4.14.202",
"@types/node": "^20.11.16",
"@types/progress": "^2.0.7"
}
}
8 changes: 4 additions & 4 deletions packages/parse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"build:md": "cp -f ./README.zh_CN.md ./README.md"
},
"dependencies": {
"fast-xml-parser": "^4.2.2",
"fast-xml-parser": "^4.3.4",
"lodash": "^4.17.21",
"prettier": "^2.8.8"
"prettier": "^3.2.5"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/lodash": "^4.14.195",
"@types/node": "^20.2.5",
"@types/lodash": "^4.14.202",
"@types/node": "^20.11.16",
"@types/prettier": "^2.7.3"
}
}
5 changes: 5 additions & 0 deletions packages/parse/src/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateReact } from '.';

generateReact('Test1', '<svg></svg>').then((res) => {
console.log(res);

Check warning on line 4 in packages/parse/src/test.ts

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
});
2 changes: 1 addition & 1 deletion packages/preview/.browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ chrome > 60
ios >= 11

[development]
last 2 chrome versions
last 10 chrome versions
8 changes: 6 additions & 2 deletions packages/preview/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const path = require('path');

const PROJECT_PATH = path.resolve(__dirname);

module.exports = {
root: true,
extends: ['@taoliujun/eslint-config/react'],
Expand All @@ -7,15 +11,15 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['/config/**/*'],
devDependencies: [path.resolve(PROJECT_PATH, './config/**/*')],
},
],
'react/display-name': ['off'],
},

overrides: [
{
files: ['./config/**/*.ts'],
files: ['./config/**/*'],
rules: {
'max-lines-per-function': ['off'],
'no-console': ['off'],
Expand Down
75 changes: 38 additions & 37 deletions packages/preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,58 @@
"test": "pnpm jest",
"test:coverage": "pnpm jest --config=jest.coverage.config.js",
"clean": "rm -rf lib/",
"start": "NODE_ENV=development NODE_OPTIONS='--loader ts-node/esm' webpack serve --config ./config/webpack.config.ts --progress",
"start": "NODE_ENV=development NODE_OPTIONS='-r ts-node/register' webpack serve --config ./config/webpack.config.ts --progress",
"build": "pnpm run build:script && pnpm run build:md",
"build:script": "cd script && tsc",
"build:md": "cp -f ./README.zh_CN.md ./README.md"
},
"dependencies": {
"@babel/core": "^7.22.10",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@tsconfig/create-react-app": "^2.0.1",
"@babel/core": "^7.23.9",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@tsconfig/create-react-app": "^2.0.2",
"@tsconfig/node20": "^20.1.2",
"@umijs/babel-preset-umi": "^4.0.75",
"ahooks": "^3.7.8",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"@types/lodash": "^4.14.202",
"@types/node": "^20.11.16",
"@types/react": "^18.2.55",
"@types/react-color": "^3.0.11",
"@types/react-dom": "^18.2.18",
"@types/webpack": "^5.28.5",
"@types/webpack-env": "^1.18.4",
"@umijs/babel-preset-umi": "^4.1.1",
"ahooks": "^3.7.10",
"autoprefixer": "^10.4.17",
"babel-loader": "^9.1.3",
"babel-preset-react-app": "^10.0.1",
"chalk": "^4.1.2",
"classnames": "^2.3.2",
"core-js": "^3.32.0",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"html-webpack-plugin": "^5.5.1",
"classnames": "^2.5.1",
"core-js": "^3.35.1",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^6.0.0",
"html-webpack-plugin": "^5.6.0",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"less-loader": "^12.2.0",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.7.6",
"postcss": "^8.4.24",
"postcss-loader": "^7.3.2",
"postcss-preset-env": "^9.1.1",
"mini-css-extract-plugin": "^2.8.0",
"node": "^21.6.1",
"postcss": "^8.4.34",
"postcss-loader": "^8.1.0",
"postcss-preset-env": "^9.3.0",
"postcss-px-to-viewport": "^1.1.1",
"prettier-plugin-tailwindcss": "^0.4",
"prettier-plugin-tailwindcss": "^0.5.11",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
"react-refresh": "^0.14.0",
"react-resizable-panels": "^1.0.9",
"react-router-dom": "^6.15.0",
"style-loader": "^3.3.3",
"tailwindcss": "^3.3.2",
"terser-webpack-plugin": "^5.3.9",
"ts-node": "^10.9.1",
"typescript": "^5.1.3",
"webpack": "^5.85.0",
"webpack-cli": "^5.1.3",
"webpack-dev-server": "^4.15.0",
"webpack-plugin-noop-ts": "^2.1.6",
"@types/lodash": "^4.14.195",
"@types/node": "^20.2.5",
"@types/react": "^18.2.8",
"@types/react-color": "^3.0.6",
"@types/react-dom": "^18.2.4",
"@types/webpack": "^5.28.1",
"@types/webpack-env": "^1.18.4"
"react-resizable-panels": "^2.0.3",
"react-router-dom": "^6.22.0",
"style-loader": "^3.3.4",
"tailwindcss": "^3.4.1",
"terser-webpack-plugin": "^5.3.10",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-plugin-noop-ts": "^2.1.6"
}
}
4 changes: 3 additions & 1 deletion packages/preview/src/appConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { pageConfig } from './pageConfig';

/** 应用配置 */
export const appConfig = {
title: 'svg preview',
title: pageConfig.title,
/** 路由方式 browser 或 hash */
routeType: 'browser',
};
3 changes: 2 additions & 1 deletion packages/preview/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"types": [
"webpack-env",
"jest"
"jest",
"node"
],
},
"ts-node": {
Expand Down
Loading
Loading