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

breaking: Switch to ESM only. Drop Node.js v14 support. #195

Merged
merged 12 commits into from
Feb 10, 2024
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
1 change: 1 addition & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
tsconfigRootDir: __dirname,
},
rules: {
'node/no-unpublished-import': 'off',
// Doesnt work with `package.json` exports
'import/no-unresolved': 'off',
// Not ESM yet
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14, 16, 18, 20]
node-version: [16, 18, 20]
fail-fast: true
steps:
- uses: actions/checkout@v3
Expand All @@ -20,11 +20,11 @@ jobs:
cache: yarn
node-version: ${{ matrix.node-version }}
- run: yarn install --immutable
- run: yarn run build
- run: yarn run pack:all
- run: yarn run type
- run: yarn run coverage
# - run: yarn run coverage
- run: yarn run test:tsm
- run: yarn run test:loader
# - run: yarn run test:loader
- run: yarn run lint
pack:
name: Pack
Expand All @@ -35,15 +35,15 @@ jobs:
with:
cache: yarn
- run: yarn install --immutable
- run: yarn run pack
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
- run: yarn install --immutable
- run: yarn run pack
- run: cd website && yarn run build
- run: yarn run pack:all
# docs:
# name: Docs
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# cache: yarn
# - run: yarn install --immutable
# - run: yarn run pack:all
# - run: cd website && yarn run build
785 changes: 0 additions & 785 deletions .yarn/releases/yarn-3.2.0.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.7.0.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.2.0.cjs
yarnPath: .yarn/releases/yarn-3.7.0.cjs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ applications, packages, and tooling.
## Requirements

- Linux, OSX, Windows
- Node 14.19+ (for backend and tooling)
- Node.js v16.12+ (for backend and tooling)
- Edge, Chrome, Firefox (for frontend)

## Documentation
Expand Down
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"private": true,
"name": "boost-root",
"type": "module",
"scripts": {
"build": "yarn run packemon build --addEngines",
"pack": "NODE_ENV=production yarn run packemon pack --addEngines --addExports --declaration",
"clean": "yarn run packemon clean && rm -rf ./packages/*/tsconfig.tsbuildinfo",
"build": "packemon build-workspace --addEngines",
"pack": "packemon pack-workspace --addEngines --addExports --declaration",
"pack:all": "bash ./scripts/buildPackages.sh",
"pack:in": "cd ${0} && packemon pack --addEngines --addExports --declaration",
"clean": "rm -rf ./packages/*/{cjs,esm,mjs,*.tsbuildinfo}",
"check": "yarn run type && yarn run test && yarn run lint",
"coverage": "yarn test --coverage",
"docs": "cd website && yarn run start",
Expand All @@ -17,15 +20,15 @@
"type": "tsc --build",
"release": "yarn run pack && yarn run check && lerna-release",
"version": "yarn install && git add yarn.lock",
"packemon": "yarn dlx --package packemon@2.3.3 --package typescript --quiet packemon"
"packemon": "yarn dlx --package [email protected].1 --package typescript --quiet packemon"
},
"engines": {
"node": ">=14.19.0"
"node": "^18.0.0"
},
"devDependencies": {
"@babel/core": "^7.21.5",
"@babel/core": "^7.23.9",
"@moonrepo/dev": "^2.0.1",
"@types/babel__core": "^7.20.0",
"@types/babel__core": "^7.20.5",
"@types/exit": "^0.1.31",
"@types/fs-extra": "^11.0.1",
"@types/lodash": "^4.14.194",
Expand All @@ -34,16 +37,17 @@
"@types/semver": "^7.3.13",
"@types/split": "^1.0.2",
"@types/wrap-ansi": "^3.0.0",
"babel-preset-moon": "^2.0.3",
"babel-preset-moon": "^2.0.14",
"eslint": "^8.56.0",
"eslint-config-moon": "^2.1.1",
"fs-extra": "^11.1.1",
"lerna": "^6.6.1",
"packemon": "^3.3.1",
"prettier": "^2.8.8",
"prettier-config-moon": "^1.1.2",
"time-require": "^0.1.2",
"tsconfig-moon": "^1.3.0",
"typescript": "^5.0.4",
"typescript": "^5.3.3",
"vitest": "^1.2.2"
},
"publishConfig": {
Expand All @@ -54,5 +58,5 @@
"themes/*",
"website"
],
"packageManager": "yarn@3.2.0"
"packageManager": "yarn@3.7.0"
}
25 changes: 11 additions & 14 deletions packages/args/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@boost/args",
"version": "4.0.1",
"type": "commonjs",
"version": "5.0.0-alpha.0",
"type": "module",
"release": "1651512176134",
"description": "A convention based argument parsing and formatting library, with strict validation checks.",
"keywords": [
Expand All @@ -14,16 +14,14 @@
"params",
"cli"
],
"main": "./cjs/index.cjs",
"types": "./dts/index.d.ts",
"main": "./mjs/index.mjs",
"types": "./mjs/index.d.ts",
"files": [
"cjs/**/*.{cjs,mjs,map}",
"dts/**/*.d.ts",
"src/**/*.{ts,tsx,json}"
"mjs/**/*",
"src/**/*"
],
"engines": {
"node": ">=14.15.0",
"npm": ">=6.14.0"
"node": ">=16.12.0"
},
"repository": {
"type": "git",
Expand All @@ -36,21 +34,20 @@
"access": "public"
},
"dependencies": {
"@boost/internal": "^4.0.1",
"@boost/internal": "^5.0.0-alpha.0",
"levenary": "^1.1.1"
},
"packemon": {
"api": "private",
"format": "cjs",
"format": "mjs",
"platform": "node"
},
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dts/index.d.ts",
"node": {
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
"types": "./mjs/index.d.ts",
"import": "./mjs/index.mjs"
}
}
}
Expand Down
19 changes: 0 additions & 19 deletions packages/args/tests/tsconfig.json

