Skip to content

Commit

Permalink
Ensured that blueprint files are installed (#45)
Browse files Browse the repository at this point in the history
* bugfix: Ensured that .github folder is present

* bugfix: Ensured that tests folder is present

* bugfix: Ensured that root files are present

* chore: Added changeset

---------

Co-authored-by: ijlee2 <[email protected]>
  • Loading branch information
ijlee2 and ijlee2 authored Jul 9, 2023
1 parent a1b5c41 commit 86544fc
Show file tree
Hide file tree
Showing 25 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-birds-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codemod-utils/cli": patch
---

Ensured that blueprints files are installed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 12 additions & 2 deletions packages/cli/src/migration/steps/create-files-from-blueprints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function getFilesToSkip(options: Options): string[] {
files.add('src/blueprints/.gitkeep');
files.add('src/utils/blueprints/blueprints-root.__js__');
files.add('src/utils/blueprints.__js__');
files.add('tests/utils/blueprints/blueprints-root.test.__js__');
files.add('__tests__/utils/blueprints/blueprints-root.test.__js__');
}

if (!codemod.hasTypeScript) {
files.add('build.sh');
files.add('__build.sh__');
files.add('src/types/index.ts');
files.add('tsconfig.build.json');
files.add('tsconfig.json');
Expand All @@ -36,8 +36,18 @@ function resolveBlueprintFilePath(
const { codemod } = options;

return blueprintFilePath
.replace('__github__/', '.github/')
.replace('__tests__/', 'tests/')
.replace('__codemod-name__', codemod.name)
.replace('__eslintignore__', '.eslintignore')
.replace('__eslintrc.cjs__', '.eslintrc.cjs')
.replace('__gitignore__', '.gitignore')
.replace('__npmignore__', '.npmignore')
.replace('__prettierrc.cjs__', '.prettierrc.cjs')
.replace('__build.sh__', 'build.sh')
.replace('__codemod-test-fixture.sh__', 'codemod-test-fixture.sh')
.replace('__codemod-test-fixtures.sh__', 'codemod-test-fixtures.sh')
.replace('__CONTRIBUTING.md__', 'CONTRIBUTING.md')
.replace('.__js__', codemod.hasTypeScript ? '.ts' : '.js');
}

Expand Down

0 comments on commit 86544fc

Please sign in to comment.