diff --git a/packages/cli/package.json b/packages/cli/package.json index 5a363ae..ec1dbda 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "full-featured-cli", - "version": "1.4.1", + "version": "1.4.2", "description": "", "main": "index.js", "bin": { diff --git a/packages/cli/src/core/dependencies/dependencies-graph/dependenciesGraph.ts b/packages/cli/src/core/dependencies/dependencies-graph/dependenciesGraph.ts index a3fb32a..36a9386 100644 --- a/packages/cli/src/core/dependencies/dependencies-graph/dependenciesGraph.ts +++ b/packages/cli/src/core/dependencies/dependencies-graph/dependenciesGraph.ts @@ -1,8 +1,9 @@ +/* eslint-disable no-extra-semi */ import { PackageInfo } from '../../../types/PackageJson' import { dependenciesType } from '../enums/dependenciesType' import Fuse from 'fuse.js' -import { Graph } from './Graph' +import { Edge, Graph } from './Graph' import { JsonData } from '../../../types/JsonData' import { GraphData } from '../../../types/GraphData' export const DEFAULT_DEPTH = 0 @@ -34,7 +35,7 @@ class DependencyGraph { setPackageDepth(pth: string, depth: number): void { if (this.index.has(pth)) { - (this.packages[this.index.get(pth) as number] as PackageInfo).depth = + ;(this.packages[this.index.get(pth) as number] as PackageInfo).depth = depth } } @@ -55,7 +56,7 @@ class DependencyGraph { version: v.version, dependencies: [] } - ;(edges[idx] as Ed[]).forEach((e) => { + ;(edges[idx] as Edge[]).forEach((e) => { if ( res[v.path] !== undefined && res[v.path]!['dependencies'] !== undefined diff --git a/packages/cli/src/core/dependencies/factory/factory.ts b/packages/cli/src/core/dependencies/factory/factory.ts index 166c792..7cf3b16 100644 --- a/packages/cli/src/core/dependencies/factory/factory.ts +++ b/packages/cli/src/core/dependencies/factory/factory.ts @@ -25,11 +25,11 @@ export class ResolverFactory { switch (pkgManager) { case PackageManagerType.npm: - console.log(loadNpmModules(root, depth), depth) - return new NpmResolver(loadNpmModules(root, depth), depth) + console.log(loadNpmModules(root), depth) + return new NpmResolver(loadNpmModules(root), depth) break case pkgManager === PackageManagerType.pnpm: - return new NpmResolver(loadNpmModules(root, depth), depth) + return new NpmResolver(loadNpmModules(root), depth) break } // 然后根据管理器类型 使用对应的resolver diff --git a/packages/cli/template/.DS_Store b/packages/cli/template/.DS_Store index 3608f38..4e03366 100644 Binary files a/packages/cli/template/.DS_Store and b/packages/cli/template/.DS_Store differ diff --git a/packages/cli/template/vite-react/.commitlintrc.js b/packages/cli/template/vite-react/.commitlintrc.js index 3010f3c..43fd938 100644 --- a/packages/cli/template/vite-react/.commitlintrc.js +++ b/packages/cli/template/vite-react/.commitlintrc.js @@ -1,84 +1,85 @@ export default { - extends: ["./node_modules/commitlint-config-gitmoji", "cz"], - rules: { - "type-empty": [ - 2, - "never", - [ - ":art:", - ":newspaper:", - ":pencil:", - ":memo:", - ":zap:", - ":fire:", - ":books:", - ":bug:", - ":ambulance:", - ":penguin:", - ":apple:", - ":checkered_flag:", - ":robot:", - ":green_ale:", - ":tractor:", - ":recycle:", - ":white_check_mark:", - ":microscope:", - ":green_heart:", - ":lock:", - ":arrow_up:", - ":arrow_down:", - ":fast_forward:", - ":rewind:", - ":rotating_light:", - ":lipstick:", - ":wheelchair:", - ":globe_with_meridians:", - ":construction:", - ":gem:", - ":bookmark:", - ":tada:", - ":loud_sound:", - ":mute:", - ":sparkles:", - ":speech_balloon:", - ":bulb:", - ":construction_worker:", - ":chart_with_upwards_trend:", - ":ribbon:", - ":rocket:", - ":heavy_minus_sign:", - ":heavy_plus_sign:", - ":wrench:", - ":hankey:", - ":leaves:", - ":bank:", - ":whale:", - ":twisted_rightwards_arrows:", - ":pushpin:", - ":busts_in_silhouette:", - ":children_crossing:", - ":iphone:", - ":clown_face:", - ":ok_hand:", - ":boom:", - ":bento:", - ":pencil2:", - ":package:", - ":alien:", - ":truck:", - ":age_facing_up:", - ":busts_in_silhouette:", - ":card_file_box:", - ":loud-sound:", - ":mute:", - ":egg:", - ":see-no-evil:", - ":camera-flash:", - ":alembic:", - ":mag:", - ":wheel-of-dharma:", - ":label:", - ], - ], - "subject-empty": [2, "never"], - }} \ No newline at end of file + extends: ['./node_modules/commitlint-config-gitmoji', 'cz'], + rules: { + 'type-empty': [ + 2, + 'never', + [ + ':art:', + ':newspaper:', + ':pencil:', + ':memo:', + ':zap:', + ':fire:', + ':books:', + ':bug:', + ':ambulance:', + ':penguin:', + ':apple:', + ':checkered_flag:', + ':robot:', + ':green_ale:', + ':tractor:', + ':recycle:', + ':white_check_mark:', + ':microscope:', + ':green_heart:', + ':lock:', + ':arrow_up:', + ':arrow_down:', + ':fast_forward:', + ':rewind:', + ':rotating_light:', + ':lipstick:', + ':wheelchair:', + ':globe_with_meridians:', + ':construction:', + ':gem:', + ':bookmark:', + ':tada:', + ':loud_sound:', + ':mute:', + ':sparkles:', + ':speech_balloon:', + ':bulb:', + ':construction_worker:', + ':chart_with_upwards_trend:', + ':ribbon:', + ':rocket:', + ':heavy_minus_sign:', + ':heavy_plus_sign:', + ':wrench:', + ':hankey:', + ':leaves:', + ':bank:', + ':whale:', + ':twisted_rightwards_arrows:', + ':pushpin:', + ':busts_in_silhouette:', + ':children_crossing:', + ':iphone:', + ':clown_face:', + ':ok_hand:', + ':boom:', + ':bento:', + ':pencil2:', + ':package:', + ':alien:', + ':truck:', + ':age_facing_up:', + ':busts_in_silhouette:', + ':card_file_box:', + ':loud-sound:', + ':mute:', + ':egg:', + ':see-no-evil:', + ':camera-flash:', + ':alembic:', + ':mag:', + ':wheel-of-dharma:', + ':label:' + ] + ], + 'subject-empty': [2, 'never'] + } +} diff --git a/packages/cli/template/vite-react/.eslintrc.cjs b/packages/cli/template/vite-react/.eslintrc.cjs index d6c9537..852bfde 100644 --- a/packages/cli/template/vite-react/.eslintrc.cjs +++ b/packages/cli/template/vite-react/.eslintrc.cjs @@ -4,7 +4,7 @@ module.exports = { extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', + 'plugin:react-hooks/recommended' ], ignorePatterns: ['dist', '.eslintrc.cjs'], parser: '@typescript-eslint/parser', @@ -12,7 +12,16 @@ module.exports = { rules: { 'react-refresh/only-export-components': [ 'warn', - { allowConstantExport: true }, + { allowConstantExport: true } ], - }, + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/promise-function-async': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/strict-boolean-expressions': 'off', + '@typescript-eslint/no-var-requires': 'off', + 'vue/no-v-model-argument': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/prefer-optional-chain': 'off' + } } diff --git a/packages/cli/template/vite-react/.postcssrc.cjs b/packages/cli/template/vite-react/.postcssrc.cjs new file mode 100644 index 0000000..d8a6fb7 --- /dev/null +++ b/packages/cli/template/vite-react/.postcssrc.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwind: {}, + autoprefixer: {} + } +} diff --git a/packages/cli/template/vite-react/package.json b/packages/cli/template/vite-react/package.json index bb8ac68..bc59930 100644 --- a/packages/cli/template/vite-react/package.json +++ b/packages/cli/template/vite-react/package.json @@ -12,8 +12,10 @@ "format": "prettier --write \"./**/*.{html,vue,ts,js,json,md}\"" }, "dependencies": { + "axios": "^1.6.5", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "tailwindcss": "^3.4.3" }, "devDependencies": { "@types/react": "^18.2.66", @@ -21,12 +23,14 @@ "@typescript-eslint/eslint-plugin": "^7.9.0", "@typescript-eslint/parser": "^7.9.0", "@vitejs/plugin-react": "^4.2.1", + "autoprefixer": "^10.4.17", "commitlint-config-gitmoji": "^2.3.1", "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", "full-featured-cz": "^0.0.1-development", "husky": "^9.0.11", + "postcss": "^8.4.38", "prettier": "^3.2.5", "typescript": "^5.2.2", "vite": "^5.2.0", diff --git a/packages/cli/template/vite-react/src/App.tsx b/packages/cli/template/vite-react/src/App.tsx index e30bdb7..d2e51c4 100644 --- a/packages/cli/template/vite-react/src/App.tsx +++ b/packages/cli/template/vite-react/src/App.tsx @@ -1,6 +1,4 @@ import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' import './App.css' import Svg from "com/Svg" function App() { @@ -9,15 +7,9 @@ function App() { return ( <> -
- - Vite logo - - - React logo - -
-

Vite + React

+ + +

Full-Featured React

-
+
+
{{ testVal }}
+ +