@rogatio/cli 5.2.0 → 5.2.1
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/node/index.js +22 -13
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// packages/cli/src/index.ts
|
|
4
4
|
import { realpathSync } from "node:fs";
|
|
5
|
-
import { basename as basename4, dirname as
|
|
5
|
+
import { basename as basename4, dirname as dirname8, resolve as resolve8 } from "node:path";
|
|
6
6
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7
7
|
|
|
8
8
|
// packages/runtime/dist/node/index.js
|
|
@@ -1176,6 +1176,7 @@ import { dirname as dirname3, join as join3 } from "node:path";
|
|
|
1176
1176
|
import { join as posixJoin } from "node:path/posix";
|
|
1177
1177
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
1178
1178
|
import { accessSync as accessSync2, constants as constants3, mkdirSync, unlinkSync as unlinkSync2 } from "node:fs";
|
|
1179
|
+
import { dirname as dirname4 } from "node:path";
|
|
1179
1180
|
import { join as posixJoin2 } from "node:path/posix";
|
|
1180
1181
|
import { spawn as spawn3, spawnSync as spawnSync3 } from "node:child_process";
|
|
1181
1182
|
import { accessSync as accessSync3, constants as constants4, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
@@ -22048,8 +22049,16 @@ var linuxAdapter = {
|
|
|
22048
22049
|
}
|
|
22049
22050
|
try {
|
|
22050
22051
|
accessSync2(caDir, constants3.W_OK);
|
|
22051
|
-
} catch {
|
|
22052
|
-
|
|
22052
|
+
} catch (err) {
|
|
22053
|
+
if (err?.code === "ENOENT") {
|
|
22054
|
+
try {
|
|
22055
|
+
accessSync2(dirname4(caDir), constants3.W_OK);
|
|
22056
|
+
} catch {
|
|
22057
|
+
reasons.push("ca-store-unwritable");
|
|
22058
|
+
}
|
|
22059
|
+
} else {
|
|
22060
|
+
reasons.push("ca-store-unwritable");
|
|
22061
|
+
}
|
|
22053
22062
|
}
|
|
22054
22063
|
const manifest = !reasons.includes("tooling-missing") && !reasons.includes("manifest-dir-unwritable");
|
|
22055
22064
|
const caTrust = !reasons.includes("tooling-missing") && !reasons.includes("ca-store-unwritable");
|
|
@@ -23739,12 +23748,12 @@ function createRoutes(context) {
|
|
|
23739
23748
|
}
|
|
23740
23749
|
|
|
23741
23750
|
// packages/cli/src/utils/asset-paths.ts
|
|
23742
|
-
import { dirname as
|
|
23751
|
+
import { dirname as dirname5, resolve as resolve3 } from "node:path";
|
|
23743
23752
|
import { fileURLToPath } from "node:url";
|
|
23744
|
-
function isDistBuild(here =
|
|
23753
|
+
function isDistBuild(here = dirname5(fileURLToPath(import.meta.url))) {
|
|
23745
23754
|
return here.includes("/dist/") || here.includes("\\dist\\");
|
|
23746
23755
|
}
|
|
23747
|
-
function editorAssetPaths(here =
|
|
23756
|
+
function editorAssetPaths(here = dirname5(fileURLToPath(import.meta.url))) {
|
|
23748
23757
|
const editorRoot = isDistBuild(here) ? resolve3(here, "..", "editor") : resolve3(here, "..", "..", "..", "editor", "dist", "browser");
|
|
23749
23758
|
return {
|
|
23750
23759
|
bundle: resolve3(editorRoot, "index.js"),
|
|
@@ -23811,7 +23820,7 @@ async function launchBrowser(url) {
|
|
|
23811
23820
|
// packages/cli/src/utils/file.ts
|
|
23812
23821
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
23813
23822
|
import { mkdir as mkdir3, readFile as readFile5, rename as rename2, writeFile as writeFile3 } from "node:fs/promises";
|
|
23814
|
-
import { basename as basename3, dirname as
|
|
23823
|
+
import { basename as basename3, dirname as dirname6, join as join5 } from "node:path";
|
|
23815
23824
|
var ProjectFileError = class extends Error {
|
|
23816
23825
|
code;
|
|
23817
23826
|
path;
|
|
@@ -23861,10 +23870,10 @@ async function readProject(path2) {
|
|
|
23861
23870
|
}
|
|
23862
23871
|
}
|
|
23863
23872
|
async function writeProject(path2, data) {
|
|
23864
|
-
const tempName = `.${basename3(
|
|
23865
|
-
const tempPath = join5(
|
|
23873
|
+
const tempName = `.${basename3(dirname6(path2))}.${randomBytes4(8).toString("hex")}.tmp`;
|
|
23874
|
+
const tempPath = join5(dirname6(path2), tempName);
|
|
23866
23875
|
try {
|
|
23867
|
-
await mkdir3(
|
|
23876
|
+
await mkdir3(dirname6(path2), { recursive: true });
|
|
23868
23877
|
await writeFile3(tempPath, JSON.stringify(data, null, 2), "utf-8");
|
|
23869
23878
|
await rename2(tempPath, path2);
|
|
23870
23879
|
} catch (e) {
|
|
@@ -24227,7 +24236,7 @@ function generateEditorHtml(apiBase, csrfToken, filePath, aiConfigured) {
|
|
|
24227
24236
|
}
|
|
24228
24237
|
|
|
24229
24238
|
// packages/cli/src/commands/runtime.ts
|
|
24230
|
-
import { dirname as
|
|
24239
|
+
import { dirname as dirname7, isAbsolute, join as join6, relative, resolve as resolve5, sep as sep2 } from "node:path";
|
|
24231
24240
|
function showRuntimeHelp() {
|
|
24232
24241
|
console.log(`Usage: rogatio runtime <command> [options]
|
|
24233
24242
|
rogatio runtime host [path]
|
|
@@ -24452,7 +24461,7 @@ async function runtimeHostCommand(args) {
|
|
|
24452
24461
|
}
|
|
24453
24462
|
return 1;
|
|
24454
24463
|
}
|
|
24455
|
-
const rootDir = root ?? (inputPath === "-" ? process.cwd() :
|
|
24464
|
+
const rootDir = root ?? (inputPath === "-" ? process.cwd() : dirname7(filePath));
|
|
24456
24465
|
const mocksResult = buildMockConfigs(compileResult.operations, rootDir);
|
|
24457
24466
|
if (!mocksResult.ok) {
|
|
24458
24467
|
console.error(`Error: ${mocksResult.message}`);
|
|
@@ -24918,7 +24927,7 @@ async function verifyCommand(args, stdinInput, captureOutput = false) {
|
|
|
24918
24927
|
}
|
|
24919
24928
|
|
|
24920
24929
|
// packages/cli/src/index.ts
|
|
24921
|
-
var __dirname =
|
|
24930
|
+
var __dirname = dirname8(fileURLToPath2(import.meta.url));
|
|
24922
24931
|
var packageJsonPath = resolve8(
|
|
24923
24932
|
__dirname,
|
|
24924
24933
|
isDistBuild(__dirname) ? "../../package.json" : "../package.json"
|
package/package.json
CHANGED