From 6b16096b928cee67e4f58e7d9363175b18bb12e9 Mon Sep 17 00:00:00 2001 From: Jason Finch Date: Sat, 17 Sep 2022 00:21:03 +1000 Subject: [PATCH] refactor: update github build for pnpm, build emit esm (#23) Update github action to work with the pnpm changes * Sync node version to package.json ver (16) * Adjust build to emit sourcemap and esm build artifacts --- .github/workflows/main.yml | 30 ++++++++++++++++++------------ package.json | 4 ++-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11023c2..baa044e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,35 +8,41 @@ jobs: - name: Begin CI... uses: actions/checkout@v2 - - name: Use Node 12 + - name: Use Node 16 uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 16.x - - name: Use cached node_modules - uses: actions/cache@v1 + # - name: Use cached node_modules + # uses: actions/cache@v1 + # with: + # path: node_modules + # key: nodeModules-${{ hashFiles('**/yarn.lock') }} + # restore-keys: | + # nodeModules- + + - uses: pnpm/action-setup@v2.2.2 + name: Install pnpm + id: pnpm-install with: - path: node_modules - key: nodeModules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - nodeModules- + version: 7.5.2 - name: Install dependencies - run: yarn install --frozen-lockfile + run: pnpm install env: CI: true - name: Lint - run: yarn lint + run: pnpm lint env: CI: true - name: Test - run: yarn test --ci --coverage --maxWorkers=2 + run: pnpm test env: CI: true - name: Build - run: yarn build + run: pnpm build env: CI: true diff --git a/package.json b/package.json index 7cc0d3a..e545ec8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "scripts": { "start": "tsup ./src/index.ts --dts --watch", - "build": "tsup ./src/index.ts --dts", + "build": "tsup ./src/index.ts --dts --sourcemap --format esm,cjs", "changeset": "pnpm exec changeset", "get:changes": "git log --format=%B --no-merges HEAD ^master | pbcopy", "husky:install": "pnpm exec husky install", @@ -34,7 +34,7 @@ }, "name": "react-abode", "author": "Bram Kaashoek", - "module": "dist/react-abode.esm.js", + "module": "dist/index.mjs", "devDependencies": { "@changesets/cli": "^2.24.2", "@types/jest": "^28.1.6",