@bamboocss/config 1.43.0 → 1.44.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
@@ -865,7 +865,7 @@ const validateRecipes = (options) => {
865
865
  * upgrading across them.
866
866
  */
867
867
  const REMOVED = {
868
- pruneUnusedTokens: (value) => value === "strict" ? `\`pruneUnusedTokens: 'strict'\` is now \`prune: { tokens: 'accounted', unresolvedPath: 'error' }\`.` : `\`pruneUnusedTokens\` is now \`prune: { tokens: '${value === false ? "off" : "reachable"}' }\`.`,
868
+ pruneUnusedTokens: (value) => value === "strict" ? `\`pruneUnusedTokens: 'strict'\` is now \`prune: { tokens: true, unresolvedPath: 'error' }\`.` : `\`pruneUnusedTokens\` is now \`prune: { tokens: ${value === false ? "false" : "true"} }\`.`,
869
869
  pruneUnusedKeyframes: (value) => `\`pruneUnusedKeyframes\` is now \`prune: { keyframes: ${value === false ? "false" : "true"} }\`.`,
870
870
  prunePreflight: (value) => `\`prunePreflight\` is now \`preflight: { prune: ${value === false ? "false" : "true"} }\`.`,
871
871
  globalCss: () => `\`globalCss\` is now \`global: { css }\`.`,
@@ -884,7 +884,7 @@ const COMPOSITION_MOVED = (old, prop) => () => `\`theme.${old}\` is now \`theme.
884
884
  const REMOVED_NESTED = {
885
885
  prune: {
886
886
  preflight: (value) => `\`prune.preflight\` is now \`preflight: { prune: ${value === false ? "false" : "true"} }\`. It was a second key named \`preflight\` one level away from the one that emits the reset, so a config asked for a reset in one place and reshaped it in another — and pruning a scoped reset already had to read \`preflight.scope\` to work at all.`,
887
- unresolved: (value) => `\`prune.unresolved\` is now \`prune.unresolvedPath\`, and the accounting pass it used to switch on is now \`prune.tokens: 'accounted'\` — write \`prune: { tokens: 'accounted', unresolvedPath: '${value === "error" ? "error" : "warn"}' }\`. They are separate because \`'off'\` used to mean two things at once: no accounting, and no report.`
887
+ unresolved: (value) => `\`prune.unresolved\` is now \`prune.unresolvedPath\` — write \`prune: { tokens: true, unresolvedPath: '${value === "error" ? "error" : "warn"}' }\`. The accounting pass it used to switch on runs by default now, so this only decides whether an unfollowable path is reported.`
888
888
  },
889
889
  theme: {
890
890
  textStyles: COMPOSITION_MOVED("textStyles", "textStyle"),
@@ -939,7 +939,10 @@ function validateRemovedOptions(config, addError) {
939
939
  const message = retired[value];
940
940
  if (message) addError("config", message);
941
941
  }
942
- if (typeof dict.prune?.tokens === "boolean") addError("config", `\`prune.tokens\` takes a strategy now, not a boolean — write \`'${dict.prune.tokens ? "reachable" : "off"}'\`. \`'accounted'\` is the new one: keeps computed from the token paths in your source rather than from what the css reaches.`);
942
+ if (typeof dict.prune?.tokens === "string") {
943
+ const strategy = dict.prune.tokens;
944
+ addError("config", `\`prune.tokens\` takes a boolean now, not a strategy — write \`${strategy === "off" ? "false" : "true"}\`.${strategy === "reachable" ? ` \`true\` accounts for each token path individually rather than keeping every declaration the moment javascript reaches for one, so it prunes at least as much and usually far more.` : strategy === "accounted" ? ` That is what \`true\` does now; it stopped being something to opt into. Reporting moved to \`prune: { unresolvedPath: 'warn' }\`, which \`'accounted'\` used to imply.` : ""}`);
945
+ }
943
946
  for (const [name, pattern] of Object.entries(config.patterns ?? {})) {
944
947
  const dictPattern = pattern;
945
948
  if (!dictPattern) continue;
package/dist/index.mjs CHANGED
@@ -837,7 +837,7 @@ const validateRecipes = (options) => {
837
837
  * upgrading across them.
838
838
  */
839
839
  const REMOVED = {
840
- pruneUnusedTokens: (value) => value === "strict" ? `\`pruneUnusedTokens: 'strict'\` is now \`prune: { tokens: 'accounted', unresolvedPath: 'error' }\`.` : `\`pruneUnusedTokens\` is now \`prune: { tokens: '${value === false ? "off" : "reachable"}' }\`.`,
840
+ pruneUnusedTokens: (value) => value === "strict" ? `\`pruneUnusedTokens: 'strict'\` is now \`prune: { tokens: true, unresolvedPath: 'error' }\`.` : `\`pruneUnusedTokens\` is now \`prune: { tokens: ${value === false ? "false" : "true"} }\`.`,
841
841
  pruneUnusedKeyframes: (value) => `\`pruneUnusedKeyframes\` is now \`prune: { keyframes: ${value === false ? "false" : "true"} }\`.`,
842
842
  prunePreflight: (value) => `\`prunePreflight\` is now \`preflight: { prune: ${value === false ? "false" : "true"} }\`.`,
843
843
  globalCss: () => `\`globalCss\` is now \`global: { css }\`.`,
@@ -856,7 +856,7 @@ const COMPOSITION_MOVED = (old, prop) => () => `\`theme.${old}\` is now \`theme.
856
856
  const REMOVED_NESTED = {
857
857
  prune: {
858
858
  preflight: (value) => `\`prune.preflight\` is now \`preflight: { prune: ${value === false ? "false" : "true"} }\`. It was a second key named \`preflight\` one level away from the one that emits the reset, so a config asked for a reset in one place and reshaped it in another — and pruning a scoped reset already had to read \`preflight.scope\` to work at all.`,
859
- unresolved: (value) => `\`prune.unresolved\` is now \`prune.unresolvedPath\`, and the accounting pass it used to switch on is now \`prune.tokens: 'accounted'\` — write \`prune: { tokens: 'accounted', unresolvedPath: '${value === "error" ? "error" : "warn"}' }\`. They are separate because \`'off'\` used to mean two things at once: no accounting, and no report.`
859
+ unresolved: (value) => `\`prune.unresolved\` is now \`prune.unresolvedPath\` — write \`prune: { tokens: true, unresolvedPath: '${value === "error" ? "error" : "warn"}' }\`. The accounting pass it used to switch on runs by default now, so this only decides whether an unfollowable path is reported.`
860
860
  },
861
861
  theme: {
862
862
  textStyles: COMPOSITION_MOVED("textStyles", "textStyle"),
@@ -911,7 +911,10 @@ function validateRemovedOptions(config, addError) {
911
911
  const message = retired[value];
912
912
  if (message) addError("config", message);
913
913
  }
914
- if (typeof dict.prune?.tokens === "boolean") addError("config", `\`prune.tokens\` takes a strategy now, not a boolean — write \`'${dict.prune.tokens ? "reachable" : "off"}'\`. \`'accounted'\` is the new one: keeps computed from the token paths in your source rather than from what the css reaches.`);
914
+ if (typeof dict.prune?.tokens === "string") {
915
+ const strategy = dict.prune.tokens;
916
+ addError("config", `\`prune.tokens\` takes a boolean now, not a strategy — write \`${strategy === "off" ? "false" : "true"}\`.${strategy === "reachable" ? ` \`true\` accounts for each token path individually rather than keeping every declaration the moment javascript reaches for one, so it prunes at least as much and usually far more.` : strategy === "accounted" ? ` That is what \`true\` does now; it stopped being something to opt into. Reporting moved to \`prune: { unresolvedPath: 'warn' }\`, which \`'accounted'\` used to imply.` : ""}`);
917
+ }
915
918
  for (const [name, pattern] of Object.entries(config.patterns ?? {})) {
916
919
  const dictPattern = pattern;
917
920
  if (!dictPattern) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/config",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "description": "Find and load bamboo config",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -64,11 +64,11 @@
64
64
  "escalade": "3.2.0",
65
65
  "microdiff": "1.5.0",
66
66
  "typescript": "6.0.2",
67
- "@bamboocss/logger": "1.43.0",
68
- "@bamboocss/preset-bamboo": "1.43.0",
69
- "@bamboocss/preset-base": "1.43.0",
70
- "@bamboocss/shared": "1.43.0",
71
- "@bamboocss/types": "1.43.0"
67
+ "@bamboocss/logger": "1.44.0",
68
+ "@bamboocss/preset-bamboo": "1.44.0",
69
+ "@bamboocss/preset-base": "1.44.0",
70
+ "@bamboocss/shared": "1.44.0",
71
+ "@bamboocss/types": "1.44.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "pkg-types": "2.3.0"