@tomjs/create-app 0.0.1 → 0.0.3

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 (44) hide show
  1. package/README.md +31 -0
  2. package/README.zh_CN.md +57 -0
  3. package/dist/index.mjs +6 -0
  4. package/package.json +19 -11
  5. package/template-config/.commitlintrc.js +3 -0
  6. package/template-config/.editorconfig +15 -0
  7. package/template-config/.eslintignore +14 -0
  8. package/template-config/.gitattributes +199 -0
  9. package/template-config/.prettierignore +17 -0
  10. package/template-config/.prettierrc.js +1 -0
  11. package/template-config/.stylelintignore +16 -0
  12. package/template-config/.stylelintrc.js +3 -0
  13. package/template-config/_gitignore +58 -0
  14. package/template-react/.eslintrc.js +7 -0
  15. package/template-react/README.md +3 -0
  16. package/template-react/_lintstagedrc.js +5 -0
  17. package/template-react/index.html +16 -0
  18. package/template-react/package.json +41 -0
  19. package/template-react/public/vite.svg +1 -0
  20. package/template-react/src/App.css +42 -0
  21. package/template-react/src/App.tsx +32 -0
  22. package/template-react/src/assets/react.svg +1 -0
  23. package/template-react/src/index.css +69 -0
  24. package/template-react/src/main.tsx +11 -0
  25. package/template-react/src/vite-env.d.ts +1 -0
  26. package/template-react/tsconfig.json +5 -0
  27. package/template-react/tsconfig.node.json +7 -0
  28. package/template-react/vite.config.ts +7 -0
  29. package/template-vue/.eslintrc.js +7 -0
  30. package/template-vue/README.md +18 -0
  31. package/template-vue/_lintstagedrc.js +6 -0
  32. package/template-vue/index.html +16 -0
  33. package/template-vue/package.json +39 -0
  34. package/template-vue/public/vite.svg +1 -0
  35. package/template-vue/src/App.vue +32 -0
  36. package/template-vue/src/assets/vue.svg +1 -0
  37. package/template-vue/src/components/HelloWorld.vue +37 -0
  38. package/template-vue/src/main.ts +6 -0
  39. package/template-vue/src/style.css +80 -0
  40. package/template-vue/src/vite-env.d.ts +1 -0
  41. package/template-vue/tsconfig.json +5 -0
  42. package/template-vue/tsconfig.node.json +7 -0
  43. package/template-vue/vite.config.ts +7 -0
  44. package/dist/index.js +0 -5
package/README.md CHANGED
@@ -25,3 +25,34 @@ yarn create @tomjs/app
25
25
  ```bash
26
26
  pnpm create @tomjs/app
27
27
  ```
28
+
29
+ Then generate the project based on the prompts.
30
+
31
+ You can also directly specify the project name, template, and module type.
32
+
33
+ - Using `npm`
34
+
35
+ ```bash
36
+ npm create @tomjs/app@latest my-app -- --template vue --module
37
+ ```
38
+
39
+ - Using `yarn`
40
+
41
+ ```bash
42
+ yarn create @tomjs/app my-app --template vue --module
43
+ ```
44
+
45
+ - Using `pnpm`
46
+
47
+ ```bash
48
+ pnpm create @tomjs/app --template vue --module
49
+ ```
50
+
51
+ Parameters:
52
+
53
+ - `-t --template` : specify the template, optional values: `vue` , `react`
54
+ - `-m --module` : `package.json` uses `type:"module"`, otherwise use `commonjs`
55
+
56
+ ## Reference project
57
+
58
+ - [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite)
package/README.zh_CN.md CHANGED
@@ -25,3 +25,60 @@ yarn create @tomjs/app
25
25
  ```bash
26
26
  pnpm create @tomjs/app
27
27
  ```
