@clearlydev/nx-archweave 0.5.3 → 0.6.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.
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-LJRFVE6B.js";
4
4
  import {
5
5
  renderLineDiff
6
- } from "./chunk-WQDJYSOD.js";
6
+ } from "./chunk-CSJZ4PP3.js";
7
7
  import {
8
8
  resolveFsdPolicy
9
9
  } from "./chunk-5MI3O4VZ.js";
@@ -88,7 +88,7 @@ function renderAddReviewReport(report) {
88
88
  }
89
89
  if (report.dependabot === "created") {
90
90
  lines.push(` ${DEPENDABOT_PATH}: created \u2014 Dependabot proposes newer pins for the workflow's actions`);
91
- lines.push(" Delete this file if you don't want those pull requests.");
91
+ lines.push(" Delete this file and pass --dependabot=false from then on if you don't want those pull requests.");
92
92
  } else if (report.dependabot === "present") {
93
93
  lines.push(` ${DEPENDABOT_PATH}: already updates github-actions`);
94
94
  } else if (report.dependabot === "proposed") {
@@ -96,12 +96,21 @@ function renderAddReviewReport(report) {
96
96
  lines.push(" to a commit SHA; add this entry under `updates:` so those pins get update pull requests:");
97
97
  lines.push("");
98
98
  lines.push(report.dependabotProposal ?? "");
99
+ } else if (report.dependabot === "off") {
100
+ lines.push(
101
+ report.dependabotOff === "recorded" ? ` ${DEPENDABOT_PATH}: not created \u2014 review.dependabot is false in toolkit.config.json (--dependabot=true turns it on)` : ` ${DEPENDABOT_PATH}: not created \u2014 Dependabot updates are off (--dependabot=false)`
102
+ );
99
103
  } else if (report.dependabot === "withheld") {
100
104
  lines.push(` ${DEPENDABOT_PATH}: not created \u2014 the workflow wasn't written this run. To get update pull requests`);
101
105
  lines.push(" for its pinned actions, add this file:");
102
106
  lines.push("");
103
107
  lines.push(report.dependabotProposal ?? "");
104
108
  }
109
+ if (report.dependabotNotApplied !== void 0) {
110
+ lines.push(
111
+ report.workflowAction === "alternate" ? ` --dependabot=${report.dependabotNotApplied} was not recorded because the workflow was written under another name; toolkit.config.json keeps its review settings.` : ` --dependabot=${report.dependabotNotApplied} was not applied because the workflow ${report.workflowAction === "skipped" ? "was skipped" : "was only proposed"}; toolkit.config.json keeps its review settings.`
112
+ );
113
+ }
105
114
  if (report.workflowAction === "alternate") {
106
115
  lines.push("");
107
116
  lines.push(" Review the generated file, then replace the main workflow file with it yourself;");
@@ -6,7 +6,7 @@ import {
6
6
  DEPENDABOT_PATH,
7
7
  renderAddReviewReport,
8
8
  renderLineDiff
9
- } from "./chunk-WQDJYSOD.js";
9
+ } from "./chunk-CSJZ4PP3.js";
10
10
  import {
11
11
  generatorFilesDir,
12
12
  renderTemplateFiles
@@ -64,7 +64,8 @@ function recordedReview(config) {
64
64
  return {
65
65
  provider: pick(record["provider"], PROVIDERS),
66
66
  mode: pick(record["mode"], MODES),
67
- maxRounds: rounds === 1 || rounds === 2 || rounds === 3 || rounds === 4 || rounds === 5 ? rounds : void 0
67
+ maxRounds: rounds === 1 || rounds === 2 || rounds === 3 || rounds === 4 || rounds === 5 ? rounds : void 0,
68
+ ...record["dependabot"] === false ? { dependabot: false } : {}
68
69
  };
69
70
  }
70
71
  function runAddReview(tree, options) {
@@ -139,21 +140,23 @@ function runAddReview(tree, options) {
139
140
  }
140
141
  }
141
142
  let configAction;
143
+ const dependabotOn = options.dependabot ?? recordedReview(config.parsed).dependabot !== false;
144
+ const reviewConfig = dependabotOn ? plan.configSnippet : { ...plan.configSnippet, dependabot: false };
142
145
  let newConfigContent = null;
143
146
  if (!mainFileMatchesOptions) {
144
147
  configAction = "not-updated";
145
148
  } else {
146
149
  const existingReview = config.parsed?.["review"];
147
- if (deepEqual(existingReview, plan.configSnippet)) {
150
+ if (deepEqual(existingReview, reviewConfig)) {
148
151
  configAction = "unchanged";
149
152
  } else {
150
153
  configAction = config.raw === null ? "created" : "updated";
151
- newConfigContent = applyJsonEdits(config.raw, [[["review"], plan.configSnippet]]);
154
+ newConfigContent = applyJsonEdits(config.raw, [[["review"], reviewConfig]]);
152
155
  }
153
156
  }
154
157
  const [dependabotFile] = renderTemplateFiles(generatorFilesDir("add-review", import.meta.url), ".github", {});
155
158
  const existingDependabot = tree.read(DEPENDABOT_PATH, "utf-8");
156
- const dependabot = existingDependabot !== null ? /github-actions/.test(existingDependabot) ? "present" : "proposed" : writeWorkflowTo !== null ? "created" : "withheld";
159
+ const dependabot = existingDependabot !== null ? /github-actions/.test(existingDependabot) ? "present" : dependabotOn ? "proposed" : "off" : !dependabotOn ? "off" : writeWorkflowTo !== null || options.dependabot === true && workflowAction === "unchanged" ? "created" : "withheld";
157
160
  const dryRun = options.dryRun ?? false;
158
161
  if (!dryRun) {
159
162
  if (writeWorkflowTo !== null) tree.write(writeWorkflowTo, plan.workflowYaml);
@@ -168,10 +171,14 @@ function runAddReview(tree, options) {
168
171
  requiredSecretName: plan.requiredSecretName,
169
172
  diff,
170
173
  workflowYaml: dryRun ? plan.workflowYaml : null,
171
- configSnippetJson: dryRun ? JSON.stringify(plan.configSnippet, null, 2) : null,
174
+ configSnippetJson: dryRun ? JSON.stringify(reviewConfig, null, 2) : null,
172
175
  configError: null,
173
176
  dependabot,
174
177
  dependabotProposal: dependabot === "proposed" || dependabot === "withheld" ? dependabotFile.content : null,
178
+ ...dependabot === "off" ? { dependabotOff: options.dependabot === false ? "option" : "recorded" } : {},
179
+ // An explicit --dependabot goes with the review config, which a run that leaves the main
180
+ // workflow alone doesn't touch: say the option wasn't applied.
181
+ ...options.dependabot !== void 0 && !mainFileMatchesOptions ? { dependabotNotApplied: options.dependabot } : {},
175
182
  ...packageManagerNote !== void 0 ? { packageManagerNote } : {},
176
183
  reviewProvider: provider
177
184
  };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-LJRFVE6B.js";
4
4
  import {
5
5
  renderAddReviewReport
6
- } from "./chunk-WQDJYSOD.js";
6
+ } from "./chunk-CSJZ4PP3.js";
7
7
  import {
8
8
  renderAddBackendBody
9
9
  } from "./chunk-SHKQSTV2.js";
@@ -2,9 +2,9 @@ import {
2
2
  addAgentRulesGenerator,
3
3
  generator_default,
4
4
  runAddAgentRules
5
- } from "../_chunks/chunk-VI7U5HS5.js";
5
+ } from "../_chunks/chunk-3HSNM6AS.js";
6
6
  import "../_chunks/chunk-LJRFVE6B.js";
7
- import "../_chunks/chunk-WQDJYSOD.js";
7
+ import "../_chunks/chunk-CSJZ4PP3.js";
8
8
  import "../_chunks/chunk-5MI3O4VZ.js";
9
9
  import "../_chunks/chunk-6ZTIUBB2.js";
10
10
  import "../_chunks/chunk-JPS6XKYK.js";
@@ -3,9 +3,9 @@ import {
3
3
  generator_default,
4
4
  recordedReview,
5
5
  runAddReview
6
- } from "../_chunks/chunk-OEEWCZCO.js";
6
+ } from "../_chunks/chunk-JNYQTW7S.js";
7
7
  import "../_chunks/chunk-2WXAGWAJ.js";
8
- import "../_chunks/chunk-WQDJYSOD.js";
8
+ import "../_chunks/chunk-CSJZ4PP3.js";
9
9
  import "../_chunks/chunk-YNMLB4DL.js";
10
10
  import "../_chunks/chunk-JPS6XKYK.js";
11
11
  import "../_chunks/chunk-TUN34LAQ.js";
@@ -3,11 +3,11 @@ import {
3
3
  failedSections,
4
4
  leftForYou,
5
5
  renderInitReport
6
- } from "../_chunks/chunk-ZFCK3KMO.js";
6
+ } from "../_chunks/chunk-XSALM2IR.js";
7
7
  import {
8
8
  recordedReview,
9
9
  runAddReview
10
- } from "../_chunks/chunk-OEEWCZCO.js";
10
+ } from "../_chunks/chunk-JNYQTW7S.js";
11
11
  import "../_chunks/chunk-ASY3CK5L.js";
