Skip to content

Commit

Permalink
build!: add ESM support
Browse files Browse the repository at this point in the history
This commit primarily aims to add ESM support. Other notable changes
include:

* Switch package manager to pnpm.
* Use tsup for build.
* Use Vitest for testing.
* Bump version to 2.0.0.
  • Loading branch information
Luluno01 committed Oct 22, 2024
1 parent e6816b7 commit e75e25f
Show file tree
Hide file tree
Showing 13 changed files with 2,110 additions and 284 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js Package
name: Publish Node.js Package

on:
release:
Expand All @@ -8,12 +8,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm test
node-version: 22
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm build
- run: pnpm test

publish-gpr:
needs: build
Expand All @@ -22,12 +25,14 @@ jobs:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@unlib-js:registry=https://npm.pkg.github.com
@unlib-js:registry=https://npm.pkg.github.com
64 changes: 0 additions & 64 deletions package-lock.json

This file was deleted.

66 changes: 57 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,74 @@
{
"name": "@unlib-js/unreliable",
"version": "1.1.3",
"version": "2.0.0",
"description": "Management wrapper for unreliable resources, e.g., another process",
"main": "build/index.js",
"main": "build/index.cjs",
"module": "build/index.js",
"type": "module",
"exports": {
".": {
"types": "./build/index.d.ts",
"import": "./build/index.js",
"require": "./build/index.cjs"
},
"./Daemon.h": {
"types": "./build/Daemon.h.d.ts",
"import": "./build/Daemon.h.js",
"require": "./build/Daemon.h.cjs"
},
"./Daemon": {
"types": "./build/Daemon.d.ts",
"import": "./build/Daemon.js",
"require": "./build/Daemon.cjs"
},
"./disposable-events": {
"types": "./build/disposable-events.d.ts",
"import": "./build/disposable-events.js",
"require": "./build/disposable-events.cjs"
},
"./stopOnExit": {
"types": "./build/stopOnExit.d.ts",
"import": "./build/stopOnExit.js",
"require": "./build/stopOnExit.cjs"
},
"./Unreliable.h": {
"types": "./build/Unreliable.h.d.ts",
"import": "./build/Unreliable.h.js",
"require": "./build/Unreliable.h.cjs"
},
"./Unreliable": {
"types": "./build/Unreliable.d.ts",
"import": "./build/Unreliable.js",
"require": "./build/Unreliable.cjs"
}
},
"files": [
"build"
],
"scripts": {
"test": "node build/test.js",
"build": "tsc",
"install": "tsc"
"test": "vitest",
"gen-exports": "tsx ./scripts/gen-exports.ts",
"build": "tsup",
"prepublish": "tsup"
},
"keywords": [
"unreliable"
],
"author": "Untitled",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.8.3",
"typescript": "^5.2.2"
"@types/node": "^22.7.7",
"@unlib-js/event-barrier": "^2.0.1",
"tsup": "^8.3.0",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
},
"packageManager": "[email protected]",
"repository": {
"url": "https://github.com/unlib-js/unreliable.git"
},
"dependencies": {
"@unlib-js/event-barrier": "github:unlib-js/event-barrier"
"peerDependencies": {
"@unlib-js/event-barrier": "^2.0.1"
}
}
Loading

0 comments on commit e75e25f

Please sign in to comment.