@wwchao6411/create-web-ui-template 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/README.md +54 -0
- package/dist/chunk-DRNPNIJR.js +131 -0
- package/dist/chunk-DRNPNIJR.js.map +1 -0
- package/dist/chunk-HDMQ6CVP.js +22 -0
- package/dist/chunk-HDMQ6CVP.js.map +1 -0
- package/dist/chunk-N6W5XQS6.js +24 -0
- package/dist/chunk-N6W5XQS6.js.map +1 -0
- package/dist/chunk-NOZ2FVZU.js +89 -0
- package/dist/chunk-NOZ2FVZU.js.map +1 -0
- package/dist/chunk-QKC3LLVR.js +81 -0
- package/dist/chunk-QKC3LLVR.js.map +1 -0
- package/dist/chunk-VKUDWI56.js +21 -0
- package/dist/chunk-VKUDWI56.js.map +1 -0
- package/dist/chunk-ZCLQAKLB.js +93 -0
- package/dist/chunk-ZCLQAKLB.js.map +1 -0
- package/dist/chunk-ZWYKFM47.js +21 -0
- package/dist/chunk-ZWYKFM47.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +16 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/modes/standalone.d.ts +10 -0
- package/dist/modes/standalone.js +11 -0
- package/dist/modes/standalone.js.map +1 -0
- package/dist/modes/workspace.d.ts +10 -0
- package/dist/modes/workspace.js +11 -0
- package/dist/modes/workspace.js.map +1 -0
- package/dist/prompts.d.ts +20 -0
- package/dist/prompts.js +9 -0
- package/dist/prompts.js.map +1 -0
- package/dist/render-template.d.ts +15 -0
- package/dist/render-template.js +10 -0
- package/dist/render-template.js.map +1 -0
- package/dist/transforms/apply-feature-flags.d.ts +5 -0
- package/dist/transforms/apply-feature-flags.js +7 -0
- package/dist/transforms/apply-feature-flags.js.map +1 -0
- package/dist/transforms/replace-tokens.d.ts +5 -0
- package/dist/transforms/replace-tokens.js +7 -0
- package/dist/transforms/replace-tokens.js.map +1 -0
- package/dist/transforms/write-package-manager-notes.d.ts +5 -0
- package/dist/transforms/write-package-manager-notes.js +7 -0
- package/dist/transforms/write-package-manager-notes.js.map +1 -0
- package/package.json +37 -0
- package/templates/web-ui-template/README.md +44 -0
- package/templates/web-ui-template/config/template.config.json +11 -0
- package/templates/web-ui-template/electron/config/config-manager.ts +9 -0
- package/templates/web-ui-template/electron/forwarding/forwarding-manager.ts +9 -0
- package/templates/web-ui-template/electron/ipc/index.ts +4 -0
- package/templates/web-ui-template/electron/main/index.ts +10 -0
- package/templates/web-ui-template/electron/preload/index.ts +7 -0
- package/templates/web-ui-template/electron.vite.config.ts +50 -0
- package/templates/web-ui-template/index.html +12 -0
- package/templates/web-ui-template/package.json +38 -0
- package/templates/web-ui-template/public/.gitkeep +1 -0
- package/templates/web-ui-template/scripts/post-create.mjs +1 -0
- package/templates/web-ui-template/src/app/App.vue +38 -0
- package/templates/web-ui-template/src/app/app.scss +8 -0
- package/templates/web-ui-template/src/app/main.ts +24 -0
- package/templates/web-ui-template/src/app/tailwind.css +1 -0
- package/templates/web-ui-template/src/business/HomePage.vue +18 -0
- package/templates/web-ui-template/src/business/LoginPage.vue +17 -0
- package/templates/web-ui-template/src/business/PreviewMicroAppPage.vue +15 -0
- package/templates/web-ui-template/src/business/WorkspacePage.vue +22 -0
- package/templates/web-ui-template/src/business/apps.ts +12 -0
- package/templates/web-ui-template/src/business/menu.ts +23 -0
- package/templates/web-ui-template/src/business/permissions.ts +1 -0
- package/templates/web-ui-template/src/platform/create-platform.ts +29 -0
- package/templates/web-ui-template/src/platform/register-microapps.ts +8 -0
- package/templates/web-ui-template/src/platform/register-routes.ts +32 -0
- package/templates/web-ui-template/src/shared/config.ts +28 -0
- package/templates/web-ui-template/tsconfig.json +13 -0
- package/templates/web-ui-template/vite.config.ts +22 -0
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export { CliEnvironment, createHelpText, runCli } from './cli.js';
|
|
3
|
+
export { InitOptions, ResolvedCliInput, createDefaultInitOptions, resolveInitOptions } from './prompts.js';
|
|
4
|
+
export { RenderTemplateInput, RenderTemplateResult, renderTemplate } from './render-template.js';
|
|
5
|
+
export { WorkspaceModeInput, renderWorkspaceMode } from './modes/workspace.js';
|
|
6
|
+
export { StandaloneModeInput, renderStandaloneMode } from './modes/standalone.js';
|
|
7
|
+
export { replaceTemplateTokens } from './transforms/replace-tokens.js';
|
|
8
|
+
export { applyFeatureFlags } from './transforms/apply-feature-flags.js';
|
|
9
|
+
export { writePackageManagerNotes } from './transforms/write-package-manager-notes.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
createHelpText,
|
|
4
|
+
runCli
|
|
5
|
+
} from "./chunk-NOZ2FVZU.js";
|
|
6
|
+
import {
|
|
7
|
+
createDefaultInitOptions,
|
|
8
|
+
resolveInitOptions
|
|
9
|
+
} from "./chunk-DRNPNIJR.js";
|
|
10
|
+
import {
|
|
11
|
+
renderStandaloneMode
|
|
12
|
+
} from "./chunk-ZWYKFM47.js";
|
|
13
|
+
import {
|
|
14
|
+
renderWorkspaceMode
|
|
15
|
+
} from "./chunk-HDMQ6CVP.js";
|
|
16
|
+
import {
|
|
17
|
+
renderTemplate
|
|
18
|
+
} from "./chunk-QKC3LLVR.js";
|
|
19
|
+
import {
|
|
20
|
+
writePackageManagerNotes
|
|
21
|
+
} from "./chunk-N6W5XQS6.js";
|
|
22
|
+
import {
|
|
23
|
+
applyFeatureFlags
|
|
24
|
+
} from "./chunk-ZCLQAKLB.js";
|
|
25
|
+
import {
|
|
26
|
+
replaceTemplateTokens
|
|
27
|
+
} from "./chunk-VKUDWI56.js";
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
import { pathToFileURL } from "url";
|
|
31
|
+
var entryUrl = process.argv[1] ? pathToFileURL(process.argv[1]).href : "";
|
|
32
|
+
if (entryUrl === import.meta.url) {
|
|
33
|
+
void runCli(process.argv.slice(2)).then((exitCode) => {
|
|
34
|
+
process.exitCode = exitCode;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
applyFeatureFlags,
|
|
39
|
+
createDefaultInitOptions,
|
|
40
|
+
createHelpText,
|
|
41
|
+
renderStandaloneMode,
|
|
42
|
+
renderTemplate,
|
|
43
|
+
renderWorkspaceMode,
|
|
44
|
+
replaceTemplateTokens,
|
|
45
|
+
resolveInitOptions,
|
|
46
|
+
runCli,
|
|
47
|
+
writePackageManagerNotes
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { pathToFileURL } from \"node:url\";\n\nimport { runCli } from \"./cli\";\n\nexport * from \"./cli\";\nexport * from \"./prompts\";\nexport * from \"./render-template\";\nexport * from \"./modes/workspace\";\nexport * from \"./modes/standalone\";\nexport * from \"./transforms/replace-tokens\";\nexport * from \"./transforms/apply-feature-flags\";\nexport * from \"./transforms/write-package-manager-notes\";\n\nconst entryUrl = process.argv[1] ? pathToFileURL(process.argv[1]).href : \"\";\n\nif (entryUrl === import.meta.url) {\n void runCli(process.argv.slice(2)).then((exitCode) => {\n process.exitCode = exitCode;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,qBAAqB;AAa9B,IAAM,WAAW,QAAQ,KAAK,CAAC,IAAI,cAAc,QAAQ,KAAK,CAAC,CAAC,EAAE,OAAO;AAEzE,IAAI,aAAa,YAAY,KAAK;AAChC,OAAK,OAAO,QAAQ,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa;AACpD,YAAQ,WAAW;AAAA,EACrB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InitOptions } from '../prompts.js';
|
|
2
|
+
import { RenderTemplateResult } from '../render-template.js';
|
|
3
|
+
|
|
4
|
+
interface StandaloneModeInput {
|
|
5
|
+
targetDirectory: string;
|
|
6
|
+
templateDirectory?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function renderStandaloneMode(options: InitOptions, input: StandaloneModeInput): Promise<RenderTemplateResult>;
|
|
9
|
+
|
|
10
|
+
export { type StandaloneModeInput, renderStandaloneMode };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderStandaloneMode
|
|
3
|
+
} from "../chunk-ZWYKFM47.js";
|
|
4
|
+
import "../chunk-QKC3LLVR.js";
|
|
5
|
+
import "../chunk-N6W5XQS6.js";
|
|
6
|
+
import "../chunk-ZCLQAKLB.js";
|
|
7
|
+
import "../chunk-VKUDWI56.js";
|
|
8
|
+
export {
|
|
9
|
+
renderStandaloneMode
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=standalone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InitOptions } from '../prompts.js';
|
|
2
|
+
import { RenderTemplateResult } from '../render-template.js';
|
|
3
|
+
|
|
4
|
+
interface WorkspaceModeInput {
|
|
5
|
+
workspaceRoot: string;
|
|
6
|
+
templateDirectory?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function renderWorkspaceMode(options: InitOptions, input: WorkspaceModeInput): Promise<RenderTemplateResult>;
|
|
9
|
+
|
|
10
|
+
export { type WorkspaceModeInput, renderWorkspaceMode };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderWorkspaceMode
|
|
3
|
+
} from "../chunk-HDMQ6CVP.js";
|
|
4
|
+
import "../chunk-QKC3LLVR.js";
|
|
5
|
+
import "../chunk-N6W5XQS6.js";
|
|
6
|
+
import "../chunk-ZCLQAKLB.js";
|
|
7
|
+
import "../chunk-VKUDWI56.js";
|
|
8
|
+
export {
|
|
9
|
+
renderWorkspaceMode
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface InitOptions {
|
|
2
|
+
projectName: string;
|
|
3
|
+
targetMode: "workspace" | "standalone";
|
|
4
|
+
enableDesktop: boolean;
|
|
5
|
+
enableMicroApp: boolean;
|
|
6
|
+
enableChromeTabs: boolean;
|
|
7
|
+
enableAuth: boolean;
|
|
8
|
+
enableSshForwarding: boolean;
|
|
9
|
+
packageManager: "pnpm" | "npm" | "yarn";
|
|
10
|
+
installNow: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ResolvedCliInput {
|
|
13
|
+
helpRequested: boolean;
|
|
14
|
+
options: InitOptions;
|
|
15
|
+
targetDirectory?: string;
|
|
16
|
+
}
|
|
17
|
+
declare function createDefaultInitOptions(): InitOptions;
|
|
18
|
+
declare function resolveInitOptions(argv: string[]): ResolvedCliInput;
|
|
19
|
+
|
|
20
|
+
export { type InitOptions, type ResolvedCliInput, createDefaultInitOptions, resolveInitOptions };
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InitOptions } from './prompts.js';
|
|
2
|
+
|
|
3
|
+
interface RenderTemplateInput {
|
|
4
|
+
mode: InitOptions["targetMode"];
|
|
5
|
+
options: InitOptions;
|
|
6
|
+
targetDirectory: string;
|
|
7
|
+
templateDirectory?: string;
|
|
8
|
+
}
|
|
9
|
+
interface RenderTemplateResult {
|
|
10
|
+
targetDirectory: string;
|
|
11
|
+
notes: string;
|
|
12
|
+
}
|
|
13
|
+
declare function renderTemplate(input: RenderTemplateInput): Promise<RenderTemplateResult>;
|
|
14
|
+
|
|
15
|
+
export { type RenderTemplateInput, type RenderTemplateResult, renderTemplate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wwchao6411/create-web-ui-template",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-web-ui-template": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"templates/web-ui-template"
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@wwchao6411/configs": "0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup src/index.ts src/cli.ts src/prompts.ts src/render-template.ts src/modes/workspace.ts src/modes/standalone.ts src/transforms/replace-tokens.ts src/transforms/apply-feature-flags.ts src/transforms/write-package-manager-notes.ts --format esm --dts --sourcemap --clean",
|
|
29
|
+
"prepare:template-assets": "node ./scripts/sync-template-assets.mjs",
|
|
30
|
+
"clean:template-assets": "node ./scripts/clean-template-assets.mjs",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"lint": "eslint . --max-warnings=0",
|
|
33
|
+
"lint:fix": "eslint . --fix",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# web-ui-template
|
|
2
|
+
|
|
3
|
+
`templates/web-ui-template` 是模板源码目录,不参与 pnpm workspace 构建。CLI 会复制这个目录、替换占位符,并按功能开关裁剪文件。
|
|
4
|
+
|
|
5
|
+
## 目录职责
|
|
6
|
+
|
|
7
|
+
- `src/app/`: 应用启动入口、全局样式和顶层导航壳
|
|
8
|
+
- `src/platform/`: 平台组合层,负责拼装预设、路由和微前端注册
|
|
9
|
+
- `src/business/`: 业务可定制区域,生成后优先在这里修改页面、菜单、权限和应用注册
|
|
10
|
+
- `src/shared/`: 模板共享配置与运行时标记
|
|
11
|
+
- `electron/`: 桌面模式下的主进程、preload、IPC 与转发占位实现
|
|
12
|
+
- `config/`: 模板元数据与功能开关占位符
|
|
13
|
+
- `scripts/`: 初始化后的辅助脚本占位
|
|
14
|
+
|
|
15
|
+
## 生成后优先修改的位置
|
|
16
|
+
|
|
17
|
+
生成项目后,优先在以下文件中落业务定制:
|
|
18
|
+
|
|
19
|
+
- `src/business/HomePage.vue`: 首页内容和品牌信息
|
|
20
|
+
- `src/business/LoginPage.vue`: 登录文案和表单扩展
|
|
21
|
+
- `src/business/WorkspacePage.vue`: 工作区默认启动面
|
|
22
|
+
- `src/business/apps.ts`: 业务应用注册表
|
|
23
|
+
- `src/business/menu.ts`: 导航菜单
|
|
24
|
+
- `src/business/permissions.ts`: 权限集合
|
|
25
|
+
|
|
26
|
+
如果只是替换业务页面,不要先改 `src/platform/*`。这些文件负责把平台壳能力接到业务层,保持稳定更利于后续升级模板。
|
|
27
|
+
|
|
28
|
+
## 功能开关
|
|
29
|
+
|
|
30
|
+
模板当前支持以下占位符,CLI 会在复制时替换:
|
|
31
|
+
|
|
32
|
+
- `__PROJECT_NAME__`
|
|
33
|
+
- `__PACKAGE_MANAGER__`
|
|
34
|
+
- `__ENABLE_DESKTOP__`
|
|
35
|
+
- `__ENABLE_MICROAPP__`
|
|
36
|
+
- `__ENABLE_CHROME_TABS__`
|
|
37
|
+
- `__ENABLE_AUTH__`
|
|
38
|
+
- `__ENABLE_SSH_FORWARDING__`
|
|
39
|
+
|
|
40
|
+
当关闭 `desktop` 或 `microapp` 时,CLI 会同步删除对应脚本与演示文件,避免生成无效目录。
|
|
41
|
+
|
|
42
|
+
## 本地验证
|
|
43
|
+
|
|
44
|
+
仓库内持续验证目标是 `apps/web-ui-template-preview`,用于确认模板默认壳面和路由表仍然可运行。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "__PROJECT_NAME__",
|
|
3
|
+
"packageManager": "__PACKAGE_MANAGER__",
|
|
4
|
+
"features": {
|
|
5
|
+
"desktop": "__ENABLE_DESKTOP__",
|
|
6
|
+
"microapp": "__ENABLE_MICROAPP__",
|
|
7
|
+
"chromeTabs": "__ENABLE_CHROME_TABS__",
|
|
8
|
+
"auth": "__ENABLE_AUTH__",
|
|
9
|
+
"sshForwarding": "__ENABLE_SSH_FORWARDING__"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { templateRuntimeConfig } from "../../src/shared/config";
|
|
2
|
+
|
|
3
|
+
// 生成模板桌面模式下的基础配置快照。
|
|
4
|
+
export function createDesktopBridgeConfig() {
|
|
5
|
+
return {
|
|
6
|
+
projectName: templateRuntimeConfig.projectName,
|
|
7
|
+
desktopEnabled: templateRuntimeConfig.features.desktop
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { templateRuntimeConfig } from "../../src/shared/config";
|
|
2
|
+
|
|
3
|
+
// 创建模板 SSH 转发能力描述,供后续桌面实现替换为真实逻辑。
|
|
4
|
+
export function createForwardingManager() {
|
|
5
|
+
return {
|
|
6
|
+
enabled: templateRuntimeConfig.features.sshForwarding,
|
|
7
|
+
mode: templateRuntimeConfig.features.sshForwarding ? "ssh" : "disabled"
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createDesktopBridgeConfig } from "../config/config-manager";
|
|
2
|
+
import { registerTemplateIpc } from "../ipc/index";
|
|
3
|
+
|
|
4
|
+
// 启动模板桌面主进程并返回最小桌面能力描述。
|
|
5
|
+
export function bootstrapTemplateDesktopMain() {
|
|
6
|
+
return {
|
|
7
|
+
config: createDesktopBridgeConfig(),
|
|
8
|
+
ipc: registerTemplateIpc()
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
2
|
+
import { defineConfig } from "electron-vite";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
5
|
+
import vue from "@vitejs/plugin-vue";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
main: {
|
|
9
|
+
build: {
|
|
10
|
+
outDir: "out/main",
|
|
11
|
+
rollupOptions: {
|
|
12
|
+
input: {
|
|
13
|
+
index: resolve(__dirname, "electron/main/index.ts")
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
preload: {
|
|
19
|
+
build: {
|
|
20
|
+
outDir: "out/preload",
|
|
21
|
+
rollupOptions: {
|
|
22
|
+
input: {
|
|
23
|
+
index: resolve(__dirname, "electron/preload/index.ts")
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
renderer: {
|
|
29
|
+
root: ".",
|
|
30
|
+
plugins: [
|
|
31
|
+
tsconfigPaths(),
|
|
32
|
+
tailwindcss(),
|
|
33
|
+
vue({
|
|
34
|
+
template: {
|
|
35
|
+
compilerOptions: {
|
|
36
|
+
isCustomElement: (tag) => tag === "micro-app"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
],
|
|
41
|
+
build: {
|
|
42
|
+
outDir: "out/renderer",
|
|
43
|
+
rollupOptions: {
|
|
44
|
+
input: {
|
|
45
|
+
index: resolve(__dirname, "index.html")
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>__PROJECT_NAME__</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="app"></div>
|
|
10
|
+
<script type="module" src="/src/app/main.ts"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__PROJECT_NAME__",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "__PACKAGE_MANAGER__",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "pnpm run dev:web",
|
|
9
|
+
"dev:web": "vite",
|
|
10
|
+
"dev:desktop": "electron-vite dev",
|
|
11
|
+
"build:web": "vite build",
|
|
12
|
+
"build": "pnpm run build:web",
|
|
13
|
+
"typecheck": "vue-tsc --noEmit",
|
|
14
|
+
"lint": "eslint . --max-warnings=0",
|
|
15
|
+
"test": "vitest run --passWithNoTests"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@micro-zoe/micro-app": "^1.0.0-rc.17",
|
|
19
|
+
"@wwchao6411/platform-shell-core": "workspace:*",
|
|
20
|
+
"@wwchao6411/platform-shell-electron": "workspace:*",
|
|
21
|
+
"@wwchao6411/platform-shell-microapp": "workspace:*",
|
|
22
|
+
"@wwchao6411/platform-shell-presets": "workspace:*",
|
|
23
|
+
"@wwchao6411/platform-shell-ui": "workspace:*",
|
|
24
|
+
"@wwchao6411/ui": "workspace:*",
|
|
25
|
+
"vue": "^3.5.22",
|
|
26
|
+
"vue-router": "^4.6.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@wwchao6411/configs": "workspace:*",
|
|
30
|
+
"@tailwindcss/vite": "^4.1.14",
|
|
31
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
32
|
+
"electron": "^37.4.0",
|
|
33
|
+
"electron-vite": "^4.0.0",
|
|
34
|
+
"sass": "^1.93.2",
|
|
35
|
+
"tailwindcss": "^4.1.14",
|
|
36
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("Scaffolded __PROJECT_NAME__ with __PACKAGE_MANAGER__.");
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { RouterLink, RouterView } from "vue-router";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<main class="template-shell min-h-screen px-6 py-8 text-slate-50">
|
|
7
|
+
<div class="mx-auto max-w-6xl space-y-6">
|
|
8
|
+
<header class="flex flex-wrap items-center gap-3 rounded-3xl border border-white/10 bg-white/5 p-4">
|
|
9
|
+
<RouterLink
|
|
10
|
+
class="rounded-2xl px-4 py-2 text-sm text-slate-200 transition hover:bg-white/10"
|
|
11
|
+
to="/"
|
|
12
|
+
>
|
|
13
|
+
Home
|
|
14
|
+
</RouterLink>
|
|
15
|
+
<RouterLink
|
|
16
|
+
class="rounded-2xl px-4 py-2 text-sm text-slate-200 transition hover:bg-white/10"
|
|
17
|
+
to="/login"
|
|
18
|
+
>
|
|
19
|
+
Login
|
|
20
|
+
</RouterLink>
|
|
21
|
+
<RouterLink
|
|
22
|
+
class="rounded-2xl px-4 py-2 text-sm text-slate-200 transition hover:bg-white/10"
|
|
23
|
+
to="/workspace"
|
|
24
|
+
>
|
|
25
|
+
Workspace
|
|
26
|
+
</RouterLink>
|
|
27
|
+
<RouterLink
|
|
28
|
+
class="rounded-2xl px-4 py-2 text-sm text-slate-200 transition hover:bg-white/10"
|
|
29
|
+
to="/workspace/sample-microapp"
|
|
30
|
+
>
|
|
31
|
+
Sample MicroApp
|
|
32
|
+
</RouterLink>
|
|
33
|
+
</header>
|
|
34
|
+
|
|
35
|
+
<RouterView />
|
|
36
|
+
</div>
|
|
37
|
+
</main>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
.template-shell {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
background:
|
|
5
|
+
radial-gradient(circle at top left, rgb(34 211 238 / 0.14), transparent 34%),
|
|
6
|
+
radial-gradient(circle at bottom right, rgb(14 165 233 / 0.18), transparent 32%),
|
|
7
|
+
linear-gradient(180deg, #020617 0%, #0f172a 100%);
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "./tailwind.css";
|
|
2
|
+
import "@wwchao6411/ui/styles.scss";
|
|
3
|
+
import "./app.scss";
|
|
4
|
+
|
|
5
|
+
import { createApp } from "vue";
|
|
6
|
+
import { createRouter, createWebHistory } from "vue-router";
|
|
7
|
+
|
|
8
|
+
import App from "./App.vue";
|
|
9
|
+
import { createTemplatePlatform } from "../platform/create-platform";
|
|
10
|
+
import { registerTemplateRoutes } from "../platform/register-routes";
|
|
11
|
+
|
|
12
|
+
const templatePlatform = createTemplatePlatform();
|
|
13
|
+
const router = createRouter({
|
|
14
|
+
history: createWebHistory(),
|
|
15
|
+
routes: registerTemplateRoutes()
|
|
16
|
+
});
|
|
17
|
+
const app = createApp(App);
|
|
18
|
+
|
|
19
|
+
app.provide("template-platform", templatePlatform);
|
|
20
|
+
app.use(router);
|
|
21
|
+
|
|
22
|
+
void router.isReady().finally(() => {
|
|
23
|
+
app.mount("#app");
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { templateRuntimeConfig } from "../shared/config";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<section class="rounded-3xl border border-white/10 bg-white/5 p-6">
|
|
7
|
+
<p class="text-xs uppercase tracking-[0.24em] text-cyan-300/80">
|
|
8
|
+
{{ templateRuntimeConfig.projectName }}
|
|
9
|
+
</p>
|
|
10
|
+
<h1 class="mt-3 text-3xl font-semibold">
|
|
11
|
+
Web UI template starter
|
|
12
|
+
</h1>
|
|
13
|
+
<p class="mt-3 max-w-3xl text-sm text-slate-300">
|
|
14
|
+
This starter keeps the platform shell, optional desktop runtime, and microapp surface in one
|
|
15
|
+
place for further product customization.
|
|
16
|
+
</p>
|
|
17
|
+
</section>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PlatformLoginPage } from "@wwchao6411/platform-shell-ui/vue";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<PlatformLoginPage
|
|
7
|
+
product-label="template"
|
|
8
|
+
:title="`Sign in to ${'__PROJECT_NAME__'}`"
|
|
9
|
+
description="Authenticate into the generated shell and continue into the workspace surface."
|
|
10
|
+
username-label="Username"
|
|
11
|
+
username-placeholder="operator"
|
|
12
|
+
password-label="Password"
|
|
13
|
+
password-placeholder="password"
|
|
14
|
+
submit-text="Enter Workspace"
|
|
15
|
+
hint="SSH forwarding and desktop integration can be enabled later."
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PlatformWorkspacePage } from "@wwchao6411/platform-shell-ui/vue";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<PlatformWorkspacePage
|
|
7
|
+
eyebrow="microapp"
|
|
8
|
+
title="Sample MicroApp Route"
|
|
9
|
+
description="Replace this stub with your first embedded business module or external product surface."
|
|
10
|
+
>
|
|
11
|
+
<div class="rounded-3xl border border-cyan-300/20 bg-slate-950/70 p-6 text-sm text-slate-200">
|
|
12
|
+
Sample MicroApp content renders here.
|
|
13
|
+
</div>
|
|
14
|
+
</PlatformWorkspacePage>
|
|
15
|
+
</template>
|