@tomjs/create-app 4.2.0 → 5.1.0
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 +10 -9
- package/locales/en-US.json +1 -0
- package/locales/zh-CN.json +1 -0
- package/package.json +1 -1
- package/templates/config/base/.vscode/settings.json +1 -1
- package/templates/config/base/package.json +1 -0
- package/templates/config/electron/package.json +13 -0
- package/templates/config/hbuilderx/extension/index.ts +22 -0
- package/templates/config/hbuilderx/extension/webview.ts +71 -0
- package/templates/config/hbuilderx/package.json +96 -0
- package/templates/{vscode-vue → config/hbuilderx}/tsconfig.node.json +4 -2
- package/templates/config/npm/LICENSE +21 -0
- package/templates/config/npm/package.json +10 -0
- package/templates/config/package.json +10 -7
- package/templates/config/public/package.json +1 -8
- package/templates/{web-react → config/react}/_eslint.config.mjs +0 -1
- package/templates/config/react/package.json +15 -0
- package/templates/config/style/lint-staged.config.mjs +1 -1
- package/templates/{vscode-vue → config/vscode}/.vscode/settings.json +1 -1
- package/templates/config/vscode/package.json +49 -0
- package/templates/{vscode-react → config/vscode}/tsconfig.node.json +2 -7
- package/templates/config/vue/package.json +11 -0
- package/templates/electron-react/package.json +3 -25
- package/templates/electron-react/pnpm-workspace.yaml +1 -0
- package/templates/electron-vue/package.json +3 -19
- package/templates/electron-vue/pnpm-workspace.yaml +1 -0
- package/templates/electron-vue/tsconfig.node.json +1 -1
- package/templates/hbuilderx-base/README.md +20 -0
- package/templates/hbuilderx-base/package.json +52 -0
- package/templates/hbuilderx-base/src/env.d.ts +1 -0
- package/templates/hbuilderx-base/src/index.ts +17 -0
- package/templates/hbuilderx-base/tsconfig.json +7 -0
- package/templates/hbuilderx-base/tsdown.config.ts +13 -0
- package/templates/hbuilderx-react/README.md +25 -0
- package/templates/hbuilderx-react/index.html +13 -0
- package/templates/hbuilderx-react/package.json +12 -0
- package/templates/hbuilderx-react/pnpm-workspace.yaml +5 -0
- package/templates/hbuilderx-react/src/App.css +45 -0
- package/templates/hbuilderx-react/src/App.tsx +41 -0
- package/templates/hbuilderx-react/src/assets/react.svg +1 -0
- package/templates/hbuilderx-react/src/index.css +73 -0
- package/templates/hbuilderx-react/src/main.tsx +10 -0
- package/templates/hbuilderx-react/tsconfig.app.json +18 -0
- package/templates/hbuilderx-react/vite.config.ts +19 -0
- package/templates/hbuilderx-vue/README.md +26 -0
- package/templates/hbuilderx-vue/index.html +13 -0
- package/templates/hbuilderx-vue/package.json +12 -0
- package/templates/hbuilderx-vue/pnpm-workspace.yaml +4 -0
- package/templates/hbuilderx-vue/src/App.vue +32 -0
- package/templates/hbuilderx-vue/src/assets/vite.svg +1 -0
- package/templates/hbuilderx-vue/src/assets/vue.svg +1 -0
- package/templates/hbuilderx-vue/src/components/HelloWorld.vue +29 -0
- package/templates/hbuilderx-vue/src/main.ts +5 -0
- package/templates/hbuilderx-vue/src/style.css +68 -0
- package/templates/hbuilderx-vue/tsconfig.app.json +18 -0
- package/templates/hbuilderx-vue/vite.config.ts +17 -0
- package/templates/node-cli/.vscode/settings.json +15 -51
- package/templates/node-vite/examples/react/package.json +1 -1
- package/templates/node-vite/examples/react/vite.config.ts +2 -2
- package/templates/node-vite/examples/vue/package.json +1 -1
- package/templates/node-vite/examples/vue/vite.config.ts +2 -2
- package/templates/vscode-base/.vscode/launch.json +1 -0
- package/templates/vscode-base/.vscode/settings.json +1 -1
- package/templates/vscode-base/.vscode/tasks.json +1 -1
- package/templates/vscode-react/package.json +1 -54
- package/templates/vscode-react/tsconfig.app.json +2 -8
- package/templates/vscode-vue/package.json +1 -50
- package/templates/vscode-vue/tsconfig.app.json +2 -10
- package/templates/web-react/package.json +0 -16
- package/templates/web-react/tsconfig.app.json +2 -9
- package/templates/web-react/tsconfig.json +2 -6
- package/templates/web-react/tsconfig.node.json +1 -3
- package/templates/web-vue/package.json +0 -10
- package/templates/web-vue/tsconfig.app.json +2 -10
- package/templates/web-vue/tsconfig.json +2 -6
- package/templates/web-vue/tsconfig.node.json +1 -3
- package/templates/electron-react/_eslint.config.mjs +0 -3
- package/templates/electron-react/electron/env.d.ts +0 -1
- package/templates/electron-react/electron/main/index.ts +0 -130
- package/templates/electron-vue/.vscode/launch.json +0 -48
- package/templates/electron-vue/.vscode/tasks.json +0 -67
- package/templates/electron-vue/_eslint.config.mjs +0 -3
- package/templates/electron-vue/electron/preload/index.ts +0 -4
- package/templates/vscode-react/.vscode/settings.json +0 -59
- package/templates/vscode-vue/.vscode/extensions.json +0 -5
- package/templates/vscode-vue/.vscode/launch.json +0 -34
- package/templates/vscode-vue/.vscode/tasks.json +0 -45
- package/templates/vscode-vue/.vscodeignore +0 -73
- package/templates/vscode-vue/_.gitignore +0 -65
- package/templates/vscode-vue/extension/index.ts +0 -21
- package/templates/vscode-vue/extension/views/helper.ts +0 -29
- package/templates/vscode-vue/extension/views/panel.ts +0 -49
- package/templates/vscode-vue/locales/en.json +0 -6
- package/templates/vscode-vue/locales/zh-CN.json +0 -6
- package/templates/vscode-vue/resources/logo.png +0 -0
- package/templates/vscode-vue/resources/logo.svg +0 -1
- package/templates/web-vue/_eslint.config.mjs +0 -6
- /package/templates/{electron-react → config/electron}/.vscode/launch.json +0 -0
- /package/templates/{electron-react → config/electron}/.vscode/tasks.json +0 -0
- /package/templates/{electron-vue → config/electron}/electron/main/index.ts +0 -0
- /package/templates/{electron-react → config/electron}/electron/preload/index.ts +0 -0
- /package/templates/{electron-react → config/electron}/public/vite.svg +0 -0
- /package/templates/{vscode-react → config/hbuilderx}/tsconfig.json +0 -0
- /package/templates/config/{public → npm}/README.md +0 -0
- /package/templates/config/{public → npm}/README.zh_CN.md +0 -0
- /package/templates/{electron-vue → config/react}/public/vite.svg +0 -0
- /package/templates/{vscode-react → config/vscode}/.vscode/extensions.json +0 -0
- /package/templates/{vscode-react → config/vscode}/.vscode/launch.json +0 -0
- /package/templates/{vscode-react → config/vscode}/.vscode/tasks.json +0 -0
- /package/templates/{vscode-react → config/vscode}/.vscodeignore +0 -0
- /package/templates/{vscode-react → config/vscode}/_.gitignore +0 -0
- /package/templates/{vscode-react → config/vscode}/extension/index.ts +0 -0
- /package/templates/{vscode-react → config/vscode}/extension/views/helper.ts +0 -0
- /package/templates/{vscode-react → config/vscode}/extension/views/panel.ts +0 -0
- /package/templates/{vscode-react → config/vscode}/locales/en.json +0 -0
- /package/templates/{vscode-react → config/vscode}/locales/zh-CN.json +0 -0
- /package/templates/{vscode-react → config/vscode}/resources/logo.png +0 -0
- /package/templates/{vscode-react → config/vscode}/resources/logo.svg +0 -0
- /package/templates/{vscode-vue → config/vscode}/tsconfig.json +0 -0
- /package/templates/{web-react → config/vue}/public/vite.svg +0 -0
- /package/templates/{web-vue/public → hbuilderx-react/src/assets}/vite.svg +0 -0
|
@@ -1,67 +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
|
-
"type": "npm",
|
|
8
|
-
"script": "dev",
|
|
9
|
-
"label": "npm:dev",
|
|
10
|
-
"problemMatcher": {
|
|
11
|
-
"owner": "typescript",
|
|
12
|
-
"fileLocation": "relative",
|
|
13
|
-
"pattern": {
|
|
14
|
-
"regexp": "^([a-zA-Z]\\:\\/?([\\w\\-]\\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
|
15
|
-
"file": 1,
|
|
16
|
-
"line": 3,
|
|
17
|
-
"column": 4,
|
|
18
|
-
"code": 5,
|
|
19
|
-
"message": 6
|
|
20
|
-
},
|
|
21
|
-
"background": {
|
|
22
|
-
"activeOnStart": true,
|
|
23
|
-
"beginsPattern": "^.*VITE v.* ready in \\d* ms.*$",
|
|
24
|
-
"endsPattern": "^.*\\[tomjs:electron\\] startup electron*$"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"isBackground": true,
|
|
28
|
-
"presentation": {
|
|
29
|
-
"reveal": "never"
|
|
30
|
-
},
|
|
31
|
-
"group": {
|
|
32
|
-
"kind": "build",
|
|
33
|
-
"isDefault": true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "npm",
|
|
38
|
-
"script": "debug",
|
|
39
|
-
"label": "npm:debug",
|
|
40
|
-
"problemMatcher": {
|
|
41
|
-
"owner": "typescript",
|
|
42
|
-
"fileLocation": "relative",
|
|
43
|
-
"pattern": {
|
|
44
|
-
"regexp": "^([a-zA-Z]\\:\\/?([\\w\\-]\\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
|
45
|
-
"file": 1,
|
|
46
|
-
"line": 3,
|
|
47
|
-
"column": 4,
|
|
48
|
-
"code": 5,
|
|
49
|
-
"message": 6
|
|
50
|
-
},
|
|
51
|
-
"background": {
|
|
52
|
-
"activeOnStart": true,
|
|
53
|
-
"beginsPattern": "^.*VITE v.* ready in \\d* ms.*$",
|
|
54
|
-
"endsPattern": "^.*\\[tomjs:electron\\] startup electron*$"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"isBackground": true,
|
|
58
|
-
"presentation": {
|
|
59
|
-
"reveal": "never"
|
|
60
|
-
},
|
|
61
|
-
"group": {
|
|
62
|
-
"kind": "build",
|
|
63
|
-
"isDefault": true
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
}
|
|
@@ -1,59 +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
|
-
|
|
11
|
-
// Disable the default formatter, use eslint instead
|
|
12
|
-
"prettier.enable": false,
|
|
13
|
-
"editor.formatOnSave": true,
|
|
14
|
-
|
|
15
|
-
// Auto fix
|
|
16
|
-
"editor.codeActionsOnSave": {
|
|
17
|
-
"source.fixAll.eslint": "explicit",
|
|
18
|
-
"source.organizeImports": "never"
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// Silent the stylistic rules in your IDE, but still auto fix them
|
|
22
|
-
"eslint.rules.customizations": [
|
|
23
|
-
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
24
|
-
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
25
|
-
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
|
26
|
-
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
27
|
-
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
28
|
-
{ "rule": "*-order", "severity": "off", "fixable": true },
|
|
29
|
-
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
30
|
-
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
|
31
|
-
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
|
32
|
-
{ "rule": "*semi", "severity": "off", "fixable": true }
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
// Enable eslint for all supported languages
|
|
36
|
-
"eslint.validate": [
|
|
37
|
-
"javascript",
|
|
38
|
-
"javascriptreact",
|
|
39
|
-
"typescript",
|
|
40
|
-
"typescriptreact",
|
|
41
|
-
"vue",
|
|
42
|
-
"html",
|
|
43
|
-
"markdown",
|
|
44
|
-
"json",
|
|
45
|
-
"jsonc",
|
|
46
|
-
"yaml",
|
|
47
|
-
"toml",
|
|
48
|
-
"xml",
|
|
49
|
-
"gql",
|
|
50
|
-
"graphql",
|
|
51
|
-
"astro",
|
|
52
|
-
"svelte",
|
|
53
|
-
"css",
|
|
54
|
-
"less",
|
|
55
|
-
"scss",
|
|
56
|
-
"pcss",
|
|
57
|
-
"postcss"
|
|
58
|
-
]
|
|
59
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// A launch configuration that compiles the extension and then opens it inside a new window
|
|
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
|
-
{
|
|
6
|
-
"version": "0.2.0",
|
|
7
|
-
"configurations": [
|
|
8
|
-
{
|
|
9
|
-
"name": "Debug Extension",
|
|
10
|
-
"type": "extensionHost",
|
|
11
|
-
"request": "launch",
|
|
12
|
-
"args": [
|
|
13
|
-
"--disable-extensions",
|
|
14
|
-
"--extensionDevelopmentPath=${workspaceFolder}"
|
|
15
|
-
],
|
|
16
|
-
"outFiles": [
|
|
17
|
-
"${workspaceFolder}/dist/extension/*.js"
|
|
18
|
-
],
|
|
19
|
-
"preLaunchTask": "npm: dev"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"name": "Preview Extension",
|
|
23
|
-
"type": "extensionHost",
|
|
24
|
-
"request": "launch",
|
|
25
|
-
"args": [
|
|
26
|
-
"--extensionDevelopmentPath=${workspaceFolder}"
|
|
27
|
-
],
|
|
28
|
-
"outFiles": [
|
|
29
|
-
"${workspaceFolder}/dist/extension/*.js"
|
|
30
|
-
],
|
|
31
|
-
"preLaunchTask": "npm: build"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
2
|
-
// for the documentation about the tasks.json format
|
|
3
|
-
{
|
|
4
|
-
"version": "2.0.0",
|
|
5
|
-
"tasks": [
|
|
6
|
-
{
|
|
7
|
-
"type": "npm",
|
|
8
|
-
"script": "dev",
|
|
9
|
-
"problemMatcher": {
|
|
10
|
-
"owner": "typescript",
|
|
11
|
-
"fileLocation": "relative",
|
|
12
|
-
"pattern": {
|
|
13
|
-
"regexp": "^([a-zA-Z]\\:/?([\\w\\-]/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
|
14
|
-
"file": 1,
|
|
15
|
-
"line": 3,
|
|
16
|
-
"column": 4,
|
|
17
|
-
"code": 5,
|
|
18
|
-
"message": 6
|
|
19
|
-
},
|
|
20
|
-
"background": {
|
|
21
|
-
"activeOnStart": true,
|
|
22
|
-
"beginsPattern": "^.*extension build start*$",
|
|
23
|
-
"endsPattern": "^.*extension (build|rebuild) success.*$"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"isBackground": true,
|
|
27
|
-
"presentation": {
|
|
28
|
-
"reveal": "never"
|
|
29
|
-
},
|
|
30
|
-
"group": {
|
|
31
|
-
"kind": "build",
|
|
32
|
-
"isDefault": true
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "npm",
|
|
37
|
-
"script": "build",
|
|
38
|
-
"group": {
|
|
39
|
-
"kind": "build",
|
|
40
|
-
"isDefault": true
|
|
41
|
-
},
|
|
42
|
-
"problemMatcher": []
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
@@ -1,73 +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
|
-
node_modules
|
|
21
|
-
|
|
22
|
-
# cache
|
|
23
|
-
.cache
|
|
24
|
-
.npm
|
|
25
|
-
.tmp
|
|
26
|
-
.temp
|
|
27
|
-
.eslintcache
|
|
28
|
-
.stylelintcache
|
|
29
|
-
tsconfig.tsbuildinfo
|
|
30
|
-
|
|
31
|
-
# environment
|
|
32
|
-
*.local
|
|
33
|
-
|
|
34
|
-
# macOS
|
|
35
|
-
.DS_Store
|
|
36
|
-
|
|
37
|
-
# package files
|
|
38
|
-
*.7z
|
|
39
|
-
*.gz
|
|
40
|
-
*.gzip
|
|
41
|
-
*.rar
|
|
42
|
-
*.tar
|
|
43
|
-
*.tar.*
|
|
44
|
-
*.tgz
|
|
45
|
-
*.zip
|
|
46
|
-
*.vsix
|
|
47
|
-
|
|
48
|
-
# IDEA
|
|
49
|
-
.idea
|
|
50
|
-
|
|
51
|
-
# vscode
|
|
52
|
-
.vscode
|
|
53
|
-
.history
|
|
54
|
-
|
|
55
|
-
# project
|
|
56
|
-
src
|
|
57
|
-
extensions
|
|
58
|
-
locales
|
|
59
|
-
|
|
60
|
-
.husky
|
|
61
|
-
.commitlintrc*
|
|
62
|
-
.editorconfig
|
|
63
|
-
.eslintrc*
|
|
64
|
-
.eslintignore
|
|
65
|
-
.gitattributes
|
|
66
|
-
.gitignore
|
|
67
|
-
.lintstagedrc*
|
|
68
|
-
.prettierrc*
|
|
69
|
-
.prettierignore
|
|
70
|
-
pnpm-lock.yaml
|
|
71
|
-
tsconfig.json
|
|
72
|
-
tsconfig.*.json
|
|
73
|
-
*.config.ts
|
|
@@ -1,65 +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
|
-
*.vsix
|
|
50
|
-
|
|
51
|
-
# IDEA
|
|
52
|
-
.idea
|
|
53
|
-
|
|
54
|
-
# vscode
|
|
55
|
-
.history
|
|
56
|
-
.vscode/i18n-ally-reviews.yml
|
|
57
|
-
|
|
58
|
-
# build output
|
|
59
|
-
build
|
|
60
|
-
dist
|
|
61
|
-
release
|
|
62
|
-
|
|
63
|
-
package.nls.json
|
|
64
|
-
package.nls.*.json
|
|
65
|
-
src/vscode.d.ts
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ExtensionContext } from 'vscode';
|
|
2
|
-
import { i18n, initExtension } from '@tomjs/vscode';
|
|
3
|
-
import { commands, window } from 'vscode';
|
|
4
|
-
import { MainPanel } from './views/panel';
|
|
5
|
-
|
|
6
|
-
export function activate(context: ExtensionContext) {
|
|
7
|
-
initExtension(context);
|
|
8
|
-
|
|
9
|
-
context.subscriptions.push(
|
|
10
|
-
commands.registerCommand('tomjs.xxx.showHello', async () => {
|
|
11
|
-
window.showInformationMessage(i18n.t('tomjs.commands.hello'));
|
|
12
|
-
}),
|
|
13
|
-
);
|
|
14
|
-
context.subscriptions.push(
|
|
15
|
-
commands.registerCommand('tomjs.xxx.showPanel', async () => {
|
|
16
|
-
MainPanel.render(context);
|
|
17
|
-
}),
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function deactivate() {}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Disposable, ExtensionContext, Webview } from 'vscode';
|
|
2
|
-
import { getWebviewHtml } from 'virtual:vscode';
|
|
3
|
-
import { window } from 'vscode';
|
|
4
|
-
|
|
5
|
-
export class WebviewHelper {
|
|
6
|
-
public static setupHtml(webview: Webview, context: ExtensionContext) {
|
|
7
|
-
return getWebviewHtml({
|
|
8
|
-
serverUrl: process.env.VITE_DEV_SERVER_URL,
|
|
9
|
-
webview,
|
|
10
|
-
context,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public static setupWebviewHooks(webview: Webview, disposables: Disposable[]) {
|
|
15
|
-
webview.onDidReceiveMessage(
|
|
16
|
-
(message: any) => {
|
|
17
|
-
const command = message.command;
|
|
18
|
-
const text = message.text;
|
|
19
|
-
console.log(`command: ${command}`);
|
|
20
|
-
switch (command) {
|
|
21
|
-
case 'hello':
|
|
22
|
-
window.showInformationMessage(text);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
undefined,
|
|
26
|
-
disposables,
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Disposable, ExtensionContext, WebviewPanel } from 'vscode';
|
|
2
|
-
import { ViewColumn, window } from 'vscode';
|
|
3
|
-
import { WebviewHelper } from './helper';
|
|
4
|
-
|
|
5
|
-
export class MainPanel {
|
|
6
|
-
public static currentPanel: MainPanel | undefined;
|
|
7
|
-
private readonly _panel: WebviewPanel;
|
|
8
|
-
private _disposables: Disposable[] = [];
|
|
9
|
-
|
|
10
|
-
private constructor(panel: WebviewPanel, context: ExtensionContext) {
|
|
11
|
-
this._panel = panel;
|
|
12
|
-
|
|
13
|
-
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
|
|
14
|
-
this._panel.webview.html = WebviewHelper.setupHtml(this._panel.webview, context);
|
|
15
|
-
|
|
16
|
-
WebviewHelper.setupWebviewHooks(this._panel.webview, this._disposables);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public static render(context: ExtensionContext) {
|
|
20
|
-
if (MainPanel.currentPanel) {
|
|
21
|
-
MainPanel.currentPanel._panel.reveal(ViewColumn.One);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const panel = window.createWebviewPanel('showHelloWorld', 'Hello World', ViewColumn.One, {
|
|
25
|
-
enableScripts: true,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
MainPanel.currentPanel = new MainPanel(panel, context);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Cleans up and disposes of webview resources when the webview panel is closed.
|
|
34
|
-
*/
|
|
35
|
-
public dispose() {
|
|
36
|
-
MainPanel.currentPanel = undefined;
|
|
37
|
-
|
|
38
|
-
// Dispose of the current webview panel
|
|
39
|
-
this._panel.dispose();
|
|
40
|
-
|
|
41
|
-
// Dispose of all disposables (i.e. commands) for the current webview panel
|
|
42
|
-
while (this._disposables.length) {
|
|
43
|
-
const disposable = this._disposables.pop();
|
|
44
|
-
if (disposable) {
|
|
45
|
-
disposable.dispose();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1717641233000" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3499" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M396.24 502.47m-41.91 0a41.91 41.91 0 1 0 83.82 0 41.91 41.91 0 1 0-83.82 0Z" fill="#005ba4" p-id="3500"></path><path d="M615.18 502.47m-41.91 0a41.91 41.91 0 1 0 83.82 0 41.91 41.91 0 1 0-83.82 0Z" fill="#005ba4" p-id="3501"></path><path d="M504.6 863.45c-216.57 0-348.06-211.65-348.06-304.73 0-177.6 156.14-322.1 348.06-322.1s348.06 144.5 348.06 322.1c0 91.13-118.42 304.73-348.06 304.73z m0-577.28c-164.6 0-298.51 122.26-298.51 272.55 0 73.6 118.97 255.18 298.51 255.18 193.9 0 298.51-181.13 298.51-255.18 0-150.29-133.91-272.55-298.51-272.55z" fill="#005ba4" p-id="3502"></path><path d="M181.3 583.5c-13.19 0-24.16-10.4-24.73-23.71l-15.63-360.94c-0.4-9.23 4.37-17.9 12.37-22.52a24.7 24.7 0 0 1 25.69 0.56l166.11 105.86c11.54 7.35 14.93 22.66 7.58 34.19-7.35 11.55-22.64 14.94-34.21 7.58L192.5 244.25l13.57 313.4c0.6 13.66-10.01 25.23-23.68 25.82-0.36 0.03-0.72 0.03-1.09 0.03zM830.12 583.5c-0.36 0-0.73 0-1.09-0.02-13.67-0.6-24.27-12.16-23.68-25.82l13.57-313.4-125.98 80.27c-11.56 7.34-26.86 3.95-34.21-7.56-7.35-11.55-3.96-26.85 7.58-34.21l166.1-105.86c7.8-5 17.7-5.21 25.69-0.56 8 4.61 12.77 13.29 12.37 22.52L854.84 559.8c-0.56 13.29-11.53 23.7-24.72 23.7zM911.81 790.16c-2 0-4.04-0.24-6.06-0.76l-234.1-58.97c-13.27-3.34-21.31-16.81-17.98-30.06 3.34-13.26 16.85-21.34 30.07-17.97l234.1 58.97c13.27 3.34 21.31 16.81 17.98 30.06-2.83 11.25-12.92 18.73-24.01 18.73zM116.13 790.16c-11.09 0-21.18-7.48-24.01-18.73-3.34-13.26 4.7-26.73 17.98-30.06l234.1-58.97c13.23-3.42 26.73 4.69 30.07 17.97 3.34 13.26-4.7 26.73-17.98 30.06l-234.1 58.97c-2.02 0.52-4.06 0.76-6.06 0.76zM340.67 633.18H40.23c-13.69 0-24.77-11.1-24.77-24.77 0-13.68 11.09-24.77 24.77-24.77h300.44c13.69 0 24.77 11.1 24.77 24.77s-11.09 24.77-24.77 24.77zM984.31 633.18H683.87c-13.69 0-24.77-11.1-24.77-24.77 0-13.68 11.09-24.77 24.77-24.77h300.44c13.69 0 24.77 11.1 24.77 24.77s-11.09 24.77-24.77 24.77z" fill="#005ba4" p-id="3503"></path><path d="M510.89 576.08m-33.31 0a33.31 33.31 0 1 0 66.62 0 33.31 33.31 0 1 0-66.62 0Z" fill="#005ba4" p-id="3504"></path><path d="M454.4 690.66c-44.81 0-81.27-36.45-81.27-81.27 0-13.68 11.09-24.77 24.77-24.77 13.69 0 24.77 11.1 24.77 24.77 0 17.5 14.23 31.73 31.73 31.73s31.72-14.23 31.72-31.73c0-13.68 11.09-24.77 24.77-24.77s24.77 11.1 24.77 24.77c0.01 44.82-36.45 81.27-81.26 81.27z" fill="#005ba4" p-id="3505"></path><path d="M567.39 690.66c-44.81 0-81.27-36.45-81.27-81.27 0-13.68 11.09-24.77 24.77-24.77s24.77 11.1 24.77 24.77c0 17.5 14.23 31.73 31.73 31.73s31.72-14.23 31.72-31.73c0-13.68 11.09-24.77 24.77-24.77s24.77 11.1 24.77 24.77c0.01 44.82-36.45 81.27-81.26 81.27z" fill="#005ba4" p-id="3506"></path></svg>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|