Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: fix build:cjs run script, drop node 12 #471

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 8 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16]
node: [14, 16, 18]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
- run: npm install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { readFileSync } from 'fs'
// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
? Number(process.env.YARGS_MIN_NODE_VERSION)
: 12
: 14
const nodeVersion = process?.versions?.node ?? process?.version?.slice(1)
if (nodeVersion) {
const major = Number(nodeVersion.match(/^([^.]+)/)![1])
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"author": "Ben Coe <ben@npmjs.com>",
"license": "ISC",
"devDependencies": {
"@rollup/plugin-typescript": "^11.0.0",
"@types/chai": "^4.2.11",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.4",
Expand All @@ -66,13 +67,11 @@
"mocha": "^10.0.0",
"puppeteer": "^16.0.0",
"rimraf": "^3.0.2",
"rollup": "^2.22.1",
"rollup": "^3.18.0",
"rollup-plugin-cleanup": "^3.1.1",
"rollup-plugin-ts": "^3.0.2",
"serve": "^14.0.0",
"standardx": "^7.0.0",
"start-server-and-test": "^1.11.2",
"ts-transform-default-export": "^1.0.2",
"typescript": "^4.0.0"
},
"files": [
Expand All @@ -82,11 +81,12 @@
"!*.d.cts"
],
"engines": {
"node": ">=12"
"node": ">=14"
},
"standardx": {
"ignore": [
"build"
]
}
},
"dependencies": {}
}
9 changes: 2 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cleanup from 'rollup-plugin-cleanup'
import ts from 'rollup-plugin-ts'
import transformDefaultExport from 'ts-transform-default-export'
import typescript from '@rollup/plugin-typescript'

const output = {
format: 'cjs',
Expand All @@ -14,11 +13,7 @@ export default {
input: './lib/index.ts',
output,
plugins: [
ts({
transformers: ({ program }) => ({
afterDeclarations: transformDefaultExport(program)
})
}),
typescript(),
cleanup({
comments: 'none',
extensions: ['*']
Expand Down