@jobber/components 8.7.0 → 8.7.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,13 @@
1
+ /**
2
+ * Single entry point used only for the PREBUILD_CSS step (see rollup.config.mjs).
3
+ *
4
+ * Rollup traverses a single entry's import graph in a deterministic, depth-first
5
+ * order, which keeps the extracted styles.css ordering stable across builds.
6
+ * Update this file to include any new styles that should be included in the extracted stylesheet.
7
+ *
8
+ * Both the main barrel and the primitives barrel are imported here so that every
9
+ * component's and styled primitive's (under `src/primitives/`) CSS lands in the
10
+ * extracted stylesheet.
11
+ */
12
+ import "./index";
13
+ import "./primitives/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -556,5 +556,5 @@
556
556
  "> 1%",
557
557
  "IE 10"
558
558
  ],
559
- "gitHead": "60b75a0d6a64b67dcb6607c474ed7aa469474f98"
559
+ "gitHead": "36bbb3d447601ce2277cf1ed0265074e479ac471"
560
560
  }
package/rollup.config.mjs CHANGED
@@ -15,25 +15,24 @@ const createMultiInput =
15
15
  typeof multiInput === "function" ? multiInput : multiInput.default;
16
16
 
17
17
  /**
18
- * When PREBUILD_CSS is supplied, only build the main barrels.
19
- * This ensures postcss maintains consistent ordering of styles across builds.
18
+ * When PREBUILD_CSS is supplied, build only a single synthetic entry that
19
+ * imports every barrel. This ensures postcss maintains consistent ordering of
20
+ * styles across builds.
20
21
  *
21
- * Using multiInput (input with globs) produces inconsistent ordering within styles.css
22
- * because files are loaded in a non-deterministic order, and postcss bundles them in
23
- * that order.
22
+ * Supplying multiple inputs (multiInput globs, or separate barrels) allows rollup
23
+ * discover css imports in a non-deterministic order, which postcss then bundles
24
+ * in that order, producing a styles.css that churns on every build. A single
25
+ * entry is traversed depth-first in a deterministic order, so the extracted
26
+ * styles.css is stable.
24
27
  *
25
- * The primitives barrel is included in addition to the main barrel so that styled
26
- * primitives (under `src/primitives/`) contribute their CSS module hashes to the
27
- * extracted styles.css. Without this, primitives' class hashes appear in the JS
28
- * bundle but not in the stylesheet, so consumers see no styles applied.
28
+ * `src/prebuildCssEntry.ts` imports both the main barrel and the primitives
29
+ * barrel so that styled primitives (under `src/primitives/`) contribute their
30
+ * CSS module hashes to the extracted styles.css. Without the primitives barrel
31
+ * their class hashes appear in the JS bundle but not in the stylesheet, so
32
+ * consumers see no styles applied.
29
33
  */
30
34
  const PREBUILD_CSS = process.env.PREBUILD_CSS === "true";
31
- // Object form gives each entry a unique `[name]` for output filenames; both
32
- // inputs share the basename `index.ts`, so the array form would collide.
33
- const PREBUILD_CSS_INPUTS = {
34
- index: "src/index.ts",
35
- "primitives/index": "src/primitives/index.ts",
36
- };
35
+ const PREBUILD_CSS_INPUT = "src/prebuildCssEntry.ts";
37
36
 
38
37
  /**
39
38
  * PostCSS plugin to remove @charset declarations.
@@ -63,7 +62,7 @@ export default {
63
62
 
64
63
  warn(warning);
65
64
  },
66
- input: PREBUILD_CSS ? PREBUILD_CSS_INPUTS : `src/**/index.{ts,tsx}`,
65
+ input: PREBUILD_CSS ? PREBUILD_CSS_INPUT : `src/**/index.{ts,tsx}`,
67
66
  plugins: [
68
67
  nodePolyfills(),
69
68
  nodeResolve(),