From fda6cf006c197223a464c9af56f23b637ea845bd Mon Sep 17 00:00:00 2001 From: jorenbroekema Date: Thu, 11 Jan 2024 17:23:51 +0100 Subject: [PATCH] chore: make value & props optional --- __tests__/formats/__snapshots__/all.test.snap.js | 4 ++-- lib/common/formats.js | 4 ++-- package.json | 2 +- types/DesignToken.d.ts | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/__tests__/formats/__snapshots__/all.test.snap.js b/__tests__/formats/__snapshots__/all.test.snap.js index e6e61e3e7..c647b83b5 100644 --- a/__tests__/formats/__snapshots__/all.test.snap.js +++ b/__tests__/formats/__snapshots__/all.test.snap.js @@ -227,8 +227,8 @@ snapshots["formats all should match typescript/module-declarations snapshot"] = export default tokens; declare interface DesignToken { - value: any; - $value: any; + value?: any; + $value?: any; name?: string; comment?: string; themeable?: boolean; diff --git a/lib/common/formats.js b/lib/common/formats.js index fae54d36a..780c0ec1b 100644 --- a/lib/common/formats.js +++ b/lib/common/formats.js @@ -593,8 +593,8 @@ const formats = { // TODO: find a browser+node compatible way to read from '../../types/DesignToken.d.ts' const designTokenInterface = `interface DesignToken { - value: any; - $value: any; + value?: any; + $value?: any; name?: string; comment?: string; themeable?: boolean; diff --git a/package.json b/package.json index c21bf49c8..90c0bf312 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "test:browser:coverage": "cd coverage/lcov-report && npx http-server -o -c-1", "test:browser:watch": "web-test-runner --watch", "test:browser:update-snapshots": "web-test-runner --update-snapshots", - "test:node": "mocha -r mocha-hooks.mjs './__integration__/logging/file.test.js' './__tests__/**/*.test.js' './__node_tests__/**/*.test.js'", + "test:node": "mocha -r mocha-hooks.mjs './__integration__/**/*.test.js' './__tests__/**/*.test.js' './__node_tests__/**/*.test.js'", "serve-docs": "docsify serve docs -p 3000 -P 12345", "install-cli": "npm install -g $(npm pack)", "release": "node scripts/inject-version.js && tsc --emitDeclarationOnly && changeset publish", diff --git a/types/DesignToken.d.ts b/types/DesignToken.d.ts index 25b70cda3..6c51242bf 100644 --- a/types/DesignToken.d.ts +++ b/types/DesignToken.d.ts @@ -16,7 +16,8 @@ * Make sure to also change it there when this type changes! */ export interface DesignToken { - value: any; + value?: any; + $value?: any; name?: string; comment?: string; themeable?: boolean;