Skip to content

Commit b1b7553

Browse files
authored
feat: publish ESM version (#473)
**Which problem is this pull request solving?** This module doesn't currently publish an ESM version. It's hard to use this in ES modules, because it needs to be dynamically imported, but it imports node builtins that can't be dynamically imported. **Describe the solution you've chosen** This PR uses `tsup` to build both cjs and esm. It also adds publint and arethetypeswrong to check the output, and removes the one-line `is-promise` CJS dependency.
1 parent 9236053 commit b1b7553

File tree

4 files changed

+2819
-42
lines changed

4 files changed

+2819
-42
lines changed

.github/workflows/workflow.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,29 @@ jobs:
2323
steps:
2424
- name: Git checkout
2525
uses: actions/checkout@v3
26-
- name: Node.js ${{ matrix.node-version }}
26+
- name: Node.js latest
2727
uses: actions/setup-node@v3
2828
with:
29-
node-version: ${{ matrix.node-version }}
29+
node-version: '*'
3030
cache: 'npm'
3131
check-latest: true
3232
- name: Install dependencies
3333
run: npm ci
3434
- name: Linting
3535
run: npm run format:ci
3636
if: "${{ matrix.node-version == '*' }}"
37+
- name: Build
38+
run: npm run build
39+
- name: Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v3
41+
if: "${{ matrix.node-version != '*' }}"
42+
with:
43+
node-version: ${{ matrix.node-version }}
44+
cache: 'npm'
45+
check-latest: true
46+
- name: Install dependencies ${{ matrix.node-version }}
47+
run: npm ci
48+
if: "${{ matrix.node-version != '*' }}"
3749
- name: Tests
3850
run: npm run test:ci
3951
- name: Get test coverage flags

0 commit comments

Comments
 (0)