This file was deleted.

14 changes: 6 additions & 8 deletions packages/args/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
{
"extends": "../../tsconfig.options.json",
"compilerOptions": {
"declarationDir": "dts",
"outDir": "dts",
"rootDir": "src",
"emitDeclarationOnly": true
"rootDir": "."
},
"exclude": [
"dts",
"tests"
],
"extends": "../../tsconfig.options.json",
"include": [
"src/**/*",
"tests/**/*",
"types/**/*",
"../../types/**/*"
],
"references": [
{
"path": "./tsconfig.mjs.json"
},
{
"path": "../internal"
}
Expand Down
12 changes: 12 additions & 0 deletions packages/args/tsconfig.mjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.options.json",
"compilerOptions": {
"outDir": "mjs",
"rootDir": "src",
"emitDeclarationOnly": true
},
"include": [
"src/**/*",
"../../types/**/*"
]
}
File renamed without changes.
8 changes: 0 additions & 8 deletions packages/cli/examples/.eslintrc

This file was deleted.

8 changes: 8 additions & 0 deletions packages/cli/examples/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
rules: {
'max-classes-per-file': 'off',
'no-magic-numbers': 'off',
'sort-keys': 'off',
'import/no-extraneous-dependencies': 'off',
},
};
53 changes: 25 additions & 28 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@boost/cli",
"version": "4.0.1",
"type": "commonjs",
"version": "5.0.0-alpha.0",
"type": "module",
"release": "1651512177598",
"description": "An interactive command line program builder, powered by React and Ink.",
"keywords": [
Expand All @@ -15,17 +15,14 @@
"react",
"ink"
],
"main": "./cjs/index.cjs",
"types": "./dts/index.d.ts",
"main": "./mjs/index.mjs",
"types": "./mjs/index.d.ts",
"files": [
"cjs/**/*.{cjs,mjs,map}",
"dts/**/*.d.ts",
"res/",
"src/**/*.{ts,tsx,json}"
"mjs/**/*",
"src/**/*"
],
"engines": {
"node": ">=14.15.0",
"npm": ">=6.14.0"
"node": ">=16.12.0"
},
"repository": {
"type": "git",
Expand All @@ -38,13 +35,13 @@
"access": "public"
},
"dependencies": {
"@boost/args": "^4.0.1",
"@boost/common": "^4.1.0",
"@boost/event": "^4.0.1",
"@boost/internal": "^4.0.1",
"@boost/log": "^4.0.1",
"@boost/terminal": "^4.0.1",
"@boost/translate": "^4.0.1",
"@boost/args": "^5.0.0-alpha.0",
"@boost/common": "^5.0.0-alpha.0",
"@boost/event": "^5.0.0-alpha.0",
"@boost/internal": "^5.0.0-alpha.0",
"@boost/log": "^5.0.0-alpha.0",
"@boost/terminal": "^5.0.0-alpha.0",
"@boost/translate": "^5.0.0-alpha.0",
"execa": "^5.1.1",
"levenary": "^1.1.1",
"semver": "^7.5.0"
Expand All @@ -66,30 +63,30 @@
"react": "src/react.ts",
"test": "src/test.ts"
},
"format": "cjs",
"platform": "node"
"format": "mjs",
"platform": "node",
"externals": [
"vitest"
]
},
"exports": {
"./package.json": "./package.json",
"./react": {
"types": "./dts/react.d.ts",
"node": {
"import": "./cjs/react-wrapper.mjs",
"require": "./cjs/react.cjs"
"types": "./mjs/react.d.ts",
"import": "./mjs/react.mjs"
}
},
"./test": {
"types": "./dts/test.d.ts",
"node": {
"import": "./cjs/test-wrapper.mjs",
"require": "./cjs/test.cjs"
"types": "./mjs/test.d.ts",
"import": "./mjs/test.mjs"
}
},
".": {
"types": "./dts/index.d.ts",
"node": {
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
"types": "./mjs/index.d.ts",
"import": "./mjs/index.mjs"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/middleware/checkPackageOutdated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import https from 'https';
import https from 'node:https';
import semver from 'semver';
import { json } from '@boost/common';
import { Middleware } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/translate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import { createTranslator } from '@boost/translate';

export const msg = createTranslator(['cli', 'prompt'], path.join(__dirname, '../res'));
2 changes: 1 addition & 1 deletion packages/cli/tests/middleware/checkPackageOutdated.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import https from 'https';
import https from 'node:https';
import { afterEach, beforeEach, describe, expect, it, MockInstance,vi } from 'vitest';
import { Loggable } from '@boost/log';
import { mockLogger } from '@boost/log/test';
Expand Down
Loading
Loading