You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ npm run build-toolkit
or
$ yarn run build-toolkit
Specific config file name
$ npm run build-toolkit --config <filename>
$ npm run build-toolkit -c <filename>
or
$ yarn run build-toolkit --config <filename>
$ yarn run build-toolkit -c <filename>
Watch option
$ npm run build-toolkit --watch <directory>
$ npm run build-toolkit -w <directory>
or
$ yarn run build-toolkit --watch <directory>
$ yarn run build-toolkit -w <directory>
Runners
1. Command
module.exports=async(runner,config)=>{
...
/** * Command Setting * cd: Optional<directory path> * command: <command> * watch: Optional<boolean>, Default<true> * watch option is set to run the command if in watching files. */awaitrunner.Command.Run({cd: '<directory path>',command: 'yarn run eslint',watch: false});
...
};
module.exports=async(runner,config)=>{
...
consttaskRunner=async(config)=>{// any task...};awaitrunner.Task.Run(taskRunner);// If you don't want to run the task on watchingawaitrunner.Task.Run(taskRunner,false);
...
};
5. Icons
module.exports=async(runner,config)=>{
...
/** * Icons Setting * dir: <svg files directory path> * output: <output file path> * type: 'json' | 'const' | 'argument' | 'module' * naming: * If type is 'json', empty. * If type is not 'json', required. * uglified: Optional<boolean>, Default<false> */consticonSetting={dir: '<svg files directory path>',output: '<output file path>',type: 'json'|'const'|'argument'|'module',naming: 'constant, function, or module name',uglified: true,};awaitrunner.Icons.Build(iconSetting);// JSON type setting// Output would be .json fileconstjsonSetting={dir: '<svg files directory path>',output: '<output file path>',type: 'json'};awaitrunner.Icons.Build(jsonSetting);// Constant type setting// Output would be .js fileconstconstSetting={dir: '<svg files directory path>',output: '<output file path>',type: 'const'naming: 'icons'};// Expected: const icons = { ... };awaitrunner.Icons.Build(constSetting);// Argument type setting// Output would be .js fileconstargSetting={dir: '<svg files directory path>',output: '<output file path>',type: 'argument'naming: 'icons.add'};// Expected: icons.add({ ... });awaitrunner.Icons.Build(argSetting);// Module type setting// Output would be .js and .d.ts filesconstmoduleSetting={dir: '<svg files directory path>',output: '<output file path>',type: 'module'naming: 'icons'};/** * Expected * .js: const icons = { ... }; export default icons; * .d.ts: declare const icons: Record<string, string>; * export default icons; */awaitrunner.Icons.Build(moduleSetting);
...
};
6. Test
module.exports=async(runner,config)=>{
...
/** * Test Setting * Jest Configuration * watch: Optional<boolean>, Default<true> * watch option is set to run the command if in watching files. */consttestSetting={preset: 'ts-jest',testEnvironment: 'jest-environment-jsdom',};awaitrunner.Test.Run(testSetting);
...
};