Skip to content

Commit

Permalink
fixup! feat(scripts-generators): incorporate base all generation to c…
Browse files Browse the repository at this point in the history
…reate-package and validate integrity on CI
  • Loading branch information
Hotell committed Apr 6, 2023
1 parent 0d01c0f commit e056509
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions scripts/generators/generate-ts-base-all-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function main(options?: yargs.Arguments<{ verify?: boolean }>) {

const { mergedTsConfig, existingTsConfig, tsConfigAllFileName } = createPathAliasesConfig({
relativeFolderPathFromRoot: '.',
writeFileToDisk: verify === false,
});

if (verify && !isEqual(existingTsConfig, mergedTsConfig)) {
Expand Down
8 changes: 5 additions & 3 deletions scripts/storybook/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ function overrideDefaultBabelLoader(options) {
*
* Main purpose of this is to be used for build-less DX in webpack in tandem with {@link registerTsPaths}
*
* @param {{relativeFolderPathFromRoot?:string}} options
* @param {{relativeFolderPathFromRoot?:string,writeFileToDisk?:boolean}} options
*/
function createPathAliasesConfig(options = {}) {
const { relativeFolderPathFromRoot = './dist' } = options;
const { relativeFolderPathFromRoot = './dist', writeFileToDisk = true } = options;
const rootPath = workspaceRoot;
const mergedTsConfigRoot = path.join(rootPath, relativeFolderPathFromRoot);
const tsConfigAllFileName = 'tsconfig.base.all.json';
Expand Down Expand Up @@ -395,7 +395,9 @@ function createPathAliasesConfig(options = {}) {
},
};

writeJsonFile(tsConfigAllPath, mergedTsConfig);
if (writeFileToDisk) {
writeJsonFile(tsConfigAllPath, mergedTsConfig);
}

return { tsConfigAllPath, tsConfigAllFileName, mergedTsConfig, existingTsConfig };
}
Expand Down

0 comments on commit e056509

Please sign in to comment.