-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add index to GuidanceBlock codemod (#4925)
Co-authored-by: Geoffrey Chong <gyf.chong@gmail.com>
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kaizen/components": patch | ||
--- | ||
|
||
Fix GuidanceBlock codemod |
19 changes: 19 additions & 0 deletions
19
packages/components/codemods/updateGuidanceBlockVariantProp/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { transformComponentsInDir } from "../utils" | ||
import { transformGuidanceBlockVariantProp } from "./transformGuidanceBlockVariantProp" | ||
/** This is here as a script runner that updates GuidanceBlock variants to v2 variants */ | ||
const updateGuidanceBlockVariantProp = (): void => { | ||
// eslint-disable-next-line no-console | ||
console.log(" ~(-_- ~) Running GuidanceBlock transformer (~ -_-)~") | ||
const targetDir = process.argv[2] | ||
if (!targetDir) { | ||
process.exit(1) | ||
} | ||
|
||
transformComponentsInDir( | ||
targetDir, | ||
transformGuidanceBlockVariantProp, | ||
"GuidanceBlock" | ||
) | ||
} | ||
|
||
updateGuidanceBlockVariantProp() |