28
+
29
+ 然后根据提示生成项目。
30
+
31
+ 你也可以直接指定项目名、模板、module类型
32
+
33
+ - 使用 `npm`
34
+
35
+ ```bash
36
+ npm create @tomjs/app@latest
37
+ npm create @tomjs/app@latest my-app -- --template vue --module
38
+ ```
39
+
40
+ - 使用 `yarn`
41
+
42
+ ```bash
43
+ yarn create @tomjs/app my-app --template vue --module
44
+ ```
45
+
46
+ - 使用 `pnpm`
47
+
48
+ ```bash
49
+ pnpm create @tomjs/app my-app --template vue --module
50
+ ```
51
+
52
+ 参数说明:
53
+
54
+ - `-t --template`:指定模板,可选值:`vue`、`react`
55
+ - `-m --module`:`package.json` 使用 `type:"module"`,否则使用 `commonjs`
56
+
57
+ ## 项目配置
58
+
59
+ 项目配置在 `package.json` 中,可配置项如下:
60
+
61
+ ````json
62
+ {
63
+ "name": "my-app",
64
+ "version": "0.0.1",
65
+ "description": "",
66
+ "main": "src/main.ts",
67
+ }
68
+
69
+ ## 项目结构
70
+
71
+ ```bash
72
+ .
73
+ ├── README.md
74
+ ├── package.json
75
+ ├── src
76
+ │ ├── App.vue
77
+ │ ├── main.ts
78
+ │ └── shims-vue.d.ts
79
+ ├── tsconfig.json
80
+
81
+ ## 参考项目
82
+
83
+ - [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite)
84
+ ````
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import s from"fs";import o from"path";import{fileURLToPath as U}from"url";import{cyan as J,green as W,red as E,reset as m}from"kolorist";import K from"minimist";import q from"prompts";import a from"fs";import k from"path";function _(e){return[["t","template"],["m","module"]].forEach(([t,n])=>{e[n]=e[n]??e[t]}),e}function A(e){let t=a.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function S(e){return e?.trim().replace(/\/+$/g,"")}function L(e,t){a.mkdirSync(t,{recursive:!0});for(let n of a.readdirSync(e)){let c=k.resolve(e,n),g=k.resolve(t,n);j(c,g)}}function j(e,t){a.statSync(e).isDirectory()?L(e,t):a.copyFileSync(e,t)}function D(e){if(a.existsSync(e))for(let t of a.readdirSync(e))t!==".git"&&a.rmSync(k.resolve(e,t),{recursive:!0,force:!0})}function w(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function $(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function b(e){if(!e)return;let n=e.split(" ")[0].split("/");return{name:n[0],version:n[1]}}var p=_(K(process.argv.slice(2),{string:["_"]})),h=process.cwd(),M=[{name:"vue",display:"Vue",color:W},{name:"react",display:"React",color:J}],C=M.map(e=>e.name),B={_gitignore:".gitignore","_lintstagedrc.js":".lintstagedrc.js"},x="my-app";async function G(){let e=S(p._[0]),t=p.template||p.t,n=e||x,c=()=>n==="."?o.basename(o.resolve()):n,g=await q([{type:e?null:"text",name:"projectName",message:m("Project name:"),initial:x,onState:r=>{n=S(r.value)||x}},{type:()=>!s.existsSync(n)||A(n)?null:"toggle",name:"overwrite",message:()=>(n==="."?"Current directory":`Target directory "${n}"`)+" is not empty. Remove existing files and continue?",initial:!1,active:"yes",inactive:"no"},{type:(r,{overwrite:l})=>{if(l===!1)throw new Error(E("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>w(c())?null:"text",name:"packageName",message:m("Package name:"),initial:()=>$(c()),validate:r=>w(r)||"Invalid package.json name"},{type:t&&C.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!C.includes(t)?m(`"${t}" isn't a valid template. Please choose from below: `):m("Select a framework:"),initial:0,choices:M.map(r=>{let l=r.color;return{title:l(r.display||r.name),value:r}})},{type:()=>p.module!==void 0?null:"toggle",name:"isModuleType",message:m("Is it set to module type?"),initial:!1,active:"yes",inactive:"no"}],{onCancel:()=>{throw console.log(E("\u2716")+" Operation cancelled"),new Error}}),{framework:R,overwrite:z,packageName:O}=g,i=o.join(h,n);z?D(i):s.existsSync(i)||s.mkdirSync(i,{recursive:!0}),console.log(`
3
+ Scaffolding project in ${i}...`);let V=R?.name||t,F=g.isModuleType??p.module,N=r=>o.join(U(import.meta.url),"../..",`template-${r}`),P=N(V);[P,N("config")].forEach(r=>{let l=s.readdirSync(r);for(let v of l){let u=B[v]??v;F&&u.endsWith("rc.js")&&(u=u.replace(".js",".cjs"));let I=o.join(i,u);j(o.join(r,v),I)}});let f=JSON.parse(s.readFileSync(o.join(P,"package.json"),"utf-8"));f.name=O||c(),F?f.type="module":delete f.type,s.writeFileSync(o.join(i,"package.json"),JSON.stringify(f,null,2)+`
4
+ `);let T=b(process.env.npm_config_user_agent),d=T?T.name:"npm",y=o.relative(h,i);switch(console.log(`
5
+ Done. Now run:
6
+ `),i!==h&&console.log(` cd ${y.includes(" ")?`"${y}"`:y}`),d){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${d} install`),console.log(` ${d} run dev`);break}}G().catch(()=>{});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomjs/create-app",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "create tomjs web app",
5
5
  "keywords": [
6
6
  "tomjs",
@@ -15,22 +15,31 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
+ "template-*",
18
19
  "*.md"
19
20
  ],
