fimo 0.2.3-staging.8 → 0.2.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/assets/skills/fimo/references/setup-plain-vite.md +4 -1
- package/assets/skills/fimo/references/setup-react-router.md +3 -2
- package/assets/skills/fimo-cli/references/agent-setup.md +1 -1
- package/assets/skills/fimo-cli/references/branches.md +2 -0
- package/assets/skills/fimo-studio/references/code-editor.md +1 -1
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +754 -631
- package/dist/runtime/templates.d.ts +5 -5
- package/dist/runtime/templates.d.ts.map +1 -1
- package/dist/runtime/templates.js +14 -13
- package/package.json +1 -2
- package/release.json +2 -2
- package/scripts/lib/dev-release-state.mjs +44 -0
- package/scripts/lib/dev-release-state.test.ts +36 -0
- package/scripts/postinstall.mjs +6 -4
- package/scripts/publish-npm.mjs +12 -1
- package/templates/react-router/package.json +1 -8
- package/templates/react-router/pnpm-workspace.yaml +6 -3
- package/scripts/lib/cleanup-release.mjs +0 -64
- package/scripts/lib/cleanup-release.test.ts +0 -142
- package/scripts/publish-tarball.mjs +0 -245
package/dist/cli/index.js
CHANGED
|
@@ -1972,8 +1972,8 @@ var require_command = __commonJS({
|
|
|
1972
1972
|
"../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js"(exports2) {
|
|
1973
1973
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
1974
1974
|
var childProcess2 = __require("node:child_process");
|
|
1975
|
-
var
|
|
1976
|
-
var
|
|
1975
|
+
var path44 = __require("node:path");
|
|
1976
|
+
var fs41 = __require("node:fs");
|
|
1977
1977
|
var process8 = __require("node:process");
|
|
1978
1978
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1979
1979
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2957,7 +2957,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2957
2957
|
* @param {string} subcommandName
|
|
2958
2958
|
*/
|
|
2959
2959
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2960
|
-
if (
|
|
2960
|
+
if (fs41.existsSync(executableFile)) return;
|
|
2961
2961
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
2962
2962
|
const executableMissing = `'${executableFile}' does not exist
|
|
2963
2963
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2975,11 +2975,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2975
2975
|
let launchWithNode = false;
|
|
2976
2976
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2977
2977
|
function findFile(baseDir, baseName) {
|
|
2978
|
-
const localBin =
|
|
2979
|
-
if (
|
|
2980
|
-
if (sourceExt.includes(
|
|
2978
|
+
const localBin = path44.resolve(baseDir, baseName);
|
|
2979
|
+
if (fs41.existsSync(localBin)) return localBin;
|
|
2980
|
+
if (sourceExt.includes(path44.extname(baseName))) return void 0;
|
|
2981
2981
|
const foundExt = sourceExt.find(
|
|
2982
|
-
(ext) =>
|
|
2982
|
+
(ext) => fs41.existsSync(`${localBin}${ext}`)
|
|
2983
2983
|
);
|
|
2984
2984
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2985
2985
|
return void 0;
|
|
@@ -2992,21 +2992,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2992
2992
|
if (this._scriptPath) {
|
|
2993
2993
|
let resolvedScriptPath;
|
|
2994
2994
|
try {
|
|
2995
|
-
resolvedScriptPath =
|
|
2995
|
+
resolvedScriptPath = fs41.realpathSync(this._scriptPath);
|
|
2996
2996
|
} catch {
|
|
2997
2997
|
resolvedScriptPath = this._scriptPath;
|
|
2998
2998
|
}
|
|
2999
|
-
executableDir =
|
|
3000
|
-
|
|
2999
|
+
executableDir = path44.resolve(
|
|
3000
|
+
path44.dirname(resolvedScriptPath),
|
|
3001
3001
|
executableDir
|
|
3002
3002
|
);
|
|
3003
3003
|
}
|
|
3004
3004
|
if (executableDir) {
|
|
3005
3005
|
let localFile = findFile(executableDir, executableFile);
|
|
3006
3006
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
3007
|
-
const legacyName =
|
|
3007
|
+
const legacyName = path44.basename(
|
|
3008
3008
|
this._scriptPath,
|
|
3009
|
-
|
|
3009
|
+
path44.extname(this._scriptPath)
|
|
3010
3010
|
);
|
|
3011
3011
|
if (legacyName !== this._name) {
|
|
3012
3012
|
localFile = findFile(
|
|
@@ -3017,7 +3017,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3017
3017
|
}
|
|
3018
3018
|
executableFile = localFile || executableFile;
|
|
3019
3019
|
}
|
|
3020
|
-
launchWithNode = sourceExt.includes(
|
|
3020
|
+
launchWithNode = sourceExt.includes(path44.extname(executableFile));
|
|
3021
3021
|
let proc;
|
|
3022
3022
|
if (process8.platform !== "win32") {
|
|
3023
3023
|
if (launchWithNode) {
|
|
@@ -3865,7 +3865,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3865
3865
|
* @return {Command}
|
|
3866
3866
|
*/
|
|
3867
3867
|
nameFromFilename(filename) {
|
|
3868
|
-
this._name =
|
|
3868
|
+
this._name = path44.basename(filename, path44.extname(filename));
|
|
3869
3869
|
return this;
|
|
3870
3870
|
}
|
|
3871
3871
|
/**
|
|
@@ -3879,9 +3879,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3879
3879
|
* @param {string} [path]
|
|
3880
3880
|
* @return {(string|null|Command)}
|
|
3881
3881
|
*/
|
|
3882
|
-
executableDir(
|
|
3883
|
-
if (
|
|
3884
|
-
this._executableDir =
|
|
3882
|
+
executableDir(path45) {
|
|
3883
|
+
if (path45 === void 0) return this._executableDir;
|
|
3884
|
+
this._executableDir = path45;
|
|
3885
3885
|
return this;
|
|
3886
3886
|
}
|
|
3887
3887
|
/**
|
|
@@ -6579,17 +6579,17 @@ var require_visit = __commonJS({
|
|
|
6579
6579
|
visit2.BREAK = BREAK;
|
|
6580
6580
|
visit2.SKIP = SKIP;
|
|
6581
6581
|
visit2.REMOVE = REMOVE;
|
|
6582
|
-
function visit_(key, node, visitor,
|
|
6583
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
6582
|
+
function visit_(key, node, visitor, path44) {
|
|
6583
|
+
const ctrl = callVisitor(key, node, visitor, path44);
|
|
6584
6584
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
6585
|
-
replaceNode(key,
|
|
6586
|
-
return visit_(key, ctrl, visitor,
|
|
6585
|
+
replaceNode(key, path44, ctrl);
|
|
6586
|
+
return visit_(key, ctrl, visitor, path44);
|
|
6587
6587
|
}
|
|
6588
6588
|
if (typeof ctrl !== "symbol") {
|
|
6589
6589
|
if (identity2.isCollection(node)) {
|
|
6590
|
-
|
|
6590
|
+
path44 = Object.freeze(path44.concat(node));
|
|
6591
6591
|
for (let i = 0; i < node.items.length; ++i) {
|
|
6592
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
6592
|
+
const ci = visit_(i, node.items[i], visitor, path44);
|
|
6593
6593
|
if (typeof ci === "number")
|
|
6594
6594
|
i = ci - 1;
|
|
6595
6595
|
else if (ci === BREAK)
|
|
@@ -6600,13 +6600,13 @@ var require_visit = __commonJS({
|
|
|
6600
6600
|
}
|
|
6601
6601
|
}
|
|
6602
6602
|
} else if (identity2.isPair(node)) {
|
|
6603
|
-
|
|
6604
|
-
const ck = visit_("key", node.key, visitor,
|
|
6603
|
+
path44 = Object.freeze(path44.concat(node));
|
|
6604
|
+
const ck = visit_("key", node.key, visitor, path44);
|
|
6605
6605
|
if (ck === BREAK)
|
|
6606
6606
|
return BREAK;
|
|
6607
6607
|
else if (ck === REMOVE)
|
|
6608
6608
|
node.key = null;
|
|
6609
|
-
const cv = visit_("value", node.value, visitor,
|
|
6609
|
+
const cv = visit_("value", node.value, visitor, path44);
|
|
6610
6610
|
if (cv === BREAK)
|
|
6611
6611
|
return BREAK;
|
|
6612
6612
|
else if (cv === REMOVE)
|
|
@@ -6629,17 +6629,17 @@ var require_visit = __commonJS({
|
|
|
6629
6629
|
visitAsync.BREAK = BREAK;
|
|
6630
6630
|
visitAsync.SKIP = SKIP;
|
|
6631
6631
|
visitAsync.REMOVE = REMOVE;
|
|
6632
|
-
async function visitAsync_(key, node, visitor,
|
|
6633
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
6632
|
+
async function visitAsync_(key, node, visitor, path44) {
|
|
6633
|
+
const ctrl = await callVisitor(key, node, visitor, path44);
|
|
6634
6634
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
6635
|
-
replaceNode(key,
|
|
6636
|
-
return visitAsync_(key, ctrl, visitor,
|
|
6635
|
+
replaceNode(key, path44, ctrl);
|
|
6636
|
+
return visitAsync_(key, ctrl, visitor, path44);
|
|
6637
6637
|
}
|
|
6638
6638
|
if (typeof ctrl !== "symbol") {
|
|
6639
6639
|
if (identity2.isCollection(node)) {
|
|
6640
|
-
|
|
6640
|
+
path44 = Object.freeze(path44.concat(node));
|
|
6641
6641
|
for (let i = 0; i < node.items.length; ++i) {
|
|
6642
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
6642
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path44);
|
|
6643
6643
|
if (typeof ci === "number")
|
|
6644
6644
|
i = ci - 1;
|
|
6645
6645
|
else if (ci === BREAK)
|
|
@@ -6650,13 +6650,13 @@ var require_visit = __commonJS({
|
|
|
6650
6650
|
}
|
|
6651
6651
|
}
|
|
6652
6652
|
} else if (identity2.isPair(node)) {
|
|
6653
|
-
|
|
6654
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
6653
|
+
path44 = Object.freeze(path44.concat(node));
|
|
6654
|
+
const ck = await visitAsync_("key", node.key, visitor, path44);
|
|
6655
6655
|
if (ck === BREAK)
|
|
6656
6656
|
return BREAK;
|
|
6657
6657
|
else if (ck === REMOVE)
|
|
6658
6658
|
node.key = null;
|
|
6659
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
6659
|
+
const cv = await visitAsync_("value", node.value, visitor, path44);
|
|
6660
6660
|
if (cv === BREAK)
|
|
6661
6661
|
return BREAK;
|
|
6662
6662
|
else if (cv === REMOVE)
|
|
@@ -6685,24 +6685,24 @@ var require_visit = __commonJS({
|
|
|
6685
6685
|
return visitor;
|
|
6686
6686
|
}
|
|
6687
6687
|
__name(initVisitor, "initVisitor");
|
|
6688
|
-
function callVisitor(key, node, visitor,
|
|
6688
|
+
function callVisitor(key, node, visitor, path44) {
|
|
6689
6689
|
if (typeof visitor === "function")
|
|
6690
|
-
return visitor(key, node,
|
|
6690
|
+
return visitor(key, node, path44);
|
|
6691
6691
|
if (identity2.isMap(node))
|
|
6692
|
-
return visitor.Map?.(key, node,
|
|
6692
|
+
return visitor.Map?.(key, node, path44);
|
|
6693
6693
|
if (identity2.isSeq(node))
|
|
6694
|
-
return visitor.Seq?.(key, node,
|
|
6694
|
+
return visitor.Seq?.(key, node, path44);
|
|
6695
6695
|
if (identity2.isPair(node))
|
|
6696
|
-
return visitor.Pair?.(key, node,
|
|
6696
|
+
return visitor.Pair?.(key, node, path44);
|
|
6697
6697
|
if (identity2.isScalar(node))
|
|
6698
|
-
return visitor.Scalar?.(key, node,
|
|
6698
|
+
return visitor.Scalar?.(key, node, path44);
|
|
6699
6699
|
if (identity2.isAlias(node))
|
|
6700
|
-
return visitor.Alias?.(key, node,
|
|
6700
|
+
return visitor.Alias?.(key, node, path44);
|
|
6701
6701
|
return void 0;
|
|
6702
6702
|
}
|
|
6703
6703
|
__name(callVisitor, "callVisitor");
|
|
6704
|
-
function replaceNode(key,
|
|
6705
|
-
const parent2 =
|
|
6704
|
+
function replaceNode(key, path44, node) {
|
|
6705
|
+
const parent2 = path44[path44.length - 1];
|
|
6706
6706
|
if (identity2.isCollection(parent2)) {
|
|
6707
6707
|
parent2.items[key] = node;
|
|
6708
6708
|
} else if (identity2.isPair(parent2)) {
|
|
@@ -7334,10 +7334,10 @@ var require_Collection = __commonJS({
|
|
|
7334
7334
|
var createNode = require_createNode();
|
|
7335
7335
|
var identity2 = require_identity();
|
|
7336
7336
|
var Node2 = require_Node();
|
|
7337
|
-
function collectionFromPath(schema,
|
|
7337
|
+
function collectionFromPath(schema, path44, value) {
|
|
7338
7338
|
let v = value;
|
|
7339
|
-
for (let i =
|
|
7340
|
-
const k =
|
|
7339
|
+
for (let i = path44.length - 1; i >= 0; --i) {
|
|
7340
|
+
const k = path44[i];
|
|
7341
7341
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
7342
7342
|
const a = [];
|
|
7343
7343
|
a[k] = v;
|
|
@@ -7357,7 +7357,7 @@ var require_Collection = __commonJS({
|
|
|
7357
7357
|
});
|
|
7358
7358
|
}
|
|
7359
7359
|
__name(collectionFromPath, "collectionFromPath");
|
|
7360
|
-
var isEmptyPath = /* @__PURE__ */ __name((
|
|
7360
|
+
var isEmptyPath = /* @__PURE__ */ __name((path44) => path44 == null || typeof path44 === "object" && !!path44[Symbol.iterator]().next().done, "isEmptyPath");
|
|
7361
7361
|
var Collection = class extends Node2.NodeBase {
|
|
7362
7362
|
static {
|
|
7363
7363
|
__name(this, "Collection");
|
|
@@ -7390,11 +7390,11 @@ var require_Collection = __commonJS({
|
|
|
7390
7390
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
7391
7391
|
* that already exists in the map.
|
|
7392
7392
|
*/
|
|
7393
|
-
addIn(
|
|
7394
|
-
if (isEmptyPath(
|
|
7393
|
+
addIn(path44, value) {
|
|
7394
|
+
if (isEmptyPath(path44))
|
|
7395
7395
|
this.add(value);
|
|
7396
7396
|
else {
|
|
7397
|
-
const [key, ...rest] =
|
|
7397
|
+
const [key, ...rest] = path44;
|
|
7398
7398
|
const node = this.get(key, true);
|
|
7399
7399
|
if (identity2.isCollection(node))
|
|
7400
7400
|
node.addIn(rest, value);
|
|
@@ -7408,8 +7408,8 @@ var require_Collection = __commonJS({
|
|
|
7408
7408
|
* Removes a value from the collection.
|
|
7409
7409
|
* @returns `true` if the item was found and removed.
|
|
7410
7410
|
*/
|
|
7411
|
-
deleteIn(
|
|
7412
|
-
const [key, ...rest] =
|
|
7411
|
+
deleteIn(path44) {
|
|
7412
|
+
const [key, ...rest] = path44;
|
|
7413
7413
|
if (rest.length === 0)
|
|
7414
7414
|
return this.delete(key);
|
|
7415
7415
|
const node = this.get(key, true);
|
|
@@ -7423,8 +7423,8 @@ var require_Collection = __commonJS({
|
|
|
7423
7423
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7424
7424
|
* `true` (collections are always returned intact).
|
|
7425
7425
|
*/
|
|
7426
|
-
getIn(
|
|
7427
|
-
const [key, ...rest] =
|
|
7426
|
+
getIn(path44, keepScalar) {
|
|
7427
|
+
const [key, ...rest] = path44;
|
|
7428
7428
|
const node = this.get(key, true);
|
|
7429
7429
|
if (rest.length === 0)
|
|
7430
7430
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -7442,8 +7442,8 @@ var require_Collection = __commonJS({
|
|
|
7442
7442
|
/**
|
|
7443
7443
|
* Checks if the collection includes a value with the key `key`.
|
|
7444
7444
|
*/
|
|
7445
|
-
hasIn(
|
|
7446
|
-
const [key, ...rest] =
|
|
7445
|
+
hasIn(path44) {
|
|
7446
|
+
const [key, ...rest] = path44;
|
|
7447
7447
|
if (rest.length === 0)
|
|
7448
7448
|
return this.has(key);
|
|
7449
7449
|
const node = this.get(key, true);
|
|
@@ -7453,8 +7453,8 @@ var require_Collection = __commonJS({
|
|
|
7453
7453
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
7454
7454
|
* boolean to add/remove the item from the set.
|
|
7455
7455
|
*/
|
|
7456
|
-
setIn(
|
|
7457
|
-
const [key, ...rest] =
|
|
7456
|
+
setIn(path44, value) {
|
|
7457
|
+
const [key, ...rest] = path44;
|
|
7458
7458
|
if (rest.length === 0) {
|
|
7459
7459
|
this.set(key, value);
|
|
7460
7460
|
} else {
|
|
@@ -10031,9 +10031,9 @@ var require_Document = __commonJS({
|
|
|
10031
10031
|
this.contents.add(value);
|
|
10032
10032
|
}
|
|
10033
10033
|
/** Adds a value to the document. */
|
|
10034
|
-
addIn(
|
|
10034
|
+
addIn(path44, value) {
|
|
10035
10035
|
if (assertCollection(this.contents))
|
|
10036
|
-
this.contents.addIn(
|
|
10036
|
+
this.contents.addIn(path44, value);
|
|
10037
10037
|
}
|
|
10038
10038
|
/**
|
|
10039
10039
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -10108,14 +10108,14 @@ var require_Document = __commonJS({
|
|
|
10108
10108
|
* Removes a value from the document.
|
|
10109
10109
|
* @returns `true` if the item was found and removed.
|
|
10110
10110
|
*/
|
|
10111
|
-
deleteIn(
|
|
10112
|
-
if (Collection.isEmptyPath(
|
|
10111
|
+
deleteIn(path44) {
|
|
10112
|
+
if (Collection.isEmptyPath(path44)) {
|
|
10113
10113
|
if (this.contents == null)
|
|
10114
10114
|
return false;
|
|
10115
10115
|
this.contents = null;
|
|
10116
10116
|
return true;
|
|
10117
10117
|
}
|
|
10118
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
10118
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path44) : false;
|
|
10119
10119
|
}
|
|
10120
10120
|
/**
|
|
10121
10121
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -10130,10 +10130,10 @@ var require_Document = __commonJS({
|
|
|
10130
10130
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
10131
10131
|
* `true` (collections are always returned intact).
|
|
10132
10132
|
*/
|
|
10133
|
-
getIn(
|
|
10134
|
-
if (Collection.isEmptyPath(
|
|
10133
|
+
getIn(path44, keepScalar) {
|
|
10134
|
+
if (Collection.isEmptyPath(path44))
|
|
10135
10135
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
10136
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
10136
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path44, keepScalar) : void 0;
|
|
10137
10137
|
}
|
|
10138
10138
|
/**
|
|
10139
10139
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -10144,10 +10144,10 @@ var require_Document = __commonJS({
|
|
|
10144
10144
|
/**
|
|
10145
10145
|
* Checks if the document includes a value at `path`.
|
|
10146
10146
|
*/
|
|
10147
|
-
hasIn(
|
|
10148
|
-
if (Collection.isEmptyPath(
|
|
10147
|
+
hasIn(path44) {
|
|
10148
|
+
if (Collection.isEmptyPath(path44))
|
|
10149
10149
|
return this.contents !== void 0;
|
|
10150
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
10150
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path44) : false;
|
|
10151
10151
|
}
|
|
10152
10152
|
/**
|
|
10153
10153
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -10164,13 +10164,13 @@ var require_Document = __commonJS({
|
|
|
10164
10164
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
10165
10165
|
* boolean to add/remove the item from the set.
|
|
10166
10166
|
*/
|
|
10167
|
-
setIn(
|
|
10168
|
-
if (Collection.isEmptyPath(
|
|
10167
|
+
setIn(path44, value) {
|
|
10168
|
+
if (Collection.isEmptyPath(path44)) {
|
|
10169
10169
|
this.contents = value;
|
|
10170
10170
|
} else if (this.contents == null) {
|
|
10171
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
10171
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path44), value);
|
|
10172
10172
|
} else if (assertCollection(this.contents)) {
|
|
10173
|
-
this.contents.setIn(
|
|
10173
|
+
this.contents.setIn(path44, value);
|
|
10174
10174
|
}
|
|
10175
10175
|
}
|
|
10176
10176
|
/**
|
|
@@ -12182,9 +12182,9 @@ var require_cst_visit = __commonJS({
|
|
|
12182
12182
|
visit2.BREAK = BREAK;
|
|
12183
12183
|
visit2.SKIP = SKIP;
|
|
12184
12184
|
visit2.REMOVE = REMOVE;
|
|
12185
|
-
visit2.itemAtPath = (cst,
|
|
12185
|
+
visit2.itemAtPath = (cst, path44) => {
|
|
12186
12186
|
let item = cst;
|
|
12187
|
-
for (const [field, index2] of
|
|
12187
|
+
for (const [field, index2] of path44) {
|
|
12188
12188
|
const tok = item?.[field];
|
|
12189
12189
|
if (tok && "items" in tok) {
|
|
12190
12190
|
item = tok.items[index2];
|
|
@@ -12193,23 +12193,23 @@ var require_cst_visit = __commonJS({
|
|
|
12193
12193
|
}
|
|
12194
12194
|
return item;
|
|
12195
12195
|
};
|
|
12196
|
-
visit2.parentCollection = (cst,
|
|
12197
|
-
const parent2 = visit2.itemAtPath(cst,
|
|
12198
|
-
const field =
|
|
12196
|
+
visit2.parentCollection = (cst, path44) => {
|
|
12197
|
+
const parent2 = visit2.itemAtPath(cst, path44.slice(0, -1));
|
|
12198
|
+
const field = path44[path44.length - 1][0];
|
|
12199
12199
|
const coll = parent2?.[field];
|
|
12200
12200
|
if (coll && "items" in coll)
|
|
12201
12201
|
return coll;
|
|
12202
12202
|
throw new Error("Parent collection not found");
|
|
12203
12203
|
};
|
|
12204
|
-
function _visit(
|
|
12205
|
-
let ctrl = visitor(item,
|
|
12204
|
+
function _visit(path44, item, visitor) {
|
|
12205
|
+
let ctrl = visitor(item, path44);
|
|
12206
12206
|
if (typeof ctrl === "symbol")
|
|
12207
12207
|
return ctrl;
|
|
12208
12208
|
for (const field of ["key", "value"]) {
|
|
12209
12209
|
const token = item[field];
|
|
12210
12210
|
if (token && "items" in token) {
|
|
12211
12211
|
for (let i = 0; i < token.items.length; ++i) {
|
|
12212
|
-
const ci = _visit(Object.freeze(
|
|
12212
|
+
const ci = _visit(Object.freeze(path44.concat([[field, i]])), token.items[i], visitor);
|
|
12213
12213
|
if (typeof ci === "number")
|
|
12214
12214
|
i = ci - 1;
|
|
12215
12215
|
else if (ci === BREAK)
|
|
@@ -12220,10 +12220,10 @@ var require_cst_visit = __commonJS({
|
|
|
12220
12220
|
}
|
|
12221
12221
|
}
|
|
12222
12222
|
if (typeof ctrl === "function" && field === "key")
|
|
12223
|
-
ctrl = ctrl(item,
|
|
12223
|
+
ctrl = ctrl(item, path44);
|
|
12224
12224
|
}
|
|
12225
12225
|
}
|
|
12226
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
12226
|
+
return typeof ctrl === "function" ? ctrl(item, path44) : ctrl;
|
|
12227
12227
|
}
|
|
12228
12228
|
__name(_visit, "_visit");
|
|
12229
12229
|
exports2.visit = visit2;
|
|
@@ -13545,14 +13545,14 @@ var require_parser = __commonJS({
|
|
|
13545
13545
|
case "scalar":
|
|
13546
13546
|
case "single-quoted-scalar":
|
|
13547
13547
|
case "double-quoted-scalar": {
|
|
13548
|
-
const
|
|
13548
|
+
const fs41 = this.flowScalar(this.type);
|
|
13549
13549
|
if (atNextItem || it2.value) {
|
|
13550
|
-
map3.items.push({ start, key:
|
|
13550
|
+
map3.items.push({ start, key: fs41, sep: [] });
|
|
13551
13551
|
this.onKeyLine = true;
|
|
13552
13552
|
} else if (it2.sep) {
|
|
13553
|
-
this.stack.push(
|
|
13553
|
+
this.stack.push(fs41);
|
|
13554
13554
|
} else {
|
|
13555
|
-
Object.assign(it2, { key:
|
|
13555
|
+
Object.assign(it2, { key: fs41, sep: [] });
|
|
13556
13556
|
this.onKeyLine = true;
|
|
13557
13557
|
}
|
|
13558
13558
|
return;
|
|
@@ -13680,13 +13680,13 @@ var require_parser = __commonJS({
|
|
|
13680
13680
|
case "scalar":
|
|
13681
13681
|
case "single-quoted-scalar":
|
|
13682
13682
|
case "double-quoted-scalar": {
|
|
13683
|
-
const
|
|
13683
|
+
const fs41 = this.flowScalar(this.type);
|
|
13684
13684
|
if (!it2 || it2.value)
|
|
13685
|
-
fc.items.push({ start: [], key:
|
|
13685
|
+
fc.items.push({ start: [], key: fs41, sep: [] });
|
|
13686
13686
|
else if (it2.sep)
|
|
13687
|
-
this.stack.push(
|
|
13687
|
+
this.stack.push(fs41);
|
|
13688
13688
|
else
|
|
13689
|
-
Object.assign(it2, { key:
|
|
13689
|
+
Object.assign(it2, { key: fs41, sep: [] });
|
|
13690
13690
|
return;
|
|
13691
13691
|
}
|
|
13692
13692
|
case "flow-map-end":
|
|
@@ -14625,9 +14625,9 @@ var init_skill_DRd1jW7a = __esm({
|
|
|
14625
14625
|
if (!(await Promise.all(entries2.map((entry) => writeSkillFiles(resolved, entry, baseDir)))).some(Boolean)) throw new Error(`Failed to fetch any skill files from well-known index at ${inputUrl}`);
|
|
14626
14626
|
return baseDir;
|
|
14627
14627
|
}, "fetchWellKnownSkills");
|
|
14628
|
-
readJsonObjectIfExists = /* @__PURE__ */ __name(async (
|
|
14628
|
+
readJsonObjectIfExists = /* @__PURE__ */ __name(async (path44) => {
|
|
14629
14629
|
try {
|
|
14630
|
-
const content2 = await readFile(
|
|
14630
|
+
const content2 = await readFile(path44, "utf-8");
|
|
14631
14631
|
const parsed = JSON.parse(content2);
|
|
14632
14632
|
return isPlainObject2(parsed) ? parsed : null;
|
|
14633
14633
|
} catch {
|
|
@@ -14822,16 +14822,16 @@ var init_skill_DRd1jW7a = __esm({
|
|
|
14822
14822
|
if (isGlobal) return agent.globalSkillsDir ?? join2(baseDir, agent.skillsDir);
|
|
14823
14823
|
return join2(baseDir, agent.skillsDir);
|
|
14824
14824
|
}, "getSkillAgentBaseDir");
|
|
14825
|
-
cleanAndCreateDirectory = /* @__PURE__ */ __name(async (
|
|
14826
|
-
await rm(
|
|
14825
|
+
cleanAndCreateDirectory = /* @__PURE__ */ __name(async (path44) => {
|
|
14826
|
+
await rm(path44, {
|
|
14827
14827
|
recursive: true,
|
|
14828
14828
|
force: true
|
|
14829
14829
|
}).catch(() => void 0);
|
|
14830
|
-
await mkdir(
|
|
14830
|
+
await mkdir(path44, { recursive: true });
|
|
14831
14831
|
}, "cleanAndCreateDirectory");
|
|
14832
14832
|
resolveSymlinkTarget = /* @__PURE__ */ __name((linkPath, linkTarget) => resolve(dirname(linkPath), linkTarget), "resolveSymlinkTarget");
|
|
14833
|
-
resolveParentSymlinks = /* @__PURE__ */ __name(async (
|
|
14834
|
-
const resolved = resolve(
|
|
14833
|
+
resolveParentSymlinks = /* @__PURE__ */ __name(async (path44) => {
|
|
14834
|
+
const resolved = resolve(path44);
|
|
14835
14835
|
const parentDir = dirname(resolved);
|
|
14836
14836
|
const name = basename(resolved);
|
|
14837
14837
|
try {
|
|
@@ -18103,11 +18103,10 @@ function readReleaseMeta() {
|
|
|
18103
18103
|
try {
|
|
18104
18104
|
const raw = fs4.readFileSync(RELEASE_FILE2, "utf8");
|
|
18105
18105
|
const parsed = JSON.parse(raw);
|
|
18106
|
-
const
|
|
18107
|
-
|
|
18108
|
-
return { id, source };
|
|
18106
|
+
const source = parsed.source === "npm" || parsed.source === "dev" ? parsed.source : null;
|
|
18107
|
+
return { source };
|
|
18109
18108
|
} catch {
|
|
18110
|
-
return {
|
|
18109
|
+
return { source: null };
|
|
18111
18110
|
}
|
|
18112
18111
|
}
|
|
18113
18112
|
function readCliSemver() {
|
|
@@ -18127,9 +18126,6 @@ function computeFimoPin(meta, semver, options = {}) {
|
|
|
18127
18126
|
return semver;
|
|
18128
18127
|
}
|
|
18129
18128
|
}
|
|
18130
|
-
if (meta.id) {
|
|
18131
|
-
return `${TARBALL_URL_BASE}/fimo-${meta.id}.tgz`;
|
|
18132
|
-
}
|
|
18133
18129
|
if ((meta.source === "dev" || meta.source === null) && options.devPackageRoot) {
|
|
18134
18130
|
return `file:${options.devPackageRoot}`;
|
|
18135
18131
|
}
|
|
@@ -18152,23 +18148,24 @@ function rewriteFimoDep(pkg, pin = resolveFimoPin()) {
|
|
|
18152
18148
|
if (typeof current !== "string") {
|
|
18153
18149
|
continue;
|
|
18154
18150
|
}
|
|
18155
|
-
const
|
|
18151
|
+
const looksLikeLegacyR2 = current.includes("r2.dev/cli/fimo-");
|
|
18152
|
+
const looksLikeLocalFile = current.startsWith("file:");
|
|
18156
18153
|
const looksLikeSemver = /^[\^~]?\d+\.\d+\.\d+/.test(current);
|
|
18157
|
-
|
|
18154
|
+
const looksLikeOwnedDistTag = current === "latest" || current === "staging" || current === "experimental";
|
|
18155
|
+
if ((looksLikeLegacyR2 || looksLikeLocalFile || looksLikeSemver || looksLikeOwnedDistTag) && current !== pin) {
|
|
18158
18156
|
deps["fimo"] = pin;
|
|
18159
18157
|
changed = true;
|
|
18160
18158
|
}
|
|
18161
18159
|
}
|
|
18162
18160
|
return changed;
|
|
18163
18161
|
}
|
|
18164
|
-
var MODULE_DIR, PACKAGE_ROOT, RELEASE_FILE2, PACKAGE_JSON_FILE,
|
|
18162
|
+
var MODULE_DIR, PACKAGE_ROOT, RELEASE_FILE2, PACKAGE_JSON_FILE, DEFAULT_TEMPLATE;
|
|
18165
18163
|
var init_templates = __esm({
|
|
18166
18164
|
"src/runtime/templates.ts"() {
|
|
18167
18165
|
MODULE_DIR = path3.dirname(fileURLToPath2(import.meta.url));
|
|
18168
18166
|
PACKAGE_ROOT = path3.resolve(MODULE_DIR, "..", "..");
|
|
18169
18167
|
RELEASE_FILE2 = path3.join(PACKAGE_ROOT, "release.json");
|
|
18170
18168
|
PACKAGE_JSON_FILE = path3.join(PACKAGE_ROOT, "package.json");
|
|
18171
|
-
TARBALL_URL_BASE = "https://pub-41cdea46386f4b238d8c528c4327dfc1.r2.dev/cli";
|
|
18172
18169
|
DEFAULT_TEMPLATE = "react-router";
|
|
18173
18170
|
__name(getTemplatePath, "getTemplatePath");
|
|
18174
18171
|
__name(readReleaseMeta, "readReleaseMeta");
|
|
@@ -18369,7 +18366,7 @@ function detectAgentsInProject(cwd) {
|
|
|
18369
18366
|
}
|
|
18370
18367
|
return detected;
|
|
18371
18368
|
}
|
|
18372
|
-
var TEMPLATE_ROOT, AGENTS_STARTER_ROOT, AGENT_TEMPLATES_ROOT,
|
|
18369
|
+
var TEMPLATE_ROOT, AGENTS_STARTER_ROOT, AGENT_TEMPLATES_ROOT, EXCLUDED_DIRS;
|
|
18373
18370
|
var init_scaffold = __esm({
|
|
18374
18371
|
"src/cli/utils/scaffold.ts"() {
|
|
18375
18372
|
init_templates();
|
|
@@ -18378,7 +18375,6 @@ var init_scaffold = __esm({
|
|
|
18378
18375
|
TEMPLATE_ROOT = getTemplatePath("react-router");
|
|
18379
18376
|
AGENTS_STARTER_ROOT = path4.resolve(CLI_ROOT, "assets", "agents-starter");
|
|
18380
18377
|
AGENT_TEMPLATES_ROOT = path4.resolve(CLI_ROOT, "assets", "agent-templates");
|
|
18381
|
-
RELEASE_FILE3 = path4.resolve(CLI_ROOT, "release.json");
|
|
18382
18378
|
EXCLUDED_DIRS = /* @__PURE__ */ new Set(["node_modules", "dist", "build", ".turbo", ".git"]);
|
|
18383
18379
|
__name(resolveTemplateRoot, "resolveTemplateRoot");
|
|
18384
18380
|
__name(resolveAgentTemplatesRoot, "resolveAgentTemplatesRoot");
|
|
@@ -19615,11 +19611,11 @@ var init_api = __esm({
|
|
|
19615
19611
|
method;
|
|
19616
19612
|
path;
|
|
19617
19613
|
detail;
|
|
19618
|
-
constructor(method,
|
|
19619
|
-
super(`API ${method} ${
|
|
19614
|
+
constructor(method, path44, status, detail) {
|
|
19615
|
+
super(`API ${method} ${path44} failed: ${status} ${detail}`);
|
|
19620
19616
|
this.name = "ApiRequestError";
|
|
19621
19617
|
this.method = method;
|
|
19622
|
-
this.path =
|
|
19618
|
+
this.path = path44;
|
|
19623
19619
|
this.status = status;
|
|
19624
19620
|
this.detail = detail;
|
|
19625
19621
|
}
|
|
@@ -19695,7 +19691,7 @@ var init_api = __esm({
|
|
|
19695
19691
|
resolveAuthToken() {
|
|
19696
19692
|
return process.env.FIMO_API_TOKEN?.trim() || requireToken(this.cfg);
|
|
19697
19693
|
}
|
|
19698
|
-
async request(
|
|
19694
|
+
async request(path44, init = {}, opts = {}) {
|
|
19699
19695
|
const token = this.resolveAuthToken();
|
|
19700
19696
|
const headers = new Headers(init.headers);
|
|
19701
19697
|
headers.set("Authorization", `Bearer ${token}`);
|
|
@@ -19705,33 +19701,33 @@ var init_api = __esm({
|
|
|
19705
19701
|
if (this.env && !headers.has(FIMO_ENV_HEADER)) {
|
|
19706
19702
|
headers.set(FIMO_ENV_HEADER, this.env);
|
|
19707
19703
|
}
|
|
19708
|
-
const response = await fimoFetch(`${this.cfg.apiUrl}${
|
|
19704
|
+
const response = await fimoFetch(`${this.cfg.apiUrl}${path44}`, { ...init, headers });
|
|
19709
19705
|
if (response.status === 401 || response.status === 403 && !opts.allow403) {
|
|
19710
19706
|
throwUnauthorized(this.cfg, response.status);
|
|
19711
19707
|
}
|
|
19712
19708
|
if (!response.ok) {
|
|
19713
19709
|
const error45 = await this.formatError(response);
|
|
19714
|
-
throw new ApiRequestError(init.method ?? "GET",
|
|
19710
|
+
throw new ApiRequestError(init.method ?? "GET", path44, response.status, error45);
|
|
19715
19711
|
}
|
|
19716
19712
|
if (response.status === 204) {
|
|
19717
19713
|
return void 0;
|
|
19718
19714
|
}
|
|
19719
19715
|
return await response.json();
|
|
19720
19716
|
}
|
|
19721
|
-
async rawRequest(
|
|
19717
|
+
async rawRequest(path44, init = {}) {
|
|
19722
19718
|
const token = this.resolveAuthToken();
|
|
19723
19719
|
const headers = new Headers(init.headers);
|
|
19724
19720
|
headers.set("Authorization", `Bearer ${token}`);
|
|
19725
19721
|
if (this.env && !headers.has(FIMO_ENV_HEADER)) {
|
|
19726
19722
|
headers.set(FIMO_ENV_HEADER, this.env);
|
|
19727
19723
|
}
|
|
19728
|
-
const response = await fimoFetch(`${this.cfg.apiUrl}${
|
|
19724
|
+
const response = await fimoFetch(`${this.cfg.apiUrl}${path44}`, { ...init, headers });
|
|
19729
19725
|
if (response.status === 401 || response.status === 403) {
|
|
19730
19726
|
throwUnauthorized(this.cfg, response.status);
|
|
19731
19727
|
}
|
|
19732
19728
|
if (!response.ok) {
|
|
19733
19729
|
const error45 = await this.formatError(response);
|
|
19734
|
-
throw new Error(`API ${init.method ?? "GET"} ${
|
|
19730
|
+
throw new Error(`API ${init.method ?? "GET"} ${path44} failed: ${response.status} ${error45}`);
|
|
19735
19731
|
}
|
|
19736
19732
|
return response;
|
|
19737
19733
|
}
|
|
@@ -20038,8 +20034,8 @@ var init_api = __esm({
|
|
|
20038
20034
|
// ── Per-surface lazy-fetch (V3 §20.4) ────────────────────────────────
|
|
20039
20035
|
// One method per surface — all share the same `(projectId, env, against?, …key)`
|
|
20040
20036
|
// shape. The drill-in renderers in `utils/format/drill/*` consume these.
|
|
20041
|
-
async getCodeFileDiff(projectId, env2,
|
|
20042
|
-
const qs = lazyFetchQs(opts.against, { path:
|
|
20037
|
+
async getCodeFileDiff(projectId, env2, path44, opts = {}) {
|
|
20038
|
+
const qs = lazyFetchQs(opts.against, { path: path44 });
|
|
20043
20039
|
const body = await this.request(
|
|
20044
20040
|
`/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/code/file?${qs}`
|
|
20045
20041
|
);
|
|
@@ -20047,38 +20043,38 @@ var init_api = __esm({
|
|
|
20047
20043
|
}
|
|
20048
20044
|
async getContentRowDiff(projectId, env2, collection, rowId, opts = {}) {
|
|
20049
20045
|
const qs = lazyFetchQs(opts.against);
|
|
20050
|
-
const
|
|
20051
|
-
const body = await this.request(qs ? `${
|
|
20046
|
+
const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/content/${encodeURIComponent(collection)}/${encodeURIComponent(rowId)}`;
|
|
20047
|
+
const body = await this.request(qs ? `${path44}?${qs}` : path44);
|
|
20052
20048
|
return body.data;
|
|
20053
20049
|
}
|
|
20054
20050
|
async getSchemaTypeDiff(projectId, env2, typeName, opts = {}) {
|
|
20055
20051
|
const qs = lazyFetchQs(opts.against);
|
|
20056
|
-
const
|
|
20057
|
-
const body = await this.request(qs ? `${
|
|
20052
|
+
const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/schemas/${encodeURIComponent(typeName)}`;
|
|
20053
|
+
const body = await this.request(qs ? `${path44}?${qs}` : path44);
|
|
20058
20054
|
return body.data;
|
|
20059
20055
|
}
|
|
20060
20056
|
async getAssetDiff(projectId, env2, assetId, opts = {}) {
|
|
20061
20057
|
const qs = lazyFetchQs(opts.against);
|
|
20062
|
-
const
|
|
20063
|
-
const body = await this.request(qs ? `${
|
|
20058
|
+
const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/assets/${encodeURIComponent(assetId)}`;
|
|
20059
|
+
const body = await this.request(qs ? `${path44}?${qs}` : path44);
|
|
20064
20060
|
return body.data;
|
|
20065
20061
|
}
|
|
20066
20062
|
async getTranslationRowDiff(projectId, env2, locale, key, opts = {}) {
|
|
20067
20063
|
const qs = lazyFetchQs(opts.against);
|
|
20068
|
-
const
|
|
20069
|
-
const body = await this.request(qs ? `${
|
|
20064
|
+
const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/translations/${encodeURIComponent(locale)}/${encodeURIComponent(key)}`;
|
|
20065
|
+
const body = await this.request(qs ? `${path44}?${qs}` : path44);
|
|
20070
20066
|
return body.data;
|
|
20071
20067
|
}
|
|
20072
20068
|
async getFormSchemaDiff(projectId, env2, formName, opts = {}) {
|
|
20073
20069
|
const qs = lazyFetchQs(opts.against);
|
|
20074
|
-
const
|
|
20075
|
-
const body = await this.request(qs ? `${
|
|
20070
|
+
const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/forms/${encodeURIComponent(formName)}`;
|
|
20071
|
+
const body = await this.request(qs ? `${path44}?${qs}` : path44);
|
|
20076
20072
|
return body.data;
|
|
20077
20073
|
}
|
|
20078
20074
|
async getActivationDiff(projectId, env2, agentName, triggerIndex, opts = {}) {
|
|
20079
20075
|
const qs = lazyFetchQs(opts.against);
|
|
20080
|
-
const
|
|
20081
|
-
const body = await this.request(qs ? `${
|
|
20076
|
+
const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/activations/${encodeURIComponent(agentName)}/${triggerIndex}`;
|
|
20077
|
+
const body = await this.request(qs ? `${path44}?${qs}` : path44);
|
|
20082
20078
|
return body.data;
|
|
20083
20079
|
}
|
|
20084
20080
|
/** Merge `from` → `env` via the M09 engine. */
|
|
@@ -20748,17 +20744,17 @@ var require_visit2 = __commonJS({
|
|
|
20748
20744
|
visit2.BREAK = BREAK;
|
|
20749
20745
|
visit2.SKIP = SKIP;
|
|
20750
20746
|
visit2.REMOVE = REMOVE;
|
|
20751
|
-
function visit_(key, node, visitor,
|
|
20752
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
20747
|
+
function visit_(key, node, visitor, path44) {
|
|
20748
|
+
const ctrl = callVisitor(key, node, visitor, path44);
|
|
20753
20749
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
20754
|
-
replaceNode(key,
|
|
20755
|
-
return visit_(key, ctrl, visitor,
|
|
20750
|
+
replaceNode(key, path44, ctrl);
|
|
20751
|
+
return visit_(key, ctrl, visitor, path44);
|
|
20756
20752
|
}
|
|
20757
20753
|
if (typeof ctrl !== "symbol") {
|
|
20758
20754
|
if (identity2.isCollection(node)) {
|
|
20759
|
-
|
|
20755
|
+
path44 = Object.freeze(path44.concat(node));
|
|
20760
20756
|
for (let i = 0; i < node.items.length; ++i) {
|
|
20761
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
20757
|
+
const ci = visit_(i, node.items[i], visitor, path44);
|
|
20762
20758
|
if (typeof ci === "number")
|
|
20763
20759
|
i = ci - 1;
|
|
20764
20760
|
else if (ci === BREAK)
|
|
@@ -20769,13 +20765,13 @@ var require_visit2 = __commonJS({
|
|
|
20769
20765
|
}
|
|
20770
20766
|
}
|
|
20771
20767
|
} else if (identity2.isPair(node)) {
|
|
20772
|
-
|
|
20773
|
-
const ck = visit_("key", node.key, visitor,
|
|
20768
|
+
path44 = Object.freeze(path44.concat(node));
|
|
20769
|
+
const ck = visit_("key", node.key, visitor, path44);
|
|
20774
20770
|
if (ck === BREAK)
|
|
20775
20771
|
return BREAK;
|
|
20776
20772
|
else if (ck === REMOVE)
|
|
20777
20773
|
node.key = null;
|
|
20778
|
-
const cv = visit_("value", node.value, visitor,
|
|
20774
|
+
const cv = visit_("value", node.value, visitor, path44);
|
|
20779
20775
|
if (cv === BREAK)
|
|
20780
20776
|
return BREAK;
|
|
20781
20777
|
else if (cv === REMOVE)
|
|
@@ -20798,17 +20794,17 @@ var require_visit2 = __commonJS({
|
|
|
20798
20794
|
visitAsync.BREAK = BREAK;
|
|
20799
20795
|
visitAsync.SKIP = SKIP;
|
|
20800
20796
|
visitAsync.REMOVE = REMOVE;
|
|
20801
|
-
async function visitAsync_(key, node, visitor,
|
|
20802
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
20797
|
+
async function visitAsync_(key, node, visitor, path44) {
|
|
20798
|
+
const ctrl = await callVisitor(key, node, visitor, path44);
|
|
20803
20799
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
20804
|
-
replaceNode(key,
|
|
20805
|
-
return visitAsync_(key, ctrl, visitor,
|
|
20800
|
+
replaceNode(key, path44, ctrl);
|
|
20801
|
+
return visitAsync_(key, ctrl, visitor, path44);
|
|
20806
20802
|
}
|
|
20807
20803
|
if (typeof ctrl !== "symbol") {
|
|
20808
20804
|
if (identity2.isCollection(node)) {
|
|
20809
|
-
|
|
20805
|
+
path44 = Object.freeze(path44.concat(node));
|
|
20810
20806
|
for (let i = 0; i < node.items.length; ++i) {
|
|
20811
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
20807
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path44);
|
|
20812
20808
|
if (typeof ci === "number")
|
|
20813
20809
|
i = ci - 1;
|
|
20814
20810
|
else if (ci === BREAK)
|
|
@@ -20819,13 +20815,13 @@ var require_visit2 = __commonJS({
|
|
|
20819
20815
|
}
|
|
20820
20816
|
}
|
|
20821
20817
|
} else if (identity2.isPair(node)) {
|
|
20822
|
-
|
|
20823
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
20818
|
+
path44 = Object.freeze(path44.concat(node));
|
|
20819
|
+
const ck = await visitAsync_("key", node.key, visitor, path44);
|
|
20824
20820
|
if (ck === BREAK)
|
|
20825
20821
|
return BREAK;
|
|
20826
20822
|
else if (ck === REMOVE)
|
|
20827
20823
|
node.key = null;
|
|
20828
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
20824
|
+
const cv = await visitAsync_("value", node.value, visitor, path44);
|
|
20829
20825
|
if (cv === BREAK)
|
|
20830
20826
|
return BREAK;
|
|
20831
20827
|
else if (cv === REMOVE)
|
|
@@ -20854,24 +20850,24 @@ var require_visit2 = __commonJS({
|
|
|
20854
20850
|
return visitor;
|
|
20855
20851
|
}
|
|
20856
20852
|
__name(initVisitor, "initVisitor");
|
|
20857
|
-
function callVisitor(key, node, visitor,
|
|
20853
|
+
function callVisitor(key, node, visitor, path44) {
|
|
20858
20854
|
if (typeof visitor === "function")
|
|
20859
|
-
return visitor(key, node,
|
|
20855
|
+
return visitor(key, node, path44);
|
|
20860
20856
|
if (identity2.isMap(node))
|
|
20861
|
-
return visitor.Map?.(key, node,
|
|
20857
|
+
return visitor.Map?.(key, node, path44);
|
|
20862
20858
|
if (identity2.isSeq(node))
|
|
20863
|
-
return visitor.Seq?.(key, node,
|
|
20859
|
+
return visitor.Seq?.(key, node, path44);
|
|
20864
20860
|
if (identity2.isPair(node))
|
|
20865
|
-
return visitor.Pair?.(key, node,
|
|
20861
|
+
return visitor.Pair?.(key, node, path44);
|
|
20866
20862
|
if (identity2.isScalar(node))
|
|
20867
|
-
return visitor.Scalar?.(key, node,
|
|
20863
|
+
return visitor.Scalar?.(key, node, path44);
|
|
20868
20864
|
if (identity2.isAlias(node))
|
|
20869
|
-
return visitor.Alias?.(key, node,
|
|
20865
|
+
return visitor.Alias?.(key, node, path44);
|
|
20870
20866
|
return void 0;
|
|
20871
20867
|
}
|
|
20872
20868
|
__name(callVisitor, "callVisitor");
|
|
20873
|
-
function replaceNode(key,
|
|
20874
|
-
const parent2 =
|
|
20869
|
+
function replaceNode(key, path44, node) {
|
|
20870
|
+
const parent2 = path44[path44.length - 1];
|
|
20875
20871
|
if (identity2.isCollection(parent2)) {
|
|
20876
20872
|
parent2.items[key] = node;
|
|
20877
20873
|
} else if (identity2.isPair(parent2)) {
|
|
@@ -21501,10 +21497,10 @@ var require_Collection2 = __commonJS({
|
|
|
21501
21497
|
var createNode = require_createNode2();
|
|
21502
21498
|
var identity2 = require_identity2();
|
|
21503
21499
|
var Node2 = require_Node2();
|
|
21504
|
-
function collectionFromPath(schema,
|
|
21500
|
+
function collectionFromPath(schema, path44, value) {
|
|
21505
21501
|
let v = value;
|
|
21506
|
-
for (let i =
|
|
21507
|
-
const k =
|
|
21502
|
+
for (let i = path44.length - 1; i >= 0; --i) {
|
|
21503
|
+
const k = path44[i];
|
|
21508
21504
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
21509
21505
|
const a = [];
|
|
21510
21506
|
a[k] = v;
|
|
@@ -21524,7 +21520,7 @@ var require_Collection2 = __commonJS({
|
|
|
21524
21520
|
});
|
|
21525
21521
|
}
|
|
21526
21522
|
__name(collectionFromPath, "collectionFromPath");
|
|
21527
|
-
var isEmptyPath = /* @__PURE__ */ __name((
|
|
21523
|
+
var isEmptyPath = /* @__PURE__ */ __name((path44) => path44 == null || typeof path44 === "object" && !!path44[Symbol.iterator]().next().done, "isEmptyPath");
|
|
21528
21524
|
var Collection = class extends Node2.NodeBase {
|
|
21529
21525
|
static {
|
|
21530
21526
|
__name(this, "Collection");
|
|
@@ -21557,11 +21553,11 @@ var require_Collection2 = __commonJS({
|
|
|
21557
21553
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
21558
21554
|
* that already exists in the map.
|
|
21559
21555
|
*/
|
|
21560
|
-
addIn(
|
|
21561
|
-
if (isEmptyPath(
|
|
21556
|
+
addIn(path44, value) {
|
|
21557
|
+
if (isEmptyPath(path44))
|
|
21562
21558
|
this.add(value);
|
|
21563
21559
|
else {
|
|
21564
|
-
const [key, ...rest] =
|
|
21560
|
+
const [key, ...rest] = path44;
|
|
21565
21561
|
const node = this.get(key, true);
|
|
21566
21562
|
if (identity2.isCollection(node))
|
|
21567
21563
|
node.addIn(rest, value);
|
|
@@ -21575,8 +21571,8 @@ var require_Collection2 = __commonJS({
|
|
|
21575
21571
|
* Removes a value from the collection.
|
|
21576
21572
|
* @returns `true` if the item was found and removed.
|
|
21577
21573
|
*/
|
|
21578
|
-
deleteIn(
|
|
21579
|
-
const [key, ...rest] =
|
|
21574
|
+
deleteIn(path44) {
|
|
21575
|
+
const [key, ...rest] = path44;
|
|
21580
21576
|
if (rest.length === 0)
|
|
21581
21577
|
return this.delete(key);
|
|
21582
21578
|
const node = this.get(key, true);
|
|
@@ -21590,8 +21586,8 @@ var require_Collection2 = __commonJS({
|
|
|
21590
21586
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
21591
21587
|
* `true` (collections are always returned intact).
|
|
21592
21588
|
*/
|
|
21593
|
-
getIn(
|
|
21594
|
-
const [key, ...rest] =
|
|
21589
|
+
getIn(path44, keepScalar) {
|
|
21590
|
+
const [key, ...rest] = path44;
|
|
21595
21591
|
const node = this.get(key, true);
|
|
21596
21592
|
if (rest.length === 0)
|
|
21597
21593
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -21609,8 +21605,8 @@ var require_Collection2 = __commonJS({
|
|
|
21609
21605
|
/**
|
|
21610
21606
|
* Checks if the collection includes a value with the key `key`.
|
|
21611
21607
|
*/
|
|
21612
|
-
hasIn(
|
|
21613
|
-
const [key, ...rest] =
|
|
21608
|
+
hasIn(path44) {
|
|
21609
|
+
const [key, ...rest] = path44;
|
|
21614
21610
|
if (rest.length === 0)
|
|
21615
21611
|
return this.has(key);
|
|
21616
21612
|
const node = this.get(key, true);
|
|
@@ -21620,8 +21616,8 @@ var require_Collection2 = __commonJS({
|
|
|
21620
21616
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
21621
21617
|
* boolean to add/remove the item from the set.
|
|
21622
21618
|
*/
|
|
21623
|
-
setIn(
|
|
21624
|
-
const [key, ...rest] =
|
|
21619
|
+
setIn(path44, value) {
|
|
21620
|
+
const [key, ...rest] = path44;
|
|
21625
21621
|
if (rest.length === 0) {
|
|
21626
21622
|
this.set(key, value);
|
|
21627
21623
|
} else {
|
|
@@ -24186,9 +24182,9 @@ var require_Document2 = __commonJS({
|
|
|
24186
24182
|
this.contents.add(value);
|
|
24187
24183
|
}
|
|
24188
24184
|
/** Adds a value to the document. */
|
|
24189
|
-
addIn(
|
|
24185
|
+
addIn(path44, value) {
|
|
24190
24186
|
if (assertCollection(this.contents))
|
|
24191
|
-
this.contents.addIn(
|
|
24187
|
+
this.contents.addIn(path44, value);
|
|
24192
24188
|
}
|
|
24193
24189
|
/**
|
|
24194
24190
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -24263,14 +24259,14 @@ var require_Document2 = __commonJS({
|
|
|
24263
24259
|
* Removes a value from the document.
|
|
24264
24260
|
* @returns `true` if the item was found and removed.
|
|
24265
24261
|
*/
|
|
24266
|
-
deleteIn(
|
|
24267
|
-
if (Collection.isEmptyPath(
|
|
24262
|
+
deleteIn(path44) {
|
|
24263
|
+
if (Collection.isEmptyPath(path44)) {
|
|
24268
24264
|
if (this.contents == null)
|
|
24269
24265
|
return false;
|
|
24270
24266
|
this.contents = null;
|
|
24271
24267
|
return true;
|
|
24272
24268
|
}
|
|
24273
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
24269
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path44) : false;
|
|
24274
24270
|
}
|
|
24275
24271
|
/**
|
|
24276
24272
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -24285,10 +24281,10 @@ var require_Document2 = __commonJS({
|
|
|
24285
24281
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
24286
24282
|
* `true` (collections are always returned intact).
|
|
24287
24283
|
*/
|
|
24288
|
-
getIn(
|
|
24289
|
-
if (Collection.isEmptyPath(
|
|
24284
|
+
getIn(path44, keepScalar) {
|
|
24285
|
+
if (Collection.isEmptyPath(path44))
|
|
24290
24286
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
24291
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
24287
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path44, keepScalar) : void 0;
|
|
24292
24288
|
}
|
|
24293
24289
|
/**
|
|
24294
24290
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -24299,10 +24295,10 @@ var require_Document2 = __commonJS({
|
|
|
24299
24295
|
/**
|
|
24300
24296
|
* Checks if the document includes a value at `path`.
|
|
24301
24297
|
*/
|
|
24302
|
-
hasIn(
|
|
24303
|
-
if (Collection.isEmptyPath(
|
|
24298
|
+
hasIn(path44) {
|
|
24299
|
+
if (Collection.isEmptyPath(path44))
|
|
24304
24300
|
return this.contents !== void 0;
|
|
24305
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
24301
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path44) : false;
|
|
24306
24302
|
}
|
|
24307
24303
|
/**
|
|
24308
24304
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -24319,13 +24315,13 @@ var require_Document2 = __commonJS({
|
|
|
24319
24315
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
24320
24316
|
* boolean to add/remove the item from the set.
|
|
24321
24317
|
*/
|
|
24322
|
-
setIn(
|
|
24323
|
-
if (Collection.isEmptyPath(
|
|
24318
|
+
setIn(path44, value) {
|
|
24319
|
+
if (Collection.isEmptyPath(path44)) {
|
|
24324
24320
|
this.contents = value;
|
|
24325
24321
|
} else if (this.contents == null) {
|
|
24326
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
24322
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path44), value);
|
|
24327
24323
|
} else if (assertCollection(this.contents)) {
|
|
24328
|
-
this.contents.setIn(
|
|
24324
|
+
this.contents.setIn(path44, value);
|
|
24329
24325
|
}
|
|
24330
24326
|
}
|
|
24331
24327
|
/**
|
|
@@ -26329,9 +26325,9 @@ var require_cst_visit2 = __commonJS({
|
|
|
26329
26325
|
visit2.BREAK = BREAK;
|
|
26330
26326
|
visit2.SKIP = SKIP;
|
|
26331
26327
|
visit2.REMOVE = REMOVE;
|
|
26332
|
-
visit2.itemAtPath = (cst,
|
|
26328
|
+
visit2.itemAtPath = (cst, path44) => {
|
|
26333
26329
|
let item = cst;
|
|
26334
|
-
for (const [field, index2] of
|
|
26330
|
+
for (const [field, index2] of path44) {
|
|
26335
26331
|
const tok = item?.[field];
|
|
26336
26332
|
if (tok && "items" in tok) {
|
|
26337
26333
|
item = tok.items[index2];
|
|
@@ -26340,23 +26336,23 @@ var require_cst_visit2 = __commonJS({
|
|
|
26340
26336
|
}
|
|
26341
26337
|
return item;
|
|
26342
26338
|
};
|
|
26343
|
-
visit2.parentCollection = (cst,
|
|
26344
|
-
const parent2 = visit2.itemAtPath(cst,
|
|
26345
|
-
const field =
|
|
26339
|
+
visit2.parentCollection = (cst, path44) => {
|
|
26340
|
+
const parent2 = visit2.itemAtPath(cst, path44.slice(0, -1));
|
|
26341
|
+
const field = path44[path44.length - 1][0];
|
|
26346
26342
|
const coll = parent2?.[field];
|
|
26347
26343
|
if (coll && "items" in coll)
|
|
26348
26344
|
return coll;
|
|
26349
26345
|
throw new Error("Parent collection not found");
|
|
26350
26346
|
};
|
|
26351
|
-
function _visit(
|
|
26352
|
-
let ctrl = visitor(item,
|
|
26347
|
+
function _visit(path44, item, visitor) {
|
|
26348
|
+
let ctrl = visitor(item, path44);
|
|
26353
26349
|
if (typeof ctrl === "symbol")
|
|
26354
26350
|
return ctrl;
|
|
26355
26351
|
for (const field of ["key", "value"]) {
|
|
26356
26352
|
const token = item[field];
|
|
26357
26353
|
if (token && "items" in token) {
|
|
26358
26354
|
for (let i = 0; i < token.items.length; ++i) {
|
|
26359
|
-
const ci = _visit(Object.freeze(
|
|
26355
|
+
const ci = _visit(Object.freeze(path44.concat([[field, i]])), token.items[i], visitor);
|
|
26360
26356
|
if (typeof ci === "number")
|
|
26361
26357
|
i = ci - 1;
|
|
26362
26358
|
else if (ci === BREAK)
|
|
@@ -26367,10 +26363,10 @@ var require_cst_visit2 = __commonJS({
|
|
|
26367
26363
|
}
|
|
26368
26364
|
}
|
|
26369
26365
|
if (typeof ctrl === "function" && field === "key")
|
|
26370
|
-
ctrl = ctrl(item,
|
|
26366
|
+
ctrl = ctrl(item, path44);
|
|
26371
26367
|
}
|
|
26372
26368
|
}
|
|
26373
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
26369
|
+
return typeof ctrl === "function" ? ctrl(item, path44) : ctrl;
|
|
26374
26370
|
}
|
|
26375
26371
|
__name(_visit, "_visit");
|
|
26376
26372
|
exports2.visit = visit2;
|
|
@@ -27674,14 +27670,14 @@ var require_parser3 = __commonJS({
|
|
|
27674
27670
|
case "scalar":
|
|
27675
27671
|
case "single-quoted-scalar":
|
|
27676
27672
|
case "double-quoted-scalar": {
|
|
27677
|
-
const
|
|
27673
|
+
const fs41 = this.flowScalar(this.type);
|
|
27678
27674
|
if (atNextItem || it2.value) {
|
|
27679
|
-
map3.items.push({ start, key:
|
|
27675
|
+
map3.items.push({ start, key: fs41, sep: [] });
|
|
27680
27676
|
this.onKeyLine = true;
|
|
27681
27677
|
} else if (it2.sep) {
|
|
27682
|
-
this.stack.push(
|
|
27678
|
+
this.stack.push(fs41);
|
|
27683
27679
|
} else {
|
|
27684
|
-
Object.assign(it2, { key:
|
|
27680
|
+
Object.assign(it2, { key: fs41, sep: [] });
|
|
27685
27681
|
this.onKeyLine = true;
|
|
27686
27682
|
}
|
|
27687
27683
|
return;
|
|
@@ -27809,13 +27805,13 @@ var require_parser3 = __commonJS({
|
|
|
27809
27805
|
case "scalar":
|
|
27810
27806
|
case "single-quoted-scalar":
|
|
27811
27807
|
case "double-quoted-scalar": {
|
|
27812
|
-
const
|
|
27808
|
+
const fs41 = this.flowScalar(this.type);
|
|
27813
27809
|
if (!it2 || it2.value)
|
|
27814
|
-
fc.items.push({ start: [], key:
|
|
27810
|
+
fc.items.push({ start: [], key: fs41, sep: [] });
|
|
27815
27811
|
else if (it2.sep)
|
|
27816
|
-
this.stack.push(
|
|
27812
|
+
this.stack.push(fs41);
|
|
27817
27813
|
else
|
|
27818
|
-
Object.assign(it2, { key:
|
|
27814
|
+
Object.assign(it2, { key: fs41, sep: [] });
|
|
27819
27815
|
return;
|
|
27820
27816
|
}
|
|
27821
27817
|
case "flow-map-end":
|
|
@@ -28382,10 +28378,10 @@ function mergeDefs(...defs) {
|
|
|
28382
28378
|
function cloneDef(schema) {
|
|
28383
28379
|
return mergeDefs(schema._zod.def);
|
|
28384
28380
|
}
|
|
28385
|
-
function getElementAtPath(obj,
|
|
28386
|
-
if (!
|
|
28381
|
+
function getElementAtPath(obj, path44) {
|
|
28382
|
+
if (!path44)
|
|
28387
28383
|
return obj;
|
|
28388
|
-
return
|
|
28384
|
+
return path44.reduce((acc, key) => acc?.[key], obj);
|
|
28389
28385
|
}
|
|
28390
28386
|
function promiseAllObject(promisesObj) {
|
|
28391
28387
|
const keys = Object.keys(promisesObj);
|
|
@@ -28675,11 +28671,11 @@ function aborted(x, startIndex = 0) {
|
|
|
28675
28671
|
}
|
|
28676
28672
|
return false;
|
|
28677
28673
|
}
|
|
28678
|
-
function prefixIssues(
|
|
28674
|
+
function prefixIssues(path44, issues) {
|
|
28679
28675
|
return issues.map((iss) => {
|
|
28680
28676
|
var _a5;
|
|
28681
28677
|
(_a5 = iss).path ?? (_a5.path = []);
|
|
28682
|
-
iss.path.unshift(
|
|
28678
|
+
iss.path.unshift(path44);
|
|
28683
28679
|
return iss;
|
|
28684
28680
|
});
|
|
28685
28681
|
}
|
|
@@ -28961,7 +28957,7 @@ function treeifyError(error45, _mapper) {
|
|
|
28961
28957
|
return issue2.message;
|
|
28962
28958
|
};
|
|
28963
28959
|
const result = { errors: [] };
|
|
28964
|
-
const processError = /* @__PURE__ */ __name((error46,
|
|
28960
|
+
const processError = /* @__PURE__ */ __name((error46, path44 = []) => {
|
|
28965
28961
|
var _a5, _b;
|
|
28966
28962
|
for (const issue2 of error46.issues) {
|
|
28967
28963
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -28971,7 +28967,7 @@ function treeifyError(error45, _mapper) {
|
|
|
28971
28967
|
} else if (issue2.code === "invalid_element") {
|
|
28972
28968
|
processError({ issues: issue2.issues }, issue2.path);
|
|
28973
28969
|
} else {
|
|
28974
|
-
const fullpath = [...
|
|
28970
|
+
const fullpath = [...path44, ...issue2.path];
|
|
28975
28971
|
if (fullpath.length === 0) {
|
|
28976
28972
|
result.errors.push(mapper(issue2));
|
|
28977
28973
|
continue;
|
|
@@ -29003,8 +28999,8 @@ function treeifyError(error45, _mapper) {
|
|
|
29003
28999
|
}
|
|
29004
29000
|
function toDotPath(_path) {
|
|
29005
29001
|
const segs = [];
|
|
29006
|
-
const
|
|
29007
|
-
for (const seg of
|
|
29002
|
+
const path44 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
29003
|
+
for (const seg of path44) {
|
|
29008
29004
|
if (typeof seg === "number")
|
|
29009
29005
|
segs.push(`[${seg}]`);
|
|
29010
29006
|
else if (typeof seg === "symbol")
|
|
@@ -45657,10 +45653,12 @@ ${failure.stderr || ""}`.trim()
|
|
|
45657
45653
|
}
|
|
45658
45654
|
let installedDeps = false;
|
|
45659
45655
|
let installError = null;
|
|
45656
|
+
const installArgs = installArgsForPackageManager(packageManager);
|
|
45657
|
+
const installCommand2 = formatPackageManagerCommand(packageManager, installArgs);
|
|
45660
45658
|
if (installDeps) {
|
|
45661
|
-
const installSp = spinner(`Installing dependencies (${
|
|
45659
|
+
const installSp = spinner(`Installing dependencies (${installCommand2})`);
|
|
45662
45660
|
try {
|
|
45663
|
-
await execFileAsync3(packageManager,
|
|
45661
|
+
await execFileAsync3(packageManager, installArgs, { cwd: targetDir });
|
|
45664
45662
|
installSp.succeed("Dependencies installed");
|
|
45665
45663
|
installedDeps = true;
|
|
45666
45664
|
} catch (error45) {
|
|
@@ -45671,7 +45669,7 @@ ${failure.stderr || ""}`.trim()
|
|
|
45671
45669
|
const relativeTarget = path22.relative(process.cwd(), targetDir) || ".";
|
|
45672
45670
|
const setupSteps = [`cd ${relativeTarget}`];
|
|
45673
45671
|
if (!installDeps) {
|
|
45674
|
-
setupSteps.push(
|
|
45672
|
+
setupSteps.push(installCommand2);
|
|
45675
45673
|
}
|
|
45676
45674
|
if (isPretty()) {
|
|
45677
45675
|
wt(setupSteps.join("\n"), "Get set up");
|
|
@@ -45736,6 +45734,15 @@ Aborted. Deleting project ${projectName}\u2026
|
|
|
45736
45734
|
process.off("SIGINT", handler);
|
|
45737
45735
|
};
|
|
45738
45736
|
}
|
|
45737
|
+
function installArgsForPackageManager(packageManager) {
|
|
45738
|
+
if (packageManager === "pnpm") {
|
|
45739
|
+
return ["install", "--config.dangerouslyAllowAllBuilds=true"];
|
|
45740
|
+
}
|
|
45741
|
+
return ["install"];
|
|
45742
|
+
}
|
|
45743
|
+
function formatPackageManagerCommand(packageManager, args) {
|
|
45744
|
+
return [packageManager, ...args].join(" ");
|
|
45745
|
+
}
|
|
45739
45746
|
function detectPackageManager() {
|
|
45740
45747
|
if (isCommandAvailable("pnpm")) {
|
|
45741
45748
|
return "pnpm";
|
|
@@ -45820,6 +45827,8 @@ var init_create = __esm({
|
|
|
45820
45827
|
__name(explainCreateProjectError, "explainCreateProjectError");
|
|
45821
45828
|
__name(runPostCreation, "runPostCreation");
|
|
45822
45829
|
__name(installAbortHandler, "installAbortHandler");
|
|
45830
|
+
__name(installArgsForPackageManager, "installArgsForPackageManager");
|
|
45831
|
+
__name(formatPackageManagerCommand, "formatPackageManagerCommand");
|
|
45823
45832
|
__name(detectPackageManager, "detectPackageManager");
|
|
45824
45833
|
__name(isCommandAvailable, "isCommandAvailable");
|
|
45825
45834
|
__name(resolveOrganization, "resolveOrganization");
|
|
@@ -46039,8 +46048,8 @@ var init_dist8 = __esm({
|
|
|
46039
46048
|
});
|
|
46040
46049
|
|
|
46041
46050
|
// ../../node_modules/.pnpm/eta@3.5.0/node_modules/eta/dist/eta.module.mjs
|
|
46042
|
-
import * as
|
|
46043
|
-
import * as
|
|
46051
|
+
import * as path24 from "node:path";
|
|
46052
|
+
import * as fs20 from "node:fs";
|
|
46044
46053
|
function ParseErr(message, str, indx) {
|
|
46045
46054
|
const whitespace2 = str.slice(0, indx).split(/\n/);
|
|
46046
46055
|
const lineNo = whitespace2.length;
|
|
@@ -46048,11 +46057,11 @@ function ParseErr(message, str, indx) {
|
|
|
46048
46057
|
message += " at line " + lineNo + " col " + colNo + ":\n\n " + str.split(/\n/)[lineNo - 1] + "\n " + Array(colNo).join(" ") + "^";
|
|
46049
46058
|
throw new EtaParseError(message);
|
|
46050
46059
|
}
|
|
46051
|
-
function RuntimeErr(originalError, str, lineNo,
|
|
46060
|
+
function RuntimeErr(originalError, str, lineNo, path44) {
|
|
46052
46061
|
const lines = str.split("\n");
|
|
46053
46062
|
const start = Math.max(lineNo - 3, 0);
|
|
46054
46063
|
const end2 = Math.min(lines.length, lineNo + 3);
|
|
46055
|
-
const filename =
|
|
46064
|
+
const filename = path44;
|
|
46056
46065
|
const context = lines.slice(start, end2).map(function(line, i) {
|
|
46057
46066
|
const curr = i + start + 1;
|
|
46058
46067
|
return (curr == lineNo ? " >> " : " ") + curr + "| " + line;
|
|
@@ -46383,13 +46392,13 @@ function renderStringAsync(template, data2) {
|
|
|
46383
46392
|
});
|
|
46384
46393
|
return renderAsync.call(this, templateFn, data2);
|
|
46385
46394
|
}
|
|
46386
|
-
function readFile2(
|
|
46395
|
+
function readFile2(path44) {
|
|
46387
46396
|
let res = "";
|
|
46388
46397
|
try {
|
|
46389
|
-
res =
|
|
46398
|
+
res = fs20.readFileSync(path44, "utf8");
|
|
46390
46399
|
} catch (err) {
|
|
46391
46400
|
if ((err == null ? void 0 : err.code) === "ENOENT") {
|
|
46392
|
-
throw new EtaFileResolutionError(`Could not find template: ${
|
|
46401
|
+
throw new EtaFileResolutionError(`Could not find template: ${path44}`);
|
|
46393
46402
|
} else {
|
|
46394
46403
|
throw err;
|
|
46395
46404
|
}
|
|
@@ -46409,7 +46418,7 @@ function resolvePath2(templatePath, options) {
|
|
|
46409
46418
|
path: templatePath,
|
|
46410
46419
|
views: this.config.views
|
|
46411
46420
|
});
|
|
46412
|
-
templatePath +=
|
|
46421
|
+
templatePath += path24.extname(templatePath) ? "" : defaultExtension;
|
|
46413
46422
|
if (baseFilePath) {
|
|
46414
46423
|
if (this.config.cacheFilepaths && this.filepathCache[cacheIndex]) {
|
|
46415
46424
|
return this.filepathCache[cacheIndex];
|
|
@@ -46417,12 +46426,12 @@ function resolvePath2(templatePath, options) {
|
|
|
46417
46426
|
const absolutePathTest = absolutePathRegExp.exec(templatePath);
|
|
46418
46427
|
if (absolutePathTest && absolutePathTest.length) {
|
|
46419
46428
|
const formattedPath = templatePath.replace(/^\/*|^\\*/, "");
|
|
46420
|
-
resolvedFilePath =
|
|
46429
|
+
resolvedFilePath = path24.join(views, formattedPath);
|
|
46421
46430
|
} else {
|
|
46422
|
-
resolvedFilePath =
|
|
46431
|
+
resolvedFilePath = path24.join(path24.dirname(baseFilePath), templatePath);
|
|
46423
46432
|
}
|
|
46424
46433
|
} else {
|
|
46425
|
-
resolvedFilePath =
|
|
46434
|
+
resolvedFilePath = path24.join(views, templatePath);
|
|
46426
46435
|
}
|
|
46427
46436
|
if (dirIsChild(views, resolvedFilePath)) {
|
|
46428
46437
|
if (baseFilePath && this.config.cacheFilepaths) {
|
|
@@ -46434,8 +46443,8 @@ function resolvePath2(templatePath, options) {
|
|
|
46434
46443
|
}
|
|
46435
46444
|
}
|
|
46436
46445
|
function dirIsChild(parent2, dir) {
|
|
46437
|
-
const relative3 =
|
|
46438
|
-
return relative3 && !relative3.startsWith("..") && !
|
|
46446
|
+
const relative3 = path24.relative(parent2, dir);
|
|
46447
|
+
return relative3 && !relative3.startsWith("..") && !path24.isAbsolute(relative3);
|
|
46439
46448
|
}
|
|
46440
46449
|
var Cacher, EtaError, EtaParseError, EtaRuntimeError, EtaFileResolutionError, EtaNameResolutionError, AsyncFunction, escMap, defaultConfig, templateLitReg, singleQuoteReg, doubleQuoteReg, Eta$1, absolutePathRegExp, Eta;
|
|
46441
46450
|
var init_eta_module = __esm({
|
|
@@ -46666,9 +46675,9 @@ function getFormFiles(formsDir) {
|
|
|
46666
46675
|
}
|
|
46667
46676
|
return readdirSync2(formsDir).filter((f) => f.endsWith(".json")).map((f) => join7(formsDir, f));
|
|
46668
46677
|
}
|
|
46669
|
-
function readForm(
|
|
46678
|
+
function readForm(path44) {
|
|
46670
46679
|
try {
|
|
46671
|
-
return JSON.parse(readFileSync4(
|
|
46680
|
+
return JSON.parse(readFileSync4(path44, "utf-8"));
|
|
46672
46681
|
} catch {
|
|
46673
46682
|
return null;
|
|
46674
46683
|
}
|
|
@@ -46787,9 +46796,9 @@ function getSchemaFiles(schemasDir) {
|
|
|
46787
46796
|
}
|
|
46788
46797
|
return readdirSync3(schemasDir).filter((f) => f.endsWith(".json")).map((f) => join8(schemasDir, f));
|
|
46789
46798
|
}
|
|
46790
|
-
function readSchema(
|
|
46799
|
+
function readSchema(path44) {
|
|
46791
46800
|
try {
|
|
46792
|
-
return JSON.parse(readFileSync5(
|
|
46801
|
+
return JSON.parse(readFileSync5(path44, "utf-8"));
|
|
46793
46802
|
} catch {
|
|
46794
46803
|
return null;
|
|
46795
46804
|
}
|
|
@@ -68310,14 +68319,14 @@ var require_util = __commonJS({
|
|
|
68310
68319
|
}
|
|
68311
68320
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
68312
68321
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
|
|
68313
|
-
let
|
|
68322
|
+
let path44 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
68314
68323
|
if (origin[origin.length - 1] === "/") {
|
|
68315
68324
|
origin = origin.slice(0, origin.length - 1);
|
|
68316
68325
|
}
|
|
68317
|
-
if (
|
|
68318
|
-
|
|
68326
|
+
if (path44 && path44[0] !== "/") {
|
|
68327
|
+
path44 = `/${path44}`;
|
|
68319
68328
|
}
|
|
68320
|
-
return new URL(`${origin}${
|
|
68329
|
+
return new URL(`${origin}${path44}`);
|
|
68321
68330
|
}
|
|
68322
68331
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
68323
68332
|
throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -69177,9 +69186,9 @@ var require_diagnostics = __commonJS({
|
|
|
69177
69186
|
"undici:client:sendHeaders",
|
|
69178
69187
|
(evt) => {
|
|
69179
69188
|
const {
|
|
69180
|
-
request: { method, path:
|
|
69189
|
+
request: { method, path: path44, origin }
|
|
69181
69190
|
} = evt;
|
|
69182
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
69191
|
+
debugLog("sending request to %s %s%s", method, origin, path44);
|
|
69183
69192
|
}
|
|
69184
69193
|
);
|
|
69185
69194
|
}
|
|
@@ -69198,14 +69207,14 @@ var require_diagnostics = __commonJS({
|
|
|
69198
69207
|
"undici:request:headers",
|
|
69199
69208
|
(evt) => {
|
|
69200
69209
|
const {
|
|
69201
|
-
request: { method, path:
|
|
69210
|
+
request: { method, path: path44, origin },
|
|
69202
69211
|
response: { statusCode }
|
|
69203
69212
|
} = evt;
|
|
69204
69213
|
debugLog(
|
|
69205
69214
|
"received response to %s %s%s - HTTP %d",
|
|
69206
69215
|
method,
|
|
69207
69216
|
origin,
|
|
69208
|
-
|
|
69217
|
+
path44,
|
|
69209
69218
|
statusCode
|
|
69210
69219
|
);
|
|
69211
69220
|
}
|
|
@@ -69214,23 +69223,23 @@ var require_diagnostics = __commonJS({
|
|
|
69214
69223
|
"undici:request:trailers",
|
|
69215
69224
|
(evt) => {
|
|
69216
69225
|
const {
|
|
69217
|
-
request: { method, path:
|
|
69226
|
+
request: { method, path: path44, origin }
|
|
69218
69227
|
} = evt;
|
|
69219
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
69228
|
+
debugLog("trailers received from %s %s%s", method, origin, path44);
|
|
69220
69229
|
}
|
|
69221
69230
|
);
|
|
69222
69231
|
diagnosticsChannel.subscribe(
|
|
69223
69232
|
"undici:request:error",
|
|
69224
69233
|
(evt) => {
|
|
69225
69234
|
const {
|
|
69226
|
-
request: { method, path:
|
|
69235
|
+
request: { method, path: path44, origin },
|
|
69227
69236
|
error: error45
|
|
69228
69237
|
} = evt;
|
|
69229
69238
|
debugLog(
|
|
69230
69239
|
"request to %s %s%s errored - %s",
|
|
69231
69240
|
method,
|
|
69232
69241
|
origin,
|
|
69233
|
-
|
|
69242
|
+
path44,
|
|
69234
69243
|
error45.message
|
|
69235
69244
|
);
|
|
69236
69245
|
}
|
|
@@ -69338,7 +69347,7 @@ var require_request = __commonJS({
|
|
|
69338
69347
|
__name(this, "Request");
|
|
69339
69348
|
}
|
|
69340
69349
|
constructor(origin, {
|
|
69341
|
-
path:
|
|
69350
|
+
path: path44,
|
|
69342
69351
|
method,
|
|
69343
69352
|
body,
|
|
69344
69353
|
headers,
|
|
@@ -69355,11 +69364,11 @@ var require_request = __commonJS({
|
|
|
69355
69364
|
maxRedirections,
|
|
69356
69365
|
typeOfService
|
|
69357
69366
|
}, handler) {
|
|
69358
|
-
if (typeof
|
|
69367
|
+
if (typeof path44 !== "string") {
|
|
69359
69368
|
throw new InvalidArgumentError2("path must be a string");
|
|
69360
|
-
} else if (
|
|
69369
|
+
} else if (path44[0] !== "/" && !(path44.startsWith("http://") || path44.startsWith("https://")) && method !== "CONNECT") {
|
|
69361
69370
|
throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
|
|
69362
|
-
} else if (invalidPathRegex.test(
|
|
69371
|
+
} else if (invalidPathRegex.test(path44)) {
|
|
69363
69372
|
throw new InvalidArgumentError2("invalid request path");
|
|
69364
69373
|
}
|
|
69365
69374
|
if (typeof method !== "string") {
|
|
@@ -69434,7 +69443,7 @@ var require_request = __commonJS({
|
|
|
69434
69443
|
this.completed = false;
|
|
69435
69444
|
this.aborted = false;
|
|
69436
69445
|
this.upgrade = upgrade || null;
|
|
69437
|
-
this.path = query ? serializePathWithQuery(
|
|
69446
|
+
this.path = query ? serializePathWithQuery(path44, query) : path44;
|
|
69438
69447
|
this.origin = origin;
|
|
69439
69448
|
this.protocol = getProtocolFromUrlString(origin);
|
|
69440
69449
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -74626,7 +74635,7 @@ var require_client_h1 = __commonJS({
|
|
|
74626
74635
|
}
|
|
74627
74636
|
__name(shouldSendContentLength, "shouldSendContentLength");
|
|
74628
74637
|
function writeH1(client, request) {
|
|
74629
|
-
const { method, path:
|
|
74638
|
+
const { method, path: path44, host, upgrade, blocking, reset } = request;
|
|
74630
74639
|
let { body, headers, contentLength } = request;
|
|
74631
74640
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
74632
74641
|
if (util.isFormDataLike(body)) {
|
|
@@ -74695,7 +74704,7 @@ var require_client_h1 = __commonJS({
|
|
|
74695
74704
|
if (socket.setTypeOfService) {
|
|
74696
74705
|
socket.setTypeOfService(request.typeOfService);
|
|
74697
74706
|
}
|
|
74698
|
-
let header = `${method} ${
|
|
74707
|
+
let header = `${method} ${path44} HTTP/1.1\r
|
|
74699
74708
|
`;
|
|
74700
74709
|
if (typeof host === "string") {
|
|
74701
74710
|
header += `host: ${host}\r
|
|
@@ -75374,7 +75383,7 @@ var require_client_h2 = __commonJS({
|
|
|
75374
75383
|
function writeH2(client, request) {
|
|
75375
75384
|
const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout];
|
|
75376
75385
|
const session = client[kHTTP2Session];
|
|
75377
|
-
const { method, path:
|
|
75386
|
+
const { method, path: path44, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
|
|
75378
75387
|
let { body } = request;
|
|
75379
75388
|
if (upgrade != null && upgrade !== "websocket") {
|
|
75380
75389
|
util.errorRequest(client, request, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -75442,7 +75451,7 @@ var require_client_h2 = __commonJS({
|
|
|
75442
75451
|
}
|
|
75443
75452
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
75444
75453
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
75445
|
-
headers[HTTP2_HEADER_PATH] =
|
|
75454
|
+
headers[HTTP2_HEADER_PATH] = path44;
|
|
75446
75455
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
75447
75456
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
75448
75457
|
} else {
|
|
@@ -75483,7 +75492,7 @@ var require_client_h2 = __commonJS({
|
|
|
75483
75492
|
stream.setTimeout(requestTimeout);
|
|
75484
75493
|
return true;
|
|
75485
75494
|
}
|
|
75486
|
-
headers[HTTP2_HEADER_PATH] =
|
|
75495
|
+
headers[HTTP2_HEADER_PATH] = path44;
|
|
75487
75496
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
75488
75497
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
75489
75498
|
if (body && typeof body.read === "function") {
|
|
@@ -77846,10 +77855,10 @@ var require_proxy_agent = __commonJS({
|
|
|
77846
77855
|
};
|
|
77847
77856
|
const {
|
|
77848
77857
|
origin,
|
|
77849
|
-
path:
|
|
77858
|
+
path: path44 = "/",
|
|
77850
77859
|
headers = {}
|
|
77851
77860
|
} = opts;
|
|
77852
|
-
opts.path = origin +
|
|
77861
|
+
opts.path = origin + path44;
|
|
77853
77862
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
77854
77863
|
const { host } = new URL(origin);
|
|
77855
77864
|
headers.host = host;
|
|
@@ -79985,21 +79994,21 @@ var require_mock_utils = __commonJS({
|
|
|
79985
79994
|
return normalizedQp;
|
|
79986
79995
|
}
|
|
79987
79996
|
__name(normalizeSearchParams, "normalizeSearchParams");
|
|
79988
|
-
function safeUrl(
|
|
79989
|
-
if (typeof
|
|
79990
|
-
return
|
|
79997
|
+
function safeUrl(path44) {
|
|
79998
|
+
if (typeof path44 !== "string") {
|
|
79999
|
+
return path44;
|
|
79991
80000
|
}
|
|
79992
|
-
const pathSegments =
|
|
80001
|
+
const pathSegments = path44.split("?", 3);
|
|
79993
80002
|
if (pathSegments.length !== 2) {
|
|
79994
|
-
return
|
|
80003
|
+
return path44;
|
|
79995
80004
|
}
|
|
79996
80005
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
79997
80006
|
qp.sort();
|
|
79998
80007
|
return [...pathSegments, qp.toString()].join("?");
|
|
79999
80008
|
}
|
|
80000
80009
|
__name(safeUrl, "safeUrl");
|
|
80001
|
-
function matchKey(mockDispatch2, { path:
|
|
80002
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
80010
|
+
function matchKey(mockDispatch2, { path: path44, method, body, headers }) {
|
|
80011
|
+
const pathMatch = matchValue(mockDispatch2.path, path44);
|
|
80003
80012
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
80004
80013
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
80005
80014
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -80026,8 +80035,8 @@ var require_mock_utils = __commonJS({
|
|
|
80026
80035
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
80027
80036
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
80028
80037
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
80029
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
80030
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
80038
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path44, ignoreTrailingSlash }) => {
|
|
80039
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path44)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path44), resolvedPath);
|
|
80031
80040
|
});
|
|
80032
80041
|
if (matchedMockDispatches.length === 0) {
|
|
80033
80042
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -80069,20 +80078,20 @@ var require_mock_utils = __commonJS({
|
|
|
80069
80078
|
}
|
|
80070
80079
|
}
|
|
80071
80080
|
__name(deleteMockDispatch, "deleteMockDispatch");
|
|
80072
|
-
function removeTrailingSlash(
|
|
80073
|
-
while (
|
|
80074
|
-
|
|
80081
|
+
function removeTrailingSlash(path44) {
|
|
80082
|
+
while (path44.endsWith("/")) {
|
|
80083
|
+
path44 = path44.slice(0, -1);
|
|
80075
80084
|
}
|
|
80076
|
-
if (
|
|
80077
|
-
|
|
80085
|
+
if (path44.length === 0) {
|
|
80086
|
+
path44 = "/";
|
|
80078
80087
|
}
|
|
80079
|
-
return
|
|
80088
|
+
return path44;
|
|
80080
80089
|
}
|
|
80081
80090
|
__name(removeTrailingSlash, "removeTrailingSlash");
|
|
80082
80091
|
function buildKey(opts) {
|
|
80083
|
-
const { path:
|
|
80092
|
+
const { path: path44, method, body, headers, query } = opts;
|
|
80084
80093
|
return {
|
|
80085
|
-
path:
|
|
80094
|
+
path: path44,
|
|
80086
80095
|
method,
|
|
80087
80096
|
body,
|
|
80088
80097
|
headers,
|
|
@@ -80809,10 +80818,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
80809
80818
|
}
|
|
80810
80819
|
format(pendingInterceptors) {
|
|
80811
80820
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
80812
|
-
({ method, path:
|
|
80821
|
+
({ method, path: path44, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
80813
80822
|
Method: method,
|
|
80814
80823
|
Origin: origin,
|
|
80815
|
-
Path:
|
|
80824
|
+
Path: path44,
|
|
80816
80825
|
"Status code": statusCode,
|
|
80817
80826
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
80818
80827
|
Invocations: timesInvoked,
|
|
@@ -80897,9 +80906,9 @@ var require_mock_agent = __commonJS({
|
|
|
80897
80906
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
80898
80907
|
const dispatchOpts = { ...opts };
|
|
80899
80908
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
80900
|
-
const [
|
|
80909
|
+
const [path44, searchParams] = dispatchOpts.path.split("?");
|
|
80901
80910
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
80902
|
-
dispatchOpts.path = `${
|
|
80911
|
+
dispatchOpts.path = `${path44}?${normalizedSearchParams}`;
|
|
80903
80912
|
}
|
|
80904
80913
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
80905
80914
|
}
|
|
@@ -81312,12 +81321,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
81312
81321
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
81313
81322
|
*/
|
|
81314
81323
|
async loadSnapshots(filePath) {
|
|
81315
|
-
const
|
|
81316
|
-
if (!
|
|
81324
|
+
const path44 = filePath || this.#snapshotPath;
|
|
81325
|
+
if (!path44) {
|
|
81317
81326
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
81318
81327
|
}
|
|
81319
81328
|
try {
|
|
81320
|
-
const data2 = await readFile3(resolve6(
|
|
81329
|
+
const data2 = await readFile3(resolve6(path44), "utf8");
|
|
81321
81330
|
const parsed = JSON.parse(data2);
|
|
81322
81331
|
if (Array.isArray(parsed)) {
|
|
81323
81332
|
this.#snapshots.clear();
|
|
@@ -81331,7 +81340,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
81331
81340
|
if (error45.code === "ENOENT") {
|
|
81332
81341
|
this.#snapshots.clear();
|
|
81333
81342
|
} else {
|
|
81334
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
81343
|
+
throw new UndiciError(`Failed to load snapshots from ${path44}`, { cause: error45 });
|
|
81335
81344
|
}
|
|
81336
81345
|
}
|
|
81337
81346
|
}
|
|
@@ -81342,11 +81351,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
81342
81351
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
81343
81352
|
*/
|
|
81344
81353
|
async saveSnapshots(filePath) {
|
|
81345
|
-
const
|
|
81346
|
-
if (!
|
|
81354
|
+
const path44 = filePath || this.#snapshotPath;
|
|
81355
|
+
if (!path44) {
|
|
81347
81356
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
81348
81357
|
}
|
|
81349
|
-
const resolvedPath = resolve6(
|
|
81358
|
+
const resolvedPath = resolve6(path44);
|
|
81350
81359
|
await mkdir2(dirname9(resolvedPath), { recursive: true });
|
|
81351
81360
|
const data2 = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
81352
81361
|
hash: hash2,
|
|
@@ -81985,15 +81994,15 @@ var require_redirect_handler = __commonJS({
|
|
|
81985
81994
|
return;
|
|
81986
81995
|
}
|
|
81987
81996
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
81988
|
-
const
|
|
81989
|
-
const redirectUrlString = `${origin}${
|
|
81997
|
+
const path44 = search ? `${pathname}${search}` : pathname;
|
|
81998
|
+
const redirectUrlString = `${origin}${path44}`;
|
|
81990
81999
|
for (const historyUrl of this.history) {
|
|
81991
82000
|
if (historyUrl.toString() === redirectUrlString) {
|
|
81992
82001
|
throw new InvalidArgumentError2(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
81993
82002
|
}
|
|
81994
82003
|
}
|
|
81995
82004
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
81996
|
-
this.opts.path =
|
|
82005
|
+
this.opts.path = path44;
|
|
81997
82006
|
this.opts.origin = origin;
|
|
81998
82007
|
this.opts.query = null;
|
|
81999
82008
|
}
|
|
@@ -88324,11 +88333,11 @@ var require_fetch = __commonJS({
|
|
|
88324
88333
|
function dispatch({ body }) {
|
|
88325
88334
|
const url2 = requestCurrentURL(request);
|
|
88326
88335
|
const agent = fetchParams.controller.dispatcher;
|
|
88327
|
-
const
|
|
88336
|
+
const path44 = url2.pathname + url2.search;
|
|
88328
88337
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
88329
88338
|
return new Promise((resolve6, reject) => agent.dispatch(
|
|
88330
88339
|
{
|
|
88331
|
-
path: hasTrailingQuestionMark ? `${
|
|
88340
|
+
path: hasTrailingQuestionMark ? `${path44}?` : path44,
|
|
88332
88341
|
origin: url2.origin,
|
|
88333
88342
|
method: request.method,
|
|
88334
88343
|
body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
|
|
@@ -89288,9 +89297,9 @@ var require_util4 = __commonJS({
|
|
|
89288
89297
|
}
|
|
89289
89298
|
}
|
|
89290
89299
|
__name(validateCookieValue, "validateCookieValue");
|
|
89291
|
-
function validateCookiePath(
|
|
89292
|
-
for (let i = 0; i <
|
|
89293
|
-
const code2 =
|
|
89300
|
+
function validateCookiePath(path44) {
|
|
89301
|
+
for (let i = 0; i < path44.length; ++i) {
|
|
89302
|
+
const code2 = path44.charCodeAt(i);
|
|
89294
89303
|
if (code2 < 32 || // exclude CTLs (0-31)
|
|
89295
89304
|
code2 === 127 || // DEL
|
|
89296
89305
|
code2 === 59) {
|
|
@@ -92538,11 +92547,11 @@ var require_undici = __commonJS({
|
|
|
92538
92547
|
if (typeof opts.path !== "string") {
|
|
92539
92548
|
throw new InvalidArgumentError2("invalid opts.path");
|
|
92540
92549
|
}
|
|
92541
|
-
let
|
|
92550
|
+
let path44 = opts.path;
|
|
92542
92551
|
if (!opts.path.startsWith("/")) {
|
|
92543
|
-
|
|
92552
|
+
path44 = `/${path44}`;
|
|
92544
92553
|
}
|
|
92545
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
92554
|
+
url2 = new URL(util.parseOrigin(url2).origin + path44);
|
|
92546
92555
|
} else {
|
|
92547
92556
|
if (!opts) {
|
|
92548
92557
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -93015,19 +93024,19 @@ var init_esm12 = __esm({
|
|
|
93015
93024
|
});
|
|
93016
93025
|
|
|
93017
93026
|
// src/cli/commands/migrate-apply.ts
|
|
93018
|
-
import
|
|
93019
|
-
import
|
|
93027
|
+
import fs33 from "node:fs";
|
|
93028
|
+
import path36 from "node:path";
|
|
93020
93029
|
function applyMigrationManifest(options) {
|
|
93021
93030
|
const { cwd, manifest } = options;
|
|
93022
93031
|
const written = [];
|
|
93023
93032
|
const warnings = [];
|
|
93024
93033
|
const previousArtifacts = readArtifactIndex(cwd);
|
|
93025
93034
|
cleanupPreviousArtifacts(cwd, previousArtifacts);
|
|
93026
|
-
resetDir(
|
|
93027
|
-
resetDir(
|
|
93028
|
-
resetDir(
|
|
93029
|
-
ensureDir(
|
|
93030
|
-
ensureDir(
|
|
93035
|
+
resetDir(path36.join(cwd, GENERATED_PAGES_DIR));
|
|
93036
|
+
resetDir(path36.join(cwd, GENERATED_COMPONENTS_DIR));
|
|
93037
|
+
resetDir(path36.join(cwd, GENERATED_ROOT));
|
|
93038
|
+
ensureDir(path36.join(cwd, SCHEMAS_DIR));
|
|
93039
|
+
ensureDir(path36.join(cwd, FORMS_DIR));
|
|
93031
93040
|
const theme = pickThemePalette(manifest);
|
|
93032
93041
|
const siteName = deriveSiteName(manifest);
|
|
93033
93042
|
const navPages = selectNavPages(manifest.pages);
|
|
@@ -93045,10 +93054,10 @@ function applyMigrationManifest(options) {
|
|
|
93045
93054
|
}
|
|
93046
93055
|
writeFile2(cwd, "design.md", buildDesignDoc(manifest, theme, siteName), written);
|
|
93047
93056
|
writeFile2(cwd, "src/index.css", buildThemeCss(theme), written);
|
|
93048
|
-
writeFile2(cwd,
|
|
93057
|
+
writeFile2(cwd, path36.join(GENERATED_COMPONENTS_DIR, "MigrationShell.tsx"), buildMigrationShellComponent(), written);
|
|
93049
93058
|
writeFile2(
|
|
93050
93059
|
cwd,
|
|
93051
|
-
|
|
93060
|
+
path36.join(GENERATED_COMPONENTS_DIR, "MigrationPageTemplate.tsx"),
|
|
93052
93061
|
buildMigrationPageTemplateComponent(),
|
|
93053
93062
|
written
|
|
93054
93063
|
);
|
|
@@ -93067,14 +93076,14 @@ function applyMigrationManifest(options) {
|
|
|
93067
93076
|
const artifactIndex = {
|
|
93068
93077
|
pageFiles: plannedPages.map((page) => toPosix(page.modulePath)),
|
|
93069
93078
|
componentFiles: [
|
|
93070
|
-
toPosix(
|
|
93071
|
-
toPosix(
|
|
93079
|
+
toPosix(path36.join(GENERATED_COMPONENTS_DIR, "MigrationShell.tsx")),
|
|
93080
|
+
toPosix(path36.join(GENERATED_COMPONENTS_DIR, "MigrationPageTemplate.tsx"))
|
|
93072
93081
|
],
|
|
93073
93082
|
schemaFiles: schemaFiles.map(toPosix),
|
|
93074
93083
|
formFiles: formFiles.map(toPosix),
|
|
93075
93084
|
generatedFiles: generatedNotes.map(toPosix)
|
|
93076
93085
|
};
|
|
93077
|
-
writeFile2(cwd,
|
|
93086
|
+
writeFile2(cwd, path36.join(GENERATED_ROOT, "artifacts.json"), JSON.stringify(artifactIndex, null, 2) + "\n", written);
|
|
93078
93087
|
return {
|
|
93079
93088
|
written,
|
|
93080
93089
|
warnings,
|
|
@@ -93165,7 +93174,7 @@ function writeSchemas(cwd, collections, written) {
|
|
|
93165
93174
|
const filePaths = [];
|
|
93166
93175
|
for (const collection of collections) {
|
|
93167
93176
|
const definition = buildSchemaDefinition(collection);
|
|
93168
|
-
const relativePath =
|
|
93177
|
+
const relativePath = path36.join(SCHEMAS_DIR, `${definition.uid}.json`);
|
|
93169
93178
|
writeFile2(cwd, relativePath, JSON.stringify(definition, null, 2) + "\n", written);
|
|
93170
93179
|
filePaths.push(relativePath);
|
|
93171
93180
|
}
|
|
@@ -93175,15 +93184,15 @@ function writeForms(cwd, forms3, written) {
|
|
|
93175
93184
|
const filePaths = [];
|
|
93176
93185
|
for (const form of forms3) {
|
|
93177
93186
|
const definition = buildFormDefinition(form);
|
|
93178
|
-
const relativePath =
|
|
93187
|
+
const relativePath = path36.join(FORMS_DIR, `${definition.name}.json`);
|
|
93179
93188
|
writeFile2(cwd, relativePath, JSON.stringify(definition, null, 2) + "\n", written);
|
|
93180
93189
|
filePaths.push(relativePath);
|
|
93181
93190
|
}
|
|
93182
93191
|
return filePaths;
|
|
93183
93192
|
}
|
|
93184
93193
|
function writeCollectionSeeds(cwd, manifest, written) {
|
|
93185
|
-
const entriesDir =
|
|
93186
|
-
ensureDir(
|
|
93194
|
+
const entriesDir = path36.join(GENERATED_ROOT, "entries");
|
|
93195
|
+
ensureDir(path36.join(cwd, entriesDir));
|
|
93187
93196
|
for (const collection of manifest.collections) {
|
|
93188
93197
|
const pages = manifest.pages.filter((page) => collection.sourceRoutes.includes(page.route));
|
|
93189
93198
|
const entries2 = pages.map((page) => ({
|
|
@@ -93191,16 +93200,16 @@ function writeCollectionSeeds(cwd, manifest, written) {
|
|
|
93191
93200
|
}));
|
|
93192
93201
|
writeFile2(
|
|
93193
93202
|
cwd,
|
|
93194
|
-
|
|
93203
|
+
path36.join(entriesDir, `${collection.suggestedSchema}.json`),
|
|
93195
93204
|
JSON.stringify(entries2, null, 2) + "\n",
|
|
93196
93205
|
written
|
|
93197
93206
|
);
|
|
93198
93207
|
}
|
|
93199
93208
|
}
|
|
93200
93209
|
function writeGeneratedNotes(cwd, manifest, siteName, warnings, written) {
|
|
93201
|
-
const generatedDir =
|
|
93210
|
+
const generatedDir = path36.join(cwd, GENERATED_ROOT);
|
|
93202
93211
|
ensureDir(generatedDir);
|
|
93203
|
-
const noteFiles = [
|
|
93212
|
+
const noteFiles = [path36.join(GENERATED_ROOT, "next-steps.md"), path36.join(GENERATED_ROOT, "summary.json")];
|
|
93204
93213
|
const nextSteps = [
|
|
93205
93214
|
"# Next Steps",
|
|
93206
93215
|
"",
|
|
@@ -93833,7 +93842,7 @@ function planPages(pages) {
|
|
|
93833
93842
|
planned.push({
|
|
93834
93843
|
page,
|
|
93835
93844
|
componentName,
|
|
93836
|
-
modulePath:
|
|
93845
|
+
modulePath: path36.join(GENERATED_PAGES_DIR, `${componentName}.tsx`)
|
|
93837
93846
|
});
|
|
93838
93847
|
}
|
|
93839
93848
|
if (!planned.some((item) => item.page.route === "/")) {
|
|
@@ -93860,7 +93869,7 @@ function planPages(pages) {
|
|
|
93860
93869
|
confidence: 0.3
|
|
93861
93870
|
},
|
|
93862
93871
|
componentName: "HomePage",
|
|
93863
|
-
modulePath:
|
|
93872
|
+
modulePath: path36.join(GENERATED_PAGES_DIR, "HomePage.tsx")
|
|
93864
93873
|
});
|
|
93865
93874
|
}
|
|
93866
93875
|
return planned.sort(
|
|
@@ -93919,12 +93928,12 @@ function extractPageSeedContent(cwd, page) {
|
|
|
93919
93928
|
paragraphs: page.paragraphs ?? [],
|
|
93920
93929
|
images: page.images ?? []
|
|
93921
93930
|
};
|
|
93922
|
-
const htmlPath = page.artifacts.html ?
|
|
93923
|
-
if (!htmlPath || !
|
|
93931
|
+
const htmlPath = page.artifacts.html ? path36.resolve(cwd, page.artifacts.html) : "";
|
|
93932
|
+
if (!htmlPath || !fs33.existsSync(htmlPath)) {
|
|
93924
93933
|
return fallback;
|
|
93925
93934
|
}
|
|
93926
93935
|
try {
|
|
93927
|
-
const $3 = load(
|
|
93936
|
+
const $3 = load(fs33.readFileSync(htmlPath, "utf8"));
|
|
93928
93937
|
const headings = unique(
|
|
93929
93938
|
$3("h1, h2, h3").toArray().map((element) => cleanText($3(element).text())).filter(Boolean).slice(0, 12)
|
|
93930
93939
|
);
|
|
@@ -94173,12 +94182,12 @@ function toRgb(color) {
|
|
|
94173
94182
|
return null;
|
|
94174
94183
|
}
|
|
94175
94184
|
function readArtifactIndex(cwd) {
|
|
94176
|
-
const artifactPath =
|
|
94177
|
-
if (!
|
|
94185
|
+
const artifactPath = path36.join(cwd, GENERATED_ROOT, "artifacts.json");
|
|
94186
|
+
if (!fs33.existsSync(artifactPath)) {
|
|
94178
94187
|
return null;
|
|
94179
94188
|
}
|
|
94180
94189
|
try {
|
|
94181
|
-
return JSON.parse(
|
|
94190
|
+
return JSON.parse(fs33.readFileSync(artifactPath, "utf8"));
|
|
94182
94191
|
} catch {
|
|
94183
94192
|
return null;
|
|
94184
94193
|
}
|
|
@@ -94192,25 +94201,25 @@ function cleanupPreviousArtifacts(cwd, index2) {
|
|
|
94192
94201
|
...index2.componentFiles,
|
|
94193
94202
|
...index2.generatedFiles
|
|
94194
94203
|
]) {
|
|
94195
|
-
deleteIfExists(
|
|
94204
|
+
deleteIfExists(path36.join(cwd, relativePath));
|
|
94196
94205
|
}
|
|
94197
94206
|
}
|
|
94198
94207
|
function writeFile2(cwd, relativePath, content2, written) {
|
|
94199
|
-
const absolutePath =
|
|
94200
|
-
ensureDir(
|
|
94201
|
-
|
|
94208
|
+
const absolutePath = path36.join(cwd, relativePath);
|
|
94209
|
+
ensureDir(path36.dirname(absolutePath));
|
|
94210
|
+
fs33.writeFileSync(absolutePath, content2, "utf8");
|
|
94202
94211
|
written.push(absolutePath);
|
|
94203
94212
|
}
|
|
94204
94213
|
function ensureDir(dir) {
|
|
94205
|
-
|
|
94214
|
+
fs33.mkdirSync(dir, { recursive: true });
|
|
94206
94215
|
}
|
|
94207
94216
|
function resetDir(dir) {
|
|
94208
|
-
|
|
94209
|
-
|
|
94217
|
+
fs33.rmSync(dir, { recursive: true, force: true });
|
|
94218
|
+
fs33.mkdirSync(dir, { recursive: true });
|
|
94210
94219
|
}
|
|
94211
94220
|
function deleteIfExists(filePath) {
|
|
94212
|
-
if (
|
|
94213
|
-
|
|
94221
|
+
if (fs33.existsSync(filePath)) {
|
|
94222
|
+
fs33.rmSync(filePath, { recursive: true, force: true });
|
|
94214
94223
|
}
|
|
94215
94224
|
}
|
|
94216
94225
|
function unique(values) {
|
|
@@ -94242,7 +94251,7 @@ function absolutizeUrl(value, base) {
|
|
|
94242
94251
|
}
|
|
94243
94252
|
}
|
|
94244
94253
|
function toPosix(value) {
|
|
94245
|
-
return value.split(
|
|
94254
|
+
return value.split(path36.sep).join("/");
|
|
94246
94255
|
}
|
|
94247
94256
|
function manifestLikeUrl(seedUrl, routePath) {
|
|
94248
94257
|
try {
|
|
@@ -94261,12 +94270,12 @@ var init_migrate_apply = __esm({
|
|
|
94261
94270
|
init_sync_forms();
|
|
94262
94271
|
init_sync_schemas();
|
|
94263
94272
|
GENERATED_MARKER = "/* AUTO-GENERATED by fimo migrate apply */";
|
|
94264
|
-
MIGRATION_DIR =
|
|
94265
|
-
GENERATED_ROOT =
|
|
94266
|
-
GENERATED_PAGES_DIR =
|
|
94267
|
-
GENERATED_COMPONENTS_DIR =
|
|
94268
|
-
SCHEMAS_DIR =
|
|
94269
|
-
FORMS_DIR =
|
|
94273
|
+
MIGRATION_DIR = path36.join(".fimo", "migrations", "current");
|
|
94274
|
+
GENERATED_ROOT = path36.join(MIGRATION_DIR, "generated");
|
|
94275
|
+
GENERATED_PAGES_DIR = path36.join("src", "pages", "migrated");
|
|
94276
|
+
GENERATED_COMPONENTS_DIR = path36.join("src", "components", "migration");
|
|
94277
|
+
SCHEMAS_DIR = path36.join("src", "schemas");
|
|
94278
|
+
FORMS_DIR = path36.join("src", "forms");
|
|
94270
94279
|
GENERIC_FONTS = /* @__PURE__ */ new Set([
|
|
94271
94280
|
"arial",
|
|
94272
94281
|
"georgia",
|
|
@@ -94351,8 +94360,8 @@ var init_migrate_apply = __esm({
|
|
|
94351
94360
|
|
|
94352
94361
|
// src/cli/commands/migrate.ts
|
|
94353
94362
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
94354
|
-
import
|
|
94355
|
-
import
|
|
94363
|
+
import fs34 from "node:fs";
|
|
94364
|
+
import path37 from "node:path";
|
|
94356
94365
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
94357
94366
|
async function migrateInitCommand(sourceUrlArg, dirArg, options) {
|
|
94358
94367
|
const projectRoot = await ensureMigrationProject(dirArg, options);
|
|
@@ -94374,14 +94383,14 @@ async function migrateInitCommand(sourceUrlArg, dirArg, options) {
|
|
|
94374
94383
|
maxAssets,
|
|
94375
94384
|
downloadMedia: options.downloadMedia !== false
|
|
94376
94385
|
});
|
|
94377
|
-
spinner2.stop(`Migration artifacts written to ${
|
|
94386
|
+
spinner2.stop(`Migration artifacts written to ${path37.join(projectRoot, MIGRATION_DIR2)}`);
|
|
94378
94387
|
if (options.json) {
|
|
94379
94388
|
console.log(JSON.stringify(manifest, null, 2));
|
|
94380
94389
|
return;
|
|
94381
94390
|
}
|
|
94382
94391
|
printManifestSummary(manifest);
|
|
94383
94392
|
console.log(`
|
|
94384
|
-
Next step: read ${
|
|
94393
|
+
Next step: read ${path37.join(projectRoot, MIGRATION_DIR2, "brief.md")}`);
|
|
94385
94394
|
} catch (error45) {
|
|
94386
94395
|
spinner2.stop(`Migration bootstrap failed: ${error45 instanceof Error ? error45.message : String(error45)}`);
|
|
94387
94396
|
process.exitCode = 1;
|
|
@@ -94393,13 +94402,13 @@ async function migratePullCommand(options) {
|
|
|
94393
94402
|
process.exitCode = 1;
|
|
94394
94403
|
return;
|
|
94395
94404
|
}
|
|
94396
|
-
const manifestPath =
|
|
94397
|
-
if (!
|
|
94405
|
+
const manifestPath = path37.join(projectRoot, MIGRATION_DIR2, "manifest.json");
|
|
94406
|
+
if (!fs34.existsSync(manifestPath)) {
|
|
94398
94407
|
console.error("No migration manifest found. Run `fimo migrate init <url>` first.");
|
|
94399
94408
|
process.exitCode = 1;
|
|
94400
94409
|
return;
|
|
94401
94410
|
}
|
|
94402
|
-
const previous = JSON.parse(
|
|
94411
|
+
const previous = JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
|
|
94403
94412
|
const project = loadProjectMetadata(projectRoot);
|
|
94404
94413
|
const maxPages = parseMaxPages(options.maxPages, previous.crawl.maxPages);
|
|
94405
94414
|
const maxAssets = parseMaxAssets(options.maxAssets);
|
|
@@ -94413,7 +94422,7 @@ async function migratePullCommand(options) {
|
|
|
94413
94422
|
maxAssets,
|
|
94414
94423
|
downloadMedia: options.downloadMedia !== false
|
|
94415
94424
|
});
|
|
94416
|
-
spinner2.stop(`Migration artifacts refreshed in ${
|
|
94425
|
+
spinner2.stop(`Migration artifacts refreshed in ${path37.join(projectRoot, MIGRATION_DIR2)}`);
|
|
94417
94426
|
if (options.json) {
|
|
94418
94427
|
console.log(JSON.stringify(manifest, null, 2));
|
|
94419
94428
|
return;
|
|
@@ -94431,7 +94440,7 @@ async function migrateRunCommand(sourceUrlArg, dirArg, options) {
|
|
|
94431
94440
|
if (hasFailed()) {
|
|
94432
94441
|
return;
|
|
94433
94442
|
}
|
|
94434
|
-
const projectRoot = resolveProjectCwd(dirArg ?
|
|
94443
|
+
const projectRoot = resolveProjectCwd(dirArg ? path37.resolve(dirArg) : options.cwd);
|
|
94435
94444
|
console.log("\nStep 2/4: inspect migration manifest");
|
|
94436
94445
|
migrateInspectCommand({ cwd: projectRoot });
|
|
94437
94446
|
if (hasFailed()) {
|
|
@@ -94454,7 +94463,7 @@ Agent-ready migration draft prepared for ${projectRoot}`);
|
|
|
94454
94463
|
"This is not the final visual rebuild yet. The CLI extracted the source, generated a scaffold, and wrote an agent handoff pack."
|
|
94455
94464
|
);
|
|
94456
94465
|
console.log(
|
|
94457
|
-
`Next step: ask your coding agent to follow ${
|
|
94466
|
+
`Next step: ask your coding agent to follow ${path37.join(projectRoot, MIGRATION_DIR2, "refine", "agent-prompt.md")}`
|
|
94458
94467
|
);
|
|
94459
94468
|
}
|
|
94460
94469
|
function migrateInspectCommand(options) {
|
|
@@ -94463,13 +94472,13 @@ function migrateInspectCommand(options) {
|
|
|
94463
94472
|
process.exitCode = 1;
|
|
94464
94473
|
return;
|
|
94465
94474
|
}
|
|
94466
|
-
const manifestPath =
|
|
94467
|
-
if (!
|
|
94475
|
+
const manifestPath = path37.join(projectRoot, MIGRATION_DIR2, "manifest.json");
|
|
94476
|
+
if (!fs34.existsSync(manifestPath)) {
|
|
94468
94477
|
console.error("No migration manifest found. Run `fimo migrate init <url>` first.");
|
|
94469
94478
|
process.exitCode = 1;
|
|
94470
94479
|
return;
|
|
94471
94480
|
}
|
|
94472
|
-
const manifest = JSON.parse(
|
|
94481
|
+
const manifest = JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
|
|
94473
94482
|
if (options.json) {
|
|
94474
94483
|
console.log(JSON.stringify(manifest, null, 2));
|
|
94475
94484
|
return;
|
|
@@ -94518,7 +94527,7 @@ function migrateApplyCommand(options) {
|
|
|
94518
94527
|
}
|
|
94519
94528
|
console.log(
|
|
94520
94529
|
`
|
|
94521
|
-
Next step: run \`fimo migrate refine -C ${projectRoot}\` or read ${
|
|
94530
|
+
Next step: run \`fimo migrate refine -C ${projectRoot}\` or read ${path37.join(projectRoot, MIGRATION_DIR2, "generated", "next-steps.md")}`
|
|
94522
94531
|
);
|
|
94523
94532
|
} catch (error45) {
|
|
94524
94533
|
spinner2.stop(`Migration apply failed: ${error45 instanceof Error ? error45.message : String(error45)}`);
|
|
@@ -94531,17 +94540,17 @@ function migrateImportCommand(options) {
|
|
|
94531
94540
|
process.exitCode = 1;
|
|
94532
94541
|
return;
|
|
94533
94542
|
}
|
|
94534
|
-
const mediaMapPath =
|
|
94535
|
-
const entriesDir =
|
|
94536
|
-
const schemasDir =
|
|
94537
|
-
const formsDir =
|
|
94538
|
-
const media =
|
|
94539
|
-
const schemas3 =
|
|
94540
|
-
const forms3 =
|
|
94541
|
-
const entryFiles =
|
|
94543
|
+
const mediaMapPath = path37.join(projectRoot, MIGRATION_DIR2, MEDIA_DIR, "map.json");
|
|
94544
|
+
const entriesDir = path37.join(projectRoot, MIGRATION_DIR2, "generated", "entries");
|
|
94545
|
+
const schemasDir = path37.join(projectRoot, "src", "schemas");
|
|
94546
|
+
const formsDir = path37.join(projectRoot, "src", "forms");
|
|
94547
|
+
const media = fs34.existsSync(mediaMapPath) ? readDownloadedMedia(mediaMapPath) : [];
|
|
94548
|
+
const schemas3 = fs34.existsSync(schemasDir) ? fs34.readdirSync(schemasDir).filter((name) => name.endsWith(".json")) : [];
|
|
94549
|
+
const forms3 = fs34.existsSync(formsDir) ? fs34.readdirSync(formsDir).filter((name) => name.endsWith(".json")) : [];
|
|
94550
|
+
const entryFiles = fs34.existsSync(entriesDir) ? fs34.readdirSync(entriesDir).filter((name) => name.endsWith(".json")) : [];
|
|
94542
94551
|
const entryCommands = entryFiles.map((file2) => {
|
|
94543
|
-
const typeName =
|
|
94544
|
-
return `Review ${
|
|
94552
|
+
const typeName = path37.basename(file2, ".json");
|
|
94553
|
+
return `Review ${path37.join(MIGRATION_DIR2, "generated", "entries", file2)}, then run fimo entries create ${typeName} --body '<entry-json>' -C ${projectRoot} for each approved entry`;
|
|
94545
94554
|
});
|
|
94546
94555
|
const result = {
|
|
94547
94556
|
media: media.length,
|
|
@@ -94550,8 +94559,8 @@ function migrateImportCommand(options) {
|
|
|
94550
94559
|
entryFiles: entryFiles.length,
|
|
94551
94560
|
commands: [
|
|
94552
94561
|
...media.map((asset) => `fimo assets upload ${asset.localPath} -C ${projectRoot}`),
|
|
94553
|
-
...schemas3.map((file2) => `fimo schemas push ${
|
|
94554
|
-
...forms3.map((file2) => `fimo forms push ${
|
|
94562
|
+
...schemas3.map((file2) => `fimo schemas push ${path37.basename(file2, ".json")} -C ${projectRoot}`),
|
|
94563
|
+
...forms3.map((file2) => `fimo forms push ${path37.basename(file2, ".json")} -C ${projectRoot}`),
|
|
94555
94564
|
...entryCommands
|
|
94556
94565
|
]
|
|
94557
94566
|
};
|
|
@@ -94595,8 +94604,8 @@ function migrateReportCommand(options) {
|
|
|
94595
94604
|
runBundledMigrationScript("write-migration-report.mjs", args);
|
|
94596
94605
|
}
|
|
94597
94606
|
function runBundledMigrationScript(scriptName, args) {
|
|
94598
|
-
const scriptPath =
|
|
94599
|
-
if (!
|
|
94607
|
+
const scriptPath = path37.join(MIGRATION_SKILL_SCRIPTS_DIR, scriptName);
|
|
94608
|
+
if (!fs34.existsSync(scriptPath)) {
|
|
94600
94609
|
console.error(`Migration helper script not found: ${scriptPath}`);
|
|
94601
94610
|
process.exitCode = 1;
|
|
94602
94611
|
return;
|
|
@@ -94633,7 +94642,7 @@ function readStringOption(options, name) {
|
|
|
94633
94642
|
return void 0;
|
|
94634
94643
|
}
|
|
94635
94644
|
function readDownloadedMedia(mediaMapPath) {
|
|
94636
|
-
return JSON.parse(
|
|
94645
|
+
return JSON.parse(fs34.readFileSync(mediaMapPath, "utf8")).filter(
|
|
94637
94646
|
(asset) => asset.status === "downloaded" && asset.localPath
|
|
94638
94647
|
);
|
|
94639
94648
|
}
|
|
@@ -94641,12 +94650,12 @@ async function ensureMigrationProject(dirArg, options) {
|
|
|
94641
94650
|
if (!dirArg) {
|
|
94642
94651
|
return requireProjectRoot(options.cwd);
|
|
94643
94652
|
}
|
|
94644
|
-
const explicitDir =
|
|
94653
|
+
const explicitDir = path37.resolve(dirArg);
|
|
94645
94654
|
const resolvedRoot = resolveProjectCwd(explicitDir);
|
|
94646
|
-
if (
|
|
94655
|
+
if (fs34.existsSync(path37.join(resolvedRoot, ".fimo.settings.json"))) {
|
|
94647
94656
|
return resolvedRoot;
|
|
94648
94657
|
}
|
|
94649
|
-
if (
|
|
94658
|
+
if (fs34.existsSync(explicitDir) && fs34.readdirSync(explicitDir).length > 0) {
|
|
94650
94659
|
console.error(
|
|
94651
94660
|
`Refusing to initialize a migration in non-empty directory ${explicitDir}. Pass a Fimo project directory or an empty/new directory.`
|
|
94652
94661
|
);
|
|
@@ -94654,7 +94663,7 @@ async function ensureMigrationProject(dirArg, options) {
|
|
|
94654
94663
|
}
|
|
94655
94664
|
await createCommand2(explicitDir, options);
|
|
94656
94665
|
const createdRoot = resolveProjectCwd(explicitDir);
|
|
94657
|
-
if (!
|
|
94666
|
+
if (!fs34.existsSync(path37.join(createdRoot, ".fimo.settings.json"))) {
|
|
94658
94667
|
console.error("Project creation did not complete. Re-run `fimo create` or try again with explicit flags.");
|
|
94659
94668
|
return null;
|
|
94660
94669
|
}
|
|
@@ -94662,7 +94671,7 @@ async function ensureMigrationProject(dirArg, options) {
|
|
|
94662
94671
|
}
|
|
94663
94672
|
function requireProjectRoot(cwdOption) {
|
|
94664
94673
|
const root2 = resolveProjectCwd(cwdOption);
|
|
94665
|
-
if (!
|
|
94674
|
+
if (!fs34.existsSync(path37.join(root2, ".fimo.settings.json"))) {
|
|
94666
94675
|
console.error(
|
|
94667
94676
|
"You are not in a Fimo project. Run `fimo create` first or pass a project directory to `fimo migrate init`."
|
|
94668
94677
|
);
|
|
@@ -94671,12 +94680,12 @@ function requireProjectRoot(cwdOption) {
|
|
|
94671
94680
|
return root2;
|
|
94672
94681
|
}
|
|
94673
94682
|
function readMigrationManifest(projectRoot) {
|
|
94674
|
-
const manifestPath =
|
|
94675
|
-
if (!
|
|
94683
|
+
const manifestPath = path37.join(projectRoot, MIGRATION_DIR2, "manifest.json");
|
|
94684
|
+
if (!fs34.existsSync(manifestPath)) {
|
|
94676
94685
|
console.error("No migration manifest found. Run `fimo migrate init <url>` first.");
|
|
94677
94686
|
return null;
|
|
94678
94687
|
}
|
|
94679
|
-
return JSON.parse(
|
|
94688
|
+
return JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
|
|
94680
94689
|
}
|
|
94681
94690
|
function loadProjectMetadata(projectRoot) {
|
|
94682
94691
|
const settings = loadProjectSettings(projectRoot);
|
|
@@ -94704,14 +94713,14 @@ function parseMaxAssets(value, fallback = DEFAULT_MAX_ASSETS) {
|
|
|
94704
94713
|
}
|
|
94705
94714
|
async function buildMigrationArtifacts(args) {
|
|
94706
94715
|
const { project, sourceUrl, maxPages, maxAssets } = args;
|
|
94707
|
-
const migrationRoot =
|
|
94708
|
-
const pagesRoot =
|
|
94709
|
-
const extractedRoot =
|
|
94710
|
-
const mediaRoot =
|
|
94711
|
-
|
|
94712
|
-
|
|
94713
|
-
|
|
94714
|
-
|
|
94716
|
+
const migrationRoot = path37.join(project.root, MIGRATION_DIR2);
|
|
94717
|
+
const pagesRoot = path37.join(migrationRoot, SOURCE_PAGES_DIR);
|
|
94718
|
+
const extractedRoot = path37.join(migrationRoot, EXTRACTED_DIR);
|
|
94719
|
+
const mediaRoot = path37.join(migrationRoot, MEDIA_DIR);
|
|
94720
|
+
fs34.rmSync(migrationRoot, { recursive: true, force: true });
|
|
94721
|
+
fs34.mkdirSync(pagesRoot, { recursive: true });
|
|
94722
|
+
fs34.mkdirSync(extractedRoot, { recursive: true });
|
|
94723
|
+
fs34.mkdirSync(mediaRoot, { recursive: true });
|
|
94715
94724
|
const crawl = await crawlSite({
|
|
94716
94725
|
sourceUrl,
|
|
94717
94726
|
maxPages,
|
|
@@ -94721,7 +94730,7 @@ async function buildMigrationArtifacts(args) {
|
|
|
94721
94730
|
const designTokens = extractDesignTokens(crawl.pages.map((page) => page.html));
|
|
94722
94731
|
const forms3 = dedupeForms(crawl.pages.flatMap((page) => page.forms));
|
|
94723
94732
|
const pages = crawl.pages.map((page) => {
|
|
94724
|
-
const artifactPath = toPosix2(
|
|
94733
|
+
const artifactPath = toPosix2(path37.relative(project.root, path37.join(pagesRoot, routeToFileName(page.route))));
|
|
94725
94734
|
return {
|
|
94726
94735
|
route: page.route,
|
|
94727
94736
|
url: page.url,
|
|
@@ -94792,7 +94801,7 @@ async function buildMigrationArtifacts(args) {
|
|
|
94792
94801
|
scripts: allScripts.length,
|
|
94793
94802
|
downloaded: mediaAssets.filter((asset) => asset.status === "downloaded").length,
|
|
94794
94803
|
failed: mediaAssets.filter((asset) => asset.status === "failed").length,
|
|
94795
|
-
manifest: mediaAssets.length > 0 ? toPosix2(
|
|
94804
|
+
manifest: mediaAssets.length > 0 ? toPosix2(path37.relative(project.root, path37.join(mediaRoot, "map.json"))) : void 0,
|
|
94796
94805
|
externalHosts: unique2(
|
|
94797
94806
|
[...allImages, ...allStylesheets, ...allScripts].map((value) => safeHostname(value)).filter((value) => Boolean(value))
|
|
94798
94807
|
)
|
|
@@ -94811,19 +94820,19 @@ async function buildMigrationArtifacts(args) {
|
|
|
94811
94820
|
unresolved,
|
|
94812
94821
|
recommendation
|
|
94813
94822
|
};
|
|
94814
|
-
|
|
94815
|
-
|
|
94816
|
-
|
|
94817
|
-
|
|
94818
|
-
|
|
94823
|
+
fs34.writeFileSync(path37.join(migrationRoot, "manifest.json"), JSON.stringify(manifest, null, 2) + "\n", "utf8");
|
|
94824
|
+
fs34.writeFileSync(path37.join(extractedRoot, "pages.json"), JSON.stringify(pages, null, 2) + "\n", "utf8");
|
|
94825
|
+
fs34.writeFileSync(path37.join(extractedRoot, "forms.json"), JSON.stringify(forms3, null, 2) + "\n", "utf8");
|
|
94826
|
+
fs34.writeFileSync(
|
|
94827
|
+
path37.join(extractedRoot, "design-tokens.json"),
|
|
94819
94828
|
JSON.stringify(designTokens, null, 2) + "\n",
|
|
94820
94829
|
"utf8"
|
|
94821
94830
|
);
|
|
94822
|
-
|
|
94831
|
+
fs34.writeFileSync(path37.join(extractedRoot, "assets.json"), JSON.stringify(manifest.assets, null, 2) + "\n", "utf8");
|
|
94823
94832
|
if (mediaAssets.length > 0) {
|
|
94824
|
-
|
|
94833
|
+
fs34.writeFileSync(path37.join(mediaRoot, "map.json"), JSON.stringify(mediaAssets, null, 2) + "\n", "utf8");
|
|
94825
94834
|
}
|
|
94826
|
-
|
|
94835
|
+
fs34.writeFileSync(path37.join(migrationRoot, "brief.md"), buildMigrationBrief(manifest) + "\n", "utf8");
|
|
94827
94836
|
return manifest;
|
|
94828
94837
|
}
|
|
94829
94838
|
async function crawlSite(args) {
|
|
@@ -94874,7 +94883,7 @@ async function crawlSiteWithFetch(args) {
|
|
|
94874
94883
|
const html3 = await response.text();
|
|
94875
94884
|
const page = analyzePage(finalUrl, html3, siteOrigin);
|
|
94876
94885
|
pages.push(page);
|
|
94877
|
-
|
|
94886
|
+
fs34.writeFileSync(path37.join(args.pagesRoot, routeToFileName(page.route)), html3, "utf8");
|
|
94878
94887
|
for (const link of page.discoveredLinks) {
|
|
94879
94888
|
if (!visited.has(link) && queue.length + pages.length < args.maxPages * 4) {
|
|
94880
94889
|
queue.push(link);
|
|
@@ -95045,11 +95054,11 @@ function buildDesignNotes(tokens, platform4) {
|
|
|
95045
95054
|
async function downloadMediaAssets(args) {
|
|
95046
95055
|
const selected = args.urls.slice(0, args.maxAssets);
|
|
95047
95056
|
const assets3 = [];
|
|
95048
|
-
const originalsRoot =
|
|
95049
|
-
|
|
95057
|
+
const originalsRoot = path37.join(args.mediaRoot, "originals");
|
|
95058
|
+
fs34.mkdirSync(originalsRoot, { recursive: true });
|
|
95050
95059
|
for (const sourceUrl of selected) {
|
|
95051
95060
|
const fileName = mediaFileName(sourceUrl, assets3.length + 1);
|
|
95052
|
-
const localPath =
|
|
95061
|
+
const localPath = path37.join(originalsRoot, fileName);
|
|
95053
95062
|
try {
|
|
95054
95063
|
const response = await fetch(sourceUrl, {
|
|
95055
95064
|
headers: {
|
|
@@ -95065,11 +95074,11 @@ async function downloadMediaAssets(args) {
|
|
|
95065
95074
|
throw new Error(`Unsupported content type ${contentType}`);
|
|
95066
95075
|
}
|
|
95067
95076
|
const buffer = Buffer.from(await response.arrayBuffer());
|
|
95068
|
-
|
|
95077
|
+
fs34.writeFileSync(localPath, buffer);
|
|
95069
95078
|
assets3.push({
|
|
95070
95079
|
sourceUrl,
|
|
95071
95080
|
fileName,
|
|
95072
|
-
localPath: toPosix2(
|
|
95081
|
+
localPath: toPosix2(path37.relative(args.projectRoot, localPath)),
|
|
95073
95082
|
contentType,
|
|
95074
95083
|
bytes: buffer.byteLength,
|
|
95075
95084
|
status: "downloaded"
|
|
@@ -95090,9 +95099,9 @@ async function downloadMediaAssets(args) {
|
|
|
95090
95099
|
}
|
|
95091
95100
|
function mediaFileName(sourceUrl, index2) {
|
|
95092
95101
|
const url2 = new URL(sourceUrl);
|
|
95093
|
-
const original =
|
|
95094
|
-
const ext =
|
|
95095
|
-
const stem =
|
|
95102
|
+
const original = path37.basename(url2.pathname).replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
95103
|
+
const ext = path37.extname(original) || ".bin";
|
|
95104
|
+
const stem = path37.basename(original, ext) || "asset";
|
|
95096
95105
|
return `${String(index2).padStart(3, "0")}-${slugify2(stem).slice(0, 48) || "asset"}${ext}`;
|
|
95097
95106
|
}
|
|
95098
95107
|
function buildNextActions(args) {
|
|
@@ -95243,7 +95252,7 @@ function printManifestSummary(manifest) {
|
|
|
95243
95252
|
console.log(`Media: ${manifest.assets.downloaded}/${manifest.assets.images} downloaded`);
|
|
95244
95253
|
}
|
|
95245
95254
|
console.log(`Recommendation: ${manifest.recommendation.mode}`);
|
|
95246
|
-
console.log(`Artifacts: ${
|
|
95255
|
+
console.log(`Artifacts: ${path37.join(manifest.project.root, manifest.project.migrationDir)}`);
|
|
95247
95256
|
if (manifest.unresolved.length > 0) {
|
|
95248
95257
|
console.log("\nUnresolved");
|
|
95249
95258
|
for (const issue2 of manifest.unresolved) {
|
|
@@ -95438,7 +95447,7 @@ function toPascalCase(value) {
|
|
|
95438
95447
|
return value.split(/[^a-zA-Z0-9]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
95439
95448
|
}
|
|
95440
95449
|
function toPosix2(value) {
|
|
95441
|
-
return value.split(
|
|
95450
|
+
return value.split(path37.sep).join("/");
|
|
95442
95451
|
}
|
|
95443
95452
|
var DEFAULT_MAX_PAGES, DEFAULT_MAX_ASSETS, MIGRATION_DIR2, CLI_ROOT4, MIGRATION_SKILL_SCRIPTS_DIR, SOURCE_PAGES_DIR, EXTRACTED_DIR, MEDIA_DIR, USER_AGENT, LEGAL_ROUTES, COLLECTION_ROUTE_BLACKLIST;
|
|
95444
95453
|
var init_migrate = __esm({
|
|
@@ -95450,10 +95459,10 @@ var init_migrate = __esm({
|
|
|
95450
95459
|
init_migrate_apply();
|
|
95451
95460
|
DEFAULT_MAX_PAGES = 12;
|
|
95452
95461
|
DEFAULT_MAX_ASSETS = 40;
|
|
95453
|
-
MIGRATION_DIR2 =
|
|
95454
|
-
CLI_ROOT4 =
|
|
95455
|
-
MIGRATION_SKILL_SCRIPTS_DIR =
|
|
95456
|
-
SOURCE_PAGES_DIR =
|
|
95462
|
+
MIGRATION_DIR2 = path37.join(".fimo", "migrations", "current");
|
|
95463
|
+
CLI_ROOT4 = path37.resolve(path37.dirname(fileURLToPath7(import.meta.url)), "..", "..", "..");
|
|
95464
|
+
MIGRATION_SKILL_SCRIPTS_DIR = path37.join(CLI_ROOT4, "assets", "skills", "fimo-migration", "scripts");
|
|
95465
|
+
SOURCE_PAGES_DIR = path37.join("source", "pages");
|
|
95457
95466
|
EXTRACTED_DIR = "extracted";
|
|
95458
95467
|
MEDIA_DIR = "media";
|
|
95459
95468
|
USER_AGENT = "fimo-cli migrate/0.1";
|
|
@@ -95538,8 +95547,8 @@ __export(migrate_refine_exports, {
|
|
|
95538
95547
|
migrateRefineCommand: () => migrateRefineCommand,
|
|
95539
95548
|
prepareMigrationRefineArtifacts: () => prepareMigrationRefineArtifacts
|
|
95540
95549
|
});
|
|
95541
|
-
import
|
|
95542
|
-
import
|
|
95550
|
+
import fs35 from "node:fs";
|
|
95551
|
+
import path38 from "node:path";
|
|
95543
95552
|
function migrateRefineCommand(options) {
|
|
95544
95553
|
const projectRoot = requireProjectRoot2(options.cwd);
|
|
95545
95554
|
if (!projectRoot) {
|
|
@@ -95567,11 +95576,11 @@ function migrateRefineCommand(options) {
|
|
|
95567
95576
|
console.log(`Project: ${projectRoot}`);
|
|
95568
95577
|
console.log(`Pages prepared: ${result.pagesPrepared}`);
|
|
95569
95578
|
console.log(`Focus route: ${result.focusRoute ?? "all routes"}`);
|
|
95570
|
-
console.log(`Prompt: ${
|
|
95571
|
-
console.log(`Summary: ${
|
|
95579
|
+
console.log(`Prompt: ${path38.join(projectRoot, result.promptPath)}`);
|
|
95580
|
+
console.log(`Summary: ${path38.join(projectRoot, result.summaryPath)}`);
|
|
95572
95581
|
console.log(`Page briefs: ${result.pageBriefs.length}`);
|
|
95573
95582
|
console.log(`
|
|
95574
|
-
Next step: open ${
|
|
95583
|
+
Next step: open ${path38.join(projectRoot, result.promptPath)} and paste it to your coding agent.`);
|
|
95575
95584
|
} catch (error45) {
|
|
95576
95585
|
spinner2.stop(`Migration refine failed: ${error45 instanceof Error ? error45.message : String(error45)}`);
|
|
95577
95586
|
process.exitCode = 1;
|
|
@@ -95586,10 +95595,10 @@ function prepareMigrationRefineArtifacts(args) {
|
|
|
95586
95595
|
);
|
|
95587
95596
|
}
|
|
95588
95597
|
const generatedArtifacts = readGeneratedArtifacts(cwd);
|
|
95589
|
-
const refineRootAbs =
|
|
95590
|
-
const pageBriefsAbs =
|
|
95591
|
-
|
|
95592
|
-
|
|
95598
|
+
const refineRootAbs = path38.join(cwd, REFINE_ROOT);
|
|
95599
|
+
const pageBriefsAbs = path38.join(cwd, PAGE_BRIEFS_DIR);
|
|
95600
|
+
fs35.rmSync(refineRootAbs, { recursive: true, force: true });
|
|
95601
|
+
fs35.mkdirSync(pageBriefsAbs, { recursive: true });
|
|
95593
95602
|
const written = [];
|
|
95594
95603
|
const pageSummaries = [];
|
|
95595
95604
|
const mediaMap = readMediaMap(cwd, manifest);
|
|
@@ -95604,8 +95613,8 @@ function prepareMigrationRefineArtifacts(args) {
|
|
|
95604
95613
|
});
|
|
95605
95614
|
pageSummaries.push(pageSummary);
|
|
95606
95615
|
}
|
|
95607
|
-
const summaryPath =
|
|
95608
|
-
const promptPath =
|
|
95616
|
+
const summaryPath = path38.join(REFINE_ROOT, "summary.json");
|
|
95617
|
+
const promptPath = path38.join(REFINE_ROOT, "agent-prompt.md");
|
|
95609
95618
|
writeFile3(
|
|
95610
95619
|
cwd,
|
|
95611
95620
|
summaryPath,
|
|
@@ -95634,7 +95643,7 @@ function prepareMigrationRefineArtifacts(args) {
|
|
|
95634
95643
|
}
|
|
95635
95644
|
function requireProjectRoot2(cwdOption) {
|
|
95636
95645
|
const root2 = resolveProjectCwd(cwdOption);
|
|
95637
|
-
if (!
|
|
95646
|
+
if (!fs35.existsSync(path38.join(root2, ".fimo.settings.json"))) {
|
|
95638
95647
|
console.error("You are not in a Fimo project. Run `fimo create` first or pass a project directory.");
|
|
95639
95648
|
return null;
|
|
95640
95649
|
}
|
|
@@ -95649,15 +95658,15 @@ function selectPagesForRefine(manifest, focusRoute) {
|
|
|
95649
95658
|
}
|
|
95650
95659
|
function writePageBrief(args) {
|
|
95651
95660
|
const { cwd, manifest, page, generatedArtifacts, mediaMap, written } = args;
|
|
95652
|
-
const sourceHtmlPath =
|
|
95653
|
-
const sourceHtml =
|
|
95661
|
+
const sourceHtmlPath = path38.join(cwd, page.artifacts.html);
|
|
95662
|
+
const sourceHtml = fs35.existsSync(sourceHtmlPath) ? fs35.readFileSync(sourceHtmlPath, "utf8") : "";
|
|
95654
95663
|
const outline = analyzeSourceHtml(sourceHtml, manifest.source.url);
|
|
95655
95664
|
const pageMedia = mediaMap.filter(
|
|
95656
95665
|
(asset) => outline.images.some((image) => normalizeUrlForMatch(image.src) === normalizeUrlForMatch(asset.sourceUrl))
|
|
95657
95666
|
);
|
|
95658
95667
|
const targetModule = resolveGeneratedPageModule(cwd, page.route, generatedArtifacts);
|
|
95659
95668
|
const currentTemplate = detectCurrentTemplate(targetModule);
|
|
95660
|
-
const briefPath =
|
|
95669
|
+
const briefPath = path38.join(PAGE_BRIEFS_DIR, `${routeToBriefFile(page.route)}.md`);
|
|
95661
95670
|
writeFile3(
|
|
95662
95671
|
cwd,
|
|
95663
95672
|
briefPath,
|
|
@@ -95665,7 +95674,7 @@ function writePageBrief(args) {
|
|
|
95665
95674
|
page,
|
|
95666
95675
|
manifest,
|
|
95667
95676
|
sourceHtmlPath: page.artifacts.html,
|
|
95668
|
-
targetModule: targetModule ? toPosix3(
|
|
95677
|
+
targetModule: targetModule ? toPosix3(path38.relative(cwd, targetModule)) : null,
|
|
95669
95678
|
currentTemplate,
|
|
95670
95679
|
outline,
|
|
95671
95680
|
pageMedia
|
|
@@ -95677,7 +95686,7 @@ function writePageBrief(args) {
|
|
|
95677
95686
|
title: page.title,
|
|
95678
95687
|
kind: page.kind,
|
|
95679
95688
|
sourceHtml: page.artifacts.html,
|
|
95680
|
-
targetModule: targetModule ? toPosix3(
|
|
95689
|
+
targetModule: targetModule ? toPosix3(path38.relative(cwd, targetModule)) : null,
|
|
95681
95690
|
currentTemplate,
|
|
95682
95691
|
briefPath,
|
|
95683
95692
|
headings: outline.headings,
|
|
@@ -95884,12 +95893,12 @@ function buildAgentPrompt(manifest, pageSummaries, focusRoute) {
|
|
|
95884
95893
|
].join("\n");
|
|
95885
95894
|
}
|
|
95886
95895
|
function readGeneratedArtifacts(cwd) {
|
|
95887
|
-
const artifactsPath =
|
|
95888
|
-
if (!
|
|
95896
|
+
const artifactsPath = path38.join(cwd, GENERATED_ARTIFACTS_PATH);
|
|
95897
|
+
if (!fs35.existsSync(artifactsPath)) {
|
|
95889
95898
|
return null;
|
|
95890
95899
|
}
|
|
95891
95900
|
try {
|
|
95892
|
-
return JSON.parse(
|
|
95901
|
+
return JSON.parse(fs35.readFileSync(artifactsPath, "utf8"));
|
|
95893
95902
|
} catch {
|
|
95894
95903
|
return null;
|
|
95895
95904
|
}
|
|
@@ -95899,12 +95908,12 @@ function readMediaMap(cwd, manifest) {
|
|
|
95899
95908
|
if (!mediaMapPath) {
|
|
95900
95909
|
return [];
|
|
95901
95910
|
}
|
|
95902
|
-
const fullPath =
|
|
95903
|
-
if (!
|
|
95911
|
+
const fullPath = path38.join(cwd, mediaMapPath);
|
|
95912
|
+
if (!fs35.existsSync(fullPath)) {
|
|
95904
95913
|
return [];
|
|
95905
95914
|
}
|
|
95906
95915
|
try {
|
|
95907
|
-
const parsed = JSON.parse(
|
|
95916
|
+
const parsed = JSON.parse(fs35.readFileSync(fullPath, "utf8"));
|
|
95908
95917
|
if (!Array.isArray(parsed)) {
|
|
95909
95918
|
return [];
|
|
95910
95919
|
}
|
|
@@ -95920,20 +95929,20 @@ function isRecord(value) {
|
|
|
95920
95929
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95921
95930
|
}
|
|
95922
95931
|
function resolveGeneratedPageModule(cwd, routePath, generatedArtifacts) {
|
|
95923
|
-
const expected =
|
|
95924
|
-
if (
|
|
95932
|
+
const expected = path38.join(cwd, "src", "pages", "migrated", `${pageComponentName2(routePath)}.tsx`);
|
|
95933
|
+
if (fs35.existsSync(expected)) {
|
|
95925
95934
|
return expected;
|
|
95926
95935
|
}
|
|
95927
95936
|
const pageFiles = generatedArtifacts?.pageFiles ?? [];
|
|
95928
95937
|
const expectedBase = `${pageComponentName2(routePath)}.tsx`;
|
|
95929
|
-
const fallback = pageFiles.map((relativePath) =>
|
|
95930
|
-
return fallback &&
|
|
95938
|
+
const fallback = pageFiles.map((relativePath) => path38.join(cwd, relativePath)).find((filePath) => path38.basename(filePath) === expectedBase);
|
|
95939
|
+
return fallback && fs35.existsSync(fallback) ? fallback : null;
|
|
95931
95940
|
}
|
|
95932
95941
|
function detectCurrentTemplate(targetModule) {
|
|
95933
|
-
if (!targetModule || !
|
|
95942
|
+
if (!targetModule || !fs35.existsSync(targetModule)) {
|
|
95934
95943
|
return "custom-or-missing";
|
|
95935
95944
|
}
|
|
95936
|
-
const source =
|
|
95945
|
+
const source = fs35.readFileSync(targetModule, "utf8");
|
|
95937
95946
|
return source.includes("MigrationPageTemplate") ? "generic-migration-template" : "custom-or-missing";
|
|
95938
95947
|
}
|
|
95939
95948
|
function routeToBriefFile(routePath) {
|
|
@@ -95978,9 +95987,9 @@ function absolutizeHref(value, baseUrl) {
|
|
|
95978
95987
|
}
|
|
95979
95988
|
}
|
|
95980
95989
|
function writeFile3(cwd, relativePath, content2, written) {
|
|
95981
|
-
const fullPath =
|
|
95982
|
-
|
|
95983
|
-
|
|
95990
|
+
const fullPath = path38.join(cwd, relativePath);
|
|
95991
|
+
fs35.mkdirSync(path38.dirname(fullPath), { recursive: true });
|
|
95992
|
+
fs35.writeFileSync(fullPath, content2, "utf8");
|
|
95984
95993
|
written.push(relativePath);
|
|
95985
95994
|
}
|
|
95986
95995
|
function unique3(values) {
|
|
@@ -96048,7 +96057,7 @@ function slugify3(value) {
|
|
|
96048
96057
|
return value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
96049
96058
|
}
|
|
96050
96059
|
function toPosix3(value) {
|
|
96051
|
-
return value.split(
|
|
96060
|
+
return value.split(path38.sep).join("/");
|
|
96052
96061
|
}
|
|
96053
96062
|
var REFINE_ROOT, PAGE_BRIEFS_DIR, GENERATED_ARTIFACTS_PATH;
|
|
96054
96063
|
var init_migrate_refine = __esm({
|
|
@@ -96057,9 +96066,9 @@ var init_migrate_refine = __esm({
|
|
|
96057
96066
|
init_esm12();
|
|
96058
96067
|
init_project();
|
|
96059
96068
|
init_migrate();
|
|
96060
|
-
REFINE_ROOT =
|
|
96061
|
-
PAGE_BRIEFS_DIR =
|
|
96062
|
-
GENERATED_ARTIFACTS_PATH =
|
|
96069
|
+
REFINE_ROOT = path38.join(MIGRATION_DIR2, "refine");
|
|
96070
|
+
PAGE_BRIEFS_DIR = path38.join(REFINE_ROOT, "pages");
|
|
96071
|
+
GENERATED_ARTIFACTS_PATH = path38.join(MIGRATION_DIR2, "generated", "artifacts.json");
|
|
96063
96072
|
__name(migrateRefineCommand, "migrateRefineCommand");
|
|
96064
96073
|
__name(prepareMigrationRefineArtifacts, "prepareMigrationRefineArtifacts");
|
|
96065
96074
|
__name(requireProjectRoot2, "requireProjectRoot");
|
|
@@ -96196,9 +96205,9 @@ async function localCodeSurface(cwd) {
|
|
|
96196
96205
|
const lines = out.split("\n").filter(Boolean);
|
|
96197
96206
|
const items = lines.map((line) => {
|
|
96198
96207
|
const code2 = line.slice(0, 2);
|
|
96199
|
-
const
|
|
96208
|
+
const path44 = line.slice(3).trim();
|
|
96200
96209
|
const verb = code2.startsWith("A") || code2.startsWith("?") ? "added" : code2.startsWith("D") ? "removed" : "changed";
|
|
96201
|
-
return { verb, key:
|
|
96210
|
+
return { verb, key: path44, origin: "local-uncommitted" };
|
|
96202
96211
|
});
|
|
96203
96212
|
return {
|
|
96204
96213
|
surface: "code",
|
|
@@ -96312,8 +96321,8 @@ var init_status = __esm({
|
|
|
96312
96321
|
|
|
96313
96322
|
// src/cli/index.ts
|
|
96314
96323
|
init_dist();
|
|
96315
|
-
import
|
|
96316
|
-
import
|
|
96324
|
+
import fs40 from "node:fs";
|
|
96325
|
+
import path43 from "node:path";
|
|
96317
96326
|
|
|
96318
96327
|
// ../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/esm.mjs
|
|
96319
96328
|
var import_index = __toESM(require_commander(), 1);
|
|
@@ -96506,8 +96515,8 @@ function parseYamlStrict(text3, file2, bundlePath) {
|
|
|
96506
96515
|
}
|
|
96507
96516
|
__name(parseYamlStrict, "parseYamlStrict");
|
|
96508
96517
|
function formatZodIssue(issue2) {
|
|
96509
|
-
const
|
|
96510
|
-
return `${
|
|
96518
|
+
const path44 = issue2.path.length === 0 ? "(root)" : issue2.path.join(".");
|
|
96519
|
+
return `${path44}: ${issue2.message}`;
|
|
96511
96520
|
}
|
|
96512
96521
|
__name(formatZodIssue, "formatZodIssue");
|
|
96513
96522
|
async function parseBundle(bundlePath, opts = {}) {
|
|
@@ -100465,8 +100474,8 @@ __name(creditsCommand, "creditsCommand");
|
|
|
100465
100474
|
init_dist6();
|
|
100466
100475
|
init_esm();
|
|
100467
100476
|
init_dist();
|
|
100468
|
-
import
|
|
100469
|
-
import
|
|
100477
|
+
import fs24 from "node:fs";
|
|
100478
|
+
import path29 from "node:path";
|
|
100470
100479
|
|
|
100471
100480
|
// src/scripts/lib/validation-report.ts
|
|
100472
100481
|
function skippedPhase(name, reason) {
|
|
@@ -100541,21 +100550,117 @@ __name(formatPhaseHuman, "formatPhaseHuman");
|
|
|
100541
100550
|
init_api();
|
|
100542
100551
|
init_config2();
|
|
100543
100552
|
init_auth_errors();
|
|
100553
|
+
|
|
100554
|
+
// src/cli/utils/dev-release.ts
|
|
100555
|
+
import fs19 from "node:fs";
|
|
100556
|
+
import path23 from "node:path";
|
|
100557
|
+
var DEP_FIELDS = ["dependencies", "devDependencies"];
|
|
100558
|
+
var FALLBACK_FIMO_DEP = "latest";
|
|
100559
|
+
function prepareDevFimoDependencyForDeploy(cwd) {
|
|
100560
|
+
const packagePath = path23.join(cwd, "package.json");
|
|
100561
|
+
if (!fs19.existsSync(packagePath)) {
|
|
100562
|
+
return null;
|
|
100563
|
+
}
|
|
100564
|
+
const original = fs19.readFileSync(packagePath, "utf8");
|
|
100565
|
+
const pkg = JSON.parse(original);
|
|
100566
|
+
const fileSpec = findLocalFimoSpec(pkg);
|
|
100567
|
+
if (!fileSpec) {
|
|
100568
|
+
return null;
|
|
100569
|
+
}
|
|
100570
|
+
const localPackageRoot = resolveFileSpec(fileSpec, cwd);
|
|
100571
|
+
const devJsonPath = findDevJson(localPackageRoot);
|
|
100572
|
+
const version2 = devJsonPath ? readDevReleaseState(devJsonPath).version : FALLBACK_FIMO_DEP;
|
|
100573
|
+
if (!version2) {
|
|
100574
|
+
throw new Error(`Missing "version" in ${devJsonPath}. Publish an experimental CLI build again.`);
|
|
100575
|
+
}
|
|
100576
|
+
const changed = replaceLocalFimoSpecs(pkg, version2);
|
|
100577
|
+
if (!changed) {
|
|
100578
|
+
return null;
|
|
100579
|
+
}
|
|
100580
|
+
fs19.writeFileSync(packagePath, JSON.stringify(pkg, null, 2) + "\n");
|
|
100581
|
+
return {
|
|
100582
|
+
devJsonPath,
|
|
100583
|
+
packagePath,
|
|
100584
|
+
version: version2,
|
|
100585
|
+
restore: /* @__PURE__ */ __name(() => fs19.writeFileSync(packagePath, original), "restore")
|
|
100586
|
+
};
|
|
100587
|
+
}
|
|
100588
|
+
__name(prepareDevFimoDependencyForDeploy, "prepareDevFimoDependencyForDeploy");
|
|
100589
|
+
function findLocalFimoSpec(pkg) {
|
|
100590
|
+
for (const field of DEP_FIELDS) {
|
|
100591
|
+
const spec = pkg[field]?.fimo;
|
|
100592
|
+
if (typeof spec === "string" && spec.startsWith("file:")) {
|
|
100593
|
+
return spec;
|
|
100594
|
+
}
|
|
100595
|
+
}
|
|
100596
|
+
return null;
|
|
100597
|
+
}
|
|
100598
|
+
__name(findLocalFimoSpec, "findLocalFimoSpec");
|
|
100599
|
+
function replaceLocalFimoSpecs(pkg, version2) {
|
|
100600
|
+
let changed = false;
|
|
100601
|
+
for (const field of DEP_FIELDS) {
|
|
100602
|
+
const deps = pkg[field];
|
|
100603
|
+
if (!deps) {
|
|
100604
|
+
continue;
|
|
100605
|
+
}
|
|
100606
|
+
const spec = deps.fimo;
|
|
100607
|
+
if (typeof spec === "string" && spec.startsWith("file:") && spec !== version2) {
|
|
100608
|
+
deps.fimo = version2;
|
|
100609
|
+
changed = true;
|
|
100610
|
+
}
|
|
100611
|
+
}
|
|
100612
|
+
return changed;
|
|
100613
|
+
}
|
|
100614
|
+
__name(replaceLocalFimoSpecs, "replaceLocalFimoSpecs");
|
|
100615
|
+
function resolveFileSpec(spec, cwd) {
|
|
100616
|
+
const rawPath = spec.slice("file:".length);
|
|
100617
|
+
const packagePath = path23.isAbsolute(rawPath) ? rawPath : path23.resolve(cwd, rawPath);
|
|
100618
|
+
return path23.resolve(packagePath);
|
|
100619
|
+
}
|
|
100620
|
+
__name(resolveFileSpec, "resolveFileSpec");
|
|
100621
|
+
function findDevJson(startPath) {
|
|
100622
|
+
let current = startPath;
|
|
100623
|
+
while (true) {
|
|
100624
|
+
const candidate = path23.join(current, ".fimo", "dev.json");
|
|
100625
|
+
if (fs19.existsSync(candidate)) {
|
|
100626
|
+
return candidate;
|
|
100627
|
+
}
|
|
100628
|
+
const parent2 = path23.dirname(current);
|
|
100629
|
+
if (parent2 === current) {
|
|
100630
|
+
return null;
|
|
100631
|
+
}
|
|
100632
|
+
current = parent2;
|
|
100633
|
+
}
|
|
100634
|
+
}
|
|
100635
|
+
__name(findDevJson, "findDevJson");
|
|
100636
|
+
function readDevReleaseState(devJsonPath) {
|
|
100637
|
+
const parsed = JSON.parse(fs19.readFileSync(devJsonPath, "utf8"));
|
|
100638
|
+
if (typeof parsed.version !== "string" || parsed.version.trim().length === 0) {
|
|
100639
|
+
return { version: "", channel: null };
|
|
100640
|
+
}
|
|
100641
|
+
return {
|
|
100642
|
+
version: parsed.version.trim(),
|
|
100643
|
+
channel: typeof parsed.channel === "string" && parsed.channel.trim() ? parsed.channel.trim() : null
|
|
100644
|
+
};
|
|
100645
|
+
}
|
|
100646
|
+
__name(readDevReleaseState, "readDevReleaseState");
|
|
100647
|
+
|
|
100648
|
+
// src/cli/commands/deploy.ts
|
|
100544
100649
|
init_git_credential_setup();
|
|
100545
100650
|
init_git();
|
|
100546
100651
|
init_interactive();
|
|
100547
100652
|
init_project_context();
|
|
100548
100653
|
|
|
100549
100654
|
// src/cli/commands/validate.ts
|
|
100550
|
-
import
|
|
100655
|
+
import path28 from "node:path";
|
|
100551
100656
|
init_dist();
|
|
100552
100657
|
init_extract_translations();
|
|
100553
100658
|
init_sync_forms();
|
|
100554
100659
|
init_sync_schemas();
|
|
100555
100660
|
|
|
100556
100661
|
// src/scripts/validate-route-metadata.ts
|
|
100557
|
-
import
|
|
100558
|
-
import
|
|
100662
|
+
import fs21 from "node:fs";
|
|
100663
|
+
import path25 from "node:path";
|
|
100559
100664
|
|
|
100560
100665
|
// src/scripts/lib/parse-routes-file.ts
|
|
100561
100666
|
function parseRoutesSource(source) {
|
|
@@ -100603,7 +100708,7 @@ __name(parseRoutesSource, "parseRoutesSource");
|
|
|
100603
100708
|
// src/scripts/validate-route-metadata.ts
|
|
100604
100709
|
function readJson(filePath) {
|
|
100605
100710
|
try {
|
|
100606
|
-
return JSON.parse(
|
|
100711
|
+
return JSON.parse(fs21.readFileSync(filePath, "utf-8"));
|
|
100607
100712
|
} catch {
|
|
100608
100713
|
return {};
|
|
100609
100714
|
}
|
|
@@ -100629,15 +100734,15 @@ function loadConfigRoutes(config2) {
|
|
|
100629
100734
|
__name(loadConfigRoutes, "loadConfigRoutes");
|
|
100630
100735
|
function validateRouteMetadata(options = {}) {
|
|
100631
100736
|
const cwd = options.cwd ?? process.cwd();
|
|
100632
|
-
const configFilePath =
|
|
100633
|
-
const srcDir =
|
|
100634
|
-
const routesFilePath =
|
|
100737
|
+
const configFilePath = path25.resolve(cwd, "fimo-config.json");
|
|
100738
|
+
const srcDir = path25.resolve(cwd, "src");
|
|
100739
|
+
const routesFilePath = path25.resolve(srcDir, "routes.ts");
|
|
100635
100740
|
const errors2 = [];
|
|
100636
100741
|
let fileRoutes = [];
|
|
100637
|
-
if (!
|
|
100742
|
+
if (!fs21.existsSync(routesFilePath)) {
|
|
100638
100743
|
errors2.push("Missing src/routes.ts.");
|
|
100639
100744
|
} else {
|
|
100640
|
-
const source =
|
|
100745
|
+
const source = fs21.readFileSync(routesFilePath, "utf-8");
|
|
100641
100746
|
fileRoutes = parseRoutesSource(source);
|
|
100642
100747
|
}
|
|
100643
100748
|
const pathToFile = /* @__PURE__ */ new Map();
|
|
@@ -100683,8 +100788,8 @@ Fix: add the route to src/routes.ts. Example: route('${route.path.replace(/^\//,
|
|
|
100683
100788
|
if (!file2) {
|
|
100684
100789
|
continue;
|
|
100685
100790
|
}
|
|
100686
|
-
const routeModulePath =
|
|
100687
|
-
if (!
|
|
100791
|
+
const routeModulePath = path25.resolve(srcDir, file2);
|
|
100792
|
+
if (!fs21.existsSync(routeModulePath)) {
|
|
100688
100793
|
errors2.push(
|
|
100689
100794
|
`Route "${route.id}" (${route.path}) references missing module "${file2}".
|
|
100690
100795
|
Fix: create the file at src/${file2}.`
|
|
@@ -100766,11 +100871,11 @@ import { existsSync as existsSync9, readFileSync as readFileSync8, readdirSync a
|
|
|
100766
100871
|
import { join as join11, resolve as resolve5 } from "node:path";
|
|
100767
100872
|
|
|
100768
100873
|
// src/scripts/export-static.ts
|
|
100769
|
-
import
|
|
100770
|
-
import
|
|
100874
|
+
import fs22 from "node:fs/promises";
|
|
100875
|
+
import path26 from "node:path";
|
|
100771
100876
|
async function pathExists(targetPath) {
|
|
100772
100877
|
try {
|
|
100773
|
-
await
|
|
100878
|
+
await fs22.access(targetPath);
|
|
100774
100879
|
return true;
|
|
100775
100880
|
} catch {
|
|
100776
100881
|
return false;
|
|
@@ -100778,26 +100883,26 @@ async function pathExists(targetPath) {
|
|
|
100778
100883
|
}
|
|
100779
100884
|
__name(pathExists, "pathExists");
|
|
100780
100885
|
async function removeDataFiles(dir) {
|
|
100781
|
-
const entries2 = await
|
|
100886
|
+
const entries2 = await fs22.readdir(dir, { withFileTypes: true });
|
|
100782
100887
|
for (const entry of entries2) {
|
|
100783
|
-
const fullPath =
|
|
100888
|
+
const fullPath = path26.join(dir, entry.name);
|
|
100784
100889
|
if (entry.isDirectory()) {
|
|
100785
100890
|
await removeDataFiles(fullPath);
|
|
100786
100891
|
} else if (entry.name.endsWith(".data")) {
|
|
100787
|
-
await
|
|
100892
|
+
await fs22.rm(fullPath);
|
|
100788
100893
|
}
|
|
100789
100894
|
}
|
|
100790
100895
|
}
|
|
100791
100896
|
__name(removeDataFiles, "removeDataFiles");
|
|
100792
100897
|
async function exportStatic(options = {}) {
|
|
100793
100898
|
const cwd = options.cwd ?? process.cwd();
|
|
100794
|
-
const clientDir =
|
|
100795
|
-
const serverDir =
|
|
100899
|
+
const clientDir = path26.resolve(cwd, "dist/client");
|
|
100900
|
+
const serverDir = path26.resolve(cwd, "dist/server");
|
|
100796
100901
|
if (!await pathExists(clientDir)) {
|
|
100797
100902
|
throw new Error("Missing dist/client output. Run `react-router build` first.");
|
|
100798
100903
|
}
|
|
100799
100904
|
if (await pathExists(serverDir)) {
|
|
100800
|
-
await
|
|
100905
|
+
await fs22.rm(serverDir, { recursive: true, force: true });
|
|
100801
100906
|
}
|
|
100802
100907
|
await removeDataFiles(clientDir);
|
|
100803
100908
|
console.log("Static export complete.");
|
|
@@ -101079,8 +101184,8 @@ if (isStandalone) {
|
|
|
101079
101184
|
}
|
|
101080
101185
|
|
|
101081
101186
|
// src/scripts/resolve-routes.ts
|
|
101082
|
-
import
|
|
101083
|
-
import
|
|
101187
|
+
import fs23 from "node:fs";
|
|
101188
|
+
import path27 from "node:path";
|
|
101084
101189
|
var SCAN_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs"];
|
|
101085
101190
|
var SCAN_EXTENSIONS_SET = new Set(SCAN_EXTENSIONS);
|
|
101086
101191
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", "dist", ".next", ".fimo", ".git", "public"]);
|
|
@@ -101103,18 +101208,18 @@ function isGlobalFile(filePath) {
|
|
|
101103
101208
|
__name(isGlobalFile, "isGlobalFile");
|
|
101104
101209
|
function collectFiles(dir) {
|
|
101105
101210
|
const files = [];
|
|
101106
|
-
if (!
|
|
101211
|
+
if (!fs23.existsSync(dir)) {
|
|
101107
101212
|
return files;
|
|
101108
101213
|
}
|
|
101109
|
-
const entries2 =
|
|
101214
|
+
const entries2 = fs23.readdirSync(dir, { withFileTypes: true });
|
|
101110
101215
|
for (const entry of entries2) {
|
|
101111
101216
|
if (SKIP_DIRS.has(entry.name)) {
|
|
101112
101217
|
continue;
|
|
101113
101218
|
}
|
|
101114
|
-
const fullPath =
|
|
101219
|
+
const fullPath = path27.join(dir, entry.name);
|
|
101115
101220
|
if (entry.isDirectory()) {
|
|
101116
101221
|
files.push(...collectFiles(fullPath));
|
|
101117
|
-
} else if (SCAN_EXTENSIONS_SET.has(
|
|
101222
|
+
} else if (SCAN_EXTENSIONS_SET.has(path27.extname(entry.name))) {
|
|
101118
101223
|
files.push(fullPath);
|
|
101119
101224
|
}
|
|
101120
101225
|
}
|
|
@@ -101141,24 +101246,24 @@ __name(extractImports, "extractImports");
|
|
|
101141
101246
|
function resolveImport(specifier, fromDir, srcDir) {
|
|
101142
101247
|
let targetPath;
|
|
101143
101248
|
if (specifier.startsWith("@/")) {
|
|
101144
|
-
targetPath =
|
|
101249
|
+
targetPath = path27.resolve(srcDir, specifier.slice(2));
|
|
101145
101250
|
} else if (specifier.startsWith(".")) {
|
|
101146
|
-
targetPath =
|
|
101251
|
+
targetPath = path27.resolve(fromDir, specifier);
|
|
101147
101252
|
} else {
|
|
101148
101253
|
return null;
|
|
101149
101254
|
}
|
|
101150
|
-
if (
|
|
101255
|
+
if (fs23.existsSync(targetPath) && fs23.statSync(targetPath).isFile()) {
|
|
101151
101256
|
return targetPath;
|
|
101152
101257
|
}
|
|
101153
101258
|
for (const ext of SCAN_EXTENSIONS) {
|
|
101154
101259
|
const withExt = targetPath + ext;
|
|
101155
|
-
if (
|
|
101260
|
+
if (fs23.existsSync(withExt)) {
|
|
101156
101261
|
return withExt;
|
|
101157
101262
|
}
|
|
101158
101263
|
}
|
|
101159
101264
|
for (const ext of SCAN_EXTENSIONS) {
|
|
101160
|
-
const indexFile =
|
|
101161
|
-
if (
|
|
101265
|
+
const indexFile = path27.join(targetPath, "index" + ext);
|
|
101266
|
+
if (fs23.existsSync(indexFile)) {
|
|
101162
101267
|
return indexFile;
|
|
101163
101268
|
}
|
|
101164
101269
|
}
|
|
@@ -101166,11 +101271,11 @@ function resolveImport(specifier, fromDir, srcDir) {
|
|
|
101166
101271
|
}
|
|
101167
101272
|
__name(resolveImport, "resolveImport");
|
|
101168
101273
|
function discoverRoutes(srcDir, root2) {
|
|
101169
|
-
const routesFilePath =
|
|
101170
|
-
if (!
|
|
101274
|
+
const routesFilePath = path27.resolve(srcDir, "routes.ts");
|
|
101275
|
+
if (!fs23.existsSync(routesFilePath)) {
|
|
101171
101276
|
return /* @__PURE__ */ new Map();
|
|
101172
101277
|
}
|
|
101173
|
-
const source =
|
|
101278
|
+
const source = fs23.readFileSync(routesFilePath, "utf-8");
|
|
101174
101279
|
const parsed = parseRoutesSource(source);
|
|
101175
101280
|
const fileToRoutes = /* @__PURE__ */ new Map();
|
|
101176
101281
|
for (const r of parsed) {
|
|
@@ -101181,7 +101286,7 @@ function discoverRoutes(srcDir, root2) {
|
|
|
101181
101286
|
if (!resolved) {
|
|
101182
101287
|
continue;
|
|
101183
101288
|
}
|
|
101184
|
-
const rel =
|
|
101289
|
+
const rel = path27.relative(root2, resolved);
|
|
101185
101290
|
if (!fileToRoutes.has(rel)) {
|
|
101186
101291
|
fileToRoutes.set(rel, /* @__PURE__ */ new Set());
|
|
101187
101292
|
}
|
|
@@ -101196,18 +101301,18 @@ function buildReverseImportGraph(srcDir, root2) {
|
|
|
101196
101301
|
for (const filePath of allFiles) {
|
|
101197
101302
|
let content2;
|
|
101198
101303
|
try {
|
|
101199
|
-
content2 =
|
|
101304
|
+
content2 = fs23.readFileSync(filePath, "utf-8");
|
|
101200
101305
|
} catch {
|
|
101201
101306
|
continue;
|
|
101202
101307
|
}
|
|
101203
101308
|
const imports = extractImports(content2);
|
|
101204
101309
|
for (const specifier of imports) {
|
|
101205
|
-
const resolved = resolveImport(specifier,
|
|
101310
|
+
const resolved = resolveImport(specifier, path27.dirname(filePath), srcDir);
|
|
101206
101311
|
if (!resolved) {
|
|
101207
101312
|
continue;
|
|
101208
101313
|
}
|
|
101209
|
-
const resolvedRel =
|
|
101210
|
-
const importerRel =
|
|
101314
|
+
const resolvedRel = path27.relative(root2, resolved);
|
|
101315
|
+
const importerRel = path27.relative(root2, filePath);
|
|
101211
101316
|
if (!fileToImporters.has(resolvedRel)) {
|
|
101212
101317
|
fileToImporters.set(resolvedRel, /* @__PURE__ */ new Set());
|
|
101213
101318
|
}
|
|
@@ -101247,7 +101352,7 @@ function resolveAffectedRoutes(file2, fileToImporters, fileToRoutes) {
|
|
|
101247
101352
|
__name(resolveAffectedRoutes, "resolveAffectedRoutes");
|
|
101248
101353
|
function resolveRoutes(changedFiles, options = {}) {
|
|
101249
101354
|
const root2 = options.cwd ?? process.cwd();
|
|
101250
|
-
const srcDir =
|
|
101355
|
+
const srcDir = path27.resolve(root2, "src");
|
|
101251
101356
|
const normalizedChangedFiles = changedFiles.map((f) => f.replace(/^\/+/, ""));
|
|
101252
101357
|
if (normalizedChangedFiles.length === 0) {
|
|
101253
101358
|
return { routeMap: {}, routes: [], unresolvedFiles: [] };
|
|
@@ -101531,7 +101636,7 @@ async function runAgentIntegrationAvailabilityCheck(opts) {
|
|
|
101531
101636
|
} catch {
|
|
101532
101637
|
return [];
|
|
101533
101638
|
}
|
|
101534
|
-
const bundles = await listBundles(
|
|
101639
|
+
const bundles = await listBundles(path28.join(projectRoot, "agents"));
|
|
101535
101640
|
const requiredByAgent = bundles.map((bundle) => {
|
|
101536
101641
|
const policy = agentIntegrationPolicy(bundle.config);
|
|
101537
101642
|
return {
|
|
@@ -101611,7 +101716,7 @@ async function runAgentSecretAvailabilityCheck(opts) {
|
|
|
101611
101716
|
} catch {
|
|
101612
101717
|
return [];
|
|
101613
101718
|
}
|
|
101614
|
-
const bundles = await listBundles(
|
|
101719
|
+
const bundles = await listBundles(path28.join(projectRoot, "agents"));
|
|
101615
101720
|
const requiredByAgent = bundles.map((bundle) => ({
|
|
101616
101721
|
name: bundle.name,
|
|
101617
101722
|
keys: (bundle.config.secrets ?? []).filter((secret) => secret.required !== false).map((secret) => secret.key)
|
|
@@ -101742,9 +101847,9 @@ __name(runSyncPhase, "runSyncPhase");
|
|
|
101742
101847
|
|
|
101743
101848
|
// src/cli/commands/deploy.ts
|
|
101744
101849
|
async function deployCommand(options, cmd) {
|
|
101745
|
-
const cwd =
|
|
101746
|
-
const fimoPath =
|
|
101747
|
-
if (!
|
|
101850
|
+
const cwd = path29.resolve(options.cwd ?? process.cwd());
|
|
101851
|
+
const fimoPath = path29.join(cwd, ".fimo.settings.json");
|
|
101852
|
+
if (!fs24.existsSync(fimoPath)) {
|
|
101748
101853
|
ui.error({
|
|
101749
101854
|
command: "deploy",
|
|
101750
101855
|
code: "NOT_IN_PROJECT",
|
|
@@ -101753,7 +101858,7 @@ async function deployCommand(options, cmd) {
|
|
|
101753
101858
|
});
|
|
101754
101859
|
return;
|
|
101755
101860
|
}
|
|
101756
|
-
const local = JSON.parse(
|
|
101861
|
+
const local = JSON.parse(fs24.readFileSync(fimoPath, "utf-8"));
|
|
101757
101862
|
if (!await isGitRepo(cwd)) {
|
|
101758
101863
|
ui.error({ command: "deploy", code: "NOT_A_GIT_REPO", message: "Not a git repository." });
|
|
101759
101864
|
return;
|
|
@@ -101811,46 +101916,64 @@ async function deployCommand(options, cmd) {
|
|
|
101811
101916
|
} else {
|
|
101812
101917
|
validateSp.succeed("Validation passed");
|
|
101813
101918
|
}
|
|
101814
|
-
|
|
101815
|
-
let message;
|
|
101816
|
-
if (options.message !== void 0) {
|
|
101817
|
-
message = options.message;
|
|
101818
|
-
} else {
|
|
101819
|
-
assertInteractive('Pass -m "<message>" or commit your changes manually.', "deploy");
|
|
101820
|
-
if (isPretty2) {
|
|
101821
|
-
O2.warn("You have uncommitted changes. Commit them before deploying.");
|
|
101822
|
-
}
|
|
101823
|
-
const answer = await Ot({
|
|
101824
|
-
message: "Commit message",
|
|
101825
|
-
placeholder: "Deploy",
|
|
101826
|
-
defaultValue: "Deploy"
|
|
101827
|
-
});
|
|
101828
|
-
if (q(answer)) {
|
|
101829
|
-
ui.info({ command: "deploy", message: "Cancelled." });
|
|
101830
|
-
return;
|
|
101831
|
-
}
|
|
101832
|
-
message = String(answer);
|
|
101833
|
-
}
|
|
101834
|
-
const commitSp = spinner("Committing pending changes");
|
|
101835
|
-
await runGit2(["add", "-A"], cwd);
|
|
101836
|
-
await runGit2(["commit", "-m", message], cwd);
|
|
101837
|
-
commitSp.succeed("Changes committed");
|
|
101838
|
-
}
|
|
101839
|
-
const remoteSp = spinner("Refreshing git remote URL");
|
|
101840
|
-
const remote = await api.getGitRemote(local.projectId, ctx.env);
|
|
101841
|
-
await ensureFimoRemote(cwd, remote.url);
|
|
101842
|
-
const remoteBranch = remote.branch;
|
|
101843
|
-
remoteSp.succeed(`Remote ready (branch ${remoteBranch})`);
|
|
101844
|
-
const pushSp = spinner(`Pushing to fimo/${remoteBranch}`);
|
|
101919
|
+
let devFimoDependency = null;
|
|
101845
101920
|
try {
|
|
101846
|
-
|
|
101847
|
-
pushSp.succeed("Pushed to Fimo");
|
|
101921
|
+
devFimoDependency = prepareDevFimoDependencyForDeploy(cwd);
|
|
101848
101922
|
} catch (error45) {
|
|
101849
|
-
|
|
101850
|
-
|
|
101851
|
-
|
|
101923
|
+
ui.error({
|
|
101924
|
+
command: "deploy",
|
|
101925
|
+
code: "DEV_FIMO_VERSION_MISSING",
|
|
101926
|
+
message: errorMessage(error45)
|
|
101927
|
+
});
|
|
101852
101928
|
return;
|
|
101853
101929
|
}
|
|
101930
|
+
if (devFimoDependency && isPretty2) {
|
|
101931
|
+
O2.info(`Deploying with fimo ${devFimoDependency.version}; restoring local file: dependency after push.`);
|
|
101932
|
+
}
|
|
101933
|
+
try {
|
|
101934
|
+
if (await hasUncommittedChanges(cwd)) {
|
|
101935
|
+
let message;
|
|
101936
|
+
if (options.message !== void 0) {
|
|
101937
|
+
message = options.message;
|
|
101938
|
+
} else {
|
|
101939
|
+
assertInteractive('Pass -m "<message>" or commit your changes manually.', "deploy");
|
|
101940
|
+
if (isPretty2) {
|
|
101941
|
+
O2.warn("You have uncommitted changes. Commit them before deploying.");
|
|
101942
|
+
}
|
|
101943
|
+
const answer = await Ot({
|
|
101944
|
+
message: "Commit message",
|
|
101945
|
+
placeholder: "Deploy",
|
|
101946
|
+
defaultValue: "Deploy"
|
|
101947
|
+
});
|
|
101948
|
+
if (q(answer)) {
|
|
101949
|
+
ui.info({ command: "deploy", message: "Cancelled." });
|
|
101950
|
+
return;
|
|
101951
|
+
}
|
|
101952
|
+
message = String(answer);
|
|
101953
|
+
}
|
|
101954
|
+
const commitSp = spinner("Committing pending changes");
|
|
101955
|
+
await runGit2(["add", "-A"], cwd);
|
|
101956
|
+
await runGit2(["commit", "-m", message], cwd);
|
|
101957
|
+
commitSp.succeed("Changes committed");
|
|
101958
|
+
}
|
|
101959
|
+
const remoteSp = spinner("Refreshing git remote URL");
|
|
101960
|
+
const remote = await api.getGitRemote(local.projectId, ctx.env);
|
|
101961
|
+
await ensureFimoRemote(cwd, remote.url);
|
|
101962
|
+
const remoteBranch = remote.branch;
|
|
101963
|
+
remoteSp.succeed(`Remote ready (branch ${remoteBranch})`);
|
|
101964
|
+
const pushSp = spinner(`Pushing to fimo/${remoteBranch}`);
|
|
101965
|
+
try {
|
|
101966
|
+
await runGit2(["push", "fimo", `HEAD:${remoteBranch}`], cwd);
|
|
101967
|
+
pushSp.succeed("Pushed to Fimo");
|
|
101968
|
+
} catch (error45) {
|
|
101969
|
+
pushSp.fail("Push failed");
|
|
101970
|
+
const failure = classifyPushError(error45);
|
|
101971
|
+
emitPushFailure(failure, remoteBranch);
|
|
101972
|
+
return;
|
|
101973
|
+
}
|
|
101974
|
+
} finally {
|
|
101975
|
+
devFimoDependency?.restore();
|
|
101976
|
+
}
|
|
101854
101977
|
let stepLabel = "";
|
|
101855
101978
|
let stepStartedAt = 0;
|
|
101856
101979
|
let stepSp = null;
|
|
@@ -102021,8 +102144,8 @@ __name(errorMessage, "errorMessage");
|
|
|
102021
102144
|
// src/cli/commands/describe.ts
|
|
102022
102145
|
init_dist();
|
|
102023
102146
|
init_project();
|
|
102024
|
-
import
|
|
102025
|
-
import
|
|
102147
|
+
import fs25 from "node:fs";
|
|
102148
|
+
import path30 from "node:path";
|
|
102026
102149
|
var DEFAULT_DEPTH = 3;
|
|
102027
102150
|
var HARD_ENTRY_CAP = 1e4;
|
|
102028
102151
|
var WIDE_DIR_THRESHOLD = 20;
|
|
@@ -102041,7 +102164,7 @@ async function describeCommand(targetPath, options) {
|
|
|
102041
102164
|
const cwd = resolveProjectCwd(options.cwd);
|
|
102042
102165
|
const full = options.full === true;
|
|
102043
102166
|
const depth = full ? Number.POSITIVE_INFINITY : parseDepth(options.depth);
|
|
102044
|
-
const scope = targetPath ?
|
|
102167
|
+
const scope = targetPath ? path30.resolve(cwd, targetPath) : null;
|
|
102045
102168
|
const description = buildDescription({ cwd, depth, scope });
|
|
102046
102169
|
ui.result({
|
|
102047
102170
|
command: "describe",
|
|
@@ -102059,9 +102182,9 @@ function parseDepth(raw) {
|
|
|
102059
102182
|
__name(parseDepth, "parseDepth");
|
|
102060
102183
|
function buildDescription(opts) {
|
|
102061
102184
|
const { cwd, depth, scope } = opts;
|
|
102062
|
-
const packageJson = readJsonSafe(
|
|
102063
|
-
const fimoConfig = readJsonSafe(
|
|
102064
|
-
const projectName = packageJson?.name ??
|
|
102185
|
+
const packageJson = readJsonSafe(path30.join(cwd, "package.json"));
|
|
102186
|
+
const fimoConfig = readJsonSafe(path30.join(cwd, "fimo-config.json"));
|
|
102187
|
+
const projectName = packageJson?.name ?? path30.basename(cwd);
|
|
102065
102188
|
const configVersion = fimoConfig?.version != null ? String(fimoConfig.version) : null;
|
|
102066
102189
|
return {
|
|
102067
102190
|
project: { name: projectName, version: configVersion },
|
|
@@ -102077,7 +102200,7 @@ function buildDescription(opts) {
|
|
|
102077
102200
|
__name(buildDescription, "buildDescription");
|
|
102078
102201
|
function readJsonSafe(filePath) {
|
|
102079
102202
|
try {
|
|
102080
|
-
return JSON.parse(
|
|
102203
|
+
return JSON.parse(fs25.readFileSync(filePath, "utf-8"));
|
|
102081
102204
|
} catch {
|
|
102082
102205
|
return null;
|
|
102083
102206
|
}
|
|
@@ -102116,10 +102239,10 @@ function normalizeVersion(raw) {
|
|
|
102116
102239
|
}
|
|
102117
102240
|
__name(normalizeVersion, "normalizeVersion");
|
|
102118
102241
|
function detectPackageManager2(cwd) {
|
|
102119
|
-
if (
|
|
102120
|
-
if (
|
|
102121
|
-
if (
|
|
102122
|
-
if (
|
|
102242
|
+
if (fs25.existsSync(path30.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
102243
|
+
if (fs25.existsSync(path30.join(cwd, "bun.lockb"))) return "bun";
|
|
102244
|
+
if (fs25.existsSync(path30.join(cwd, "yarn.lock"))) return "yarn";
|
|
102245
|
+
if (fs25.existsSync(path30.join(cwd, "package-lock.json"))) return "npm";
|
|
102123
102246
|
return "unknown";
|
|
102124
102247
|
}
|
|
102125
102248
|
__name(detectPackageManager2, "detectPackageManager");
|
|
@@ -102129,16 +102252,16 @@ function countRoutes(config2) {
|
|
|
102129
102252
|
}
|
|
102130
102253
|
__name(countRoutes, "countRoutes");
|
|
102131
102254
|
function collectSchemas(cwd) {
|
|
102132
|
-
const dir =
|
|
102133
|
-
if (!
|
|
102134
|
-
const names =
|
|
102255
|
+
const dir = path30.join(cwd, "src", "schemas");
|
|
102256
|
+
if (!fs25.existsSync(dir)) return { count: 0, names: [] };
|
|
102257
|
+
const names = fs25.readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, "")).sort();
|
|
102135
102258
|
return { count: names.length, names };
|
|
102136
102259
|
}
|
|
102137
102260
|
__name(collectSchemas, "collectSchemas");
|
|
102138
102261
|
function collectLocales(cwd, config2) {
|
|
102139
|
-
const translationsDir =
|
|
102140
|
-
if (
|
|
102141
|
-
const fromDir =
|
|
102262
|
+
const translationsDir = path30.join(cwd, "translations");
|
|
102263
|
+
if (fs25.existsSync(translationsDir)) {
|
|
102264
|
+
const fromDir = fs25.readdirSync(translationsDir).filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, "")).sort();
|
|
102142
102265
|
if (fromDir.length > 0) return fromDir;
|
|
102143
102266
|
}
|
|
102144
102267
|
if (config2?.seo?.locales?.length) return [...config2.seo.locales].sort();
|
|
@@ -102149,11 +102272,11 @@ __name(collectLocales, "collectLocales");
|
|
|
102149
102272
|
function walkTree(opts) {
|
|
102150
102273
|
const { cwd, depth, scope } = opts;
|
|
102151
102274
|
const root2 = scope ?? cwd;
|
|
102152
|
-
if (!
|
|
102275
|
+
if (!fs25.existsSync(root2) || !fs25.statSync(root2).isDirectory()) {
|
|
102153
102276
|
return {
|
|
102154
102277
|
entries: [],
|
|
102155
102278
|
depth,
|
|
102156
|
-
scope: scope ?
|
|
102279
|
+
scope: scope ? path30.relative(cwd, scope) : null,
|
|
102157
102280
|
cappedToDepth1: false,
|
|
102158
102281
|
totalEntries: 0
|
|
102159
102282
|
};
|
|
@@ -102167,7 +102290,7 @@ function walkTree(opts) {
|
|
|
102167
102290
|
return {
|
|
102168
102291
|
entries: cappedEntries,
|
|
102169
102292
|
depth: 1,
|
|
102170
|
-
scope: scope ?
|
|
102293
|
+
scope: scope ? path30.relative(cwd, scope) : null,
|
|
102171
102294
|
cappedToDepth1: true,
|
|
102172
102295
|
totalEntries: counter.count
|
|
102173
102296
|
};
|
|
@@ -102175,7 +102298,7 @@ function walkTree(opts) {
|
|
|
102175
102298
|
return {
|
|
102176
102299
|
entries: entries2,
|
|
102177
102300
|
depth,
|
|
102178
|
-
scope: scope ?
|
|
102301
|
+
scope: scope ? path30.relative(cwd, scope) : null,
|
|
102179
102302
|
cappedToDepth1: false,
|
|
102180
102303
|
totalEntries: counter.count
|
|
102181
102304
|
};
|
|
@@ -102185,7 +102308,7 @@ function walkDir(dir, depthRemaining, counter) {
|
|
|
102185
102308
|
if (counter.capped) return [];
|
|
102186
102309
|
let names;
|
|
102187
102310
|
try {
|
|
102188
|
-
names =
|
|
102311
|
+
names = fs25.readdirSync(dir);
|
|
102189
102312
|
} catch {
|
|
102190
102313
|
return [];
|
|
102191
102314
|
}
|
|
@@ -102198,7 +102321,7 @@ function walkDir(dir, depthRemaining, counter) {
|
|
|
102198
102321
|
}
|
|
102199
102322
|
let stat2;
|
|
102200
102323
|
try {
|
|
102201
|
-
stat2 =
|
|
102324
|
+
stat2 = fs25.statSync(path30.join(dir, name));
|
|
102202
102325
|
} catch {
|
|
102203
102326
|
continue;
|
|
102204
102327
|
}
|
|
@@ -102219,10 +102342,10 @@ function walkDir(dir, depthRemaining, counter) {
|
|
|
102219
102342
|
break;
|
|
102220
102343
|
}
|
|
102221
102344
|
if (depthRemaining > 1) {
|
|
102222
|
-
const childEntries = walkDir(
|
|
102345
|
+
const childEntries = walkDir(path30.join(dir, name), depthRemaining - 1, counter);
|
|
102223
102346
|
result.push({ name, type: "dir", children: childEntries });
|
|
102224
102347
|
} else {
|
|
102225
|
-
const childCount = safeCountChildren(
|
|
102348
|
+
const childCount = safeCountChildren(path30.join(dir, name));
|
|
102226
102349
|
result.push({
|
|
102227
102350
|
name,
|
|
102228
102351
|
type: "dir",
|
|
@@ -102260,7 +102383,7 @@ function walkDir(dir, depthRemaining, counter) {
|
|
|
102260
102383
|
__name(walkDir, "walkDir");
|
|
102261
102384
|
function safeCountChildren(dir) {
|
|
102262
102385
|
try {
|
|
102263
|
-
return
|
|
102386
|
+
return fs25.readdirSync(dir).filter((n) => !ALWAYS_SKIP_DIRS.has(n) && !n.startsWith(".")).length;
|
|
102264
102387
|
} catch {
|
|
102265
102388
|
return 0;
|
|
102266
102389
|
}
|
|
@@ -102944,30 +103067,30 @@ init_dist();
|
|
|
102944
103067
|
// ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
|
|
102945
103068
|
import process7 from "node:process";
|
|
102946
103069
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
102947
|
-
import
|
|
103070
|
+
import path31 from "node:path";
|
|
102948
103071
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
102949
103072
|
import { promisify as promisify8 } from "node:util";
|
|
102950
103073
|
import childProcess from "node:child_process";
|
|
102951
|
-
import
|
|
103074
|
+
import fs30, { constants as fsConstants2 } from "node:fs/promises";
|
|
102952
103075
|
|
|
102953
103076
|
// ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
|
|
102954
103077
|
import process3 from "node:process";
|
|
102955
|
-
import
|
|
103078
|
+
import fs29, { constants as fsConstants } from "node:fs/promises";
|
|
102956
103079
|
|
|
102957
103080
|
// ../../node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js
|
|
102958
103081
|
import process2 from "node:process";
|
|
102959
103082
|
import os2 from "node:os";
|
|
102960
|
-
import
|
|
103083
|
+
import fs28 from "node:fs";
|
|
102961
103084
|
|
|
102962
103085
|
// ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
|
|
102963
|
-
import
|
|
103086
|
+
import fs27 from "node:fs";
|
|
102964
103087
|
|
|
102965
103088
|
// ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
102966
|
-
import
|
|
103089
|
+
import fs26 from "node:fs";
|
|
102967
103090
|
var isDockerCached;
|
|
102968
103091
|
function hasDockerEnv() {
|
|
102969
103092
|
try {
|
|
102970
|
-
|
|
103093
|
+
fs26.statSync("/.dockerenv");
|
|
102971
103094
|
return true;
|
|
102972
103095
|
} catch {
|
|
102973
103096
|
return false;
|
|
@@ -102976,7 +103099,7 @@ function hasDockerEnv() {
|
|
|
102976
103099
|
__name(hasDockerEnv, "hasDockerEnv");
|
|
102977
103100
|
function hasDockerCGroup() {
|
|
102978
103101
|
try {
|
|
102979
|
-
return
|
|
103102
|
+
return fs26.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
102980
103103
|
} catch {
|
|
102981
103104
|
return false;
|
|
102982
103105
|
}
|
|
@@ -102994,7 +103117,7 @@ __name(isDocker, "isDocker");
|
|
|
102994
103117
|
var cachedResult;
|
|
102995
103118
|
var hasContainerEnv = /* @__PURE__ */ __name(() => {
|
|
102996
103119
|
try {
|
|
102997
|
-
|
|
103120
|
+
fs27.statSync("/run/.containerenv");
|
|
102998
103121
|
return true;
|
|
102999
103122
|
} catch {
|
|
103000
103123
|
return false;
|
|
@@ -103020,12 +103143,12 @@ var isWsl = /* @__PURE__ */ __name(() => {
|
|
|
103020
103143
|
return true;
|
|
103021
103144
|
}
|
|
103022
103145
|
try {
|
|
103023
|
-
if (
|
|
103146
|
+
if (fs28.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
|
|
103024
103147
|
return !isInsideContainer();
|
|
103025
103148
|
}
|
|
103026
103149
|
} catch {
|
|
103027
103150
|
}
|
|
103028
|
-
if (
|
|
103151
|
+
if (fs28.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs28.existsSync("/run/WSL")) {
|
|
103029
103152
|
return !isInsideContainer();
|
|
103030
103153
|
}
|
|
103031
103154
|
return false;
|
|
@@ -103043,14 +103166,14 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
|
103043
103166
|
const configFilePath = "/etc/wsl.conf";
|
|
103044
103167
|
let isConfigFileExists = false;
|
|
103045
103168
|
try {
|
|
103046
|
-
await
|
|
103169
|
+
await fs29.access(configFilePath, fsConstants.F_OK);
|
|
103047
103170
|
isConfigFileExists = true;
|
|
103048
103171
|
} catch {
|
|
103049
103172
|
}
|
|
103050
103173
|
if (!isConfigFileExists) {
|
|
103051
103174
|
return defaultMountPoint;
|
|
103052
103175
|
}
|
|
103053
|
-
const configContent = await
|
|
103176
|
+
const configContent = await fs29.readFile(configFilePath, { encoding: "utf8" });
|
|
103054
103177
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
103055
103178
|
if (!configMountPoint) {
|
|
103056
103179
|
return defaultMountPoint;
|
|
@@ -103213,8 +103336,8 @@ __name(defaultBrowser2, "defaultBrowser");
|
|
|
103213
103336
|
|
|
103214
103337
|
// ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
|
|
103215
103338
|
var execFile8 = promisify8(childProcess.execFile);
|
|
103216
|
-
var __dirname =
|
|
103217
|
-
var localXdgOpenPath =
|
|
103339
|
+
var __dirname = path31.dirname(fileURLToPath6(import.meta.url));
|
|
103340
|
+
var localXdgOpenPath = path31.join(__dirname, "xdg-open");
|
|
103218
103341
|
var { platform: platform3, arch } = process7;
|
|
103219
103342
|
async function getWindowsDefaultBrowserFromWsl() {
|
|
103220
103343
|
const powershellPath = await powerShellPath();
|
|
@@ -103365,7 +103488,7 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
103365
103488
|
const isBundled = !__dirname || __dirname === "/";
|
|
103366
103489
|
let exeLocalXdgOpen = false;
|
|
103367
103490
|
try {
|
|
103368
|
-
await
|
|
103491
|
+
await fs30.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
103369
103492
|
exeLocalXdgOpen = true;
|
|
103370
103493
|
} catch {
|
|
103371
103494
|
}
|
|
@@ -104439,8 +104562,8 @@ __name(formsSubmissionsStatsCommand, "formsSubmissionsStatsCommand");
|
|
|
104439
104562
|
|
|
104440
104563
|
// src/cli/commands/forms.ts
|
|
104441
104564
|
init_dist();
|
|
104442
|
-
import
|
|
104443
|
-
import
|
|
104565
|
+
import fs31 from "node:fs";
|
|
104566
|
+
import path32 from "node:path";
|
|
104444
104567
|
init_project_context();
|
|
104445
104568
|
init_project();
|
|
104446
104569
|
function renderPrettyJson6(data2) {
|
|
@@ -104465,15 +104588,15 @@ async function formsPushCommand(formName, options, cmd) {
|
|
|
104465
104588
|
const { ctx, api } = await bootstrapProjectCommand(options, cmd, { refuseReadOnly: true });
|
|
104466
104589
|
await requireOperation("forms.push", { projectId: ctx.projectId, env: ctx.env });
|
|
104467
104590
|
const cwd = resolveProjectCwd(options.cwd);
|
|
104468
|
-
const formsDir =
|
|
104469
|
-
const files = formName ? [`${formName}.json`] :
|
|
104591
|
+
const formsDir = path32.join(cwd, "src/forms");
|
|
104592
|
+
const files = formName ? [`${formName}.json`] : fs31.readdirSync(formsDir).filter((f) => f.endsWith(".json"));
|
|
104470
104593
|
const results = [];
|
|
104471
104594
|
for (const file2 of files) {
|
|
104472
|
-
const filePath =
|
|
104473
|
-
if (!
|
|
104595
|
+
const filePath = path32.join(formsDir, file2);
|
|
104596
|
+
if (!fs31.existsSync(filePath)) {
|
|
104474
104597
|
throw new Error(`Form file not found: ${filePath}`);
|
|
104475
104598
|
}
|
|
104476
|
-
const form = JSON.parse(
|
|
104599
|
+
const form = JSON.parse(fs31.readFileSync(filePath, "utf-8"));
|
|
104477
104600
|
const { id, ...payload2 } = form;
|
|
104478
104601
|
if (id) {
|
|
104479
104602
|
const result = await api.updateForm(ctx.projectId, id, payload2);
|
|
@@ -104481,7 +104604,7 @@ async function formsPushCommand(formName, options, cmd) {
|
|
|
104481
104604
|
} else {
|
|
104482
104605
|
const result = await api.createForm(ctx.projectId, payload2);
|
|
104483
104606
|
form.id = result.id;
|
|
104484
|
-
|
|
104607
|
+
fs31.writeFileSync(filePath, `${JSON.stringify(form, null, 2)}
|
|
104485
104608
|
`);
|
|
104486
104609
|
results.push(result);
|
|
104487
104610
|
}
|
|
@@ -104873,7 +104996,7 @@ __name(installCommand, "installCommand");
|
|
|
104873
104996
|
|
|
104874
104997
|
// src/cli/commands/integrations.ts
|
|
104875
104998
|
init_dist6();
|
|
104876
|
-
import
|
|
104999
|
+
import path33 from "node:path";
|
|
104877
105000
|
init_dist();
|
|
104878
105001
|
init_api();
|
|
104879
105002
|
init_auth();
|
|
@@ -104957,7 +105080,7 @@ async function listAgentRuntimeCommand(api, projectId, opts) {
|
|
|
104957
105080
|
);
|
|
104958
105081
|
}
|
|
104959
105082
|
const projectRoot = resolveProjectCwd(opts.cwd);
|
|
104960
|
-
const bundle = await parseBundle(
|
|
105083
|
+
const bundle = await parseBundle(path33.join(projectRoot, "agents", agentName));
|
|
104961
105084
|
const policy = agentIntegrationPolicy(bundle.config);
|
|
104962
105085
|
const statuses = await api.listProjectIntegrations(projectId);
|
|
104963
105086
|
const statusByKey = new Map(statuses.map((status) => [status.integrationKey, status]));
|
|
@@ -105108,7 +105231,7 @@ async function requireAgentIntegrationTool(integration, tool, opts) {
|
|
|
105108
105231
|
);
|
|
105109
105232
|
}
|
|
105110
105233
|
const projectRoot = resolveProjectCwd(opts.cwd);
|
|
105111
|
-
const bundle = await parseBundle(
|
|
105234
|
+
const bundle = await parseBundle(path33.join(projectRoot, "agents", agentName));
|
|
105112
105235
|
const policy = agentIntegrationPolicy(bundle.config);
|
|
105113
105236
|
const integrationKey = integration.toLowerCase();
|
|
105114
105237
|
const toolKey = tool.toLowerCase();
|
|
@@ -105771,8 +105894,8 @@ init_auth();
|
|
|
105771
105894
|
init_config2();
|
|
105772
105895
|
init_auth_errors();
|
|
105773
105896
|
init_project();
|
|
105774
|
-
import
|
|
105775
|
-
import
|
|
105897
|
+
import fs32 from "node:fs";
|
|
105898
|
+
import path34 from "node:path";
|
|
105776
105899
|
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
105777
105900
|
var ORGANIZATION_ROLE_OPTIONS = [
|
|
105778
105901
|
{ value: "member", label: "Member", hint: "Can create projects and view members" },
|
|
@@ -106129,8 +106252,8 @@ async function confirmInvite(skipPrompt) {
|
|
|
106129
106252
|
__name(confirmInvite, "confirmInvite");
|
|
106130
106253
|
function tryLoadLocalProject(cwdOption) {
|
|
106131
106254
|
const cwd = resolveProjectCwd(cwdOption);
|
|
106132
|
-
const settingsPath =
|
|
106133
|
-
if (!
|
|
106255
|
+
const settingsPath = path34.join(cwd, ".fimo.settings.json");
|
|
106256
|
+
if (!fs32.existsSync(settingsPath)) {
|
|
106134
106257
|
return null;
|
|
106135
106258
|
}
|
|
106136
106259
|
return loadProjectSettings(cwd);
|
|
@@ -106493,7 +106616,7 @@ init_color();
|
|
|
106493
106616
|
import { execSync, spawnSync as spawnSync4 } from "node:child_process";
|
|
106494
106617
|
import { mkdtempSync, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
106495
106618
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
106496
|
-
import
|
|
106619
|
+
import path35 from "node:path";
|
|
106497
106620
|
|
|
106498
106621
|
// src/cli/utils/format/render-merge.ts
|
|
106499
106622
|
function renderMergeSuccess(result, p2) {
|
|
@@ -106891,8 +107014,8 @@ async function resumeMerge(args) {
|
|
|
106891
107014
|
__name(resumeMerge, "resumeMerge");
|
|
106892
107015
|
function openEditorForPick(conflict) {
|
|
106893
107016
|
const editor = process.env.EDITOR ?? process.env.VISUAL ?? "nano";
|
|
106894
|
-
const tmp = mkdtempSync(
|
|
106895
|
-
const file2 =
|
|
107017
|
+
const tmp = mkdtempSync(path35.join(tmpdir3(), "fimo-merge-"));
|
|
107018
|
+
const file2 = path35.join(tmp, `${conflict.surface}-${sanitiseKey(conflict.key)}.json`);
|
|
106896
107019
|
const seed = conflict.childValue !== void 0 ? JSON.stringify(conflict.childValue, null, 2) : '// Replace this comment with the resolved value as JSON\n""';
|
|
106897
107020
|
writeFileSync7(file2, seed, "utf8");
|
|
106898
107021
|
spawnSync4(editor, [file2], { stdio: "inherit" });
|
|
@@ -107226,8 +107349,8 @@ init_dist();
|
|
|
107226
107349
|
init_api();
|
|
107227
107350
|
init_config2();
|
|
107228
107351
|
init_project();
|
|
107229
|
-
import
|
|
107230
|
-
import
|
|
107352
|
+
import fs36 from "node:fs";
|
|
107353
|
+
import path39 from "node:path";
|
|
107231
107354
|
function registerProjectSecretsCommands(program2) {
|
|
107232
107355
|
const vars = program2.command("vars").description("Manage project variables");
|
|
107233
107356
|
vars.command("list").description("List project variables").option("--project <id>", "Project id (defaults to .fimo.settings.json projectId)").option("-C, --cwd <dir>", "Project directory").action((opts) => listCommand2("variable", opts));
|
|
@@ -107339,10 +107462,10 @@ async function writePulledVars(api, projectRoot, projectId, file2) {
|
|
|
107339
107462
|
const rows = (await api.listProjectSecretEntries(projectId, { kind: "variable" })).filter(
|
|
107340
107463
|
(row2) => row2.exposure === "public"
|
|
107341
107464
|
);
|
|
107342
|
-
const target =
|
|
107343
|
-
const existing =
|
|
107465
|
+
const target = path39.resolve(projectRoot, file2);
|
|
107466
|
+
const existing = fs36.existsSync(target) ? fs36.readFileSync(target, "utf8") : "";
|
|
107344
107467
|
const body = mergeEnvFile(existing, rows);
|
|
107345
|
-
|
|
107468
|
+
fs36.writeFileSync(target, body);
|
|
107346
107469
|
return { path: target, written: rows.length };
|
|
107347
107470
|
}
|
|
107348
107471
|
__name(writePulledVars, "writePulledVars");
|
|
@@ -107410,19 +107533,19 @@ init_auth();
|
|
|
107410
107533
|
init_config2();
|
|
107411
107534
|
init_auth_errors();
|
|
107412
107535
|
init_interactive();
|
|
107413
|
-
import
|
|
107414
|
-
import
|
|
107536
|
+
import fs37 from "node:fs";
|
|
107537
|
+
import path40 from "node:path";
|
|
107415
107538
|
function resolveCwd2(options) {
|
|
107416
|
-
return options.cwd ?
|
|
107539
|
+
return options.cwd ? path40.resolve(options.cwd) : process.cwd();
|
|
107417
107540
|
}
|
|
107418
107541
|
__name(resolveCwd2, "resolveCwd");
|
|
107419
107542
|
function readLocalConfig(options) {
|
|
107420
107543
|
const cwd = resolveCwd2(options);
|
|
107421
|
-
const settingsPath =
|
|
107422
|
-
if (!
|
|
107544
|
+
const settingsPath = path40.join(cwd, ".fimo.settings.json");
|
|
107545
|
+
if (!fs37.existsSync(settingsPath)) {
|
|
107423
107546
|
return null;
|
|
107424
107547
|
}
|
|
107425
|
-
return JSON.parse(
|
|
107548
|
+
return JSON.parse(fs37.readFileSync(settingsPath, "utf-8"));
|
|
107426
107549
|
}
|
|
107427
107550
|
__name(readLocalConfig, "readLocalConfig");
|
|
107428
107551
|
function resolveProjectId5(argv, options, command) {
|
|
@@ -107534,11 +107657,11 @@ async function projectsRenameCommand(nameArg, projectIdArg, options) {
|
|
|
107534
107657
|
});
|
|
107535
107658
|
return;
|
|
107536
107659
|
}
|
|
107537
|
-
const configPath =
|
|
107660
|
+
const configPath = path40.join(cwd, "fimo-config.json");
|
|
107538
107661
|
let config2 = {};
|
|
107539
|
-
if (
|
|
107662
|
+
if (fs37.existsSync(configPath)) {
|
|
107540
107663
|
try {
|
|
107541
|
-
config2 = JSON.parse(
|
|
107664
|
+
config2 = JSON.parse(fs37.readFileSync(configPath, "utf-8"));
|
|
107542
107665
|
} catch (error45) {
|
|
107543
107666
|
ui.error({
|
|
107544
107667
|
command: "projects rename",
|
|
@@ -107550,7 +107673,7 @@ async function projectsRenameCommand(nameArg, projectIdArg, options) {
|
|
|
107550
107673
|
}
|
|
107551
107674
|
const seo = config2.seo ?? {};
|
|
107552
107675
|
config2.seo = { ...seo, siteName: name };
|
|
107553
|
-
|
|
107676
|
+
fs37.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n");
|
|
107554
107677
|
ui.ok({
|
|
107555
107678
|
command: "projects rename",
|
|
107556
107679
|
headline: `Renamed to "${name}".`,
|
|
@@ -107770,12 +107893,12 @@ __name(resolveCurrentCliUser, "resolveCurrentCliUser");
|
|
|
107770
107893
|
init_dist();
|
|
107771
107894
|
init_agents();
|
|
107772
107895
|
init_scaffold();
|
|
107773
|
-
import
|
|
107774
|
-
import
|
|
107896
|
+
import fs38 from "node:fs";
|
|
107897
|
+
import path41 from "node:path";
|
|
107775
107898
|
async function rulesSyncCommand(options = {}) {
|
|
107776
|
-
const cwd =
|
|
107777
|
-
const agentsMdPath =
|
|
107778
|
-
if (!
|
|
107899
|
+
const cwd = path41.resolve(options.cwd ?? process.cwd());
|
|
107900
|
+
const agentsMdPath = path41.join(cwd, "AGENTS.md");
|
|
107901
|
+
if (!fs38.existsSync(agentsMdPath)) {
|
|
107779
107902
|
ui.error({
|
|
107780
107903
|
command: "rules sync",
|
|
107781
107904
|
code: "NO_AGENTS_MD",
|
|
@@ -107853,8 +107976,8 @@ __name(rulesSyncCommand, "rulesSyncCommand");
|
|
|
107853
107976
|
|
|
107854
107977
|
// src/cli/commands/schema.ts
|
|
107855
107978
|
init_dist();
|
|
107856
|
-
import
|
|
107857
|
-
import
|
|
107979
|
+
import fs39 from "node:fs";
|
|
107980
|
+
import path42 from "node:path";
|
|
107858
107981
|
init_project_context();
|
|
107859
107982
|
init_project();
|
|
107860
107983
|
function toApiShape(schema) {
|
|
@@ -107888,15 +108011,15 @@ async function schemaPushCommand(typeName, options, cmd) {
|
|
|
107888
108011
|
const { ctx, api } = await bootstrapProjectCommand(options, cmd, { refuseReadOnly: true });
|
|
107889
108012
|
await requireOperation("cms.schema.push", { projectId: ctx.projectId, env: ctx.env });
|
|
107890
108013
|
const cwd = resolveProjectCwd(options.cwd);
|
|
107891
|
-
const schemasDir =
|
|
107892
|
-
const files = typeName ? [`${typeName}.json`] :
|
|
108014
|
+
const schemasDir = path42.join(cwd, "src/schemas");
|
|
108015
|
+
const files = typeName ? [`${typeName}.json`] : fs39.readdirSync(schemasDir).filter((f) => f.endsWith(".json"));
|
|
107893
108016
|
const results = [];
|
|
107894
108017
|
for (const file2 of files) {
|
|
107895
|
-
const filePath =
|
|
107896
|
-
if (!
|
|
108018
|
+
const filePath = path42.join(schemasDir, file2);
|
|
108019
|
+
if (!fs39.existsSync(filePath)) {
|
|
107897
108020
|
throw new Error(`Schema file not found: ${filePath}`);
|
|
107898
108021
|
}
|
|
107899
|
-
const schema = JSON.parse(
|
|
108022
|
+
const schema = JSON.parse(fs39.readFileSync(filePath, "utf-8"));
|
|
107900
108023
|
const contentType = toApiShape(schema);
|
|
107901
108024
|
try {
|
|
107902
108025
|
const result = await api.createSchema(ctx.projectId, contentType);
|
|
@@ -108195,7 +108318,7 @@ init_project_context();
|
|
|
108195
108318
|
function computeVersionString() {
|
|
108196
108319
|
let pkgVersion = "0.0.0";
|
|
108197
108320
|
try {
|
|
108198
|
-
const pkg = JSON.parse(
|
|
108321
|
+
const pkg = JSON.parse(fs40.readFileSync(path43.join(CLI_ROOT, "package.json"), "utf8"));
|
|
108199
108322
|
if (typeof pkg.version === "string" && pkg.version.length > 0) {
|
|
108200
108323
|
pkgVersion = pkg.version;
|
|
108201
108324
|
}
|
|
@@ -108203,7 +108326,7 @@ function computeVersionString() {
|
|
|
108203
108326
|
}
|
|
108204
108327
|
let releaseId;
|
|
108205
108328
|
try {
|
|
108206
|
-
const release = JSON.parse(
|
|
108329
|
+
const release = JSON.parse(fs40.readFileSync(path43.join(CLI_ROOT, "release.json"), "utf8"));
|
|
108207
108330
|
if (typeof release.id === "string" && release.id.length > 0) {
|
|
108208
108331
|
releaseId = release.id;
|
|
108209
108332
|
}
|