Skip to content

Commit

Permalink
✨ feat: recently change
Browse files Browse the repository at this point in the history
  • Loading branch information
liliphoenix committed Jun 26, 2024
1 parent 13b828f commit 1fc8d34
Show file tree
Hide file tree
Showing 32 changed files with 602 additions and 567 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "full-featured-cli",
"version": "1.4.1",
"version": "1.4.2",
"description": "",
"main": "index.js",
"bin": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}
}
Expand All @@ -55,7 +56,7 @@ class DependencyGraph {
version: v.version,
dependencies: []
}
;(edges[idx] as Ed<dependenciesType>[]).forEach((e) => {
;(edges[idx] as Edge<dependenciesType>[]).forEach((e) => {
if (
res[v.path] !== undefined &&
res[v.path]!['dependencies'] !== undefined
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/core/dependencies/factory/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified packages/cli/template/.DS_Store
Binary file not shown.
167 changes: 84 additions & 83 deletions packages/cli/template/vite-react/.commitlintrc.js
Original file line number Diff line number Diff line change
@@ -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"],
}}
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']
}
}
15 changes: 12 additions & 3 deletions packages/cli/template/vite-react/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@ 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',
plugins: ['react-refresh'],
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'
}
}
6 changes: 6 additions & 0 deletions packages/cli/template/vite-react/.postcssrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwind: {},
autoprefixer: {}
}
}
6 changes: 5 additions & 1 deletion packages/cli/template/vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@
"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",
"@types/react-dom": "^18.2.22",
"@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",
Expand Down
17 changes: 4 additions & 13 deletions packages/cli/template/vite-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -9,15 +7,9 @@ function App() {

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<Svg name='vite-test1'></Svg>
<Svg name='vite-test2'></Svg>
<h1>Full-Featured React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
Expand All @@ -29,8 +21,7 @@ function App() {
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
<Svg name='vite-test1'></Svg>
<Svg name='vite-test2'></Svg>

</>
)
}
Expand Down
58 changes: 58 additions & 0 deletions packages/cli/template/vite-react/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import type { dataType } from 'types/axios'
import { Request } from './request'
/*
* @params Baseurl
* @params timeout 延时
* @params interceptors 传入的拦截器
* @params useDefaultReq 是否使用默认的请求拦截器
* @params interceptors 是否使用默认的相应拦截器
*/

const requestInt = new Request({
baseURL: '/api',
timeout: 3000
})

const request = (config: any): any => {
return requestInt.request(config)
}

/*
* get方法
* @params url
* @params method 传入的参数
* @params params or query 传入的参数
*/

export const getWeather = (params = {}): dataType => {
return request({
url: '/456456/weather/v001/now',
method: 'get',
params,
selfHeader: {
'X-APISpace-Token ': 'n30k9jlfyucfa7k4ogr58xeuxjb3ghqh'
}
})
}

/*
* post方法
* @params url
* @params method 传入的参数
* @params params or query 传入的参数
*/

export const getNumberIP = (data = {}): dataType => {
return request({
url: '/teladress/teladress',
method: 'post',
data,
selfHeader: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-APISpace-Token ': 'n30k9jlfyucfa7k4ogr58xeuxjb3ghqh'
}
})
}
Loading

0 comments on commit 1fc8d34

Please sign in to comment.