@tomjs/create-app 1.7.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -21
- package/README.zh_CN.md +14 -21
- package/dist/index.js +9 -22
- package/package.json +49 -52
- package/templates/{base/core → config/base}/.editorconfig +0 -4
- package/templates/config/base/.vscode/settings.json +50 -0
- package/templates/{base/core/_gitignore → config/base/_.gitignore} +1 -3
- package/templates/config/base/_commitlint.config.mjs +3 -0
- package/templates/config/base/_eslint.config.mjs +8 -0
- package/templates/config/base/lint-staged.config.mjs +3 -0
- package/templates/config/base/package.json +24 -0
- package/templates/config/base/pnpm-workspace.yaml +3 -0
- package/templates/config/base/simple-git-hooks.mjs +4 -0
- package/templates/{vscode → config/public}/LICENSE +1 -1
- package/templates/config/public/README.md +20 -0
- package/templates/config/public/README.zh_CN.md +20 -0
- package/templates/config/public/package.json +10 -0
- package/templates/config/style/lint-staged.config.mjs +7 -0
- package/templates/config/style/package.json +12 -0
- package/templates/config/style/stylelint.config.mjs +3 -0
- package/templates/{base/electron → electron-react}/.vscode/launch.json +23 -3
- package/templates/electron-react/.vscode/tasks.json +67 -0
- package/templates/electron-react/README.md +1 -1
- package/templates/electron-react/_eslint.config.mjs +8 -0
- package/templates/electron-react/electron/main/index.ts +71 -40
- package/templates/electron-react/electron/preload/index.ts +4 -0
- package/templates/electron-react/index.html +1 -2
- package/templates/electron-react/package.json +35 -1
- package/templates/electron-react/pnpm-workspace.yaml +6 -0
- package/templates/electron-react/src/App.css +6 -2
- package/templates/electron-react/src/App.tsx +12 -5
- package/templates/electron-react/src/index.css +14 -9
- package/templates/electron-react/tsconfig.json +9 -0
- package/templates/{base/electron → electron-react}/tsconfig.node.json +1 -1
- package/templates/electron-react/vite.config.ts +9 -22
- package/templates/electron-vue/.vscode/launch.json +48 -0
- package/templates/electron-vue/.vscode/tasks.json +67 -0
- package/templates/electron-vue/README.md +1 -1
- package/templates/electron-vue/_eslint.config.mjs +8 -0
- package/templates/electron-vue/electron/env.d.ts +1 -0
- package/templates/electron-vue/electron/main/index.ts +46 -30
- package/templates/electron-vue/electron/preload/index.ts +4 -0
- package/templates/electron-vue/index.html +1 -2
- package/templates/electron-vue/package.json +31 -2
- package/templates/electron-vue/pnpm-workspace.yaml +5 -0
- package/templates/electron-vue/src/App.vue +1 -1
- package/templates/electron-vue/src/style.css +15 -10
- package/templates/electron-vue/tsconfig.json +5 -0
- package/templates/electron-vue/tsconfig.node.json +7 -0
- package/templates/electron-vue/vite.config.ts +3 -21
- package/templates/{node-cli-legacy → node-base}/.vscode/launch.json +3 -6
- package/templates/node-base/package.json +15 -0
- package/templates/node-base/src/index.ts +5 -0
- package/templates/{node-cli-legacy → node-base}/tsconfig.json +1 -1
- package/templates/node-cli/.vscode/i18n-ally-custom-framework.yml +35 -0
- package/templates/node-cli/.vscode/launch.json +3 -6
- package/templates/node-cli/.vscode/settings.json +56 -0
- package/templates/node-cli/_.gitignore +59 -0
- package/templates/node-cli/locales/en-US.json +12 -0
- package/templates/node-cli/locales/zh-CN.json +12 -0
- package/templates/node-cli/package.json +20 -20
- package/templates/node-cli/src/app.ts +19 -0
- package/templates/node-cli/src/config.ts +2 -2
- package/templates/node-cli/src/index.ts +78 -1
- package/templates/node-cli/src/types.ts +5 -1
- package/templates/node-cli/src/utils/exec.ts +68 -0
- package/templates/node-cli/src/utils/index.ts +3 -0
- package/templates/node-cli/src/utils/lang.ts +104 -0
- package/templates/node-cli/src/utils/util.ts +20 -0
- package/templates/node-cli/tsconfig.json +2 -2
- package/templates/node-cli/{tsup.config.ts → tsdown.config.ts} +3 -4
- package/templates/node-vite/examples/react/README.md +1 -0
- package/templates/node-vite/examples/react/_eslint.config.mjs +6 -0
- package/templates/{react → node-vite/examples/react}/index.html +1 -2
- package/templates/node-vite/examples/react/package.json +27 -0
- package/templates/{react → node-vite/examples/react}/src/App.css +5 -2
- package/templates/{react → node-vite/examples/react}/src/App.tsx +8 -9
- package/templates/{react → node-vite/examples/react}/src/index.css +15 -11
- package/templates/node-vite/examples/react/src/main.tsx +10 -0
- package/templates/node-vite/examples/react/tsconfig.json +5 -0
- package/templates/node-vite/examples/react/vite.config.ts +14 -0
- package/templates/node-vite/examples/vue/README.md +1 -0
- package/templates/node-vite/examples/vue/_eslint.config.mjs +6 -0
- package/templates/{vue → node-vite/examples/vue}/index.html +1 -2
- package/templates/node-vite/examples/vue/package.json +22 -0
- package/templates/{vue → node-vite/examples/vue}/src/App.vue +3 -3
- package/templates/node-vite/examples/vue/src/components/HelloWorld.vue +19 -0
- package/templates/{vue → node-vite/examples/vue}/src/main.ts +0 -1
- package/templates/{vue → node-vite/examples/vue}/src/style.css +16 -12
- package/templates/{base → node-vite/examples}/vue/tsconfig.json +2 -2
- package/templates/{vue → node-vite/examples/vue}/vite.config.ts +1 -1
- package/templates/node-vite/package.json +16 -0
- package/templates/node-vite/pnpm-lock.yaml +2293 -0
- package/templates/node-vite/pnpm-workspace.yaml +6 -0
- package/templates/{node → node-vite}/tsconfig.json +1 -1
- package/templates/{node-cli-legacy/tsup.config.ts → node-vite/tsdown.config.ts} +4 -5
- package/templates/vscode-base/.vscode/settings.json +59 -0
- package/templates/{vscode → vscode-base}/.vscode/tasks.json +2 -2
- package/templates/{base/node → vscode-base}/LICENSE +1 -1
- package/templates/{vscode/_gitignore → vscode-base/_.gitignore} +1 -0
- package/templates/vscode-base/locales/zh-CN.json +6 -0
- package/templates/{vscode → vscode-base}/package.json +12 -19
- package/templates/vscode-base/resources/logo.png +0 -0
- package/templates/vscode-base/resources/logo.svg +1 -0
- package/templates/{vscode/tsup.config.ts → vscode-base/tsdown.config.ts} +3 -3
- package/templates/{base/vscode → vscode-react}/.vscode/launch.json +14 -1
- package/templates/vscode-react/.vscode/settings.json +59 -0
- package/templates/{base/vscode → vscode-react}/.vscode/tasks.json +10 -1
- package/templates/{base/vscode → vscode-react}/LICENSE +1 -1
- package/templates/vscode-react/README.md +2 -2
- package/templates/{base/vscode/_gitignore → vscode-react/_.gitignore} +2 -1
- package/templates/{base/vscode → vscode-react}/extension/views/helper.ts +5 -4
- package/templates/{base/vscode → vscode-react}/extension/views/panel.ts +2 -1
- package/templates/vscode-react/package.json +65 -1
- package/templates/vscode-react/pnpm-workspace.yaml +5 -0
- package/templates/vscode-react/src/App.css +1 -1
- package/templates/vscode-react/src/App.tsx +16 -10
- package/templates/vscode-react/src/utils/vscode.ts +2 -81
- package/templates/vscode-react/src/vite-env.d.ts +1 -0
- package/templates/vscode-react/tsconfig.json +5 -0
- package/templates/vscode-react/vite.config.ts +4 -5
- package/templates/vscode-vue/.vscode/extensions.json +5 -0
- package/templates/vscode-vue/.vscode/launch.json +34 -0
- package/templates/vscode-vue/.vscode/settings.json +59 -0
- package/templates/{base/electron → vscode-vue}/.vscode/tasks.json +14 -6
- package/templates/vscode-vue/.vscodeignore +73 -0
- package/templates/vscode-vue/LICENSE +21 -0
- package/templates/vscode-vue/README.md +2 -2
- package/templates/vscode-vue/_.gitignore +65 -0
- package/templates/vscode-vue/extension/env.d.ts +1 -0
- package/templates/vscode-vue/extension/index.ts +21 -0
- package/templates/vscode-vue/extension/views/helper.ts +28 -0
- package/templates/vscode-vue/extension/views/panel.ts +49 -0
- package/templates/vscode-vue/locales/en.json +6 -0
- package/templates/vscode-vue/package.json +56 -2
- package/templates/vscode-vue/pnpm-workspace.yaml +4 -0
- package/templates/vscode-vue/src/App.vue +17 -11
- package/templates/vscode-vue/src/utils/vscode.ts +2 -81
- package/templates/vscode-vue/src/vite-env.d.ts +1 -0
- package/templates/vscode-vue/tsconfig.json +5 -0
- package/templates/vscode-vue/tsconfig.node.json +7 -0
- package/templates/vscode-vue/vite.config.ts +0 -4
- package/templates/web-react/README.md +1 -0
- package/templates/web-react/_eslint.config.mjs +6 -0
- package/templates/web-react/index.html +13 -0
- package/templates/web-react/package.json +27 -0
- package/templates/web-react/public/vite.svg +1 -0
- package/templates/web-react/src/App.css +45 -0
- package/templates/web-react/src/App.tsx +31 -0
- package/templates/web-react/src/assets/react.svg +1 -0
- package/templates/web-react/src/index.css +73 -0
- package/templates/web-react/src/main.tsx +10 -0
- package/templates/web-react/tsconfig.app.json +28 -0
- package/templates/web-react/tsconfig.json +7 -0
- package/templates/web-react/tsconfig.node.json +26 -0
- package/templates/web-react/vite.config.ts +14 -0
- package/templates/web-vue/README.md +1 -0
- package/templates/web-vue/_eslint.config.mjs +6 -0
- package/templates/web-vue/index.html +13 -0
- package/templates/web-vue/package.json +22 -0
- package/templates/web-vue/public/vite.svg +1 -0
- package/templates/web-vue/src/App.vue +32 -0
- package/templates/web-vue/src/assets/vue.svg +1 -0
- package/templates/web-vue/src/components/HelloWorld.vue +19 -0
- package/templates/web-vue/src/main.ts +5 -0
- package/templates/web-vue/src/style.css +84 -0
- package/templates/web-vue/tsconfig.app.json +4 -0
- package/templates/web-vue/tsconfig.json +7 -0
- package/templates/web-vue/tsconfig.node.json +7 -0
- package/templates/web-vue/vite.config.ts +7 -0
- package/templates/base/core/.commitlintrc.cjs +0 -3
- package/templates/base/core/.eslintignore +0 -14
- package/templates/base/core/.husky/commit-msg +0 -1
- package/templates/base/core/.husky/pre-commit +0 -1
- package/templates/base/core/.prettierignore +0 -17
- package/templates/base/core/.prettierrc.cjs +0 -1
- package/templates/base/core/_eslintrc.cjs +0 -7
- package/templates/base/core/_lintstagedrc.cjs +0 -4
- package/templates/base/core/package.json +0 -31
- package/templates/base/electron/electron/main/index.ts +0 -111
- package/templates/base/electron/electron/polyfills.ts +0 -4
- package/templates/base/electron/electron/preload/index.ts +0 -1
- package/templates/base/electron/package.json +0 -25
- package/templates/base/node/README.md +0 -13
- package/templates/base/node/README.zh_CN.md +0 -13
- package/templates/base/node/package.json +0 -48
- package/templates/base/node/test/index.test.ts +0 -7
- package/templates/base/package/package.json +0 -8
- package/templates/base/react/_eslintrc.cjs +0 -7
- package/templates/base/react/_lintstagedrc.cjs +0 -6
- package/templates/base/react/package.json +0 -19
- package/templates/base/react/tsconfig.json +0 -5
- package/templates/base/style/.stylelintignore +0 -16
- package/templates/base/style/.stylelintrc.cjs +0 -3
- package/templates/base/style/_lintstagedrc.cjs +0 -5
- package/templates/base/style/package.json +0 -10
- package/templates/base/vscode/.vscode/settings.json +0 -10
- package/templates/base/vscode/package.json +0 -67
- package/templates/base/vue/_eslintrc.cjs +0 -7
- package/templates/base/vue/_lintstagedrc.cjs +0 -6
- package/templates/base/vue/package.json +0 -17
- package/templates/config.json +0 -108
- package/templates/electron-react/public/img/icon.png +0 -0
- package/templates/electron-vue/public/img/icon.png +0 -0
- package/templates/node/package.json +0 -10
- package/templates/node/src/index.ts +0 -3
- package/templates/node/tsup.config.ts +0 -19
- package/templates/node-cli/index.d.ts +0 -5
- package/templates/node-cli/src/cli.ts +0 -68
- package/templates/node-cli/xxx.config.cjs +0 -0
- package/templates/node-cli-legacy/index.d.ts +0 -5
- package/templates/node-cli-legacy/package.json +0 -30
- package/templates/node-cli-legacy/src/cli.ts +0 -45
- package/templates/node-cli-legacy/src/config.ts +0 -28
- package/templates/node-cli-legacy/src/index.ts +0 -3
- package/templates/node-cli-legacy/src/types.ts +0 -1
- package/templates/node-cli-legacy/src/utils.ts +0 -5
- package/templates/node-vite-plugin/package.json +0 -18
- package/templates/node-vite-plugin/test/index.test.ts +0 -7
- package/templates/node-vite-plugin/tsconfig.json +0 -4
- package/templates/node-vite-plugin/tsup.config.ts +0 -18
- package/templates/node-workspaces/package.json +0 -8
- package/templates/react/package.json +0 -12
- package/templates/react/src/main.tsx +0 -11
- package/templates/react/src/vite-env.d.ts +0 -1
- package/templates/react/vite.config.ts +0 -7
- package/templates/schema.json +0 -110
- package/templates/vscode/.vscode/settings.json +0 -10
- package/templates/vscode/README.md +0 -3
- package/templates/vue/package.json +0 -12
- package/templates/vue/src/components/HelloWorld.vue +0 -37
- package/templates/vue/src/vite-env.d.ts +0 -1
- package/templates/{base/core → config/base}/.gitattributes +0 -0
- package/templates/{node-cli-legacy/xxx.config.cjs → config/base/README.md} +0 -0
- package/templates/{base/electron → electron-react}/electron/env.d.ts +0 -0
- package/templates/{react → node-vite/examples/react}/public/vite.svg +0 -0
- package/templates/{react → node-vite/examples/react}/src/assets/react.svg +0 -0
- package/templates/{base → node-vite/examples}/react/tsconfig.node.json +0 -0
- package/templates/{vue → node-vite/examples/vue}/public/vite.svg +0 -0
- package/templates/{vue → node-vite/examples/vue}/src/assets/vue.svg +0 -0
- package/templates/{base → node-vite/examples}/vue/tsconfig.node.json +0 -0
- package/templates/{node-vite-plugin → node-vite}/src/index.ts +0 -0
- package/templates/{node-vite-plugin → node-vite}/src/types.ts +0 -0
- package/templates/{base/vscode → vscode-base}/.vscode/extensions.json +0 -0
- package/templates/{vscode → vscode-base}/.vscode/launch.json +0 -0
- package/templates/{vscode → vscode-base}/.vscodeignore +0 -0
- package/templates/{base/vscode → vscode-base}/README.md +0 -0
- package/templates/{vscode → vscode-base}/locales/en.json +0 -0
- package/templates/{vscode → vscode-base}/src/index.ts +1 -1
- package/templates/{vscode → vscode-base}/tsconfig.json +0 -0
- package/templates/{vscode → vscode-react}/.vscode/extensions.json +0 -0
- package/templates/{base/vscode → vscode-react}/.vscodeignore +0 -0
- package/templates/{base/vscode → vscode-react}/extension/env.d.ts +0 -0
- package/templates/{base/vscode → vscode-react}/extension/index.ts +1 -1
- /package/templates/{base/vscode → vscode-react}/locales/en.json +0 -0
- /package/templates/{base/vscode → vscode-react}/locales/zh-CN.json +0 -0
- /package/templates/{base/vscode → vscode-react}/resources/logo.png +0 -0
- /package/templates/{base/vscode → vscode-react}/resources/logo.svg +0 -0
- /package/templates/{base/vscode → vscode-react}/tsconfig.node.json +0 -0
- /package/templates/{vscode → vscode-vue}/locales/zh-CN.json +0 -0
- /package/templates/{vscode → vscode-vue}/resources/logo.png +0 -0
- /package/templates/{vscode → vscode-vue}/resources/logo.svg +0 -0
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import meow from 'meow';
|
|
2
|
-
import { getReleaseConfig } from './config.js';
|
|
3
|
-
import { isDev } from './constants.js';
|
|
4
|
-
import type { XxxCLIOptions } from './types.js';
|
|
5
|
-
|
|
6
|
-
const cli = meow(
|
|
7
|
-
`
|
|
8
|
-
Usage
|
|
9
|
-
$ xxx [input] [options]
|
|
10
|
-
|
|
11
|
-
Options
|
|
12
|
-
--cwd The current working directory (default: ".")
|
|
13
|
-
--config Specify the config file path (eg. xxx.config.json)
|
|
14
|
-
--verbose Display verbose output
|
|
15
|
-
-h, --help Display this message
|
|
16
|
-
-v, --version Display version number
|
|
17
|
-
`,
|
|
18
|
-
{
|
|
19
|
-
importMeta: import.meta,
|
|
20
|
-
booleanDefault: undefined,
|
|
21
|
-
helpIndent: 0,
|
|
22
|
-
flags: {
|
|
23
|
-
cwd: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
},
|
|
26
|
-
config: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
},
|
|
29
|
-
verbose: {
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
},
|
|
32
|
-
h: {
|
|
33
|
-
type: 'boolean',
|
|
34
|
-
default: false,
|
|
35
|
-
},
|
|
36
|
-
v: {
|
|
37
|
-
type: 'boolean',
|
|
38
|
-
default: false,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const { input, flags } = cli;
|
|
45
|
-
if (flags.h) {
|
|
46
|
-
cli.showHelp(0);
|
|
47
|
-
} else if (flags.v) {
|
|
48
|
-
cli.showVersion();
|
|
49
|
-
} else {
|
|
50
|
-
console.log(input, flags);
|
|
51
|
-
|
|
52
|
-
const cliOpts = Object.assign({}, flags);
|
|
53
|
-
console.log('cli options:', cliOpts);
|
|
54
|
-
|
|
55
|
-
const config = await getReleaseConfig(flags);
|
|
56
|
-
console.log('config file:', config);
|
|
57
|
-
|
|
58
|
-
const mergedOpts = Object.assign(
|
|
59
|
-
{
|
|
60
|
-
verbose: isDev,
|
|
61
|
-
} as XxxCLIOptions,
|
|
62
|
-
config,
|
|
63
|
-
cliOpts,
|
|
64
|
-
) as XxxCLIOptions;
|
|
65
|
-
|
|
66
|
-
mergedOpts.cwd ||= process.cwd();
|
|
67
|
-
console.log('merged options:', mergedOpts);
|
|
68
|
-
}
|
|
File without changes
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "node cli",
|
|
3
|
-
"keywords": [
|
|
4
|
-
"cli"
|
|
5
|
-
],
|
|
6
|
-
"packageManager": "pnpm@8.6.12",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"index.d.ts"
|
|
10
|
-
],
|
|
11
|
-
"bin": {
|
|
12
|
-
"xxx": "./dist/index.js",
|
|
13
|
-
"xxx-cli": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "tsup --watch",
|
|
17
|
-
"start": "tsx ./src/index.ts",
|
|
18
|
-
"build": "tsup"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@tomjs/logger": "^1.1.4",
|
|
22
|
-
"@tomjs/node": "^2.2.3",
|
|
23
|
-
"cac": "^6.7.14",
|
|
24
|
-
"chalk": "^4.1.2",
|
|
25
|
-
"cosmiconfig": "^9.0.0",
|
|
26
|
-
"execa": "^5.1.1",
|
|
27
|
-
"ora": "^5.4.1"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {}
|
|
30
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { readJsonSync } from '@tomjs/node';
|
|
3
|
-
import cac from 'cac';
|
|
4
|
-
import { getReleaseConfig } from './config';
|
|
5
|
-
import type { XxxCLIOptions } from './types';
|
|
6
|
-
import { logger } from './utils';
|
|
7
|
-
|
|
8
|
-
let version: string = '';
|
|
9
|
-
try {
|
|
10
|
-
const pkg = readJsonSync(path.join(__dirname, '../package.json')) || {};
|
|
11
|
-
version = pkg.version;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
console.error(e);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const cli = cac('xxx').option('--verbose', 'Display verbose output', {
|
|
17
|
-
default: process.env.NODE_ENV === 'development',
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// cmd
|
|
21
|
-
cli.command('[cwd]', 'Do something').action(async (input: string, flags: XxxCLIOptions) => {
|
|
22
|
-
logger.enableDebug(true);
|
|
23
|
-
console.log(input, flags);
|
|
24
|
-
|
|
25
|
-
const cliOpts = Object.assign({}, flags);
|
|
26
|
-
console.log('cli options:', cliOpts);
|
|
27
|
-
|
|
28
|
-
const config = await getReleaseConfig(flags);
|
|
29
|
-
console.log('config file:', config);
|
|
30
|
-
|
|
31
|
-
const mergedOpts = Object.assign(
|
|
32
|
-
{
|
|
33
|
-
verbose: process.env.NODE_ENV === 'development',
|
|
34
|
-
} as XxxCLIOptions,
|
|
35
|
-
config,
|
|
36
|
-
cliOpts,
|
|
37
|
-
) as XxxCLIOptions;
|
|
38
|
-
|
|
39
|
-
mergedOpts.cwd ||= process.cwd();
|
|
40
|
-
console.log('merged options:', mergedOpts);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
cli.help();
|
|
44
|
-
cli.version(version);
|
|
45
|
-
cli.parse();
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import { cosmiconfig } from 'cosmiconfig';
|
|
3
|
-
import type { XxxCLIOptions } from './types';
|
|
4
|
-
|
|
5
|
-
export async function getReleaseConfig(opts: XxxCLIOptions) {
|
|
6
|
-
const explorer = cosmiconfig('xxx', {
|
|
7
|
-
stopDir: opts.cwd,
|
|
8
|
-
searchPlaces: [
|
|
9
|
-
'package.json',
|
|
10
|
-
'xxx.config.json',
|
|
11
|
-
'xxx.config.js',
|
|
12
|
-
'xxx.config.mjs',
|
|
13
|
-
'xxx.config.cjs',
|
|
14
|
-
],
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
if (opts.config) {
|
|
18
|
-
if (!fs.existsSync(opts.config)) {
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const result = await explorer.load(opts.config);
|
|
23
|
-
return result?.config || {};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const result = await explorer.search();
|
|
27
|
-
return result?.config || {};
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { XxxCLIOptions } from '../index';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "vite plugin",
|
|
3
|
-
"keywords": [
|
|
4
|
-
"vite",
|
|
5
|
-
"plugin"
|
|
6
|
-
],
|
|
7
|
-
"scripts": {
|
|
8
|
-
"dev": "tsup --watch",
|
|
9
|
-
"build": "tsup"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"vite": "^5.4.2"
|
|
14
|
-
},
|
|
15
|
-
"peerDependencies": {
|
|
16
|
-
"vite": ">=2"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
import pkg from './package.json';
|
|
3
|
-
|
|
4
|
-
export default defineConfig(options => {
|
|
5
|
-
const isDev = !!options.watch;
|
|
6
|
-
|
|
7
|
-
return {
|
|
8
|
-
entry: ['src/index.ts'],
|
|
9
|
-
format: ['esm', 'cjs'],
|
|
10
|
-
target: 'node16',
|
|
11
|
-
external: ['vite'].concat(Object.keys(pkg.dependencies || {})),
|
|
12
|
-
shims: true,
|
|
13
|
-
clean: true,
|
|
14
|
-
dts: true,
|
|
15
|
-
sourcemap: isDev,
|
|
16
|
-
splitting: true,
|
|
17
|
-
};
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/templates/schema.json
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://tomjs.tomgao.cc/schema/create-app.json",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"title": "Create App JSON Schema",
|
|
6
|
-
"description": "Schema for the provided JSON configuration",
|
|
7
|
-
"properties": {
|
|
8
|
-
"list": {
|
|
9
|
-
"type": "array",
|
|
10
|
-
"items": {
|
|
11
|
-
"type": "object",
|
|
12
|
-
"properties": {
|
|
13
|
-
"name": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "Name of the template group"
|
|
16
|
-
},
|
|
17
|
-
"display": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "Display name of the template group"
|
|
20
|
-
},
|
|
21
|
-
"variants": {
|
|
22
|
-
"type": "array",
|
|
23
|
-
"items": {
|
|
24
|
-
"type": "object",
|
|
25
|
-
"properties": {
|
|
26
|
-
"name": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"description": "Name of the template variant"
|
|
29
|
-
},
|
|
30
|
-
"display": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"description": "Display name of the template variant"
|
|
33
|
-
},
|
|
34
|
-
"templates": {
|
|
35
|
-
"type": "array",
|
|
36
|
-
"items": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"enum": [
|
|
39
|
-
"base/electron",
|
|
40
|
-
"base/node",
|
|
41
|
-
"base/react",
|
|
42
|
-
"base/style",
|
|
43
|
-
"base/vue",
|
|
44
|
-
"base/vscode",
|
|
45
|
-
"react",
|
|
46
|
-
"vue"
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
"uniqueItems": true,
|
|
50
|
-
"description": "An array containing templates to select."
|
|
51
|
-
},
|
|
52
|
-
"examples": {
|
|
53
|
-
"type": "array",
|
|
54
|
-
"items": {
|
|
55
|
-
"type": "string",
|
|
56
|
-
"enum": ["vue", "react"]
|
|
57
|
-
},
|
|
58
|
-
"uniqueItems": true,
|
|
59
|
-
"description": "An array containing examples to select."
|
|
60
|
-
},
|
|
61
|
-
"packages": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"properties": {
|
|
64
|
-
"exclude": {
|
|
65
|
-
"type": "array",
|
|
66
|
-
"items": {
|
|
67
|
-
"type": "string"
|
|
68
|
-
},
|
|
69
|
-
"description": "Files or folders not included when used in example or package"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"types": {
|
|
74
|
-
"type": "array",
|
|
75
|
-
"items": {
|
|
76
|
-
"type": "string",
|
|
77
|
-
"enum": ["project", "example", "package"]
|
|
78
|
-
},
|
|
79
|
-
"uniqueItems": true,
|
|
80
|
-
"description": "Supported template types, default is all"
|
|
81
|
-
},
|
|
82
|
-
"workspaces": {
|
|
83
|
-
"type": "boolean",
|
|
84
|
-
"description": "Whether to use workspaces"
|
|
85
|
-
},
|
|
86
|
-
"devDependencies": {
|
|
87
|
-
"type": "integer",
|
|
88
|
-
"enum": [0, 1, 2],
|
|
89
|
-
"description": "Whether to use it for devDependencies in package.json.\n0: not used\n1: used\n2: prompt"
|
|
90
|
-
},
|
|
91
|
-
"test": {
|
|
92
|
-
"type": "boolean",
|
|
93
|
-
"description": "Whether to use test"
|
|
94
|
-
},
|
|
95
|
-
"git": {
|
|
96
|
-
"type": "integer",
|
|
97
|
-
"enum": [0, 1, 2],
|
|
98
|
-
"description": "Whether to select git repository.\n0: not used\n1: used\n2: prompt"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"required": ["name", "display"]
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"required": ["name", "display"]
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"required": ["list"]
|
|
110
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"i18n-ally.localesPaths": ["locales"],
|
|
3
|
-
"i18n-ally.sourceLanguage": "zh-CN",
|
|
4
|
-
"i18n-ally.displayLanguage": "zh-CN",
|
|
5
|
-
"i18n-ally.keepFulfilled": true,
|
|
6
|
-
"i18n-ally.keystyle": "flat",
|
|
7
|
-
"i18n-ally.sortKeys": true,
|
|
8
|
-
"i18n-ally.translate.promptSource": true,
|
|
9
|
-
"i18n-ally.translate.saveAsCandidates": true
|
|
10
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
|
|
4
|
-
defineProps<{ msg: string }>();
|
|
5
|
-
|
|
6
|
-
const count = ref(0);
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<h1>{{ msg }}</h1>
|
|
11
|
-
|
|
12
|
-
<div class="card">
|
|
13
|
-
<button type="button" @click="count++">count is {{ count }}</button>
|
|
14
|
-
<p>
|
|
15
|
-
Edit
|
|
16
|
-
<code>components/HelloWorld.vue</code> to test HMR
|
|
17
|
-
</p>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<p>
|
|
21
|
-
Check out
|
|
22
|
-
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the
|
|
23
|
-
official Vue + Vite starter
|
|
24
|
-
</p>
|
|
25
|
-
<p>
|
|
26
|
-
Install
|
|
27
|
-
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
|
|
28
|
-
in your IDE for a better DX
|
|
29
|
-
</p>
|
|
30
|
-
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<style scoped>
|
|
34
|
-
.read-the-docs {
|
|
35
|
-
color: #888;
|
|
36
|
-
}
|
|
37
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|