@stacksolo/cli 0.1.1 → 0.1.3
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 +27 -24
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -275,6 +275,7 @@ var init_plugin_loader_service = __esm({
|
|
|
275
275
|
|
|
276
276
|
// src/index.ts
|
|
277
277
|
import { Command as Command24 } from "commander";
|
|
278
|
+
import { createRequire } from "module";
|
|
278
279
|
|
|
279
280
|
// src/commands/project/init.ts
|
|
280
281
|
import { Command } from "commander";
|
|
@@ -6599,7 +6600,7 @@ CMD ["node", "dist/index.js"]
|
|
|
6599
6600
|
`;
|
|
6600
6601
|
}
|
|
6601
6602
|
function generateContainerPackageJson(container, config) {
|
|
6602
|
-
const
|
|
6603
|
+
const pkg2 = {
|
|
6603
6604
|
name: `@${config.project.name}/${container.name}`,
|
|
6604
6605
|
version: "0.1.0",
|
|
6605
6606
|
private: true,
|
|
@@ -6622,7 +6623,7 @@ function generateContainerPackageJson(container, config) {
|
|
|
6622
6623
|
typescript: "^5.3.0"
|
|
6623
6624
|
}
|
|
6624
6625
|
};
|
|
6625
|
-
return JSON.stringify(
|
|
6626
|
+
return JSON.stringify(pkg2, null, 2) + "\n";
|
|
6626
6627
|
}
|
|
6627
6628
|
function generateTsConfig() {
|
|
6628
6629
|
const config = {
|
|
@@ -6732,7 +6733,7 @@ function generateFunctionScaffold(func, config) {
|
|
|
6732
6733
|
};
|
|
6733
6734
|
}
|
|
6734
6735
|
function generateFunctionPackageJson(func, config) {
|
|
6735
|
-
const
|
|
6736
|
+
const pkg2 = {
|
|
6736
6737
|
name: `@${config.project.name}/${func.name}`,
|
|
6737
6738
|
version: "0.1.0",
|
|
6738
6739
|
private: true,
|
|
@@ -6756,7 +6757,7 @@ function generateFunctionPackageJson(func, config) {
|
|
|
6756
6757
|
typescript: "^5.3.0"
|
|
6757
6758
|
}
|
|
6758
6759
|
};
|
|
6759
|
-
return JSON.stringify(
|
|
6760
|
+
return JSON.stringify(pkg2, null, 2) + "\n";
|
|
6760
6761
|
}
|
|
6761
6762
|
function generateTsConfig2() {
|
|
6762
6763
|
const config = {
|
|
@@ -7728,7 +7729,7 @@ CMD ["./start.sh"]
|
|
|
7728
7729
|
`;
|
|
7729
7730
|
}
|
|
7730
7731
|
function generatePackageJson(kernel, config) {
|
|
7731
|
-
const
|
|
7732
|
+
const pkg2 = {
|
|
7732
7733
|
name: `@${config.project.name}/${kernel.name}`,
|
|
7733
7734
|
version: "0.1.0",
|
|
7734
7735
|
description: "Kernel service - HTTP + NATS hybrid",
|
|
@@ -7755,7 +7756,7 @@ function generatePackageJson(kernel, config) {
|
|
|
7755
7756
|
typescript: "^5.0.0"
|
|
7756
7757
|
}
|
|
7757
7758
|
};
|
|
7758
|
-
return JSON.stringify(
|
|
7759
|
+
return JSON.stringify(pkg2, null, 2) + "\n";
|
|
7759
7760
|
}
|
|
7760
7761
|
function generateTsConfig3() {
|
|
7761
7762
|
const config = {
|
|
@@ -9302,17 +9303,17 @@ async function deployConfig(config, _stateDir, options = {}) {
|
|
|
9302
9303
|
await fs7.mkdir(stagingDir, { recursive: true });
|
|
9303
9304
|
await execAsync5(`cp -r "${distDir}"/* "${stagingDir}"/`, { timeout: 3e4 });
|
|
9304
9305
|
const pkgContent = await fs7.readFile(packageJsonPath, "utf-8");
|
|
9305
|
-
const
|
|
9306
|
-
if (
|
|
9307
|
-
|
|
9306
|
+
const pkg2 = JSON.parse(pkgContent);
|
|
9307
|
+
if (pkg2.main && pkg2.main.startsWith("dist/")) {
|
|
9308
|
+
pkg2.main = pkg2.main.replace("dist/", "");
|
|
9308
9309
|
}
|
|
9309
|
-
if (
|
|
9310
|
-
delete
|
|
9311
|
-
delete
|
|
9312
|
-
delete
|
|
9310
|
+
if (pkg2.scripts) {
|
|
9311
|
+
delete pkg2.scripts.build;
|
|
9312
|
+
delete pkg2.scripts.typecheck;
|
|
9313
|
+
delete pkg2.scripts.dev;
|
|
9313
9314
|
}
|
|
9314
|
-
delete
|
|
9315
|
-
await fs7.writeFile(path9.join(stagingDir, "package.json"), JSON.stringify(
|
|
9315
|
+
delete pkg2.devDependencies;
|
|
9316
|
+
await fs7.writeFile(path9.join(stagingDir, "package.json"), JSON.stringify(pkg2, null, 2));
|
|
9316
9317
|
await execAsync5(`cd "${stagingDir}" && zip -r "${sourceZipPath}" .`, { timeout: 6e4 });
|
|
9317
9318
|
await fs7.rm(stagingDir, { recursive: true, force: true });
|
|
9318
9319
|
} else {
|
|
@@ -9359,7 +9360,7 @@ async function deployConfig(config, _stateDir, options = {}) {
|
|
|
9359
9360
|
const packageJsonPath = path9.join(kernelSourceDir, "package.json");
|
|
9360
9361
|
try {
|
|
9361
9362
|
const packageJsonContent = await fs7.readFile(packageJsonPath, "utf-8");
|
|
9362
|
-
const
|
|
9363
|
+
const pkg2 = JSON.parse(packageJsonContent);
|
|
9363
9364
|
const nodeModulesPath = path9.join(kernelSourceDir, "node_modules");
|
|
9364
9365
|
try {
|
|
9365
9366
|
await fs7.access(nodeModulesPath);
|
|
@@ -9367,7 +9368,7 @@ async function deployConfig(config, _stateDir, options = {}) {
|
|
|
9367
9368
|
log(`Installing dependencies for GCP Kernel...`);
|
|
9368
9369
|
await execAsync5("npm install", { cwd: kernelSourceDir, timeout: 12e4 });
|
|
9369
9370
|
}
|
|
9370
|
-
if (
|
|
9371
|
+
if (pkg2.scripts?.build) {
|
|
9371
9372
|
log(`Building GCP Kernel TypeScript...`);
|
|
9372
9373
|
await execAsync5("npm run build", { cwd: kernelSourceDir, timeout: 6e4 });
|
|
9373
9374
|
}
|
|
@@ -9553,7 +9554,7 @@ terraform {
|
|
|
9553
9554
|
const packageJsonPath = path9.join(sourceDir, "package.json");
|
|
9554
9555
|
try {
|
|
9555
9556
|
const packageJsonContent = await fs7.readFile(packageJsonPath, "utf-8");
|
|
9556
|
-
const
|
|
9557
|
+
const pkg2 = JSON.parse(packageJsonContent);
|
|
9557
9558
|
const nodeModulesPath = path9.join(sourceDir, "node_modules");
|
|
9558
9559
|
try {
|
|
9559
9560
|
await fs7.access(nodeModulesPath);
|
|
@@ -9561,7 +9562,7 @@ terraform {
|
|
|
9561
9562
|
log(`Installing dependencies for ${containerName}...`);
|
|
9562
9563
|
await execAsync5("npm install", { cwd: sourceDir, timeout: 12e4 });
|
|
9563
9564
|
}
|
|
9564
|
-
if (
|
|
9565
|
+
if (pkg2.scripts?.build) {
|
|
9565
9566
|
log(`Building ${containerName}...`);
|
|
9566
9567
|
await execAsync5("npm run build", { cwd: sourceDir, timeout: 6e4 });
|
|
9567
9568
|
}
|
|
@@ -9635,12 +9636,12 @@ terraform {
|
|
|
9635
9636
|
const packageJsonPath = path9.join(sourceDir, "package.json");
|
|
9636
9637
|
try {
|
|
9637
9638
|
const pkgContent = await fs7.readFile(packageJsonPath, "utf-8");
|
|
9638
|
-
const
|
|
9639
|
-
if (
|
|
9639
|
+
const pkg2 = JSON.parse(pkgContent);
|
|
9640
|
+
if (pkg2.dependencies?.["@sveltejs/kit"] || pkg2.devDependencies?.["@sveltejs/kit"]) {
|
|
9640
9641
|
detectedFramework = "sveltekit";
|
|
9641
|
-
} else if (
|
|
9642
|
+
} else if (pkg2.dependencies?.vue || pkg2.devDependencies?.vue) {
|
|
9642
9643
|
detectedFramework = "vue";
|
|
9643
|
-
} else if (
|
|
9644
|
+
} else if (pkg2.dependencies?.react || pkg2.devDependencies?.react) {
|
|
9644
9645
|
detectedFramework = "react";
|
|
9645
9646
|
}
|
|
9646
9647
|
} catch {
|
|
@@ -18368,8 +18369,10 @@ var unregisterCommand = new Command23("unregister").description("Remove a projec
|
|
|
18368
18369
|
});
|
|
18369
18370
|
|
|
18370
18371
|
// src/index.ts
|
|
18372
|
+
var require2 = createRequire(import.meta.url);
|
|
18373
|
+
var pkg = require2("../package.json");
|
|
18371
18374
|
var program = new Command24();
|
|
18372
|
-
program.name("stacksolo").description("Deploy cloud infrastructure for your applications").version(
|
|
18375
|
+
program.name("stacksolo").description("Deploy cloud infrastructure for your applications").version(pkg.version);
|
|
18373
18376
|
program.addCommand(initCommand);
|
|
18374
18377
|
program.addCommand(scaffoldCommand);
|
|
18375
18378
|
program.addCommand(cloneCommand);
|