@r_masseater/vite-plus-adopt 0.23.2 → 0.24.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/README.md CHANGED
@@ -123,7 +123,7 @@ The Renovate preset updates `version` of each GitHub key and of `dotnet`. A new
123
123
 
124
124
  ## GitHub Actions caches
125
125
 
126
- `vpa ci` puts the shared `setup` action of [typescript-template](https://github.com/masseater/typescript-template) into every job that runs `vp`, and removes what that action replaces: hand-written `actions/cache` steps for the pnpm store, the pnpm metadata, the vpa tools and msch, the `voidzero-dev/setup-vp` step and the `vp install --frozen-lockfile` step. Comments and formatting around the edited steps stay. It pins every template action and workflow to one commit, and calls `maintain-caches.yml` from `.github/workflows/cache.yml`, which saves the pnpm store on the default branch and deletes cache entries that it no longer needs. A local action in `.github/actions/` that wraps the shared one keeps its extra steps, and `vpa ci` forwards the inputs `cache`, `save` and `session-path` that it declares. In a repository that uses the shared `setup` action, it also writes `up-to-date.yml` and `update-branches.yml` as the template has them, with their triggers and jobs such as the `wake` job that starts the merge queue, and keeps the `up-to-date` job that the repository owns. Renovate only moves the pinned commits, so without this the rest of those workflows stays at what the template had when they were copied. Run it again after a new `vpa` version to move the pins. The library entry exports `findCiDrift(root)`, which lists the files `vpa ci` would change, the queue workflows that differ from the template and the files whose template pins differ.
126
+ `vpa ci` puts the shared `setup` action of [masseater/ecosystems](https://github.com/masseater/ecosystems/tree/main/.github/shared-actions) into every job that runs `vp`, and removes what that action replaces: hand-written `actions/cache` steps for the pnpm store, the pnpm metadata, the vpa tools and msch, the `voidzero-dev/setup-vp` step and the `vp install --frozen-lockfile` step. Comments and formatting around the edited steps stay. It pins every shared action and workflow to one commit, and calls `maintain-caches.yml` from `.github/workflows/cache.yml`, which saves the pnpm store on the default branch and deletes cache entries that it no longer needs. A local action in `.github/actions/` that wraps the shared one keeps its extra steps, and `vpa ci` forwards the inputs `cache`, `save` and `session-path` that it declares. In a repository that uses the shared `setup` action, it also writes `up-to-date.yml` and `update-branches.yml` as the shared set has them, with their triggers and jobs such as the `wake` job that starts the merge queue, and keeps the `up-to-date` job that the repository owns. Renovate only moves the pinned commits, so without this the rest of those workflows stays at what the shared set had when they were copied. Run it again after a new `vpa` version to move the pins. The library entry exports `findCiDrift(root)`, which lists the files `vpa ci` would change, the queue workflows that differ from the shared set and the files whose pins differ.
127
127
 
128
128
  ## Replacement for @arethetypeswrong/core
129
129
 
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as runVpa } from "./vpa-BJdZ0wwc.mjs";
2
+ import { t as runVpa } from "./vpa-8G8VJV72.mjs";
3
3
  import { Effect, Path, Stdio } from "effect";
4
4
  import { runMain } from "@r_masseater/masseater-utils/node-main";
5
5
  // src/app/run-cli.ts
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { i as VpToolsError, n as findCiDrift, r as loadViteConfig, t as runVpa } from "./vpa-BJdZ0wwc.mjs";
1
+ export { i as VpToolsError, n as findCiDrift, r as loadViteConfig, t as runVpa } from "./vpa-8G8VJV72.mjs";
@@ -453,16 +453,17 @@ const fromTemplate = ({ templates, name, source }) => pipe(templates, Array.find
453
453
  onNone: () => source,
454
454
  onSome: (template) => applied(template, source)
455
455
  }));
456
- // src/features/sync-ci/model/template.ts
457
- const TEMPLATE_REF = "5e76f3a93f86e75256944671d89b5d0bca0ed0fd";
458
- const TEMPLATE = "masseater/typescript-template/.github";
459
- const templateAction = (name) => `${TEMPLATE}/actions/${name}`;
460
- const SETUP_ACTION = templateAction("setup");
461
- const VERIFY_ACTION = templateAction("verify");
456
+ // src/features/sync-ci/model/shared-actions.ts
457
+ const ACTIONS_REF = "e4489d044394d552044bea8304cf4b497ab68b82";
458
+ const REPOSITORY = "masseater/ecosystems/.github";
459
+ const actionPath = (name) => `${REPOSITORY}/shared-actions/${name}`;
460
+ const SETUP_ACTION = actionPath("setup");
461
+ const VERIFY_ACTION = actionPath("verify");
462
462
  const MAINTAIN_WORKFLOW_FILE = "maintain-caches.yml";
463
- const MAINTAIN_WORKFLOW = `${TEMPLATE}/workflows/${MAINTAIN_WORKFLOW_FILE}`;
464
- const TEMPLATE_USE = new RegExp(String.raw`^${TEMPLATE}/(?:actions|workflows)/[^@]+@`, "u");
465
- const pinned = (path) => `${path}@${TEMPLATE_REF}`;
463
+ const MAINTAIN_WORKFLOW = `${REPOSITORY}/workflows/${MAINTAIN_WORKFLOW_FILE}`;
464
+ const KINDS = String.raw`${REPOSITORY}/(?:shared-actions|workflows)/`;
465
+ const ACTIONS_USE = new RegExp(String.raw`^${KINDS}[^@]+@`, "u");
466
+ const pinned = (path) => `${path}@${ACTIONS_REF}`;
466
467
  const CACHE_WORKFLOW = "cache.yml";
