@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.
Files changed (262) hide show
  1. package/README.md +14 -21
  2. package/README.zh_CN.md +14 -21
  3. package/dist/index.js +9 -22
  4. package/package.json +49 -52
  5. package/templates/{base/core → config/base}/.editorconfig +0 -4
  6. package/templates/config/base/.vscode/settings.json +50 -0
  7. package/templates/{base/core/_gitignore → config/base/_.gitignore} +1 -3
  8. package/templates/config/base/_commitlint.config.mjs +3 -0
  9. package/templates/config/base/_eslint.config.mjs +8 -0
  10. package/templates/config/base/lint-staged.config.mjs +3 -0
  11. package/templates/config/base/package.json +24 -0
  12. package/templates/config/base/pnpm-workspace.yaml +3 -0
  13. package/templates/config/base/simple-git-hooks.mjs +4 -0
  14. package/templates/{vscode → config/public}/LICENSE +1 -1
  15. package/templates/config/public/README.md +20 -0
  16. package/templates/config/public/README.zh_CN.md +20 -0
  17. package/templates/config/public/package.json +10 -0
  18. package/templates/config/style/lint-staged.config.mjs +7 -0
  19. package/templates/config/style/package.json +12 -0
  20. package/templates/config/style/stylelint.config.mjs +3 -0
  21. package/templates/{base/electron → electron-react}/.vscode/launch.json +23 -3
  22. package/templates/electron-react/.vscode/tasks.json +67 -0
  23. package/templates/electron-react/README.md +1 -1
  24. package/templates/electron-react/_eslint.config.mjs +8 -0
  25. package/templates/electron-react/electron/main/index.ts +71 -40
  26. package/templates/electron-react/electron/preload/index.ts +4 -0
  27. package/templates/electron-react/index.html +1 -2
  28. package/templates/electron-react/package.json +35 -1
  29. package/templates/electron-react/pnpm-workspace.yaml +6 -0
  30. package/templates/electron-react/src/App.css +6 -2
  31. package/templates/electron-react/src/App.tsx +12 -5
  32. package/templates/electron-react/src/index.css +14 -9
  33. package/templates/electron-react/tsconfig.json +9 -0
  34. package/templates/{base/electron → electron-react}/tsconfig.node.json +1 -1
  35. package/templates/electron-react/vite.config.ts +9 -22
  36. package/templates/electron-vue/.vscode/launch.json +48 -0
  37. package/templates/electron-vue/.vscode/tasks.json +67 -0
  38. package/templates/electron-vue/README.md +1 -1
  39. package/templates/electron-vue/_eslint.config.mjs +8 -0
  40. package/templates/electron-vue/electron/env.d.ts +1 -0
  41. package/templates/electron-vue/electron/main/index.ts +46 -30
  42. package/templates/electron-vue/electron/preload/index.ts +4 -0
  43. package/templates/electron-vue/index.html +1 -2
  44. package/templates/electron-vue/package.json +31 -2
  45. package/templates/electron-vue/pnpm-workspace.yaml +5 -0
  46. package/templates/electron-vue/src/App.vue +1 -1
  47. package/templates/electron-vue/src/style.css +15 -10
  48. package/templates/electron-vue/tsconfig.json +5 -0
  49. package/templates/electron-vue/tsconfig.node.json +7 -0
  50. package/templates/electron-vue/vite.config.ts +3 -21
  51. package/templates/{node-cli-legacy → node-base}/.vscode/launch.json +3 -6
  52. package/templates/node-base/package.json +15 -0
  53. package/templates/node-base/src/index.ts +5 -0
  54. package/templates/{node-cli-legacy → node-base}/tsconfig.json +1 -1
  55. package/templates/node-cli/.vscode/i18n-ally-custom-framework.yml +35 -0
  56. package/templates/node-cli/.vscode/launch.json +3 -6
  57. package/templates/node-cli/.vscode/settings.json +56 -0
  58. package/templates/node-cli/_.gitignore +59 -0
  59. package/templates/node-cli/locales/en-US.json +12 -0
  60. package/templates/node-cli/locales/zh-CN.json +12 -0
  61. package/templates/node-cli/package.json +20 -20
  62. package/templates/node-cli/src/app.ts +19 -0
  63. package/templates/node-cli/src/config.ts +2 -2
  64. package/templates/node-cli/src/index.ts +78 -1
  65. package/templates/node-cli/src/types.ts +5 -1
  66. package/templates/node-cli/src/utils/exec.ts +68 -0
  67. package/templates/node-cli/src/utils/index.ts +3 -0
  68. package/templates/node-cli/src/utils/lang.ts +104 -0
  69. package/templates/node-cli/src/utils/util.ts +20 -0
  70. package/templates/node-cli/tsconfig.json +2 -2
  71. package/templates/node-cli/{tsup.config.ts → tsdown.config.ts} +3 -4
  72. package/templates/node-vite/examples/react/README.md +1 -0
  73. package/templates/node-vite/examples/react/_eslint.config.mjs +6 -0
  74. package/templates/{react → node-vite/examples/react}/index.html +1 -2
  75. package/templates/node-vite/examples/react/package.json +27 -0
  76. package/templates/{react → node-vite/examples/react}/src/App.css +5 -2
  77. package/templates/{react → node-vite/examples/react}/src/App.tsx +8 -9
  78. package/templates/{react → node-vite/examples/react}/src/index.css +15 -11
  79. package/templates/node-vite/examples/react/src/main.tsx +10 -0
  80. package/templates/node-vite/examples/react/tsconfig.json +5 -0
  81. package/templates/node-vite/examples/react/vite.config.ts +14 -0
  82. package/templates/node-vite/examples/vue/README.md +1 -0
  83. package/templates/node-vite/examples/vue/_eslint.config.mjs +6 -0
  84. package/templates/{vue → node-vite/examples/vue}/index.html +1 -2
  85. package/templates/node-vite/examples/vue/package.json +22 -0
  86. package/templates/{vue → node-vite/examples/vue}/src/App.vue +3 -3
  87. package/templates/node-vite/examples/vue/src/components/HelloWorld.vue +19 -0
  88. package/templates/{vue → node-vite/examples/vue}/src/main.ts +0 -1
  89. package/templates/{vue → node-vite/examples/vue}/src/style.css +16 -12
  90. package/templates/{base → node-vite/examples}/vue/tsconfig.json +2 -2
  91. package/templates/{vue → node-vite/examples/vue}/vite.config.ts +1 -1
  92. package/templates/node-vite/package.json +16 -0
  93. package/templates/node-vite/pnpm-lock.yaml +2293 -0
  94. package/templates/node-vite/pnpm-workspace.yaml +6 -0
  95. package/templates/{node → node-vite}/tsconfig.json +1 -1
  96. package/templates/{node-cli-legacy/tsup.config.ts → node-vite/tsdown.config.ts} +4 -5
  97. package/templates/vscode-base/.vscode/settings.json +59 -0
  98. package/templates/{vscode → vscode-base}/.vscode/tasks.json +2 -2
  99. package/templates/{base/node → vscode-base}/LICENSE +1 -1
  100. package/templates/{vscode/_gitignore → vscode-base/_.gitignore} +1 -0
  101. package/templates/vscode-base/locales/zh-CN.json +6 -0
  102. package/templates/{vscode → vscode-base}/package.json +12 -19
  103. package/templates/vscode-base/resources/logo.png +0 -0
  104. package/templates/vscode-base/resources/logo.svg +1 -0
  105. package/templates/{vscode/tsup.config.ts → vscode-base/tsdown.config.ts} +3 -3
  106. package/templates/{base/vscode → vscode-react}/.vscode/launch.json +14 -1
  107. package/templates/vscode-react/.vscode/settings.json +59 -0
  108. package/templates/{base/vscode → vscode-react}/.vscode/tasks.json +10 -1
  109. package/templates/{base/vscode → vscode-react}/LICENSE +1 -1
  110. package/templates/vscode-react/README.md +2 -2
  111. package/templates/{base/vscode/_gitignore → vscode-react/_.gitignore} +2 -1
  112. package/templates/{base/vscode → vscode-react}/extension/views/helper.ts +5 -4
  113. package/templates/{base/vscode → vscode-react}/extension/views/panel.ts +2 -1
  114. package/templates/vscode-react/package.json +65 -1
  115. package/templates/vscode-react/pnpm-workspace.yaml +5 -0
  116. package/templates/vscode-react/src/App.css +1 -1
  117. package/templates/vscode-react/src/App.tsx +16 -10
  118. package/templates/vscode-react/src/utils/vscode.ts +2 -81
  119. package/templates/vscode-react/src/vite-env.d.ts +1 -0
  120. package/templates/vscode-react/tsconfig.json +5 -0
  121. package/templates/vscode-react/vite.config.ts +4 -5
  122. package/templates/vscode-vue/.vscode/extensions.json +5 -0
  123. package/templates/vscode-vue/.vscode/launch.json +34 -0
  124. package/templates/vscode-vue/.vscode/settings.json +59 -0
  125. package/templates/{base/electron → vscode-vue}/.vscode/tasks.json +14 -6
  126. package/templates/vscode-vue/.vscodeignore +73 -0
  127. package/templates/vscode-vue/LICENSE +21 -0
  128. package/templates/vscode-vue/README.md +2 -2
  129. package/templates/vscode-vue/_.gitignore +65 -0
  130. package/templates/vscode-vue/extension/env.d.ts +1 -0
  131. package/templates/vscode-vue/extension/index.ts +21 -0
  132. package/templates/vscode-vue/extension/views/helper.ts +28 -0
  133. package/templates/vscode-vue/extension/views/panel.ts +49 -0
  134. package/templates/vscode-vue/locales/en.json +6 -0
  135. package/templates/vscode-vue/package.json +56 -2
  136. package/templates/vscode-vue/pnpm-workspace.yaml +4 -0
  137. package/templates/vscode-vue/src/App.vue +17 -11
  138. package/templates/vscode-vue/src/utils/vscode.ts +2 -81
  139. package/templates/vscode-vue/src/vite-env.d.ts +1 -0
  140. package/templates/vscode-vue/tsconfig.json +5 -0
  141. package/templates/vscode-vue/tsconfig.node.json +7 -0
  142. package/templates/vscode-vue/vite.config.ts +0 -4
  143. package/templates/web-react/README.md +1 -0
  144. package/templates/web-react/_eslint.config.mjs +6 -0
  145. package/templates/web-react/index.html +13 -0
  146. package/templates/web-react/package.json +27 -0
  147. package/templates/web-react/public/vite.svg +1 -0
  148. package/templates/web-react/src/App.css +45 -0
  149. package/templates/web-react/src/App.tsx +31 -0
  150. package/templates/web-react/src/assets/react.svg +1 -0
  151. package/templates/web-react/src/index.css +73 -0
  152. package/templates/web-react/src/main.tsx +10 -0
  153. package/templates/web-react/tsconfig.app.json +28 -0
  154. package/templates/web-react/tsconfig.json +7 -0
  155. package/templates/web-react/tsconfig.node.json +26 -0
  156. package/templates/web-react/vite.config.ts +14 -0
  157. package/templates/web-vue/README.md +1 -0
  158. package/templates/web-vue/_eslint.config.mjs +6 -0
  159. package/templates/web-vue/index.html +13 -0
  160. package/templates/web-vue/package.json +22 -0
  161. package/templates/web-vue/public/vite.svg +1 -0
  162. package/templates/web-vue/src/App.vue +32 -0
  163. package/templates/web-vue/src/assets/vue.svg +1 -0
  164. package/templates/web-vue/src/components/HelloWorld.vue +19 -0
  165. package/templates/web-vue/src/main.ts +5 -0
  166. package/templates/web-vue/src/style.css +84 -0
  167. package/templates/web-vue/tsconfig.app.json +4 -0
  168. package/templates/web-vue/tsconfig.json +7 -0
  169. package/templates/web-vue/tsconfig.node.json +7 -0
  170. package/templates/web-vue/vite.config.ts +7 -0
  171. package/templates/base/core/.commitlintrc.cjs +0 -3
  172. package/templates/base/core/.eslintignore +0 -14
  173. package/templates/base/core/.husky/commit-msg +0 -1
  174. package/templates/base/core/.husky/pre-commit +0 -1
  175. package/templates/base/core/.prettierignore +0 -17
  176. package/templates/base/core/.prettierrc.cjs +0 -1
  177. package/templates/base/core/_eslintrc.cjs +0 -7
  178. package/templates/base/core/_lintstagedrc.cjs +0 -4
  179. package/templates/base/core/package.json +0 -31
  180. package/templates/base/electron/electron/main/index.ts +0 -111
  181. package/templates/base/electron/electron/polyfills.ts +0 -4
  182. package/templates/base/electron/electron/preload/index.ts +0 -1
  183. package/templates/base/electron/package.json +0 -25
  184. package/templates/base/node/README.md +0 -13
  185. package/templates/base/node/README.zh_CN.md +0 -13
  186. package/templates/base/node/package.json +0 -48
  187. package/templates/base/node/test/index.test.ts +0 -7
  188. package/templates/base/package/package.json +0 -8
  189. package/templates/base/react/_eslintrc.cjs +0 -7
  190. package/templates/base/react/_lintstagedrc.cjs +0 -6
  191. package/templates/base/react/package.json +0 -19
  192. package/templates/base/react/tsconfig.json +0 -5
  193. package/templates/base/style/.stylelintignore +0 -16
  194. package/templates/base/style/.stylelintrc.cjs +0 -3
  195. package/templates/base/style/_lintstagedrc.cjs +0 -5
  196. package/templates/base/style/package.json +0 -10
  197. package/templates/base/vscode/.vscode/settings.json +0 -10
  198. package/templates/base/vscode/package.json +0 -67
  199. package/templates/base/vue/_eslintrc.cjs +0 -7
  200. package/templates/base/vue/_lintstagedrc.cjs +0 -6
  201. package/templates/base/vue/package.json +0 -17
  202. package/templates/config.json +0 -108
  203. package/templates/electron-react/public/img/icon.png +0 -0
  204. package/templates/electron-vue/public/img/icon.png +0 -0
  205. package/templates/node/package.json +0 -10
  206. package/templates/node/src/index.ts +0 -3
  207. package/templates/node/tsup.config.ts +0 -19
  208. package/templates/node-cli/index.d.ts +0 -5
  209. package/templates/node-cli/src/cli.ts +0 -68
  210. package/templates/node-cli/xxx.config.cjs +0 -0
  211. package/templates/node-cli-legacy/index.d.ts +0 -5
  212. package/templates/node-cli-legacy/package.json +0 -30
  213. package/templates/node-cli-legacy/src/cli.ts +0 -45
  214. package/templates/node-cli-legacy/src/config.ts +0 -28
  215. package/templates/node-cli-legacy/src/index.ts +0 -3
  216. package/templates/node-cli-legacy/src/types.ts +0 -1
  217. package/templates/node-cli-legacy/src/utils.ts +0 -5
  218. package/templates/node-vite-plugin/package.json +0 -18
  219. package/templates/node-vite-plugin/test/index.test.ts +0 -7
  220. package/templates/node-vite-plugin/tsconfig.json +0 -4
  221. package/templates/node-vite-plugin/tsup.config.ts +0 -18
  222. package/templates/node-workspaces/package.json +0 -8
  223. package/templates/react/package.json +0 -12
  224. package/templates/react/src/main.tsx +0 -11
  225. package/templates/react/src/vite-env.d.ts +0 -1
  226. package/templates/react/vite.config.ts +0 -7
  227. package/templates/schema.json +0 -110
  228. package/templates/vscode/.vscode/settings.json +0 -10
  229. package/templates/vscode/README.md +0 -3
  230. package/templates/vue/package.json +0 -12
  231. package/templates/vue/src/components/HelloWorld.vue +0 -37
  232. package/templates/vue/src/vite-env.d.ts +0 -1
  233. package/templates/{base/core → config/base}/.gitattributes +0 -0
  234. package/templates/{node-cli-legacy/xxx.config.cjs → config/base/README.md} +0 -0
  235. package/templates/{base/electron → electron-react}/electron/env.d.ts +0 -0
  236. package/templates/{react → node-vite/examples/react}/public/vite.svg +0 -0
  237. package/templates/{react → node-vite/examples/react}/src/assets/react.svg +0 -0
  238. package/templates/{base → node-vite/examples}/react/tsconfig.node.json +0 -0
  239. package/templates/{vue → node-vite/examples/vue}/public/vite.svg +0 -0
  240. package/templates/{vue → node-vite/examples/vue}/src/assets/vue.svg +0 -0
  241. package/templates/{base → node-vite/examples}/vue/tsconfig.node.json +0 -0
  242. package/templates/{node-vite-plugin → node-vite}/src/index.ts +0 -0
  243. package/templates/{node-vite-plugin → node-vite}/src/types.ts +0 -0
  244. package/templates/{base/vscode → vscode-base}/.vscode/extensions.json +0 -0
  245. package/templates/{vscode → vscode-base}/.vscode/launch.json +0 -0
  246. package/templates/{vscode → vscode-base}/.vscodeignore +0 -0
  247. package/templates/{base/vscode → vscode-base}/README.md +0 -0
  248. package/templates/{vscode → vscode-base}/locales/en.json +0 -0
  249. package/templates/{vscode → vscode-base}/src/index.ts +1 -1
  250. package/templates/{vscode → vscode-base}/tsconfig.json +0 -0
  251. package/templates/{vscode → vscode-react}/.vscode/extensions.json +0 -0
  252. package/templates/{base/vscode → vscode-react}/.vscodeignore +0 -0
  253. package/templates/{base/vscode → vscode-react}/extension/env.d.ts +0 -0
  254. package/templates/{base/vscode → vscode-react}/extension/index.ts +1 -1
  255. /package/templates/{base/vscode → vscode-react}/locales/en.json +0 -0
  256. /package/templates/{base/vscode → vscode-react}/locales/zh-CN.json +0 -0
  257. /package/templates/{base/vscode → vscode-react}/resources/logo.png +0 -0
  258. /package/templates/{base/vscode → vscode-react}/resources/logo.svg +0 -0
  259. /package/templates/{base/vscode → vscode-react}/tsconfig.node.json +0 -0
  260. /package/templates/{vscode → vscode-vue}/locales/zh-CN.json +0 -0
  261. /package/templates/{vscode → vscode-vue}/resources/logo.png +0 -0
  262. /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,5 +0,0 @@
