starpak 0.1.3 → 0.1.4
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/cli/dist/index.cjs +41 -7
- package/package.json +2 -3
package/cli/dist/index.cjs
CHANGED
|
@@ -5495,7 +5495,7 @@ var zh = {
|
|
|
5495
5495
|
"cmd.help.desc": "\u7785\u7785\u548B\u7528",
|
|
5496
5496
|
"app.name": "starpak \u2728",
|
|
5497
5497
|
"app.desc": "\u8BF6\u563F\uFF0C\u628A\u4F60\u4EE3\u7801\u53D8\u6210\u670D\u52A1\u7684\u9B54\u6CD5\u68D2\uFF5E cd \u8FDB\u53BB\uFF0C\u5269\u4E0B\u7684\u4EA4\u7ED9\u6211",
|
|
5498
|
-
"app.version": "0.1.
|
|
5498
|
+
"app.version": "0.1.4",
|
|
5499
5499
|
"help.usage.hint": "\u5514\u2026 \u7528 starpak --help \u770B\u770B\u6211\u80FD\u5E72\u5565\u5427",
|
|
5500
5500
|
"cmd.install.desc": "\u5440\uFF0C\u88C5\u70B9\u5565\u597D\u4E1C\u897F\uFF1F",
|
|
5501
5501
|
"cmd.install.arg.target": "\u9879\u76EE\u76EE\u5F55\u3001GitHub \u4ED3\u5E93\u6216\u5305\u540D\u5566",
|
|
@@ -5562,7 +5562,7 @@ var en = {
|
|
|
5562
5562
|
"cmd.help.desc": "Show help",
|
|
5563
5563
|
"app.name": "starpak \u2728",
|
|
5564
5564
|
"app.desc": "A lil magic wand that turns your code into services~ cd in, leave the rest to me",
|
|
5565
|
-
"app.version": "0.1.
|
|
5565
|
+
"app.version": "0.1.4",
|
|
5566
5566
|
"help.usage.hint": "Hmm... try starpak --help to see what I can do~",
|
|
5567
5567
|
"cmd.install.desc": "Install something nice",
|
|
5568
5568
|
"cmd.install.arg.target": "Project dir, GitHub repo, or package name",
|
|
@@ -12443,8 +12443,12 @@ async function findSuspiciousFiles(dir, maxDepth = 4) {
|
|
|
12443
12443
|
"start.sh",
|
|
12444
12444
|
"run.sh",
|
|
12445
12445
|
"start.bat",
|
|
12446
|
-
"run.bat"
|
|
12446
|
+
"run.bat",
|
|
12447
|
+
"Package.swift",
|
|
12448
|
+
"build.gradle",
|
|
12449
|
+
"pom.xml"
|
|
12447
12450
|
]);
|
|
12451
|
+
const scriptTargets = /* @__PURE__ */ new Set([".sh", ".bat", ".py", ".rb", ".php", ".pl", ".lua"]);
|
|
12448
12452
|
function scan(d, depth) {
|
|
12449
12453
|
if (depth > maxDepth) return;
|
|
12450
12454
|
try {
|
|
@@ -12491,7 +12495,6 @@ async function analyzeTechStack(files) {
|
|
|
12491
12495
|
if (deps.includes("express")) frameworks.push("express");
|
|
12492
12496
|
if (deps.includes("react")) frameworks.push("react");
|
|
12493
12497
|
if (deps.includes("vue")) frameworks.push("vue");
|
|
12494
|
-
if (deps.includes("svelte")) frameworks.push("svelte");
|
|
12495
12498
|
entryPoint = json.main || json.bin || null;
|
|
12496
12499
|
buildCommand = json.scripts?.build || null;
|
|
12497
12500
|
startCommand = json.scripts?.start || null;
|
|
@@ -12502,9 +12505,7 @@ async function analyzeTechStack(files) {
|
|
|
12502
12505
|
else if ((0, import_fs.existsSync)((0, import_path.join)(dir, "server.js"))) entryPoint = "server.js";
|
|
12503
12506
|
else if ((0, import_fs.existsSync)((0, import_path.join)(dir, "main.js"))) entryPoint = "main.js";
|
|
12504
12507
|
}
|
|
12505
|
-
if (!startCommand) {
|
|
12506
|
-
startCommand = entryPoint ? `node ${entryPoint}` : "node .";
|
|
12507
|
-
}
|
|
12508
|
+
if (!startCommand) startCommand = entryPoint ? `node ${entryPoint}` : "node .";
|
|
12508
12509
|
} catch {
|
|
12509
12510
|
}
|
|
12510
12511
|
}
|
|
@@ -12518,11 +12519,13 @@ async function analyzeTechStack(files) {
|
|
|
12518
12519
|
if (types.includes("requirements.txt") || types.includes("setup.py") || types.includes("pyproject.toml")) {
|
|
12519
12520
|
runtimes.push("python");
|
|
12520
12521
|
systemDeps.push("python3", "python3-pip", "python3-venv");
|
|
12522
|
+
if (!startCommand) startCommand = "python3 main.py";
|
|
12521
12523
|
}
|
|
12522
12524
|
if (types.includes("Cargo.toml")) {
|
|
12523
12525
|
runtimes.push("rust");
|
|
12524
12526
|
systemDeps.push("rustc", "cargo");
|
|
12525
12527
|
buildCommand = buildCommand || "cargo build --release";
|
|
12528
|
+
startCommand = startCommand || "./target/release/app";
|
|
12526
12529
|
}
|
|
12527
12530
|
if (types.includes("go.mod")) {
|
|
12528
12531
|
runtimes.push("go");
|
|
@@ -12530,9 +12533,40 @@ async function analyzeTechStack(files) {
|
|
|
12530
12533
|
buildCommand = buildCommand || "go build -o ./bin/app .";
|
|
12531
12534
|
startCommand = startCommand || "./bin/app";
|
|
12532
12535
|
}
|
|
12536
|
+
if (types.includes("Gemfile")) {
|
|
12537
|
+
runtimes.push("ruby");
|
|
12538
|
+
systemDeps.push("ruby", "bundler");
|
|
12539
|
+
buildCommand = buildCommand || "bundle install";
|
|
12540
|
+
startCommand = startCommand || "bundle exec ruby main.rb";
|
|
12541
|
+
}
|
|
12542
|
+
if (types.includes("composer.json")) {
|
|
12543
|
+
runtimes.push("php");
|
|
12544
|
+
systemDeps.push("php", "composer");
|
|
12545
|
+
buildCommand = buildCommand || "composer install";
|
|
12546
|
+
startCommand = startCommand || "php artisan serve";
|
|
12547
|
+
}
|
|
12548
|
+
if (types.includes("Package.swift")) {
|
|
12549
|
+
runtimes.push("swift");
|
|
12550
|
+
systemDeps.push("swift");
|
|
12551
|
+
buildCommand = buildCommand || "swift build";
|
|
12552
|
+
startCommand = startCommand || "swift run";
|
|
12553
|
+
}
|
|
12554
|
+
if (types.includes("pom.xml")) {
|
|
12555
|
+
runtimes.push("java");
|
|
12556
|
+
systemDeps.push("java", "maven");
|
|
12557
|
+
buildCommand = buildCommand || "mvn package";
|
|
12558
|
+
startCommand = startCommand || "mvn exec:java";
|
|
12559
|
+
}
|
|
12560
|
+
if (types.includes("build.gradle")) {
|
|
12561
|
+
runtimes.push("java");
|
|
12562
|
+
systemDeps.push("java", "gradle");
|
|
12563
|
+
buildCommand = buildCommand || "gradle build";
|
|
12564
|
+
startCommand = startCommand || "gradle run";
|
|
12565
|
+
}
|
|
12533
12566
|
if (types.includes("Dockerfile")) {
|
|
12534
12567
|
runtimes.push("docker");
|
|
12535
12568
|
buildCommand = buildCommand || "docker build -t starpak-app .";
|
|
12569
|
+
startCommand = startCommand || "docker run starpak-app";
|
|
12536
12570
|
}
|
|
12537
12571
|
if (types.includes("Makefile") && !buildCommand) {
|
|
12538
12572
|
if (!runtimes.length) runtimes.push("system");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpak",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Universal package manager, but not just packages! — cd in, the rest is automatic",
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"prepublish": "npm run build",
|
|
31
31
|
"build": "tsup --config cli/tsup.config.ts",
|
|
32
|
-
"dev": "tsx cli/index.ts"
|
|
33
|
-
"postinstall": "node -e ''"
|
|
32
|
+
"dev": "tsx cli/index.ts"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"cli-progress": "^3.12.0",
|