@lousy-agents/lint 5.13.6 → 5.14.0
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/{27.js → 475.js} +6 -6
- package/dist/index.js +278 -310
- package/package.json +1 -1
package/dist/{27.js → 475.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const __rspack_esm_id =
|
|
2
|
-
export const __rspack_esm_ids = [
|
|
1
|
+
export const __rspack_esm_id = 475;
|
|
2
|
+
export const __rspack_esm_ids = [475];
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
4710(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
// ESM COMPAT FLAG
|
|
6
6
|
__webpack_require__.r(__webpack_exports__);
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ var promises_ = __webpack_require__(1455);
|
|
|
23
23
|
var external_node_path_ = __webpack_require__(6760);
|
|
24
24
|
// EXTERNAL MODULE: external "node:stream"
|
|
25
25
|
var external_node_stream_ = __webpack_require__(7075);
|
|
26
|
-
;// CONCATENATED MODULE: ../../node_modules/
|
|
26
|
+
;// CONCATENATED MODULE: ../../node_modules/readdirp/index.js
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -299,7 +299,7 @@ function readdirpPromise(root, options = {}) {
|
|
|
299
299
|
|
|
300
300
|
// EXTERNAL MODULE: external "node:os"
|
|
301
301
|
var external_node_os_ = __webpack_require__(8161);
|
|
302
|
-
;// CONCATENATED MODULE: ../../node_modules/
|
|
302
|
+
;// CONCATENATED MODULE: ../../node_modules/chokidar/handler.js
|
|
303
303
|
|
|
304
304
|
|
|
305
305
|
|
|
@@ -933,7 +933,7 @@ class NodeFsHandler {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
|
|
936
|
-
;// CONCATENATED MODULE: ../../node_modules/
|
|
936
|
+
;// CONCATENATED MODULE: ../../node_modules/chokidar/index.js
|
|
937
937
|
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
938
938
|
|
|
939
939
|
|
package/dist/index.js
CHANGED
|
@@ -566,7 +566,7 @@ module.exports = webpackEmptyAsyncContext;
|
|
|
566
566
|
|
|
567
567
|
|
|
568
568
|
},
|
|
569
|
-
|
|
569
|
+
5144(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
570
570
|
|
|
571
571
|
// EXPORTS
|
|
572
572
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -765,14 +765,17 @@ var dist = __webpack_require__(3519);
|
|
|
765
765
|
* Extracts YAML data between leading `---` delimiters.
|
|
766
766
|
*/
|
|
767
767
|
/**
|
|
768
|
-
* Parses YAML frontmatter
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
*/ function
|
|
768
|
+
* Parses YAML frontmatter and returns a tagged result:
|
|
769
|
+
* - `{ ok: true, data }` on success
|
|
770
|
+
* - `{ ok: false, reason: 'missing' }` when no frontmatter delimiters found
|
|
771
|
+
* - `{ ok: false, reason: 'invalid', detail }` when YAML is malformed (with error detail)
|
|
772
|
+
*/ function parseFrontmatterWithError(content) {
|
|
773
773
|
const lines = content.split("\n");
|
|
774
774
|
if (lines[0]?.trim() !== "---") {
|
|
775
|
-
return
|
|
775
|
+
return {
|
|
776
|
+
ok: false,
|
|
777
|
+
reason: "missing"
|
|
778
|
+
};
|
|
776
779
|
}
|
|
777
780
|
let endIndex = -1;
|
|
778
781
|
for(let i = 1; i < lines.length; i++){
|
|
@@ -782,7 +785,10 @@ var dist = __webpack_require__(3519);
|
|
|
782
785
|
}
|
|
783
786
|
}
|
|
784
787
|
if (endIndex === -1) {
|
|
785
|
-
return
|
|
788
|
+
return {
|
|
789
|
+
ok: false,
|
|
790
|
+
reason: "missing"
|
|
791
|
+
};
|
|
786
792
|
}
|
|
787
793
|
const yamlContent = lines.slice(1, endIndex).join("\n");
|
|
788
794
|
let data;
|
|
@@ -791,23 +797,39 @@ var dist = __webpack_require__(3519);
|
|
|
791
797
|
maxAliasCount: 0
|
|
792
798
|
});
|
|
793
799
|
data = parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
794
|
-
} catch
|
|
795
|
-
|
|
800
|
+
} catch (error) {
|
|
801
|
+
const detail = error instanceof Error ? error.message : "Unknown YAML parse error";
|
|
802
|
+
return {
|
|
803
|
+
ok: false,
|
|
804
|
+
reason: "invalid",
|
|
805
|
+
detail
|
|
806
|
+
};
|
|
796
807
|
}
|
|
797
808
|
const fieldLines = new Map();
|
|
798
809
|
for(let i = 1; i < endIndex; i++){
|
|
799
|
-
// Match YAML top-level field names: non-whitespace start, any chars except colon, then colon followed by whitespace or end-of-line
|
|
800
810
|
const match = lines[i]?.match(/^([^\s:][^:]*?):(?:\s|$)/);
|
|
801
811
|
if (match?.[1]) {
|
|
802
812
|
fieldLines.set(match[1], i + 1);
|
|
803
813
|
}
|
|
804
814
|
}
|
|
805
815
|
return {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
816
|
+
ok: true,
|
|
817
|
+
data: {
|
|
818
|
+
data: data ?? {},
|
|
819
|
+
fieldLines,
|
|
820
|
+
frontmatterStartLine: 1
|
|
821
|
+
}
|
|
809
822
|
};
|
|
810
823
|
}
|
|
824
|
+
/**
|
|
825
|
+
* Parses YAML frontmatter from markdown content.
|
|
826
|
+
*
|
|
827
|
+
* Returns `null` when the content has no opening `---`, no closing `---`,
|
|
828
|
+
* or contains invalid YAML.
|
|
829
|
+
*/ function parseFrontmatter(content) {
|
|
830
|
+
const result = parseFrontmatterWithError(content);
|
|
831
|
+
return result.ok ? result.data : null;
|
|
832
|
+
}
|
|
811
833
|
|
|
812
834
|
// EXTERNAL MODULE: external "node:fs"
|
|
813
835
|
var external_node_fs_ = __webpack_require__(3024);
|
|
@@ -17418,7 +17440,7 @@ function default_ok() {}
|
|
|
17418
17440
|
|
|
17419
17441
|
function unreachable() {}
|
|
17420
17442
|
|
|
17421
|
-
;// CONCATENATED MODULE: ../../node_modules/
|
|
17443
|
+
;// CONCATENATED MODULE: ../../node_modules/is-plain-obj/index.js
|
|
17422
17444
|
function isPlainObject(value) {
|
|
17423
17445
|
if (typeof value !== 'object' || value === null) {
|
|
17424
17446
|
return false;
|
|
@@ -31430,371 +31452,317 @@ var jsonc = __webpack_require__(5975);
|
|
|
31430
31452
|
|
|
31431
31453
|
|
|
31432
31454
|
|
|
31433
|
-
|
|
31434
31455
|
const defaultFindOptions = {
|
|
31435
|
-
|
|
31436
|
-
|
|
31437
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
31440
|
-
|
|
31441
|
-
|
|
31442
|
-
|
|
31443
|
-
} catch {
|
|
31444
|
-
}
|
|
31445
|
-
}
|
|
31456
|
+
startingFrom: ".",
|
|
31457
|
+
rootPattern: /^node_modules$/,
|
|
31458
|
+
reverse: false,
|
|
31459
|
+
test: (filePath) => {
|
|
31460
|
+
try {
|
|
31461
|
+
if ((0,external_node_fs_.statSync)(filePath).isFile()) return true;
|
|
31462
|
+
} catch {}
|
|
31463
|
+
}
|
|
31446
31464
|
};
|
|
31447
31465
|
async function findFile(filename, _options = {}) {
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
|
|
31452
|
-
|
|
31453
|
-
|
|
31454
|
-
|
|
31455
|
-
|
|
31456
|
-
|
|
31457
|
-
|
|
31458
|
-
|
|
31459
|
-
|
|
31460
|
-
|
|
31461
|
-
|
|
31462
|
-
|
|
31463
|
-
|
|
31464
|
-
|
|
31465
|
-
|
|
31466
|
-
|
|
31467
|
-
|
|
31468
|
-
|
|
31469
|
-
}
|
|
31470
|
-
}
|
|
31471
|
-
}
|
|
31472
|
-
} else {
|
|
31473
|
-
for (let index = segments.length; index > root; index--) {
|
|
31474
|
-
for (const filename2 of filenames) {
|
|
31475
|
-
const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename2);
|
|
31476
|
-
if (await options.test(filePath)) {
|
|
31477
|
-
return filePath;
|
|
31478
|
-
}
|
|
31479
|
-
}
|
|
31480
|
-
}
|
|
31481
|
-
}
|
|
31482
|
-
throw new Error(
|
|
31483
|
-
`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`
|
|
31484
|
-
);
|
|
31466
|
+
const filenames = Array.isArray(filename) ? filename : [filename];
|
|
31467
|
+
const options = {
|
|
31468
|
+
...defaultFindOptions,
|
|
31469
|
+
..._options
|
|
31470
|
+
};
|
|
31471
|
+
const basePath = pathe_M_eThtNZ_resolve(options.startingFrom);
|
|
31472
|
+
const leadingSlash = basePath[0] === "/";
|
|
31473
|
+
const segments = basePath.split("/").filter(Boolean);
|
|
31474
|
+
if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
|
|
31475
|
+
if (leadingSlash) segments[0] = "/" + segments[0];
|
|
31476
|
+
let root = segments.findIndex((r) => r.match(options.rootPattern));
|
|
31477
|
+
if (root === -1) root = 0;
|
|
31478
|
+
if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename of filenames) {
|
|
31479
|
+
const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename);
|
|
31480
|
+
if (await options.test(filePath)) return filePath;
|
|
31481
|
+
}
|
|
31482
|
+
else for (let index = segments.length; index > root; index--) for (const filename of filenames) {
|
|
31483
|
+
const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename);
|
|
31484
|
+
if (await options.test(filePath)) return filePath;
|
|
31485
|
+
}
|
|
31486
|
+
throw new Error(`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`);
|
|
31485
31487
|
}
|
|
31486
31488
|
function findNearestFile(filename, options = {}) {
|
|
31487
|
-
|
|
31489
|
+
return findFile(filename, options);
|
|
31488
31490
|
}
|
|
31489
31491
|
function findFarthestFile(filename, options = {}) {
|
|
31490
|
-
|
|
31492
|
+
return findFile(filename, {
|
|
31493
|
+
...options,
|
|
31494
|
+
reverse: true
|
|
31495
|
+
});
|
|
31491
31496
|
}
|
|
31492
|
-
|
|
31493
31497
|
function _resolvePath(id, opts = {}) {
|
|
31494
|
-
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
31499
|
-
|
|
31500
|
-
return resolveModulePath(id, {
|
|
31501
|
-
...opts,
|
|
31502
|
-
from: opts.from || opts.parent || opts.url
|
|
31503
|
-
});
|
|
31498
|
+
if (id instanceof URL || id.startsWith("file://")) return normalize((0,external_node_url_.fileURLToPath)(id));
|
|
31499
|
+
if (isAbsolute(id)) return normalize(id);
|
|
31500
|
+
return resolveModulePath(id, {
|
|
31501
|
+
...opts,
|
|
31502
|
+
from: opts.from || opts.parent || opts.url
|
|
31503
|
+
});
|
|
31504
31504
|
}
|
|
31505
|
-
|
|
31506
31505
|
const FileCache$1 = /* @__PURE__ */ (/* unused pure expression or super */ null && (new Map()));
|
|
31507
31506
|
function defineTSConfig(tsconfig) {
|
|
31508
|
-
|
|
31507
|
+
return tsconfig;
|
|
31509
31508
|
}
|
|
31510
31509
|
async function readTSConfig(id, options = {}) {
|
|
31511
|
-
|
|
31512
|
-
|
|
31513
|
-
|
|
31514
|
-
|
|
31515
|
-
|
|
31516
|
-
|
|
31517
|
-
const parsed = parseJSONC(text);
|
|
31518
|
-
cache.set(resolvedPath, parsed);
|
|
31519
|
-
return parsed;
|
|
31510
|
+
const resolvedPath = await resolveTSConfig(id, options);
|
|
31511
|
+
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache$1;
|
|
31512
|
+
if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
|
|
31513
|
+
const parsed = parseJSONC(await promises.readFile(resolvedPath, "utf8"));
|
|
31514
|
+
cache.set(resolvedPath, parsed);
|
|
31515
|
+
return parsed;
|
|
31520
31516
|
}
|
|
31521
31517
|
async function writeTSConfig(path, tsconfig) {
|
|
31522
|
-
|
|
31518
|
+
await promises.writeFile(path, stringifyJSONC(tsconfig));
|
|
31523
31519
|
}
|
|
31524
31520
|
async function resolveTSConfig(id = process.cwd(), options = {}) {
|
|
31525
|
-
|
|
31526
|
-
|
|
31527
|
-
|
|
31528
|
-
|
|
31521
|
+
return findNearestFile("tsconfig.json", {
|
|
31522
|
+
...options,
|
|
31523
|
+
startingFrom: _resolvePath(id, options)
|
|
31524
|
+
});
|
|
31529
31525
|
}
|
|
31530
|
-
|
|
31531
31526
|
const lockFiles = [
|
|
31532
|
-
|
|
31533
|
-
|
|
31534
|
-
|
|
31535
|
-
|
|
31536
|
-
|
|
31537
|
-
|
|
31538
|
-
|
|
31527
|
+
"yarn.lock",
|
|
31528
|
+
"package-lock.json",
|
|
31529
|
+
"pnpm-lock.yaml",
|
|
31530
|
+
"npm-shrinkwrap.json",
|
|
31531
|
+
"bun.lockb",
|
|
31532
|
+
"bun.lock",
|
|
31533
|
+
"deno.lock"
|
|
31534
|
+
];
|
|
31535
|
+
const packageFiles = [
|
|
31536
|
+
"package.json",
|
|
31537
|
+
"package.json5",
|
|
31538
|
+
"package.yaml"
|
|
31539
31539
|
];
|
|
31540
|
-
const packageFiles = ["package.json", "package.json5", "package.yaml"];
|
|
31541
31540
|
const workspaceFiles = [
|
|
31542
|
-
|
|
31543
|
-
|
|
31544
|
-
|
|
31545
|
-
|
|
31546
|
-
|
|
31547
|
-
|
|
31541
|
+
"pnpm-workspace.yaml",
|
|
31542
|
+
"lerna.json",
|
|
31543
|
+
"turbo.json",
|
|
31544
|
+
"rush.json",
|
|
31545
|
+
"deno.json",
|
|
31546
|
+
"deno.jsonc"
|
|
31548
31547
|
];
|
|
31549
31548
|
const FileCache = /* @__PURE__ */ new Map();
|
|
31550
31549
|
function definePackageJSON(pkg) {
|
|
31551
|
-
|
|
31550
|
+
return pkg;
|
|
31552
31551
|
}
|
|
31553
31552
|
async function findPackage(id = process.cwd(), options = {}) {
|
|
31554
|
-
|
|
31555
|
-
|
|
31556
|
-
|
|
31557
|
-
|
|
31553
|
+
return findNearestFile(packageFiles, {
|
|
31554
|
+
...options,
|
|
31555
|
+
startingFrom: _resolvePath(id, options)
|
|
31556
|
+
});
|
|
31558
31557
|
}
|
|
31559
31558
|
async function readPackage(id, options = {}) {
|
|
31560
|
-
|
|
31561
|
-
|
|
31562
|
-
|
|
31563
|
-
|
|
31564
|
-
|
|
31565
|
-
|
|
31566
|
-
|
|
31567
|
-
|
|
31568
|
-
|
|
31569
|
-
|
|
31570
|
-
|
|
31571
|
-
|
|
31572
|
-
|
|
31573
|
-
|
|
31574
|
-
} catch {
|
|
31575
|
-
parsed = parseJSONC(blob);
|
|
31576
|
-
}
|
|
31577
|
-
}
|
|
31578
|
-
cache.set(resolvedPath, parsed);
|
|
31579
|
-
return parsed;
|
|
31559
|
+
const resolvedPath = await findPackage(id, options);
|
|
31560
|
+
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
|
31561
|
+
if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
|
|
31562
|
+
const blob = await promises.readFile(resolvedPath, "utf8");
|
|
31563
|
+
let parsed;
|
|
31564
|
+
if (resolvedPath.endsWith(".json5")) parsed = parseJSON5(blob);
|
|
31565
|
+
else if (resolvedPath.endsWith(".yaml")) parsed = parseYAML(blob);
|
|
31566
|
+
else try {
|
|
31567
|
+
parsed = parseJSON(blob);
|
|
31568
|
+
} catch {
|
|
31569
|
+
parsed = parseJSONC(blob);
|
|
31570
|
+
}
|
|
31571
|
+
cache.set(resolvedPath, parsed);
|
|
31572
|
+
return parsed;
|
|
31580
31573
|
}
|
|
31581
31574
|
async function writePackage(path, pkg) {
|
|
31582
|
-
|
|
31583
|
-
|
|
31584
|
-
|
|
31585
|
-
|
|
31586
|
-
|
|
31587
|
-
} else {
|
|
31588
|
-
content = stringifyJSON(pkg);
|
|
31589
|
-
}
|
|
31590
|
-
await promises.writeFile(path, content);
|
|
31575
|
+
let content;
|
|
31576
|
+
if (path.endsWith(".json5")) content = stringifyJSON5(pkg);
|
|
31577
|
+
else if (path.endsWith(".yaml")) content = stringifyYAML(pkg);
|
|
31578
|
+
else content = stringifyJSON(pkg);
|
|
31579
|
+
await promises.writeFile(path, content);
|
|
31591
31580
|
}
|
|
31592
31581
|
async function readPackageJSON(id, options = {}) {
|
|
31593
|
-
|
|
31594
|
-
|
|
31595
|
-
|
|
31596
|
-
|
|
31597
|
-
|
|
31598
|
-
|
|
31599
|
-
|
|
31600
|
-
|
|
31601
|
-
|
|
31602
|
-
|
|
31603
|
-
|
|
31604
|
-
|
|
31605
|
-
cache.set(resolvedPath, parsed);
|
|
31606
|
-
return parsed;
|
|
31582
|
+
const resolvedPath = await resolvePackageJSON(id, options);
|
|
31583
|
+
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
|
31584
|
+
if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
|
|
31585
|
+
const blob = await external_node_fs_.promises.readFile(resolvedPath, "utf8");
|
|
31586
|
+
let parsed;
|
|
31587
|
+
try {
|
|
31588
|
+
parsed = json_n(blob);
|
|
31589
|
+
} catch {
|
|
31590
|
+
parsed = (0,jsonc.parseJSONC)(blob);
|
|
31591
|
+
}
|
|
31592
|
+
cache.set(resolvedPath, parsed);
|
|
31593
|
+
return parsed;
|
|
31607
31594
|
}
|
|
31608
31595
|
async function writePackageJSON(path, pkg) {
|
|
31609
|
-
|
|
31596
|
+
await promises.writeFile(path, stringifyJSON(pkg));
|
|
31610
31597
|
}
|
|
31611
31598
|
async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
|
31612
|
-
|
|
31613
|
-
|
|
31614
|
-
|
|
31615
|
-
|
|
31599
|
+
return findNearestFile("package.json", {
|
|
31600
|
+
...options,
|
|
31601
|
+
startingFrom: _resolvePath(id, options)
|
|
31602
|
+
});
|
|
31616
31603
|
}
|
|
31617
31604
|
async function resolveLockfile(id = process.cwd(), options = {}) {
|
|
31618
|
-
|
|
31619
|
-
|
|
31620
|
-
|
|
31621
|
-
|
|
31605
|
+
return findNearestFile(lockFiles, {
|
|
31606
|
+
...options,
|
|
31607
|
+
startingFrom: _resolvePath(id, options)
|
|
31608
|
+
});
|
|
31622
31609
|
}
|
|
31623
31610
|
const workspaceTests = {
|
|
31624
|
-
|
|
31625
|
-
|
|
31626
|
-
|
|
31627
|
-
|
|
31611
|
+
workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r)),
|
|
31612
|
+
gitConfig: (opts) => findFile(".git/config", opts).then((r) => pathe_M_eThtNZ_resolve(r, "../..")),
|
|
31613
|
+
lockFile: (opts) => findFile(lockFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r)),
|
|
31614
|
+
packageJson: (opts) => findFile(packageFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r))
|
|
31628
31615
|
};
|
|
31629
31616
|
async function findWorkspaceDir(id = process.cwd(), options = {}) {
|
|
31630
|
-
|
|
31631
|
-
|
|
31632
|
-
|
|
31633
|
-
|
|
31634
|
-
|
|
31635
|
-
|
|
31636
|
-
|
|
31637
|
-
|
|
31638
|
-
|
|
31639
|
-
|
|
31640
|
-
|
|
31641
|
-
|
|
31642
|
-
|
|
31643
|
-
|
|
31644
|
-
|
|
31645
|
-
|
|
31646
|
-
|
|
31647
|
-
|
|
31648
|
-
|
|
31617
|
+
const startingFrom = _resolvePath(id, options);
|
|
31618
|
+
const tests = options.tests || [
|
|
31619
|
+
"workspaceFile",
|
|
31620
|
+
"gitConfig",
|
|
31621
|
+
"lockFile",
|
|
31622
|
+
"packageJson"
|
|
31623
|
+
];
|
|
31624
|
+
for (const testName of tests) {
|
|
31625
|
+
const test = workspaceTests[testName];
|
|
31626
|
+
if (options[testName] === false || !test) continue;
|
|
31627
|
+
const direction = options[testName] || (testName === "gitConfig" ? "closest" : "furthest");
|
|
31628
|
+
const detected = await test({
|
|
31629
|
+
...options,
|
|
31630
|
+
startingFrom,
|
|
31631
|
+
reverse: direction === "furthest"
|
|
31632
|
+
}).catch(() => {});
|
|
31633
|
+
if (detected) return detected;
|
|
31634
|
+
}
|
|
31635
|
+
throw new Error(`Cannot detect workspace root from ${id}`);
|
|
31649
31636
|
}
|
|
31650
31637
|
async function updatePackage(id, callback, options = {}) {
|
|
31651
|
-
|
|
31652
|
-
|
|
31653
|
-
|
|
31654
|
-
|
|
31655
|
-
|
|
31656
|
-
|
|
31657
|
-
}
|
|
31658
|
-
return Reflect.get(target, prop);
|
|
31659
|
-
}
|
|
31660
|
-
});
|
|
31661
|
-
const updated = await callback(proxy) || pkg;
|
|
31662
|
-
await writePackage(resolvedPath, updated);
|
|
31638
|
+
const resolvedPath = await findPackage(id, options);
|
|
31639
|
+
const pkg = await readPackage(id, options);
|
|
31640
|
+
await writePackage(resolvedPath, await callback(new Proxy(pkg, { get(target, prop) {
|
|
31641
|
+
if (typeof prop === "string" && objectKeys.has(prop) && !Object.hasOwn(target, prop)) target[prop] = {};
|
|
31642
|
+
return Reflect.get(target, prop);
|
|
31643
|
+
} })) || pkg);
|
|
31663
31644
|
}
|
|
31664
31645
|
function sortPackage(pkg) {
|
|
31665
|
-
|
|
31666
|
-
|
|
31667
|
-
|
|
31668
|
-
|
|
31669
|
-
|
|
31670
|
-
|
|
31671
|
-
|
|
31672
|
-
|
|
31673
|
-
|
|
31674
|
-
|
|
31675
|
-
|
|
31676
|
-
|
|
31677
|
-
|
|
31678
|
-
|
|
31679
|
-
|
|
31680
|
-
|
|
31681
|
-
|
|
31682
|
-
|
|
31683
|
-
|
|
31684
|
-
const value = sorted[key];
|
|
31685
|
-
if (dist_isObject(value)) {
|
|
31686
|
-
sorted[key] = sortObject(value);
|
|
31687
|
-
}
|
|
31688
|
-
}
|
|
31689
|
-
return sorted;
|
|
31646
|
+
const sorted = {};
|
|
31647
|
+
const originalKeys = Object.keys(pkg);
|
|
31648
|
+
const knownKeysPresent = defaultFieldOrder.filter((key) => Object.hasOwn(pkg, key));
|
|
31649
|
+
for (const key of originalKeys) {
|
|
31650
|
+
const currentIndex = knownKeysPresent.indexOf(key);
|
|
31651
|
+
if (currentIndex === -1) {
|
|
31652
|
+
sorted[key] = pkg[key];
|
|
31653
|
+
continue;
|
|
31654
|
+
}
|
|
31655
|
+
for (let i = 0; i <= currentIndex; i++) {
|
|
31656
|
+
const knownKey = knownKeysPresent[i];
|
|
31657
|
+
if (!Object.hasOwn(sorted, knownKey)) sorted[knownKey] = pkg[knownKey];
|
|
31658
|
+
}
|
|
31659
|
+
}
|
|
31660
|
+
for (const key of [...dependencyKeys, "scripts"]) {
|
|
31661
|
+
const value = sorted[key];
|
|
31662
|
+
if (dist_isObject(value)) sorted[key] = sortObject(value);
|
|
31663
|
+
}
|
|
31664
|
+
return sorted;
|
|
31690
31665
|
}
|
|
31691
31666
|
function normalizePackage(pkg) {
|
|
31692
|
-
|
|
31693
|
-
|
|
31694
|
-
|
|
31695
|
-
|
|
31696
|
-
|
|
31697
|
-
|
|
31698
|
-
|
|
31699
|
-
delete normalized[key];
|
|
31700
|
-
}
|
|
31701
|
-
}
|
|
31702
|
-
return normalized;
|
|
31667
|
+
const normalized = sortPackage(pkg);
|
|
31668
|
+
for (const key of dependencyKeys) {
|
|
31669
|
+
if (!Object.hasOwn(normalized, key)) continue;
|
|
31670
|
+
const value = normalized[key];
|
|
31671
|
+
if (!dist_isObject(value)) delete normalized[key];
|
|
31672
|
+
}
|
|
31673
|
+
return normalized;
|
|
31703
31674
|
}
|
|
31704
31675
|
function dist_isObject(value) {
|
|
31705
|
-
|
|
31676
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31706
31677
|
}
|
|
31707
31678
|
function sortObject(obj) {
|
|
31708
|
-
|
|
31709
|
-
Object.entries(obj).sort(([a], [b]) => a.localeCompare(b))
|
|
31710
|
-
);
|
|
31679
|
+
return Object.fromEntries(Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)));
|
|
31711
31680
|
}
|
|
31712
31681
|
const dependencyKeys = (/* unused pure expression or super */ null && ([
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31682
|
+
"dependencies",
|
|
31683
|
+
"devDependencies",
|
|
31684
|
+
"optionalDependencies",
|
|
31685
|
+
"peerDependencies"
|
|
31717
31686
|
]));
|
|
31718
|
-
const objectKeys =
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
|
|
31722
|
-
|
|
31723
|
-
|
|
31724
|
-
|
|
31725
|
-
|
|
31726
|
-
|
|
31727
|
-
|
|
31728
|
-
|
|
31729
|
-
|
|
31730
|
-
|
|
31731
|
-
])
|
|
31687
|
+
const objectKeys = new Set([
|
|
31688
|
+
"typesVersions",
|
|
31689
|
+
"scripts",
|
|
31690
|
+
"resolutions",
|
|
31691
|
+
"overrides",
|
|
31692
|
+
"dependencies",
|
|
31693
|
+
"devDependencies",
|
|
31694
|
+
"dependenciesMeta",
|
|
31695
|
+
"peerDependencies",
|
|
31696
|
+
"peerDependenciesMeta",
|
|
31697
|
+
"optionalDependencies",
|
|
31698
|
+
"engines",
|
|
31699
|
+
"publishConfig"
|
|
31700
|
+
]);
|
|
31732
31701
|
const defaultFieldOrder = (/* unused pure expression or super */ null && ([
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31751
|
-
|
|
31752
|
-
|
|
31753
|
-
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31764
|
-
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
|
|
31769
|
-
|
|
31770
|
-
|
|
31771
|
-
|
|
31772
|
-
|
|
31702
|
+
"$schema",
|
|
31703
|
+
"name",
|
|
31704
|
+
"version",
|
|
31705
|
+
"private",
|
|
31706
|
+
"description",
|
|
31707
|
+
"keywords",
|
|
31708
|
+
"homepage",
|
|
31709
|
+
"bugs",
|
|
31710
|
+
"repository",
|
|
31711
|
+
"funding",
|
|
31712
|
+
"license",
|
|
31713
|
+
"author",
|
|
31714
|
+
"sideEffects",
|
|
31715
|
+
"type",
|
|
31716
|
+
"imports",
|
|
31717
|
+
"exports",
|
|
31718
|
+
"main",
|
|
31719
|
+
"module",
|
|
31720
|
+
"browser",
|
|
31721
|
+
"types",
|
|
31722
|
+
"typesVersions",
|
|
31723
|
+
"typings",
|
|
31724
|
+
"bin",
|
|
31725
|
+
"man",
|
|
31726
|
+
"files",
|
|
31727
|
+
"workspaces",
|
|
31728
|
+
"scripts",
|
|
31729
|
+
"resolutions",
|
|
31730
|
+
"overrides",
|
|
31731
|
+
"dependencies",
|
|
31732
|
+
"devDependencies",
|
|
31733
|
+
"dependenciesMeta",
|
|
31734
|
+
"peerDependencies",
|
|
31735
|
+
"peerDependenciesMeta",
|
|
31736
|
+
"optionalDependencies",
|
|
31737
|
+
"bundledDependencies",
|
|
31738
|
+
"bundleDependencies",
|
|
31739
|
+
"packageManager",
|
|
31740
|
+
"engines",
|
|
31741
|
+
"publishConfig"
|
|
31773
31742
|
]));
|
|
31774
|
-
|
|
31775
31743
|
function defineGitConfig(config) {
|
|
31776
|
-
|
|
31744
|
+
return config;
|
|
31777
31745
|
}
|
|
31778
31746
|
async function resolveGitConfig(dir, opts) {
|
|
31779
|
-
|
|
31747
|
+
return findNearestFile(".git/config", {
|
|
31748
|
+
...opts,
|
|
31749
|
+
startingFrom: dir
|
|
31750
|
+
});
|
|
31780
31751
|
}
|
|
31781
31752
|
async function readGitConfig(dir, opts) {
|
|
31782
|
-
|
|
31783
|
-
const ini = await readFile(path, "utf8");
|
|
31784
|
-
return parseGitConfig(ini);
|
|
31753
|
+
return parseGitConfig(await readFile(await resolveGitConfig(dir, opts), "utf8"));
|
|
31785
31754
|
}
|
|
31786
31755
|
async function writeGitConfig(path, config) {
|
|
31787
|
-
|
|
31756
|
+
await writeFile(path, stringifyGitConfig(config));
|
|
31788
31757
|
}
|
|
31789
31758
|
function parseGitConfig(ini) {
|
|
31790
|
-
|
|
31759
|
+
return parseINI(ini.replaceAll(/^\[(\w+) "(.+)"\]$/gm, "[$1.$2]"));
|
|
31791
31760
|
}
|
|
31792
31761
|
function stringifyGitConfig(config) {
|
|
31793
|
-
|
|
31762
|
+
return stringifyINI(config).replaceAll(/^\[(\w+)\.(\w+)\]$/gm, "[$1 \"$2\"]");
|
|
31794
31763
|
}
|
|
31795
31764
|
|
|
31796
31765
|
|
|
31797
|
-
|
|
31798
31766
|
;// CONCATENATED MODULE: ../../node_modules/c12/dist/index.mjs
|
|
31799
31767
|
|
|
31800
31768
|
|
|
@@ -32165,7 +32133,7 @@ async function watchConfig(options) {
|
|
|
32165
32133
|
options.rcFile && resolve(l.cwd, typeof options.rcFile === "string" ? options.rcFile : `.${configName}rc`),
|
|
32166
32134
|
options.packageJson && resolve(l.cwd, "package.json")
|
|
32167
32135
|
]).filter(Boolean))];
|
|
32168
|
-
const watch = await __webpack_require__.e(/* import() */
|
|
32136
|
+
const watch = await __webpack_require__.e(/* import() */ 475).then(__webpack_require__.bind(__webpack_require__, 4710)).then((r) => r.watch || r.default || r);
|
|
32169
32137
|
const { diff } = await __webpack_require__.e(/* import() */ 164).then(__webpack_require__.bind(__webpack_require__, 263));
|
|
32170
32138
|
const _fswatcher = watch(watchingFiles, {
|
|
32171
32139
|
ignoreInitial: true,
|
|
@@ -42371,7 +42339,7 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
|
|
|
42371
42339
|
// module factories are used so entry inlining is disabled
|
|
42372
42340
|
// startup
|
|
42373
42341
|
// Load entry module and return exports
|
|
42374
|
-
var __webpack_exports__ = __webpack_require__(
|
|
42342
|
+
var __webpack_exports__ = __webpack_require__(5144);
|
|
42375
42343
|
var __webpack_exports__DEFAULT_LINT_RULES = __webpack_exports__.Kd;
|
|
42376
42344
|
var __webpack_exports__LintValidationError = __webpack_exports__.F5;
|
|
42377
42345
|
var __webpack_exports__createFormatter = __webpack_exports__.xi;
|
package/package.json
CHANGED