@tomjs/create-app 0.0.9 → 0.0.11
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/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/template-electron-react/README.md +3 -3
- package/template-electron-vue/README.md +3 -3
- package/template-config/.commitlintrc.cjs +0 -3
- package/template-config/.editorconfig +0 -15
- package/template-config/.eslintignore +0 -14
- package/template-config/.gitattributes +0 -199
- package/template-config/.husky/commit-msg +0 -5
- package/template-config/.husky/common.sh +0 -9
- package/template-config/.husky/pre-commit +0 -5
- package/template-config/.prettierignore +0 -17
- package/template-config/.prettierrc.cjs +0 -1
- package/template-config/.stylelintignore +0 -16
- package/template-config/.stylelintrc.cjs +0 -3
- package/template-config/_gitignore +0 -58
- package/template-electron-react/.eslintrc.cjs +0 -7
- package/template-electron-react/.vscode/.debug.env +0 -1
- package/template-electron-react/.vscode/.debug.script.mjs +0 -23
- package/template-electron-react/.vscode/extensions.json +0 -6
- package/template-electron-react/.vscode/launch.json +0 -53
- package/template-electron-react/.vscode/settings.json +0 -13
- package/template-electron-react/.vscode/tasks.json +0 -31
- package/template-electron-react/_lintstagedrc.cjs +0 -5
- package/template-electron-react/electron/electron-env.d.ts +0 -11
- package/template-electron-react/electron/main/index.ts +0 -119
- package/template-electron-react/electron/preload/index.ts +0 -0
- package/template-electron-react/index.html +0 -15
- package/template-electron-react/package.json +0 -60
- package/template-electron-react/public/img/icon.png +0 -0
- package/template-electron-react/public/vite.svg +0 -1
- package/template-electron-react/scripts/builder.ts +0 -38
- package/template-electron-react/scripts/constants.ts +0 -19
- package/template-electron-react/scripts/release.ts +0 -41
- package/template-electron-react/src/App.css +0 -45
- package/template-electron-react/src/App.tsx +0 -40
- package/template-electron-react/src/assets/electron.svg +0 -10
- package/template-electron-react/src/assets/react.svg +0 -1
- package/template-electron-react/src/index.css +0 -69
- package/template-electron-react/src/main.tsx +0 -11
- package/template-electron-react/src/vite-env.d.ts +0 -1
- package/template-electron-react/tsconfig.json +0 -10
- package/template-electron-react/tsconfig.node.json +0 -7
- package/template-electron-react/vite.config.ts +0 -111
- package/template-electron-vue/.eslintrc.cjs +0 -7
- package/template-electron-vue/.vscode/.debug.env +0 -1
- package/template-electron-vue/.vscode/.debug.script.mjs +0 -23
- package/template-electron-vue/.vscode/extensions.json +0 -6
- package/template-electron-vue/.vscode/launch.json +0 -53
- package/template-electron-vue/.vscode/settings.json +0 -13
- package/template-electron-vue/.vscode/tasks.json +0 -31
- package/template-electron-vue/_lintstagedrc.cjs +0 -6
- package/template-electron-vue/electron/electron-env.d.ts +0 -11
- package/template-electron-vue/electron/main/index.ts +0 -119
- package/template-electron-vue/electron/preload/index.ts +0 -0
- package/template-electron-vue/index.html +0 -15
- package/template-electron-vue/package.json +0 -54
- package/template-electron-vue/public/img/icon.png +0 -0
- package/template-electron-vue/public/vite.svg +0 -1
- package/template-electron-vue/scripts/builder.ts +0 -38
- package/template-electron-vue/scripts/constants.ts +0 -19
- package/template-electron-vue/scripts/release.ts +0 -41
- package/template-electron-vue/src/App.vue +0 -43
- package/template-electron-vue/src/assets/electron.svg +0 -10
- package/template-electron-vue/src/assets/vue.svg +0 -1
- package/template-electron-vue/src/components/HelloWorld.vue +0 -37
- package/template-electron-vue/src/main.ts +0 -6
- package/template-electron-vue/src/style.css +0 -80
- package/template-electron-vue/src/vite-env.d.ts +0 -1
- package/template-electron-vue/tsconfig.json +0 -10
- package/template-electron-vue/tsconfig.node.json +0 -7
- package/template-electron-vue/vite.config.ts +0 -111
- package/template-node/.eslintrc.cjs +0 -7
- package/template-node/_lintstagedrc.cjs +0 -4
- package/template-node/package.json +0 -47
- package/template-node/src/index.ts +0 -14
- package/template-node/tsconfig.json +0 -7
- package/template-node/tsup.config.ts +0 -11
- package/template-react/.eslintrc.cjs +0 -7
- package/template-react/_lintstagedrc.cjs +0 -5
- package/template-react/index.html +0 -14
- package/template-react/package.json +0 -43
- package/template-react/public/vite.svg +0 -1
- package/template-react/src/App.css +0 -42
- package/template-react/src/App.tsx +0 -32
- package/template-react/src/assets/react.svg +0 -1
- package/template-react/src/index.css +0 -69
- package/template-react/src/main.tsx +0 -11
- package/template-react/src/vite-env.d.ts +0 -1
- package/template-react/tsconfig.json +0 -5
- package/template-react/tsconfig.node.json +0 -7
- package/template-react/vite.config.ts +0 -7
- package/template-vue/.eslintrc.cjs +0 -7
- package/template-vue/_lintstagedrc.cjs +0 -6
- package/template-vue/index.html +0 -14
- package/template-vue/package.json +0 -41
- package/template-vue/public/vite.svg +0 -1
- package/template-vue/src/App.vue +0 -32
- package/template-vue/src/assets/vue.svg +0 -1
- package/template-vue/src/components/HelloWorld.vue +0 -37
- package/template-vue/src/main.ts +0 -6
- package/template-vue/src/style.css +0 -80
- package/template-vue/src/vite-env.d.ts +0 -1
- package/template-vue/tsconfig.json +0 -5
- package/template-vue/tsconfig.node.json +0 -7
- package/template-vue/vite.config.ts +0 -7
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import l from"fs";import a from"path";import{fileURLToPath as K}from"url";import{blue as w,cyan as q,green as B,red as T,reset as p,yellow as $}from"kolorist";import G from"minimist";import H from"prompts";import s from"fs";import d from"path";function b(e){return[["t","template"]].forEach(([t,n])=>{e[n]=e[n]??e[t]}),e}function C(e){let t=s.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function y(e){return e?.trim().replace(/\/+$/g,"")}function J(e,t){s.mkdirSync(t,{recursive:!0});for(let n of s.readdirSync(e)){let m=d.resolve(e,n),g=d.resolve(t,n);v(m,g)}}function v(e,t){s.statSync(e).isDirectory()?J(e,t):s.copyFileSync(e,t)}function E(e){if(s.existsSync(e))for(let t of s.readdirSync(e))t!==".git"&&s.rmSync(d.resolve(e,t),{recursive:!0,force:!0})}function k(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function A(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function D(e){if(!e)return;let n=e.split(" ")[0].split("/");return{name:n[0],version:n[1]}}var S=b(G(process.argv.slice(2),{string:["_"]})),F=process.cwd(),V=[{name:"vue",display:"Vue",color:B,variants:[{name:"vue",display:"Web",color:w},{name:"electron-vue",display:"Electron",color:$}]},{name:"react",display:"React",color:q,variants:[{name:"react",display:"Web",color:w},{name:"electron-react",display:"Electron",color:$}]},{name:"node",display:"Node",color:w}],R=V.map(e=>e.variants&&e.variants.map(t=>t.name)||[e.name]).reduce((e,t)=>e.concat(t),[]),Q={_gitignore:".gitignore","_lintstagedrc.cjs":".lintstagedrc.cjs"},h="my-app";async function X(){let e=y(S._[0]),t=S.template||S.t,n=e||h,m=()=>n==="."?a.basename(a.resolve()):n,g={};g=await H([{type:e?null:"text",name:"projectName",message:p("Project name:"),initial:h,onState:r=>{n=y(r.value)||h}},{type:()=>!l.existsSync(n)||C(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:o})=>{if(o===!1)throw console.log(T("\u2716")+" Operation cancelled"),new Error;return null},name:"overwriteChecker"},{type:()=>k(m())?null:"text",name:"packageName",message:p("Package name:"),initial:()=>A(m()),validate:r=>k(r)||"Invalid package.json name"},{type:t&&R.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!R.includes(t)?p(`"${t}" isn't a valid template. Please choose from below: `):p("Select a framework:"),initial:0,choices:V.map(r=>{let o=r.color;return{title:o(r.display||r.name),value:r}})},{type:r=>r&&r.variants?"select":null,name:"variant",message:p("Select a variant:"),choices:r=>r?.variants?.map(o=>{let c=o.color;return{title:c(o.display||o.name),value:o.name}})}],{onCancel:()=>{throw console.log(T("\u2716")+" Operation cancelled"),new Error}});let{framework:z,overwrite:O,packageName:L,variant:M}=g,i=a.join(F,n);O?E(i):l.existsSync(i)||l.mkdirSync(i,{recursive:!0}),console.log(`
|
|
3
|
-
Scaffolding project in ${i}...`);let j=M||z?.name||t||"",x=r=>a.join(K(import.meta.url),"../..",`template-${r}`),N=x(j),U=j.includes("node");[N,x("config")].forEach(r=>{let o=l.readdirSync(r);for(let c of o){let W=Q[c]??c;if(U&&c.includes("stylelint"))
|
|
3
|
+
Scaffolding project in ${i}...`);let j=M||z?.name||t||"",x=r=>a.join(K(import.meta.url),"../..",`template-${r}`),N=x(j),U=j.includes("node");[N,x("config")].forEach(r=>{let o=l.readdirSync(r);for(let c of o){let W=Q[c]??c;if(U&&c.includes("stylelint"))continue;let I=a.join(i,W);v(a.join(r,c),I)}});let P=JSON.parse(l.readFileSync(a.join(N,"package.json"),"utf-8"));P.name=L||m(),l.writeFileSync(a.join(i,"package.json"),JSON.stringify(P,null,2)+`
|
|
4
4
|
`);let _=D(process.env.npm_config_user_agent),u=_?_.name:"npm",f=a.relative(F,i);switch(console.log(`
|
|
5
5
|
Done. Now run:
|
|
6
6
|
`),i!==F&&console.log(` cd ${f.includes(" ")?`"${f}"`:f}`),u){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${u} install`),console.log(` ${u} run dev`);break}}X().catch(e=>{e.message&&console.error(e)});
|
package/package.json
CHANGED
|
@@ -17,9 +17,9 @@ vite + electron + react
|
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
├─┬ dist
|
|
20
|
-
│ ├── main.
|
|
21
|
-
│ ├── preload.
|
|
22
|
-
│ ├─┬ render
|
|
20
|
+
│ ├── main.js > Electron-Main
|
|
21
|
+
│ ├── preload.js > Preload-Scripts
|
|
22
|
+
│ ├─┬ render > Electron-Renderer
|
|
23
23
|
│ │ └── index.html
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -17,9 +17,9 @@ vite + electron + vue
|
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
├─┬ dist
|
|
20
|
-
│ ├── main.
|
|
21
|
-
│ ├── preload.
|
|
22
|
-
│ ├─┬ render
|
|
20
|
+
│ ├── main.js > Electron-Main
|
|
21
|
+
│ ├── preload.js > Preload-Scripts
|
|
22
|
+
│ ├─┬ render > Electron-Renderer
|
|
23
23
|
│ │ └── index.html
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1,199 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require.resolve('@tomjs/prettier');
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VITE_DEV_SERVER_URL=http://127.0.0.1:6888/
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import { createRequire } from 'node:module'
|
|
5
|
-
import { spawn } from 'node:child_process'
|
|
6
|
-
|
|
7
|
-
const pkg = createRequire(import.meta.url)('../package.json')
|
|
8
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
9
|
-
|
|
10
|
-
// write .debug.env
|
|
11
|
-
const envContent = Object.entries(pkg.debug.env).map(([key, val]) => `${key}=${val}`)
|
|
12
|
-
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
|
|
13
|
-
|
|
14
|
-
// bootstrap
|
|
15
|
-
spawn(
|
|
16
|
-
// TODO: terminate `npm run dev` when Debug exits.
|
|
17
|
-
process.platform === 'win32' ? 'npm.cmd' : 'npm',
|
|
18
|
-
['run', 'dev'],
|
|
19
|
-
{
|
|
20
|
-
stdio: 'inherit',
|
|
21
|
-
env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }),
|
|
22
|
-
},
|
|
23
|
-
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"compounds": [
|
|
7
|
-
{
|
|
8
|
-
"name": "Debug App",
|
|
9
|
-
"preLaunchTask": "Before Debug",
|
|
10
|
-
"configurations": [
|
|
11
|
-
"Debug Main Process",
|
|
12
|
-
"Debug Renderer Process"
|
|
13
|
-
],
|
|
14
|
-
"presentation": {
|
|
15
|
-
"hidden": false,
|
|
16
|
-
"group": "",
|
|
17
|
-
"order": 1
|
|
18
|
-
},
|
|
19
|
-
"stopAll": true
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"configurations": [
|
|
23
|
-
{
|
|
24
|
-
"name": "Debug Main Process",
|
|
25
|
-
"type": "node",
|
|
26
|
-
"request": "launch",
|
|
27
|
-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
|
|
28
|
-
"windows": {
|
|
29
|
-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
|
|
30
|
-
},
|
|
31
|
-
"runtimeArgs": [
|
|
32
|
-
"--remote-debugging-port=9229",
|
|
33
|
-
"."
|
|
34
|
-
],
|
|
35
|
-
"envFile": "${workspaceFolder}/.vscode/.debug.env",
|
|
36
|
-
"console": "integratedTerminal"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "Debug Renderer Process",
|
|
40
|
-
"port": 9229,
|
|
41
|
-
"request": "attach",
|
|
42
|
-
"type": "chrome",
|
|
43
|
-
"timeout": 60000,
|
|
44
|
-
"skipFiles": [
|
|
45
|
-
"<node_internals>/**",
|
|
46
|
-
"${workspaceRoot}/node_modules/**",
|
|
47
|
-
"${workspaceRoot}/dist-electron/**",
|
|
48
|
-
// Skip files in host(VITE_DEV_SERVER_URL)
|
|
49
|
-
"http://127.0.0.1:6888/**"
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
]
|
|
53
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
3
|
-
"typescript.tsc.autoDetect": "off",
|
|
4
|
-
"json.schemas": [
|
|
5
|
-
{
|
|
6
|
-
"fileMatch": [
|
|
7
|
-
"/*electron-builder.json5",
|
|
8
|
-
"/*electron-builder.json"
|
|
9
|
-
],
|
|
10
|
-
"url": "https://json.schemastore.org/electron-builder"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
-
// for the documentation about the tasks.json format
|
|
4
|
-
"version": "2.0.0",
|
|
5
|
-
"tasks": [
|
|
6
|
-
{
|
|
7
|
-
"label": "Before Debug",
|
|
8
|
-
"type": "shell",
|
|
9
|
-
"command": "node .vscode/.debug.script.mjs",
|
|
10
|
-
"isBackground": true,
|
|
11
|
-
"problemMatcher": {
|
|
12
|
-
"owner": "typescript",
|
|
13
|
-
"fileLocation": "relative",
|
|
14
|
-
"pattern": {
|
|
15
|
-
// TODO: correct "regexp"
|
|
16
|
-
"regexp": "^([a-zA-Z]\\:\/?([\\w\\-]\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
|
17
|
-
"file": 1,
|
|
18
|
-
"line": 3,
|
|
19
|
-
"column": 4,
|
|
20
|
-
"code": 5,
|
|
21
|
-
"message": 6
|
|
22
|
-
},
|
|
23
|
-
"background": {
|
|
24
|
-
"activeOnStart": true,
|
|
25
|
-
"beginsPattern": "^.*VITE v.* ready in \\d* ms.*$",
|
|
26
|
-
"endsPattern": "^.*\\[startup\\] Electron App.*$"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|