Skip to content

Commit

Permalink
refactor: use ES Modules for component-library-design-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Nov 19, 2024
1 parent c8f01a4 commit 5d7f279
Show file tree
Hide file tree
Showing 6 changed files with 373 additions and 277 deletions.
10 changes: 6 additions & 4 deletions packages/component-library-design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@
"publishConfig": {
"access": "public"
},
"type": "module",
"repository": {
"type": "git+ssh",
"url": "[email protected]:nl-design-system/utrecht.git",
"directory": "packages/component-library-design-tokens"
},
"dependencies": {
"glob": "10.4.2",
"lodash-es": "4.17.21"
},
"devDependencies": {
"@nl-design-system-unstable/theme-toolkit": "1.0.0",
"glob": "10.4.2",
"lodash.clonedeepwith": "4.5.0",
"lodash.isplainobject": "4.0.6",
"lodash.merge": "4.6.2",
"@types/lodash-es": "4.17.12",
"rimraf": "5.0.7"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mkdir, writeFile } from 'node:fs/promises';
import { getComponentTokens } from './lib.mjs';
import cloneDeepWith from 'lodash.clonedeepwith';
import isPlainObject from 'lodash.isplainobject';
import cloneDeepWith from 'lodash-es/clonedeepwith.js';
import isPlainObject from 'lodash-es/isplainobject.js';
import { isDesignTokenDefinition } from '@nl-design-system-unstable/theme-toolkit/dist/design-tokens.js';

const traverseDeep = (root, parents, current, valueTest, callback) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/component-library-design-tokens/src/lib.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFile } from 'node:fs/promises';
import merge from 'lodash.merge';
import merge from 'lodash-es/merge.js';
import { glob } from 'glob';
import { resolve } from 'path';

Expand Down
4 changes: 2 additions & 2 deletions packages/component-library-design-tokens/src/lint-build.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFile } from 'node:fs/promises';
import cloneDeepWith from 'lodash.clonedeepwith';
import isPlainObject from 'lodash.isplainobject';
import cloneDeepWith from 'lodash-es/clonedeepwith.js';
import isPlainObject from 'lodash-es/isplainobject.js';
import { glob } from 'glob';
import { getComponentTokens } from './lib.mjs';
import { isDesignTokenDefinition } from '@nl-design-system-unstable/theme-toolkit/dist/design-tokens.js';
Expand Down
7 changes: 3 additions & 4 deletions packages/component-library-design-tokens/src/lint-theme.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { readFile } from 'node:fs/promises';
import merge from 'lodash.merge';
import cloneDeepWith from 'lodash.clonedeepwith';
import isPlainObject from 'lodash.isplainobject';
import { glob } from 'glob';
import merge from 'lodash-es/merge.js';
import cloneDeepWith from 'lodash-es/clonedeepwith.js';
import isPlainObject from 'lodash-es/isplainobject.js';
import { getComponentTokens } from './lib.mjs';
import { isDesignToken, isDesignTokenDefinition } from '@nl-design-system-unstable/theme-toolkit/dist/design-tokens.js';

Expand Down
Loading

0 comments on commit 5d7f279

Please sign in to comment.