@zebeqo/vendy 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/dist/main.mjs +24 -5
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -32319,12 +32319,22 @@ const parse$1 = (tag) => {
32319
32319
  };
32320
32320
  };
32321
32321
  const packagePrefix = (name) => `${name}@`;
32322
+ /** The version `release` gives package `name` of a repo publishing `packages`: a `<name>@<version>` tag, or a `v<version>` or `<version>` tag when `name` is the only package. */
32323
+ const packageVersion = (release, name, packages) => release.prefix === packagePrefix(name) || (release.prefix === "v" || release.prefix === "") && packages.length === 1 && packages[0] === name ? release.version : void 0;
32322
32324
  const isPrerelease = (release) => import_semver.default.prerelease(release.version) !== null;
32323
- const sameLine = (left, right) => import_semver.default.major(left.version) === import_semver.default.major(right.version) && import_semver.default.minor(left.version) === import_semver.default.minor(right.version) && import_semver.default.patch(left.version) === import_semver.default.patch(right.version);
32325
+ const forwardChannels = [
32326
+ "alpha",
32327
+ "beta",
32328
+ "rc"
32329
+ ];
32330
+ const channel = (release) => String(import_semver.default.prerelease(release.version)?.[0] ?? "").replace(/[^A-Za-z].*$/, "");
32331
+ const sameCore = (left, right) => import_semver.default.major(left.version) === import_semver.default.major(right.version) && import_semver.default.minor(left.version) === import_semver.default.minor(right.version) && import_semver.default.patch(left.version) === import_semver.default.patch(right.version);
32332
+ const sameChannel = (left, right) => channel(left) === channel(right) || forwardChannels.includes(channel(left)) && forwardChannels.includes(channel(right));
32333
+ const onLine = (release, current) => !isPrerelease(release) || isPrerelease(current) && sameCore(release, current) && sameChannel(release, current);
32324
32334
  const newest = (releases, current) => {
32325
32335
  const byVersion = (left, right) => import_semver.default.compare(left.version, right.version);
32326
32336
  const stable = releases.filter((release) => !isPrerelease(release));
32327
- return (current === void 0 ? stable.length > 0 ? stable : releases : [current, ...releases.filter((release) => release.prefix === current.prefix && (!isPrerelease(release) || isPrerelease(current) && sameLine(release, current)))]).reduce((best, release) => best === void 0 || byVersion(release, best) > 0 ? release : best, void 0);
32337
+ return (current === void 0 ? stable.length > 0 ? stable : releases : [current, ...releases.filter((release) => release.prefix === current.prefix && onLine(release, current))]).reduce((best, release) => best === void 0 || byVersion(release, best) > 0 ? release : best, void 0);
32328
32338
  };
32329
32339
  var NoReleases = class extends TaggedError()("NoReleases", {
32330
32340
  url: String$7,
@@ -36516,6 +36526,15 @@ const readFindings = (repo, paths) => (repo.uses ?? []).flatMap((use) => (use.re
36516
36526
  }];
36517
36527
  }));
36518
36528
  const vendoredManifests = (repo) => (paths) => paths.filter((path) => isPackageJson(path) && !path.split("/").includes("node_modules") && (repo.paths === void 0 || repo.paths.some((vendored) => covers(vendored, path))));
36529
+ const releasedPackages = (repo, published) => {
36530
+ const release = parse$1(repo.ref);
36531
+ if (release === void 0) return published;
36532
+ const names = published.map((pkg) => pkg.name);
36533
+ return published.map((pkg) => ({
36534
+ ...pkg,
36535
+ version: packageVersion(release, pkg.name, names) ?? pkg.version
36536
+ }));
36537
+ };
36519
36538
  const packageOf = (packages, file) => packages.find((directory) => directory === "" || covers(directory, file)) ?? "";