20
- "main": "./dist/index.js",
21
+ "main": "./dist/index.mjs",
21
22
  "bin": {
22
- "create-app": "./dist/index.js"
23
+ "create-app": "./dist/index.mjs"
23
24
  },
24
25
  "engines": {
25
26
  "node": ">=18"
26
27
  },
28
+ "dependencies": {
29
+ "cross-spawn": "^7.0.3",
30
+ "kolorist": "^1.8.0",
31
+ "minimist": "^1.2.8",
32
+ "prompts": "^2.4.2"
33
+ },
27
34
  "devDependencies": {
28
- "@commitlint/cli": "^18.4.1",
29
- "@tomjs/commitlint": "^1.0.4",
30
- "@tomjs/eslint": "^1.0.6",
31
- "@tomjs/prettier": "^1.0.4",
35
+ "@commitlint/cli": "^18.4.2",
36
+ "@tomjs/commitlint": "^2.0.3",
37
+ "@tomjs/eslint": "^1.0.7",
38
+ "@tomjs/prettier": "^1.0.5",
32
39
  "@tomjs/tsconfig": "^1.0.6",
40
+ "@types/minimist": "^1.2.5",
33
41
  "@types/node": "^18.18.9",
42
+ "@types/prompts": "^2.4.8",
34
43
  "eslint": "^8.53.0",
35
44
  "husky": "^8.0.3",
36
45
  "lint-staged": "^15.1.0",
@@ -41,11 +50,10 @@
41
50
  "typescript": "^5.2.2"
42
51
  },
43
52
  "scripts": {
44
- "dev": "tsup src/index.ts --format cjs --watch",
45
- "build": "tsup src/index.ts --format cjs",
53
+ "dev": "tsup --watch",
54
+ "build": "tsup --minify",
46
55
  "lint": "run-s lint:eslint lint:prettier",
47
56
  "lint:eslint": "eslint \"src/**/*.{js,cjs,ts}\" *.{js,cjs,ts} --fix --cache",
48
- "lint:prettier": "prettier --write \"src/**/*.{js,cjs,ts,json,md}\" *.{js,cjs,ts,json,md}",
49
- "release": "npm run build && np --any-branch --no-yarn --yolo --no-publish --message \"chore: release v%s\""
57
+ "lint:prettier": "prettier --write \"src/**/*.{js,cjs,ts,json,md}\" *.{js,cjs,ts,json,md}"
50
58
  }
51
59
  }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: [require.resolve('@tomjs/commitlint')],
