@tomjs/create-app 0.11.4 → 0.11.5
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 +3 -3
- package/template-electron-react/package.json +3 -3
- package/template-electron-vue/package.json +4 -4
- package/template-node/package.json +3 -3
- package/template-react/package.json +2 -2
- package/template-vscode/package.json +12 -6
- package/template-vscode/package.nls.json +4 -0
- package/template-vscode/package.nls.zh-cn.json +4 -0
- package/template-vscode-react/extension/panels/MainPanel.ts +4 -7
- package/template-vscode-react/package.json +14 -6
- package/template-vscode-react/package.nls.json +4 -0
- package/template-vscode-react/package.nls.zh-cn.json +4 -0
- package/template-vscode-vue/extension/panels/MainPanel.ts +4 -7
- package/template-vscode-vue/package.json +15 -6
- package/template-vscode-vue/package.nls.json +4 -0
- package/template-vscode-vue/package.nls.zh-cn.json +4 -0
- package/template-vue/package.json +3 -3
- /package/template-vscode/{images/icon.png → resources/logo.png} +0 -0
- /package/template-vscode-react/{images/icon.png → resources/logo.png} +0 -0
- /package/template-vscode-vue/{images/icon.png → resources/logo.png} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -5,5 +5,5 @@ Scaffolding project in ${a}...`);let _=y||P?.name||r||"",U=t=>c.join(Je(import.m
|
|
|
5
5
|
Done. Now run:
|
|
6
6
|
`),a!==ee&&console.log(` cd ${z.includes(" ")?`"${z}"`:z}`),W){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${W} install`),console.log(` ${W} run dev`);break}function Ae(){Fe(".lintstagedrc.cjs","jest.config.cjs","tsconfig.json","tsup.config.ts");let t=u.find(i=>["vite"].includes(i)),n=["#pnpm",`pnpm add ${f}${t?" -D":""}`,"","#yarn",`yarn add ${f}${t?" -D":""}`,"","#npm",`npm i ${f}${t?" --save-dev":""}`].join(`
|
|
7
7
|
`);["LICENSE","README.md","README.zh_CN.md"].forEach(i=>{let o=c.join(a,i);if(!u.includes("publish")&&s.existsSync(o)){s.rmSync(o),i==="README.md"&&s.writeFileSync(o,`# ${f}
|
|
8
|
-
`,{encoding:"utf-8"});return}if(!s.existsSync(o))return;let m=Object.assign({},J,{"pkg.install":n}),d=s.readFileSync(o,"utf-8");Object.keys(m).forEach(h=>{d=d.replace(new RegExp("{{"+h+"}}","g"),m[h])}),s.writeFileSync(o,d,"utf8")})}function k(t,...n){["dependencies","devDependencies"].forEach(i=>{Object.keys(t[i]||{}).forEach(o=>{n.find(m=>o.includes(m))&&delete t[i][o]})})}function re(...t){!Array.isArray(t)||t.length===0||t.forEach(n=>{let i=c.join(a,n);s.existsSync(i)&&A(i)})}function $e(){let t=c.join(a,"package.json"),n=S(t);n.name=f,u.includes("publish")||(delete n.author,delete n.publishConfig,delete n.repository,delete n.scripts.prepublishOnly,delete n.devDependencies.np),I&&(u.includes("electron")||(k(n,"electron"),n.scripts["lint:eslint"]=n.scripts["lint:eslint"].replace(",electron","")),u.includes("vite")||k(n,"vite")),v(t,n);let i=ue(t);Object.keys(J).forEach(o=>{i=i.replace(new RegExp("{{"+o+"}}","g"),J[o])}),s.writeFileSync(t,i)}function Oe(t,n){let i=t.lastIndexOf("."),o=t.substring(0,i)+"."+n+t.substring(i),m=c.join(a,t),d=c.join(a,o);s.existsSync(d)&&(u.includes(n)?(A(m),Ie(d,m)):A(d))}function Fe(...t){t.forEach(n=>{Be.forEach(i=>{Oe(n,i)})})}function Ce(){let t=c.join(a,"package.json"),n=S(t);if(u.includes("test")){if(u.includes("electron")){k(n,"vitest"),v(t,n);let i=c.join(a,"test/simple.test.ts");if(s.existsSync(i)){let o=s.readFileSync(i,{encoding:"utf8"});s.writeFileSync(i,o.replace("import { describe, expect, it } from 'vitest';",""),{encoding:"utf8"})}}else re("jest.config.cjs");return}delete n.scripts.test,n.scripts["lint:eslint"]=n.scripts["lint:eslint"].replace(",test",""),k(n,"jest","vitest"),re(".lintstagedrc.cjs","jest.config.cjs","test")
|
|
8
|
+
`,{encoding:"utf-8"});return}if(!s.existsSync(o))return;let m=Object.assign({},J,{"pkg.install":n}),d=s.readFileSync(o,"utf-8");Object.keys(m).forEach(h=>{d=d.replace(new RegExp("{{"+h+"}}","g"),m[h])}),s.writeFileSync(o,d,"utf8")})}function k(t,...n){["dependencies","devDependencies"].forEach(i=>{Object.keys(t[i]||{}).forEach(o=>{n.find(m=>o.includes(m))&&delete t[i][o]})})}function re(...t){!Array.isArray(t)||t.length===0||t.forEach(n=>{let i=c.join(a,n);s.existsSync(i)&&A(i)})}function $e(){let t=c.join(a,"package.json"),n=S(t);n.name=f,u.includes("publish")||(delete n.author,delete n.publishConfig,delete n.repository,delete n.scripts.prepublishOnly,delete n.devDependencies.np),I&&(u.includes("electron")||(k(n,"electron"),n.scripts["lint:eslint"]=n.scripts["lint:eslint"].replace(",electron","")),u.includes("vite")||k(n,"vite")),v(t,n);let i=ue(t);Object.keys(J).forEach(o=>{i=i.replace(new RegExp("{{"+o+"}}","g"),J[o])}),s.writeFileSync(t,i)}function Oe(t,n){let i=t.lastIndexOf("."),o=t.substring(0,i)+"."+n+t.substring(i),m=c.join(a,t),d=c.join(a,o);s.existsSync(d)&&(u.includes(n)?(A(m),Ie(d,m)):A(d))}function Fe(...t){t.forEach(n=>{Be.forEach(i=>{Oe(n,i)})})}function Ce(){let t=c.join(a,"package.json"),n=S(t);if(u.includes("test")){if(u.includes("electron")){k(n,"vitest"),v(t,n);let i=c.join(a,"test/simple.test.ts");if(s.existsSync(i)){let o=s.readFileSync(i,{encoding:"utf8"});s.writeFileSync(i,o.replace("import { describe, expect, it } from 'vitest';",""),{encoding:"utf8"})}}else re("jest.config.cjs");return}delete n.scripts.test,n.scripts["lint:eslint"]=n.scripts["lint:eslint"].replace(",test",""),k(n,"jest","vitest"),v(t,n),re(".lintstagedrc.cjs","jest.config.cjs","test")}function De(){if(!u.includes("examples")){let i=S(c.join(a,"package.json"));i.scripts.lint=i.scripts.lint.replace(" lint:stylelint",""),i.scripts["lint:eslint"]=i.scripts["lint:eslint"].replace(",examples",""),delete i.scripts["lint:stylelint"],k(i,"stylelint"),v(c.join(a,"package.json"),i);return}let t=c.join(a,"examples");s.mkdirSync(t);let n=u.includes("electron");["vue","react"].forEach(i=>{let o=U(n?`electron-${i}`:i),m=c.join(t,i);if(!s.existsSync(o)){console.log(`${We(o)} template is not exist`);return}s.cpSync(o,m,{recursive:!0});let d=S(c.join(m,"package.json"));Object.keys(d.scripts).forEach(h=>{(h.startsWith("lint")||["prepare"].includes(h))&&delete d.scripts[h]}),k(d,"eslint","prettier","stylelint","commitlint","husky","lint-staged","tsconfig","lint-staged","npm-run-all"),v(c.join(m,"package.json"),d),["_lintstagedrc.cjs"].forEach(h=>{let oe=c.join(m,h);s.existsSync(oe)&&s.rmSync(oe,{recursive:!0})})}),s.writeFileSync(c.join(a,"pnpm-workspace.yaml"),`packages:
|
|
9
9
|
- 'examples/*'`,{encoding:"utf-8"})}}X().then(async()=>He().catch(e=>{e.message&&console.error(e)})).catch(e=>{e.message&&console.error(e)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/create-app",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"description": "create tomjs web app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tomjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@tomjs/tsconfig": "^1.3.0",
|
|
59
59
|
"@types/lodash-es": "^4.17.12",
|
|
60
60
|
"@types/minimist": "^1.2.5",
|
|
61
|
-
"@types/node": "^18.19.
|
|
61
|
+
"@types/node": "^18.19.8",
|
|
62
62
|
"@types/prompts": "^2.4.9",
|
|
63
63
|
"@types/shelljs": "^0.8.15",
|
|
64
64
|
"cross-env": "^7.0.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"lint-staged": "^15.2.0",
|
|
68
68
|
"np": "^9.2.0",
|
|
69
69
|
"npm-run-all": "^4.1.5",
|
|
70
|
-
"prettier": "^3.2.
|
|
70
|
+
"prettier": "^3.2.4",
|
|
71
71
|
"stylelint": "^16.1.0",
|
|
72
72
|
"tsup": "^8.0.1",
|
|
73
73
|
"typescript": "~5.3.3"
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"@tomjs/stylelint": "^2.2.0",
|
|
33
33
|
"@tomjs/tsconfig": "^1.3.0",
|
|
34
34
|
"@tomjs/vite-plugin-electron": "^1.8.2",
|
|
35
|
-
"@types/node": "^18.19.
|
|
35
|
+
"@types/node": "^18.19.8",
|
|
36
36
|
"@types/react": "^18.2.48",
|
|
37
37
|
"@types/react-dom": "^18.2.18",
|
|
38
38
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
39
39
|
"cross-env": "^7.0.3",
|
|
40
|
-
"electron": "^28.1.
|
|
40
|
+
"electron": "^28.1.4",
|
|
41
41
|
"electron-builder": "^24.9.1",
|
|
42
42
|
"eslint": "^8.56.0",
|
|
43
43
|
"husky": "^8.0.3",
|
|
44
44
|
"lint-staged": "^15.2.0",
|
|
45
45
|
"npm-run-all": "^4.1.5",
|
|
46
|
-
"prettier": "^3.2.
|
|
46
|
+
"prettier": "^3.2.4",
|
|
47
47
|
"rimraf": "^5.0.5",
|
|
48
48
|
"stylelint": "^16.1.0",
|
|
49
49
|
"tsx": "^4.7.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@tomjs/electron-devtools-installer": "^2.1.0",
|
|
24
|
-
"vue": "^3.4.
|
|
24
|
+
"vue": "^3.4.14"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@commitlint/cli": "^18.4.4",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"@tomjs/stylelint": "^2.2.0",
|
|
32
32
|
"@tomjs/tsconfig": "^1.3.0",
|
|
33
33
|
"@tomjs/vite-plugin-electron": "^1.8.2",
|
|
34
|
-
"@types/node": "^18.19.
|
|
34
|
+
"@types/node": "^18.19.8",
|
|
35
35
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
36
36
|
"cross-env": "^7.0.3",
|
|
37
|
-
"electron": "^28.1.
|
|
37
|
+
"electron": "^28.1.4",
|
|
38
38
|
"electron-builder": "^24.9.1",
|
|
39
39
|
"eslint": "^8.56.0",
|
|
40
40
|
"husky": "^8.0.3",
|
|
41
41
|
"lint-staged": "^15.2.0",
|
|
42
42
|
"npm-run-all": "^4.1.5",
|
|
43
|
-
"prettier": "^3.2.
|
|
43
|
+
"prettier": "^3.2.4",
|
|
44
44
|
"rimraf": "^5.0.5",
|
|
45
45
|
"stylelint": "^16.1.0",
|
|
46
46
|
"tsx": "^4.7.0",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
"@tomjs/stylelint": "^2.2.0",
|
|
60
60
|
"@tomjs/tsconfig": "^1.3.0",
|
|
61
61
|
"@types/jest": "^29.5.11",
|
|
62
|
-
"@types/node": "^18.19.
|
|
62
|
+
"@types/node": "^18.19.8",
|
|
63
63
|
"cross-env": "^7.0.3",
|
|
64
|
-
"electron": "^28.1.
|
|
64
|
+
"electron": "^28.1.4",
|
|
65
65
|
"eslint": "^8.56.0",
|
|
66
66
|
"husky": "^8.0.3",
|
|
67
67
|
"jest": "^29.7.0",
|
|
68
68
|
"lint-staged": "^15.2.0",
|
|
69
69
|
"np": "^9.2.0",
|
|
70
70
|
"npm-run-all": "^4.1.5",
|
|
71
|
-
"prettier": "^3.2.
|
|
71
|
+
"prettier": "^3.2.4",
|
|
72
72
|
"rimraf": "^5.0.5",
|
|
73
73
|
"stylelint": "^16.1.0",
|
|
74
74
|
"ts-jest": "^29.1.1",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@tomjs/prettier": "^1.1.1",
|
|
28
28
|
"@tomjs/stylelint": "^2.2.0",
|
|
29
29
|
"@tomjs/tsconfig": "^1.3.0",
|
|
30
|
-
"@types/node": "^18.19.
|
|
30
|
+
"@types/node": "^18.19.8",
|
|
31
31
|
"@types/react": "^18.2.48",
|
|
32
32
|
"@types/react-dom": "^18.2.18",
|
|
33
33
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"husky": "^8.0.3",
|
|
37
37
|
"lint-staged": "^15.2.0",
|
|
38
38
|
"npm-run-all": "^4.1.5",
|
|
39
|
-
"prettier": "^3.2.
|
|
39
|
+
"prettier": "^3.2.4",
|
|
40
40
|
"stylelint": "^16.1.0",
|
|
41
41
|
"typescript": "~5.3.3",
|
|
42
42
|
"vite": "^5.0.11"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"displayName": "
|
|
4
|
-
"description": "",
|
|
2
|
+
"name": "vscode-extension",
|
|
3
|
+
"displayName": "%displayName%",
|
|
4
|
+
"description": "%description%",
|
|
5
5
|
"version": "0.0.0",
|
|
6
6
|
"publisher": "{{git.org}}",
|
|
7
7
|
"license": "MIT",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"vscode": "^1.56.0"
|
|
11
11
|
},
|
|
12
12
|
"main": "dist/index.js",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vscode"
|
|
15
|
+
],
|
|
16
|
+
"categories": [
|
|
17
|
+
"Other"
|
|
18
|
+
],
|
|
13
19
|
"activationEvents": [
|
|
14
20
|
"onCommand:hello-world.showHelloWorld"
|
|
15
21
|
],
|
|
@@ -29,7 +35,7 @@
|
|
|
29
35
|
"url": "git+{{git.url}}/issues"
|
|
30
36
|
},
|
|
31
37
|
"homepage": "{{git.url}}/blob/main/README.md",
|
|
32
|
-
"icon": "
|
|
38
|
+
"icon": "resources/logo.png",
|
|
33
39
|
"vsce": {
|
|
34
40
|
"dependencies": false,
|
|
35
41
|
"yarn": false
|
|
@@ -48,13 +54,13 @@
|
|
|
48
54
|
"@tomjs/eslint": "^1.2.2",
|
|
49
55
|
"@tomjs/prettier": "^1.1.1",
|
|
50
56
|
"@tomjs/tsconfig": "^1.3.0",
|
|
51
|
-
"@types/node": "^18.19.
|
|
57
|
+
"@types/node": "^18.19.8",
|
|
52
58
|
"@types/vscode": "^1.56.0",
|
|
53
59
|
"eslint": "^8.56.0",
|
|
54
60
|
"husky": "^8.0.3",
|
|
55
61
|
"lint-staged": "^15.2.0",
|
|
56
62
|
"npm-run-all": "^4.1.5",
|
|
57
|
-
"prettier": "^3.2.
|
|
63
|
+
"prettier": "^3.2.4",
|
|
58
64
|
"rimraf": "^5.0.5",
|
|
59
65
|
"tsup": "^8.0.1",
|
|
60
66
|
"typescript": "~5.3.3"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Disposable, Uri, ViewColumn, Webview, WebviewPanel, window } from 'vscode';
|
|
2
|
-
// import __getWebviewHtml__ from '@tomjs/vscode-extension-webview';
|
|
3
2
|
|
|
4
3
|
function uuid() {
|
|
5
4
|
let text = '';
|
|
@@ -15,11 +14,11 @@ function getUri(webview: Webview, extensionUri: Uri, pathList: string[]) {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* This class manages the state and behavior of
|
|
17
|
+
* This class manages the state and behavior of Main webview panels.
|
|
19
18
|
*
|
|
20
19
|
* It contains all the data and methods for:
|
|
21
20
|
*
|
|
22
|
-
* - Creating and rendering
|
|
21
|
+
* - Creating and rendering Main webview panels
|
|
23
22
|
* - Properly cleaning up and disposing of webview resources when the panel is closed
|
|
24
23
|
* - Setting the HTML (and by proxy CSS/JavaScript) content of the webview panel
|
|
25
24
|
* - Setting message listeners so data can be passed between the webview and extension
|
|
@@ -30,7 +29,7 @@ export class MainPanel {
|
|
|
30
29
|
private _disposables: Disposable[] = [];
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
|
-
* The
|
|
32
|
+
* The MainPanel class private constructor (called only from the render method).
|
|
34
33
|
*
|
|
35
34
|
* @param panel A reference to the webview panel
|
|
36
35
|
* @param extensionUri The URI of the directory containing the extension
|
|
@@ -111,9 +110,8 @@ export class MainPanel {
|
|
|
111
110
|
* rendered within the webview panel
|
|
112
111
|
*/
|
|
113
112
|
private _getWebviewContent(webview: Webview, extensionUri: Uri) {
|
|
114
|
-
// The
|
|
113
|
+
// The file from the vite build output
|
|
115
114
|
const stylesUri = getUri(webview, extensionUri, ['dist', 'webview', 'assets', 'index.css']);
|
|
116
|
-
// The JS file from the Vue build output
|
|
117
115
|
const scriptUri = getUri(webview, extensionUri, ['dist', 'webview', 'assets', 'index.js']);
|
|
118
116
|
|
|
119
117
|
const nonce = uuid();
|
|
@@ -122,7 +120,6 @@ export class MainPanel {
|
|
|
122
120
|
return __getWebviewHtml__(process.env.VITE_DEV_SERVER_URL);
|
|
123
121
|
}
|
|
124
122
|
|
|
125
|
-
// Tip: Install the es6-string-html VS Code extension to enable code highlighting below
|
|
126
123
|
return /*html*/ `
|
|
127
124
|
<!doctype html>
|
|
128
125
|
<html lang="en">
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "vscode-extension",
|
|
3
|
+
"displayName": "%displayName%",
|
|
4
|
+
"description": "%description%",
|
|
3
5
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
+
"publisher": "{{git.org}}",
|
|
7
|
+
"license": "MIT",
|
|
6
8
|
"engines": {
|
|
7
9
|
"node": ">=14",
|
|
8
10
|
"vscode": "^1.56.0"
|
|
9
11
|
},
|
|
10
12
|
"main": "dist/extension/index.js",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vscode"
|
|
15
|
+
],
|
|
16
|
+
"categories": [
|
|
17
|
+
"Other"
|
|
18
|
+
],
|
|
11
19
|
"activationEvents": [
|
|
12
20
|
"onCommand:hello-world.showHelloWorld"
|
|
13
21
|
],
|
|
@@ -27,7 +35,7 @@
|
|
|
27
35
|
"url": "git+{{git.url}}/issues"
|
|
28
36
|
},
|
|
29
37
|
"homepage": "{{git.url}}/blob/main/README.md",
|
|
30
|
-
"icon": "
|
|
38
|
+
"icon": "resources/logo.png",
|
|
31
39
|
"vsce": {
|
|
32
40
|
"dependencies": false,
|
|
33
41
|
"yarn": false
|
|
@@ -56,7 +64,7 @@
|
|
|
56
64
|
"@tomjs/tsconfig": "^1.3.0",
|
|
57
65
|
"@tomjs/vite-plugin-vscode": "^1.4.0",
|
|
58
66
|
"@tomjs/vscode-extension-webview": "^1.2.0",
|
|
59
|
-
"@types/node": "^18.19.
|
|
67
|
+
"@types/node": "^18.19.8",
|
|
60
68
|
"@types/react": "^18.2.48",
|
|
61
69
|
"@types/react-dom": "^18.2.18",
|
|
62
70
|
"@types/vscode": "^1.56.0",
|
|
@@ -67,7 +75,7 @@
|
|
|
67
75
|
"husky": "^8.0.3",
|
|
68
76
|
"lint-staged": "^15.2.0",
|
|
69
77
|
"npm-run-all": "^4.1.5",
|
|
70
|
-
"prettier": "^3.2.
|
|
78
|
+
"prettier": "^3.2.4",
|
|
71
79
|
"rimraf": "^5.0.5",
|
|
72
80
|
"stylelint": "^16.1.0",
|
|
73
81
|
"tsx": "^4.7.0",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Disposable, Uri, ViewColumn, Webview, WebviewPanel, window } from 'vscode';
|
|
2
|
-
// import __getWebviewHtml__ from '@tomjs/vscode-extension-webview';
|
|
3
2
|
|
|
4
3
|
function uuid() {
|
|
5
4
|
let text = '';
|
|
@@ -15,11 +14,11 @@ function getUri(webview: Webview, extensionUri: Uri, pathList: string[]) {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* This class manages the state and behavior of
|
|
17
|
+
* This class manages the state and behavior of Main webview panels.
|
|
19
18
|
*
|
|
20
19
|
* It contains all the data and methods for:
|
|
21
20
|
*
|
|
22
|
-
* - Creating and rendering
|
|
21
|
+
* - Creating and rendering Main webview panels
|
|
23
22
|
* - Properly cleaning up and disposing of webview resources when the panel is closed
|
|
24
23
|
* - Setting the HTML (and by proxy CSS/JavaScript) content of the webview panel
|
|
25
24
|
* - Setting message listeners so data can be passed between the webview and extension
|
|
@@ -30,7 +29,7 @@ export class MainPanel {
|
|
|
30
29
|
private _disposables: Disposable[] = [];
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
|
-
* The
|
|
32
|
+
* The MainPanel class private constructor (called only from the render method).
|
|
34
33
|
*
|
|
35
34
|
* @param panel A reference to the webview panel
|
|
36
35
|
* @param extensionUri The URI of the directory containing the extension
|
|
@@ -111,9 +110,8 @@ export class MainPanel {
|
|
|
111
110
|
* rendered within the webview panel
|
|
112
111
|
*/
|
|
113
112
|
private _getWebviewContent(webview: Webview, extensionUri: Uri) {
|
|
114
|
-
// The
|
|
113
|
+
// The file from the vite build output
|
|
115
114
|
const stylesUri = getUri(webview, extensionUri, ['dist', 'webview', 'assets', 'index.css']);
|
|
116
|
-
// The JS file from the Vue build output
|
|
117
115
|
const scriptUri = getUri(webview, extensionUri, ['dist', 'webview', 'assets', 'index.js']);
|
|
118
116
|
|
|
119
117
|
const nonce = uuid();
|
|
@@ -122,7 +120,6 @@ export class MainPanel {
|
|
|
122
120
|
return __getWebviewHtml__(process.env.VITE_DEV_SERVER_URL);
|
|
123
121
|
}
|
|
124
122
|
|
|
125
|
-
// Tip: Install the es6-string-html VS Code extension to enable code highlighting below
|
|
126
123
|
return /*html*/ `
|
|
127
124
|
<!doctype html>
|
|
128
125
|
<html lang="en">
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "vscode-extension",
|
|
3
|
+
"displayName": "%displayName%",
|
|
4
|
+
"description": "%description%",
|
|
3
5
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
6
|
+
"publisher": "{{git.org}}",
|
|
7
|
+
"license": "MIT",
|
|
5
8
|
"engines": {
|
|
6
9
|
"node": ">=14",
|
|
7
10
|
"vscode": "^1.56.0"
|
|
8
11
|
},
|
|
9
12
|
"main": "dist/extension/index.js",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vscode"
|
|
15
|
+
],
|
|
16
|
+
"categories": [
|
|
17
|
+
"Other"
|
|
18
|
+
],
|
|
10
19
|
"activationEvents": [
|
|
11
20
|
"onCommand:hello-world.showHelloWorld"
|
|
12
21
|
],
|
|
@@ -26,7 +35,7 @@
|
|
|
26
35
|
"url": "git+{{git.url}}/issues"
|
|
27
36
|
},
|
|
28
37
|
"homepage": "{{git.url}}/blob/main/README.md",
|
|
29
|
-
"icon": "
|
|
38
|
+
"icon": "resources/logo.png",
|
|
30
39
|
"vsce": {
|
|
31
40
|
"dependencies": false,
|
|
32
41
|
"yarn": false
|
|
@@ -43,7 +52,7 @@
|
|
|
43
52
|
},
|
|
44
53
|
"dependencies": {
|
|
45
54
|
"@vscode/webview-ui-toolkit": "^1.4.0",
|
|
46
|
-
"vue": "^3.4.
|
|
55
|
+
"vue": "^3.4.14"
|
|
47
56
|
},
|
|
48
57
|
"devDependencies": {
|
|
49
58
|
"@commitlint/cli": "^18.4.4",
|
|
@@ -54,7 +63,7 @@
|
|
|
54
63
|
"@tomjs/tsconfig": "^1.3.0",
|
|
55
64
|
"@tomjs/vite-plugin-vscode": "^1.4.0",
|
|
56
65
|
"@tomjs/vscode-extension-webview": "^1.2.0",
|
|
57
|
-
"@types/node": "^18.19.
|
|
66
|
+
"@types/node": "^18.19.8",
|
|
58
67
|
"@types/vscode": "^1.56.0",
|
|
59
68
|
"@types/vscode-webview": "^1.57.4",
|
|
60
69
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
@@ -63,7 +72,7 @@
|
|
|
63
72
|
"husky": "^8.0.3",
|
|
64
73
|
"lint-staged": "^15.2.0",
|
|
65
74
|
"npm-run-all": "^4.1.5",
|
|
66
|
-
"prettier": "^3.2.
|
|
75
|
+
"prettier": "^3.2.4",
|
|
67
76
|
"rimraf": "^5.0.5",
|
|
68
77
|
"stylelint": "^16.1.0",
|
|
69
78
|
"tsx": "^4.7.0",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prepare": "husky install"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"vue": "^3.4.
|
|
20
|
+
"vue": "^3.4.14"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@commitlint/cli": "^18.4.4",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"@tomjs/prettier": "^1.1.1",
|
|
27
27
|
"@tomjs/stylelint": "^2.2.0",
|
|
28
28
|
"@tomjs/tsconfig": "^1.3.0",
|
|
29
|
-
"@types/node": "^18.19.
|
|
29
|
+
"@types/node": "^18.19.8",
|
|
30
30
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
31
31
|
"cross-env": "^7.0.3",
|
|
32
32
|
"eslint": "^8.56.0",
|
|
33
33
|
"husky": "^8.0.3",
|
|
34
34
|
"lint-staged": "^15.2.0",
|
|
35
35
|
"npm-run-all": "^4.1.5",
|
|
36
|
-
"prettier": "^3.2.
|
|
36
|
+
"prettier": "^3.2.4",
|
|
37
37
|
"stylelint": "^16.1.0",
|
|
38
38
|
"typescript": "~5.3.3",
|
|
39
39
|
"vite": "^5.0.11",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|