36520
36539
  const governedPackages = (library, project) => (library.repo.uses ?? []).every((use) => use.scope === void 0) ? new Set(project.packages) : new Set(project.files.filter((file) => library.scope.covers(file)).map((file) => packageOf(project.packages, file)));
36521
36540
  const declaredIn = (directory) => directory === "" ? "package.json" : `${directory}/package.json`;
@@ -36624,7 +36643,7 @@ const inspect$4 = fn("Check.inspect")(function* (options) {
36624
36643
  const snapshot = pinned.get(repo.name);
36625
36644
  return snapshot?._tag === "Available" ? [{
36626
36645
  repo,
36627
- published: published(snapshot.files),
36646
+ published: releasedPackages(repo, published(snapshot.files)),
36628
36647
  scope: repoScope(repo)
36629
36648
  }] : [];
36630
36649
  });
@@ -45590,7 +45609,7 @@ const skills$1 = {
45590
45609
  },
45591
45610
  "update": {
45592
45611
  description: "Move snapshots to their newest upstream one repo at a time — libraries to their newest release with the dependency alongside, references to their branch tip — then trace what changed to the uses it affects, carry the project's code and guides forward, and recommend new upstream features the map has a use for.",
45593
- content: "---\nname: update\ndescription: Move snapshots to their newest upstream one repo at a time — libraries to their newest release with the dependency alongside, references to their branch tip — then trace what changed to the uses it affects, carry the project's code and guides forward, and recommend new upstream features the map has a use for.\n---\n\n# update snapshots\n\nThe project always runs on the newest upstream. One repo at a time, each finished before the next starts: move it, trace the change to the map, carry the project forward, commit.\n\nWith no repo named, take every repo in `vendy catalog`. Start from `vendy status` to see which have anything new.\n\n## 1. Move the pin\n\n```bash\nvendy update <name> # prints: updated <name> <from>..<to>, then a diffstat of the whole snapshot\nvendy update <name> --patch # the full patch instead\n```\n\n`<from>..<to>` is the range every command below takes. Name revisions by SHA: the store fetches no upstream tags.\n\nA reference repo follows its branch to the tip. A library repo on a release tag moves to the newest release with the same tag pattern — prereleases only on the line it is already on — and never backward. Then bring the dependency along — for a reference repo, the tool pin its documentation describes: `vendy skills get core`, \"Matching a dependency to its snapshot\".\n\nA library repo still on a branch gets onto releases first:\n\n```bash\nvendy track <name> --release # the repository's own releases: v<version>, or <repo>@<version>\nvendy track <name> --release --package <pkg> # a monorepo's <pkg>@<version> tags\n```\n\nIf the project installs a newer release than the newest tag vendy finds — a prerelease line the snapshot is not on — track that release's tag by name instead: `vendy track <name> <tag>`.\n\nNothing new upstream → next repo.\n\n## 2. Find what changed\n\nTwo questions, read at different breadths.\n\n### What the project must follow\n\nNarrow: only the uses' evidence decides what the project's code depends on. Stop at the first layer that answers it:\n\n1. **The changelog.** `gh release view <tag> --repo <owner>/<repo>` for each release crossed, or the `CHANGELOG.md`, `.changeset/`, or release notes inside the snapshot. Breaking changes and deprecations, at the highest signal per line.\n2. **The diff in the `read` paths.**\n\n ```bash\n vendy diff <name> <from>..<to> --read --stat # which evidence changed\n vendy diff <name> <from>..<to> --read # how\n ```\n\n3. **Fresh read.** When the update crosses a major version, or a `read` path was moved or deleted, read the affected use's evidence again from scratch, as if vendoring it, and decide what the best practice is now.\n\n### What is new\n\nWide: never narrowed to the `read` paths, because a feature a use could take up often lands where the map does not read yet. Weigh each new thing against what each use is `for`, not where it reads.\n\n1. **The changelog** for every release crossed. When it names each feature and what it is for, it is enough: open a feature's code only once you are about to recommend it, to cite its evidence.\n2. **Where upstream changed**, when there is no changelog or it is too thin to judge from — a reference repo usually has none. Start from `vendy git <name> log --oneline <from>..<to>` and the diffstat `vendy update` printed; for a large update, `vendy diff <name> <from>..<to> --dirstat` shows it by directory.\n\n## 3. Trace it to the map\n\nFor every use of the repo, decide:\n\n- **Unaffected** — nothing in its evidence changed in a way its code depends on.\n- **Code must follow** — a breaking change, a deprecation, or a new recommended way of doing what this use's code does. List the files in its scope and what changes, citing the upstream evidence for each.\n- **Map must follow** — a `read` path moved, the evidence now lives elsewhere, or a recommended feature's evidence lies outside the use's `read` paths.\n- **Guide must follow** — a runbook step or an explained mechanism no longer matches.\n\nThen **recommend new features** from \"What is new\": anything one of the repo's uses could take up — a simpler API for what the code does by hand, a capability the scope's feature is missing. Only what the map has a use for; new features the project has no use for are noise.\n\n## 4. Carry the project forward\n\nEverything unaffected → commit the pin (and dependency) alone and move on.\n\nAnything affected → show the user the plan from step 3, with the recommendations kept separate from the required changes, and wait. On approval: change the code, update the `read` paths and guides, run `vendy check` and the project's own checks and tests, and commit — one commit per repo, holding its pin, its dependency, and the code and guides that followed it.\n\nWhen a repo cannot be carried forward cleanly — a migration too large for this pass, tests that will not go green — stop at that repo and report. Do not continue to the next on top of a broken one. Put the repo back where it was while the user decides — `vendy pin <name> <from>` for a reference repo, `vendy track <name> <old-tag>` and the old dependency for a library — so the snapshot never describes code the project does not run.\n"
45612
+ content: "---\nname: update\ndescription: Move snapshots to their newest upstream one repo at a time — libraries to their newest release with the dependency alongside, references to their branch tip — then trace what changed to the uses it affects, carry the project's code and guides forward, and recommend new upstream features the map has a use for.\n---\n\n# update snapshots\n\nThe project always runs on the newest upstream. One repo at a time, each finished before the next starts: move it, trace the change to the map, carry the project forward, commit.\n\nWith no repo named, take every repo in `vendy catalog`. Start from `vendy status` to see which have anything new.\n\n## 1. Move the pin\n\n```bash\nvendy update <name> # prints: updated <name> <from>..<to>, then a diffstat of the whole snapshot\nvendy update <name> --patch # the full patch instead\n```\n\n`<from>..<to>` is the range every command below takes. Name revisions by SHA: the store fetches no upstream tags.\n\nA reference repo follows its branch to the tip. A library repo on a release tag moves to the newest release with the same tag pattern — prereleases only on the line it is already on (alpha → beta → rc; a nightly or canary channel only from that channel) — and never backward. Then bring the dependency along — for a reference repo, the tool pin its documentation describes: `vendy skills get core`, \"Matching a dependency to its snapshot\".\n\nA library repo still on a branch gets onto releases first:\n\n```bash\nvendy track <name> --release # the repository's own releases: v<version>, or <repo>@<version>\nvendy track <name> --release --package <pkg> # a monorepo's <pkg>@<version> tags\n```\n\nIf the project installs a newer release than the newest tag vendy finds — a prerelease line the snapshot is not on — track that release's tag by name instead: `vendy track <name> <tag>`.\n\nNothing new upstream → next repo.\n\n## 2. Find what changed\n\nTwo questions, read at different breadths.\n\n### What the project must follow\n\nNarrow: only the uses' evidence decides what the project's code depends on. Stop at the first layer that answers it:\n\n1. **The changelog.** `gh release view <tag> --repo <owner>/<repo>` for each release crossed, or the `CHANGELOG.md`, `.changeset/`, or release notes inside the snapshot. Breaking changes and deprecations, at the highest signal per line.\n2. **The diff in the `read` paths.**\n\n ```bash\n vendy diff <name> <from>..<to> --read --stat # which evidence changed\n vendy diff <name> <from>..<to> --read # how\n ```\n\n3. **Fresh read.** When the update crosses a major version, or a `read` path was moved or deleted, read the affected use's evidence again from scratch, as if vendoring it, and decide what the best practice is now.\n\n### What is new\n\nWide: never narrowed to the `read` paths, because a feature a use could take up often lands where the map does not read yet. Weigh each new thing against what each use is `for`, not where it reads.\n\n1. **The changelog** for every release crossed. When it names each feature and what it is for, it is enough: open a feature's code only once you are about to recommend it, to cite its evidence.\n2. **Where upstream changed**, when there is no changelog or it is too thin to judge from — a reference repo usually has none. Start from `vendy git <name> log --oneline <from>..<to>` and the diffstat `vendy update` printed; for a large update, `vendy diff <name> <from>..<to> --dirstat` shows it by directory.\n\n## 3. Trace it to the map\n\nFor every use of the repo, decide:\n\n- **Unaffected** — nothing in its evidence changed in a way its code depends on.\n- **Code must follow** — a breaking change, a deprecation, or a new recommended way of doing what this use's code does. List the files in its scope and what changes, citing the upstream evidence for each.\n- **Map must follow** — a `read` path moved, the evidence now lives elsewhere, or a recommended feature's evidence lies outside the use's `read` paths.\n- **Guide must follow** — a runbook step or an explained mechanism no longer matches.\n\nThen **recommend new features** from \"What is new\": anything one of the repo's uses could take up — a simpler API for what the code does by hand, a capability the scope's feature is missing. Only what the map has a use for; new features the project has no use for are noise.\n\n## 4. Carry the project forward\n\nEverything unaffected → commit the pin (and dependency) alone and move on.\n\nAnything affected → show the user the plan from step 3, with the recommendations kept separate from the required changes, and wait. On approval: change the code, update the `read` paths and guides, run `vendy check` and the project's own checks and tests, and commit — one commit per repo, holding its pin, its dependency, and the code and guides that followed it.\n\nWhen a repo cannot be carried forward cleanly — a migration too large for this pass, tests that will not go green — stop at that repo and report. Do not continue to the next on top of a broken one. Put the repo back where it was while the user decides — `vendy pin <name> <from>` for a reference repo, `vendy track <name> <old-tag>` and the old dependency for a library — so the snapshot never describes code the project does not run.\n"
45594
45613
  },
