@topolo/cli 0.1.18 → 0.1.19
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 +32 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2699,7 +2699,28 @@ function sleep(ms) {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
|
|
2701
2701
|
// src/version.ts
|
|
2702
|
-
|
|
2702
|
+
import { readFileSync } from "fs";
|
|
2703
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
2704
|
+
import { fileURLToPath } from "url";
|
|
2705
|
+
function readCliVersion() {
|
|
2706
|
+
try {
|
|
2707
|
+
const here = dirname2(fileURLToPath(import.meta.url));
|
|
2708
|
+
const candidates = [
|
|
2709
|
+
join2(here, "package.json"),
|
|
2710
|
+
join2(here, "..", "package.json")
|
|
2711
|
+
];
|
|
2712
|
+
for (const path4 of candidates) {
|
|
2713
|
+
try {
|
|
2714
|
+
const pkg = JSON.parse(readFileSync(path4, "utf8"));
|
|
2715
|
+
if (typeof pkg.version === "string" && pkg.version) return pkg.version;
|
|
2716
|
+
} catch {
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
} catch {
|
|
2720
|
+
}
|
|
2721
|
+
return "0.0.0";
|
|
2722
|
+
}
|
|
2723
|
+
var CLI_VERSION = readCliVersion();
|
|
2703
2724
|
|
|
2704
2725
|
// src/client.ts
|
|
2705
2726
|
async function buildClient(options) {
|
|
@@ -2938,14 +2959,14 @@ function parseQueryPairs(pairs) {
|
|
|
2938
2959
|
|
|
2939
2960
|
// src/commands/apps.ts
|
|
2940
2961
|
import { execSync } from "child_process";
|
|
2941
|
-
import { existsSync as existsSync3, mkdirSync, readFileSync as
|
|
2962
|
+
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
2942
2963
|
import path2 from "path";
|
|
2943
2964
|
|
|
2944
2965
|
// src/commands/app-audit-local.ts
|
|
2945
2966
|
import {
|
|
2946
2967
|
existsSync as existsSync2,
|
|
2947
2968
|
readdirSync,
|
|
2948
|
-
readFileSync,
|
|
2969
|
+
readFileSync as readFileSync2,
|
|
2949
2970
|
statSync
|
|
2950
2971
|
} from "fs";
|
|
2951
2972
|
import path from "path";
|
|
@@ -2954,7 +2975,7 @@ function readEvidenceFile(appRoot) {
|
|
|
2954
2975
|
const candidate = path.join(appRoot, ".topolo", "evidence.json");
|
|
2955
2976
|
if (!isFile(candidate)) return null;
|
|
2956
2977
|
try {
|
|
2957
|
-
const raw = JSON.parse(
|
|
2978
|
+
const raw = JSON.parse(readFileSync2(candidate, "utf8"));
|
|
2958
2979
|
if (raw && typeof raw === "object" && raw.version === 1) {
|
|
2959
2980
|
return raw;
|
|
2960
2981
|
}
|
|
@@ -3737,7 +3758,7 @@ function readSourceIndex(root) {
|
|
|
3737
3758
|
const files = collectSourceFiles(root, 4e3);
|
|
3738
3759
|
const chunks = files.map((file) => {
|
|
3739
3760
|
try {
|
|
3740
|
-
return
|
|
3761
|
+
return readFileSync2(file, "utf8");
|
|
3741
3762
|
} catch {
|
|
3742
3763
|
return "";
|
|
3743
3764
|
}
|
|
@@ -3797,7 +3818,7 @@ function sortedDirEntries(dir) {
|
|
|
3797
3818
|
function readJson(filePath) {
|
|
3798
3819
|
if (!isFile(filePath)) return null;
|
|
3799
3820
|
try {
|
|
3800
|
-
return JSON.parse(
|
|
3821
|
+
return JSON.parse(readFileSync2(filePath, "utf8"));
|
|
3801
3822
|
} catch {
|
|
3802
3823
|
return null;
|
|
3803
3824
|
}
|
|
@@ -3870,7 +3891,7 @@ function isFile(filePath) {
|
|
|
3870
3891
|
// src/commands/app-scaffold.ts
|
|
3871
3892
|
import { constants } from "fs";
|
|
3872
3893
|
import { access, mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
|
|
3873
|
-
import { dirname as
|
|
3894
|
+
import { dirname as dirname3, relative, resolve } from "path";
|
|
3874
3895
|
var CLOUDFLARE_ACCOUNT_ID = "49ef1ba682ad8cfd720c86699ae17521";
|
|
3875
3896
|
var STAGING_CLOUDFLARE_ACCOUNT_ID = "4f4e1c69a3830946f9fea7b1eb7531ac";
|
|
3876
3897
|
var CLOUDFLARE_COMPATIBILITY_DATE = "2026-05-05";
|
|
@@ -3977,7 +3998,7 @@ async function writeApplicationScaffold(payload, options = {}) {
|
|
|
3977
3998
|
const files = [];
|
|
3978
3999
|
for (const planned of plannedFiles) {
|
|
3979
4000
|
const existed = await pathExists(planned.absolutePath);
|
|
3980
|
-
await mkdir2(
|
|
4001
|
+
await mkdir2(dirname3(planned.absolutePath), { recursive: true });
|
|
3981
4002
|
await writeFile2(planned.absolutePath, planned.file.content, "utf8");
|
|
3982
4003
|
files.push({
|
|
3983
4004
|
path: planned.file.path,
|
|
@@ -6223,7 +6244,7 @@ function recordApplicationEvidence(application, options = {}) {
|
|
|
6223
6244
|
let before = null;
|
|
6224
6245
|
if (existsSync3(evidencePath)) {
|
|
6225
6246
|
try {
|
|
6226
|
-
const raw = JSON.parse(
|
|
6247
|
+
const raw = JSON.parse(readFileSync3(evidencePath, "utf8"));
|
|
6227
6248
|
if (raw && typeof raw === "object" && raw.version === 1) {
|
|
6228
6249
|
before = raw;
|
|
6229
6250
|
}
|
|
@@ -6499,7 +6520,7 @@ function statusesAtOrWorse(threshold) {
|
|
|
6499
6520
|
}
|
|
6500
6521
|
|
|
6501
6522
|
// src/commands/platform.ts
|
|
6502
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
6523
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync as statSync2 } from "fs";
|
|
6503
6524
|
import path3 from "path";
|
|
6504
6525
|
function registerPlatformCommand(program2) {
|
|
6505
6526
|
const platform3 = program2.command("platform").description("Internal Topolo first-party platform and personal app commands");
|
|
@@ -6625,7 +6646,7 @@ function scanStagingProductionUrls(rootInput, allowPatterns) {
|
|
|
6625
6646
|
function scanFile(filePath) {
|
|
6626
6647
|
if (shouldSkipFile(filePath)) return;
|
|
6627
6648
|
const relativePath = path3.relative(root, filePath);
|
|
6628
|
-
const content =
|
|
6649
|
+
const content = readFileSync4(filePath, "utf8");
|
|
6629
6650
|
const lines = content.split(/\r?\n/);
|
|
6630
6651
|
lines.forEach((line, index) => {
|
|
6631
6652
|
const matches = [...line.matchAll(PRODUCTION_TOPOLO_URL_PATTERN)].map((match) => match[0]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|