@hublo/sentinel 1.2.0-alpha.3 → 1.2.0-alpha.4

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.
@@ -21,7 +21,7 @@ import {
21
21
  registerAdapters,
22
22
  resolve,
23
23
  resolveBin
24
- } from "../chunk-YZ4EKBK7.js";
24
+ } from "../chunk-6DBTDMSN.js";
25
25
 
26
26
  // bin/sentinel.ts
27
27
  import { program } from "commander";
@@ -469,7 +469,7 @@ var BUILD_CONFIG_FILES = [
469
469
  ];
470
470
  var BUILD_PRESET_SPECIFIER = "@hublo/sentinel/build/react";
471
471
  var BUILD_SCRIPT_NAME = "build";
472
- var SENTINEL_BUILD_COMMAND = "sentinel --run --build";
472
+ var SENTINEL_BUILD_COMMAND = "sentinel --run --build --";
473
473
  var DEV_SCRIPT_NAME = "serve";
474
474
  var SENTINEL_DEV_COMMAND = "sentinel --run --dev";
475
475
  function buildTarget() {
@@ -726,7 +726,9 @@ function buildScripts(cwd) {
726
726
  const own2 = moduleName(cwd);
727
727
  scripts[DEV_SCRIPT_NAME] = composeDevScript(
728
728
  existingDev,
729
- `${selfCommand(cwd, "--run --dev") ?? SENTINEL_DEV_COMMAND} --module ${own2}`
729
+ // Trailing `--` for the same reason as the build script: whatever the caller appends
730
+ // reaches Vite, not sentinel's parser. It goes after `--module`, which is sentinel's own.
731
+ `${selfCommand(cwd, "--run --dev") ?? SENTINEL_DEV_COMMAND} --module ${own2} --`
730
732
  );
731
733
  }
732
734
  return scripts;
@@ -935,22 +937,24 @@ var ViteDevAdapter = class extends ViteRoleAdapter {
935
937
  return "dev";
936
938
  }
937
939
  /**
938
- * There is no such thing as adopting the dev server on its own.
940
+ * `--init --dev` does the same thing as `--init --build`, and now says so.
939
941
  *
940
- * `ViteRoleAdapter.plan()` is shared with `--build` because everything else about the two
941
- * targets is shared, and inheriting it here made `--init --dev` perform the FULL build
942
- * adoption, silently, under a message that only ever mentioned the build. Exiting 0 on that
943
- * is the worst of the options: it teaches that dev can be adopted by itself, and that belief
944
- * is what produces the half-migrated module this role exists to prevent (see the class
945
- * comment above, and `registerBuild`).
946
- *
947
- * A single plan writes both scripts, so the honest answer is to name the command that does
948
- * it rather than to do it under a different name.
942
+ * The shared plan is deliberate (see `ViteRoleAdapter.plan`): one plan writes both scripts,
943
+ * because adopting one without the other leaves the module half-migrated. What was missing
944
+ * was only the telling: the run printed a message about the build and nothing about `serve`,
945
+ * so a developer could believe the dev server had been adopted on its own. Refusing was the
946
+ * wrong correction, it added friction to a command that already produced the right result.
949
947
  */
950
- plan() {
951
- throw new Error(
952
- "the dev server is adopted together with the build, never on its own. Run --init --build: one plan writes both the `build` and the `serve` scripts."
953
- );
948
+ plan(context) {
949
+ const planned = super.plan(context);
950
+ if (planned.operations.length === 0) return planned;
951
+ return {
952
+ ...planned,
953
+ notes: [
954
+ ...planned.notes ?? [],
955
+ "--init --dev adopts the build too: one plan writes both `build` and `serve`."
956
+ ]
957
+ };
954
958
  }
955
959
  /**
956
960
  * Start the dev server. It does not return until stopped, so there is no verdict to report
@@ -6261,4 +6265,4 @@ export {
6261
6265
  detectFramework,
6262
6266
  dispatch
6263
6267
  };
6264
- //# sourceMappingURL=chunk-YZ4EKBK7.js.map
6268
+ //# sourceMappingURL=chunk-6DBTDMSN.js.map
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  registerAdapters,
8
8
  resolve,
9
9
  setDefaultRunner
10
- } from "./chunk-YZ4EKBK7.js";
10
+ } from "./chunk-6DBTDMSN.js";
11
11
  export {
12
12
  BaseAdapter,
13
13
  all,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.2.0-alpha.3",
3
+ "version": "1.2.0-alpha.4",
4
4
  "description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
5
5
  "type": "module",
6
6
  "license": "MIT",