467
468
  const DEFAULT_BRANCH_ONLY = "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)";
468
469
  const REGISTRY_ACCESS = `\${{ secrets.TAKUMI_GUARD_TOKEN }}`;
@@ -487,7 +488,7 @@ const CACHE_WORKFLOW_SOURCE = Array.join([
487
488
  ` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
488
489
  ""
489
490
  ], "\n");
490
- const PINNED_USE = new RegExp(String.raw`(?<use>${TEMPLATE}/(?:actions|workflows)/[^@\s]+)@(?<ref>[0-9a-f]{40})`, "gu");
491
+ const PINNED_USE = new RegExp(String.raw`(?<use>${KINDS}[^@\s]+)@(?<ref>[0-9a-f]{40})`, "gu");
491
492
  const refsIn = (source) => pipe(source, String$1.matchAll(PINNED_USE), Array.fromIterable, Array.flatMap(({ groups }) => pipe(Option.fromNullishOr(groups), Option.flatMap(Record.get("ref")), Option.toArray)));
492
493
  const withoutRefs = (source) => pipe(source, String$1.replaceAll(PINNED_USE, "$<use>"));
493
494
  // src/features/sync-ci/model/cache-workflow.ts
@@ -622,14 +623,14 @@ const stepEdits = (rewrite) => {
622
623
  // src/features/sync-ci/model/rewrite-document.ts
623
624
  const AFTER_REF = /@.*$/u;
624
625
  const CLOSING_BRACKET = 1;
625
- const TELEMETRY_USE = /\/actions\/ci-telemetry@/u;
626
+ const TELEMETRY_USE = /\/ci-telemetry@/u;
626
627
  const pinEdits = (document, source) => {
627
628
  const found = [];
628
629
  visit(document, { Pair: (_key, pair) => {
629
- if (isPair(pair) && scalarText(pair.key) === "uses" && isScalar(pair.value) && TEMPLATE_USE.test(scalarText(pair.value))) pipe(Option.fromNullishOr(pair.value.range), Option.map(([start, end]) => ({
630
+ if (isPair(pair) && scalarText(pair.key) === "uses" && isScalar(pair.value) && ACTIONS_USE.test(scalarText(pair.value))) pipe(Option.fromNullishOr(pair.value.range), Option.map(([start, end]) => ({
630
631
  start,
631
632
  end,
632
- text: pipe(source, String$1.slice(start, end), String$1.replace(AFTER_REF, `@${TEMPLATE_REF}`))
633
+ text: pipe(source, String$1.slice(start, end), String$1.replace(AFTER_REF, `@${ACTIONS_REF}`))
633
634
  })), Option.map((edit) => found.push(edit)));
634
635
  } });
635
636
  return found;
@@ -737,7 +738,7 @@ const UPDATE_BRANCHES_SOURCE = Array.join([
737
738
  " contents: read",
738
739
  " id-token: write",
739
740
  " steps:",
740
- ` - uses: ${pinned(templateAction("update-branches"))}`,
741
+ ` - uses: ${pinned(actionPath("update-branches"))}`,
741
742
  "",
742
743
  " ci-telemetry:",
743
744
  " needs: [update]",
@@ -747,7 +748,7 @@ const UPDATE_BRANCHES_SOURCE = Array.join([
747
748
  " actions: read",
748
749
  " contents: read",
749
750
  " steps:",
750
- ` - uses: ${pinned(templateAction("ci-telemetry"))}`,
751
+ ` - uses: ${pinned(actionPath("ci-telemetry"))}`,
751
752
  " with:",
752
753
  ` github-token: \${{ github.token }}`,
753
754
  ""
@@ -845,7 +846,7 @@ const OWN_CI = {
845
846
  changes: [],
846
847
  sources: []
847
848
  };
848
- const isTemplate = (root) => Effect.gen(function* findMaintainWorkflow() {
849
+ const isHost = (root) => Effect.gen(function* findMaintainWorkflow() {
849
850
  const fs = yield* FileSystem.FileSystem;
850
851
  const path = yield* Path.Path;
851
852
  return yield* fs.exists(path.join(root, WORKFLOWS, MAINTAIN_WORKFLOW_FILE)).pipe(Effect.orElseSucceed(() => false));
@@ -876,7 +877,7 @@ const planRewrites = (root, workflows, actions) => Effect.gen(function* planChan
876
877
  };
877
878
  });
878
879
  const planned = (root) => Effect.gen(function* plan() {
879
- if (yield* isTemplate(root)) return OWN_CI;
880
+ if (yield* isHost(root)) return OWN_CI;
880
881
  const workflows = yield* workflowSources(root);
881
882
  const actions = yield* actionSources(root);
882
883
  return yield* planRewrites(root, workflows, actions);
@@ -890,7 +891,7 @@ const syncCi = (root) => planned(root).pipe(Effect.flatMap(({ changes }) => Effe
890
891
  })));
891
892
  // package.json
892
893
  var name = "@r_masseater/vite-plus-adopt";
893
- var version = "0.23.2";
894
+ var version = "0.24.0";
894
895
  // src/features/sync-ci/model/installed-version.ts
895
896
  const RANGE_PREFIX = /^[\^~]/u;
896
897
  const pnpm$1 = attempt("pnpm");
@@ -1889,4 +1890,4 @@ const runVpa = Function.dual(2, (root, args) => pipe(args, Array.match({
1889
1890
  })));
1890
1891
  export { VpToolsError as i, findCiDrift as n, loadViteConfig as r, runVpa as t };
1891
1892
 
1892
- //# sourceMappingURL=vpa-BJdZ0wwc.mjs.map
1893
+ //# sourceMappingURL=vpa-8G8VJV72.mjs.map