@pmate/cli 0.24.41 → 0.24.42
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.js +20 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18931,7 +18931,7 @@ var ServiceRuntimeRunner = class {
|
|
|
18931
18931
|
if (cwd) {
|
|
18932
18932
|
return import_node_path24.default.resolve(process.cwd(), cwd);
|
|
18933
18933
|
}
|
|
18934
|
-
const repository = this.getType(service) === "vite" || this.getType(service) === "static" ? this.
|
|
18934
|
+
const repository = this.getType(service) === "vite" || this.getType(service) === "static" ? this.getRepoStaticSite(service).repository.trim() : this.getType(service) === "fc" ? this.getFc(service).repository?.trim() : this.getType(service) === "ios" || this.getType(service) === "android" ? void 0 : this.getNetwork(service).repository?.trim();
|
|
18935
18935
|
if (repository) {
|
|
18936
18936
|
const repoName = repository.replace(/\/+$/, "").split("/").pop()?.replace(/\.git$/i, "");
|
|
18937
18937
|
if (repoName) {
|
|
@@ -18950,13 +18950,14 @@ var ServiceRuntimeRunner = class {
|
|
|
18950
18950
|
}
|
|
18951
18951
|
resolveLocalDir(service, cwd) {
|
|
18952
18952
|
const repoRoot = this.resolveRepoRoot(service, cwd);
|
|
18953
|
-
const dir = this.getType(service) === "vite" || this.getType(service) === "static" ? this.
|
|
18953
|
+
const dir = this.getType(service) === "vite" || this.getType(service) === "static" ? this.getRepoStaticSite(service).dir.trim() : this.getType(service) === "fc" ? this.getFc(service).dir?.trim() : this.getType(service) === "ios" || this.getType(service) === "android" ? void 0 : this.getNetwork(service).dir?.trim();
|
|
18954
18954
|
if (!dir) {
|
|
18955
18955
|
throw new Error(`Missing service dir for ${service.id}`);
|
|
18956
18956
|
}
|
|
18957
18957
|
return import_node_path24.default.resolve(repoRoot, dir);
|
|
18958
18958
|
}
|
|
18959
18959
|
async deployVite(service, options) {
|
|
18960
|
+
this.assertDeployableStaticSite(service);
|
|
18960
18961
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
18961
18962
|
const packageJsonPath = import_node_path24.default.join(appDir, "package.json");
|
|
18962
18963
|
if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
|
|
@@ -18986,6 +18987,7 @@ var ServiceRuntimeRunner = class {
|
|
|
18986
18987
|
await AliyunService.uploadDirectory(distDir, bucketName);
|
|
18987
18988
|
}
|
|
18988
18989
|
async deployStatic(service, options) {
|
|
18990
|
+
this.assertDeployableStaticSite(service);
|
|
18989
18991
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
18990
18992
|
const srcDir = import_node_path24.default.join(appDir, "src");
|
|
18991
18993
|
if (!(0, import_node_fs20.existsSync)(srcDir)) {
|
|
@@ -19311,6 +19313,9 @@ var ServiceRuntimeRunner = class {
|
|
|
19311
19313
|
}
|
|
19312
19314
|
async initStaticLike(service) {
|
|
19313
19315
|
const site = this.getSite(service);
|
|
19316
|
+
if (site.exposeType === "managed-oss-cdn") {
|
|
19317
|
+
throw new Error(`Service ${service.id} is managed-oss-cdn and cannot be initialized`);
|
|
19318
|
+
}
|
|
19314
19319
|
const bucketName = site.bucket?.trim();
|
|
19315
19320
|
const baseDomain = site.domain?.trim();
|
|
19316
19321
|
if (!bucketName) {
|
|
@@ -19327,6 +19332,19 @@ var ServiceRuntimeRunner = class {
|
|
|
19327
19332
|
routeType: this.getType(service) === "vite" ? "spa" : "spa"
|
|
19328
19333
|
});
|
|
19329
19334
|
}
|
|
19335
|
+
assertDeployableStaticSite(service) {
|
|
19336
|
+
const site = this.getSite(service);
|
|
19337
|
+
if (site.exposeType === "managed-oss-cdn") {
|
|
19338
|
+
throw new Error(`Service ${service.id} is managed-oss-cdn and cannot be deployed`);
|
|
19339
|
+
}
|
|
19340
|
+
}
|
|
19341
|
+
getRepoStaticSite(service) {
|
|
19342
|
+
const site = this.getSite(service);
|
|
19343
|
+
if (site.exposeType === "managed-oss-cdn") {
|
|
19344
|
+
throw new Error(`Service ${service.id} is managed-oss-cdn and has no repository or dir`);
|
|
19345
|
+
}
|
|
19346
|
+
return site;
|
|
19347
|
+
}
|
|
19330
19348
|
async initServerApp(service, options, config) {
|
|
19331
19349
|
const network = this.getNetwork(service);
|
|
19332
19350
|
const subdomain = "subdomain" in network ? network.subdomain?.trim() : void 0;
|