@mnci/cli 1.15.7 → 1.15.8

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
@@ -145,7 +145,13 @@ that would just fail felt worse than being upfront that it doesn't exist yet.
145
145
  2. Patches `nx.json` with the release opinion (the only config Nx has no
146
146
  default for): independent versioning from **conventional commits**,
147
147
  `{projectName}@{version}` tags, **tag-only git** (`commit: false`) — nothing
148
- is ever pushed to `main`; future runs resolve versions from tag names.
148
+ is ever pushed to `main`; future runs resolve versions from tag names. Also
149
+ fills in `namedInputs.sharedGlobals` with the root config files
150
+ (`eslint.config.mjs`, `tsconfig.base.json`, `package.json`), without which
151
+ `nx affected` on a pull request is blind to them: they live in no project, so
152
+ changing one marked only the root pseudo-project — which has no
153
+ lint/typecheck/test/build target — and the affected-scoped verify step ran
154
+ nothing at all while reporting green.
149
155
  3. Writes `eslint.config.mjs` (three lines importing `@mnci/eslint-config` —
150
156
  the whole linting opinion, in one root config), `.prettierrc.json` +
151
157
  `.prettierignore`, `.npmrc` (publish auth — see **Publish auth** below),
@@ -169,7 +175,8 @@ this existed; nothing let an already-generated workspace pick one up.
169
175
  `mnci upgrade`, run from the workspace root, closes that gap: it resolves the
170
176
  same options `new` would have and calls the exact same `applyOverlay` `new`
171
177
  itself calls — the one function that does every bit of `mnci`-owned file
172
- writing (`nx.json`'s `release`/`sync`/`generators`/`mnci` blocks, `.npmrc`,
178
+ writing (`nx.json`'s `release`/`sync`/`generators`/`namedInputs.sharedGlobals`/
179
+ `mnci` blocks, `.npmrc`,
173
180
  `eslint.config.mjs`, `.prettierrc.json`, `commitlint.config.mjs`,
174
181
  `.husky/commit-msg`, the CI pipeline file(s), the
175
182
  `<workspace-name>.code-workspace` file, and the curated root `package.json`
package/dist/cli.js CHANGED
@@ -1329,6 +1329,20 @@ function withEslintPlugin(nxJson) {
1329
1329
  const registered = plugins.some((entry) => pluginName(entry) === ESLINT_PLUGIN_CONFIG.plugin);
1330
1330
  return registered ? { ...nxJson, plugins } : { ...nxJson, plugins: [...plugins, ESLINT_PLUGIN_CONFIG] };
1331
1331
  }
1332
+ var SHARED_GLOBAL_INPUTS = [
1333
+ "{workspaceRoot}/eslint.config.mjs",
1334
+ "{workspaceRoot}/tsconfig.base.json",
1335
+ "{workspaceRoot}/package.json"
1336
+ ];
1337
+ function withSharedGlobals(nxJson) {
1338
+ const namedInputs = nxJson.namedInputs ?? {};
1339
+ const existing = namedInputs.sharedGlobals ?? [];
1340
+ const missing = SHARED_GLOBAL_INPUTS.filter((entry) => !existing.includes(entry));
1341
+ return {
1342
+ ...nxJson,
1343
+ namedInputs: { ...namedInputs, sharedGlobals: [...existing, ...missing] }
1344
+ };
1345
+ }
1332
1346
  function withReleaseConfig(nxJson, ci) {
1333
1347
  return { ...nxJson, defaultBase: "main", release: releaseConfig(ci) };
1334
1348
  }
@@ -2004,7 +2018,7 @@ function applyOverlay(workspaceRoot, options) {
2004
2018
  };
2005
2019
  const sync = { ...nxJson.sync, ...SYNC_CONFIG };
2006
2020
  const mnci = { ...nxJson.mnci, ...mnciConfig(options) };
2007
- const patched = withEslintPlugin(withReleaseConfig(nxJson, options.ci));
2021
+ const patched = withSharedGlobals(withEslintPlugin(withReleaseConfig(nxJson, options.ci)));
2008
2022
  writeFileEnsured(nxJsonPath, toJson({ ...patched, generators, sync, mnci }));
2009
2023
  const manifestPath = (0, import_node_path11.join)(workspaceRoot, "package.json");
2010
2024
  const manifest = readJson(manifestPath);