Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/esm-only.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@labdigital/enviconf": minor
---

Publish as ESM-only. The CommonJS (`dist/index.cjs`) and IIFE (`dist/index.global.js`) builds are removed; the package now ships `dist/index.js` + `dist/index.d.ts` and `exports` has `types` and `default` conditions. This also fixes the package entry points: `main` pointed to a non-existent `index.js` in the package root and the type declarations were missing from `exports`. CommonJS consumers on Node.js >= 22.12 can still `require()` the package.
5 changes: 5 additions & 0 deletions .changeset/node-22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@labdigital/enviconf": minor
---

Require Node.js >= 22 (`engines.node` is now `>=22`). Node.js 20 and older are end-of-life and no longer supported.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

21 changes: 15 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Release
on: [push]
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened

env:
CI: true
Expand All @@ -10,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Node.js
uses: labd/gh-actions-typescript/pnpm-install@ada4548df9a365c62c8b396b583953c6d4bc113f # v1.1.0
Expand All @@ -31,7 +39,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Node.js ${{ matrix.node }}
uses: labd/gh-actions-typescript/pnpm-install@ada4548df9a365c62c8b396b583953c6d4bc113f # v1.1.0
Expand All @@ -47,7 +55,7 @@ jobs:
release:
timeout-minutes: 15
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
environment: release
permissions:
Expand All @@ -56,15 +64,15 @@ jobs:
pull-requests: write # create/update the release PR
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Set up Node.js
uses: labd/gh-actions-typescript/pnpm-install@ada4548df9a365c62c8b396b583953c6d4bc113f # v1.1.0
with:
node-version: 22
cache: false
cache: "false"

- name: Upgrade npm for trusted publishing
run: npm i -g npm@^11.6.4
Expand All @@ -76,6 +84,7 @@ jobs:
pr-title: "Release new version"
commit-message: "update version"
publish-script: pnpm publish:ci
version-script: pnpm publish:version
# v2 pushes the release commit and tags through the GitHub API; the
# git CLI path keeps the previous behaviour.
push-with-git-cli: true
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @labdigital/enviconf

[![npm](https://img.shields.io/npm/v/@labdigital/enviconf)](https://www.npmjs.com/package/@labdigital/enviconf)

A simple configuration library that loads configuration from environment
variables and provides a simple interface to access them.

Expand Down
40 changes: 21 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,51 @@
"license": "MIT",
"author": "Lab Digital <opensource@labdigital.nl>",
"description": "A simple library to parse environment variables",
"engines": {
"node": ">=22"
},
"keywords": [],
"publishConfig": {
"access": "public",
"provenance": true
},
"type": "module",
"main": "index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js"
}
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist",
"src"
],
"packageManager": "pnpm@12.12.0",
"packageManager": "pnpm@12.12.1",
"scripts": {
"build": "tsup",
"build": "tsdown",
"check": "biome check && tsc",
"test": "pnpm vitest run",
"test:ci": "pnpm vitest run --coverage",
"publish:ci": "pnpm build && pnpm changeset publish",
"format": "biome format --write",
"lint": "biome lint",
"tsc": "tsc --noEmit"
"tsc": "tsc --noEmit",
"publish:version": "pnpm changeset version && pnpm format"
},
"testMatch": [
"src/**/*.test.ts"
],
"devDependencies": {
"@biomejs/biome": "^2.0.0",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.4",
"@types/node": "^24.0.3",
"@biomejs/biome": "^2.5.15",
"@changesets/changelog-github": "^1.0.1",
"@changesets/cli": "^3.0.3",
"@types/node": "^26.6.5",
"@vitest/coverage-v8": "^5.0.5",
"publint": "^0.3.25",
"tsdown": "^0.23.1",
"tslib": "^2.8.1",
"tsup": "^8.5.0",
"typescript": "^5.8.3",
"vite": "^8",
"typescript": "^7.0.2",
"vite": "^8.3.5",
"vitest": "^5.0.5"
},
"repository": {
Expand Down
Loading
Loading