@antelopejs/tooling-configs 0.7.1 → 0.7.2
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/README.md +5 -3
- package/dist/bin/api-diff.mjs +22 -1
- package/dist/bin/checks.mjs +1 -1
- package/dist/bin/comment-proof.mjs +1 -1
- package/dist/bin/sync.mjs +121 -44
- package/dist/bin/verify.mjs +21 -21
- package/dist/{checks-DJ_CFEZH.mjs → checks-DvND3Ngb.mjs} +198 -67
- package/dist/{docs-compat-CSljVi3O.mjs → docs-compat-BAZiPLZt.mjs} +5 -7
- package/dist/eslint.mjs +2 -2
- package/dist/{guardrails-6i82vsUi.mjs → guardrails-PoMIcyGb.mjs} +418 -83
- package/dist/oxc/guardrails/index.mjs +1 -1
- package/dist/oxc/lint.d.mts +1 -0
- package/dist/oxc/lint.mjs +1 -1
- package/dist/pack-tarball-Cn4zGKn7.mjs +40 -0
- package/dist/{type-aware-rules-Da3769fI.mjs → type-aware-rules-BxhHbizU.mjs} +15 -2
- package/dist/{typescript-CxfNxyr2.mjs → typescript-QfxkJYzd.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { t as CEILINGS_FILE } from "./ceilings-B7KayYIG.mjs";
|
|
2
2
|
import { l as serializeManifest, o as packageManager, s as parseManifest } from "./package-DDG3YH7W.mjs";
|
|
3
|
-
import { f as parseJson } from "./json-CG2L7YFl.mjs";
|
|
3
|
+
import { a as isString, f as parseJson, i as isObject, u as optStr } from "./json-CG2L7YFl.mjs";
|
|
4
4
|
import { a as gitFiles, u as trackedManifests } from "./files-C-JJhExM.mjs";
|
|
5
|
-
import { n as workspaceDirectories } from "./docs-compat-
|
|
5
|
+
import { i as DMS_PACKAGES, n as workspaceDirectories } from "./docs-compat-BAZiPLZt.mjs";
|
|
6
6
|
import { n as shimInvocation, t as runCommand } from "./run-command-BlFRPORx.mjs";
|
|
7
7
|
import { n as tagVersion } from "./npm-CIIqL5SG.mjs";
|
|
8
|
+
import { n as packTarball } from "./pack-tarball-Cn4zGKn7.mjs";
|
|
8
9
|
import { t as accepting } from "./ports-DAeEJsYh.mjs";
|
|
9
10
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
10
11
|
import { basename, dirname, join, posix, relative, resolve, sep } from "node:path";
|
|
@@ -13,8 +14,8 @@ import { isMap, isScalar, isSeq, parseAllDocuments, parseDocument, stringify } f
|
|
|
13
14
|
import ts from "@typescript/typescript6";
|
|
14
15
|
import { createHash } from "node:crypto";
|
|
15
16
|
import { tmpdir } from "node:os";
|
|
17
|
+
import { Range, gtr, minVersion, prerelease, satisfies, valid, validRange } from "semver";
|
|
16
18
|
import { gunzipSync } from "node:zlib";
|
|
17
|
-
import { validRange } from "semver";
|
|
18
19
|
import { minimatch } from "minimatch";
|
|
19
20
|
//#region src/guardrails/run-pnpm.ts
|
|
20
21
|
/** Runs pnpm, the only manager the pack's CI installs with, with `args` quietly; returns its output only when it failed. */
|
|
@@ -43,6 +44,7 @@ function runPnpm(root, args) {
|
|
|
43
44
|
* next patch release.
|
|
44
45
|
*/
|
|
45
46
|
const ANTELOPEJS_SCOPE$1 = "@antelopejs/";
|
|
47
|
+
const INTERFACE_PREFIX = `${ANTELOPEJS_SCOPE$1}interface-`;
|
|
46
48
|
/** A linked folder is the copy the dependent builds against, not a release it resolves. */
|
|
47
49
|
const LINK_SPEC_PREFIXES = ["file:", "link:"];
|
|
48
50
|
/** pnpm replaces a `workspace:` spec with a range on the sibling's version when it publishes the package. */
|
|
@@ -224,11 +226,95 @@ function checkDependencyRanges(manifest, localVersions = /* @__PURE__ */ new Map
|
|
|
224
226
|
}
|
|
225
227
|
return violations;
|
|
226
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* The `@antelopejs/interface-*` ranges of `manifest` that resolve from the registry: neither a linked folder nor a
|
|
231
|
+
* `workspace:` sibling.
|
|
232
|
+
*/
|
|
233
|
+
function interfaceRanges(manifest) {
|
|
234
|
+
return CHECKED_FIELDS.flatMap((field) => Object.entries(manifest[field] ?? {}).filter(([name, spec]) => name.startsWith(INTERFACE_PREFIX) && !isLinkSpec(spec) && !spec.startsWith(WORKSPACE_PREFIX)).map(([name, spec]) => ({
|
|
235
|
+
field,
|
|
236
|
+
name,
|
|
237
|
+
spec
|
|
238
|
+
})));
|
|
239
|
+
}
|
|
227
240
|
function describeViolation(violation) {
|
|
228
241
|
const { field, name, spec, local, expected } = violation;
|
|
229
242
|
return `${field}["${name}"] is "${spec}": AntelopeJS packages ship breaking changes in minor releases, so it must stop below the next minor${local === void 0 ? "" : ` and admit ${local}, the version in this repository`}; ${expected ? `use "${expected}"` : "declare it as >=<floor> <next minor> on 0.x or ~<floor> from 1.0"}`;
|
|
230
243
|
}
|
|
231
244
|
//#endregion
|
|
245
|
+
//#region src/guardrails/registry.ts
|
|
246
|
+
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
247
|
+
/** How long one registry read may take before it counts as failed. */
|
|
248
|
+
const REGISTRY_TIMEOUT_MS = 3e3;
|
|
249
|
+
/** How many times a read that failed or timed out is made before the document counts as unreadable. */
|
|
250
|
+
const REGISTRY_ATTEMPTS = 2;
|
|
251
|
+
/** The dependency fields a release resolves an interface it implements from. */
|
|
252
|
+
const RELEASE_FIELDS = [
|
|
253
|
+
"dependencies",
|
|
254
|
+
"peerDependencies",
|
|
255
|
+
"optionalDependencies"
|
|
256
|
+
];
|
|
257
|
+
/** The registry npm is configured with, ending in `/`. */
|
|
258
|
+
function registry() {
|
|
259
|
+
const configured = process.env.npm_config_registry || process.env.NPM_CONFIG_REGISTRY;
|
|
260
|
+
if (!configured) return DEFAULT_REGISTRY;
|
|
261
|
+
return configured.endsWith("/") ? configured : `${configured}/`;
|
|
262
|
+
}
|
|
263
|
+
/** What {@link readRegistry} returns when the registry answers that nothing is published at a path. */
|
|
264
|
+
const UNPUBLISHED = "unpublished";
|
|
265
|
+
/** The document at `path` under the {@link registry}, {@link UNPUBLISHED} when the registry answers 404, or `undefined` when it cannot be read within {@link REGISTRY_ATTEMPTS} reads of {@link REGISTRY_TIMEOUT_MS} each. */
|
|
266
|
+
async function readRegistry(path, accept) {
|
|
267
|
+
for (let attempt = 0; attempt < REGISTRY_ATTEMPTS; attempt++) try {
|
|
268
|
+
const response = await fetch(new URL(path, registry()), {
|
|
269
|
+
headers: { accept },
|
|
270
|
+
signal: AbortSignal.timeout(REGISTRY_TIMEOUT_MS)
|
|
271
|
+
});
|
|
272
|
+
if (response.status === 404) return UNPUBLISHED;
|
|
273
|
+
if (!response.ok) return void 0;
|
|
274
|
+
return { document: parseJson(await response.text()) };
|
|
275
|
+
} catch {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const encodedName = (name) => name.replace("/", "%2f");
|
|
280
|
+
/** The `latest` dist-tag of `name` on the {@link registry}, or `undefined` when it cannot be read. */
|
|
281
|
+
async function publishedVersion(name) {
|
|
282
|
+
const packument = await readRegistry(encodedName(name), "application/vnd.npm.install-v1+json");
|
|
283
|
+
return packument === void 0 || packument === UNPUBLISHED ? void 0 : tagVersion(packument.document, "latest");
|
|
284
|
+
}
|
|
285
|
+
function declaredRange(release, name) {
|
|
286
|
+
for (const field of RELEASE_FIELDS) {
|
|
287
|
+
const dependencies = Object.hasOwn(release, field) ? release[field] : void 0;
|
|
288
|
+
const range = dependencies !== void 0 && isObject(dependencies) ? optStr(dependencies, name) : void 0;
|
|
289
|
+
if (range !== void 0) return range;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function implementedNames(release) {
|
|
293
|
+
const config = Object.hasOwn(release, "antelopeJs") ? release.antelopeJs : void 0;
|
|
294
|
+
if (config === void 0 || !isObject(config)) return [];
|
|
295
|
+
const names = Object.hasOwn(config, "implements") ? config.implements : void 0;
|
|
296
|
+
return Array.isArray(names) ? names.filter(isString) : [];
|
|
297
|
+
}
|
|
298
|
+
/** The release the `latest` dist-tag of `name` points at, `"unpublished"` when the registry has none, or `undefined` when it cannot be read. */
|
|
299
|
+
async function implementingRelease(name) {
|
|
300
|
+
const read = await readRegistry(`${encodedName(name)}/latest`, "application/json");
|
|
301
|
+
if (read === UNPUBLISHED) return UNPUBLISHED;
|
|
302
|
+
const release = read?.document;
|
|
303
|
+
if (release === void 0 || !isObject(release)) return void 0;
|
|
304
|
+
const version = optStr(release, "version");
|
|
305
|
+
if (version === void 0) return void 0;
|
|
306
|
+
const implemented = /* @__PURE__ */ new Map();
|
|
307
|
+
for (const interfaceName of implementedNames(release)) {
|
|
308
|
+
const range = declaredRange(release, interfaceName);
|
|
309
|
+
if (range !== void 0) implemented.set(interfaceName, range);
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
name,
|
|
313
|
+
version,
|
|
314
|
+
implements: implemented
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
232
318
|
//#region src/guardrails/dependency-ranges-sync.ts
|
|
233
319
|
/** Each tracked manifest that parses; a fixture that is not JSON is not a package this repository releases. */
|
|
234
320
|
function tracked(root) {
|
|
@@ -300,11 +386,93 @@ function moveDependencyRanges(root, check) {
|
|
|
300
386
|
function hasDependencyRanges(root) {
|
|
301
387
|
return tracked(root).some(({ manifest }) => declaresAntelopePackage(manifest));
|
|
302
388
|
}
|
|
303
|
-
|
|
304
|
-
|
|
389
|
+
function belowNewest(spec, version) {
|
|
390
|
+
if (version === void 0 || valid(version) === null || prerelease(version) !== null || !gtr(version, spec)) return void 0;
|
|
391
|
+
const expected = cappedReplacement(spec, version);
|
|
392
|
+
return expected === void 0 ? void 0 : {
|
|
393
|
+
reason: `which stops below ${version}, its newest published version`,
|
|
394
|
+
expected
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
/** The lowest release `range` admits, without the prerelease suffix a floor such as `^0.10.0-rc.1` carries. */
|
|
398
|
+
function stableFloor(range) {
|
|
399
|
+
const floor = minVersion(range);
|
|
400
|
+
return floor === null ? void 0 : `${floor.major}.${floor.minor}.${floor.patch}`;
|
|
401
|
+
}
|
|
402
|
+
/** Whether one release admitted by `a` is also admitted by `b`, counting releases only, as an install resolves them. */
|
|
403
|
+
function sharesRelease(a, b) {
|
|
404
|
+
return new Range(a).set.some((left) => new Range(b).set.some((right) => {
|
|
405
|
+
const both = [...left, ...right].join(" ");
|
|
406
|
+
const floor = stableFloor(both);
|
|
407
|
+
return floor !== void 0 && satisfies(floor, both);
|
|
408
|
+
}));
|
|
409
|
+
}
|
|
410
|
+
/** The implementation of `name` in each of `releases` that is not a prerelease and declares a range semver reads. */
|
|
411
|
+
function implementations(name, releases) {
|
|
412
|
+
return releases.flatMap((release) => {
|
|
413
|
+
const range = release.implements.get(name);
|
|
414
|
+
return range === void 0 || prerelease(release.version) !== null || validRange(range) === null ? [] : [{
|
|
415
|
+
release,
|
|
416
|
+
range
|
|
417
|
+
}];
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function outsideImplemented(spec, { release, range }) {
|
|
421
|
+
if (sharesRelease(spec, range)) return void 0;
|
|
422
|
+
const floor = stableFloor(range);
|
|
423
|
+
const expected = floor === void 0 ? void 0 : cappedReplacement(spec, floor);
|
|
424
|
+
return expected === void 0 ? void 0 : {
|
|
425
|
+
reason: `which excludes "${range}", the range ${release.name} ${release.version}, its newest release, implements it on`,
|
|
426
|
+
expected
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/** The newest release of each DMS package outside this repository that could be read, and whether every published one could. */
|
|
430
|
+
async function dmsReleases(local) {
|
|
431
|
+
const reads = await Promise.all(DMS_PACKAGES.filter((name) => !local.has(name)).map(implementingRelease));
|
|
432
|
+
return {
|
|
433
|
+
releases: reads.filter((read) => read !== void 0 && read !== "unpublished"),
|
|
434
|
+
complete: !reads.includes(void 0)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* One line per range among `ranges` that shares no release with the range the newest release of a DMS package outside
|
|
439
|
+
* `local` implements its interface on, since a project loads the interface version that release is built against. An
|
|
440
|
+
* interface no such release implements is held instead to the `latest` dist-tag of its package: one line when every
|
|
441
|
+
* release the range admits sits below it, and only when every published DMS release could be read, since an unread one
|
|
442
|
+
* may implement it. A line that gives the fix an earlier one gave is skipped. A package whose release cannot be read,
|
|
443
|
+
* or whose `latest` is a prerelease, is skipped, so a registry outage leaves only the cap rule deciding the step.
|
|
444
|
+
*/
|
|
445
|
+
async function staleRanges(ranges, local) {
|
|
446
|
+
if (!ranges.length) return [];
|
|
447
|
+
const names = [...new Set(ranges.map(({ name }) => name))];
|
|
448
|
+
const [newest, { releases, complete }] = await Promise.all([Promise.all(names.map(async (name) => [name, await publishedVersion(name)])).then((entries) => new Map(entries)), dmsReleases(local)]);
|
|
449
|
+
return ranges.flatMap(({ path, field, name, spec }) => {
|
|
450
|
+
if (validRange(spec) === null) return [];
|
|
451
|
+
const implemented = implementations(name, releases);
|
|
452
|
+
const findings = (implemented.length ? implemented.map((implementation) => outsideImplemented(spec, implementation)) : complete ? [belowNewest(spec, newest.get(name))] : []).filter((finding) => finding !== void 0);
|
|
453
|
+
return findings.filter(({ expected }, index) => findings.findIndex((finding) => finding.expected === expected) === index).map(({ reason, expected }) => `${path}: ${field}["${name}"] is "${spec}", ${reason}, and @antelopejs/core loads one copy of each interface; use "${expected}"\n`);
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Each `@antelopejs/*` range in a tracked manifest that does not stop below the next minor, and each capped
|
|
458
|
+
* `@antelopejs/interface-*` range on a package outside this repository that the newest DMS release implementing it, or
|
|
459
|
+
* else its newest published release, does not admit, one line each; empty when every range passes.
|
|
460
|
+
*/
|
|
461
|
+
async function checkRepositoryRanges(root) {
|
|
305
462
|
const manifests = tracked(root);
|
|
306
463
|
const versions = localVersions(manifests.map(({ manifest }) => manifest));
|
|
307
|
-
|
|
464
|
+
const capped = [];
|
|
465
|
+
const published = [];
|
|
466
|
+
for (const { path, manifest } of manifests) {
|
|
467
|
+
const violations = checkDependencyRanges(manifest, versions);
|
|
468
|
+
capped.push(...violations.map((violation) => `${path}: ${describeViolation(violation)}\n`));
|
|
469
|
+
published.push(...interfaceRanges(manifest).filter(({ field, name }) => !versions.has(name) && !violations.some((violation) => violation.field === field && violation.name === name)).map((range) => ({
|
|
470
|
+
path,
|
|
471
|
+
...range
|
|
472
|
+
})));
|
|
473
|
+
}
|
|
474
|
+
const local = new Set(manifests.flatMap(({ manifest: { name } }) => name ? [name] : []));
|
|
475
|
+
return [...capped, ...await staleRanges(published, local)].join("");
|
|
308
476
|
}
|
|
309
477
|
//#endregion
|
|
310
478
|
//#region src/guardrails/git-identity.ts
|
|
@@ -430,38 +598,6 @@ function entrySpecifiers(name, exports, files, consumer) {
|
|
|
430
598
|
};
|
|
431
599
|
}
|
|
432
600
|
//#endregion
|
|
433
|
-
//#region src/guardrails/pack-tarball.ts
|
|
434
|
-
/** The flag that stops `pack` from running lifecycle scripts, by package manager. */
|
|
435
|
-
const IGNORE_SCRIPTS = {
|
|
436
|
-
pnpm: "--config.ignore-scripts=true",
|
|
437
|
-
npm: "--ignore-scripts"
|
|
438
|
-
};
|
|
439
|
-
/**
|
|
440
|
-
* Packs the package in `cwd` into `destination`: runs its `prepack` through `<manager> run`, which uses the configured
|
|
441
|
-
* script shell, then `<manager> pack` with lifecycle scripts off, since `pnpm pack` runs them through cmd.exe on Windows
|
|
442
|
-
* whatever the script shell, so a POSIX `prepare` fails there. Returns the first failed command, else the pack.
|
|
443
|
-
*/
|
|
444
|
-
async function packTarball(manager, cwd, destination, signal) {
|
|
445
|
-
const prepack = await runCommand(manager, [
|
|
446
|
-
"run",
|
|
447
|
-
"--if-present",
|
|
448
|
-
"prepack"
|
|
449
|
-
], {
|
|
450
|
-
cwd,
|
|
451
|
-
signal
|
|
452
|
-
});
|
|
453
|
-
if (prepack.status !== 0) return prepack;
|
|
454
|
-
return runCommand(manager, [
|
|
455
|
-
"pack",
|
|
456
|
-
IGNORE_SCRIPTS[manager],
|
|
457
|
-
"--pack-destination",
|
|
458
|
-
destination
|
|
459
|
-
], {
|
|
460
|
-
cwd,
|
|
461
|
-
signal
|
|
462
|
-
});
|
|
463
|
-
}
|
|
464
|
-
//#endregion
|
|
465
601
|
//#region src/guardrails/published-types.ts
|
|
466
602
|
const DECLARATION_FILE = /\.d\.[cm]?ts$/;
|
|
467
603
|
/** An `exports` map that names declarations: a `types` condition or a `.d.ts`, `.d.mts` or `.d.cts` target. */
|
|
@@ -700,11 +836,6 @@ async function checkPublishedTypes(root, signal) {
|
|
|
700
836
|
/** An object literal holding no other, such as a config example's `source: { package, version }`. */
|
|
701
837
|
const FLAT_OBJECT = /\{[^{}]*\}/g;
|
|
702
838
|
const ANTELOPEJS_SCOPE = "@antelopejs/";
|
|
703
|
-
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
704
|
-
/** How long one read of a package's dist-tags may take before it counts as failed. */
|
|
705
|
-
const REGISTRY_TIMEOUT_MS = 3e3;
|
|
706
|
-
/** How many times a read that failed or timed out is made before the version counts as unreadable. */
|
|
707
|
-
const REGISTRY_ATTEMPTS = 2;
|
|
708
839
|
function stringField(body, key) {
|
|
709
840
|
return new RegExp(String.raw`(?<![\w$-])["']?${key}["']?\s*:\s*["']([^"'\n]+)["']`).exec(body);
|
|
710
841
|
}
|
|
@@ -749,23 +880,6 @@ function readmeExamples(root) {
|
|
|
749
880
|
const packages = ownPackages(root);
|
|
750
881
|
return readmes.flatMap((readme) => examplesIn(readme, readFileSync(join(root, readme), "utf8"), packages));
|
|
751
882
|
}
|
|
752
|
-
function registry() {
|
|
753
|
-
const configured = process.env.npm_config_registry || process.env.NPM_CONFIG_REGISTRY;
|
|
754
|
-
if (!configured) return DEFAULT_REGISTRY;
|
|
755
|
-
return configured.endsWith("/") ? configured : `${configured}/`;
|
|
756
|
-
}
|
|
757
|
-
/** The `latest` dist-tag of `name` on the registry npm is configured with, or `undefined` when it cannot be read within {@link REGISTRY_ATTEMPTS} reads of {@link REGISTRY_TIMEOUT_MS} each. */
|
|
758
|
-
async function publishedVersion(name) {
|
|
759
|
-
for (let attempt = 0; attempt < REGISTRY_ATTEMPTS; attempt++) try {
|
|
760
|
-
const response = await fetch(new URL(name.replace("/", "%2f"), registry()), {
|
|
761
|
-
headers: { accept: "application/vnd.npm.install-v1+json" },
|
|
762
|
-
signal: AbortSignal.timeout(REGISTRY_TIMEOUT_MS)
|
|
763
|
-
});
|
|
764
|
-
return response.ok ? tagVersion(parseJson(await response.text()), "latest") : void 0;
|
|
765
|
-
} catch {
|
|
766
|
-
continue;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
883
|
async function newestVersions(examples) {
|
|
770
884
|
const names = [...new Set(examples.map(({ name }) => name))];
|
|
771
885
|
const entries = await Promise.all(names.map(async (name) => {
|
|
@@ -1214,21 +1328,38 @@ function declaresWorkspaces(path) {
|
|
|
1214
1328
|
throw error;
|
|
1215
1329
|
}
|
|
1216
1330
|
}
|
|
1331
|
+
/** Whether a `pnpm-workspace.yaml` lists `packages`, or cannot be read and so might; an empty one, or one without them, holds its own folder only. */
|
|
1332
|
+
function declaresPackages(path) {
|
|
1333
|
+
if (!existsSync(path)) return false;
|
|
1334
|
+
const document = parseDocument(readFileSync(path, "utf8"));
|
|
1335
|
+
if (document.errors.length > 0) return true;
|
|
1336
|
+
const { contents } = document;
|
|
1337
|
+
if (contents === null || isScalar(contents) && contents.value === null) return false;
|
|
1338
|
+
return !isMap(contents) || contents.has("packages");
|
|
1339
|
+
}
|
|
1217
1340
|
/**
|
|
1218
|
-
* Whether a folder above `folder` holds a workspace that may list it, a `pnpm-workspace.yaml`
|
|
1219
|
-
* `workspaces`: its membership then follows patterns this check does not evaluate, and that workspace's
|
|
1341
|
+
* Whether a folder above `folder` holds a workspace that may list it, a `pnpm-workspace.yaml` with `packages` or a
|
|
1342
|
+
* `package.json` with `workspaces`: its membership then follows patterns this check does not evaluate, and that workspace's
|
|
1343
|
+
* lockfile may hold it.
|
|
1220
1344
|
*/
|
|
1221
1345
|
function inWorkspace(root, folder) {
|
|
1222
|
-
return ancestors(folder).some((above) =>
|
|
1346
|
+
return ancestors(folder).some((above) => declaresPackages(join(root, above, PNPM_WORKSPACE)) || declaresWorkspaces(join(root, above, MANIFEST)));
|
|
1223
1347
|
}
|
|
1224
1348
|
function fixCommand(root, folder, lockfile) {
|
|
1225
1349
|
if (lockfile === NPM_LOCK) return `npm install --package-lock-only --prefix ${folder}`;
|
|
1226
1350
|
return existsSync(join(root, folder, PNPM_WORKSPACE)) ? `pnpm install --dir ${folder} --lockfile-only` : `pnpm install --dir ${folder} --ignore-workspace --lockfile-only`;
|
|
1227
1351
|
}
|
|
1352
|
+
/** The lockfile an install writes in a folder that holds none: `package-lock.json` when a folder above holds one, `pnpm-lock.yaml` otherwise. */
|
|
1353
|
+
function unlockedLockfile(root, folder) {
|
|
1354
|
+
return ancestors(folder).some((above) => existsSync(join(root, above, NPM_LOCK))) ? NPM_LOCK : PNPM_LOCK$1;
|
|
1355
|
+
}
|
|
1356
|
+
/** Whether pnpm installs `folder`: it holds a `pnpm-lock.yaml`, or no lockfile and no folder above it holds a `package-lock.json`. */
|
|
1357
|
+
function installsWithPnpm(root, folder) {
|
|
1358
|
+
return (lockfileIn(join(root, folder)) ?? unlockedLockfile(root, folder)) === PNPM_LOCK$1;
|
|
1359
|
+
}
|
|
1228
1360
|
function unlocked(root, folder) {
|
|
1229
1361
|
if (inWorkspace(root, folder)) return "";
|
|
1230
|
-
|
|
1231
|
-
return `${folder}/${MANIFEST} has dependencies and no lockfile: run \`${fixCommand(root, folder, manager)}\`.\n`;
|
|
1362
|
+
return `${folder}/${MANIFEST} has dependencies and no lockfile: run \`${fixCommand(root, folder, unlockedLockfile(root, folder))}\`.\n`;
|
|
1232
1363
|
}
|
|
1233
1364
|
function checkFolder(root, { folder, lockfile }) {
|
|
1234
1365
|
if (lockfile === "other") return "";
|
|
@@ -1702,7 +1833,7 @@ const OWN_STEPS = /* @__PURE__ */ new Map([
|
|
|
1702
1833
|
["verify:types", typecheckLayers],
|
|
1703
1834
|
["verify:lockfiles", (root) => Promise.resolve(checkLockfiles(root))],
|
|
1704
1835
|
["lockfile:singletons", (root) => Promise.resolve(checkSingletonPackages(root))],
|
|
1705
|
-
["dependency:ranges",
|
|
1836
|
+
["dependency:ranges", checkRepositoryRanges],
|
|
1706
1837
|
["git:identity", checkGitIdentity],
|
|
1707
1838
|
["readme:version", checkReadmeVersion],
|
|
1708
1839
|
["published:types", checkPublishedTypes]
|
|
@@ -1871,4 +2002,4 @@ async function runChecks(root, options = {}) {
|
|
|
1871
2002
|
};
|
|
1872
2003
|
}
|
|
1873
2004
|
//#endregion
|
|
1874
|
-
export { stepsOf as a, matchingScripts as i, droppedChecksSteps as n,
|
|
2005
|
+
export { stepsOf as a, installsWithPnpm as c, runPnpm as d, matchingScripts as i, verifyLayers as l, droppedChecksSteps as n, pnpmLockfiles as o, runChecks as r, inWorkspace as s, CHECKS_SKIP_ENV as t, moveDependencyRanges as u };
|
|
@@ -141,12 +141,8 @@ const ORGANIZATION = "https://github.com/AntelopeJS";
|
|
|
141
141
|
/** The AntelopeJS DMS modules in display order. Every README holding the markers lists exactly these. */
|
|
142
142
|
const MODULES = [
|
|
143
143
|
{
|
|
144
|
-
repo: "dms-
|
|
145
|
-
row: "
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
repo: "dms-ai",
|
|
149
|
-
row: "An assistant chat in the dashboard, on your own Claude Code or Codex"
|
|
144
|
+
repo: "dms-assistant",
|
|
145
|
+
row: "An assistant chat in the dashboard and its onboarding, on your own Claude Code or Codex"
|
|
150
146
|
},
|
|
151
147
|
{
|
|
152
148
|
repo: "dms-database",
|
|
@@ -185,6 +181,8 @@ const MODULES = [
|
|
|
185
181
|
row: "The `ajs dms` CLI, the Vue renderer and the SDK every frontend module builds on"
|
|
186
182
|
}
|
|
187
183
|
];
|
|
184
|
+
/** The npm package of the DMS core and of each DMS module, each published under its repository's name. */
|
|
185
|
+
const DMS_PACKAGES = ["@antelopejs/dms", ...MODULES.map(({ repo }) => `@antelopejs/${repo}`)];
|
|
188
186
|
/** The generated block, formatted as oxfmt leaves it. */
|
|
189
187
|
function modulesBlock() {
|
|
190
188
|
return [
|
|
@@ -478,4 +476,4 @@ function planDocs(root, manager) {
|
|
|
478
476
|
return plan;
|
|
479
477
|
}
|
|
480
478
|
//#endregion
|
|
481
|
-
export { workspaceDirectories as n, workspacePatterns as r, planDocs as t };
|
|
479
|
+
export { DMS_PACKAGES as i, workspaceDirectories as n, workspacePatterns as r, planDocs as t };
|
package/dist/eslint.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as typeAwareRuleSetting, t as TYPE_AWARE_RULES } from "./type-aware-rules-
|
|
2
|
-
import { t as guardrailsPlugin } from "./guardrails-
|
|
1
|
+
import { n as typeAwareRuleSetting, t as TYPE_AWARE_RULES } from "./type-aware-rules-BxhHbizU.mjs";
|
|
2
|
+
import { t as guardrailsPlugin } from "./guardrails-PoMIcyGb.mjs";
|
|
3
3
|
import { createConfigForNuxt } from "@nuxt/eslint-config/flat";
|
|
4
4
|
//#region src/eslint.ts
|
|
5
5
|
/** Whether every rule of `plugin` has the `create` function ESLint calls, which `eslintCompatPlugin` gives each oxlint rule. */
|