45595
45614
  "vendor": {
45596
45615
  description: "Vendor an external repository and build with it — resolving the URL, pinning a library to its newest release and moving the dependency alongside, recording a provisional use for what the user wants from it, building the feature from its evidence, and finishing with align. Also covers vendoring a package on your own instead of reading node_modules.",
@@ -46193,7 +46212,7 @@ const withGitSeparator = (args) => {
46193
46212
  const run = (args, config) => runWith(vendy, config)(withGitSeparator(args)).pipe(provideService(Blocking, (description) => error(`waiting for file lock on ${description}`)), provideService(runner, invocation(process.cwd())), provideService(CliConfig, cliConfig), provideService(Formatter, formatter));
46194
46213
  //#endregion
46195
46214
  //#region src/main.ts
46196
- const version = "0.1.0";
46215
+ const version = "0.1.1";
46197
46216
  const isSqliteExperimentalWarning = (warning) => warning.name === "ExperimentalWarning" && warning.message.startsWith("SQLite ");
46198
46217
  for (const printWarning of process.listeners("warning")) {
46199
46218
  process.off("warning", printWarning);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zebeqo/vendy",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Let your coding agent choose, build with, and maintain vendored repos, and keep your code in step as upstream moves",
5
5
  "license": "MIT",
6
6
  "repository": {