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

feat: ES module builds (ESM Support) #2665

Draft
wants to merge 37 commits into
base: dove
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8127d82
Merge pull request #19 from feathersjs/dove
fratzinger Oct 15, 2021
22b7457
Updated Slack link to Discord link
candicetate Jan 24, 2022
f85aac8
Updated Slack links to Discord links
candicetate Jan 24, 2022
4aabf87
fix(express): Fix application typings to work with typed configuratio…
daffl Jan 25, 2022
58f03ef
fix(schema): Properly handle resolver errors (#2540)
daffl Jan 25, 2022
7cfea62
fix(queryProperty): allow compound oneOf (#2545)
marshallswain Jan 28, 2022
ec529cd
chore: Update year and remove david-dm badges (#2548)
daffl Jan 30, 2022
4a02435
chore(dependencies): Update all dependencies and CI Node versions (#2…
daffl Feb 6, 2022
fdfbb8c
Merge branch 'dove' of https://github.com/fratzinger/feathers into dove
fratzinger Mar 9, 2022
77c7741
chore(transport-commons): export Channel, RealTimeConnection & Combin…
fratzinger Mar 9, 2022
2ee4f06
Merge branch 'dove' of https://github.com/feathersjs/feathers into fe…
fratzinger Mar 9, 2022
eacadd9
Merge pull request #41 from fratzinger/feathersjs-dove
fratzinger Mar 9, 2022
e4981d9
feat: Publish native ES module builds
daffl Apr 24, 2022
3c2bcb3
chore(esm): moduleResolution: "node"
fratzinger Jun 9, 2022
036bd6a
fix(esm): export default and default module.exports
fratzinger Jun 9, 2022
88760f7
Merge branch 'dove' into esm-build-fratzinger
fratzinger Jun 11, 2022
57ba14b
Merge remote-tracking branch 'upstream/dove' into esm-build-fratzinger
fratzinger Jun 11, 2022
7807fab
chore: revert global moduleResolution
fratzinger Jun 12, 2022
f7ac14b
fix(esm): don't use `export =` but export default
fratzinger Jun 12, 2022
cbb636b
fix(esm): compile with `--moduleResolution node`
fratzinger Jun 12, 2022
357f364
lint: ignorePattern "**/esm/"
fratzinger Jun 12, 2022
113ec58
fix(transport-commons): fix import from @feathersjs/errors
fratzinger Jun 13, 2022
d2cc9f6
Merge branch 'dove' into esm-build-fratzinger
fratzinger Oct 29, 2022
8c4f594
fix typo in compile script
fratzinger Oct 29, 2022
707f782
fix(socketio-client): import from transport-commons
fratzinger Oct 29, 2022
eef613a
chore: update package-lock
fratzinger Oct 29, 2022
5969be2
fix: text/fixture ref in express from authentication-local
fratzinger Oct 29, 2022
b888cd0
chore: add todo comments for separate packages
fratzinger Oct 29, 2022
b7eafb7
test: fix import from '[...]/lib'
fratzinger Oct 29, 2022
0af31a6
chore: add esm to @feathersjs/cli
fratzinger Oct 29, 2022
f839bcb
Merge with latest dove
daffl Dec 20, 2022
e6f7a3d
Update ESM build
daffl Dec 20, 2022
4095a58
Update all dependencies
daffl Dec 20, 2022
820743d
Update all package file lists
daffl Dec 20, 2022
43f2b08
Merge branch 'dove' into esm-build-fratzinger
fratzinger Jun 7, 2023
926ffd6
refactor: tsconfig.esm.json extends default
fratzinger Jun 9, 2023
0502063
fix: trailing comma json
fratzinger Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
"@typescript-eslint",
"prettier"
],
"ignorePatterns": ["**/lib/", "**/dist/"],
"ignorePatterns": ["**/lib/", "**/dist/", "**/esm/"],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dist/

# TypeScript compiled files
packages/**/lib
packages/**/esm
**/build/*.tgz
*.sqlite
docs/.vitepress/cache
6,652 changes: 3,708 additions & 2,944 deletions docs/package-lock.json

Large diffs are not rendered by default.

45,132 changes: 33,815 additions & 11,317 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions packages/adapter-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,24 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 14"
},
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
}
},
"main": "lib/",
"types": "lib/",
"scripts": {
"prepublish": "npm run compile",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
},
"directories": {
Expand All @@ -44,6 +54,7 @@
"LICENSE",
"README.md",
"src/**",
"esm/**",
"lib/**"
],
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-commons/test/fixture.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AdapterBase, AdapterParams, PaginationOptions } from '../src'
import { Id, NullableId, Paginated } from '@feathersjs/feathers'
import { BadRequest, MethodNotAllowed } from '@feathersjs/errors/lib'
import { BadRequest, MethodNotAllowed } from '@feathersjs/errors'

export type Data = {
id: Id
Expand Down
9 changes: 9 additions & 0 deletions packages/adapter-commons/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}
19 changes: 15 additions & 4 deletions packages/adapter-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,24 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 14"
},
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
}
},
"main": "lib/",
"types": "lib/",
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
},
"directories": {
Expand All @@ -44,6 +54,7 @@
"LICENSE",
"README.md",
"src/**",
"esm/**",
"lib/**"
],
"publishConfig": {
Expand Down
9 changes: 9 additions & 0 deletions packages/adapter-tests/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}
19 changes: 15 additions & 4 deletions packages/authentication-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"description": "The authentication plugin for feathers-client",
"version": "5.0.5",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
}
},
"keywords": [
"feathers",
"feathers-plugin"
Expand All @@ -29,21 +37,24 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 14"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"src/**",
"esm/**",
"lib/**",
"*.d.ts",
"*.js"
],
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
},
"directories": {
Expand Down
9 changes: 9 additions & 0 deletions packages/authentication-client/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}
20 changes: 16 additions & 4 deletions packages/authentication-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
"description": "Local authentication strategy for @feathers/authentication",
"version": "5.0.5",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./test/fixture": "./test/fixture.ts"
},
"keywords": [
"feathers",
"feathers-plugin"
Expand All @@ -29,21 +38,24 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 14"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"src/**",
"esm/**",
"lib/**",
"*.d.ts",
"*.js"
],
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
},
"directories": {
Expand Down
9 changes: 9 additions & 0 deletions packages/authentication-local/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}
19 changes: 15 additions & 4 deletions packages/authentication-oauth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"description": "oAuth 1 and 2 authentication for Feathers. Powered by Grant.",
"version": "5.0.5",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
}
},
"keywords": [
"feathers",
"feathers-plugin"
Expand All @@ -29,13 +37,14 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 14"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"src/**",
"esm/**",
"lib/**",
"*.d.ts",
"*.js"
Expand All @@ -44,7 +53,9 @@
"start": "ts-node test/app",
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
},
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions packages/authentication-oauth/test/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthenticationService } from '@feathersjs/authentication/lib'
import { feathers } from '@feathersjs/feathers/lib'
import { AuthenticationService } from '@feathersjs/authentication'
import { feathers } from '@feathersjs/feathers'
import { strict as assert } from 'assert'
import { getGrantConfig } from '../src/utils'

Expand Down
9 changes: 9 additions & 0 deletions packages/authentication-oauth/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}
19 changes: 15 additions & 4 deletions packages/authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"description": "Add Authentication to your FeathersJS app.",
"version": "5.0.5",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
}
},
"keywords": [
"feathers",
"feathers-plugin"
Expand All @@ -30,6 +38,7 @@
"README.md",
"src/**",
"lib/**",
"esm/**",
"*.d.ts",
"*.js"
],
Expand All @@ -38,12 +47,14 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 14"
},
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
},
"directories": {
Expand Down
9 changes: 9 additions & 0 deletions packages/authentication/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}
16 changes: 14 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
"description": "The command line interface for creating Feathers applications",
"version": "5.0.5",
"homepage": "https://feathersjs.com",
"main": "lib/",
"module": "./esm/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./lib/index.d.ts"
}
},
"bin": {
"feathers": "./bin/feathers"
},
Expand Down Expand Up @@ -37,14 +46,17 @@
"LICENSE",
"README.md",
"lib/**",
"esm/**",
"lib/app/static/.gitignore",
"bin/**",
"*.d.ts",
"*.js"
],
"scripts": {
"prepublish": "npm run compile",
"compile": "shx rm -rf lib/ && tsc",
"compile:esm": "shx rm -rf esm/ && tsc --project tsconfig.esm.json",
"compile:cjs": "shx rm -rf lib/ && tsc",
"compile": "npm run compile:cjs && npm run compile:esm && cp -r src/. lib/",
"mocha": "mocha --timeout 60000 --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts",
"test": "npm run compile && npm run mocha"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.esm",
"include": [
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "esm"
}
}