@bamboocss/generator 1.34.0 → 1.34.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.
package/dist/index.cjs CHANGED
@@ -4097,13 +4097,15 @@ var Generator = class extends _bamboocss_core.Context {
4097
4097
  * Only under `unresolvedToken: 'error'` — see that option for why this one is graded and a
4098
4098
  * dead binding is not.
4099
4099
  *
4100
- * Read off the decoded sheet rather than accumulated as `transform` runs, and that is the
4101
- * load-bearing part. A `Context` outlives rebuilds while the decoder memoizes each atom by
4102
- * hash, so on the second build of the same source `transform` is never re-entered: an
4103
- * accumulating record either keeps a finding past the edit that fixed it — wedging a dev
4104
- * server — or is cleared and then never refilled, which passes a build whose source is
4105
- * still broken. That second one is the worse failure and is what an earlier version of this
4106
- * did.
4100
+ * Two sources, because neither sees the whole build.
4101
+ *
4102
+ * **Atomic styles are read off the decoded sheet** rather than accumulated as `transform`
4103
+ * runs, and that is the load-bearing part for them. A `Context` outlives rebuilds while the
4104
+ * decoder memoizes each atom by hash, so on the second build of the same source `transform`
4105
+ * is never re-entered: an accumulating record either keeps a finding past the edit that
4106
+ * fixed it — wedging a dev server — or is cleared and then never refilled, which passes a
4107
+ * build whose source is still broken. That second one is the worse failure and is what an
4108
+ * earlier version of this did.
4107
4109
  *
4108
4110
  * `decoder.atomic` has neither problem, because it is not a record of what happened — it is
4109
4111
  * what the sheet is built from, and each result keeps the `prop` and `value` it was written
@@ -4117,22 +4119,35 @@ var Generator = class extends _bamboocss_core.Context {
4117
4119
  * own output. A production build is a fresh process and sees only what its source asked
4118
4120
  * for.
4119
4121
  *
4122
+ * **Config-derived styles are not in that set at all**, which is the gap this used to have.
4123
+ * `globalCss`, the reset, config recipes and compositions serialize through
4124
+ * `transformStyles`, and that clones the decoder — so their atoms land in a throwaway and
4125
+ * `decoder.atomic` never hears about them. Reading only the sheet made `'error'` *quieter*
4126
+ * than the default on exactly those styles: the warning was suppressed in favour of a check
4127
+ * that could not see them, so a bad token in `globalCss` warned with the option unset and
4128
+ * then passed silently with it set to `'error'`. `utility.unresolvedTokens` is the record of
4129
+ * what only `transform` can see; see it for why accumulating is right for that half.
4130
+ *
4131
+ * Both halves key on `property:path` with shorthands resolved, so a value that does reach
4132
+ * both — every atomic style is transformed once before it is memoized — is one finding.
4133
+ *
4120
4134
  * Here rather than beside the asserts in `BambooContext` because this is where the sheet
4121
4135
  * exists: those all run during extraction, before anything has been decoded. Every path
4122
4136
  * that emits css comes through `getCss`.
4123
4137
  */
4124
4138
  assertNoUnresolvedTokens = () => {
4125
4139
  if (this.config.unresolvedToken !== "error") return;
4126
- const found = /* @__PURE__ */ new Map();
4140
+ const found = new Map(this.utility.unresolvedTokens);
4127
4141
  for (const atom of this.decoder.atomic) {
4128
4142
  const { prop, value } = atom.entry;
4129
4143
  if (typeof value !== "string" || typeof prop !== "string") continue;
4130
4144
  if (!this.utility.isUnresolvedTokenValue(prop, value)) continue;
4131
- const bare = this.utility.bareTokenPath(prop, value);
4132
- found.set(`${prop}:${bare}`, {
4133
- prop,
4145
+ const key = this.utility.resolveShorthand(prop);
4146
+ const bare = this.utility.bareTokenPath(key, value);
4147
+ found.set(`${key}:${bare}`, {
4148
+ prop: key,
4134
4149
  value: bare,
4135
- category: this.utility.getTokenCategory(prop)
4150
+ category: this.utility.getTokenCategory(key)
4136
4151
  });
4137
4152
  }
4138
4153
  if (!found.size) return;
package/dist/index.d.cts CHANGED
@@ -135,13 +135,15 @@ declare class Generator extends Context {
135
135
  * Only under `unresolvedToken: 'error'` — see that option for why this one is graded and a
136
136
  * dead binding is not.
137
137
  *
138
- * Read off the decoded sheet rather than accumulated as `transform` runs, and that is the
139
- * load-bearing part. A `Context` outlives rebuilds while the decoder memoizes each atom by
140
- * hash, so on the second build of the same source `transform` is never re-entered: an
141
- * accumulating record either keeps a finding past the edit that fixed it — wedging a dev
142
- * server — or is cleared and then never refilled, which passes a build whose source is
143
- * still broken. That second one is the worse failure and is what an earlier version of this
144
- * did.
138
+ * Two sources, because neither sees the whole build.
139
+ *
140
+ * **Atomic styles are read off the decoded sheet** rather than accumulated as `transform`
141
+ * runs, and that is the load-bearing part for them. A `Context` outlives rebuilds while the
142
+ * decoder memoizes each atom by hash, so on the second build of the same source `transform`
143
+ * is never re-entered: an accumulating record either keeps a finding past the edit that
144
+ * fixed it — wedging a dev server — or is cleared and then never refilled, which passes a
145
+ * build whose source is still broken. That second one is the worse failure and is what an
146
+ * earlier version of this did.
145
147
  *
146
148
  * `decoder.atomic` has neither problem, because it is not a record of what happened — it is
147
149
  * what the sheet is built from, and each result keeps the `prop` and `value` it was written
@@ -155,6 +157,18 @@ declare class Generator extends Context {
155
157
  * own output. A production build is a fresh process and sees only what its source asked
156
158
  * for.
157
159
  *
160
+ * **Config-derived styles are not in that set at all**, which is the gap this used to have.
161
+ * `globalCss`, the reset, config recipes and compositions serialize through
162
+ * `transformStyles`, and that clones the decoder — so their atoms land in a throwaway and
163
+ * `decoder.atomic` never hears about them. Reading only the sheet made `'error'` *quieter*
164
+ * than the default on exactly those styles: the warning was suppressed in favour of a check
165
+ * that could not see them, so a bad token in `globalCss` warned with the option unset and
166
+ * then passed silently with it set to `'error'`. `utility.unresolvedTokens` is the record of
167
+ * what only `transform` can see; see it for why accumulating is right for that half.
168
+ *
169
+ * Both halves key on `property:path` with shorthands resolved, so a value that does reach
170
+ * both — every atomic style is transformed once before it is memoized — is one finding.
171
+ *
158
172
  * Here rather than beside the asserts in `BambooContext` because this is where the sheet
159
173
  * exists: those all run during extraction, before anything has been decoded. Every path
160
174
  * that emits css comes through `getCss`.
package/dist/index.d.mts CHANGED
@@ -135,13 +135,15 @@ declare class Generator extends Context {
135
135
  * Only under `unresolvedToken: 'error'` — see that option for why this one is graded and a
136
136
  * dead binding is not.
137
137
  *
138
- * Read off the decoded sheet rather than accumulated as `transform` runs, and that is the
139
- * load-bearing part. A `Context` outlives rebuilds while the decoder memoizes each atom by
140
- * hash, so on the second build of the same source `transform` is never re-entered: an
141
- * accumulating record either keeps a finding past the edit that fixed it — wedging a dev
142
- * server — or is cleared and then never refilled, which passes a build whose source is
143
- * still broken. That second one is the worse failure and is what an earlier version of this
144
- * did.
138
+ * Two sources, because neither sees the whole build.
139
+ *
140
+ * **Atomic styles are read off the decoded sheet** rather than accumulated as `transform`
141
+ * runs, and that is the load-bearing part for them. A `Context` outlives rebuilds while the
142
+ * decoder memoizes each atom by hash, so on the second build of the same source `transform`
143
+ * is never re-entered: an accumulating record either keeps a finding past the edit that
144
+ * fixed it — wedging a dev server — or is cleared and then never refilled, which passes a
145
+ * build whose source is still broken. That second one is the worse failure and is what an
146
+ * earlier version of this did.
145
147
  *
146
148
  * `decoder.atomic` has neither problem, because it is not a record of what happened — it is
147
149
  * what the sheet is built from, and each result keeps the `prop` and `value` it was written
@@ -155,6 +157,18 @@ declare class Generator extends Context {
155
157
  * own output. A production build is a fresh process and sees only what its source asked
156
158
  * for.
157
159
  *
160
+ * **Config-derived styles are not in that set at all**, which is the gap this used to have.
161
+ * `globalCss`, the reset, config recipes and compositions serialize through
162
+ * `transformStyles`, and that clones the decoder — so their atoms land in a throwaway and
163
+ * `decoder.atomic` never hears about them. Reading only the sheet made `'error'` *quieter*
164
+ * than the default on exactly those styles: the warning was suppressed in favour of a check
165
+ * that could not see them, so a bad token in `globalCss` warned with the option unset and
166
+ * then passed silently with it set to `'error'`. `utility.unresolvedTokens` is the record of
167
+ * what only `transform` can see; see it for why accumulating is right for that half.
168
+ *
169
+ * Both halves key on `property:path` with shorthands resolved, so a value that does reach
170
+ * both — every atomic style is transformed once before it is memoized — is one finding.
171
+ *
158
172
  * Here rather than beside the asserts in `BambooContext` because this is where the sheet
159
173
  * exists: those all run during extraction, before anything has been decoded. Every path
160
174
  * that emits css comes through `getCss`.
package/dist/index.mjs CHANGED
@@ -4071,13 +4071,15 @@ var Generator = class extends Context {
4071
4071
  * Only under `unresolvedToken: 'error'` — see that option for why this one is graded and a
4072
4072
  * dead binding is not.
4073
4073
  *
4074
- * Read off the decoded sheet rather than accumulated as `transform` runs, and that is the
4075
- * load-bearing part. A `Context` outlives rebuilds while the decoder memoizes each atom by
4076
- * hash, so on the second build of the same source `transform` is never re-entered: an
4077
- * accumulating record either keeps a finding past the edit that fixed it — wedging a dev
4078
- * server — or is cleared and then never refilled, which passes a build whose source is
4079
- * still broken. That second one is the worse failure and is what an earlier version of this
4080
- * did.
4074
+ * Two sources, because neither sees the whole build.
4075
+ *
4076
+ * **Atomic styles are read off the decoded sheet** rather than accumulated as `transform`
4077
+ * runs, and that is the load-bearing part for them. A `Context` outlives rebuilds while the
4078
+ * decoder memoizes each atom by hash, so on the second build of the same source `transform`
4079
+ * is never re-entered: an accumulating record either keeps a finding past the edit that
4080
+ * fixed it — wedging a dev server — or is cleared and then never refilled, which passes a
4081
+ * build whose source is still broken. That second one is the worse failure and is what an
4082
+ * earlier version of this did.
4081
4083
  *
4082
4084
  * `decoder.atomic` has neither problem, because it is not a record of what happened — it is
4083
4085
  * what the sheet is built from, and each result keeps the `prop` and `value` it was written
@@ -4091,22 +4093,35 @@ var Generator = class extends Context {
4091
4093
  * own output. A production build is a fresh process and sees only what its source asked
4092
4094
  * for.
4093
4095
  *
4096
+ * **Config-derived styles are not in that set at all**, which is the gap this used to have.
4097
+ * `globalCss`, the reset, config recipes and compositions serialize through
4098
+ * `transformStyles`, and that clones the decoder — so their atoms land in a throwaway and
4099
+ * `decoder.atomic` never hears about them. Reading only the sheet made `'error'` *quieter*
4100
+ * than the default on exactly those styles: the warning was suppressed in favour of a check
4101
+ * that could not see them, so a bad token in `globalCss` warned with the option unset and
4102
+ * then passed silently with it set to `'error'`. `utility.unresolvedTokens` is the record of
4103
+ * what only `transform` can see; see it for why accumulating is right for that half.
4104
+ *
4105
+ * Both halves key on `property:path` with shorthands resolved, so a value that does reach
4106
+ * both — every atomic style is transformed once before it is memoized — is one finding.
4107
+ *
4094
4108
  * Here rather than beside the asserts in `BambooContext` because this is where the sheet
4095
4109
  * exists: those all run during extraction, before anything has been decoded. Every path
4096
4110
  * that emits css comes through `getCss`.
4097
4111
  */
4098
4112
  assertNoUnresolvedTokens = () => {
4099
4113
  if (this.config.unresolvedToken !== "error") return;
4100
- const found = /* @__PURE__ */ new Map();
4114
+ const found = new Map(this.utility.unresolvedTokens);
4101
4115
  for (const atom of this.decoder.atomic) {
4102
4116
  const { prop, value } = atom.entry;
4103
4117
  if (typeof value !== "string" || typeof prop !== "string") continue;
4104
4118
  if (!this.utility.isUnresolvedTokenValue(prop, value)) continue;
4105
- const bare = this.utility.bareTokenPath(prop, value);
4106
- found.set(`${prop}:${bare}`, {
4107
- prop,
4119
+ const key = this.utility.resolveShorthand(prop);
4120
+ const bare = this.utility.bareTokenPath(key, value);
4121
+ found.set(`${key}:${bare}`, {
4122
+ prop: key,
4108
4123
  value: bare,
4109
- category: this.utility.getTokenCategory(prop)
4124
+ category: this.utility.getTokenCategory(key)
4110
4125
  });
4111
4126
  }
4112
4127
  if (!found.size) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/generator",
3
- "version": "1.34.0",
3
+ "version": "1.34.1",
4
4
  "description": "The css generator for css bamboo",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -38,12 +38,12 @@
38
38
  "pluralize": "8.0.0",
39
39
  "postcss": "8.5.26",
40
40
  "ts-pattern": "5.9.0",
41
- "@bamboocss/core": "1.34.0",
42
- "@bamboocss/logger": "1.34.0",
43
- "@bamboocss/token-dictionary": "1.34.0",
44
- "@bamboocss/is-valid-prop": "^1.34.0",
45
- "@bamboocss/shared": "1.34.0",
46
- "@bamboocss/types": "1.34.0"
41
+ "@bamboocss/core": "1.34.1",
42
+ "@bamboocss/is-valid-prop": "^1.34.1",
43
+ "@bamboocss/logger": "1.34.1",
44
+ "@bamboocss/shared": "1.34.1",
45
+ "@bamboocss/token-dictionary": "1.34.1",
46
+ "@bamboocss/types": "1.34.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/pluralize": "0.0.33"