Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 release #1258

Merged
merged 141 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
1b12cab
chore: formatting-only changes for JS/MD files and pkg json
jorenbroekema Sep 1, 2023
cc1bbbd
chore: formatting createPropertyFormatter test/code
jorenbroekema Sep 29, 2023
0278a06
chore: add verify & release workflows (#1018)
jorenbroekema Oct 2, 2023
048fbb8
BREAKING: make style-dictionary ESM-only and browser-compatible (#1014)
jorenbroekema Oct 22, 2023
4cd3417
chore: bump husky, change precommit hook, eslint scripts
jorenbroekema Oct 23, 2023
a3e322b
chore: customize commit message changesets workflow
jorenbroekema Oct 23, 2023
7f5252a
chore: release (prerelease)
github-actions[bot] Oct 23, 2023
31235e1
feat: commentStyle and commentPosition improvements for createPropert…
jorenbroekema Oct 24, 2023
884e726
fix: allow falsy token values for outputReferences, e.g. 0
jorenbroekema Oct 26, 2023
e8e1a0f
chore: release (prerelease)
github-actions[bot] Oct 26, 2023
a568ae3
chore: fix unit tests
jorenbroekema Nov 9, 2023
6de1fb7
fix: logging to respect log level option, fix integration tests
jorenbroekema Nov 21, 2023
b47cadd
fix: add commentPosition to FormatHelpers.LineFormatting type interface
jorenbroekema Nov 23, 2023
a030071
chore: add changesets
jorenbroekema Nov 23, 2023
169712b
feat: add preprocessors
jorenbroekema Nov 2, 2023
471d0ab
chore: remove es6 helpers and use actual ES6
jorenbroekema Nov 23, 2023
026ff74
chore: release (prerelease)
github-actions[bot] Nov 28, 2023
b7fdbac
chore: fix inject-version script
jorenbroekema Nov 28, 2023
f85bce8
feat: refactor reference utils and expose as standalone functions
jorenbroekema Dec 4, 2023
9b5d1f0
fix: make sure fs-node.js is published to npm
jorenbroekema Dec 5, 2023
edc982f
chore: release (prerelease)
github-actions[bot] Dec 5, 2023
41a4579
fix: bin path in pkg json
jorenbroekema Dec 5, 2023
ed5cc71
fix: main type export default
jorenbroekema Dec 5, 2023
5ed5d88
chore: release (prerelease)
github-actions[bot] Dec 5, 2023
3011789
Update docs (#1051)
jorenbroekema Dec 14, 2023
557f895
feat: make ref utils consistent API, apply strict typing (breaking)
jorenbroekema Dec 23, 2023
2a11240
chore: upgrade glob to latest, set posix:true, verify & fix Windows (…
jorenbroekema Dec 23, 2023
96e73be
chore: release (prerelease) (#1072)
github-actions[bot] Dec 23, 2023
dd03c12
chore: fix glob usage in script (#1074)
jorenbroekema Dec 23, 2023
bff6868
chore: fix npm script name
jorenbroekema Dec 23, 2023
6b13242
fix: glob dependency (#1075)
jorenbroekema Dec 23, 2023
536e1d0
chore: release (prerelease) (#1076)
github-actions[bot] Dec 23, 2023
40b2491
feat: improve and test ref utils error handling (#1077)
jorenbroekema Jan 8, 2024
97262f1
chore: release (prerelease) (#1078)
github-actions[bot] Jan 8, 2024
a265057
feat: expose flattenTokens utility (#1079)
jorenbroekema Jan 11, 2024
4e10493
fix: resolved filepath, async parser await (#1083)
jorenbroekema Jan 15, 2024
2b89f4d
chore: release (prerelease) (#1080)
github-actions[bot] Jan 15, 2024
14ce841
feat: allow deferring transitive transforms from the transformer (#1069)
jorenbroekema Jan 22, 2024
eb4ecff
feat: support w3c special properties (#1081)
jorenbroekema Jan 23, 2024
88fada8
chore: release (prerelease) (#1086)
github-actions[bot] Jan 23, 2024
f71c3ea
feat: expose typeW3CDelegate util function (#1087)
jorenbroekema Jan 25, 2024
6a855ce
chore: release (prerelease) (#1089)
github-actions[bot] Jan 25, 2024
2e7403f
fix: only run postinstall scripts in non- prod-mode (#1091)
jorenbroekema Jan 26, 2024
a7d5564
chore: release (prerelease) (#1092)
github-actions[bot] Jan 26, 2024
47da944
fix: publish missing script file to npm (#1093)
jorenbroekema Jan 26, 2024
da11a07
chore: release (prerelease) (#1094)
github-actions[bot] Jan 26, 2024
1cc9390
fix: dev scripts only run in sd cwd (#1095)
jorenbroekema Jan 26, 2024
dc3aa7e
chore: release (prerelease) (#1096)
github-actions[bot] Jan 26, 2024
80cf815
fix: escape double quotes for ts outputStringLiterals (#1097)
andnorda Feb 8, 2024
2492007
W3C Syntax refactor to allow value & type token names/groups (#1100)
jorenbroekema Feb 9, 2024
d6b45a7
chore: release (prerelease) (#1101)
github-actions[bot] Feb 9, 2024
5f3fdc2
feat: support async for all hooks (#1106)
jorenbroekema Feb 23, 2024
9928d0c
chore: release (prerelease) (#1108)
github-actions[bot] Feb 23, 2024
1d74837
fix: dtcg option not passed in some places (#1116)
jorenbroekema Mar 11, 2024
2aabb6e
fix: outputReferenceFallbacks for css/variables formatter (#1113)
tkgroot Mar 11, 2024
aef164a
chore: release (prerelease) (#1117)
github-actions[bot] Mar 11, 2024
4fa7c60
fix: missing type imports (#1118)
jorenbroekema Mar 11, 2024
1e0f277
chore: typo
jorenbroekema Mar 11, 2024
650dace
chore: release (prerelease) (#1119)
github-actions[bot] Mar 11, 2024
ad8d962
chore: fix small type problem
jorenbroekema Mar 11, 2024
f0e190a
feat: allow transforms to be added on top of transformGroup (#1120)
jorenbroekema Mar 12, 2024
f9d8c00
chore: release (prerelease) (#1121)
github-actions[bot] Mar 12, 2024
0e8d7ee
chore: fix ref docs mistakes, add DTCG option (#1122)
jorenbroekema Mar 14, 2024
844892c
feat: remove reliance on CTI, add token type (#1123)
jorenbroekema Mar 19, 2024
97236c0
feat: redesign logging (#1125)
jorenbroekema Mar 19, 2024
79e6722
fix: outputReferences for DTCG spec tokens (#1127)
jorenbroekema Mar 19, 2024
76d0331
chore: release (prerelease) (#1126)
github-actions[bot] Mar 19, 2024
3ed12d1
feat: allow passing Filesystem volumes to SD instance / extend method…
jorenbroekema Mar 25, 2024
d29138b
chore: update docs volumes (#1130)
jorenbroekema Mar 25, 2024
19514e6
chore: release (prerelease) (#1129)
github-actions[bot] Mar 25, 2024
8720c42
fix: absolute paths in Node env (#1134)
jorenbroekema Mar 26, 2024
2421b50
feat: add warnings disabled option, fix logging issues (#1136)
jorenbroekema Mar 26, 2024
8956989
chore: release (prerelease) (#1131)
github-actions[bot] Mar 26, 2024
d6f0a3c
fix(types): added missing type exports
lukasoppermann Mar 26, 2024
dd03956
chore: release (prerelease) (#1138)
github-actions[bot] Mar 26, 2024
beee59d
fix(types): add missing type keyword for type export from index.d.ts …
lukasoppermann Mar 27, 2024
46a3187
chore: release (prerelease) (#1140)
github-actions[bot] Mar 27, 2024
5fb5a61
Revamp docs (#1141)
jorenbroekema Apr 3, 2024
8873031
feat: allow outputReferences function, publish filter util for it (#1…
jorenbroekema Apr 4, 2024
c55d01d
feat: move formatHelpers to utils entrypoint (breaking) (#1147)
jorenbroekema Apr 4, 2024
3b98ac0
chore: release (prerelease) (#1146)
github-actions[bot] Apr 5, 2024
ae5bc52
chore: add migration docs (#1148)
jorenbroekema Apr 9, 2024
18821b8
Some small docs fixes, and removing docsify (#1149)
jorenbroekema Apr 9, 2024
ef0f2f4
fix: change merging behavior for tokens to override (#1151)
jorenbroekema Apr 11, 2024
a8a2a04
fix: asset url handling in CSS format (#1153)
jorenbroekema Apr 11, 2024
00101ac
feat: add outputReferencesTransformed utility function (#1154)
jorenbroekema Apr 12, 2024
38bc4f8
chore: release (prerelease) (#1152)
github-actions[bot] Apr 12, 2024
3e7b7fb
fix: outputReferencesTransformed util handling object-value tokens, u…
jorenbroekema Apr 15, 2024
46d3e59
chore: fix some docs links (#1159)
jorenbroekema Apr 15, 2024
c4d55d5
fix: logging to be in sequence per platform (#1161)
jorenbroekema Apr 16, 2024
cf5fe49
fix: get rid of lodash, refactor templates to ES6 (#1160)
jorenbroekema Apr 16, 2024
20ac2c8
chore: release (prerelease) (#1157)
github-actions[bot] Apr 16, 2024
2c2f561
Format options improvements (#1165)
jorenbroekema Apr 19, 2024
6a6b3cb
feat: turn off generated timestamp by default in file headers (#1174)
jorenbroekema May 1, 2024
7713b43
Expand composites (#1169)
jorenbroekema May 1, 2024
1c0679c
Align Hooks APIs (#1185)
jorenbroekema May 6, 2024
9630368
chore: release (prerelease) (#1167)
github-actions[bot] May 9, 2024
cee733f
chore: fix docs typo (#1189)
jorenbroekema May 9, 2024
ec32cfa
fix: color filter now skips invalid colors (#995) (#1188)
Rykus0 May 9, 2024
3820434
chore: docs mentions extend twice, duplicate (#1192)
jorenbroekema May 9, 2024
04ee87f
feat: add object-value CSS shorthand transforms (#1194)
jorenbroekema May 14, 2024
6dbbdb7
chore: release (prerelease) (#1190)
github-actions[bot] May 14, 2024
9aed0b8
chore: improve sd-playground, eject feature (#1196)
jorenbroekema May 15, 2024
b0efc6c
Examples (#1204)
jorenbroekema May 16, 2024
f72db9a
feat: pass options to fileheaders and filters, add unfilteredAllToken…
jorenbroekema May 17, 2024
b9fca9d
fix: pass options to transforms filters, live demo main page (#1208)
jorenbroekema May 17, 2024
b3e3090
chore: allow preselecting playground file (#1209)
jorenbroekema May 17, 2024
9b9c11b
fix: typeDtcgDelegate at any position, size/rem apply to unitless va…
jorenbroekema May 17, 2024
7c004b9
chore: release (prerelease) (#1207)
github-actions[bot] May 17, 2024
55df10b
feat: add convert to DTCG spec utilities, file converter docs site (#…
jorenbroekema May 23, 2024
db07acd
chore: release (prerelease) (#1213)
github-actions[bot] May 23, 2024
634868a
chore: version inject for sd-playground on build (#1216)
jorenbroekema May 25, 2024
02af685
docs(DTCG): Update DTCG docs with latest link and fix full name (#1215)
kaelig May 25, 2024
944e12b
chore: move `@zip.js/zip.js` from `devDependencies` to `dependencies …
daanvosdewael May 27, 2024
c1f4569
chore: add mermaid integration to docs, create architecture (#1221)
jorenbroekema May 27, 2024
9f607cb
chore: release (prerelease) (#1220)
github-actions[bot] May 29, 2024
c5ea8f5
feat: add formatPlatform/formatAllPlatforms methods (#1222)
jorenbroekema May 30, 2024
604f68f
fix: allow register hooks override existing (#1223)
jorenbroekema May 30, 2024
77240e7
feat: pass dictionary options to preprocessors (#1224)
jorenbroekema May 30, 2024
af481e1
feat: pass ref path in getReferences util output (#1226)
jorenbroekema May 30, 2024
355785f
chore: add missing changeset for SD format platform methods (#1227)
jorenbroekema May 30, 2024
02847e3
chore: release (prerelease) (#1225)
github-actions[bot] May 30, 2024
bc77590
timingFunction and fontFamily props, optional border props (#1229)
jorenbroekema Jun 4, 2024
15be4cf
chore: release (prerelease) (#1230)
github-actions[bot] Jun 4, 2024
609a19d
fix: expand on platform level to adjust path prop (#1231)
jorenbroekema Jun 4, 2024
e912bee
chore: release (prerelease) (#1232)
github-actions[bot] Jun 4, 2024
62c8fad
fix: fix CLI, update basic example, fix android templates DTCG (#1235)
jorenbroekema Jun 6, 2024
5690abe
chore: release (prerelease) (#1236)
github-actions[bot] Jun 11, 2024
50b8f62
feat: allow not throwing on broken refs (#1240)
jorenbroekema Jun 15, 2024
c856761
chore: release (prerelease) (#1242)
github-actions[bot] Jun 16, 2024
904d6b2
feat: recursively expand nested composite tokens (#1244)
Imable Jun 17, 2024
854ad9b
chore: release (prerelease) (#1245)
github-actions[bot] Jun 17, 2024
5bdca66
fix: deepExtend util to not clear meta for colliding tokens (#1254)
jorenbroekema Jun 24, 2024
3d6f921
chore: release (prerelease) (#1255)
github-actions[bot] Jun 24, 2024
4ea473a
fix: .d.ts type issue and resulting type errors (#1249)
jorenbroekema Jun 28, 2024
d03a38f
fix: upgrade esm browser fork of glob (#1257)
jorenbroekema Jun 28, 2024
568b707
chore: release (prerelease) (#1256)
github-actions[bot] Jun 28, 2024
4614e43
chore: exit prerelease mode and release v4 (#1233)
jorenbroekema Jun 28, 2024
2253a56
chore: format changelog and type error after rebase
jorenbroekema Jun 28, 2024
e8b367b
chore: remove pkg lock and put back type comment
jorenbroekema Jun 28, 2024
071a6fc
chore: clean up changesets folder
jorenbroekema Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: deepExtend util to not clear meta for colliding tokens (#1254)
  • Loading branch information
jorenbroekema committed Jun 28, 2024
commit 5bdca66d786f2079953b6d4185f9dfc9d6298bf2
5 changes: 5 additions & 0 deletions .changeset/clever-horses-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'style-dictionary': patch
---

Fix deepExtend util bug with overriding behavior for tokens.
4 changes: 2 additions & 2 deletions __integration__/logging/__snapshots__/config.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
export const snapshots = {};
snapshots["integration > logging > config > property value collisions should not throw, but notify users by default"] =
`
Token collisions detected (4):
Token collisions detected (16):
Use log.verbosity "verbose" or use CLI option --verbose for more details.`;
/* end snapshot integration > logging > config > property value collisions should not throw, but notify users by default */

snapshots["integration > logging > config > property value collisions should not show warnings if given higher log level"] =
`
Token collisions detected (4):
Token collisions detected (16):
Use log.verbosity "verbose" or use CLI option --verbose for more details.`;
/* end snapshot integration > logging > config > property value collisions should not show warnings if given higher log level */

25 changes: 23 additions & 2 deletions __tests__/__snapshots__/StyleDictionary.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,43 @@ Use log.verbosity "verbose" or use CLI option --verbose for more details.`;

snapshots["StyleDictionary class collisions should throw an error if the collision is in source files and log is set to error"] =
`
Token collisions detected (7):
Token collisions detected (28):

Collision detected at: size.padding.zero! Original value: 0, New value: 0
Collision detected at: size.padding.zero! Original value: dimension, New value: dimension
Collision detected at: size.padding.zero! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.zero! Original value: true, New value: true
Collision detected at: size.padding.tiny! Original value: 3, New value: 3
Collision detected at: size.padding.tiny! Original value: dimension, New value: dimension
Collision detected at: size.padding.tiny! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.tiny! Original value: true, New value: true
Collision detected at: size.padding.small! Original value: 5, New value: 5
Collision detected at: size.padding.small! Original value: dimension, New value: dimension
Collision detected at: size.padding.small! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.small! Original value: true, New value: true
Collision detected at: size.padding.base! Original value: 10, New value: 10
Collision detected at: size.padding.base! Original value: dimension, New value: dimension
Collision detected at: size.padding.base! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.base! Original value: true, New value: true
Collision detected at: size.padding.large! Original value: 15, New value: 15
Collision detected at: size.padding.large! Original value: dimension, New value: dimension
Collision detected at: size.padding.large! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.large! Original value: true, New value: true
Collision detected at: size.padding.xl! Original value: 20, New value: 20
Collision detected at: size.padding.xl! Original value: dimension, New value: dimension
Collision detected at: size.padding.xl! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.xl! Original value: true, New value: true
Collision detected at: size.padding.xxl! Original value: 30, New value: 30
Collision detected at: size.padding.xxl! Original value: dimension, New value: dimension
Collision detected at: size.padding.xxl! Original value: __tests__/__tokens/_paddings.json, New value: __tests__/__tokens/_paddings.json
Collision detected at: size.padding.xxl! Original value: true, New value: true

`;
/* end snapshot StyleDictionary class collisions should throw an error if the collision is in source files and log is set to error */

snapshots["StyleDictionary class collisions should throw a brief error if the collision is in source files and log is set to error and verbosity default"] =
`
Token collisions detected (7):
Token collisions detected (28):
Use log.verbosity "verbose" or use CLI option --verbose for more details.`;
/* end snapshot StyleDictionary class collisions should throw a brief error if the collision is in source files and log is set to error and verbosity default */

Expand Down
18 changes: 16 additions & 2 deletions __tests__/utils/deepExtend.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,32 @@ describe('utils', () => {

it("shouldn't merge when keys collide that should override rather than merge", () => {
const test = deepExtend(
[{ foo: { value: 'bar', metadata: 'meta' } }, { foo: { value: 'baz' } }],
[
{ foo: { type: 'other', value: 'bar', metadata: 'meta' } },
{ foo: { type: 'other', value: 'baz' } },
],
{ collision: function () {}, overrideKeys: ['value'] },
);
expect(test.foo).to.eql({
type: 'other',
value: 'baz',
});
expect(test).to.have.nested.property('foo.value', 'baz');
// we do not want to inherit this metadata from the prop we are overriding
expect(test).to.not.have.nested.property('foo.metadata');

const testDTCG = deepExtend(
[{ foo: { $value: 'bar', metadata: 'meta' } }, { foo: { $value: 'baz' } }],
[
{ foo: { $type: 'other', $value: 'bar', metadata: 'meta' } },
{ foo: { $type: 'other', $value: 'baz' } },
],
{ collision: function () {}, overrideKeys: ['$value'] },
);

expect(testDTCG.foo).to.eql({
$type: 'other',
$value: 'baz',
});
expect(testDTCG).to.have.nested.property('foo.$value', 'baz');
expect(testDTCG).to.not.have.nested.property('foo.metadata');
});
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/deepExtend.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function deepExtend(objects, opts = {}, path) {
// we want to fully override an object, e.g. for design tokens
// we dont want sibling props of target to be merged into the copy
// see tests for more details
target = /** @type {T} */ ({});
target = options;
}
}
target[name] = copy;
Expand Down