Skip to content

Commit

Permalink
chore: switch to pnpm (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coobaha authored May 19, 2023
1 parent 3e08aad commit 2a6e242
Show file tree
Hide file tree
Showing 13 changed files with 3,355 additions and 6,249 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]
node: [16, 18, 20]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: 'pnpm'
- run: node --version
- run: yarn install
- run: yarn test
- run: yarn build
- run: pnpm install
- run: pnpm test
- run: pnpm build
18 changes: 9 additions & 9 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ jobs:
release-type: node
package-name: '@coobaha/typed-fastify'
command: github-release
# The logic below handles the npm publication:
# these if statements ensure that a publication only occurs when
# a new release is created:
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
if: ${{ steps.release.outputs.release_created }}
with:
node-version: 18
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
cache: 'pnpm'
- id: build
if: ${{ steps.release.outputs.release_created }}
run: |
yarn install
yarn build
yarn test
pnpm install
pnpm build
pnpm test
- id: publish
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: yarn npm publish --access public
run: pnpm publish --access public
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,3 @@ lib
bin
*.tsbuildinfo

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
.gitignore
.prettierrc
.tsconfig
.yarn-error.log
.github
.husky
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.3.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ things:
```sh
npm i @coobaha/typed-fastify

pnpm i @coobaha/typed-fastify

yarn add @coobaha/typed-fastify

```

Example of service we want to build
Expand Down
2 changes: 1 addition & 1 deletion generator/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sha256 from 'crypto-js/sha256';
import type { TsConfigJson } from 'type-fest';
import traverse from 'json-schema-traverse';
import mergeAllOf from 'json-schema-merge-allof';
import { JSONSchema7 } from 'json-schema';
import type { JSONSchema7 } from 'json-schema';

const revision = '__v' + require('../package.json').version; // + Date.now();

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"typed-fastify-schema": "bin/gen.bin.js"
},
"dependencies": {
"@types/json-schema": "^7.0.11",
"crypto-js": "^4.1.1",
"glob": "^8.0.3",
"json-schema-merge-allof": "^0.8.1",
Expand Down Expand Up @@ -63,7 +64,7 @@
]
},
"main": "lib/index.js",
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"peerDependencies": {
"fastify": "^4"
},
Expand All @@ -75,8 +76,8 @@
"prepublishOnly": "pinst --disable",
"preserver": "tsnd generator/gen.bin.ts gen 'test/test_schema.ts'",
"pretest": "tsnd generator/gen.bin.ts gen 'test/test_schema.ts'",
"server": "yarn preserver && tsnd test/server.ts",
"test": "yarn pretest && yarn test:types && yarn test:integration",
"server": "pnpm preserver && tsnd test/server.ts",
"test": "pnpm pretest && pnpm test:types && pnpm test:integration",
"test:integration": "TAP_TS=1 tap test/*.test.ts -R terse --no-check-coverage",
"test:types": "tsc -p test/tsconfig.test.json"
}
Expand Down
Loading

0 comments on commit 2a6e242

Please sign in to comment.