Skip to content

Commit

Permalink
feat: publish ESM version (#473)
Browse files Browse the repository at this point in the history
**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.
  • Loading branch information
ascorbic authored Feb 13, 2024
1 parent 9236053 commit b1b7553
Show file tree
Hide file tree
Showing 4 changed files with 2,819 additions and 42 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,29 @@ jobs:
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Node.js ${{ matrix.node-version }}
- name: Node.js latest
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: '*'
cache: 'npm'
check-latest: true
- name: Install dependencies
run: npm ci
- name: Linting
run: npm run format:ci
if: "${{ matrix.node-version == '*' }}"
- name: Build
run: npm run build
- name: Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
if: "${{ matrix.node-version != '*' }}"
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
check-latest: true
- name: Install dependencies ${{ matrix.node-version }}
run: npm ci
if: "${{ matrix.node-version != '*' }}"
- name: Tests
run: npm run test:ci
- name: Get test coverage flags
Expand Down
Loading

0 comments on commit b1b7553

Please sign in to comment.