Skip to content

Commit

Permalink
chore: migrate to pnpm (#241)
Browse files Browse the repository at this point in the history
Add exports type for modern ts imports.
Migrate to ESM.

BREAKING CHANGE: remove mem dependency
  • Loading branch information
tusbar authored May 29, 2023
1 parent 4aa38a0 commit 0192ee2
Show file tree
Hide file tree
Showing 7 changed files with 8,937 additions and 9,912 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ jobs:
with:
token: ${{ secrets.BOT_GITHUB_TOKEN_PUBLIC }}

- uses: pnpm/action-setup@v2
with:
version: "latest"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn --frozen-lockfile --non-interactive --prefer-offline
run: pnpm install --frozen-lockfile

- name: Build output
run: yarn build
run: pnpm build

- name: Run semantic release
env:
Expand All @@ -36,4 +40,4 @@ jobs:
GIT_AUTHOR_EMAIL: ${{ secrets.BOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.BOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.BOT_EMAIL }}
run: yarn semantic-release
run: pnpm semantic-release
30 changes: 21 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: "latest"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn --frozen-lockfile --non-interactive --prefer-offline
run: pnpm install --frozen-lockfile

- name: Run linter for scripts
run: yarn xo
run: pnpm xo

check-ts:
name: Run typescript checks
Expand All @@ -36,17 +40,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: "latest"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn --frozen-lockfile --non-interactive --prefer-offline
run: pnpm install --frozen-lockfile

- name: Run typescript checks
run: yarn check:ts
run: pnpm check:ts

test:
name: Run tests
Expand All @@ -57,17 +65,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: "latest"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn --frozen-lockfile --non-interactive --prefer-offline
run: pnpm install --frozen-lockfile

- name: Run tests
run: yarn test --runInBand --ci --reporters=default --reporters=github-actions
run: pnpm test -- --runInBand --ci --reporters=default --reporters=github-actions

- name: Upload code coverage to codecov
uses: codecov/codecov-action@v3
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
"repository": "https://github.com/bizon/amazon-ids",
"author": "Bertrand Marron <bertrand.marron@gmail.com>",
"license": "MIT",
"type": "module",
"sideEffects": false,
"files": [
"dist"
],
"source": "./src/index.ts",
"main": "./dist/amazon-ids.cjs",
"umd:main": "./dist/amazon-ids.umd.js",
"module": "./dist/amazon-ids.js",
"exports": {
"require": "./dist/amazon-ids.js",
"default": "./dist/amazon-ids.modern.mjs"
"types": "./dist/index.d.ts",
"require": "./dist/amazon-ids.cjs",
"default": "./dist/amazon-ids.modern.js"
},
"main": "./dist/amazon-ids.js",
"module": "./dist/amazon-ids.mjs",
"types": "./dist/index.d.ts",
"umd:main": "./dist/amazon-ids.umd.js",
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "jest",
"check:ts": "tsc --noEmit",
"build": "microbundle",
"dev": "microbundle watch"
},
"dependencies": {
"mem": "^8.1.1"
},
"devDependencies": {
"@bizon/semantic-release-config": "^2.0.0",
"@jest/types": "^29.5.0",
"@tsconfig/node16": "^1.0.4",
"@tsconfig/node18": "^2.0.1",
"@types/jest": "^29.5.1",
"eslint-config-xo-bizon": "^1.2.0",
"jest": "^29.5.0",
Expand Down
Loading

0 comments on commit 0192ee2

Please sign in to comment.