Skip to content

Commit

Permalink
fix(class-name-updater): fix cli to grab package file relatively (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
wise-king-sullyman authored Mar 19, 2024
1 parent 7f1517a commit 9df19dd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,36 @@ jobs:
- run: yarn build
- name: Run tests
run: yarn test --maxWorkers=2
class-name-updater-tests:
runs-on: ubuntu-latest
env:
GH_PR_NUM: ${{ github.event.number }}
steps:
- uses: actions/checkout@v2
# Yes, we really want to checkout the PR
- run: |
if [[ ! -z "${GH_PR_NUM}" ]]; then
echo "Checking out PR"
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '14'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: yarn build:classnames
- name: Run class-name-updater tests
run: yarn test:classnames
error-tests:
runs-on: ubuntu-latest
env:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
"test:console": "pf-codemods --v6 --no-cache test/console/frontend",
"test:integreatly": "pf-codemods --v6 --no-cache test/tutorial-web-app",
"test:packages": "yarn get:packages && node --unhandled-rejections=strict packages/pf-codemods/index.js --v6 --no-cache test/packages",
"test:classnames": "class-name-updater --no-cache test",
"test:classnames": "yarn build:classnames && lerna run test --scope=@patternfly/class-name-updater --stream",
"get:packages": "node getPackages.js",
"generate": "yarn build:generators && plop",
"build": "lerna run build",
"build:generators": "tsc --build --verbose generators/tsconfig.cjs.json",
"build:readme": "lerna run build:readme",
"build:classnames": "lerna run build --scope=@patternfly/class-name-updater",
"clean": "lerna run clean"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/class-name-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"scripts": {
"build": "tsc --build --verbose ./tsconfig.json",
"clean": "rimraf ./dist",
"test": "jest"
"test": "node ./dist/cli.js test --exclude test/largeFile.js"
},
"dependencies": {
"colors": "^1.4.0",
Expand Down
7 changes: 1 addition & 6 deletions packages/class-name-updater/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import { classNameUpdate } from "./classNameUpdate";

program
.version(
require(join(
process.cwd(),
"packages",
"class-name-updater",
"package.json"
)).version
require('../package.json').version
)
.description("Update class name versioning")
.arguments("<path> [otherPaths...]")
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 9df19dd

Please sign in to comment.