codebyplan 1.13.54 → 1.13.55
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/cli.js +25 -15
- package/package.json +1 -1
- package/templates/github-workflows/ci.yml +18 -1
package/dist/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ var VERSION, PACKAGE_NAME;
|
|
|
39
39
|
var init_version = __esm({
|
|
40
40
|
"src/lib/version.ts"() {
|
|
41
41
|
"use strict";
|
|
42
|
-
VERSION = "1.13.
|
|
42
|
+
VERSION = "1.13.55";
|
|
43
43
|
PACKAGE_NAME = "codebyplan";
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -35477,6 +35477,21 @@ ${entry}
|
|
|
35477
35477
|
}
|
|
35478
35478
|
return "added";
|
|
35479
35479
|
}
|
|
35480
|
+
async function markUncovered(dep, exactVersion, ctx) {
|
|
35481
|
+
console.log(
|
|
35482
|
+
` uncovered ${dep.name}@${exactVersion || "?"} \u2014 no docs in the library mirror`
|
|
35483
|
+
);
|
|
35484
|
+
const libPath = join37(ctx.absDir, libDirName(dep.name));
|
|
35485
|
+
if (existsSync13(libPath)) {
|
|
35486
|
+
if (ctx.dryRun) {
|
|
35487
|
+
console.log(` would remove stale mirror dir ${libPath}`);
|
|
35488
|
+
} else {
|
|
35489
|
+
await rm2(libPath, { recursive: true, force: true });
|
|
35490
|
+
console.log(` removed stale mirror dir for ${dep.name}`);
|
|
35491
|
+
}
|
|
35492
|
+
}
|
|
35493
|
+
return { kind: "uncovered", dep, exactVersion };
|
|
35494
|
+
}
|
|
35480
35495
|
async function syncOneLibrary(dep, ctx) {
|
|
35481
35496
|
const exactVersion = await resolveExactVersion(ctx.projectPath, dep);
|
|
35482
35497
|
let manifest;
|
|
@@ -35491,10 +35506,7 @@ async function syncOneLibrary(dep, ctx) {
|
|
|
35491
35506
|
manifest = res.data;
|
|
35492
35507
|
} catch (err) {
|
|
35493
35508
|
if (err instanceof ApiError && err.status === 404) {
|
|
35494
|
-
|
|
35495
|
-
` uncovered ${dep.name}@${exactVersion || "?"} \u2014 no docs in the library mirror`
|
|
35496
|
-
);
|
|
35497
|
-
return { kind: "uncovered", dep, exactVersion };
|
|
35509
|
+
return markUncovered(dep, exactVersion, ctx);
|
|
35498
35510
|
}
|
|
35499
35511
|
const message = err instanceof Error ? err.message : String(err);
|
|
35500
35512
|
console.warn(
|
|
@@ -35503,10 +35515,7 @@ async function syncOneLibrary(dep, ctx) {
|
|
|
35503
35515
|
return { kind: "failed", dep, exactVersion, message };
|
|
35504
35516
|
}
|
|
35505
35517
|
if (!manifest || !Array.isArray(manifest.files) || manifest.files.length === 0) {
|
|
35506
|
-
|
|
35507
|
-
` uncovered ${dep.name}@${exactVersion || "?"} \u2014 no docs in the library mirror`
|
|
35508
|
-
);
|
|
35509
|
-
return { kind: "uncovered", dep, exactVersion };
|
|
35518
|
+
return markUncovered(dep, exactVersion, ctx);
|
|
35510
35519
|
}
|
|
35511
35520
|
const unsafeCount = manifest.files.filter(
|
|
35512
35521
|
(f) => sanitizeDocPath(f.path) === null
|
|
@@ -35521,10 +35530,7 @@ async function syncOneLibrary(dep, ctx) {
|
|
|
35521
35530
|
files: manifest.files.filter((f) => sanitizeDocPath(f.path) !== null)
|
|
35522
35531
|
};
|
|
35523
35532
|
if (manifest.files.length === 0) {
|
|
35524
|
-
|
|
35525
|
-
` uncovered ${dep.name}@${exactVersion || "?"} \u2014 no docs in the library mirror`
|
|
35526
|
-
);
|
|
35527
|
-
return { kind: "uncovered", dep, exactVersion };
|
|
35533
|
+
return markUncovered(dep, exactVersion, ctx);
|
|
35528
35534
|
}
|
|
35529
35535
|
}
|
|
35530
35536
|
const lockEntry = ctx.lock.libraries[dep.name];
|
|
@@ -35544,8 +35550,12 @@ async function syncOneLibrary(dep, ctx) {
|
|
|
35544
35550
|
}
|
|
35545
35551
|
const fetched = await fetchAllFiles(manifest.version_id);
|
|
35546
35552
|
const sameVersionLockFiles = lockEntry && lockEntry.resolved_version === manifest.resolved_version ? lockEntry.files : {};
|
|
35553
|
+
const manifestPaths = new Set(manifest.files.map((f) => f.path));
|
|
35547
35554
|
let written = 0;
|
|
35548
35555
|
for (const file of fetched) {
|
|
35556
|
+
if (!manifestPaths.has(file.path)) {
|
|
35557
|
+
continue;
|
|
35558
|
+
}
|
|
35549
35559
|
const rel = sanitizeDocPath(file.path);
|
|
35550
35560
|
if (rel === null) {
|
|
35551
35561
|
console.warn(
|
|
@@ -35565,9 +35575,9 @@ async function syncOneLibrary(dep, ctx) {
|
|
|
35565
35575
|
}
|
|
35566
35576
|
let removedFiles = 0;
|
|
35567
35577
|
if (lockEntry && lockEntry.resolved_version === manifest.resolved_version) {
|
|
35568
|
-
const
|
|
35578
|
+
const manifestPaths2 = new Set(manifest.files.map((f) => f.path));
|
|
35569
35579
|
for (const lockedPath of Object.keys(lockEntry.files)) {
|
|
35570
|
-
if (
|
|
35580
|
+
if (manifestPaths2.has(lockedPath)) continue;
|
|
35571
35581
|
const rel = sanitizeDocPath(lockedPath);
|
|
35572
35582
|
if (rel === null) continue;
|
|
35573
35583
|
removedFiles++;
|
package/package.json
CHANGED
|
@@ -100,5 +100,22 @@ jobs:
|
|
|
100
100
|
- name: Install dependencies
|
|
101
101
|
run: pnpm install --frozen-lockfile
|
|
102
102
|
|
|
103
|
+
# Monorepo dogfoods the codebyplan workspace package, whose `codebyplan`
|
|
104
|
+
# bin (dist/cli.js) is produced by build:npm — a plain install does not
|
|
105
|
+
# create it, and pnpm therefore skips the bin shim, so `pnpm exec
|
|
106
|
+
# codebyplan` 404s. Build it here. In a consumer repo `--filter
|
|
107
|
+
# codebyplan` matches no workspace package, so this is a harmless no-op
|
|
108
|
+
# and the prebuilt npm bin is used below.
|
|
109
|
+
- name: Build codebyplan CLI (monorepo dogfood; no-op when consumed from npm)
|
|
110
|
+
run: pnpm --filter codebyplan build:npm 2>/dev/null || true
|
|
111
|
+
|
|
112
|
+
# In the monorepo run the freshly-built bundle directly (the bin shim may
|
|
113
|
+
# be missing because dist/cli.js did not exist at install time); in a
|
|
114
|
+
# consumer repo that path is absent, so fall back to the installed bin.
|
|
103
115
|
- name: Strict check (no baseline)
|
|
104
|
-
run:
|
|
116
|
+
run: |
|
|
117
|
+
if [ -f packages/codebyplan-package/dist/cli.js ]; then
|
|
118
|
+
node packages/codebyplan-package/dist/cli.js check --scope merged --no-baseline
|
|
119
|
+
else
|
|
120
|
+
pnpm exec codebyplan check --scope merged --no-baseline
|
|
121
|
+
fi
|