@vsceasy/cli 0.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/CHANGELOG.md +45 -0
- package/LICENSE +21 -0
- package/README.md +474 -0
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +9044 -0
- package/dist/cli.d.ts +3 -0
- package/dist/commands/command/add.d.ts +3 -0
- package/dist/commands/components/add.d.ts +3 -0
- package/dist/commands/create.d.ts +3 -0
- package/dist/commands/crud/add.d.ts +3 -0
- package/dist/commands/db/init.d.ts +3 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/groups.d.ts +16 -0
- package/dist/commands/helper/add.d.ts +3 -0
- package/dist/commands/job/add.d.ts +3 -0
- package/dist/commands/menu/add.d.ts +3 -0
- package/dist/commands/menu/edit.d.ts +3 -0
- package/dist/commands/model/add.d.ts +3 -0
- package/dist/commands/panel/add.d.ts +3 -0
- package/dist/commands/publish/init.d.ts +3 -0
- package/dist/commands/rpc/add.d.ts +3 -0
- package/dist/commands/statusBar/add.d.ts +3 -0
- package/dist/commands/subpanel/add.d.ts +3 -0
- package/dist/commands/test/setup.d.ts +3 -0
- package/dist/commands/treeView/add.d.ts +3 -0
- package/dist/commands/upgrade.d.ts +3 -0
- package/dist/commands/wizard.d.ts +3 -0
- package/dist/data/codicons.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3169 -0
- package/dist/lib/command/add.d.ts +31 -0
- package/dist/lib/components/add.d.ts +20 -0
- package/dist/lib/config.d.ts +10 -0
- package/dist/lib/crud/add.d.ts +19 -0
- package/dist/lib/crud/crudConfig.d.ts +37 -0
- package/dist/lib/crud/parseModel.d.ts +33 -0
- package/dist/lib/db/init.d.ts +16 -0
- package/dist/lib/db/wire.d.ts +10 -0
- package/dist/lib/doctor.d.ts +30 -0
- package/dist/lib/findProject.d.ts +10 -0
- package/dist/lib/helper/add.d.ts +14 -0
- package/dist/lib/iconPicker.d.ts +7 -0
- package/dist/lib/index.d.ts +46 -0
- package/dist/lib/interactive.d.ts +30 -0
- package/dist/lib/job/add.d.ts +24 -0
- package/dist/lib/menu/add.d.ts +13 -0
- package/dist/lib/menu/edit.d.ts +39 -0
- package/dist/lib/menuTree.d.ts +33 -0
- package/dist/lib/model/add.d.ts +27 -0
- package/dist/lib/model/parseFields.d.ts +14 -0
- package/dist/lib/panel/add.d.ts +29 -0
- package/dist/lib/publish/init.d.ts +12 -0
- package/dist/lib/rpc/add.d.ts +22 -0
- package/dist/lib/scaffold.d.ts +13 -0
- package/dist/lib/statusBar/add.d.ts +33 -0
- package/dist/lib/subpanel/add.d.ts +20 -0
- package/dist/lib/testSetup/index.d.ts +10 -0
- package/dist/lib/treeView/add.d.ts +13 -0
- package/dist/lib/upgrade.d.ts +22 -0
- package/dist/lib/validate.d.ts +14 -0
- package/dist/lib/wizard/run.d.ts +13 -0
- package/package.json +67 -0
- package/templates/_generators/command/command.ts.tpl +8 -0
- package/templates/_generators/components/Button.tsx.tpl +12 -0
- package/templates/_generators/components/Card.tsx.tpl +22 -0
- package/templates/_generators/components/Field.tsx.tpl +20 -0
- package/templates/_generators/components/Input.tsx.tpl +10 -0
- package/templates/_generators/components/List.tsx.tpl +29 -0
- package/templates/_generators/components/components.css.tpl +66 -0
- package/templates/_generators/components/index.ts.tpl +10 -0
- package/templates/_generators/crud/formApp.tsx.tpl +83 -0
- package/templates/_generators/crud/formNav.ts.tpl +19 -0
- package/templates/_generators/crud/formPanel.ts.tpl +32 -0
- package/templates/_generators/crud/listApp.tsx.tpl +84 -0
- package/templates/_generators/crud/listPanel.ts.tpl +30 -0
- package/templates/_generators/crud/main.tsx.tpl +6 -0
- package/templates/_generators/crud/service.ts.tpl +27 -0
- package/templates/_generators/helper/cache.ts.tpl +117 -0
- package/templates/_generators/helper/config.ts.tpl +36 -0
- package/templates/_generators/helper/db.ts.tpl +322 -0
- package/templates/_generators/helper/notifications.ts.tpl +45 -0
- package/templates/_generators/helper/secrets.ts.tpl +36 -0
- package/templates/_generators/helper/state.ts.tpl +44 -0
- package/templates/_generators/job/job.ts.tpl +10 -0
- package/templates/_generators/menu/menu.ts.tpl +21 -0
- package/templates/_generators/model/model.ts.tpl +17 -0
- package/templates/_generators/panel/App.tsx.tpl +10 -0
- package/templates/_generators/panel/main.tsx.tpl +6 -0
- package/templates/_generators/panel/panel.ts.tpl +5 -0
- package/templates/_generators/panel/templates/dashboard/App.tsx.tpl +41 -0
- package/templates/_generators/panel/templates/form/App.tsx.tpl +44 -0
- package/templates/_generators/panel/templates/list/App.tsx.tpl +40 -0
- package/templates/_generators/publish/CHANGELOG.md.tpl +8 -0
- package/templates/_generators/publish/README.md.tpl +23 -0
- package/templates/_generators/statusBar/statusBar.ts.tpl +7 -0
- package/templates/_generators/subpanel/App.tsx.tpl +10 -0
- package/templates/_generators/subpanel/main.tsx.tpl +6 -0
- package/templates/_generators/subpanel/subpanel.ts.tpl +6 -0
- package/templates/_generators/test/_helpers.ts.tpl +120 -0
- package/templates/_generators/test/sample.test.ts.tpl +38 -0
- package/templates/_generators/test/vitest.config.ts.tpl +23 -0
- package/templates/_generators/test/vscode.stub.ts.tpl +109 -0
- package/templates/_generators/treeView/treeView.ts.tpl +16 -0
- package/templates/react/.vscode/launch.json +34 -0
- package/templates/react/.vscode/tasks.json +32 -0
- package/templates/react/.vscodeignore +8 -0
- package/templates/react/README.md +50 -0
- package/templates/react/package.json +54 -0
- package/templates/react/scripts/gen.ts +395 -0
- package/templates/react/src/commands/hello.ts +6 -0
- package/templates/react/src/extension/extension.ts +5 -0
- package/templates/react/src/panels/dashboard.ts +21 -0
- package/templates/react/src/shared/api.ts +7 -0
- package/templates/react/src/shared/vsceasy/bootstrap.ts +657 -0
- package/templates/react/src/shared/vsceasy/client.ts +8 -0
- package/templates/react/src/shared/vsceasy/codiconNames.ts +196 -0
- package/templates/react/src/shared/vsceasy/define.ts +269 -0
- package/templates/react/src/shared/vsceasy/index.ts +13 -0
- package/templates/react/src/shared/vsceasy/rpc.ts +214 -0
- package/templates/react/src/webview/panels/dashboard/App.tsx +31 -0
- package/templates/react/src/webview/panels/dashboard/main.tsx +6 -0
- package/templates/react/src/webview/styles.css +33 -0
- package/templates/react/tsconfig.json +17 -0
- package/templates/react/vite.config.ts +42 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { connectWebview } from '../../../shared/vsceasy/client';
|
|
3
|
+
import type { DashboardApi } from '../../../shared/api';
|
|
4
|
+
|
|
5
|
+
const api = connectWebview<DashboardApi>();
|
|
6
|
+
|
|
7
|
+
export function App() {
|
|
8
|
+
const [info, setInfo] = useState<{ workspace: string | null; vscodeVersion: string } | null>(null);
|
|
9
|
+
const [files, setFiles] = useState<string[]>([]);
|
|
10
|
+
const [pattern, setPattern] = useState('**/*.ts');
|
|
11
|
+
|
|
12
|
+
useEffect(() => { api.getInfo().then(setInfo); }, []);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="app">
|
|
16
|
+
<h1>{{displayName}} Dashboard</h1>
|
|
17
|
+
{info && (
|
|
18
|
+
<section>
|
|
19
|
+
<p><strong>Workspace:</strong> {info.workspace ?? '(none)'}</p>
|
|
20
|
+
<p><strong>VS Code:</strong> {info.vscodeVersion}</p>
|
|
21
|
+
</section>
|
|
22
|
+
)}
|
|
23
|
+
<section>
|
|
24
|
+
<input value={pattern} onChange={(e) => setPattern(e.target.value)} />
|
|
25
|
+
<button onClick={async () => setFiles(await api.listFiles(pattern))}>Find files</button>
|
|
26
|
+
<button onClick={() => api.showMessage('Hello from the webview!')}>Toast</button>
|
|
27
|
+
<ul>{files.map((f) => <li key={f}>{f}</li>)}</ul>
|
|
28
|
+
</section>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
:root { color-scheme: light dark; }
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 1rem;
|
|
6
|
+
font-family: var(--vscode-font-family);
|
|
7
|
+
font-size: var(--vscode-font-size);
|
|
8
|
+
color: var(--vscode-foreground);
|
|
9
|
+
background: var(--vscode-editor-background);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.app h1 { font-size: 1.25rem; margin: 0 0 1rem; }
|
|
13
|
+
|
|
14
|
+
button, input {
|
|
15
|
+
font: inherit;
|
|
16
|
+
color: var(--vscode-button-foreground, inherit);
|
|
17
|
+
background: var(--vscode-button-background, transparent);
|
|
18
|
+
border: 1px solid var(--vscode-button-border, var(--vscode-input-border, #555));
|
|
19
|
+
padding: 0.35rem 0.75rem;
|
|
20
|
+
border-radius: 2px;
|
|
21
|
+
margin-right: 0.5rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
input {
|
|
25
|
+
background: var(--vscode-input-background);
|
|
26
|
+
color: var(--vscode-input-foreground);
|
|
27
|
+
min-width: 16rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button:hover { background: var(--vscode-button-hoverBackground); }
|
|
31
|
+
|
|
32
|
+
ul { padding-left: 1.25rem; }
|
|
33
|
+
li { line-height: 1.6; }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
|
|
6
|
+
const WEBVIEW_ROOT = path.resolve(__dirname, 'src/webview');
|
|
7
|
+
|
|
8
|
+
function discoverHtmlEntries(subdir: string): Record<string, string> {
|
|
9
|
+
const dir = path.join(WEBVIEW_ROOT, subdir);
|
|
10
|
+
if (!fs.existsSync(dir)) return {};
|
|
11
|
+
const out: Record<string, string> = {};
|
|
12
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
13
|
+
if (!entry.isDirectory()) continue;
|
|
14
|
+
const html = path.join(dir, entry.name, 'index.html');
|
|
15
|
+
// Key includes subdir so panel `dashboard` and subpanel `dashboard` never collide.
|
|
16
|
+
if (fs.existsSync(html)) out[`${subdir}/${entry.name}`] = html;
|
|
17
|
+
}
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const entries = {
|
|
22
|
+
...discoverHtmlEntries('panels'),
|
|
23
|
+
...discoverHtmlEntries('subpanels'),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default defineConfig({
|
|
27
|
+
plugins: [react()],
|
|
28
|
+
root: WEBVIEW_ROOT,
|
|
29
|
+
build: {
|
|
30
|
+
outDir: path.resolve(__dirname, 'dist/webview'),
|
|
31
|
+
emptyOutDir: true,
|
|
32
|
+
manifest: 'manifest.json',
|
|
33
|
+
rollupOptions: {
|
|
34
|
+
input: entries,
|
|
35
|
+
output: {
|
|
36
|
+
entryFileNames: '[name]/index.js',
|
|
37
|
+
chunkFileNames: 'chunks/[name]-[hash].js',
|
|
38
|
+
assetFileNames: 'assets/[name]-[hash].[ext]',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|