Skip to content

Commit

Permalink
fixup! fixup! Feat(web-react): Add spirit-codemod package
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelklibani committed Mar 5, 2024
1 parent 9abcc0a commit 3c8b0f9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/codemods/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ build

# Folder __testfixtures__ is used by jscodeshift and cannot be renamed
# There are just test fixtures, no need to lint them
# https://github.com/facebook/jscodeshift?tab=readme-ov-file#unit-testing
**/__testfixtures__/**
8 changes: 4 additions & 4 deletions packages/codemods/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @lmc-eu/spirit-codemods

> Codemods for migrating to the newer version of the Spirit Design library.
> Codemods for migration to the newer version of the Spirit Design library.
`spirit-codemods` is a **CLI tool** designed to assist you in migrating to the latest version of our Spirit Design library. This tool efficiently handles the removal of breaking changes and deprecations with simple commands.
`spirit-codemods` is a **CLI tool** designed to assist you in migrating to the latest version of our Spirit Design System library. This tool efficiently handles the removal of breaking changes and deprecations with simple commands.

For React transformations, it utilizes the [jscodeshift][jscodeshift] library.

Expand All @@ -22,14 +22,14 @@ There are **two mandatory arguments**: `-p`/`--path` and `-c`/`--codemod`.
The former specifies the directory path where you want to execute transforms, while the latter specifies the desired codemod to run.

```shell
npx npx @lmc-eu/spirit-codemods -p ./ -c v2/web-react/codemod-name
npx @lmc-eu/spirit-codemods -p ./ -c v2/web-react/codemod-name
```

Other optional arguments include:

- `-v`/`--version` - Displays current version
- `-h`/`--help` - Displays this message
- `-e`/`--extensions` - Extensions to look for when transforming files, default: `ts,tsx,js,jsx`
- `-e`/`--extensions` - Extensions of the transformed files, default: `ts,tsx,js,jsx`
- `--parser` - Parser to use (babel, ts, tsx, flow), default: `tsx`
- `--ignore-pattern` - Ignore files or directories, default: `**/node_modules/**`

Expand Down
1 change: 1 addition & 0 deletions packages/codemods/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const config = {
// An array of regexp pattern strings that are matched against all test paths before executing the test
// https://jestjs.io/docs/configuration#testpathignorepatterns-arraystring
testPathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/node_modules/', '.*__tests__/.*DataProvider.ts'],

// The directory where Jest should output its coverage files.
// https://jestjs.io/docs/configuration#coveragedirectory-string
coverageDirectory: './.coverage',
Expand Down
2 changes: 1 addition & 1 deletion packages/codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"scripts": {
"prebuild": "shx rm -rf dist && shx mkdir -p dist",
"build": "tsup --config ./config/tsup.config.ts",
"postbuild": "shx cp -r package.json README.md src/bin dist/ && node src/scripts/copyTransforms.js",
"postbuild": "shx cp -r package.json README.md src/bin dist/ && node scripts/copyTransforms.js",
"start": "tsup src/index.ts --watch",
"types": "tsc",
"lint": "eslint ./",
Expand Down
File renamed without changes.

0 comments on commit 3c8b0f9

Please sign in to comment.