@nextclaw/app-runtime 0.14.1 → 0.15.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.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/package.js +1 -1
- package/dist/services/app-build.service.d.ts +1 -0
- package/dist/services/app-build.service.d.ts.map +1 -1
- package/dist/services/app-build.service.js +37 -2
- package/dist/services/app-build.service.js.map +1 -1
- package/dist/services/app-runtime-cli.service.js +1 -1
- package/dist/services/app-runtime-cli.service.js.map +1 -1
- package/dist/services/app-runtime-options.service.d.ts.map +1 -1
- package/dist/services/app-runtime-options.service.js +2 -2
- package/dist/services/app-runtime-options.service.js.map +1 -1
- package/dist/services/app-runtime-toolchain.service.d.ts +5 -2
- package/dist/services/app-runtime-toolchain.service.d.ts.map +1 -1
- package/dist/services/app-runtime-toolchain.service.js +36 -4
- package/dist/services/app-runtime-toolchain.service.js.map +1 -1
- package/dist/services/app-rust-wasi-scaffold-template.service.d.ts +24 -0
- package/dist/services/app-rust-wasi-scaffold-template.service.d.ts.map +1 -0
- package/dist/services/app-rust-wasi-scaffold-template.service.js +357 -0
- package/dist/services/app-rust-wasi-scaffold-template.service.js.map +1 -0
- package/dist/services/app-scaffold.service.d.ts +4 -2
- package/dist/services/app-scaffold.service.d.ts.map +1 -1
- package/dist/services/app-scaffold.service.js +20 -4
- package/dist/services/app-scaffold.service.js.map +1 -1
- package/dist/services/platform-auth-state.service.js +1 -1
- package/package.json +2 -1
- package/resources/rust-wasi/Cargo.lock +454 -0
- package/resources/wit/portable-service.wit +47 -0
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { AppInstanceService, AppRunResult } from "./services/app-instance.servic
|
|
|
14
14
|
import { HostBridgeServer } from "./services/host-bridge.service.js";
|
|
15
15
|
import { AppScaffoldFile, AppTsHttpScaffoldTemplateService } from "./services/app-ts-http-scaffold-template.service.js";
|
|
16
16
|
import { AppTsHttpLiteScaffoldTemplateService } from "./services/app-ts-http-lite-scaffold-template.service.js";
|
|
17
|
+
import { AppRustWasiScaffoldTemplateService } from "./services/app-rust-wasi-scaffold-template.service.js";
|
|
17
18
|
import { AppScaffoldResult, AppScaffoldService, AppScaffoldTemplate } from "./services/app-scaffold.service.js";
|
|
18
19
|
import { AppRuntimeOptionsService, BuildCliOptions, CreateCliOptions, GrantCliOptions, InstallCliOptions, JsonOnlyCliOptions, PackCliOptions, PublishCliOptions, RevokeCliOptions, RuntimeCliOptions, UninstallCliOptions, UpdateCliOptions } from "./services/app-runtime-options.service.js";
|
|
19
20
|
import { AppRuntimeCliService } from "./services/app-runtime-cli.service.js";
|
|
@@ -26,7 +27,7 @@ import { AppRegistryService } from "./services/app-registry.service.js";
|
|
|
26
27
|
import { AppGrantService } from "./services/app-grant.service.js";
|
|
27
28
|
import { GrantCommand } from "./controllers/grant.controller.js";
|
|
28
29
|
import { AppInstanceStorageService } from "./services/app-instance-storage.service.js";
|
|
29
|
-
import { AppRuntimeCommandResult, AppRuntimeDoctorResult, AppRuntimeToolStatus, AppRuntimeToolchainService } from "./services/app-runtime-toolchain.service.js";
|
|
30
|
+
import { AppRuntimeCommandResult, AppRuntimeDoctorResult, AppRuntimeToolStatus, AppRuntimeToolchainProfile, AppRuntimeToolchainService } from "./services/app-runtime-toolchain.service.js";
|
|
30
31
|
import { AppBuildResult, AppBuildService } from "./services/app-build.service.js";
|
|
31
32
|
import { AppRegistryConfigService } from "./services/app-registry-config.service.js";
|
|
32
33
|
import { AppRemoteRegistryClientService } from "./services/app-remote-registry-client.service.js";
|
|
@@ -57,4 +58,4 @@ import { AppServiceLaunch, AppServiceLaunchService } from "./services/app-servic
|
|
|
57
58
|
import { AppInstanceInventoryService } from "./services/app-instance-inventory.service.js";
|
|
58
59
|
import { FileLockBusyError, FileLockLease, FileLockService } from "./services/file-lock.service.js";
|
|
59
60
|
import { UiServerService } from "./services/ui-server.service.js";
|
|
60
|
-
export { APP_STORAGE_LAYOUT_VERSION, AppActivationResult, AppArtifactArchitecture, AppArtifactTarget, AppArtifactValidationExpectation, AppArtifactValidationResult, AppArtifactValidationService, AppBuildResult, AppBuildService, AppBundleChecksums, AppBundleExtractResult, AppBundleMetadata, AppBundlePackResult, AppBundleService, AppComponentKind, AppComponentManifest, AppComponentManifestBundle, AppComponentManifestSummary, AppComponentReference, AppCoreWasmMainManifest, AppDarwinArtifactTarget, AppDistributionDeclaration, AppDistributionMode, AppDocumentAccessMode, AppDocumentAccessScope, AppDocumentGrantMap, AppDocumentGrantMutationResult, AppDocumentGrantState, AppGrantService, AppHomeService, AppHostHandle, AppHostService, AppHostStartOptions, AppInfoResult, AppInstallProgressHandler, AppInstallProgressPhase, AppInstallResult, AppInstallSourceKind, AppInstallationIntegrityService, AppInstallationService, AppInstalledPermissionState, AppInstanceInventory, AppInstanceInventoryDiagnostic, AppInstanceInventoryEntry, AppInstanceInventoryService, AppInstanceMetadata, AppInstanceRecord, AppInstanceService, AppInstanceStorageService, AppLaunchResolution, AppLinuxArtifactTarget, AppMainManifest, AppManifest, AppManifestBundle, AppManifestService, AppManifestSummary, AppMarketplaceClientService, AppMarketplaceMetadata, AppMarketplaceMetadataService, AppMarketplaceVisuals, AppNativeArtifactTarget, AppPermissionSummary, AppPermissions, AppPermissionsService, AppPlatformSecuritySummary, AppPlatformTargetService, AppPreparedPublishArtifact, AppPublishArtifact, AppPublishArtifactService, AppPublishFile, AppPublishPayload, AppPublishResult, AppPublishService, AppPublishValidationResult, AppPublishValidationService, AppPublishValidationWarning, AppPublishValidationWarningCode, AppPublisher, AppRegistry, AppRegistryAppRecord, AppRegistryConfig, AppRegistryConfigService, AppRegistryConfigSnapshot, AppRegistryInstalledVersion, AppRegistryService, AppRemoteRegistryArtifact, AppRemoteRegistryClientService, AppRemoteRegistryDocument, AppRemoteRegistryResolution, AppRemoteRegistryVersion, AppResolvedComponent, AppRollbackResult, AppRunResult, AppRuntimeCliService, AppRuntimeCommandResult, AppRuntimeDeclaration, AppRuntimeDoctorResult, AppRuntimeIsolation, AppRuntimeOptionsService, AppRuntimeProfile, AppRuntimeToolStatus, AppRuntimeToolchainService, AppScaffoldFile, AppScaffoldResult, AppScaffoldService, AppScaffoldTemplate, AppServiceLaunch, AppServiceLaunchService, AppStandaloneManifest, AppStandaloneManifestBundle, AppStandaloneManifestSummary, AppStorageContext, AppStorageDeclaration, AppStorageLayout, AppStorageUsage, AppTsHttpLiteScaffoldTemplateService, AppTsHttpScaffoldTemplateService, AppUiManifest, AppUninstallResult, AppUniversalArtifactTarget, AppUpdateResult, AppWasiHttpComponentMainManifest, AppWindowsArtifactTarget, BuildCliOptions, CreateCliOptions, CreateCommand, DEFAULT_APP_INSTANCE_ID, DEFAULT_APP_MARKETPLACE_API_BASE, DEFAULT_APP_REGISTRY_URL, FileLockBusyError, FileLockLease, FileLockService, GrantCliOptions, GrantCommand, HostBridgeServer, InfoCommand, InstallCliOptions, InstallCommand, InstalledAppListItem, JsonOnlyCliOptions, ListCommand, MainRunRequest, MainRunResult, MainRunnerService, PackCliOptions, PackCommand, PermissionsCommand, PlatformAuthStateService, PlatformPublishAuthState, PublishCliOptions, PublishCommand, RegistryCommand, ResolvedDocumentGrant, ResolvedPermissions, RevokeCliOptions, RevokeCommand, RuntimeCliOptions, UiServerService, UninstallCliOptions, UninstallCommand, UpdateCliOptions, UpdateCommand, ValidatePublishCommand, WasmDocumentSummaryInput, WasmMainRunnerService, WasmSidecarClientService, WasmtimeWasiHttpComponentHandle, WasmtimeWasiHttpComponentService, WasmtimeWasiHttpComponentStartOptions, isAppComponentManifestBundle, isAppStandaloneManifestBundle };
|
|
61
|
+
export { APP_STORAGE_LAYOUT_VERSION, AppActivationResult, AppArtifactArchitecture, AppArtifactTarget, AppArtifactValidationExpectation, AppArtifactValidationResult, AppArtifactValidationService, AppBuildResult, AppBuildService, AppBundleChecksums, AppBundleExtractResult, AppBundleMetadata, AppBundlePackResult, AppBundleService, AppComponentKind, AppComponentManifest, AppComponentManifestBundle, AppComponentManifestSummary, AppComponentReference, AppCoreWasmMainManifest, AppDarwinArtifactTarget, AppDistributionDeclaration, AppDistributionMode, AppDocumentAccessMode, AppDocumentAccessScope, AppDocumentGrantMap, AppDocumentGrantMutationResult, AppDocumentGrantState, AppGrantService, AppHomeService, AppHostHandle, AppHostService, AppHostStartOptions, AppInfoResult, AppInstallProgressHandler, AppInstallProgressPhase, AppInstallResult, AppInstallSourceKind, AppInstallationIntegrityService, AppInstallationService, AppInstalledPermissionState, AppInstanceInventory, AppInstanceInventoryDiagnostic, AppInstanceInventoryEntry, AppInstanceInventoryService, AppInstanceMetadata, AppInstanceRecord, AppInstanceService, AppInstanceStorageService, AppLaunchResolution, AppLinuxArtifactTarget, AppMainManifest, AppManifest, AppManifestBundle, AppManifestService, AppManifestSummary, AppMarketplaceClientService, AppMarketplaceMetadata, AppMarketplaceMetadataService, AppMarketplaceVisuals, AppNativeArtifactTarget, AppPermissionSummary, AppPermissions, AppPermissionsService, AppPlatformSecuritySummary, AppPlatformTargetService, AppPreparedPublishArtifact, AppPublishArtifact, AppPublishArtifactService, AppPublishFile, AppPublishPayload, AppPublishResult, AppPublishService, AppPublishValidationResult, AppPublishValidationService, AppPublishValidationWarning, AppPublishValidationWarningCode, AppPublisher, AppRegistry, AppRegistryAppRecord, AppRegistryConfig, AppRegistryConfigService, AppRegistryConfigSnapshot, AppRegistryInstalledVersion, AppRegistryService, AppRemoteRegistryArtifact, AppRemoteRegistryClientService, AppRemoteRegistryDocument, AppRemoteRegistryResolution, AppRemoteRegistryVersion, AppResolvedComponent, AppRollbackResult, AppRunResult, AppRuntimeCliService, AppRuntimeCommandResult, AppRuntimeDeclaration, AppRuntimeDoctorResult, AppRuntimeIsolation, AppRuntimeOptionsService, AppRuntimeProfile, AppRuntimeToolStatus, AppRuntimeToolchainProfile, AppRuntimeToolchainService, AppRustWasiScaffoldTemplateService, AppScaffoldFile, AppScaffoldResult, AppScaffoldService, AppScaffoldTemplate, AppServiceLaunch, AppServiceLaunchService, AppStandaloneManifest, AppStandaloneManifestBundle, AppStandaloneManifestSummary, AppStorageContext, AppStorageDeclaration, AppStorageLayout, AppStorageUsage, AppTsHttpLiteScaffoldTemplateService, AppTsHttpScaffoldTemplateService, AppUiManifest, AppUninstallResult, AppUniversalArtifactTarget, AppUpdateResult, AppWasiHttpComponentMainManifest, AppWindowsArtifactTarget, BuildCliOptions, CreateCliOptions, CreateCommand, DEFAULT_APP_INSTANCE_ID, DEFAULT_APP_MARKETPLACE_API_BASE, DEFAULT_APP_REGISTRY_URL, FileLockBusyError, FileLockLease, FileLockService, GrantCliOptions, GrantCommand, HostBridgeServer, InfoCommand, InstallCliOptions, InstallCommand, InstalledAppListItem, JsonOnlyCliOptions, ListCommand, MainRunRequest, MainRunResult, MainRunnerService, PackCliOptions, PackCommand, PermissionsCommand, PlatformAuthStateService, PlatformPublishAuthState, PublishCliOptions, PublishCommand, RegistryCommand, ResolvedDocumentGrant, ResolvedPermissions, RevokeCliOptions, RevokeCommand, RuntimeCliOptions, UiServerService, UninstallCliOptions, UninstallCommand, UpdateCliOptions, UpdateCommand, ValidatePublishCommand, WasmDocumentSummaryInput, WasmMainRunnerService, WasmSidecarClientService, WasmtimeWasiHttpComponentHandle, WasmtimeWasiHttpComponentService, WasmtimeWasiHttpComponentStartOptions, isAppComponentManifestBundle, isAppStandaloneManifestBundle };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { AppBundleService } from "./services/app-bundle.service.js";
|
|
|
7
7
|
import { HostBridgeServer } from "./services/host-bridge.service.js";
|
|
8
8
|
import { AppTsHttpScaffoldTemplateService } from "./services/app-ts-http-scaffold-template.service.js";
|
|
9
9
|
import { AppTsHttpLiteScaffoldTemplateService } from "./services/app-ts-http-lite-scaffold-template.service.js";
|
|
10
|
+
import { AppRustWasiScaffoldTemplateService } from "./services/app-rust-wasi-scaffold-template.service.js";
|
|
10
11
|
import { AppScaffoldService } from "./services/app-scaffold.service.js";
|
|
11
12
|
import { CreateCommand } from "./controllers/create.controller.js";
|
|
12
13
|
import { UiServerService } from "./services/ui-server.service.js";
|
|
@@ -52,4 +53,4 @@ import { ValidatePublishCommand } from "./controllers/validate-publish.controlle
|
|
|
52
53
|
import { AppRuntimeOptionsService } from "./services/app-runtime-options.service.js";
|
|
53
54
|
import { AppRuntimeCliService } from "./services/app-runtime-cli.service.js";
|
|
54
55
|
import { AppInstanceInventoryService } from "./services/app-instance-inventory.service.js";
|
|
55
|
-
export { APP_STORAGE_LAYOUT_VERSION, AppArtifactValidationService, AppBuildService, AppBundleService, AppGrantService, AppHomeService, AppHostService, AppInstallationIntegrityService, AppInstallationService, AppInstanceInventoryService, AppInstanceService, AppInstanceStorageService, AppManifestService, AppMarketplaceClientService, AppMarketplaceMetadataService, AppPermissionsService, AppPlatformTargetService, AppPublishArtifactService, AppPublishService, AppPublishValidationService, AppRegistryConfigService, AppRegistryService, AppRemoteRegistryClientService, AppRuntimeCliService, AppRuntimeOptionsService, AppRuntimeToolchainService, AppScaffoldService, AppServiceLaunchService, AppTsHttpLiteScaffoldTemplateService, AppTsHttpScaffoldTemplateService, CreateCommand, DEFAULT_APP_INSTANCE_ID, DEFAULT_APP_MARKETPLACE_API_BASE, DEFAULT_APP_REGISTRY_URL, FileLockBusyError, FileLockService, GrantCommand, HostBridgeServer, InfoCommand, InstallCommand, ListCommand, MainRunnerService, PackCommand, PermissionsCommand, PlatformAuthStateService, PublishCommand, RegistryCommand, RevokeCommand, UiServerService, UninstallCommand, UpdateCommand, ValidatePublishCommand, WasmMainRunnerService, WasmSidecarClientService, WasmtimeWasiHttpComponentService, isAppComponentManifestBundle, isAppStandaloneManifestBundle };
|
|
56
|
+
export { APP_STORAGE_LAYOUT_VERSION, AppArtifactValidationService, AppBuildService, AppBundleService, AppGrantService, AppHomeService, AppHostService, AppInstallationIntegrityService, AppInstallationService, AppInstanceInventoryService, AppInstanceService, AppInstanceStorageService, AppManifestService, AppMarketplaceClientService, AppMarketplaceMetadataService, AppPermissionsService, AppPlatformTargetService, AppPublishArtifactService, AppPublishService, AppPublishValidationService, AppRegistryConfigService, AppRegistryService, AppRemoteRegistryClientService, AppRuntimeCliService, AppRuntimeOptionsService, AppRuntimeToolchainService, AppRustWasiScaffoldTemplateService, AppScaffoldService, AppServiceLaunchService, AppTsHttpLiteScaffoldTemplateService, AppTsHttpScaffoldTemplateService, CreateCommand, DEFAULT_APP_INSTANCE_ID, DEFAULT_APP_MARKETPLACE_API_BASE, DEFAULT_APP_REGISTRY_URL, FileLockBusyError, FileLockService, GrantCommand, HostBridgeServer, InfoCommand, InstallCommand, ListCommand, MainRunnerService, PackCommand, PermissionsCommand, PlatformAuthStateService, PublishCommand, RegistryCommand, RevokeCommand, UiServerService, UninstallCommand, UpdateCommand, ValidatePublishCommand, WasmMainRunnerService, WasmSidecarClientService, WasmtimeWasiHttpComponentService, isAppComponentManifestBundle, isAppStandaloneManifestBundle };
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-build.service.d.ts","names":[],"sources":["../../src/services/app-build.service.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"app-build.service.d.ts","names":[],"sources":["../../src/services/app-build.service.ts"],"mappings":";;;;KASY,cAAA;EACV,YAAA;EACA,QAAA;EACA,aAAA;EACA,qBAAA;EACA,KAAA;EACA,aAAA;AAAA;AAAA,cAGW,eAAA;EAAA,iBAEQ,eAAA;EAAA,iBACA,gBAAA;cADA,eAAA,GAAiB,kBAAA,EACjB,gBAAA,GAAkB,0BAAA;EAGrC,KAAA,GAAe,MAAA;IACb,YAAA;IACA,OAAA;EAAA,MACE,OAAA,CAAQ,cAAA;EAAA,QA8CJ,sBAAA;EAAA,QA4CA,UAAA;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppManifestService } from "./app-manifest.service.js";
|
|
2
|
-
import { isAppStandaloneManifestBundle } from "../types/app-manifest.types.js";
|
|
2
|
+
import { isAppComponentManifestBundle, isAppStandaloneManifestBundle } from "../types/app-manifest.types.js";
|
|
3
3
|
import { AppRuntimeToolchainService } from "./app-runtime-toolchain.service.js";
|
|
4
|
-
import { access } from "node:fs/promises";
|
|
4
|
+
import { access, copyFile, readFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
//#region src/services/app-build.service.ts
|
|
7
7
|
var AppBuildService = class {
|
|
@@ -12,6 +12,7 @@ var AppBuildService = class {
|
|
|
12
12
|
build = async (params) => {
|
|
13
13
|
const appDirectory = path.resolve(params.appDirectory);
|
|
14
14
|
const bundle = await this.manifestService.load(appDirectory);
|
|
15
|
+
if (isAppComponentManifestBundle(bundle)) return await this.buildRustWasiComponent(appDirectory, bundle.components);
|
|
15
16
|
if (!isAppStandaloneManifestBundle(bundle)) throw new Error("schema v2 组合包必须提交可直接运行的 bundle,不能执行本地 build。");
|
|
16
17
|
if (bundle.manifest.main.kind !== "wasi-http-component") return {
|
|
17
18
|
appDirectory,
|
|
@@ -44,6 +45,40 @@ var AppBuildService = class {
|
|
|
44
45
|
built: true
|
|
45
46
|
};
|
|
46
47
|
};
|
|
48
|
+
buildRustWasiComponent = async (appDirectory, components) => {
|
|
49
|
+
const serviceComponents = components.filter((component) => component.kind === "service");
|
|
50
|
+
if (serviceComponents.length !== 1) throw new Error(`Rust/WASI scaffold build requires exactly one Service Component; found ${serviceComponents.length}.`);
|
|
51
|
+
const guestDirectory = path.join(appDirectory, "guest");
|
|
52
|
+
const cargoTomlPath = path.join(guestDirectory, "Cargo.toml");
|
|
53
|
+
const cargoLockPath = path.join(guestDirectory, "Cargo.lock");
|
|
54
|
+
await Promise.all([access(cargoTomlPath), access(cargoLockPath)]);
|
|
55
|
+
await this.toolchainService.assertReadyForWasiComponentBuild();
|
|
56
|
+
await this.toolchainService.runCommand({
|
|
57
|
+
command: "cargo",
|
|
58
|
+
args: [
|
|
59
|
+
"build",
|
|
60
|
+
"--locked",
|
|
61
|
+
"--release",
|
|
62
|
+
"--target",
|
|
63
|
+
"wasm32-wasip2"
|
|
64
|
+
],
|
|
65
|
+
cwd: guestDirectory
|
|
66
|
+
});
|
|
67
|
+
const cargoToml = await readFile(cargoTomlPath, "utf8");
|
|
68
|
+
const crateName = /^name\s*=\s*"([^"]+)"/m.exec(cargoToml)?.[1];
|
|
69
|
+
if (!crateName) throw new Error("Rust Guest Cargo.toml must declare package.name.");
|
|
70
|
+
const compiledPath = path.join(guestDirectory, "target", "wasm32-wasip2", "release", `${crateName.replace(/-/g, "_")}.wasm`);
|
|
71
|
+
const mainEntryPath = path.join(serviceComponents[0].componentDirectory, "service.wasm");
|
|
72
|
+
await access(compiledPath);
|
|
73
|
+
await copyFile(compiledPath, mainEntryPath);
|
|
74
|
+
return {
|
|
75
|
+
appDirectory,
|
|
76
|
+
mainKind: "wasi-component",
|
|
77
|
+
mainEntryPath,
|
|
78
|
+
installedDependencies: false,
|
|
79
|
+
built: true
|
|
80
|
+
};
|
|
81
|
+
};
|
|
47
82
|
pathExists = async (targetPath) => {
|
|
48
83
|
try {
|
|
49
84
|
await access(targetPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-build.service.js","names":[],"sources":["../../src/services/app-build.service.ts"],"sourcesContent":["import { access } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { AppManifestService } from \"#app-runtime/services/app-manifest.service.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"app-build.service.js","names":[],"sources":["../../src/services/app-build.service.ts"],"sourcesContent":["import { access, copyFile, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { AppManifestService } from \"#app-runtime/services/app-manifest.service.js\";\nimport {\n isAppComponentManifestBundle,\n isAppStandaloneManifestBundle,\n} from \"#app-runtime/types/app-manifest.types.js\";\nimport { AppRuntimeToolchainService } from \"./app-runtime-toolchain.service.js\";\n\nexport type AppBuildResult = {\n appDirectory: string;\n mainKind: string;\n mainEntryPath: string;\n installedDependencies: boolean;\n built: boolean;\n skippedReason?: string;\n};\n\nexport class AppBuildService {\n constructor(\n private readonly manifestService: AppManifestService = new AppManifestService(),\n private readonly toolchainService: AppRuntimeToolchainService = new AppRuntimeToolchainService(),\n ) {}\n\n build = async (params: {\n appDirectory: string;\n install: boolean;\n }): Promise<AppBuildResult> => {\n const appDirectory = path.resolve(params.appDirectory);\n const bundle = await this.manifestService.load(appDirectory);\n if (isAppComponentManifestBundle(bundle)) {\n return await this.buildRustWasiComponent(appDirectory, bundle.components);\n }\n if (!isAppStandaloneManifestBundle(bundle)) {\n throw new Error(\"schema v2 组合包必须提交可直接运行的 bundle,不能执行本地 build。\");\n }\n if (bundle.manifest.main.kind !== \"wasi-http-component\") {\n return {\n appDirectory,\n mainKind: bundle.manifest.main.kind,\n mainEntryPath: bundle.mainEntryPath,\n installedDependencies: false,\n built: false,\n skippedReason: \"main.kind=wasm 应用不需要 TS/WASI HTTP 构建。\",\n };\n }\n\n await this.toolchainService.assertReadyForWasiHttpBuild();\n const mainDirectory = path.join(appDirectory, \"main\");\n await access(path.join(mainDirectory, \"package.json\"));\n const shouldInstall = params.install || !(await this.pathExists(path.join(mainDirectory, \"node_modules\")));\n if (shouldInstall) {\n await this.toolchainService.runCommand({\n command: \"npm\",\n args: [\"install\"],\n cwd: mainDirectory,\n });\n }\n await this.toolchainService.runCommand({\n command: \"npm\",\n args: [\"run\", \"build\"],\n cwd: mainDirectory,\n });\n await access(bundle.mainEntryPath);\n return {\n appDirectory,\n mainKind: bundle.manifest.main.kind,\n mainEntryPath: bundle.mainEntryPath,\n installedDependencies: shouldInstall,\n built: true,\n };\n };\n\n private buildRustWasiComponent = async (\n appDirectory: string,\n components: Array<{ kind: \"panel\" | \"service\"; componentDirectory: string }>,\n ): Promise<AppBuildResult> => {\n const serviceComponents = components.filter((component) => component.kind === \"service\");\n if (serviceComponents.length !== 1) {\n throw new Error(\n `Rust/WASI scaffold build requires exactly one Service Component; found ${serviceComponents.length}.`,\n );\n }\n const guestDirectory = path.join(appDirectory, \"guest\");\n const cargoTomlPath = path.join(guestDirectory, \"Cargo.toml\");\n const cargoLockPath = path.join(guestDirectory, \"Cargo.lock\");\n await Promise.all([access(cargoTomlPath), access(cargoLockPath)]);\n await this.toolchainService.assertReadyForWasiComponentBuild();\n await this.toolchainService.runCommand({\n command: \"cargo\",\n args: [\"build\", \"--locked\", \"--release\", \"--target\", \"wasm32-wasip2\"],\n cwd: guestDirectory,\n });\n const cargoToml = await readFile(cargoTomlPath, \"utf8\");\n const crateName = /^name\\s*=\\s*\"([^\"]+)\"/m.exec(cargoToml)?.[1];\n if (!crateName) {\n throw new Error(\"Rust Guest Cargo.toml must declare package.name.\");\n }\n const compiledPath = path.join(\n guestDirectory,\n \"target\",\n \"wasm32-wasip2\",\n \"release\",\n `${crateName.replace(/-/g, \"_\")}.wasm`,\n );\n const mainEntryPath = path.join(serviceComponents[0]!.componentDirectory, \"service.wasm\");\n await access(compiledPath);\n await copyFile(compiledPath, mainEntryPath);\n return {\n appDirectory,\n mainKind: \"wasi-component\",\n mainEntryPath,\n installedDependencies: false,\n built: true,\n };\n };\n\n private pathExists = async (targetPath: string): Promise<boolean> => {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n };\n}\n"],"mappings":";;;;;;AAkBA,IAAa,kBAAb,MAA6B;CAC3B,YACE,kBAAuD,IAAI,oBAAoB,EAC/E,mBAAgE,IAAI,4BAA4B,EAChG;AAFiB,OAAA,kBAAA;AACA,OAAA,mBAAA;;CAGnB,QAAQ,OAAO,WAGgB;EAC7B,MAAM,eAAe,KAAK,QAAQ,OAAO,aAAa;EACtD,MAAM,SAAS,MAAM,KAAK,gBAAgB,KAAK,aAAa;AAC5D,MAAI,6BAA6B,OAAO,CACtC,QAAO,MAAM,KAAK,uBAAuB,cAAc,OAAO,WAAW;AAE3E,MAAI,CAAC,8BAA8B,OAAO,CACxC,OAAM,IAAI,MAAM,+CAA+C;AAEjE,MAAI,OAAO,SAAS,KAAK,SAAS,sBAChC,QAAO;GACL;GACA,UAAU,OAAO,SAAS,KAAK;GAC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AAI,CAAC,UACH,OAAM,IAAI,MAAM,mDAAmD;EAErE,MAAM,eAAe,KAAK,KACxB,gBACA,UACA,iBACA,WACA,GAAG,UAAU,QAAQ,MAAM,IAAI,CAAC,OACjC;EACD,MAAM,gBAAgB,KAAK,KAAK,kBAAkB,GAAI,oBAAoB,eAAe;AACzF,QAAM,OAAO,aAAa;AAC1B,QAAM,SAAS,cAAc,cAAc;AAC3C,SAAO;GACL;GACA,UAAU;GACV;GACA,uBAAuB;GACvB,OAAO;GACR;;CAGH,aAAqB,OAAO,eAAyC;AACnE,MAAI;AACF,SAAM,OAAO,WAAW;AACxB,UAAO;UACD;AACN,UAAO"}
|
|
@@ -339,7 +339,7 @@ var AppRuntimeCliService = class {
|
|
|
339
339
|
});
|
|
340
340
|
};
|
|
341
341
|
writeUsage = () => {
|
|
342
|
-
this.write("Usage: napp create <app-dir> [--template starter|ts-http|ts-http-lite] [--json]\n");
|
|
342
|
+
this.write("Usage: napp create <app-dir> [--template starter|ts-http|ts-http-lite|rust-wasi] [--json]\n");
|
|
343
343
|
this.write(" napp inspect <app-dir> [--json]\n");
|
|
344
344
|
this.write(" napp build <app-dir> [--install] [--json]\n");
|
|
345
345
|
this.write(" napp doctor [--json]\n");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-cli.service.js","names":["packageJson.version"],"sources":["../../src/services/app-runtime-cli.service.ts"],"sourcesContent":["import packageJson from \"../../package.json\" with { type: \"json\" };\nimport { CreateCommand } from \"#app-runtime/controllers/create.controller.js\";\nimport { DevCommand } from \"#app-runtime/controllers/dev.controller.js\";\nimport { GrantCommand } from \"#app-runtime/controllers/grant.controller.js\";\nimport { InfoCommand } from \"#app-runtime/controllers/info.controller.js\";\nimport { InspectCommand } from \"#app-runtime/controllers/inspect.controller.js\";\nimport { InstallCommand } from \"#app-runtime/controllers/install.controller.js\";\nimport { ListCommand } from \"#app-runtime/controllers/list.controller.js\";\nimport { PackCommand } from \"#app-runtime/controllers/pack.controller.js\";\nimport { PermissionsCommand } from \"#app-runtime/controllers/permissions.controller.js\";\nimport { PublishCommand } from \"#app-runtime/controllers/publish.controller.js\";\nimport { RegistryCommand } from \"#app-runtime/controllers/registry.controller.js\";\nimport { RevokeCommand } from \"#app-runtime/controllers/revoke.controller.js\";\nimport { RunCommand } from \"#app-runtime/controllers/run.controller.js\";\nimport { UninstallCommand } from \"#app-runtime/controllers/uninstall.controller.js\";\nimport { UpdateCommand } from \"#app-runtime/controllers/update.controller.js\";\nimport { ValidatePublishCommand } from \"#app-runtime/controllers/validate-publish.controller.js\";\nimport { AppBuildService } from \"#app-runtime/services/app-build.service.js\";\nimport { AppRuntimeToolchainService } from \"#app-runtime/services/app-runtime-toolchain.service.js\";\nimport { AppRuntimeOptionsService } from \"./app-runtime-options.service.js\";\n\nexport class AppRuntimeCliService {\n constructor(\n private readonly optionsService: AppRuntimeOptionsService = new AppRuntimeOptionsService(),\n ) {}\n\n run = async (): Promise<void> => {\n const args = process.argv.slice(2);\n const [command, ...restArgs] = args;\n if (command === \"--help\" || command === \"help\") {\n this.writeUsage();\n return;\n }\n if (command === \"--version\" || command === \"version\") {\n this.write(`${packageJson.version}\\n`);\n return;\n }\n if (!command) {\n this.writeUsage();\n process.exit(1);\n }\n await this.dispatch(command, restArgs);\n };\n\n private dispatch = async (command: string, restArgs: string[]): Promise<void> => {\n switch (command) {\n case \"create\":\n await this.handleCreate(restArgs);\n return;\n case \"inspect\":\n await this.handleInspect(restArgs);\n return;\n case \"build\":\n await this.handleBuild(restArgs);\n return;\n case \"doctor\":\n await this.handleDoctor(restArgs);\n return;\n case \"run\":\n await this.handleRun(restArgs);\n return;\n case \"dev\":\n await this.handleDev(restArgs);\n return;\n case \"pack\":\n await this.handlePack(restArgs);\n return;\n case \"publish\":\n await this.handlePublish(restArgs);\n return;\n case \"validate-publish\":\n await this.handleValidatePublish(restArgs);\n return;\n case \"install\":\n await this.handleInstall(restArgs);\n return;\n case \"update\":\n await this.handleUpdate(restArgs);\n return;\n case \"uninstall\":\n await this.handleUninstall(restArgs);\n return;\n case \"list\":\n await this.handleList(restArgs);\n return;\n case \"info\":\n await this.handleInfo(restArgs);\n return;\n case \"registry\":\n await this.handleRegistry(restArgs);\n return;\n case \"permissions\":\n await this.handlePermissions(restArgs);\n return;\n case \"grant\":\n await this.handleGrant(restArgs);\n return;\n case \"revoke\":\n await this.handleRevoke(restArgs);\n return;\n default:\n this.writeUsage();\n process.exit(1);\n }\n };\n\n private handleCreate = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"create\", restArgs);\n const options = this.optionsService.readCreateOptions(optionArgs);\n await new CreateCommand().run({\n appDirectory: target,\n template: options.template,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleInspect = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"inspect\", restArgs);\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new InspectCommand().run({\n appDirectory: target,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleBuild = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"build\", restArgs);\n const options = this.optionsService.readBuildOptions(optionArgs);\n const result = await new AppBuildService().build({\n appDirectory: target,\n install: options.install,\n });\n if (options.json) {\n this.write(`${JSON.stringify({ ok: true, build: result }, null, 2)}\\n`);\n return;\n }\n if (!result.built) {\n this.write(`Build skipped: ${result.skippedReason ?? result.mainKind}\\n`);\n return;\n }\n this.write(`Built ${result.mainKind} app\\n`);\n this.write(`Main: ${result.mainEntryPath}\\n`);\n if (result.installedDependencies) {\n this.write(\"Dependencies: installed\\n\");\n }\n };\n\n private handleDoctor = async (restArgs: string[]): Promise<void> => {\n const options = this.optionsService.readJsonOnlyOptions(restArgs);\n const result = await new AppRuntimeToolchainService().doctor();\n if (options.json) {\n this.write(`${JSON.stringify({ ok: result.ok, doctor: result }, null, 2)}\\n`);\n if (!result.ok) {\n process.exitCode = 1;\n }\n return;\n }\n this.write(`NApp runtime doctor: ${result.ok ? \"ok\" : \"not ready\"}\\n`);\n for (const tool of result.tools) {\n this.write(\n `${tool.ok ? \"ok\" : \"missing\"} ${tool.name}${tool.version ? ` ${tool.version}` : \"\"}\\n`,\n );\n if (!tool.ok) {\n this.write(` ${tool.installHint}\\n`);\n }\n }\n if (!result.ok) {\n process.exitCode = 1;\n }\n };\n\n private handleRun = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"run\", restArgs);\n const options = this.optionsService.readRuntimeOptions(optionArgs);\n await new RunCommand().run({\n appReference: target,\n host: options.host,\n port: options.port,\n dataDirectory: options.dataDirectory,\n json: options.json,\n documentGrantMap: options.documentGrantMap,\n write: this.write,\n });\n };\n\n private handleDev = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"dev\", restArgs);\n const options = this.optionsService.readRuntimeOptions(optionArgs);\n await new DevCommand().run({\n appReference: target,\n host: options.host,\n port: options.port,\n dataDirectory: options.dataDirectory,\n json: options.json,\n documentGrantMap: options.documentGrantMap,\n write: this.write,\n });\n };\n\n private handlePack = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"pack\", restArgs);\n const options = this.optionsService.readPackOptions(optionArgs);\n await new PackCommand().run({\n appDirectory: target,\n outputPath: options.outputPath,\n mode: options.mode,\n json: options.json,\n write: this.write,\n });\n };\n\n private handlePublish = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"publish\", restArgs);\n const options = this.optionsService.readPublishOptions(optionArgs);\n await new PublishCommand().run({\n appDirectory: target,\n metadataPath: options.metadataPath,\n apiBaseUrl: options.apiBaseUrl,\n token: options.token,\n mode: options.mode,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleValidatePublish = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"validate-publish\", restArgs);\n const options = this.optionsService.readPublishOptions(optionArgs);\n await new ValidatePublishCommand().run({\n appDirectory: target,\n metadataPath: options.metadataPath,\n mode: options.mode,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleInstall = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"install\", restArgs);\n const options = this.optionsService.readInstallOptions(optionArgs);\n await new InstallCommand().run({\n appSource: target,\n registryUrl: options.registryUrl,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleUpdate = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"update\", restArgs);\n const options = this.optionsService.readUpdateOptions(optionArgs);\n await new UpdateCommand().run({\n appId: target,\n version: options.version,\n registryUrl: options.registryUrl,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleUninstall = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"uninstall\", restArgs);\n const options = this.optionsService.readUninstallOptions(optionArgs);\n await new UninstallCommand().run({\n appId: target,\n purgeData: options.purgeData,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleList = async (restArgs: string[]): Promise<void> => {\n const options = this.optionsService.readJsonOnlyOptions(restArgs);\n await new ListCommand().run({\n json: options.json,\n write: this.write,\n });\n };\n\n private handleInfo = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"info\", restArgs);\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new InfoCommand().run({\n appId: target,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleRegistry = async (restArgs: string[]): Promise<void> => {\n const [actionOrUrl, ...optionArgs] = restArgs;\n if (!actionOrUrl || actionOrUrl === \"get\") {\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new RegistryCommand().run({\n action: \"get\",\n json: options.json,\n write: this.write,\n });\n return;\n }\n if (actionOrUrl === \"--json\") {\n const options = this.optionsService.readJsonOnlyOptions([actionOrUrl, ...optionArgs]);\n await new RegistryCommand().run({\n action: \"get\",\n json: options.json,\n write: this.write,\n });\n return;\n }\n if (actionOrUrl === \"set\") {\n const { target, optionArgs: actionOptionArgs } = this.optionsService.readTarget(\n \"registry set\",\n optionArgs,\n );\n const options = this.optionsService.readJsonOnlyOptions(actionOptionArgs);\n await new RegistryCommand().run({\n action: \"set\",\n registryUrl: target,\n json: options.json,\n write: this.write,\n });\n return;\n }\n if (actionOrUrl === \"reset\") {\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new RegistryCommand().run({\n action: \"reset\",\n json: options.json,\n write: this.write,\n });\n return;\n }\n throw new Error(`未知 registry 子命令:${actionOrUrl}`);\n };\n\n private handlePermissions = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"permissions\", restArgs);\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new PermissionsCommand().run({\n appId: target,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleGrant = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"grant\", restArgs);\n const options = this.optionsService.readGrantOptions(optionArgs);\n await new GrantCommand().run({\n appId: target,\n documentGrantMap: options.documentGrantMap,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleRevoke = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"revoke\", restArgs);\n const options = this.optionsService.readRevokeOptions(optionArgs);\n await new RevokeCommand().run({\n appId: target,\n documentScopeIds: options.documentScopeIds,\n json: options.json,\n write: this.write,\n });\n };\n\n private writeUsage = (): void => {\n this.write(\"Usage: napp create <app-dir> [--template starter|ts-http|ts-http-lite] [--json]\\n\");\n this.write(\" napp inspect <app-dir> [--json]\\n\");\n this.write(\" napp build <app-dir> [--install] [--json]\\n\");\n this.write(\" napp doctor [--json]\\n\");\n this.write(\" napp <run|dev> <app-dir|app-id> [--host 127.0.0.1] [--port 3100] [--data /path] [--json] [--document scope=/path]\\n\");\n this.write(\" napp pack <app-dir> [--mode source|bundle] [--out bundle.napp] [--json]\\n\");\n this.write(\" napp publish <app-dir> [--mode source|bundle] [--meta marketplace.json] [--api-base <url>] [--token <token>] [--json]\\n\");\n this.write(\" napp validate-publish <app-dir> [--mode source|bundle] [--meta marketplace.json] [--json]\\n\");\n this.write(\" napp install <app-dir|bundle.napp|app-id[@version]> [--registry <url>] [--json]\\n\");\n this.write(\" napp update <app-id> [--version <version>] [--registry <url>] [--json]\\n\");\n this.write(\" napp uninstall <app-id> [--purge-data] [--json]\\n\");\n this.write(\" napp list [--json]\\n\");\n this.write(\" napp info <app-id> [--json]\\n\");\n this.write(\" napp registry [get] [--json]\\n\");\n this.write(\" napp registry set <url> [--json]\\n\");\n this.write(\" napp registry reset [--json]\\n\");\n this.write(\" napp permissions <app-id> [--json]\\n\");\n this.write(\" napp grant <app-id> --document scope=/path [--json]\\n\");\n this.write(\" napp revoke <app-id> --document scope [--json]\\n\");\n this.write(\" napp --help\\n\");\n this.write(\" napp --version\\n\");\n };\n\n private write = (text: string): void => {\n process.stdout.write(text);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,IAAa,uBAAb,MAAkC;CAChC,YACE,iBAA4D,IAAI,0BAA0B,EAC1F;AADiB,OAAA,iBAAA;;CAGnB,MAAM,YAA2B;EAE/B,MAAM,CAAC,SAAS,GAAG,YADN,QAAQ,KAAK,MAAM,EAAE;AAElC,MAAI,YAAY,YAAY,YAAY,QAAQ;AAC9C,QAAK,YAAY;AACjB;;AAEF,MAAI,YAAY,eAAe,YAAY,WAAW;AACpD,QAAK,MAAM,GAAGA,QAAoB,IAAI;AACtC;;AAEF,MAAI,CAAC,SAAS;AACZ,QAAK,YAAY;AACjB,WAAQ,KAAK,EAAE;;AAEjB,QAAM,KAAK,SAAS,SAAS,SAAS;;CAGxC,WAAmB,OAAO,SAAiB,aAAsC;AAC/E,UAAQ,SAAR;GACE,KAAK;AACH,UAAM,KAAK,aAAa,SAAS;AACjC;GACF,KAAK;AACH,UAAM,KAAK,cAAc,SAAS;AAClC;GACF,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AAO,MAAM,KAAK"}
|
|
1
|
+
{"version":3,"file":"app-runtime-cli.service.js","names":["packageJson.version"],"sources":["../../src/services/app-runtime-cli.service.ts"],"sourcesContent":["import packageJson from \"../../package.json\" with { type: \"json\" };\nimport { CreateCommand } from \"#app-runtime/controllers/create.controller.js\";\nimport { DevCommand } from \"#app-runtime/controllers/dev.controller.js\";\nimport { GrantCommand } from \"#app-runtime/controllers/grant.controller.js\";\nimport { InfoCommand } from \"#app-runtime/controllers/info.controller.js\";\nimport { InspectCommand } from \"#app-runtime/controllers/inspect.controller.js\";\nimport { InstallCommand } from \"#app-runtime/controllers/install.controller.js\";\nimport { ListCommand } from \"#app-runtime/controllers/list.controller.js\";\nimport { PackCommand } from \"#app-runtime/controllers/pack.controller.js\";\nimport { PermissionsCommand } from \"#app-runtime/controllers/permissions.controller.js\";\nimport { PublishCommand } from \"#app-runtime/controllers/publish.controller.js\";\nimport { RegistryCommand } from \"#app-runtime/controllers/registry.controller.js\";\nimport { RevokeCommand } from \"#app-runtime/controllers/revoke.controller.js\";\nimport { RunCommand } from \"#app-runtime/controllers/run.controller.js\";\nimport { UninstallCommand } from \"#app-runtime/controllers/uninstall.controller.js\";\nimport { UpdateCommand } from \"#app-runtime/controllers/update.controller.js\";\nimport { ValidatePublishCommand } from \"#app-runtime/controllers/validate-publish.controller.js\";\nimport { AppBuildService } from \"#app-runtime/services/app-build.service.js\";\nimport { AppRuntimeToolchainService } from \"#app-runtime/services/app-runtime-toolchain.service.js\";\nimport { AppRuntimeOptionsService } from \"./app-runtime-options.service.js\";\n\nexport class AppRuntimeCliService {\n constructor(\n private readonly optionsService: AppRuntimeOptionsService = new AppRuntimeOptionsService(),\n ) {}\n\n run = async (): Promise<void> => {\n const args = process.argv.slice(2);\n const [command, ...restArgs] = args;\n if (command === \"--help\" || command === \"help\") {\n this.writeUsage();\n return;\n }\n if (command === \"--version\" || command === \"version\") {\n this.write(`${packageJson.version}\\n`);\n return;\n }\n if (!command) {\n this.writeUsage();\n process.exit(1);\n }\n await this.dispatch(command, restArgs);\n };\n\n private dispatch = async (command: string, restArgs: string[]): Promise<void> => {\n switch (command) {\n case \"create\":\n await this.handleCreate(restArgs);\n return;\n case \"inspect\":\n await this.handleInspect(restArgs);\n return;\n case \"build\":\n await this.handleBuild(restArgs);\n return;\n case \"doctor\":\n await this.handleDoctor(restArgs);\n return;\n case \"run\":\n await this.handleRun(restArgs);\n return;\n case \"dev\":\n await this.handleDev(restArgs);\n return;\n case \"pack\":\n await this.handlePack(restArgs);\n return;\n case \"publish\":\n await this.handlePublish(restArgs);\n return;\n case \"validate-publish\":\n await this.handleValidatePublish(restArgs);\n return;\n case \"install\":\n await this.handleInstall(restArgs);\n return;\n case \"update\":\n await this.handleUpdate(restArgs);\n return;\n case \"uninstall\":\n await this.handleUninstall(restArgs);\n return;\n case \"list\":\n await this.handleList(restArgs);\n return;\n case \"info\":\n await this.handleInfo(restArgs);\n return;\n case \"registry\":\n await this.handleRegistry(restArgs);\n return;\n case \"permissions\":\n await this.handlePermissions(restArgs);\n return;\n case \"grant\":\n await this.handleGrant(restArgs);\n return;\n case \"revoke\":\n await this.handleRevoke(restArgs);\n return;\n default:\n this.writeUsage();\n process.exit(1);\n }\n };\n\n private handleCreate = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"create\", restArgs);\n const options = this.optionsService.readCreateOptions(optionArgs);\n await new CreateCommand().run({\n appDirectory: target,\n template: options.template,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleInspect = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"inspect\", restArgs);\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new InspectCommand().run({\n appDirectory: target,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleBuild = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"build\", restArgs);\n const options = this.optionsService.readBuildOptions(optionArgs);\n const result = await new AppBuildService().build({\n appDirectory: target,\n install: options.install,\n });\n if (options.json) {\n this.write(`${JSON.stringify({ ok: true, build: result }, null, 2)}\\n`);\n return;\n }\n if (!result.built) {\n this.write(`Build skipped: ${result.skippedReason ?? result.mainKind}\\n`);\n return;\n }\n this.write(`Built ${result.mainKind} app\\n`);\n this.write(`Main: ${result.mainEntryPath}\\n`);\n if (result.installedDependencies) {\n this.write(\"Dependencies: installed\\n\");\n }\n };\n\n private handleDoctor = async (restArgs: string[]): Promise<void> => {\n const options = this.optionsService.readJsonOnlyOptions(restArgs);\n const result = await new AppRuntimeToolchainService().doctor();\n if (options.json) {\n this.write(`${JSON.stringify({ ok: result.ok, doctor: result }, null, 2)}\\n`);\n if (!result.ok) {\n process.exitCode = 1;\n }\n return;\n }\n this.write(`NApp runtime doctor: ${result.ok ? \"ok\" : \"not ready\"}\\n`);\n for (const tool of result.tools) {\n this.write(\n `${tool.ok ? \"ok\" : \"missing\"} ${tool.name}${tool.version ? ` ${tool.version}` : \"\"}\\n`,\n );\n if (!tool.ok) {\n this.write(` ${tool.installHint}\\n`);\n }\n }\n if (!result.ok) {\n process.exitCode = 1;\n }\n };\n\n private handleRun = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"run\", restArgs);\n const options = this.optionsService.readRuntimeOptions(optionArgs);\n await new RunCommand().run({\n appReference: target,\n host: options.host,\n port: options.port,\n dataDirectory: options.dataDirectory,\n json: options.json,\n documentGrantMap: options.documentGrantMap,\n write: this.write,\n });\n };\n\n private handleDev = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"dev\", restArgs);\n const options = this.optionsService.readRuntimeOptions(optionArgs);\n await new DevCommand().run({\n appReference: target,\n host: options.host,\n port: options.port,\n dataDirectory: options.dataDirectory,\n json: options.json,\n documentGrantMap: options.documentGrantMap,\n write: this.write,\n });\n };\n\n private handlePack = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"pack\", restArgs);\n const options = this.optionsService.readPackOptions(optionArgs);\n await new PackCommand().run({\n appDirectory: target,\n outputPath: options.outputPath,\n mode: options.mode,\n json: options.json,\n write: this.write,\n });\n };\n\n private handlePublish = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"publish\", restArgs);\n const options = this.optionsService.readPublishOptions(optionArgs);\n await new PublishCommand().run({\n appDirectory: target,\n metadataPath: options.metadataPath,\n apiBaseUrl: options.apiBaseUrl,\n token: options.token,\n mode: options.mode,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleValidatePublish = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"validate-publish\", restArgs);\n const options = this.optionsService.readPublishOptions(optionArgs);\n await new ValidatePublishCommand().run({\n appDirectory: target,\n metadataPath: options.metadataPath,\n mode: options.mode,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleInstall = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"install\", restArgs);\n const options = this.optionsService.readInstallOptions(optionArgs);\n await new InstallCommand().run({\n appSource: target,\n registryUrl: options.registryUrl,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleUpdate = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"update\", restArgs);\n const options = this.optionsService.readUpdateOptions(optionArgs);\n await new UpdateCommand().run({\n appId: target,\n version: options.version,\n registryUrl: options.registryUrl,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleUninstall = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"uninstall\", restArgs);\n const options = this.optionsService.readUninstallOptions(optionArgs);\n await new UninstallCommand().run({\n appId: target,\n purgeData: options.purgeData,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleList = async (restArgs: string[]): Promise<void> => {\n const options = this.optionsService.readJsonOnlyOptions(restArgs);\n await new ListCommand().run({\n json: options.json,\n write: this.write,\n });\n };\n\n private handleInfo = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"info\", restArgs);\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new InfoCommand().run({\n appId: target,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleRegistry = async (restArgs: string[]): Promise<void> => {\n const [actionOrUrl, ...optionArgs] = restArgs;\n if (!actionOrUrl || actionOrUrl === \"get\") {\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new RegistryCommand().run({\n action: \"get\",\n json: options.json,\n write: this.write,\n });\n return;\n }\n if (actionOrUrl === \"--json\") {\n const options = this.optionsService.readJsonOnlyOptions([actionOrUrl, ...optionArgs]);\n await new RegistryCommand().run({\n action: \"get\",\n json: options.json,\n write: this.write,\n });\n return;\n }\n if (actionOrUrl === \"set\") {\n const { target, optionArgs: actionOptionArgs } = this.optionsService.readTarget(\n \"registry set\",\n optionArgs,\n );\n const options = this.optionsService.readJsonOnlyOptions(actionOptionArgs);\n await new RegistryCommand().run({\n action: \"set\",\n registryUrl: target,\n json: options.json,\n write: this.write,\n });\n return;\n }\n if (actionOrUrl === \"reset\") {\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new RegistryCommand().run({\n action: \"reset\",\n json: options.json,\n write: this.write,\n });\n return;\n }\n throw new Error(`未知 registry 子命令:${actionOrUrl}`);\n };\n\n private handlePermissions = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"permissions\", restArgs);\n const options = this.optionsService.readJsonOnlyOptions(optionArgs);\n await new PermissionsCommand().run({\n appId: target,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleGrant = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"grant\", restArgs);\n const options = this.optionsService.readGrantOptions(optionArgs);\n await new GrantCommand().run({\n appId: target,\n documentGrantMap: options.documentGrantMap,\n json: options.json,\n write: this.write,\n });\n };\n\n private handleRevoke = async (restArgs: string[]): Promise<void> => {\n const { target, optionArgs } = this.optionsService.readTarget(\"revoke\", restArgs);\n const options = this.optionsService.readRevokeOptions(optionArgs);\n await new RevokeCommand().run({\n appId: target,\n documentScopeIds: options.documentScopeIds,\n json: options.json,\n write: this.write,\n });\n };\n\n private writeUsage = (): void => {\n this.write(\"Usage: napp create <app-dir> [--template starter|ts-http|ts-http-lite|rust-wasi] [--json]\\n\");\n this.write(\" napp inspect <app-dir> [--json]\\n\");\n this.write(\" napp build <app-dir> [--install] [--json]\\n\");\n this.write(\" napp doctor [--json]\\n\");\n this.write(\" napp <run|dev> <app-dir|app-id> [--host 127.0.0.1] [--port 3100] [--data /path] [--json] [--document scope=/path]\\n\");\n this.write(\" napp pack <app-dir> [--mode source|bundle] [--out bundle.napp] [--json]\\n\");\n this.write(\" napp publish <app-dir> [--mode source|bundle] [--meta marketplace.json] [--api-base <url>] [--token <token>] [--json]\\n\");\n this.write(\" napp validate-publish <app-dir> [--mode source|bundle] [--meta marketplace.json] [--json]\\n\");\n this.write(\" napp install <app-dir|bundle.napp|app-id[@version]> [--registry <url>] [--json]\\n\");\n this.write(\" napp update <app-id> [--version <version>] [--registry <url>] [--json]\\n\");\n this.write(\" napp uninstall <app-id> [--purge-data] [--json]\\n\");\n this.write(\" napp list [--json]\\n\");\n this.write(\" napp info <app-id> [--json]\\n\");\n this.write(\" napp registry [get] [--json]\\n\");\n this.write(\" napp registry set <url> [--json]\\n\");\n this.write(\" napp registry reset [--json]\\n\");\n this.write(\" napp permissions <app-id> [--json]\\n\");\n this.write(\" napp grant <app-id> --document scope=/path [--json]\\n\");\n this.write(\" napp revoke <app-id> --document scope [--json]\\n\");\n this.write(\" napp --help\\n\");\n this.write(\" napp --version\\n\");\n };\n\n private write = (text: string): void => {\n process.stdout.write(text);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,IAAa,uBAAb,MAAkC;CAChC,YACE,iBAA4D,IAAI,0BAA0B,EAC1F;AADiB,OAAA,iBAAA;;CAGnB,MAA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6HAA6H;AACxI,OAAK,MAAM,mFAAmF;AAC9F,OAAK,MAAM,iIAAiI;AAC5I,OAAK,MAAM,qGAAqG;AAChH,OAAK,MAAM,2FAA2F;AACtG,OAAK,MAAM,kFAAkF;AAC7F,OAAK,MAAM,2DAA2D;AACtE,OAAK,MAAM,8BAA8B;AACzC,OAAK,MAAM,uCAAuC;AAClD,OAAK,MAAM,wCAAwC;AACnD,OAAK,MAAM,4CAA4C;AACvD,OAAK,MAAM,wCAAwC;AACnD,OAAK,MAAM,8CAA8C;AACzD,OAAK,MAAM,+DAA+D;AAC1E,OAAK,MAAM,0DAA0D;AACrE,OAAK,MAAM,uBAAuB;AAClC,OAAK,MAAM,0BAA0B;;CAGvC,SAAiB,SAAuB;AACtC,UAAQ,OAAO,MAAM,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-options.service.d.ts","names":[],"sources":["../../src/services/app-runtime-options.service.ts"],"mappings":";;;;;KAIY,iBAAA;EACV,IAAA;EACA,IAAA;EACA,aAAA;EACA,IAAA;EACA,gBAAA,EAAkB,mBAAA;AAAA;AAAA,KAGR,gBAAA;EACV,IAAA;EACA,QAAA,EAAU,mBAAA;AAAA;AAAA,KAGA,cAAA;EACV,IAAA;EACA,UAAA;EACA,IAAA,GAAO,mBAAA;AAAA;AAAA,KAGG,eAAA;EACV,IAAA;EACA,OAAA;AAAA;AAAA,KAGU,kBAAA;EACV,IAAA;AAAA;AAAA,KAGU,iBAAA;EACV,IAAA;EACA,WAAA;AAAA;AAAA,KAGU,gBAAA;EACV,IAAA;EACA,WAAA;EACA,OAAA;AAAA;AAAA,KAGU,mBAAA;EACV,IAAA;EACA,SAAA;AAAA;AAAA,KAGU,eAAA;EACV,IAAA;EACA,gBAAA,EAAkB,mBAAA;AAAA;AAAA,KAGR,gBAAA;EACV,IAAA;EACA,gBAAA;AAAA;AAAA,KAGU,iBAAA;EACV,IAAA;EACA,YAAA;EACA,UAAA;EACA,KAAA;EACA,IAAA,GAAO,mBAAA;AAAA;AAAA,cAGI,wBAAA;EACX,UAAA,GACE,OAAA,UACA,OAAA;IAEA,MAAA;IACA,UAAA;EAAA;EAYF,iBAAA,GAAqB,OAAA,eAAoB,gBAAA;EAAA,QA4BjC,kBAAA;
|
|
1
|
+
{"version":3,"file":"app-runtime-options.service.d.ts","names":[],"sources":["../../src/services/app-runtime-options.service.ts"],"mappings":";;;;;KAIY,iBAAA;EACV,IAAA;EACA,IAAA;EACA,aAAA;EACA,IAAA;EACA,gBAAA,EAAkB,mBAAA;AAAA;AAAA,KAGR,gBAAA;EACV,IAAA;EACA,QAAA,EAAU,mBAAA;AAAA;AAAA,KAGA,cAAA;EACV,IAAA;EACA,UAAA;EACA,IAAA,GAAO,mBAAA;AAAA;AAAA,KAGG,eAAA;EACV,IAAA;EACA,OAAA;AAAA;AAAA,KAGU,kBAAA;EACV,IAAA;AAAA;AAAA,KAGU,iBAAA;EACV,IAAA;EACA,WAAA;AAAA;AAAA,KAGU,gBAAA;EACV,IAAA;EACA,WAAA;EACA,OAAA;AAAA;AAAA,KAGU,mBAAA;EACV,IAAA;EACA,SAAA;AAAA;AAAA,KAGU,eAAA;EACV,IAAA;EACA,gBAAA,EAAkB,mBAAA;AAAA;AAAA,KAGR,gBAAA;EACV,IAAA;EACA,gBAAA;AAAA;AAAA,KAGU,iBAAA;EACV,IAAA;EACA,YAAA;EACA,UAAA;EACA,KAAA;EACA,IAAA,GAAO,mBAAA;AAAA;AAAA,cAGI,wBAAA;EACX,UAAA,GACE,OAAA,UACA,OAAA;IAEA,MAAA;IACA,UAAA;EAAA;EAYF,iBAAA,GAAqB,OAAA,eAAoB,gBAAA;EAAA,QA4BjC,kBAAA;EAUR,eAAA,GAAmB,OAAA,eAAoB,cAAA;EA6BvC,gBAAA,GAAoB,OAAA,eAAoB,eAAA;EAuBxC,mBAAA,GAAuB,OAAA,eAAoB,kBAAA;EAmB3C,kBAAA,GAAsB,OAAA,eAAoB,iBAAA;EAyB1C,iBAAA,GAAqB,OAAA,eAAoB,gBAAA;EA6BzC,oBAAA,GAAwB,OAAA,eAAoB,mBAAA;EAuB5C,kBAAA,GAAsB,OAAA,eAAoB,iBAAA;EAiD1C,gBAAA,GAAoB,OAAA,eAAoB,eAAA;EAgCxC,iBAAA,GAAqB,OAAA,eAAoB,gBAAA;EA+BzC,kBAAA,GAAsB,OAAA,eAAoB,iBAAA;EAAA,QAqClC,oBAAA;EAAA,QAOA,mBAAA;EAAA,QAgBA,mBAAA;EAAA,QAQA,kBAAA;AAAA"}
|
|
@@ -31,8 +31,8 @@ var AppRuntimeOptionsService = class {
|
|
|
31
31
|
return options;
|
|
32
32
|
};
|
|
33
33
|
readCreateTemplate = (rawTemplate) => {
|
|
34
|
-
if (rawTemplate === "starter" || rawTemplate === "ts-http" || rawTemplate === "ts-http-lite") return rawTemplate;
|
|
35
|
-
throw new Error("--template 只支持 starter、ts-http
|
|
34
|
+
if (rawTemplate === "starter" || rawTemplate === "ts-http" || rawTemplate === "ts-http-lite" || rawTemplate === "rust-wasi") return rawTemplate;
|
|
35
|
+
throw new Error("--template 只支持 starter、ts-http、ts-http-lite 或 rust-wasi。");
|
|
36
36
|
};
|
|
37
37
|
readPackOptions = (rawArgs) => {
|
|
38
38
|
const options = { json: false };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-options.service.js","names":[],"sources":["../../src/services/app-runtime-options.service.ts"],"sourcesContent":["import type { AppDocumentGrantMap } from \"#app-runtime/types/app-permissions.types.js\";\nimport type { AppDistributionMode } from \"#app-runtime/types/app-bundle.types.js\";\nimport type { AppScaffoldTemplate } from \"#app-runtime/services/app-scaffold.service.js\";\n\nexport type RuntimeCliOptions = {\n host: string;\n port: number;\n dataDirectory?: string;\n json: boolean;\n documentGrantMap: AppDocumentGrantMap;\n};\n\nexport type CreateCliOptions = {\n json: boolean;\n template: AppScaffoldTemplate;\n};\n\nexport type PackCliOptions = {\n json: boolean;\n outputPath?: string;\n mode?: AppDistributionMode;\n};\n\nexport type BuildCliOptions = {\n json: boolean;\n install: boolean;\n};\n\nexport type JsonOnlyCliOptions = {\n json: boolean;\n};\n\nexport type InstallCliOptions = {\n json: boolean;\n registryUrl?: string;\n};\n\nexport type UpdateCliOptions = {\n json: boolean;\n registryUrl?: string;\n version?: string;\n};\n\nexport type UninstallCliOptions = {\n json: boolean;\n purgeData: boolean;\n};\n\nexport type GrantCliOptions = {\n json: boolean;\n documentGrantMap: AppDocumentGrantMap;\n};\n\nexport type RevokeCliOptions = {\n json: boolean;\n documentScopeIds: string[];\n};\n\nexport type PublishCliOptions = {\n json: boolean;\n metadataPath?: string;\n apiBaseUrl?: string;\n token?: string;\n mode?: AppDistributionMode;\n};\n\nexport class AppRuntimeOptionsService {\n readTarget = (\n command: string,\n rawArgs: string[],\n ): {\n target: string;\n optionArgs: string[];\n } => {\n const [target, ...optionArgs] = rawArgs;\n if (!target || target.startsWith(\"--\")) {\n throw new Error(`${command} 缺少目标参数。`);\n }\n return {\n target,\n optionArgs,\n };\n };\n\n readCreateOptions = (rawArgs: string[]): CreateCliOptions => {\n const options: CreateCliOptions = {\n json: false,\n template: \"starter\",\n };\n\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--template\":\n options.template = this.readCreateTemplate(this.requireOptionValue(current, nextValue));\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n\n return options;\n };\n\n private readCreateTemplate = (rawTemplate: string): AppScaffoldTemplate => {\n if (rawTemplate === \"starter\" || rawTemplate === \"ts-http\" || rawTemplate === \"ts-http-lite\") {\n return rawTemplate;\n }\n throw new Error(\"--template 只支持 starter、ts-http 或 ts-http-lite。\");\n };\n\n readPackOptions = (rawArgs: string[]): PackCliOptions => {\n const options: PackCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--out\":\n options.outputPath = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--mode\":\n options.mode = this.readDistributionMode(this.requireOptionValue(current, nextValue));\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readBuildOptions = (rawArgs: string[]): BuildCliOptions => {\n const options: BuildCliOptions = {\n json: false,\n install: false,\n };\n for (const current of rawArgs) {\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--install\":\n options.install = true;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readJsonOnlyOptions = (rawArgs: string[]): JsonOnlyCliOptions => {\n const options: JsonOnlyCliOptions = {\n json: false,\n };\n for (const current of rawArgs) {\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readInstallOptions = (rawArgs: string[]): InstallCliOptions => {\n const options: InstallCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--registry\":\n options.registryUrl = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readUpdateOptions = (rawArgs: string[]): UpdateCliOptions => {\n const options: UpdateCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--registry\":\n options.registryUrl = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--version\":\n options.version = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readUninstallOptions = (rawArgs: string[]): UninstallCliOptions => {\n const options: UninstallCliOptions = {\n json: false,\n purgeData: false,\n };\n for (const current of rawArgs) {\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--purge-data\":\n options.purgeData = true;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readRuntimeOptions = (rawArgs: string[]): RuntimeCliOptions => {\n const options: RuntimeCliOptions = {\n host: \"127.0.0.1\",\n port: 3100,\n dataDirectory: undefined,\n json: false,\n documentGrantMap: {},\n };\n\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--host\":\n options.host = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--port\":\n options.port = Number.parseInt(this.requireOptionValue(current, nextValue), 10);\n if (Number.isNaN(options.port) || options.port < 0) {\n throw new Error(\"--port 必须是非负整数。\");\n }\n index += 1;\n break;\n case \"--json\":\n options.json = true;\n break;\n case \"--data\":\n options.dataDirectory = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--document\":\n this.assignDocumentGrant(\n options.documentGrantMap,\n this.requireOptionValue(current, nextValue),\n );\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n\n return options;\n };\n\n readGrantOptions = (rawArgs: string[]): GrantCliOptions => {\n const options: GrantCliOptions = {\n json: false,\n documentGrantMap: {},\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--document\":\n this.assignDocumentGrant(\n options.documentGrantMap,\n this.requireOptionValue(current, nextValue),\n );\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n if (Object.keys(options.documentGrantMap).length === 0) {\n throw new Error(\"grant 至少需要一个 --document scope=/path。\");\n }\n return options;\n };\n\n readRevokeOptions = (rawArgs: string[]): RevokeCliOptions => {\n const options: RevokeCliOptions = {\n json: false,\n documentScopeIds: [],\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--document\":\n options.documentScopeIds.push(\n this.readDocumentScopeId(this.requireOptionValue(current, nextValue)),\n );\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n if (options.documentScopeIds.length === 0) {\n throw new Error(\"revoke 至少需要一个 --document scope。\");\n }\n return options;\n };\n\n readPublishOptions = (rawArgs: string[]): PublishCliOptions => {\n const options: PublishCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--meta\":\n options.metadataPath = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--api-base\":\n options.apiBaseUrl = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--token\":\n options.token = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--mode\":\n options.mode = this.readDistributionMode(this.requireOptionValue(current, nextValue));\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n private readDistributionMode = (rawMode: string): AppDistributionMode => {\n if (rawMode === \"source\" || rawMode === \"bundle\") {\n return rawMode;\n }\n throw new Error(\"--mode 只支持 source 或 bundle。\");\n };\n\n private assignDocumentGrant = (\n documentGrantMap: AppDocumentGrantMap,\n rawGrant: string,\n ): void => {\n const delimiterIndex = rawGrant.indexOf(\"=\");\n if (delimiterIndex < 1) {\n throw new Error(\"--document 必须使用 scopeId=/absolute/or/relative/path 格式。\");\n }\n const scopeId = rawGrant.slice(0, delimiterIndex).trim();\n const directoryPath = rawGrant.slice(delimiterIndex + 1).trim();\n if (!scopeId || !directoryPath) {\n throw new Error(\"--document 缺少 scopeId 或 path。\");\n }\n documentGrantMap[scopeId] = directoryPath;\n };\n\n private readDocumentScopeId = (scopeId: string): string => {\n const normalized = scopeId.trim();\n if (!normalized || normalized.includes(\"=\")) {\n throw new Error(\"--document 必须使用 scopeId 格式。\");\n }\n return normalized;\n };\n\n private requireOptionValue = (flag: string, nextValue: string | undefined): string => {\n if (!nextValue || nextValue.startsWith(\"--\")) {\n throw new Error(`${flag} 缺少值。`);\n }\n return nextValue;\n };\n}\n"],"mappings":";AAkEA,IAAa,2BAAb,MAAsC;CACpC,cACE,SACA,YAIG;EACH,MAAM,CAAC,QAAQ,GAAG,cAAc;AAChC,MAAI,CAAC,UAAU,OAAO,WAAW,KAAK,CACpC,OAAM,IAAI,MAAM,GAAG,QAAQ,UAAU;AAEvC,SAAO;GACL;GACA;GACD;;CAGH,qBAAqB,YAAwC;EAC3D,MAAM,UAA4B;GAChC,MAAM;GACN,UAAU;GACX;AAED,OAAK,IAAI,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,SAAS,GAAG;GACtD,MAAM,UAAU,QAAQ;AACxB,OAAI,CAAC,SAAS,WAAW,KAAK,CAC5B,OAAM,IAAI,MAAM,Q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src/services/app-runtime-options.service.ts"],"sourcesContent":["import type { AppDocumentGrantMap } from \"#app-runtime/types/app-permissions.types.js\";\nimport type { AppDistributionMode } from \"#app-runtime/types/app-bundle.types.js\";\nimport type { AppScaffoldTemplate } from \"#app-runtime/services/app-scaffold.service.js\";\n\nexport type RuntimeCliOptions = {\n host: string;\n port: number;\n dataDirectory?: string;\n json: boolean;\n documentGrantMap: AppDocumentGrantMap;\n};\n\nexport type CreateCliOptions = {\n json: boolean;\n template: AppScaffoldTemplate;\n};\n\nexport type PackCliOptions = {\n json: boolean;\n outputPath?: string;\n mode?: AppDistributionMode;\n};\n\nexport type BuildCliOptions = {\n json: boolean;\n install: boolean;\n};\n\nexport type JsonOnlyCliOptions = {\n json: boolean;\n};\n\nexport type InstallCliOptions = {\n json: boolean;\n registryUrl?: string;\n};\n\nexport type UpdateCliOptions = {\n json: boolean;\n registryUrl?: string;\n version?: string;\n};\n\nexport type UninstallCliOptions = {\n json: boolean;\n purgeData: boolean;\n};\n\nexport type GrantCliOptions = {\n json: boolean;\n documentGrantMap: AppDocumentGrantMap;\n};\n\nexport type RevokeCliOptions = {\n json: boolean;\n documentScopeIds: string[];\n};\n\nexport type PublishCliOptions = {\n json: boolean;\n metadataPath?: string;\n apiBaseUrl?: string;\n token?: string;\n mode?: AppDistributionMode;\n};\n\nexport class AppRuntimeOptionsService {\n readTarget = (\n command: string,\n rawArgs: string[],\n ): {\n target: string;\n optionArgs: string[];\n } => {\n const [target, ...optionArgs] = rawArgs;\n if (!target || target.startsWith(\"--\")) {\n throw new Error(`${command} 缺少目标参数。`);\n }\n return {\n target,\n optionArgs,\n };\n };\n\n readCreateOptions = (rawArgs: string[]): CreateCliOptions => {\n const options: CreateCliOptions = {\n json: false,\n template: \"starter\",\n };\n\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--template\":\n options.template = this.readCreateTemplate(this.requireOptionValue(current, nextValue));\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n\n return options;\n };\n\n private readCreateTemplate = (rawTemplate: string): AppScaffoldTemplate => {\n if (\n rawTemplate === \"starter\" || rawTemplate === \"ts-http\" ||\n rawTemplate === \"ts-http-lite\" || rawTemplate === \"rust-wasi\"\n ) {\n return rawTemplate;\n }\n throw new Error(\"--template 只支持 starter、ts-http、ts-http-lite 或 rust-wasi。\");\n };\n\n readPackOptions = (rawArgs: string[]): PackCliOptions => {\n const options: PackCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--out\":\n options.outputPath = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--mode\":\n options.mode = this.readDistributionMode(this.requireOptionValue(current, nextValue));\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readBuildOptions = (rawArgs: string[]): BuildCliOptions => {\n const options: BuildCliOptions = {\n json: false,\n install: false,\n };\n for (const current of rawArgs) {\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--install\":\n options.install = true;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readJsonOnlyOptions = (rawArgs: string[]): JsonOnlyCliOptions => {\n const options: JsonOnlyCliOptions = {\n json: false,\n };\n for (const current of rawArgs) {\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readInstallOptions = (rawArgs: string[]): InstallCliOptions => {\n const options: InstallCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--registry\":\n options.registryUrl = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readUpdateOptions = (rawArgs: string[]): UpdateCliOptions => {\n const options: UpdateCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--registry\":\n options.registryUrl = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--version\":\n options.version = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readUninstallOptions = (rawArgs: string[]): UninstallCliOptions => {\n const options: UninstallCliOptions = {\n json: false,\n purgeData: false,\n };\n for (const current of rawArgs) {\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--purge-data\":\n options.purgeData = true;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n readRuntimeOptions = (rawArgs: string[]): RuntimeCliOptions => {\n const options: RuntimeCliOptions = {\n host: \"127.0.0.1\",\n port: 3100,\n dataDirectory: undefined,\n json: false,\n documentGrantMap: {},\n };\n\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--host\":\n options.host = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--port\":\n options.port = Number.parseInt(this.requireOptionValue(current, nextValue), 10);\n if (Number.isNaN(options.port) || options.port < 0) {\n throw new Error(\"--port 必须是非负整数。\");\n }\n index += 1;\n break;\n case \"--json\":\n options.json = true;\n break;\n case \"--data\":\n options.dataDirectory = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--document\":\n this.assignDocumentGrant(\n options.documentGrantMap,\n this.requireOptionValue(current, nextValue),\n );\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n\n return options;\n };\n\n readGrantOptions = (rawArgs: string[]): GrantCliOptions => {\n const options: GrantCliOptions = {\n json: false,\n documentGrantMap: {},\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--document\":\n this.assignDocumentGrant(\n options.documentGrantMap,\n this.requireOptionValue(current, nextValue),\n );\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n if (Object.keys(options.documentGrantMap).length === 0) {\n throw new Error(\"grant 至少需要一个 --document scope=/path。\");\n }\n return options;\n };\n\n readRevokeOptions = (rawArgs: string[]): RevokeCliOptions => {\n const options: RevokeCliOptions = {\n json: false,\n documentScopeIds: [],\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--document\":\n options.documentScopeIds.push(\n this.readDocumentScopeId(this.requireOptionValue(current, nextValue)),\n );\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n if (options.documentScopeIds.length === 0) {\n throw new Error(\"revoke 至少需要一个 --document scope。\");\n }\n return options;\n };\n\n readPublishOptions = (rawArgs: string[]): PublishCliOptions => {\n const options: PublishCliOptions = {\n json: false,\n };\n for (let index = 0; index < rawArgs.length; index += 1) {\n const current = rawArgs[index];\n if (!current?.startsWith(\"--\")) {\n throw new Error(`未知参数:${current}`);\n }\n const nextValue = rawArgs[index + 1];\n switch (current) {\n case \"--json\":\n options.json = true;\n break;\n case \"--meta\":\n options.metadataPath = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--api-base\":\n options.apiBaseUrl = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--token\":\n options.token = this.requireOptionValue(current, nextValue);\n index += 1;\n break;\n case \"--mode\":\n options.mode = this.readDistributionMode(this.requireOptionValue(current, nextValue));\n index += 1;\n break;\n default:\n throw new Error(`未知参数:${current}`);\n }\n }\n return options;\n };\n\n private readDistributionMode = (rawMode: string): AppDistributionMode => {\n if (rawMode === \"source\" || rawMode === \"bundle\") {\n return rawMode;\n }\n throw new Error(\"--mode 只支持 source 或 bundle。\");\n };\n\n private assignDocumentGrant = (\n documentGrantMap: AppDocumentGrantMap,\n rawGrant: string,\n ): void => {\n const delimiterIndex = rawGrant.indexOf(\"=\");\n if (delimiterIndex < 1) {\n throw new Error(\"--document 必须使用 scopeId=/absolute/or/relative/path 格式。\");\n }\n const scopeId = rawGrant.slice(0, delimiterIndex).trim();\n const directoryPath = rawGrant.slice(delimiterIndex + 1).trim();\n if (!scopeId || !directoryPath) {\n throw new Error(\"--document 缺少 scopeId 或 path。\");\n }\n documentGrantMap[scopeId] = directoryPath;\n };\n\n private readDocumentScopeId = (scopeId: string): string => {\n const normalized = scopeId.trim();\n if (!normalized || normalized.includes(\"=\")) {\n throw new Error(\"--document 必须使用 scopeId 格式。\");\n }\n return normalized;\n };\n\n private requireOptionValue = (flag: string, nextValue: string | undefined): string => {\n if (!nextValue || nextValue.startsWith(\"--\")) {\n throw new Error(`${flag} 缺少值。`);\n }\n return nextValue;\n };\n}\n"],"mappings":";AAkEA,IAAa,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AE,CAAC,MAAM;AAC/D,MAAI,CAAC,WAAW,CAAC,cACf,OAAM,IAAI,MAAM,gCAAgC;AAElD,mBAAiB,WAAW;;CAG9B,uBAA+B,YAA4B;EACzD,MAAM,aAAa,QAAQ,MAAM;AACjC,MAAI,CAAC,cAAc,WAAW,SAAS,IAAI,CACzC,OAAM,IAAI,MAAM,8BAA8B;AAEhD,SAAO;;CAGT,sBAA8B,MAAc,cAA0C;AACpF,MAAI,CAAC,aAAa,UAAU,WAAW,KAAK,CAC1C,OAAM,IAAI,MAAM,GAAG,KAAK,OAAO;AAEjC,SAAO"}
|
|
@@ -9,15 +9,18 @@ type AppRuntimeToolStatus = {
|
|
|
9
9
|
};
|
|
10
10
|
type AppRuntimeDoctorResult = {
|
|
11
11
|
ok: boolean;
|
|
12
|
+
profile: AppRuntimeToolchainProfile;
|
|
12
13
|
tools: AppRuntimeToolStatus[];
|
|
13
14
|
};
|
|
15
|
+
type AppRuntimeToolchainProfile = "all" | "wasi-component" | "wasi-http";
|
|
14
16
|
type AppRuntimeCommandResult = {
|
|
15
17
|
stdout: string;
|
|
16
18
|
stderr: string;
|
|
17
19
|
};
|
|
18
20
|
declare class AppRuntimeToolchainService {
|
|
19
|
-
doctor: () => Promise<AppRuntimeDoctorResult>;
|
|
21
|
+
doctor: (profile?: AppRuntimeToolchainProfile) => Promise<AppRuntimeDoctorResult>;
|
|
20
22
|
assertReadyForWasiHttpBuild: () => Promise<void>;
|
|
23
|
+
assertReadyForWasiComponentBuild: () => Promise<void>;
|
|
21
24
|
runCommand: (params: {
|
|
22
25
|
command: string;
|
|
23
26
|
args: string[];
|
|
@@ -27,5 +30,5 @@ declare class AppRuntimeToolchainService {
|
|
|
27
30
|
private collectProcess;
|
|
28
31
|
}
|
|
29
32
|
//#endregion
|
|
30
|
-
export { AppRuntimeCommandResult, AppRuntimeDoctorResult, AppRuntimeToolStatus, AppRuntimeToolchainService };
|
|
33
|
+
export { AppRuntimeCommandResult, AppRuntimeDoctorResult, AppRuntimeToolStatus, AppRuntimeToolchainProfile, AppRuntimeToolchainService };
|
|
31
34
|
//# sourceMappingURL=app-runtime-toolchain.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-toolchain.service.d.ts","names":[],"sources":["../../src/services/app-runtime-toolchain.service.ts"],"mappings":";KAGY,oBAAA;EACV,IAAA;EACA,OAAA;EACA,EAAA;EACA,OAAA;EACA,WAAA;EACA,KAAA;AAAA;AAAA,KAGU,sBAAA;EACV,EAAA;EACA,KAAA,EAAO,oBAAA;AAAA;AAAA,KAGG,uBAAA;EACV,MAAA;EACA,MAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"app-runtime-toolchain.service.d.ts","names":[],"sources":["../../src/services/app-runtime-toolchain.service.ts"],"mappings":";KAGY,oBAAA;EACV,IAAA;EACA,OAAA;EACA,EAAA;EACA,OAAA;EACA,WAAA;EACA,KAAA;AAAA;AAAA,KAGU,sBAAA;EACV,EAAA;EACA,OAAA,EAAS,0BAAA;EACT,KAAA,EAAO,oBAAA;AAAA;AAAA,KAGG,0BAAA;AAAA,KAEA,uBAAA;EACV,MAAA;EACA,MAAA;AAAA;AAAA,cAoDW,0BAAA;EACX,MAAA,GAAgB,OAAA,GAAS,0BAAA,KAAqC,OAAA,CAAQ,sBAAA;EActE,2BAAA,QAAwC,OAAA;EAcxC,gCAAA,QAA6C,OAAA;EAU7C,UAAA,GAAoB,MAAA;IAClB,OAAA;IACA,IAAA;IACA,GAAA;EAAA,MACE,OAAA,CAAQ,uBAAA;EAAA,QASJ,SAAA;EAAA,QA0BA,cAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
//#region src/services/app-runtime-toolchain.service.ts
|
|
3
|
-
const
|
|
3
|
+
const WASI_HTTP_TOOLS = [
|
|
4
4
|
{
|
|
5
5
|
name: "npm",
|
|
6
6
|
command: "npm",
|
|
@@ -20,19 +20,51 @@ const REQUIRED_TOOLS = [
|
|
|
20
20
|
installHint: "请安装 Bytecode Alliance wkg;有 Rust/Cargo 时可执行:cargo install wkg --locked。"
|
|
21
21
|
}
|
|
22
22
|
];
|
|
23
|
+
const WASI_COMPONENT_TOOLS = [
|
|
24
|
+
{
|
|
25
|
+
name: "cargo",
|
|
26
|
+
command: "cargo",
|
|
27
|
+
args: ["--version"],
|
|
28
|
+
installHint: "Install Rust with rustup: https://rustup.rs/"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "rustc",
|
|
32
|
+
command: "rustc",
|
|
33
|
+
args: ["--version"],
|
|
34
|
+
installHint: "Install Rust with rustup: https://rustup.rs/"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "wasm32-wasip2 target",
|
|
38
|
+
command: "rustc",
|
|
39
|
+
args: [
|
|
40
|
+
"--print",
|
|
41
|
+
"target-libdir",
|
|
42
|
+
"--target",
|
|
43
|
+
"wasm32-wasip2"
|
|
44
|
+
],
|
|
45
|
+
installHint: "Run: rustup target add wasm32-wasip2"
|
|
46
|
+
}
|
|
47
|
+
];
|
|
23
48
|
var AppRuntimeToolchainService = class {
|
|
24
|
-
doctor = async () => {
|
|
25
|
-
const
|
|
49
|
+
doctor = async (profile = "all") => {
|
|
50
|
+
const requiredTools = profile === "wasi-component" ? WASI_COMPONENT_TOOLS : profile === "wasi-http" ? WASI_HTTP_TOOLS : [...WASI_COMPONENT_TOOLS, ...WASI_HTTP_TOOLS];
|
|
51
|
+
const tools = await Promise.all(requiredTools.map((tool) => this.checkTool(tool)));
|
|
26
52
|
return {
|
|
27
53
|
ok: tools.every((tool) => tool.ok),
|
|
54
|
+
profile,
|
|
28
55
|
tools
|
|
29
56
|
};
|
|
30
57
|
};
|
|
31
58
|
assertReadyForWasiHttpBuild = async () => {
|
|
32
|
-
const missing = (await this.doctor()).tools.filter((tool) => !tool.ok);
|
|
59
|
+
const missing = (await this.doctor("wasi-http")).tools.filter((tool) => !tool.ok);
|
|
33
60
|
if (missing.length === 0) return;
|
|
34
61
|
throw new Error(["NApp WASI HTTP 开发环境尚未就绪。", ...missing.map((tool) => `- 缺少 ${tool.name}: ${tool.installHint}`)].join("\n"));
|
|
35
62
|
};
|
|
63
|
+
assertReadyForWasiComponentBuild = async () => {
|
|
64
|
+
const missing = (await this.doctor("wasi-component")).tools.filter((tool) => !tool.ok);
|
|
65
|
+
if (missing.length === 0) return;
|
|
66
|
+
throw new Error(["Rust/WASI Component development environment is not ready.", ...missing.map((tool) => `- Missing ${tool.name}: ${tool.installHint}`)].join("\n"));
|
|
67
|
+
};
|
|
36
68
|
runCommand = async (params) => {
|
|
37
69
|
const { command, args, cwd } = params;
|
|
38
70
|
const child = spawn(command, args, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-toolchain.service.js","names":[],"sources":["../../src/services/app-runtime-toolchain.service.ts"],"sourcesContent":["import { spawn, type ChildProcessByStdio } from \"node:child_process\";\nimport type { Readable } from \"node:stream\";\n\nexport type AppRuntimeToolStatus = {\n name: string;\n command: string;\n ok: boolean;\n version?: string;\n installHint: string;\n error?: string;\n};\n\nexport type AppRuntimeDoctorResult = {\n ok: boolean;\n tools: AppRuntimeToolStatus[];\n};\n\nexport type AppRuntimeCommandResult = {\n stdout: string;\n stderr: string;\n};\n\ntype RequiredTool = {\n name: string;\n command: string;\n args: string[];\n installHint: string;\n};\n\nconst
|
|
1
|
+
{"version":3,"file":"app-runtime-toolchain.service.js","names":[],"sources":["../../src/services/app-runtime-toolchain.service.ts"],"sourcesContent":["import { spawn, type ChildProcessByStdio } from \"node:child_process\";\nimport type { Readable } from \"node:stream\";\n\nexport type AppRuntimeToolStatus = {\n name: string;\n command: string;\n ok: boolean;\n version?: string;\n installHint: string;\n error?: string;\n};\n\nexport type AppRuntimeDoctorResult = {\n ok: boolean;\n profile: AppRuntimeToolchainProfile;\n tools: AppRuntimeToolStatus[];\n};\n\nexport type AppRuntimeToolchainProfile = \"all\" | \"wasi-component\" | \"wasi-http\";\n\nexport type AppRuntimeCommandResult = {\n stdout: string;\n stderr: string;\n};\n\ntype RequiredTool = {\n name: string;\n command: string;\n args: string[];\n installHint: string;\n};\n\nconst WASI_HTTP_TOOLS: RequiredTool[] = [\n {\n name: \"npm\",\n command: \"npm\",\n args: [\"--version\"],\n installHint: \"请安装 Node.js,或使用 NextClaw 桌面版内置运行环境。\",\n },\n {\n name: \"wasmtime\",\n command: \"wasmtime\",\n args: [\"--version\"],\n installHint: \"请安装 Wasmtime,或使用后续内置 Wasmtime 的 NextClaw 发行包。\",\n },\n {\n name: \"wkg\",\n command: \"wkg\",\n args: [\"--version\"],\n installHint: \"请安装 Bytecode Alliance wkg;有 Rust/Cargo 时可执行:cargo install wkg --locked。\",\n },\n];\n\nconst WASI_COMPONENT_TOOLS: RequiredTool[] = [\n {\n name: \"cargo\",\n command: \"cargo\",\n args: [\"--version\"],\n installHint: \"Install Rust with rustup: https://rustup.rs/\",\n },\n {\n name: \"rustc\",\n command: \"rustc\",\n args: [\"--version\"],\n installHint: \"Install Rust with rustup: https://rustup.rs/\",\n },\n {\n name: \"wasm32-wasip2 target\",\n command: \"rustc\",\n args: [\"--print\", \"target-libdir\", \"--target\", \"wasm32-wasip2\"],\n installHint: \"Run: rustup target add wasm32-wasip2\",\n },\n];\n\nexport class AppRuntimeToolchainService {\n doctor = async (profile: AppRuntimeToolchainProfile = \"all\"): Promise<AppRuntimeDoctorResult> => {\n const requiredTools = profile === \"wasi-component\"\n ? WASI_COMPONENT_TOOLS\n : profile === \"wasi-http\"\n ? WASI_HTTP_TOOLS\n : [...WASI_COMPONENT_TOOLS, ...WASI_HTTP_TOOLS];\n const tools = await Promise.all(requiredTools.map((tool) => this.checkTool(tool)));\n return {\n ok: tools.every((tool) => tool.ok),\n profile,\n tools,\n };\n };\n\n assertReadyForWasiHttpBuild = async (): Promise<void> => {\n const result = await this.doctor(\"wasi-http\");\n const missing = result.tools.filter((tool) => !tool.ok);\n if (missing.length === 0) {\n return;\n }\n throw new Error(\n [\n \"NApp WASI HTTP 开发环境尚未就绪。\",\n ...missing.map((tool) => `- 缺少 ${tool.name}: ${tool.installHint}`),\n ].join(\"\\n\"),\n );\n };\n\n assertReadyForWasiComponentBuild = async (): Promise<void> => {\n const result = await this.doctor(\"wasi-component\");\n const missing = result.tools.filter((tool) => !tool.ok);\n if (missing.length === 0) return;\n throw new Error([\n \"Rust/WASI Component development environment is not ready.\",\n ...missing.map((tool) => `- Missing ${tool.name}: ${tool.installHint}`),\n ].join(\"\\n\"));\n };\n\n runCommand = async (params: {\n command: string;\n args: string[];\n cwd: string;\n }): Promise<AppRuntimeCommandResult> => {\n const { command, args, cwd } = params;\n const child = spawn(command, args, {\n cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return await this.collectProcess(child, command);\n };\n\n private checkTool = async (tool: RequiredTool): Promise<AppRuntimeToolStatus> => {\n try {\n const result = await this.runCommand({\n command: tool.command,\n args: tool.args,\n cwd: process.cwd(),\n });\n const version = (result.stdout || result.stderr).trim().split(/\\r?\\n/)[0]?.trim();\n return {\n name: tool.name,\n command: tool.command,\n ok: true,\n version,\n installHint: tool.installHint,\n };\n } catch (error) {\n return {\n name: tool.name,\n command: tool.command,\n ok: false,\n installHint: tool.installHint,\n error: error instanceof Error ? error.message : String(error),\n };\n }\n };\n\n private collectProcess = async (\n child: ChildProcessByStdio<null, Readable, Readable>,\n command: string,\n ): Promise<AppRuntimeCommandResult> => {\n const stdoutChunks: Buffer[] = [];\n const stderrChunks: Buffer[] = [];\n child.stdout.on(\"data\", (chunk: Buffer) => {\n stdoutChunks.push(chunk);\n });\n child.stderr.on(\"data\", (chunk: Buffer) => {\n stderrChunks.push(chunk);\n });\n const exitCode = await new Promise<number | null>((resolve, reject) => {\n child.once(\"error\", reject);\n child.once(\"exit\", resolve);\n });\n const stdout = Buffer.concat(stdoutChunks).toString(\"utf-8\");\n const stderr = Buffer.concat(stderrChunks).toString(\"utf-8\");\n if (exitCode !== 0) {\n throw new Error(`${command} exited with ${exitCode ?? \"unknown\"}\\n${stderr || stdout}`);\n }\n return {\n stdout,\n stderr,\n };\n };\n}\n"],"mappings":";;AAgCA,MAAM,kBAAkC;CACtC;EACE,MAAM;EACN,SAAS;EACT,MAAM,CAAC,YAAY;EACnB,aAAa;EACd;CACD;EACE,MAAM;EACN,SAAS;EACT,MAAM,CAAC,YAAY;EACnB,aAAa;EACd;CACD;EACE,MAAM;EACN,SAAS;EACT,MAAM,CAAC,YAAY;EACnB,aAAa;EACd;CACF;AAED,MAAM,uBAAuC;CAC3C;EACE,MAAM;EACN,SAAS;EACT,MAAM,CAAC,YAAY;EACnB,aAAa;EACd;CACD;EACE,MAAM;EACN,SAAS;EACT,MAAM,CAAC,YAAY;EACnB,aAAa;EACd;CACD;EACE,MAAM;EACN,SAAS;EACT,MAAM;GAAC;GAAW;GAAiB;GAAY;GAAgB;EAC/D,aAAa;EACd;CACF;AAED,IAAa,6BAAb,MAAwC;CACtC,SAAS,OAAO,UAAsC,UAA2C;EAC/F,MAAM,gBAAgB,YAAY,mBAC9B,uBACA,YAAY,cACV,kBACA,CAAC,GAAG,sBAAsB,GAAG,gBAAgB;EACnD,MAAM,QAAQ,MAAM,QAAQ,IAAI,cAAc,KAAK,SAAS,KAAK,UAAU,KAAK,CAAC,CAAC;AAClF,SAAO;GACL,IAAI,MAAM,OAAO,SAAS,KAAK,GAAG;GAClC;GACA;GACD;;CAGH,8BAA8B,YAA2B;EAEvD,MAAM,WADS,MAAM,KAAK,OAAO,YAAY,EACtB,MAAM,QAAQ,SAAS,CAAC,KAAK,GAAG;AACvD,MAAI,QAAQ,WAAW,EACrB;AAEF,QAAM,IAAI,MACR,CACE,4BACA,GAAG,QAAQ,KAAK,SAAS,QAAQ,KAAK,KAAK,IAAI,KAAK,cAAc,CACnE,CAAC,KAAK,KAAK,CACb;;CAGH,mCAAmC,YAA2B;EAE5D,MAAM,WADS,MAAM,KAAK,OAAO,iBAAiB,EAC3B,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AAC,SAAS,QAAQ;EAC5D,MAAM,SAAS,OAAO,OAAO,aAAa,CAAC,SAAS,QAAQ;AAC5D,MAAI,aAAa,EACf,OAAM,IAAI,MAAM,GAAG,QAAQ,eAAe,YAAY,UAAU,IAAI,UAAU,SAAS;AAEzF,SAAO;GACL;GACA;GACD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AppScaffoldFile } from "./app-ts-http-scaffold-template.service.js";
|
|
2
|
+
|
|
3
|
+
//#region src/services/app-rust-wasi-scaffold-template.service.d.ts
|
|
4
|
+
declare class AppRustWasiScaffoldTemplateService {
|
|
5
|
+
buildFiles: (params: {
|
|
6
|
+
appId: string;
|
|
7
|
+
appName: string;
|
|
8
|
+
}) => AppScaffoldFile[];
|
|
9
|
+
private buildManifest;
|
|
10
|
+
private buildPanelManifest;
|
|
11
|
+
private buildServiceManifest;
|
|
12
|
+
private buildServiceSmokeFixture;
|
|
13
|
+
private buildCargoToml;
|
|
14
|
+
private buildRustSource;
|
|
15
|
+
private buildReadme;
|
|
16
|
+
private buildPanelHtml;
|
|
17
|
+
private buildPanelScript;
|
|
18
|
+
private buildMarketplaceMetadata;
|
|
19
|
+
private normalizeSlug;
|
|
20
|
+
private buildIconSvg;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { AppRustWasiScaffoldTemplateService };
|
|
24
|
+
//# sourceMappingURL=app-rust-wasi-scaffold-template.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-rust-wasi-scaffold-template.service.d.ts","names":[],"sources":["../../src/services/app-rust-wasi-scaffold-template.service.ts"],"mappings":";;;cAaa,kCAAA;EACX,UAAA,GAAc,MAAA;IAAU,KAAA;IAAe,OAAA;EAAA,MAAoB,eAAA;EAAA,QAqCnD,aAAA;EAAA,QAwBA,kBAAA;EAAA,QASA,oBAAA;EAAA,QAoBA,wBAAA;EAAA,QAkBA,cAAA;EAAA,QAcA,eAAA;EAAA,QAuEA,WAAA;EAAA,QAwCA,cAAA;EAAA,QA6BA,gBAAA;EAAA,QA4BA,wBAAA;EAAA,QAmBA,aAAA;EAAA,QAMA,YAAA;AAAA"}
|