12
12
  import {
13
13
  DEFAULT_MAX_ROUNDS,
@@ -16,9 +16,9 @@ import {
16
16
  } from "../_chunks/chunk-2WXAGWAJ.js";
17
17
  import {
18
18
  runAddAgentRules
19
- } from "../_chunks/chunk-VI7U5HS5.js";
19
+ } from "../_chunks/chunk-3HSNM6AS.js";
20
20
  import "../_chunks/chunk-LJRFVE6B.js";
21
- import "../_chunks/chunk-WQDJYSOD.js";
21
+ import "../_chunks/chunk-CSJZ4PP3.js";
22
22
  import "../_chunks/chunk-5MI3O4VZ.js";
23
23
  import {
24
24
  runAddBackend
@@ -395,7 +395,8 @@ function runInit(tree, options, deps) {
395
395
  dryRun,
396
396
  // The first AI host's provider — buildPresetConfig
397
397
  // resolved it; claude when no host was picked.
398
- provider: config.review.provider
398
+ provider: config.review.provider,
399
+ ...options.dependabot !== void 0 ? { dependabot: options.dependabot } : {}
399
400
  });
400
401
  sections.push({ id: "review", enabled: true, report: { kind: "review", report } });
401
402
  } else {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  applyLintInputs,
3
3
  renderLintInputs
4
- } from "../../generators/_chunks/chunk-ZFCK3KMO.js";
4
+ } from "../../generators/_chunks/chunk-XSALM2IR.js";
5
5
  import "../../generators/_chunks/chunk-LJRFVE6B.js";
