@construct-space/cli 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +119 -73
- package/package.json +8 -3
package/dist/index.js
CHANGED
|
@@ -3190,7 +3190,7 @@ function loadCreds() {
|
|
|
3190
3190
|
} catch (err) {
|
|
3191
3191
|
const msg = err instanceof Error ? err.message : String(err);
|
|
3192
3192
|
throw new Error(msg + `
|
|
3193
|
-
Run 'construct login' first
|
|
3193
|
+
Run 'construct login' first.`, { cause: err });
|
|
3194
3194
|
}
|
|
3195
3195
|
}
|
|
3196
3196
|
async function graphRequest(opts) {
|
|
@@ -8247,7 +8247,7 @@ function scanPagesDir(pagesDir) {
|
|
|
8247
8247
|
function varNameFromFile(filePath) {
|
|
8248
8248
|
let cleaned = filePath.replace(/^pages\//, "").replace(/\.vue$/, "");
|
|
8249
8249
|
cleaned = cleaned.replace(/\[([^\]]+)\]/g, "$1");
|
|
8250
|
-
const segments = cleaned.split(/[
|
|
8250
|
+
const segments = cleaned.split(/[/-]/).filter(Boolean);
|
|
8251
8251
|
const name = segments.map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
8252
8252
|
return (name || "Index") + "Page";
|
|
8253
8253
|
}
|
|
@@ -8261,11 +8261,11 @@ function resolvePages(m, root, prefix) {
|
|
|
8261
8261
|
return m.pages.map((p) => {
|
|
8262
8262
|
if (p.component) {
|
|
8263
8263
|
const base = basename(p.component);
|
|
8264
|
-
const nameWithoutExt = base.replace(extname(base), "").replace(/[
|
|
8264
|
+
const nameWithoutExt = base.replace(extname(base), "").replace(/[[\]]/g, "");
|
|
8265
8265
|
const dir = p.component.replace(/^pages\//, "").replace(/\/[^/]+$/, "");
|
|
8266
8266
|
let varName;
|
|
8267
8267
|
if (dir && dir !== p.component.replace(/^pages\//, "")) {
|
|
8268
|
-
varName = capitalize(dir.split("/").map((s) => s.replace(/[
|
|
8268
|
+
varName = capitalize(dir.split("/").map((s) => s.replace(/[[\]]/g, "")).join("-")) + capitalize(nameWithoutExt) + "Page";
|
|
8269
8269
|
} else {
|
|
8270
8270
|
varName = capitalize(nameWithoutExt) + "Page";
|
|
8271
8271
|
}
|
|
@@ -8281,7 +8281,7 @@ function resolvePages(m, root, prefix) {
|
|
|
8281
8281
|
if (existsSync4(legacyFullPath)) {
|
|
8282
8282
|
let varName = "IndexPage";
|
|
8283
8283
|
if (p.path) {
|
|
8284
|
-
varName = capitalize(p.path.replace(/\[([^\]]+)\]/g, "$1").replace(/[
|
|
8284
|
+
varName = capitalize(p.path.replace(/\[([^\]]+)\]/g, "$1").replace(/[/:]/g, "-").replace(/-+/g, "-")) + "Page";
|
|
8285
8285
|
}
|
|
8286
8286
|
return { varName, importPath: prefix + legacyComponent, path: p.path };
|
|
8287
8287
|
}
|
|
@@ -8518,7 +8518,7 @@ function readObjectEntries(source) {
|
|
|
8518
8518
|
i += 1;
|
|
8519
8519
|
if (i >= source.length)
|
|
8520
8520
|
break;
|
|
8521
|
-
let key
|
|
8521
|
+
let key;
|
|
8522
8522
|
const quote = source[i];
|
|
8523
8523
|
if (quote === '"' || quote === "'" || quote === "`") {
|
|
8524
8524
|
i += 1;
|
|
@@ -8641,7 +8641,7 @@ async function build(options) {
|
|
|
8641
8641
|
}
|
|
8642
8642
|
const distDir = join6(root, "dist");
|
|
8643
8643
|
const expectedBundle = `space-${m.id}.iife.js`;
|
|
8644
|
-
|
|
8644
|
+
const bundlePath = join6(distDir, expectedBundle);
|
|
8645
8645
|
if (!existsSync6(bundlePath)) {
|
|
8646
8646
|
const matches = readdirSync3(distDir).filter((f) => f.startsWith("space-") && f.endsWith(".iife.js"));
|
|
8647
8647
|
if (matches.length === 1) {
|
|
@@ -8685,16 +8685,16 @@ import { existsSync as existsSync7, readFileSync as readFileSync5 } from "fs";
|
|
|
8685
8685
|
import { join as join9 } from "path";
|
|
8686
8686
|
import { createHash as createHash2 } from "crypto";
|
|
8687
8687
|
|
|
8688
|
-
// node_modules/chokidar/
|
|
8689
|
-
import { stat as statcb } from "fs";
|
|
8690
|
-
import { stat as stat3, readdir as readdir2 } from "fs/promises";
|
|
8688
|
+
// node_modules/chokidar/index.js
|
|
8691
8689
|
import { EventEmitter } from "events";
|
|
8692
|
-
import
|
|
8690
|
+
import { stat as statcb, Stats } from "fs";
|
|
8691
|
+
import { readdir as readdir2, stat as stat3 } from "fs/promises";
|
|
8692
|
+
import * as sp2 from "path";
|
|
8693
8693
|
|
|
8694
|
-
// node_modules/readdirp/
|
|
8695
|
-
import {
|
|
8694
|
+
// node_modules/readdirp/index.js
|
|
8695
|
+
import { lstat, readdir, realpath, stat } from "fs/promises";
|
|
8696
|
+
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "path";
|
|
8696
8697
|
import { Readable } from "stream";
|
|
8697
|
-
import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from "path";
|
|
8698
8698
|
var EntryTypes = {
|
|
8699
8699
|
FILE_TYPE: "files",
|
|
8700
8700
|
DIR_TYPE: "directories",
|
|
@@ -8750,6 +8750,20 @@ var normalizeFilter = (filter) => {
|
|
|
8750
8750
|
};
|
|
8751
8751
|
|
|
8752
8752
|
class ReaddirpStream extends Readable {
|
|
8753
|
+
parents;
|
|
8754
|
+
reading;
|
|
8755
|
+
parent;
|
|
8756
|
+
_stat;
|
|
8757
|
+
_maxDepth;
|
|
8758
|
+
_wantsDir;
|
|
8759
|
+
_wantsFile;
|
|
8760
|
+
_wantsEverything;
|
|
8761
|
+
_root;
|
|
8762
|
+
_isDirent;
|
|
8763
|
+
_statsProp;
|
|
8764
|
+
_rdOptions;
|
|
8765
|
+
_fileFilter;
|
|
8766
|
+
_directoryFilter;
|
|
8753
8767
|
constructor(options = {}) {
|
|
8754
8768
|
super({
|
|
8755
8769
|
objectMode: true,
|
|
@@ -8766,7 +8780,7 @@ class ReaddirpStream extends Readable {
|
|
|
8766
8780
|
} else {
|
|
8767
8781
|
this._stat = statMethod;
|
|
8768
8782
|
}
|
|
8769
|
-
this._maxDepth = opts.depth
|
|
8783
|
+
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
8770
8784
|
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
8771
8785
|
this._wantsFile = type ? FILE_TYPES.has(type) : false;
|
|
8772
8786
|
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
@@ -8911,11 +8925,11 @@ function readdirp(root, options = {}) {
|
|
|
8911
8925
|
return new ReaddirpStream(options);
|
|
8912
8926
|
}
|
|
8913
8927
|
|
|
8914
|
-
// node_modules/chokidar/
|
|
8915
|
-
import {
|
|
8916
|
-
import {
|
|
8917
|
-
import * as sysPath from "path";
|
|
8928
|
+
// node_modules/chokidar/handler.js
|
|
8929
|
+
import { watch as fs_watch, unwatchFile, watchFile } from "fs";
|
|
8930
|
+
import { realpath as fsrealpath, lstat as lstat2, open, stat as stat2 } from "fs/promises";
|
|
8918
8931
|
import { type as osType } from "os";
|
|
8932
|
+
import * as sp from "path";
|
|
8919
8933
|
var STR_DATA = "data";
|
|
8920
8934
|
var STR_END = "end";
|
|
8921
8935
|
var STR_CLOSE = "close";
|
|
@@ -9207,7 +9221,7 @@ var binaryExtensions = new Set([
|
|
|
9207
9221
|
"zip",
|
|
9208
9222
|
"zipx"
|
|
9209
9223
|
]);
|
|
9210
|
-
var isBinaryPath = (filePath) => binaryExtensions.has(
|
|
9224
|
+
var isBinaryPath = (filePath) => binaryExtensions.has(sp.extname(filePath).slice(1).toLowerCase());
|
|
9211
9225
|
var foreach = (val, fn) => {
|
|
9212
9226
|
if (val instanceof Set) {
|
|
9213
9227
|
val.forEach(fn);
|
|
@@ -9245,7 +9259,7 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
|
|
9245
9259
|
listener(path);
|
|
9246
9260
|
emitRaw(rawEvent, evPath, { watchedPath: path });
|
|
9247
9261
|
if (evPath && path !== evPath) {
|
|
9248
|
-
fsWatchBroadcast(
|
|
9262
|
+
fsWatchBroadcast(sp.resolve(path, evPath), KEY_LISTENERS, sp.join(path, evPath));
|
|
9249
9263
|
}
|
|
9250
9264
|
};
|
|
9251
9265
|
try {
|
|
@@ -9360,17 +9374,19 @@ var setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
9360
9374
|
};
|
|
9361
9375
|
|
|
9362
9376
|
class NodeFsHandler {
|
|
9377
|
+
fsw;
|
|
9378
|
+
_boundHandleError;
|
|
9363
9379
|
constructor(fsW) {
|
|
9364
9380
|
this.fsw = fsW;
|
|
9365
9381
|
this._boundHandleError = (error2) => fsW._handleError(error2);
|
|
9366
9382
|
}
|
|
9367
9383
|
_watchWithNodeFs(path, listener) {
|
|
9368
9384
|
const opts = this.fsw.options;
|
|
9369
|
-
const directory =
|
|
9370
|
-
const basename4 =
|
|
9385
|
+
const directory = sp.dirname(path);
|
|
9386
|
+
const basename4 = sp.basename(path);
|
|
9371
9387
|
const parent = this.fsw._getWatchedDir(directory);
|
|
9372
9388
|
parent.add(basename4);
|
|
9373
|
-
const absolutePath =
|
|
9389
|
+
const absolutePath = sp.resolve(path);
|
|
9374
9390
|
const options = {
|
|
9375
9391
|
persistent: opts.persistent
|
|
9376
9392
|
};
|
|
@@ -9397,8 +9413,8 @@ class NodeFsHandler {
|
|
|
9397
9413
|
if (this.fsw.closed) {
|
|
9398
9414
|
return;
|
|
9399
9415
|
}
|
|
9400
|
-
const dirname3 =
|
|
9401
|
-
const basename4 =
|
|
9416
|
+
const dirname3 = sp.dirname(file);
|
|
9417
|
+
const basename4 = sp.basename(file);
|
|
9402
9418
|
const parent = this.fsw._getWatchedDir(dirname3);
|
|
9403
9419
|
let prevStats = stats;
|
|
9404
9420
|
if (parent.has(basename4))
|
|
@@ -9481,8 +9497,9 @@ class NodeFsHandler {
|
|
|
9481
9497
|
this.fsw._symlinkPaths.set(full, true);
|
|
9482
9498
|
}
|
|
9483
9499
|
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
9484
|
-
directory =
|
|
9485
|
-
|
|
9500
|
+
directory = sp.join(directory, "");
|
|
9501
|
+
const throttleKey = target ? `${directory}:${target}` : directory;
|
|
9502
|
+
throttler = this.fsw._throttle("readdir", throttleKey, 1000);
|
|
9486
9503
|
if (!throttler)
|
|
9487
9504
|
return;
|
|
9488
9505
|
const previous = this.fsw._getWatchedDir(wh.path);
|
|
@@ -9499,7 +9516,7 @@ class NodeFsHandler {
|
|
|
9499
9516
|
return;
|
|
9500
9517
|
}
|
|
9501
9518
|
const item = entry.path;
|
|
9502
|
-
let path =
|
|
9519
|
+
let path = sp.join(directory, item);
|
|
9503
9520
|
current.add(item);
|
|
9504
9521
|
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) {
|
|
9505
9522
|
return;
|
|
@@ -9510,7 +9527,7 @@ class NodeFsHandler {
|
|
|
9510
9527
|
}
|
|
9511
9528
|
if (item === target || !target && !previous.has(item)) {
|
|
9512
9529
|
this.fsw._incrReadyCount();
|
|
9513
|
-
path =
|
|
9530
|
+
path = sp.join(dir, sp.relative(dir, path));
|
|
9514
9531
|
this._addToNodeFs(path, initialAdd, wh, depth + 1);
|
|
9515
9532
|
}
|
|
9516
9533
|
}).on(EV.ERROR, this._boundHandleError);
|
|
@@ -9536,12 +9553,12 @@ class NodeFsHandler {
|
|
|
9536
9553
|
});
|
|
9537
9554
|
}
|
|
9538
9555
|
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath2) {
|
|
9539
|
-
const parentDir = this.fsw._getWatchedDir(
|
|
9540
|
-
const tracked = parentDir.has(
|
|
9556
|
+
const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));
|
|
9557
|
+
const tracked = parentDir.has(sp.basename(dir));
|
|
9541
9558
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
9542
9559
|
this.fsw._emit(EV.ADD_DIR, dir, stats);
|
|
9543
9560
|
}
|
|
9544
|
-
parentDir.add(
|
|
9561
|
+
parentDir.add(sp.basename(dir));
|
|
9545
9562
|
this.fsw._getWatchedDir(dir);
|
|
9546
9563
|
let throttler;
|
|
9547
9564
|
let closer;
|
|
@@ -9582,7 +9599,7 @@ class NodeFsHandler {
|
|
|
9582
9599
|
const follow = this.fsw.options.followSymlinks;
|
|
9583
9600
|
let closer;
|
|
9584
9601
|
if (stats.isDirectory()) {
|
|
9585
|
-
const absPath =
|
|
9602
|
+
const absPath = sp.resolve(path);
|
|
9586
9603
|
const targetPath = follow ? await fsrealpath(path) : path;
|
|
9587
9604
|
if (this.fsw.closed)
|
|
9588
9605
|
return;
|
|
@@ -9596,14 +9613,14 @@ class NodeFsHandler {
|
|
|
9596
9613
|
const targetPath = follow ? await fsrealpath(path) : path;
|
|
9597
9614
|
if (this.fsw.closed)
|
|
9598
9615
|
return;
|
|
9599
|
-
const parent =
|
|
9616
|
+
const parent = sp.dirname(wh.watchPath);
|
|
9600
9617
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
9601
9618
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
9602
9619
|
closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
|
|
9603
9620
|
if (this.fsw.closed)
|
|
9604
9621
|
return;
|
|
9605
9622
|
if (targetPath !== undefined) {
|
|
9606
|
-
this.fsw._symlinkPaths.set(
|
|
9623
|
+
this.fsw._symlinkPaths.set(sp.resolve(path), targetPath);
|
|
9607
9624
|
}
|
|
9608
9625
|
} else {
|
|
9609
9626
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
@@ -9621,7 +9638,7 @@ class NodeFsHandler {
|
|
|
9621
9638
|
}
|
|
9622
9639
|
}
|
|
9623
9640
|
|
|
9624
|
-
// node_modules/chokidar/
|
|
9641
|
+
// node_modules/chokidar/index.js
|
|
9625
9642
|
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
9626
9643
|
var SLASH = "/";
|
|
9627
9644
|
var SLASH_SLASH = "//";
|
|
@@ -9629,7 +9646,7 @@ var ONE_DOT = ".";
|
|
|
9629
9646
|
var TWO_DOTS = "..";
|
|
9630
9647
|
var STRING_TYPE = "string";
|
|
9631
9648
|
var BACK_SLASH_RE = /\\/g;
|
|
9632
|
-
var DOUBLE_SLASH_RE =
|
|
9649
|
+
var DOUBLE_SLASH_RE = /\/\//g;
|
|
9633
9650
|
var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
9634
9651
|
var REPLACER_RE = /^\.[/\\]/;
|
|
9635
9652
|
function arrify(item) {
|
|
@@ -9648,11 +9665,11 @@ function createPattern(matcher) {
|
|
|
9648
9665
|
if (matcher.path === string)
|
|
9649
9666
|
return true;
|
|
9650
9667
|
if (matcher.recursive) {
|
|
9651
|
-
const relative4 =
|
|
9668
|
+
const relative4 = sp2.relative(matcher.path, string);
|
|
9652
9669
|
if (!relative4) {
|
|
9653
9670
|
return false;
|
|
9654
9671
|
}
|
|
9655
|
-
return !relative4.startsWith("..") && !
|
|
9672
|
+
return !relative4.startsWith("..") && !sp2.isAbsolute(relative4);
|
|
9656
9673
|
}
|
|
9657
9674
|
return false;
|
|
9658
9675
|
};
|
|
@@ -9662,14 +9679,12 @@ function createPattern(matcher) {
|
|
|
9662
9679
|
function normalizePath(path) {
|
|
9663
9680
|
if (typeof path !== "string")
|
|
9664
9681
|
throw new Error("string expected");
|
|
9665
|
-
path =
|
|
9682
|
+
path = sp2.normalize(path);
|
|
9666
9683
|
path = path.replace(/\\/g, "/");
|
|
9667
9684
|
let prepend = false;
|
|
9668
9685
|
if (path.startsWith("//"))
|
|
9669
9686
|
prepend = true;
|
|
9670
|
-
|
|
9671
|
-
while (path.match(DOUBLE_SLASH_RE2))
|
|
9672
|
-
path = path.replace(DOUBLE_SLASH_RE2, "/");
|
|
9687
|
+
path = path.replace(DOUBLE_SLASH_RE, "/");
|
|
9673
9688
|
if (prepend)
|
|
9674
9689
|
path = "/" + path;
|
|
9675
9690
|
return path;
|
|
@@ -9710,31 +9725,32 @@ var toUnix = (string) => {
|
|
|
9710
9725
|
if (str.startsWith(SLASH_SLASH)) {
|
|
9711
9726
|
prepend = true;
|
|
9712
9727
|
}
|
|
9713
|
-
|
|
9714
|
-
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
9715
|
-
}
|
|
9728
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
9716
9729
|
if (prepend) {
|
|
9717
9730
|
str = SLASH + str;
|
|
9718
9731
|
}
|
|
9719
9732
|
return str;
|
|
9720
9733
|
};
|
|
9721
|
-
var normalizePathToUnix = (path) => toUnix(
|
|
9734
|
+
var normalizePathToUnix = (path) => toUnix(sp2.normalize(toUnix(path)));
|
|
9722
9735
|
var normalizeIgnored = (cwd = "") => (path) => {
|
|
9723
9736
|
if (typeof path === "string") {
|
|
9724
|
-
return normalizePathToUnix(
|
|
9737
|
+
return normalizePathToUnix(sp2.isAbsolute(path) ? path : sp2.join(cwd, path));
|
|
9725
9738
|
} else {
|
|
9726
9739
|
return path;
|
|
9727
9740
|
}
|
|
9728
9741
|
};
|
|
9729
9742
|
var getAbsolutePath = (path, cwd) => {
|
|
9730
|
-
if (
|
|
9743
|
+
if (sp2.isAbsolute(path)) {
|
|
9731
9744
|
return path;
|
|
9732
9745
|
}
|
|
9733
|
-
return
|
|
9746
|
+
return sp2.join(cwd, path);
|
|
9734
9747
|
};
|
|
9735
9748
|
var EMPTY_SET = Object.freeze(new Set);
|
|
9736
9749
|
|
|
9737
9750
|
class DirEntry {
|
|
9751
|
+
path;
|
|
9752
|
+
_removeWatcher;
|
|
9753
|
+
items;
|
|
9738
9754
|
constructor(dir, removeWatcher) {
|
|
9739
9755
|
this.path = dir;
|
|
9740
9756
|
this._removeWatcher = removeWatcher;
|
|
@@ -9759,7 +9775,7 @@ class DirEntry {
|
|
|
9759
9775
|
await readdir2(dir);
|
|
9760
9776
|
} catch (err) {
|
|
9761
9777
|
if (this._removeWatcher) {
|
|
9762
|
-
this._removeWatcher(
|
|
9778
|
+
this._removeWatcher(sp2.dirname(dir), sp2.basename(dir));
|
|
9763
9779
|
}
|
|
9764
9780
|
}
|
|
9765
9781
|
}
|
|
@@ -9787,12 +9803,19 @@ var STAT_METHOD_F = "stat";
|
|
|
9787
9803
|
var STAT_METHOD_L = "lstat";
|
|
9788
9804
|
|
|
9789
9805
|
class WatchHelper {
|
|
9806
|
+
fsw;
|
|
9807
|
+
path;
|
|
9808
|
+
watchPath;
|
|
9809
|
+
fullWatchPath;
|
|
9810
|
+
dirParts;
|
|
9811
|
+
followSymlinks;
|
|
9812
|
+
statMethod;
|
|
9790
9813
|
constructor(path, follow, fsw) {
|
|
9791
9814
|
this.fsw = fsw;
|
|
9792
9815
|
const watchPath = path;
|
|
9793
9816
|
this.path = path = path.replace(REPLACER_RE, "");
|
|
9794
9817
|
this.watchPath = watchPath;
|
|
9795
|
-
this.fullWatchPath =
|
|
9818
|
+
this.fullWatchPath = sp2.resolve(watchPath);
|
|
9796
9819
|
this.dirParts = [];
|
|
9797
9820
|
this.dirParts.forEach((parts) => {
|
|
9798
9821
|
if (parts.length > 1)
|
|
@@ -9802,7 +9825,7 @@ class WatchHelper {
|
|
|
9802
9825
|
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
9803
9826
|
}
|
|
9804
9827
|
entryPath(entry) {
|
|
9805
|
-
return
|
|
9828
|
+
return sp2.join(this.watchPath, sp2.relative(this.watchPath, entry.fullPath));
|
|
9806
9829
|
}
|
|
9807
9830
|
filterPath(entry) {
|
|
9808
9831
|
const { stats } = entry;
|
|
@@ -9817,6 +9840,24 @@ class WatchHelper {
|
|
|
9817
9840
|
}
|
|
9818
9841
|
|
|
9819
9842
|
class FSWatcher extends EventEmitter {
|
|
9843
|
+
closed;
|
|
9844
|
+
options;
|
|
9845
|
+
_closers;
|
|
9846
|
+
_ignoredPaths;
|
|
9847
|
+
_throttled;
|
|
9848
|
+
_streams;
|
|
9849
|
+
_symlinkPaths;
|
|
9850
|
+
_watched;
|
|
9851
|
+
_pendingWrites;
|
|
9852
|
+
_pendingUnlinks;
|
|
9853
|
+
_readyCount;
|
|
9854
|
+
_emitReady;
|
|
9855
|
+
_closePromise;
|
|
9856
|
+
_userIgnored;
|
|
9857
|
+
_readyEmitted;
|
|
9858
|
+
_emitRaw;
|
|
9859
|
+
_boundRemove;
|
|
9860
|
+
_nodeFsHandler;
|
|
9820
9861
|
constructor(_opts = {}) {
|
|
9821
9862
|
super();
|
|
9822
9863
|
this.closed = false;
|
|
@@ -9925,7 +9966,7 @@ class FSWatcher extends EventEmitter {
|
|
|
9925
9966
|
return;
|
|
9926
9967
|
results.forEach((item) => {
|
|
9927
9968
|
if (item)
|
|
9928
|
-
this.add(
|
|
9969
|
+
this.add(sp2.dirname(item), sp2.basename(_origAdd || item));
|
|
9929
9970
|
});
|
|
9930
9971
|
});
|
|
9931
9972
|
return this;
|
|
@@ -9936,10 +9977,10 @@ class FSWatcher extends EventEmitter {
|
|
|
9936
9977
|
const paths = unifyPaths(paths_);
|
|
9937
9978
|
const { cwd } = this.options;
|
|
9938
9979
|
paths.forEach((path) => {
|
|
9939
|
-
if (!
|
|
9980
|
+
if (!sp2.isAbsolute(path) && !this._closers.has(path)) {
|
|
9940
9981
|
if (cwd)
|
|
9941
|
-
path =
|
|
9942
|
-
path =
|
|
9982
|
+
path = sp2.join(cwd, path);
|
|
9983
|
+
path = sp2.resolve(path);
|
|
9943
9984
|
}
|
|
9944
9985
|
this._closePath(path);
|
|
9945
9986
|
this._addIgnoredPath(path);
|
|
@@ -9983,7 +10024,7 @@ class FSWatcher extends EventEmitter {
|
|
|
9983
10024
|
getWatched() {
|
|
9984
10025
|
const watchList = {};
|
|
9985
10026
|
this._watched.forEach((entry, dir) => {
|
|
9986
|
-
const key = this.options.cwd ?
|
|
10027
|
+
const key = this.options.cwd ? sp2.relative(this.options.cwd, dir) : dir;
|
|
9987
10028
|
const index = key || ONE_DOT;
|
|
9988
10029
|
watchList[index] = entry.getChildren().sort();
|
|
9989
10030
|
});
|
|
@@ -9999,9 +10040,9 @@ class FSWatcher extends EventEmitter {
|
|
|
9999
10040
|
return;
|
|
10000
10041
|
const opts = this.options;
|
|
10001
10042
|
if (isWindows)
|
|
10002
|
-
path =
|
|
10043
|
+
path = sp2.normalize(path);
|
|
10003
10044
|
if (opts.cwd)
|
|
10004
|
-
path =
|
|
10045
|
+
path = sp2.relative(opts.cwd, path);
|
|
10005
10046
|
const args = [path];
|
|
10006
10047
|
if (stats != null)
|
|
10007
10048
|
args.push(stats);
|
|
@@ -10052,7 +10093,7 @@ class FSWatcher extends EventEmitter {
|
|
|
10052
10093
|
return this;
|
|
10053
10094
|
}
|
|
10054
10095
|
if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
10055
|
-
const fullPath = opts.cwd ?
|
|
10096
|
+
const fullPath = opts.cwd ? sp2.join(opts.cwd, path) : path;
|
|
10056
10097
|
let stats2;
|
|
10057
10098
|
try {
|
|
10058
10099
|
stats2 = await stat3(fullPath);
|
|
@@ -10108,8 +10149,8 @@ class FSWatcher extends EventEmitter {
|
|
|
10108
10149
|
const pollInterval = awf.pollInterval;
|
|
10109
10150
|
let timeoutHandler;
|
|
10110
10151
|
let fullPath = path;
|
|
10111
|
-
if (this.options.cwd && !
|
|
10112
|
-
fullPath =
|
|
10152
|
+
if (this.options.cwd && !sp2.isAbsolute(path)) {
|
|
10153
|
+
fullPath = sp2.join(this.options.cwd, path);
|
|
10113
10154
|
}
|
|
10114
10155
|
const now = new Date;
|
|
10115
10156
|
const writes = this._pendingWrites;
|
|
@@ -10166,7 +10207,7 @@ class FSWatcher extends EventEmitter {
|
|
|
10166
10207
|
return new WatchHelper(path, this.options.followSymlinks, this);
|
|
10167
10208
|
}
|
|
10168
10209
|
_getWatchedDir(directory) {
|
|
10169
|
-
const dir =
|
|
10210
|
+
const dir = sp2.resolve(directory);
|
|
10170
10211
|
if (!this._watched.has(dir))
|
|
10171
10212
|
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
10172
10213
|
return this._watched.get(dir);
|
|
@@ -10177,8 +10218,8 @@ class FSWatcher extends EventEmitter {
|
|
|
10177
10218
|
return Boolean(Number(stats.mode) & 256);
|
|
10178
10219
|
}
|
|
10179
10220
|
_remove(directory, item, isDirectory) {
|
|
10180
|
-
const path =
|
|
10181
|
-
const fullPath =
|
|
10221
|
+
const path = sp2.join(directory, item);
|
|
10222
|
+
const fullPath = sp2.resolve(path);
|
|
10182
10223
|
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
|
|
10183
10224
|
if (!this._throttle("remove", path, 100))
|
|
10184
10225
|
return;
|
|
@@ -10196,7 +10237,7 @@ class FSWatcher extends EventEmitter {
|
|
|
10196
10237
|
}
|
|
10197
10238
|
let relPath = path;
|
|
10198
10239
|
if (this.options.cwd)
|
|
10199
|
-
relPath =
|
|
10240
|
+
relPath = sp2.relative(this.options.cwd, path);
|
|
10200
10241
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
10201
10242
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
10202
10243
|
if (event === EVENTS.ADD)
|
|
@@ -10211,8 +10252,8 @@ class FSWatcher extends EventEmitter {
|
|
|
10211
10252
|
}
|
|
10212
10253
|
_closePath(path) {
|
|
10213
10254
|
this._closeFile(path);
|
|
10214
|
-
const dir =
|
|
10215
|
-
this._getWatchedDir(dir).remove(
|
|
10255
|
+
const dir = sp2.dirname(path);
|
|
10256
|
+
this._getWatchedDir(dir).remove(sp2.basename(path));
|
|
10216
10257
|
}
|
|
10217
10258
|
_closeFile(path) {
|
|
10218
10259
|
const closers = this._closers.get(path);
|
|
@@ -11700,7 +11741,7 @@ function graphFork(newSpaceID) {
|
|
|
11700
11741
|
// package.json
|
|
11701
11742
|
var package_default = {
|
|
11702
11743
|
name: "@construct-space/cli",
|
|
11703
|
-
version: "1.9.
|
|
11744
|
+
version: "1.9.5",
|
|
11704
11745
|
description: "Construct CLI \u2014 scaffold, build, develop, and publish spaces",
|
|
11705
11746
|
type: "module",
|
|
11706
11747
|
bin: {
|
|
@@ -11719,7 +11760,9 @@ var package_default = {
|
|
|
11719
11760
|
build: "bun build src/index.ts --outdir dist --target bun --format esm && cp -r templates dist/",
|
|
11720
11761
|
dev: "bun run src/index.ts",
|
|
11721
11762
|
test: "bun test",
|
|
11722
|
-
typecheck: "tsc --noEmit"
|
|
11763
|
+
typecheck: "tsc --noEmit",
|
|
11764
|
+
lint: "eslint src",
|
|
11765
|
+
"lint:fix": "eslint src --fix"
|
|
11723
11766
|
},
|
|
11724
11767
|
dependencies: {
|
|
11725
11768
|
commander: "^14.0.3",
|
|
@@ -11730,7 +11773,10 @@ var package_default = {
|
|
|
11730
11773
|
},
|
|
11731
11774
|
devDependencies: {
|
|
11732
11775
|
"@types/bun": "latest",
|
|
11733
|
-
typescript: "^6.0.2"
|
|
11776
|
+
typescript: "^6.0.2",
|
|
11777
|
+
eslint: "^10.4.0",
|
|
11778
|
+
"@eslint/js": "^10.0.1",
|
|
11779
|
+
"typescript-eslint": "^8.59.4"
|
|
11734
11780
|
},
|
|
11735
11781
|
keywords: [
|
|
11736
11782
|
"construct",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@construct-space/cli",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
4
4
|
"description": "Construct CLI — scaffold, build, develop, and publish spaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"build": "bun build src/index.ts --outdir dist --target bun --format esm && cp -r templates dist/",
|
|
20
20
|
"dev": "bun run src/index.ts",
|
|
21
21
|
"test": "bun test",
|
|
22
|
-
"typecheck": "tsc --noEmit"
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"lint": "eslint src",
|
|
24
|
+
"lint:fix": "eslint src --fix"
|
|
23
25
|
},
|
|
24
26
|
"dependencies": {
|
|
25
27
|
"commander": "^14.0.3",
|
|
@@ -30,7 +32,10 @@
|
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@types/bun": "latest",
|
|
33
|
-
"typescript": "^6.0.2"
|
|
35
|
+
"typescript": "^6.0.2",
|
|
36
|
+
"eslint": "^10.4.0",
|
|
37
|
+
"@eslint/js": "^10.0.1",
|
|
38
|
+
"typescript-eslint": "^8.59.4"
|
|
34
39
|
},
|
|
35
40
|
"keywords": [
|
|
36
41
|
"construct",
|