@bamboocss/node 1.41.0 → 1.42.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.
package/dist/index.cjs CHANGED
@@ -2306,6 +2306,7 @@ async function loadConfigAndCreateContext(options = {}) {
2306
2306
  });
2307
2307
  if (config) Object.assign(conf.config, config);
2308
2308
  if (options.cwd) conf.config.cwd = options.cwd;
2309
+ if (options.dev) conf.config.dev = true;
2309
2310
  const autoPlugins = getAutoPlugins();
2310
2311
  conf.hooks = (0, _bamboocss_config.mergeHooks)([...autoPlugins, {
2311
2312
  name: RESOLVED_HOOKS_NAME,
@@ -2971,7 +2972,8 @@ var Builder = class {
2971
2972
  });
2972
2973
  if (!this.context) return this.setupContext({
2973
2974
  configPath,
2974
- cwd: options.cwd
2975
+ cwd: options.cwd,
2976
+ dev: options.dev
2975
2977
  });
2976
2978
  const ctx = this.getContextOrThrow();
2977
2979
  this.affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
@@ -3029,10 +3031,11 @@ var Builder = class {
3029
3031
  this.hasEmitted = true;
3030
3032
  }
3031
3033
  setupContext = async (options) => {
3032
- const { configPath, cwd } = options;
3034
+ const { configPath, cwd, dev } = options;
3033
3035
  const ctx = await loadConfigAndCreateContext({
3034
3036
  configPath,
3035
- cwd
3037
+ cwd,
3038
+ dev
3036
3039
  });
3037
3040
  (0, _bamboocss_shared.uniq)([...ctx.conf.dependencies, ...ctx.explicitDeps]).forEach((file) => {
3038
3041
  this.configDependencies.add((0, path.resolve)(cwd || ctx.conf.config.cwd, file));
@@ -3516,7 +3519,7 @@ const hasUncompilableSources = (options) => {
3516
3519
  //#endregion
3517
3520
  //#region src/setup-config.ts
3518
3521
  async function setupConfig(cwd, opts = {}) {
3519
- const { force, outExtension, outdir = "styled-system", strictTokens } = opts;
3522
+ const { force, outExtension, outdir = "styled-system", strictValues } = opts;
3520
3523
  let configFile;
3521
3524
  try {
3522
3525
  configFile = (0, _bamboocss_config.findConfig)({ cwd });
@@ -3539,10 +3542,10 @@ export default defineConfig({
3539
3542
  ${outExtension ? `\n // The extension for the emitted JavaScript files\noutExtension: '${outExtension}',` : ""}
3540
3543
  // Where to look for your css declarations
3541
3544
  include: ["./src/**/*.{js,jsx,ts,tsx}", "./pages/**/*.{js,jsx,ts,tsx}"],
3542
- ${strictTokens ? `
3543
- // How much of a style value typescript checks. \`'unknown-tokens'\` rejects a value
3544
- // that is neither a token nor a keyword the property enumerates, while leaving raw
3545
- // css values alone; \`true\` allows only tokens.\nstrictTokens: ${JSON.stringify(strictTokens)},\n` : ""}
3545
+ ${strictValues ? `
3546
+ // Require every style value to be a token, so a raw css value is written \`[14px]\`.
3547
+ // A misspelled token is reported by the build whether or not this is on.
3548
+ strictValues: ${JSON.stringify(strictValues)},\n` : ""}
3546
3549
 
3547
3550
  // Files to exclude
3548
3551
  exclude: [],
package/dist/index.d.cts CHANGED
@@ -228,6 +228,7 @@ declare class Builder {
228
228
  setup: (options?: {
229
229
  configPath?: string;
230
230
  cwd?: string;
231
+ dev?: boolean;
231
232
  }) => Promise<BambooContext | undefined>;
232
233
  /**
233
234
  * Write the generated `styled-system`, so an integration can be a project's only codegen.
@@ -293,6 +294,8 @@ interface FileMeta {
293
294
  interface SetupContextOptions {
294
295
  configPath: string;
295
296
  cwd?: string;
297
+ /** Set by the integration; only a dev server knows it is one. @see `hash: 'auto'` */
298
+ dev?: boolean;
296
299
  }
297
300
  //#endregion
298
301
  //#region src/codegen.d.ts
@@ -310,6 +313,7 @@ declare function loadConfigAndCreateContext(options?: {
310
313
  cwd?: string;
311
314
  config?: Config;
312
315
  configPath?: string;
316
+ dev?: boolean;
313
317
  }): Promise<BambooContext>;
314
318
  //#endregion
315
319
  //#region src/cpu-profile.d.ts
package/dist/index.d.mts CHANGED
@@ -228,6 +228,7 @@ declare class Builder {
228
228
  setup: (options?: {
229
229
  configPath?: string;
230
230
  cwd?: string;
231
+ dev?: boolean;
231
232
  }) => Promise<BambooContext | undefined>;
232
233
  /**
233
234
  * Write the generated `styled-system`, so an integration can be a project's only codegen.
@@ -293,6 +294,8 @@ interface FileMeta {
293
294
  interface SetupContextOptions {
294
295
  configPath: string;
295
296
  cwd?: string;
297
+ /** Set by the integration; only a dev server knows it is one. @see `hash: 'auto'` */
298
+ dev?: boolean;
296
299
  }
297
300
  //#endregion
298
301
  //#region src/codegen.d.ts
@@ -310,6 +313,7 @@ declare function loadConfigAndCreateContext(options?: {
310
313
  cwd?: string;
311
314
  config?: Config;
312
315
  configPath?: string;
316
+ dev?: boolean;
313
317
  }): Promise<BambooContext>;
314
318
  //#endregion
315
319
  //#region src/cpu-profile.d.ts
package/dist/index.mjs CHANGED
@@ -2292,6 +2292,7 @@ async function loadConfigAndCreateContext(options = {}) {
2292
2292
  });
2293
2293
  if (config) Object.assign(conf.config, config);
2294
2294
  if (options.cwd) conf.config.cwd = options.cwd;
2295
+ if (options.dev) conf.config.dev = true;
2295
2296
  const autoPlugins = getAutoPlugins();
2296
2297
  conf.hooks = mergeHooks([...autoPlugins, {
2297
2298
  name: RESOLVED_HOOKS_NAME,
@@ -2957,7 +2958,8 @@ var Builder = class {
2957
2958
  });
2958
2959
  if (!this.context) return this.setupContext({
2959
2960
  configPath,
2960
- cwd: options.cwd
2961
+ cwd: options.cwd,
2962
+ dev: options.dev
2961
2963
  });
2962
2964
  const ctx = this.getContextOrThrow();
2963
2965
  this.affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
@@ -3015,10 +3017,11 @@ var Builder = class {
3015
3017
  this.hasEmitted = true;
3016
3018
  }
3017
3019
  setupContext = async (options) => {
3018
- const { configPath, cwd } = options;
3020
+ const { configPath, cwd, dev } = options;
3019
3021
  const ctx = await loadConfigAndCreateContext({
3020
3022
  configPath,
3021
- cwd
3023
+ cwd,
3024
+ dev
3022
3025
  });
3023
3026
  uniq([...ctx.conf.dependencies, ...ctx.explicitDeps]).forEach((file) => {
3024
3027
  this.configDependencies.add(resolve(cwd || ctx.conf.config.cwd, file));
@@ -3502,7 +3505,7 @@ const hasUncompilableSources = (options) => {
3502
3505
  //#endregion
3503
3506
  //#region src/setup-config.ts
3504
3507
  async function setupConfig(cwd, opts = {}) {
3505
- const { force, outExtension, outdir = "styled-system", strictTokens } = opts;
3508
+ const { force, outExtension, outdir = "styled-system", strictValues } = opts;
3506
3509
  let configFile;
3507
3510
  try {
3508
3511
  configFile = findConfig({ cwd });
@@ -3525,10 +3528,10 @@ export default defineConfig({
3525
3528
  ${outExtension ? `\n // The extension for the emitted JavaScript files\noutExtension: '${outExtension}',` : ""}
3526
3529
  // Where to look for your css declarations
3527
3530
  include: ["./src/**/*.{js,jsx,ts,tsx}", "./pages/**/*.{js,jsx,ts,tsx}"],
3528
- ${strictTokens ? `
3529
- // How much of a style value typescript checks. \`'unknown-tokens'\` rejects a value
3530
- // that is neither a token nor a keyword the property enumerates, while leaving raw
3531
- // css values alone; \`true\` allows only tokens.\nstrictTokens: ${JSON.stringify(strictTokens)},\n` : ""}
3531
+ ${strictValues ? `
3532
+ // Require every style value to be a token, so a raw css value is written \`[14px]\`.
3533
+ // A misspelled token is reported by the build whether or not this is on.
3534
+ strictValues: ${JSON.stringify(strictValues)},\n` : ""}
3532
3535
 
3533
3536
  // Files to exclude
3534
3537
  exclude: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/node",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
4
4
  "description": "The core css bamboo library",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -52,17 +52,17 @@
52
52
  "postcss": "8.5.26",
53
53
  "ts-morph": "28.0.0",
54
54
  "ts-pattern": "5.9.0",
55
- "@bamboocss/config": "1.41.0",
56
- "@bamboocss/core": "1.41.0",
57
- "@bamboocss/generator": "1.41.0",
58
- "@bamboocss/logger": "1.41.0",
59
- "@bamboocss/parser": "1.41.0",
60
- "@bamboocss/plugin-svelte": "1.41.0",
61
- "@bamboocss/plugin-vue": "1.41.0",
62
- "@bamboocss/reporter": "1.41.0",
63
- "@bamboocss/shared": "1.41.0",
64
- "@bamboocss/token-dictionary": "1.41.0",
65
- "@bamboocss/types": "1.41.0"
55
+ "@bamboocss/config": "1.42.0",
56
+ "@bamboocss/core": "1.42.0",
57
+ "@bamboocss/generator": "1.42.0",
58
+ "@bamboocss/logger": "1.42.0",
59
+ "@bamboocss/parser": "1.42.0",
60
+ "@bamboocss/plugin-svelte": "1.42.0",
61
+ "@bamboocss/plugin-vue": "1.42.0",
62
+ "@bamboocss/reporter": "1.42.0",
63
+ "@bamboocss/shared": "1.42.0",
64
+ "@bamboocss/token-dictionary": "1.42.0",
65
+ "@bamboocss/types": "1.42.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/fs-extra": "11.0.4",