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

Bundle type definitions for monorepo packages #39

Merged
merged 2 commits into from
Oct 25, 2021
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
158 changes: 135 additions & 23 deletions package-lock.json

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

1 change: 1 addition & 0 deletions packages/express-oauth2-jwt-bearer/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
'oauth2-bearer': ['../oauth2-bearer/src'],
'access-token-jwt': ['../access-token-jwt/src'],
},
useUnknownInCatchVariables: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollup-plugin-dts brought in a new version of TS with a breaking change around errors being unknown by default. Which was causing some tests to fail.

This disables the breaking change for the tests (in ts-jest)

},
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/express-oauth2-jwt-bearer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prettier": "~2.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.45.1",
"rollup-plugin-dts": "^4.0.0",
"rollup-plugin-typescript2": "^0.30.0",
"ts-jest": "^26.5.4",
"tslib": "^2.2.0",
Expand Down
36 changes: 25 additions & 11 deletions packages/express-oauth2-jwt-bearer/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import dts from 'rollup-plugin-dts';

export default {
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'cjs',
export default [
{
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'cjs',
},
external: ['jose'],
plugins: [
nodeResolve(),
typescript({
tsconfigOverride: { compilerOptions: { module: 'ES2015' } },
}),
],
},
external: ["jose"],
plugins: [
nodeResolve(),
typescript({ tsconfigOverride: { compilerOptions: { module: 'ES2015' } } }),
],
};
{
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'es',
},
external: ['express', 'http', 'https'],
plugins: [dts({ respectExternal: true })],
},
];
1 change: 0 additions & 1 deletion packages/express-oauth2-jwt-bearer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"allowJs": true,
"removeComments": true,
"declaration": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using rollup-plugin-dts to provide the type declaration rather than typescript

"outDir": "./dist"
},
"include": [
Expand Down