Skip to content

Commit

Permalink
Merge pull request #28 from Supernova-Studio/sergii/pf-113-sync-flag
Browse files Browse the repository at this point in the history
PF-113: Update flags for Token Studio sync
  • Loading branch information
tchief authored May 15, 2024
2 parents 0f0bc5f + 751cdad commit e865029
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
18 changes: 16 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@supernovaio/cli",
"description": "Supernova.io Command Line Interface",
"version": "1.0.5",
"version": "1.0.6",
"author": "Supernova.io",
"homepage": "https://supernova.io/",
"keywords": [
Expand Down Expand Up @@ -104,7 +104,7 @@
"lint": "eslint . --ext .ts --config .eslintrc",
"postpack": "shx rm -f oclif.manifest.json",
"prepack": "yarn build && oclif manifest",
"test": "DEBUG=* && npm run build && env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --require ts-node/register --forbid-only \"test/**/*.test.ts\"",
"test": "DEBUG=* && npm run build && env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --require ts-node/register --forbid-only \"test/**/sync-tokens.test.ts\"",
"publish-package": "npm run build && npm run prepack && npm publish --access public && npm run postpack"
},
"types": "dist/index.d.ts"
Expand Down
11 changes: 7 additions & 4 deletions src/utils/figma-tokens-data-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,15 @@ export class FigmaTokensDataLoader {
throw new Error('Unable to load mapping file: `settings` must be an object')
}
if (mapping.settings.hasOwnProperty('dryRun') && typeof mapping.settings.dryRun !== 'boolean') {
throw new Error('Unable to load mapping file: `dryRun` must be of boolan type')
throw new Error('Unable to load mapping file: `dryRun` must be of boolean type')
}
if (mapping.settings.hasOwnProperty('verbose') && typeof mapping.settings.verbose !== 'boolean') {
throw new Error('Unable to load mapping file: `verbose` must be of boolan type')
throw new Error('Unable to load mapping file: `verbose` must be of boolean type')
}
if (mapping.settings.hasOwnProperty('preciseCopy') && typeof mapping.settings.preciseCopy !== 'boolean') {
throw new Error('Unable to load mapping file: `preciseCopy` must be of boolan type')
if (mapping.settings.hasOwnProperty('preciseCopy')
&& typeof mapping.settings.preciseCopy !== 'boolean'
&& typeof mapping.settings.preciseCopy !== "string") {
throw new Error('Unable to load mapping file: `preciseCopy` must be of boolean or string type')
}
}
}
Expand All @@ -220,6 +222,7 @@ export class FigmaTokensDataLoader {
}

let settings: DTPluginToSupernovaSettings = {
...(mapping.settings ?? {}),
dryRun: mapping.settings?.dryRun ?? false,
verbose: mapping.settings?.verbose ?? false,
preciseCopy: mapping.settings?.preciseCopy ?? false
Expand Down

0 comments on commit e865029

Please sign in to comment.