Skip to content

Commit

Permalink
refactor: generate an application through a configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed May 27, 2024
1 parent 5d8246b commit f5f2273
Show file tree
Hide file tree
Showing 207 changed files with 2,480 additions and 4,104 deletions.
File renamed without changes.
29 changes: 29 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
env: {
node: true,
es6: true,
},
extends: [require.resolve('@tomjs/eslint/node')],
rules: {
'n/no-missing-import': 'off',
'n/no-unpublished-import': 'off',
'n/no-unpublished-require': 'off',
'n/no-process-exit': 'off',
'n/no-extraneous-require': 'off',
},
overrides: [
{
files: ['*.vue'],
extends: [require.resolve('@tomjs/eslint/vue')],
rules: {
'vue/max-attributes-per-line': 'off',
'vue/html-self-closing': 'off',
'vue/singleline-html-element-content-newline': 'off',
},
},
{
files: ['*.tsx'],
extends: [require.resolve('@tomjs/eslint/react')],
},
],
};
13 changes: 0 additions & 13 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ web_modules
tsconfig.tsbuildinfo

# environment
*.local
.env

# macOS
.DS_Store
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
'*.{js,cjs,ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.{js,cjs,mjs,ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.{json,md}': ['prettier --write'],
'*.vue': ['eslint --fix', 'stylelint --fix', 'prettier --write'],
'*.{css,scss,less,html}': ['stylelint --fix', 'prettier --write'],
Expand Down
6 changes: 0 additions & 6 deletions .lintstagedrc.js

This file was deleted.

File renamed without changes.
14 changes: 7 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug Create App",
"name": "Debug CLI",
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\dist\\index.mjs",
"outFiles": [
"${workspaceFolder}/**/*.js",
"${workspaceFolder}/**/*.mjs"
"runtimeExecutable": "tsx",
"runtimeArgs": [
"-r",
"dotenv/config"
],
"console": "integratedTerminal",
"preLaunchTask": "${defaultBuildTask}",
"program": "${workspaceFolder}\\src\\index.ts",
"console": "integratedTerminal"
}
]
}
36 changes: 0 additions & 36 deletions .vscode/tasks.json

This file was deleted.

41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@tomjs/create-app",
"type": "module",
"version": "0.15.0",
"description": "create tomjs web app",
"keywords": [
Expand All @@ -23,13 +24,12 @@
"email": "[email protected]"
},
"license": "MIT",
"main": "dist/index.mjs",
"bin": {
"create-app": "dist/index.mjs"
"create-app": "dist/index.js"
},
"files": [
"dist",
"template-*/**"
"template/**"
],
"engines": {
"node": ">=18"
Expand All @@ -44,41 +44,46 @@
},
"scripts": {
"dev": "tsup --watch",
"debug": "cross-env VSCODE_DEBUG=1 tsup --watch",
"debug": "tsx -r dotenv/config src/index.ts",
"build": "tsup --minify",
"lint": "run-s lint:eslint lint:stylelint lint:prettier",
"lint:eslint": "eslint \"{src,template-*}/**/*.{js,cjs,ts}\" *.{js,cjs,ts} --fix --cache",
"lint:stylelint": "stylelint \"template-*/**/*.{css,scss,less,vue,html}\" --fix --cache",
"lint:prettier": "prettier --write \"{src,template-*}/**/*.{js,cjs,ts,json,md}\" *.{js,cjs,ts,json,md}",
"lint:eslint": "eslint \"{src,templates}/**/*.{js,cjs,ts,tsx,vue}\" *.{js,cjs,ts} --fix --cache",
"lint:stylelint": "stylelint \"templates/**/*.{css,scss,less,vue,html}\" --fix --cache",
"lint:prettier": "prettier --write .",
"prepare": "husky"
},
"dependencies": {
"kolorist": "^1.8.0",
"@tomjs/logger": "^1.0.0",
"@tomjs/node": "^2.1.0",
"chalk": "^5.3.0",
"dayjs": "^1.11.11",
"execa": "^9.1.0",
"inquirer": "^9.2.22",
"lodash-es": "^4.17.21",
"minimist": "^1.2.8",
"prompts": "^2.4.2",
"shelljs": "^0.8.5"
"meow": "^13.2.0"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@tomjs/commitlint": "^3.0.0",
"@tomjs/eslint": "^2.3.0",
"@tomjs/prettier": "^1.3.0",
"@tomjs/stylelint": "^2.3.0",
"@tomjs/tsconfig": "^1.5.0",
"@tomjs/commitlint": "^3.2.0",
"@tomjs/eslint": "^3.0.1",
"@tomjs/prettier": "^1.4.1",
"@tomjs/stylelint": "^2.5.0",
"@tomjs/tsconfig": "^1.6.0",
"@types/inquirer": "^9.0.7",
"@types/lodash-es": "^4.17.12",
"@types/minimist": "^1.2.5",
"@types/node": "^18.19.33",
"@types/prompts": "^2.4.9",
"@types/shelljs": "^0.8.15",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"stylelint": "^16.5.0",
"tsup": "^8.0.2",
"tsx": "^4.10.5",
"type-fest": "^4.18.2",
"typescript": "~5.4.5"
}
}
Loading

0 comments on commit f5f2273

Please sign in to comment.