Skip to content

Commit

Permalink
chore: switch yarn to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Dec 10, 2024
1 parent 113e33b commit 9dbdc12
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6,793 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
cache: "yarn"
cache: "npm"
node-version: 22
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install Node dependencies
run: yarn --frozen-lockfile
run: npm ci

- name: Create release
run: npm run release
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "yarn"
cache: "npm"

- name: Install Node dependencies
run: yarn --frozen-lockfile
run: npm ci

- name: Lint
run: yarn lint
run: npm run lint

- name: Build
run: yarn build
run: npm run build

- name: Test coverage
run: yarn jest test/ --collectCoverage=true
run: npmx jest test/ --collectCoverage=true

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ fs.writeFile(outputPath, schemaString, (err) => {

## Run locally

`yarn --silent run run --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`
`npm run --silent run -- --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`

## Debug

`yarn --silent run debug --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`
`npm run --silent debug -- --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`

And connect via the debugger protocol.

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
"debug": "tsx --inspect-brk ts-json-schema-generator.ts",
"format": "eslint --fix",
"lint": "eslint",
"prepublishOnly": "yarn build",
"release": "yarn build && auto shipit",
"prepublishOnly": "npm run build",
"release": "npm run build && auto shipit",
"run": "tsx ts-json-schema-generator.ts",
"test": "jest test/ --verbose",
"test:coverage": "yarn jest test/ --collectCoverage=true",
"test:coverage": "npm run jest -- test/ --collectCoverage=true",
"test:fast": "cross-env FAST_TEST=1 jest test/ --verbose",
"test:update": "cross-env UPDATE_SCHEMA=true yarn test:fast",
"test:update": "cross-env UPDATE_SCHEMA=true npm run test:fast",
"watch": "tsc -w"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ To add/update a test case for generating a valid schema from a Typescript file:
- Create folder `test/valid-data/annotation-default`
- Add `main.ts` to that folder with the type sample
- Update the corresponding `main.ts` file with your changes.
- Run `yarn test:update` to compile the JSON schema
- Run `npm run test:update` to compile the JSON schema
- Add a test to `test/valid-data-annotations.test.ts`, matching a similar pattern to the existing tests.
- Run tests via `yarn jest test/valid-data-annotations.test.ts` (this only runs the subset of tests related to schema validation)
- Run tests via `npx jest test/valid-data-annotations.test.ts` (this only runs the subset of tests related to schema validation)
Loading

0 comments on commit 9dbdc12

Please sign in to comment.