@hublo/sentinel 1.2.0-alpha.0 → 1.2.0-alpha.1

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.
@@ -0,0 +1,39 @@
1
+ // src/roles/build/presets/requirements.json
2
+ var requirements_default = {
3
+ svelte: {
4
+ why: "sentinel ships Vite 8, and @sveltejs/vite-plugin-svelte caps at Vite 6 until its major 7",
5
+ requires: {
6
+ "@sveltejs/vite-plugin-svelte": "7.0.0",
7
+ svelte: "5.46.4"
8
+ }
9
+ }
10
+ };
11
+
12
+ // src/roles/build/presets/shared.json
13
+ var shared_default = {
14
+ target: "chrome89",
15
+ allowedHosts: [".hubpreprod.com", ".playground-hublo.com"],
16
+ publicAssets: [
17
+ {
18
+ dir: "public/branding",
19
+ baseURL: "/branding",
20
+ maxAge: 31536e3
21
+ }
22
+ ]
23
+ };
24
+
25
+ // src/roles/build/preset-data.ts
26
+ var REACT_APP_DEFAULTS = shared_default;
27
+ var REQUIREMENTS = requirements_default;
28
+
29
+ // src/shared/deep-merge.ts
30
+ function isPlainObject(value) {
31
+ return typeof value === "object" && value !== null && !Array.isArray(value);
32
+ }
33
+
34
+ export {
35
+ REACT_APP_DEFAULTS,
36
+ REQUIREMENTS,
37
+ isPlainObject
38
+ };
39
+ //# sourceMappingURL=chunk-XVDOQ3G3.js.map
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@ import {
7
7
  registerAdapters,
8
8
  resolve,
9
9
  setDefaultRunner
10
- } from "./chunk-TWL6T237.js";
11
- import "./chunk-XSCDJZDY.js";
10
+ } from "./chunk-FLJ2QNFF.js";
11
+ import "./chunk-XVDOQ3G3.js";
12
12
  export {
13
13
  BaseAdapter,
14
14
  all,
@@ -93,14 +93,10 @@ declare function appEnv(root: string, mode: string): Record<string, string>;
93
93
  /** True when this run is a test rather than a real build. */
94
94
  declare function isTestMode(mode: string, env?: NodeJS.ProcessEnv): boolean;
95
95
  /**
96
- * WHICH plugins run, as names, in order.
96
+ * The plugin names in the order they run, which is what `--inspect` reports.
97
97
  *
98
- * Split out from building them so the rule can be tested without instantiating a single
99
- * plugin. The rule is the part that must not diverge between apps; the instances are just
100
- * function calls.
101
- *
102
- * Under test the router plugin runs alone: `tanstackStart` and `nitro` bring a server the
103
- * tests neither need nor can run. All three apps already do this, identically.
98
+ * `extras` is how many plugins the app appends of its own; they are named positionally
99
+ * because sentinel has no way to name a function someone else passed in.
104
100
  */
105
101
  declare function pluginPlan(isTest: boolean, extras?: number): string[];
106
102
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  REACT_APP_DEFAULTS,
3
3
  isPlainObject
4
- } from "../../chunk-XSCDJZDY.js";
4
+ } from "../../chunk-XVDOQ3G3.js";
5
5
 
6
6
  // src/roles/build/react-app.ts
7
7
  import tailwindcss from "@tailwindcss/vite";
@@ -33,22 +33,37 @@ function appEnv(root, mode) {
33
33
  function isTestMode(mode, env = process.env) {
34
34
  return mode === "test" || env.VITEST === "true";
35
35
  }
36
+ function pluginEntries(options, isTest) {
37
+ const { tanstack, router } = options;
38
+ return [
39
+ { name: "tailwindcss", build: () => tailwindcss() },
40
+ ...isTest ? [
41
+ {
42
+ name: "tanstackRouter",
43
+ build: () => tanstack.router({ ...router, target: "react", autoCodeSplitting: true })
44
+ }
45
+ ] : [
46
+ { name: "tanstackStart", build: () => tanstack.start({ router }) },
47
+ { name: "nitro", build: () => nitro() }
48
+ ],
49
+ { name: "react", build: () => react() },
50
+ { name: "svgr", build: () => svgr() }
51
+ ];
52
+ }
36
53
  function pluginPlan(isTest, extras = 0) {
54
+ const entries = pluginEntries(
55
+ { tanstack: { start: () => [], router: () => null }, router: STUB_ROUTER },
56
+ isTest
57
+ );
37
58
  return [
38
- "tailwindcss",
39
- ...isTest ? ["tanstackRouter"] : ["tanstackStart", "nitro"],
40
- "react",
41
- "svgr",
59
+ ...entries.map((entry) => entry.name),
42
60
  ...Array.from({ length: extras }, (_, at) => `app:${at}`)
43
61
  ];
44
62
  }
63
+ var STUB_ROUTER = { routesDirectory: "", generatedRouteTree: "" };
45
64
  function basePlugins(options, isTest) {
46
- const { tanstack, router } = options;
47
65
  return [
48
- tailwindcss(),
49
- ...isTest ? [tanstack.router({ ...router, target: "react", autoCodeSplitting: true })] : [...tanstack.start({ router }), nitro()],
50
- react(),
51
- svgr(),
66
+ ...pluginEntries(options, isTest).flatMap((entry) => entry.build()),
52
67
  ...options.plugins ?? []
53
68
  ];
54
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.2.0-alpha.0",
3
+ "version": "1.2.0-alpha.1",
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",
@@ -1,26 +0,0 @@
1
- // src/roles/build/presets/base.json
2
- var base_default = {
3
- target: "chrome89",
4
- allowedHosts: [".hubpreprod.com", ".playground-hublo.com"],
5
- publicAssets: [
6
- {
7
- dir: "public/branding",
8
- baseURL: "/branding",
9
- maxAge: 31536e3
10
- }
11
- ]
12
- };
13
-
14
- // src/roles/build/preset-data.ts
15
- var REACT_APP_DEFAULTS = base_default;
16
-
17
- // src/shared/deep-merge.ts
18
- function isPlainObject(value) {
19
- return typeof value === "object" && value !== null && !Array.isArray(value);
20
- }
21
-
22
- export {
23
- REACT_APP_DEFAULTS,
24
- isPlainObject
25
- };
26
- //# sourceMappingURL=chunk-XSCDJZDY.js.map