Skip to content

Commit

Permalink
feat(tokens-cli): allow scheme configuration formainMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Uceda committed Sep 21, 2022
1 parent e8f1b6e commit 3027015
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion tokens-cli/build/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ const builder = (yargs) => yargs.options({
desc: 'light or dark',
default: 'light',
},
menuScheme: {
type: 'string',
alias: 'm',
desc: 'light or dark',
default: 'light',
},
});
exports.builder = builder;
// dit build -i "schemes/light/*.json" -o dist/light/
const handler = (argv) => {
const { scheme, output, input } = argv;
const { scheme, menuScheme, output, input } = argv;
(0, dali_tokens_1.generate)({
source: input,
scheme: scheme,
menuScheme: menuScheme,
output: `${path_1.default.normalize(path_1.default.format(path_1.default.parse(output)))}/`,
});
process.exit(0);
Expand Down
10 changes: 9 additions & 1 deletion tokens-cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Options {
input?: string;
output?: string;
scheme?: string;
menuScheme?: string;
}

export const command = 'build';
Expand All @@ -31,15 +32,22 @@ export const builder: CommandBuilder<Options, Options> = (yargs) =>
desc: 'light or dark',
default: 'light',
},
menuScheme: {
type: 'string',
alias: 'm',
desc: 'light or dark',
default: 'light',
},
});

// dit build -i "schemes/light/*.json" -o dist/light/
export const handler = (argv: Arguments<Options>): void => {
const { scheme, output, input } = argv;
const { scheme, menuScheme, output, input } = argv;

generate({
source: input as string,
scheme: scheme as Scheme,
menuScheme: menuScheme as Scheme,
output: `${path.normalize(path.format(path.parse(output as string)))}/`,
});

Expand Down

0 comments on commit 3027015

Please sign in to comment.