3
+ };
@@ -0,0 +1,15 @@
1
+ # 🎨 editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ indent_style = space
9
+ indent_size = 2
10
+ trim_trailing_whitespace = true
11
+ insert_final_newline = true
12
+
13
+ [*.md]
14
+ insert_final_newline = false
15
+ trim_trailing_whitespace = false
@@ -0,0 +1,14 @@
1
+ # IDE
2
+ .vscode
3
+ .idea
4
+ .history
5
+ .git
6
+
7
+ # temp
8
+ .cache
9
+ .temp
10
+ .tmp
11
+
12
+ # project
13
+ node_modules
14
+ dist
@@ -0,0 +1,199 @@
1
+ ## GITATTRIBUTES FOR WEB PROJECTS
2
+ #
3
+ # These settings are for any web project.
4
+ #
5
+ # Details per file setting:
6
+ # text These files should be normalized (i.e. convert CRLF to LF).
7
+ # binary These files are binary and should be left untouched.
8
+ #
9
+ # Note that binary is a macro for -text -diff.
10
+ ######################################################################
11
+
12
+ ## AUTO-DETECT
13
+ ## Handle line endings automatically for files detected as
14
+ ## text and leave all files detected as binary untouched.
15
+ ## This will handle all files NOT defined below.
16
+ * text eol=lf
17
+
18
+ ## SOURCE CODE
19
+ *.bat text eol=crlf
20
+ *.coffee text
21
+ *.css text
22
+ *.htm text
23
+ *.html text
24
+ *.inc text
25
+ *.ini text
26
+ *.java text
27
+ *.js text
28
+ *.json text
29
+ *.jsx text
30
+ *.less text
31
+ *.od text
32
+ *.onlydata text
33
+ *.php text
34
+ *.pl text
35
+ *.py text
36
+ *.rb text
37
+ *.sass text
38
+ *.scm text
39
+ *.scss text
40
+ *.sh text eol=lf
41
+ *.sql text
42
+ *.styl text
43
+ *.tag text
44
+ *.ts text
45
+ *.tsx text
46
+ *.xml text
47
+ *.xhtml text
48
+
49
+ ## DOCKER
50
+ *.dockerignore text
51
+ Dockerfile text
52
+
53
+ ## DOCUMENTATION
54
+ *.markdown text
55
+ *.md text
56
+ *.mdwn text
57
+ *.mdown text
58
+ *.mkd text
59
+ *.mkdn text
60
+ *.mdtxt text
61
+ *.mdtext text
62
+ *.txt text
63
+ AUTHORS text
64
+ CHANGELOG text
65
+ CHANGES text
66
+ CONTRIBUTING text
67
+ COPYING text
68
+ copyright text
69
+ *COPYRIGHT* text
70
+ INSTALL text
71
+ license text
72
+ LICENSE text
73
+ NEWS text
74
+ readme text
75
+ *README* text
76
+
77
+ ## TEMPLATES
78
+ *.dot text
79
+ *.ejs text
80
+ *.haml text
81
+ *.handlebars text
82
+ *.hbs text
83
+ *.hbt text
84
+ *.jade text
85
+ *.latte text
86
+ *.mustache text
87
+ *.njk text
88
+ *.phtml text
89
+ *.tmpl text
90
+ *.tpl text
91
+ *.twig text
92
+
93
+ ## LINTERS
94
+ .csslintrc text
95
+ .eslintrc text
96
+ .jscsrc text
97
+ .jshintrc text
98
+ .jshintignore text
99
+ .stylelintrc text
100
+
101
+ ## CONFIGS
102
+ *.bowerrc text
103
+ *.cnf text
104
+ *.conf text
105
+ *.config text
106
+ .browserslistrc text
107
+ .editorconfig text
108
+ .gitattributes text
109
+ .gitconfig text
110
+ .gitignore text
111
+ .htaccess text
112
+ *.npmignore text
113
+ *.yaml text
114
+ *.yml text
115
+ browserslist text
116
+ Makefile text
117
+ makefile text
118
+
119
+ ## HEROKU
120
+ Procfile text
121
+ .slugignore text
122
+
123
+ ## GRAPHICS
124
+ *.ai binary
125
+ *.bmp binary
126
+ *.eps binary
127
+ *.gif binary
128
+ *.ico binary
129
+ *.jng binary
130
+ *.jp2 binary
131
+ *.jpg binary
132
+ *.jpeg binary
133
+ *.jpx binary
134
+ *.jxr binary
135
+ *.pdf binary
136
+ *.png binary
137
+ *.psb binary
138
+ *.psd binary
139
+ *.svg text
140
+ *.svgz binary
141
+ *.tif binary
142
+ *.tiff binary
143
+ *.wbmp binary
144
+ *.webp binary
145
+
146
+ ## AUDIO
147
+ *.kar binary
148
+ *.m4a binary
149
+ *.mid binary
150
+ *.midi binary
151
+ *.mp3 binary
152
+ *.ogg binary
153
+ *.ra binary
154
+
155
+ ## VIDEO
156
+ *.3gpp binary
157
+ *.3gp binary
158
+ *.as binary
159
+ *.asf binary
160
+ *.asx binary
161
+ *.fla binary
162
+ *.flv binary
163
+ *.m4v binary
164
+ *.mng binary
165
+ *.mov binary
166
+ *.mp4 binary
167
+ *.mpeg binary
168
+ *.mpg binary
169
+ *.swc binary
170
+ *.swf binary
171
+ *.webm binary
172
+
173
+ ## ARCHIVES
174
+ *.7z binary
175
+ *.gz binary
176
+ *.rar binary
177
+ *.tar binary
178
+ *.zip binary
179
+
180
+ ## FONTS
181
+ *.ttf binary
182
+ *.eot binary
183
+ *.otf binary
184
+ *.woff binary
185
+ *.woff2 binary
186
+
187
+ ## EXECUTABLES
188
+ *.exe binary
189
+ *.pyc binary
190
+ *.jar binary
191
+ *.dll binary
192
+
193
+ ## DOCUMENT
194
+ *.doc binary
195
+ *.docx binary
196
+ *.xls binary
197
+ *.xlsx binary
198
+ *.ppt binary
199
+ *.pptx binary
@@ -0,0 +1,17 @@
1
+ # IDE
2
+ .vscode
3
+ .idea
4
+ .history
5
+ .git
6
+
7
+ # temp
8
+ .cache
9
+ .temp
10
+ .tmp
11
+
12
+ # project
13
+ node_modules
14
+ dist
15
+
16
+ # file
17
+ pnpm-lock.yaml
@@ -0,0 +1 @@
1
+ module.exports = require.resolve('@tomjs/prettier');
@@ -0,0 +1,16 @@
1
+ # IDE
2
+ .vscode
3
+ .idea
4
+ .history
5
+ .git
6
+
7
+ # temp
8
+ .cache
9
+ .temp
10
+ .tmp
11
+
12
+ # project
13
+ node_modules
14
+ public
15
+ dist
16
+ build
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: [require.resolve('@tomjs/stylelint/vue')],
3
+ };
@@ -0,0 +1,58 @@
1
+ # logs
2
+ *.log
3
+ lerna-debug.log*
4
+ logs
5
+ npm-debug.log*
6
+ pnpm-debug.log*
7
+ yarn-debug.log*
8
+ yarn-error.log*
9
+
10
+ # diagnostic reports (https://nodejs.org/api/report.html)
11
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12
+
13
+ # runtime data
14
+ *.pid
15
+ *.pid.lock
16
+ *.seed
17
+ pids
18
+
19
+ # dependency directory
20
+ bower_components
21
+ jspm_packages
22
+ node_modules
23
+ web_modules
24
+
25
+ # cache
26
+ .cache
27
+ .npm
28
+ .tmp
29
+ .temp
30
+ .eslintcache
31
+ .stylelintcache
32
+ tsconfig.tsbuildinfo
33
+
34
+ # environment
35
+ *.local
36
+
37
+ # macOS
38
+ .DS_Store
39
+
40
+ # package files
41
+ *.7z
42
+ *.gz
43
+ *.gzip
44
+ *.rar
45
+ *.tar
46
+ *.tar.*
47
+ *.tgz
48
+ *.zip
49
+
50
+ # IDEA
51
+ .idea
52
+
53
+ # vscode
54
+ .history
55
+
56
+ # build output
57
+ build
58
+ dist
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ env: {
3
+ node: true,
4
+ es6: true,
5
+ },
6
+ extends: [require.resolve('@tomjs/eslint/react/typescript')],
7
+ };
@@ -0,0 +1,3 @@
1
+ # react
2
+
3
+ react project
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ '*.{js,cjs,ts,tsx}': ['eslint --fix', 'prettier --write'],
3
+ '*.{json,md}': ['prettier --write'],
4
+ '*.{css,scss,less,html}': ['stylelint --fix', 'prettier --write'],
5
+ };
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Vite + React + TS</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="root"></div>
13
+ <script type="module" src="/src/main.tsx"></script>
14
+ </body>
15
+
16
+ </html>
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "template-react",
3
+ "version": "0.0.0",
4
+ "type": "commonjs",
5
+ "engines": {
6
+ "node": ">=18"
7
+ },
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "build": "tsc && vite build",
11
+ "preview": "vite preview",
12
+ "lint": "run-s lint:eslint lint:stylelint lint:prettier",
13
+ "lint:eslint": "eslint \"src/**/*.{ts,tsx}\" *.{js,cjs,ts} --fix --cache",
14
+ "lint:stylelint": "stylelint \"src/**/*.{css,scss,less,html}\" --fix --cache",
15
+ "lint:prettier": "prettier --write .",
16
+ "prepare": "husky install"
17
+ },
18
+ "dependencies": {
19
+ "react": "^18.2.0",
20
+ "react-dom": "^18.2.0"
21
+ },
22
+ "devDependencies": {
23
+ "@commitlint/cli": "^18.4.2",
24
+ "@tomjs/commitlint": "^2.0.3",
25
+ "@tomjs/eslint": "^1.0.7",
26
+ "@tomjs/prettier": "^1.0.5",
27
+ "@tomjs/stylelint": "^1.0.5",
28
+ "@tomjs/tsconfig": "^1.0.6",
29
+ "@types/react": "^18.2.37",
30
+ "@types/react-dom": "^18.2.15",
31
+ "@vitejs/plugin-react-swc": "^3.4.1",
32
+ "eslint": "^8.53.0",
33
+ "husky": "^8.0.3",
34
+ "lint-staged": "^15.1.0",
35
+ "npm-run-all": "^4.1.5",
36
+ "prettier": "^3.1.0",
37
+ "stylelint": "^15.11.0",
38
+ "typescript": "^5.2.2",
39
+ "vite": "^4.5.0"
40
+ }
41
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,42 @@
1
+ #root {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
+ transition: filter 300ms;
13
+ }
14
+ .logo:hover {
15
+ filter: drop-shadow(0 0 2em #646cffaa);
16
+ }
17
+ .logo.react:hover {
18
+ filter: drop-shadow(0 0 2em #61dafbaa);
19
+ }
20
+
21
+ @keyframes logo-spin {
22
+ from {
23
+ transform: rotate(0deg);
24
+ }
25
+ to {
26
+ transform: rotate(360deg);
27
+ }
28
+ }
29
+
30
+ @media (prefers-reduced-motion: no-preference) {
31
+ a:nth-of-type(2) .logo {
32
+ animation: logo-spin infinite 20s linear;
33
+ }
34
+ }
35
+
36
+ .card {
37
+ padding: 2em;
38
+ }
39
+
40
+ .read-the-docs {
41
+ color: #888;
42
+ }
@@ -0,0 +1,32 @@
1
+ import { useState } from 'react';
2
+ import viteLogo from '/vite.svg';
3
+ import reactLogo from './assets/react.svg';
4
+
5
+ import './App.css';
6
+
7
+ function App() {
8
+ const [count, setCount] = useState(0);
9
+
10
+ return (
11
+ <>
12
+ <div>
13
+ <a href="https://vitejs.dev" target="_blank">
14
+ <img src={viteLogo} className="logo" alt="Vite logo" />
15
+ </a>
16
+ <a href="https://react.dev" target="_blank">
17
+ <img src={reactLogo} className="logo react" alt="React logo" />
18
+ </a>
19
+ </div>
20
+ <h1>Vite + React</h1>
21
+ <div className="card">
22
+ <button onClick={() => setCount(count => count + 1)}>count is {count}</button>
23
+ <p>
24
+ Edit <code>src/App.tsx</code> and save to test HMR
25
+ </p>
26
+ </div>
27
+ <p className="read-the-docs">Click on the Vite and React logos to learn more</p>
28
+ </>
29
+ );
30
+ }
31
+
32
+ export default App;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -0,0 +1,69 @@
1
+ :root {
2
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ -webkit-text-size-adjust: 100%;
15
+ }
16
+
17
+ a {
18
+ font-weight: 500;
19
+ color: #646cff;
20
+ text-decoration: inherit;
21
+ }
22
+ a:hover {
23
+ color: #535bf2;
24
+ }
25
+
26
+ body {
27
+ margin: 0;
28
+ display: flex;
29
+ place-items: center;
30
+ min-width: 320px;
31
+ min-height: 100vh;
32
+ }
33
+
34
+ h1 {
35
+ font-size: 3.2em;
36
+ line-height: 1.1;
37
+ }
38
+
39
+ button {
40
+ border-radius: 8px;
41
+ border: 1px solid transparent;
42
+ padding: 0.6em 1.2em;
43
+ font-size: 1em;
44
+ font-weight: 500;
45
+ font-family: inherit;
46
+ background-color: #1a1a1a;
47
+ cursor: pointer;
48
+ transition: border-color 0.25s;
49
+ }
50
+ button:hover {
51
+ border-color: #646cff;
52
+ }
53
+ button:focus,
54
+ button:focus-visible {
55
+ outline: 4px auto -webkit-focus-ring-color;
56
+ }
57
+
58
+ @media (prefers-color-scheme: light) {
59
+ :root {
60
+ color: #213547;
61
+ background-color: #ffffff;
62
+ }
63
+ a:hover {
64
+ color: #747bff;
65
+ }
66
+ button {
67
+ background-color: #f9f9f9;
68
+ }
69
+ }
@@ -0,0 +1,11 @@
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
+ );
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "@tomjs/tsconfig/react.json",
3
+ "include": ["src"],
4
+ "references": [{ "path": "./tsconfig.node.json" }]
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "@tomjs/tsconfig/node.json",
3
+ "compilerOptions": {
4
+ "composite": true
5
+ },
6
+ "include": ["vite.config.ts"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react-swc';
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ });
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ env: {
3
+ node: true,
4
+ es6: true,
5
+ },
6
+ extends: [require.resolve('@tomjs/eslint/vue/typescript')],
7
+ };
@@ -0,0 +1,18 @@
1
+ # Vue 3 + TypeScript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8
+
9
+ ## Type Support For `.vue` Imports in TS
10
+
11
+ TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
12
+
13
+ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
14
+
15
+ 1. Disable the built-in TypeScript Extension
16
+ 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17
+ 2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18
+ 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ '*.{js,cjs,ts,tsx}': ['eslint --fix', 'prettier --write'],
3
+ '*.{json,md}': ['prettier --write'],
4
+ '*.vue': ['eslint --fix', 'stylelint --fix', 'prettier --write'],
5
+ '*.{css,scss,less,html}': ['stylelint --fix', 'prettier --write'],
6
+ };
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Vite + Vue + TS</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script type="module" src="/src/main.ts"></script>
14
+ </body>
15
+
16
+ </html>
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "template-vue",
3
+ "version": "0.0.0",
4
+ "type": "commonjs",
5
+ "engines": {
6
+ "node": ">=18"
7
+ },
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "build": "vue-tsc --noEmit && vite build",
11
+ "preview": "vite preview",
12
+ "lint": "run-s lint:eslint lint:stylelint lint:prettier",
13
+ "lint:eslint": "eslint \"src/**/*.{ts,tsx,vue}\" *.{js,cjs,ts} --fix --cache",
14
+ "lint:stylelint": "stylelint \"src/**/*.{css,scss,less,vue,html}\" --fix --cache",
15
+ "lint:prettier": "prettier --write .",
16
+ "prepare": "husky install"
17
+ },
18
+ "dependencies": {
19
+ "vue": "^3.3.8"
20
+ },
21
+ "devDependencies": {
22
+ "@commitlint/cli": "^18.4.2",
23
+ "@tomjs/commitlint": "^2.0.3",
24
+ "@tomjs/eslint": "^1.0.7",
25
+ "@tomjs/prettier": "^1.0.5",
26
+ "@tomjs/stylelint": "^1.0.5",
27
+ "@tomjs/tsconfig": "^1.0.6",
28
+ "@vitejs/plugin-vue": "^4.5.0",
29
+ "eslint": "^8.53.0",
30
+ "husky": "^8.0.3",
31
+ "lint-staged": "^15.1.0",
32
+ "npm-run-all": "^4.1.5",
33
+ "prettier": "^3.1.0",
34
+ "stylelint": "^15.11.0",
35
+ "typescript": "^5.2.2",
36
+ "vite": "^4.5.0",
37
+ "vue-tsc": "^1.8.22"
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,32 @@
1
+ <script setup lang="ts">
2
+ import HelloWorld from './components/HelloWorld.vue';
3
+ </script>
4
+
5
+ <template>
6
+ <div>
7
+ <a href="https://vitejs.dev" target="_blank">
8
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
9
+ </a>
10
+ <a href="https://vuejs.org/" target="_blank">
11
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
12
+ </a>
13
+ </div>
14
+ <HelloWorld msg="Vite + Vue" />
15
+ </template>
16
+
17
+ <style scoped>
18
+ .logo {
19
+ height: 6em;
20
+ padding: 1.5em;
21
+ will-change: filter;
22
+ transition: filter 300ms;
23
+ }
24
+
25
+ .logo:hover {
26
+ filter: drop-shadow(0 0 2em #646cffaa);
27
+ }
28
+
29
+ .logo.vue:hover {
30
+ filter: drop-shadow(0 0 2em #42b883aa);
31
+ }
32
+ </style>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
@@ -0,0 +1,37 @@
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>
@@ -0,0 +1,6 @@
1
+ import { createApp } from 'vue';
2
+ import App from './App.vue';
3
+
4
+ import './style.css';
5
+
6
+ createApp(App).mount('#app');
@@ -0,0 +1,80 @@
1
+ :root {
2
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ -webkit-text-size-adjust: 100%;
15
+ }
16
+
17
+ a {
18
+ font-weight: 500;
19
+ color: #646cff;
20
+ text-decoration: inherit;
21
+ }
22
+ a:hover {
23
+ color: #535bf2;
24
+ }
25
+
26
+ body {
27
+ margin: 0;
28
+ display: flex;
29
+ place-items: center;
30
+ min-width: 320px;
31
+ min-height: 100vh;
32
+ }
33
+
34
+ h1 {
35
+ font-size: 3.2em;
36
+ line-height: 1.1;
37
+ }
38
+
39
+ button {
40
+ border-radius: 8px;
41
+ border: 1px solid transparent;
42
+ padding: 0.6em 1.2em;
43
+ font-size: 1em;
44
+ font-weight: 500;
45
+ font-family: inherit;
46
+ background-color: #1a1a1a;
47
+ cursor: pointer;
48
+ transition: border-color 0.25s;
49
+ }
50
+ button:hover {
51
+ border-color: #646cff;
52
+ }
53
+ button:focus,
54
+ button:focus-visible {
55
+ outline: 4px auto -webkit-focus-ring-color;
56
+ }
57
+
58
+ .card {
59
+ padding: 2em;
60
+ }
61
+
62
+ #app {
63
+ max-width: 1280px;
64
+ margin: 0 auto;
65
+ padding: 2rem;
66
+ text-align: center;
67
+ }
68
+
69
+ @media (prefers-color-scheme: light) {
70
+ :root {
71
+ color: #213547;
72
+ background-color: #ffffff;
73
+ }
74
+ a:hover {
75
+ color: #747bff;
76
+ }
77
+ button {
78
+ background-color: #f9f9f9;
79
+ }
80
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "@tomjs/tsconfig/vue.json",
3
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
4
+ "references": [{ "path": "./tsconfig.node.json" }]
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "@tomjs/tsconfig/node.json",
3
+ "compilerOptions": {
4
+ "composite": true
5
+ },
6
+ "include": ["vite.config.ts"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+ import vue from '@vitejs/plugin-vue';
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ });
package/dist/index.js DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- // src/index.ts
5
- console.log("Hello World!");