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

Add ESM wrapper to avoid dual package hazard #842

Merged
merged 10 commits into from
Oct 6, 2023
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 9 additions & 13 deletions packages/connect-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@
"url": "https://github.com/connectrpc/connect-es.git",
"directory": "packages/connect-express"
},
"sideEffects": false,
"scripts": {
"clean": "rm -rf ./dist/cjs/* ./dist/esm/*",
"build": "npm run build:cjs && npm run build:esm",
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
"attw": "attw --pack"
},
"main": "./dist/cjs/index.js",
"type": "module",
"sideEffects": false,
"main": "./dist/cjs/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
"module": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/proxy/index.js"
}
},
"engines": {
Expand All @@ -36,7 +32,7 @@
"@types/express": "^4.17.18"
},
"peerDependencies": {
"@bufbuild/protobuf": "^1.2.1",
"@bufbuild/protobuf": "^1.3.3",
"@connectrpc/connect": "1.1.1",
"@connectrpc/connect-node": "1.1.1"
},
Expand Down
22 changes: 9 additions & 13 deletions packages/connect-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,29 @@
"url": "https://github.com/connectrpc/connect-es.git",
"directory": "packages/connect-fastify"
},
"sideEffects": false,
"scripts": {
"clean": "rm -rf ./dist/cjs/* ./dist/esm/*",
"build": "npm run build:cjs && npm run build:esm",
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
"attw": "attw --pack"
},
"main": "./dist/cjs/index.js",
"type": "module",
"sideEffects": false,
"main": "./dist/cjs/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
"module": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/proxy/index.js"
}
},
"engines": {
"node": ">=16.0.0"
},
"peerDependencies": {
"@bufbuild/protobuf": "^1.2.1",
"@bufbuild/protobuf": "^1.3.3",
"fastify": "^4.22.1",
"@connectrpc/connect": "1.1.1",
"@connectrpc/connect-node": "1.1.1"
Expand Down
22 changes: 9 additions & 13 deletions packages/connect-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,29 @@
"url": "https://github.com/connectrpc/connect-es.git",
"directory": "packages/connect-next"
},
"sideEffects": false,
"scripts": {
"clean": "rm -rf ./dist/cjs/* ./dist/esm/*",
"build": "npm run build:cjs && npm run build:esm",
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
"attw": "attw --pack"
},
"main": "./dist/cjs/index.js",
"type": "module",
"sideEffects": false,
"main": "./dist/cjs/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
"module": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/proxy/index.js"
}
},
"engines": {
"node": ">=16.0.0"
},
"peerDependencies": {
"@bufbuild/protobuf": "^1.2.1",
"@bufbuild/protobuf": "^1.3.3",
"next": "^13.2.4",
"@connectrpc/connect": "1.1.1",
"@connectrpc/connect-node": "1.1.1"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/connect-node-test/src/gen/server/v1/server_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions packages/connect-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@
"directory": "packages/connect-node"
},
"scripts": {
"clean": "rm -rf ./dist/cjs/* ./dist/esm/*",
"build": "npm run build:cjs && npm run build:esm",
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"jasmine": "jasmine --config=jasmine.json",
"attw": "attw --pack"
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
"attw": "attw --pack",
"jasmine": "jasmine --config=jasmine.json"
},
"main": "./dist/cjs/index.js",
"type": "module",
"main": "./dist/cjs/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
"module": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/proxy/index.js"
}
},
"engines": {
Expand All @@ -36,7 +32,7 @@
"undici": "^5.25.4"
},
"peerDependencies": {
"@bufbuild/protobuf": "^1.2.1",
"@bufbuild/protobuf": "^1.3.3",
"@connectrpc/connect": "1.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-web-bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"@connectrpc/connect-web": "1.1.1",
"@bufbuild/protobuf": "^1.3.1",
"@bufbuild/protobuf": "^1.3.3",
"@bufbuild/protoc-gen-es": "^1.3.1",
"brotli": "^1.3.3",
"esbuild": "^0.16.12",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading