Skip to content

Commit

Permalink
Copy over template and testUtil changes from svg codemod
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Jun 14, 2023
1 parent 0c83254 commit 715f74c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export const matchInlineTransformSnapshot = async (
await runTransform({
transformPath,
targetPaths: [tempFilePath],
options: {
verbose: 1,
},
parser,
})

Expand Down
3 changes: 2 additions & 1 deletion packages/codemods/src/testUtils/matchTransformSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export const matchTransformSnapshot: MatchTransformSnapshotFunction = async (
targetPaths: [tempFilePath],
parser,
options: {
verbose: true,
verbose: 1,
print: true,
},
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ export const description = '(${version}->${version}) Converts world to bazinga'
export const handler = () => {
task(
'${titleName}',
async ({ setOutput }: TaskInnerApi) => {
async ({ setOutput }: TaskInnerAPI) => {
await runTransform({
transformPath: path.join(__dirname, '${name}.js'),
// Here we know exactly which file we need to transform, but often times you won't.
// If you need to transform files based on their name, location, etc, use `fast-glob`.
// If you need to transform files based on their contents, use `getFilesWithPattern`.
targetPaths: [path.join(getPaths().base, 'redwood.toml')],
targetPaths: fg.sync('**/*.{js,jsx,tsx}', {
cwd: getPaths().web.src,
absolute: true,
}),
})

setOutput('All done! Run `yarn rw lint --fix` to prettify your code')
Expand Down

0 comments on commit 715f74c

Please sign in to comment.