@rightkit/git 0.2.22 → 0.2.23

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/install.mjs CHANGED
@@ -13,7 +13,7 @@ import { applyPlan, planSync } from "./sync.mjs";
13
13
 
14
14
  export const DEFAULT_MATRIX = { os: ["ubuntu-latest", "macos-latest", "windows-latest"], node: ["22.13", "24"] };
15
15
  export const DEFAULT_PACKAGE_MANAGER = "pnpm@11.24.0";
16
- export const DEFAULT_TEMPLATE_VERSION = "1.7.0";
16
+ export const DEFAULT_TEMPLATE_VERSION = "1.8.0";
17
17
 
18
18
  /**
19
19
  * opts: { lanes: string[], matrix?, packageManager?, templateVersion?,
package/manifest.mjs CHANGED
@@ -167,7 +167,7 @@ export function validateManifest(manifest) {
167
167
  errors.push("rustCache must be an object");
168
168
  } else {
169
169
  for (const key of Object.keys(rustCache)) {
170
- if (key !== "workspaces") errors.push(`unknown rustCache field: ${key}`);
170
+ if (key !== "workspaces" && key !== "requiredForGate") errors.push(`unknown rustCache field: ${key}`);
171
171
  }
172
172
  if (!Array.isArray(rustCache.workspaces) || rustCache.workspaces.length === 0) {
173
173
  errors.push("rustCache.workspaces must be a non-empty array");
@@ -176,6 +176,9 @@ export function validateManifest(manifest) {
176
176
  } else if (new Set(rustCache.workspaces).size !== rustCache.workspaces.length) {
177
177
  errors.push("rustCache.workspaces entries must be unique");
178
178
  }
179
+ if (rustCache.requiredForGate !== undefined && typeof rustCache.requiredForGate !== "boolean") {
180
+ errors.push("rustCache.requiredForGate must be a boolean");
181
+ }
179
182
  }
180
183
  }
181
184
 
@@ -776,6 +779,7 @@ export function buildRenderContext(manifest, repoPath) {
776
779
  TEMPLATE_VERSION: manifest.templateVersion,
777
780
  GATE_PATH: manifest.gate?.path,
778
781
  RUST_CACHE_WORKSPACES: rustWorkspaces.map((workspace) => ` ${workspace} -> target`).join("\n"),
782
+ RUST_REQUIRED_FOR_GATE: manifest.rustCache?.requiredForGate === true ? "true" : "false",
779
783
  CANDIDATE_BUILD_SCRIPT: manifest.candidate?.buildScript,
780
784
  CANDIDATE_CHECK_SCRIPT: manifest.candidate?.checkScript,
781
785
  CANDIDATE_ARTIFACT_ROOT: manifest.candidate?.artifactRoot,
@@ -95,7 +95,8 @@
95
95
  "minItems": 1,
96
96
  "uniqueItems": true,
97
97
  "items": { "type": "string", "pattern": "^(?:\\.|(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*)$" }
98
- }
98
+ },
99
+ "requiredForGate": { "type": "boolean" }
99
100
  }
100
101
  },
101
102
  "gate": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/git",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Public-repo-only GitHub Actions workflow layer: templates, visibility gate, sync/drift/adopt/uninstall for right-git.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
package/render.test.mjs CHANGED
@@ -61,9 +61,10 @@ test("rust-hybrid ci renders its pinned package manager and gate", () => {
61
61
  assert.match(content, /--diff-filter=ACDMRTUXB/, "deleted Rust inputs must trigger Rust setup");
62
62
  assert.match(content, /\*\.rs\|Cargo\.toml[\s\S]*scripts\/gate\.sh/);
63
63
  assert.match(content, /\.rightgit\.json\|\.github\/workflows\/\*\.yml\|\.github\/workflows\/\*\.yaml/);
64
- assert.equal((content.match(/if: steps\.rust-changes\.outputs\.changed == 'true'/g) ?? []).length, 3);
64
+ assert.equal((content.match(/if: steps\.rust-changes\.outputs\.required == 'true'/g) ?? []).length, 3);
65
65
  assert.match(content, /RIGHT_GIT_RUST_CHANGED: \$\{\{ steps\.rust-changes\.outputs\.changed \}\}/);
66
- assert.match(content, /RUSTC_WRAPPER: \$\{\{ steps\.rust-changes\.outputs\.changed == 'true' && 'sccache' \|\| '' \}\}/);
66
+ assert.match(content, /RIGHT_GIT_RUST_REQUIRED: \$\{\{ steps\.rust-changes\.outputs\.required \}\}/);
67
+ assert.match(content, /RUSTC_WRAPPER: \$\{\{ steps\.rust-changes\.outputs\.required == 'true' && 'sccache' \|\| '' \}\}/);
67
68
  assert.match(content, /CARGO_INCREMENTAL: "0"/);
68
69
  assert.match(content, /CARGO_PROFILE_DEV_DEBUG: "0"/);
69
70
  assert.match(content, /CARGO_PROFILE_TEST_DEBUG: "0"/);
@@ -129,7 +130,7 @@ test("rust-hybrid cache contract renders every declared Cargo workspace", () =>
129
130
  lanes: ["ci"],
130
131
  profile: "rust-hybrid",
131
132
  gate: { path: "scripts/gate.sh" },
132
- rustCache: { workspaces: [".", "apps/studio/src-tauri"] },
133
+ rustCache: { workspaces: [".", "apps/studio/src-tauri"], requiredForGate: true },
133
134
  matrix: { os: ["windows-2025"], node: ["22.23.2"] },
134
135
  };
135
136
  const content = renderTemplate(
@@ -140,7 +141,8 @@ test("rust-hybrid cache contract renders every declared Cargo workspace", () =>
140
141
  assert.match(content, /add-job-id-key: false/);
141
142
  assert.match(content, /cache-workspace-crates: false/);
142
143
  assert.match(content, /cache-on-failure: true/);
143
- assert.match(content, /RUSTC_WRAPPER: \$\{\{ steps\.rust-changes\.outputs\.changed == 'true' && 'sccache' \|\| '' \}\}/);
144
+ assert.match(content, /if \[\[ "true" == "true" \]\]; then[\s\S]*required=true/);
145
+ assert.match(content, /RUSTC_WRAPPER: \$\{\{ steps\.rust-changes\.outputs\.required == 'true' && 'sccache' \|\| '' \}\}/);
144
146
  });
145
147
 
146
148
  test("rust-hybrid release candidate can opt into OIDC Windows signing without long-lived secrets", () => {
@@ -54,17 +54,22 @@ jobs:
54
54
  fi
55
55
  fi
56
56
  printf 'changed=%s\n' "$changed" >> "$GITHUB_OUTPUT"
57
+ required="$changed"
58
+ if [[ "${RUST_REQUIRED_FOR_GATE}" == "true" ]]; then
59
+ required=true
60
+ fi
61
+ printf 'required=%s\n' "$required" >> "$GITHUB_OUTPUT"
57
62
  - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
58
63
  with:
59
64
  node-version: ${{ matrix.node }}
60
65
  package-manager-cache: false
61
66
  ${PACKAGE_MANAGER_SETUP}
62
67
  - uses: dtolnay/rust-toolchain@f8be11a05b1d4f3fcebe6410cc16743212b999b0
63
- if: steps.rust-changes.outputs.changed == 'true'
68
+ if: steps.rust-changes.outputs.required == 'true'
64
69
  with:
65
70
  components: rustfmt, clippy
66
71
  - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
67
- if: steps.rust-changes.outputs.changed == 'true'
72
+ if: steps.rust-changes.outputs.required == 'true'
68
73
  with:
69
74
  workspaces: |
70
75
  ${RUST_CACHE_WORKSPACES}
@@ -74,14 +79,15 @@ ${RUST_CACHE_WORKSPACES}
74
79
  cache-on-failure: true
75
80
  save-if: ${{ github.event_name != 'pull_request' }}
76
81
  - uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
77
- if: steps.rust-changes.outputs.changed == 'true'
82
+ if: steps.rust-changes.outputs.required == 'true'
78
83
  with:
79
84
  version: "v0.16.0"
80
85
  - run: bash ./${GATE_PATH}
81
86
  env:
82
87
  RIGHT_GIT_RUST_CHANGED: ${{ steps.rust-changes.outputs.changed }}
88
+ RIGHT_GIT_RUST_REQUIRED: ${{ steps.rust-changes.outputs.required }}
83
89
  SCCACHE_GHA_ENABLED: "true"
84
- RUSTC_WRAPPER: ${{ steps.rust-changes.outputs.changed == 'true' && 'sccache' || '' }}
90
+ RUSTC_WRAPPER: ${{ steps.rust-changes.outputs.required == 'true' && 'sccache' || '' }}
85
91
  CARGO_INCREMENTAL: "0"
86
92
  CARGO_PROFILE_DEV_DEBUG: "0"
87
93
  CARGO_PROFILE_TEST_DEBUG: "0"
@@ -78,12 +78,12 @@ test("install validates before it creates a manifest", async () => {
78
78
  assert.equal(fs.existsSync(path.join(dir, MANIFEST_FILENAME)), false);
79
79
  });
80
80
 
81
- test("install emits GitHub-Actions-only policy at template 1.7.0", async () => {
81
+ test("install emits GitHub-Actions-only policy at template 1.8.0", async () => {
82
82
  const dir = makeTempRepo(null);
83
83
  const result = await installCommand(dir, { lanes: ["ci"] }, PUBLIC_DEPS);
84
84
  assert.equal(result.ok, true);
85
85
  const manifest = JSON.parse(fs.readFileSync(path.join(dir, MANIFEST_FILENAME), "utf8"));
86
86
  assert.equal(manifest.compile, "github-actions-only");
87
- assert.equal(DEFAULT_TEMPLATE_VERSION, "1.7.0");
87
+ assert.equal(DEFAULT_TEMPLATE_VERSION, "1.8.0");
88
88
  assert.equal(manifest.templateVersion, DEFAULT_TEMPLATE_VERSION);
89
89
  });