6
- import "../../generators/_chunks/chunk-WQDJYSOD.js";
6
+ import "../../generators/_chunks/chunk-CSJZ4PP3.js";
7
7
  import "../../generators/_chunks/chunk-SHKQSTV2.js";
8
8
  import "../../generators/_chunks/chunk-AMOOSD5Q.js";
9
9
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clearlydev/nx-archweave",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "Nx plugin and CLI that set up Feature-Sliced Design (FSD) import linting, frontend/backend module boundaries and AI agent rule files. AI PR review is optional (beta).",
5
5
  "license": "MIT",
6
6
  "author": "clearlydev (https://github.com/clearlydev)",
@@ -105,7 +105,7 @@
105
105
  }
106
106
  },
107
107
  "dependencies": {
108
- "@nx/devkit": "^23.1.0",
108
+ "@nx/devkit": "^24.1.0",
109
109
  "jsonc-parser": "^3.3.1"
110
110
  }
111
111
  }
@@ -52,6 +52,10 @@
52
52
  ],
53
53
  "description": "How to resolve an existing, differing workflow file. Omit to get a merge proposal (diff printed, nothing written)"
54
54
  },
55
+ "dependabot": {
56
+ "type": "boolean",
57
+ "description": "false: no .github/dependabot.yml for the review workflow's pinned actions (an existing one is left alone), recorded as review.dependabot in toolkit.config.json. true clears that record. Omitted: the record, else true"
58
+ },
55
59
  "dryRun": {
56
60
  "type": "boolean",
57
61
  "default": false,
@@ -71,6 +71,10 @@
71
71
  "type": "boolean",
72
72
  "description": "Toggle add-review. Defaults to the preset's review.enabled default (quick-start and solo: off, team: on). Off never removes review files a workspace already has"
73
73
  },
74
+ "dependabot": {
75
+ "type": "boolean",
76
+ "description": "With review on, passed to add-review. false: no .github/dependabot.yml for the review workflow's pinned actions (an existing one is left alone), recorded as review.dependabot in toolkit.config.json. true clears that record. Omitted: the record, else true"
77
+ },
74
78
  "dryRun": {
75
79
  "type": "boolean",
76
80
  "default": false,