1
- export interface XxxCLIOptions {
2
- cwd?: string;
3
- config?: string;
4
- verbose?: boolean;
5
- }
@@ -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,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import './cli';
@@ -1 +0,0 @@
1
- export { XxxCLIOptions } from '../index';
@@ -1,5 +0,0 @@
1
- import Logger from '@tomjs/logger';
2
-
3
- export const logger = new Logger({
4
- directory: 'xxx/logs',
5
- });
@@ -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,7 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- describe('some test', () => {
4
- it('1 + 1 = 2', () => {
5
- expect(1 + 1).toBe(2);
6
- });
7
- });
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "@tomjs/tsconfig/node.json",
3
- "include": ["src", "test", "*.ts"]
4
- }
@@ -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,8 +0,0 @@
1
- {
2
- "private": true,
3
- "scripts": {
4
- "build": "pnpm -r --stream --filter=@tomjs/* build",
5
- "lint:eslint": "eslint \"packages/**/*.ts\" *.{js,cjs,ts} --fix --cache"
6
- },
7
- "devDependencies": {}
8
- }
@@ -1,12 +0,0 @@
1
- {
2
- "name": "template-react",
3
- "version": "0.0.0",
4
- "description": "vite + react",
5
- "type": "module",
6
- "engines": {
7
- "node": ">=18"
8
- },
9
- "scripts": {},
10
- "dependencies": {},
11
- "devDependencies": {}
12
- }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import App from './App.tsx';
4
-
5
- import './index.css';
6
-
7
- ReactDOM.createRoot(document.getElementById('root')!).render(
8
- <React.StrictMode>
9
- <App />
10
- </React.StrictMode>,
11
- );
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,7 +0,0 @@
1
- import react from '@vitejs/plugin-react-swc';
2
- import { defineConfig } from 'vite';
3
-
4
- // https://vitejs.dev/config/
5
- export default defineConfig({
6
- plugins: [react()],
7
- });
@@ -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,3 +0,0 @@
1
- # extension
2
-
3
- vscode extension
@@ -1,12 +0,0 @@
1
- {
2
- "name": "template-vue",
3
- "version": "0.0.0",
4
- "description": "vite + vue",
5
- "type": "module",
6
- "engines": {
7
- "node": ">=18"
8
- },
9
- "scripts": {},
10
- "dependencies": {},
11
- "devDependencies": {}
12
- }
@@ -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
@@ -1,5 +1,5 @@
1
- import { i18n, initExtension } from '@tomjs/vscode';
2
1
  import type { ExtensionContext } from 'vscode';
2
+ import { i18n, initExtension } from '@tomjs/vscode';
3
3
  import { commands, window } from 'vscode';
4
4
 
5
5
  export function activate(context: ExtensionContext) {
File without changes
@@ -1,5 +1,5 @@
1
- import { i18n, initExtension } from '@tomjs/vscode';
2
1
  import type { ExtensionContext } from 'vscode';
2
+ import { i18n, initExtension } from '@tomjs/vscode';
3
3
  import { commands, window } from 'vscode';
4
4
  import { MainPanel } from './views/panel';
5
5