Skip to content

Commit

Permalink
chore(deps): update dependency tsx to ^4.19.2 (#5210)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency tsx to ^4.19.2

* chore: update codemod docs

* chore: fix codemod runner

* fix: update codemod to use latest tsx

* update the codemod docs for clarity on running the cli

---------

Co-authored-by: Cassandra Tam <[email protected]>
Co-authored-by: Michael Winter <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 6351873 commit 1aca0e0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-cougars-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/components": patch
---

Fix codemod runner
4 changes: 2 additions & 2 deletions packages/components/bin/codemod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ TARGET_DIR="$BASEPATH/$transformDir"

# Print the parameters (for debugging purposes)
echo ""
echo "RUNNING - codemod '$codemodFileName' on the dir:"
echo "Attempting to run codemod '$codemodFileName' on the dir:"
echo "$TARGET_DIR"
echo ""

if npx tsx $CODEMOD_PATH $TARGET_DIR; then
if npx tsx@latest $CODEMOD_PATH $TARGET_DIR; then
echo "Codemod '$codemodFileName' completed successfully in directory '$transformDir'"
else
echo "Codemod '$codemodFileName' could not be run in '$TARGET_DIR'"
Expand Down
11 changes: 7 additions & 4 deletions packages/components/codemods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
# Kaizen codemods
This directory is a collection of codemods that can be executed via CLI with the `kaizen-codemod` command.

## Prerequisite
Install `@kaizen/components`.
## Prerequisites

Install `@kaizen/components`

## CLI pattern

_Note: Navigate into the directory which has installed `@kaizen/components` then run the codemod script._

```
kaizen-codemod {DIR} {CODEMOD_NAME}
pnpm kaizen-codemod {DIR} {CODEMOD_NAME}
```

DIR - the directory to run the codemod for. Note that node_modules are excluded.
CODEMOD_NAME - the name of the codemod (refer to list below).

Example:
```
kaizen-codemod src migrateWellVariantToColor
pnpm kaizen-codemod src migrateWellVariantToColor
```

## Available codemods
Expand Down
3 changes: 1 addition & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"react-select": "^5.8.2",
"react-textfit": "^1.1.1",
"resize-observer-polyfill": "^1.5.1",
"tsx": "^4.19.1",
"use-debounce": "^10.0.4",
"uuid": "^10.0.0"
},
Expand Down Expand Up @@ -132,7 +131,7 @@
"serialize-query-params": "^2.0.2",
"svgo": "^3.3.2",
"tslib": "^2.8.0",
"tsx": "^4.19.1"
"tsx": "^4.19.2"
},
"peerDependencies": {
"@cultureamp/i18n-react-intl": "^2.5.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Icon/bin/update-icons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

pnpm svgo -f ./assets/svgs/icons -o ./src/Icon/bin/built-svgs/

npx tsx ./src/Icon/bin/wrapSVGs.ts --source-dir ./src/Icon/bin/built-svgs --output-dir ./src/Icon --delete-source-dir
pnpm tsx ./src/Icon/bin/wrapSVGs.ts --source-dir ./src/Icon/bin/built-svgs --output-dir ./src/Icon --delete-source-dir

pnpm prettier -w ./src/Icon
2 changes: 1 addition & 1 deletion packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"react-map-interaction": "^2.1.0",
"rollup": "^4.24.2",
"tslib": "^2.8.0",
"tsx": "^4.19.1"
"tsx": "^4.19.2"
},
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0"
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1aca0e0

Please sign in to comment.