@knapsack/design-token-utils 4.66.6--canary.4358.9a9a41d.0 → 4.67.0--canary.5f03d3b.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,37 +1,3 @@
1
- # v4.66.5 (Fri Jul 19 2024)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - KSP-5287: CSS output with var references properly reference [#4376](https://github.com/knapsack-labs/app-monorepo/pull/4376) ([@illepic](https://github.com/illepic))
6
-
7
- #### 🏠 Internal
8
-
9
- - update token import replace existing language [#4375](https://github.com/knapsack-labs/app-monorepo/pull/4375) ([@GormanDesign](https://github.com/GormanDesign))
10
-
11
- #### Authors: 2
12
-
13
- - Christopher Bloom ([@illepic](https://github.com/illepic))
14
- - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
15
-
16
- ---
17
-
18
- # v4.66.4 (Fri Jul 19 2024)
19
-
20
- #### 🐛 Bug Fix
21
-
22
- - KSP-5283: token var refs point to correct token. Figma Var imports merge correctly without deepMerge. [#4370](https://github.com/knapsack-labs/app-monorepo/pull/4370) ([@illepic](https://github.com/illepic))
23
-
24
- #### 🏠 Internal
25
-
26
- - update ReactMarkdown to latest version [#4369](https://github.com/knapsack-labs/app-monorepo/pull/4369) ([@GormanDesign](https://github.com/GormanDesign))
27
-
28
- #### Authors: 2
29
-
30
- - Christopher Bloom ([@illepic](https://github.com/illepic))
31
- - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
32
-
33
- ---
34
-
35
1
  # v4.66.3 (Fri Jul 19 2024)
36
2
 
37
3
  #### 🐛 Bug Fix
@@ -1 +1 @@
1
- {"version":3,"file":"token-collection-utils.d.ts","sourceRoot":"","sources":["../../src/collections/token-collection-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAMtF,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB,UAEA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,YAAY,EACZ,SAAS,EAAE,EAAE,eAAe,EAAE,EAC9B,QAAQ,GACT,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAuCT;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAYT;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE"}
1
+ {"version":3,"file":"token-collection-utils.d.ts","sourceRoot":"","sources":["../../src/collections/token-collection-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAMtF,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB,UAEA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,YAAY,EACZ,SAAS,EAAE,EAAE,eAAe,EAAE,EAC9B,QAAQ,GACT,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAmCT;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAYT;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE"}
@@ -20,14 +20,11 @@ export function getTokenCollectionCss({ collectionId, tokenData: { collectionsBy
20
20
  return [];
21
21
  const { value } = varInMode;
22
22
  const { type } = value;
23
- // var-refs are *groups*. Need to remove collection and root and collection
24
- // id from value
23
+ // var-refs are *groups*
25
24
  if (type === 'var-ref') {
26
- // Start with the full var value, e.g. `collections.theme.brand.color`
27
- // then remove just the collection root key + collection id from the string
28
- // e.g. `collections.theme`
29
- const refValue = value.groupId.replace(collection.groupId, '');
30
- return [` ${cssVarName(varData.id)}: var(${cssVarName(refValue)});`];
25
+ return [
26
+ ` ${cssVarName(varData.id)}: var(${cssVarName(value.groupId)});`,
27
+ ];
31
28
  }
32
29
  // Return CSS for actual vars
33
30
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"token-collection-utils.js","sourceRoot":"","sources":["../../src/collections/token-collection-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AAErD,MAAM,UAAU,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,GAIP;IACC,OAAO,QAAQ,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,MAAM,GAAG,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,EACpC,YAAY,EACZ,SAAS,EAAE,EAAE,eAAe,EAAE,EAC9B,QAAQ,GAKT;IACC,MAAM,UAAU,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,KAAK,GAAa,UAAU,CAAC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AAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,GAIT;IACC,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrE,OAAO;QACL,UAAU;QACV,EAAE;QACF,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAC1C,OAAO,qBAAqB,CAAC;gBAC3B,YAAY,EAAE,UAAU,CAAC,EAAE;gBAC3B,SAAS;aACV,CAAC,CAAC;QACL,CAAC,CAAC;KACH,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC7D,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"file":"token-collection-utils.js","sourceRoot":"","sources":["../../src/collections/token-collection-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AAErD,MAAM,UAAU,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,GAIP;IACC,OAAO,QAAQ,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,MAAM,GAAG,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,EACpC,YAAY,EACZ,SAAS,EAAE,EAAE,eAAe,EAAE,EAC9B,QAAQ,GAKT;IACC,MAAM,UAAU,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IACjD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AC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,GAIT;IACC,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrE,OAAO;QACL,UAAU;QACV,EAAE;QACF,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAC1C,OAAO,qBAAqB,CAAC;gBAC3B,YAAY,EAAE,UAAU,CAAC,EAAE;gBAC3B,SAAS;aACV,CAAC,CAAC;QACL,CAAC,CAAC;KACH,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC7D,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC"}
@@ -2,9 +2,6 @@ import { TokenSrcGroup } from '@knapsack/types';
2
2
  import { KsFigmaVarsFormat } from '../../formats/ks-figma-vars/ks-figma-vars.format.js';
3
3
  import { ConverterGenericWarning } from '../../types.js';
4
4
  import { TokenDataSummary } from '../spec-src-to-token-data/convert-src-to-token-data.js';
5
- /**
6
- * ATTENTION: this is a WIP; assume nothing, question everything
7
- */
8
5
  export declare function convertKsFigmaVarsToSpec({ ksFigmaVars, currentTokensSrc, }: {
9
6
  ksFigmaVars: KsFigmaVarsFormat;
10
7
  currentTokensSrc: TokenSrcGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"ks-figma-vars-to-spec.d.ts","sourceRoot":"","sources":["../../../src/converters/ks-figma-vars-to-spec/ks-figma-vars-to-spec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EACL,iBAAiB,EAMlB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AA2E1F;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,gBAAgB,GACjB,EAAE;IACD,WAAW,EAAE,iBAAiB,CAAC;IAC/B,gBAAgB,EAAE,aAAa,CAAC;CACjC,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACzC,GAAG,EAAE,aAAa,CAAC;IACnB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CA6HA"}
1
+ {"version":3,"file":"ks-figma-vars-to-spec.d.ts","sourceRoot":"","sources":["../../../src/converters/ks-figma-vars-to-spec/ks-figma-vars-to-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EACL,iBAAiB,EAMlB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AA2E1F,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,gBAAgB,GACjB,EAAE;IACD,WAAW,EAAE,iBAAiB,CAAC;IAC/B,gBAAgB,EAAE,aAAa,CAAC;CACjC,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACzC,GAAG,EAAE,aAAa,CAAC;IACnB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CA0EA"}
@@ -1,4 +1,3 @@
1
- import loGet from 'lodash/get.js';
2
1
  import { isKsFigmaVarValueRgb, isKsFigmaVarValueAlias, } from '../../formats/ks-figma-vars/ks-figma-vars.format.js';
3
2
  import { TokenSrcUpdater } from '../../token-src-updater/token-src-updater.js';
4
3
  import { convertFigmaColorToHex } from './utils.js';
@@ -66,42 +65,24 @@ function createTokenSrcValueInfo({ value, varType, }) {
66
65
  }
67
66
  }
68
67
  }
69
- /**
70
- * ATTENTION: this is a WIP; assume nothing, question everything
71
- */
72
68
  export function convertKsFigmaVarsToSpec({ ksFigmaVars, currentTokensSrc, }) {
69
+ // ATTENTION: this is a WIP; assume nothing, question everything
73
70
  const warnings = [];
74
- // Tokens already in src
75
- const tsu = new TokenSrcUpdater({ src: currentTokensSrc });
76
- const { collectionsById, tokensById, tokens } = tsu.data;
71
+ const tsu = new TokenSrcUpdater({
72
+ src: currentTokensSrc,
73
+ });
74
+ const { collectionsById, tokensById } = tsu.data;
77
75
  if (!tsu.collectionsParentKey) {
78
76
  tsu.setCollectionsParentKey({ collectionsParentKey: 'collections' });
79
77
  }
80
78
  const modesById = {};
81
- // Start by creating empty collections and modes by looping over INCOMING collections
82
79
  Object.values(ksFigmaVars.collectionsById).forEach(({ id, name, modes, variableIds }) => {
83
- if (collectionsById[name]) {
84
- console.log('Collection already exists, no need to create:', name);
85
- }
86
- else {
87
- tsu.collection.create({
88
- collectionId: name,
89
- // Important that we do NOT create the default `mode 1` starter mode here
90
- excludeInitialMode: true,
91
- });
80
+ if (!collectionsById[name]) {
81
+ tsu.collection.create({ collectionId: name, excludeInitialMode: true });
92
82
  }
93
- // Do not create modes that already exist
94
- modes.forEach((incomingMode) => {
95
- var _a;
96
- // Check if mode already exists
97
- if ((_a = collectionsById[name]) === null || _a === void 0 ? void 0 : _a.modes.find((existingMode) => existingMode.id === incomingMode.name)) {
98
- console.log('Mode already exists, no need to create:', incomingMode.name);
99
- // Don't create mode if it already exists
100
- return;
101
- }
102
- // Otherwise create mode
103
- modesById[incomingMode.modeId] = incomingMode.name;
104
- tsu.mode.create({ modeId: incomingMode.name, collectionId: name });
83
+ modes.forEach((mode) => {
84
+ modesById[mode.modeId] = mode.name;
85
+ tsu.mode.create({ modeId: mode.name, collectionId: name });
105
86
  });
106
87
  });
107
88
  Object.values(ksFigmaVars.collectionsById).forEach(({ variableIds }) => {
@@ -109,38 +90,18 @@ export function convertKsFigmaVarsToSpec({ ksFigmaVars, currentTokensSrc, }) {
109
90
  .map((vId) => ksFigmaVars.variablesById[vId])
110
91
  .forEach(({ collectionId, name, type: varType, valuesByMode }) => {
111
92
  const { name: collectionName } = ksFigmaVars.collectionsById[collectionId];
112
- // Figma treats '/' as a group separator
113
93
  const varId = name.replace('/', '.');
114
- // Note, this does not indicate values for modes
115
- const fullVarPath = `${tsu.collectionsParentKey}.${collectionName}.${varId}`;
116
- console.log('DEBUG varId:', fullVarPath);
117
- // 2024/07/18: tokensById does not appear to contain Tokens that are refs
118
- // const varExists = Object.keys(tokensById).some((key) =>
119
- // key.startsWith(fullVarPath),
120
- // );
121
- // Instead, fall back to loGet against src
122
- const varExists = loGet(currentTokensSrc, fullVarPath);
123
- if (varExists) {
124
- console.log('Var already exists, no need to create:', fullVarPath);
125
- }
126
- else {
127
- // Avoid creating var if it already exists
128
- tsu.var.create({
129
- collectionId: collectionName,
130
- varId,
131
- varType: mapFigmaVarType(varType),
132
- });
133
- }
94
+ tsu.var.create({
95
+ collectionId: collectionName,
96
+ varId,
97
+ varType: mapFigmaVarType(varType),
98
+ });
134
99
  Object.entries(valuesByMode).forEach(([modeId, value]) => {
135
- // VAR ALIAS
136
100
  if (isKsFigmaVarValueAlias(value)) {
137
101
  const figmaVar = ksFigmaVars.variablesById[value.id];
138
102
  if (!figmaVar) {
139
103
  throw new Error(`Var ${name} has a reference, "${value.id}", that cannot be found`);
140
104
  }
141
- // Using the target Figma Var, get the Collection ID it belongs to,
142
- // and use to look up that Collection's name
143
- const targetCollectionName = ksFigmaVars.collectionsById[figmaVar.collectionId].name;
144
105
  tsu.var.setModeValue({
145
106
  collectionId: collectionName,
146
107
  varId,
@@ -152,14 +113,13 @@ export function convertKsFigmaVarsToSpec({ ksFigmaVars, currentTokensSrc, }) {
152
113
  isVarRef: true,
153
114
  referencedTokenId: [
154
115
  tsu.collectionsParentKey,
155
- targetCollectionName,
116
+ collectionName,
156
117
  figmaVar.name.replace('/', '.'),
157
118
  ].join('.'),
158
119
  },
159
120
  });
160
121
  return;
161
122
  }
162
- // ALL OTHER VAR TYPES
163
123
  tsu.var.setModeValue({
164
124
  collectionId: collectionName,
165
125
  varId,
@@ -1 +1 @@
1
- {"version":3,"file":"ks-figma-vars-to-spec.js","sourceRoot":"","sources":["../../../src/converters/ks-figma-vars-to-spec/ks-figma-vars-to-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,OAAO,EAKL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,SAAS,eAAe,CAAC,IAAyB;IAChD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,gBAAgB,GAAU,IAAI,CAAC;YACrC,OAAO,gBAAgB,CAAC;QAC1B,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,uBAAuB,CAAC,EAC/B,KAAK,EACL,OAAO,GAIR;IACC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACtC,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,KAAK;aACN,CAAC;QACJ,CAAC;Q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I;QACd,QAAQ;KACT,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ks-figma-vars-to-spec.js","sourceRoot":"","sources":["../../../src/converters/ks-figma-vars-to-spec/ks-figma-vars-to-spec.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,SAAS,eAAe,CAAC,IAAyB;IAChD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,gBAAgB,GAAU,IAAI,CAAC;YACrC,OAAO,gBAAgB,CAAC;QAC1B,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,uBAAuB,CAAC,EAC/B,KAAK,EACL,OAAO,GAIR;IACC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACtC,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,KAAK;aACN,CAAC;QACJ,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACrC,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,KAAK;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@
1
1
  {
2
2
  "name": "@knapsack/design-token-utils",
3
3
  "description": "",
4
- "version": "4.66.6--canary.4358.9a9a41d.0",
4
+ "version": "4.67.0--canary.5f03d3b.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -26,19 +26,19 @@
26
26
  "test": "time npm run ava"
27
27
  },
28
28
  "dependencies": {
29
- "@knapsack/color-utils": "4.66.6--canary.4358.9a9a41d.0",
30
- "@knapsack/file-utils": "4.66.6--canary.4358.9a9a41d.0",
31
- "@knapsack/types": "4.66.6--canary.4358.9a9a41d.0",
32
- "@knapsack/utils": "4.66.6--canary.4358.9a9a41d.0",
29
+ "@knapsack/color-utils": "4.67.0--canary.5f03d3b.0",
30
+ "@knapsack/file-utils": "4.67.0--canary.5f03d3b.0",
31
+ "@knapsack/types": "4.67.0--canary.5f03d3b.0",
32
+ "@knapsack/utils": "4.67.0--canary.5f03d3b.0",
33
33
  "flat": "^5.0.2",
34
34
  "immer": "^10.0.4",
35
35
  "lodash": "^4.17.21",
36
36
  "superstruct": "^0.16.7"
37
37
  },
38
38
  "devDependencies": {
39
- "@knapsack/eslint-config-starter": "4.66.6--canary.4358.9a9a41d.0",
40
- "@knapsack/test-ava": "4.66.6--canary.4358.9a9a41d.0",
41
- "@knapsack/typescript-config-starter": "4.66.6--canary.4358.9a9a41d.0",
39
+ "@knapsack/eslint-config-starter": "4.67.0--canary.5f03d3b.0",
40
+ "@knapsack/test-ava": "4.67.0--canary.5f03d3b.0",
41
+ "@knapsack/typescript-config-starter": "4.67.0--canary.5f03d3b.0",
42
42
  "@microsoft/api-extractor": "^7.43.8",
43
43
  "@types/flat": "^5.0.5",
44
44
  "@types/fs-extra": "^11.0.4",
@@ -63,5 +63,5 @@
63
63
  "directory": "libs/design-token-utils",
64
64
  "type": "git"
65
65
  },
66
- "gitHead": "9a9a41d2d7b5087480b6989a430a526641c62e57"
66
+ "gitHead": "5f03d3be42dc1ed7a2eab43f5a66a5c4a18a38ab"
67
67
  }