-
Notifications
You must be signed in to change notification settings - Fork 9
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(packaging): configure rollup for jitar #261
Changes from 20 commits
ba1a786
28360d1
be27ce7
60c4c10
e6d402a
4503a40
6e768cc
f79b16b
16dc63e
ce9925f
161ade7
1614a15
4a2f71e
5619482
c2f5215
c79136c
a42a75a
1684313
66ca36e
a3e0818
b00a373
5598333
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,11 @@ | |
"test": "npm run test --workspace=packages/reflection --workspace=packages/serialization --workspace=packages/runtime --workspace=packages/caching --workspace=packages/server-nodejs --workspace=packages/jitar --workspace=packages/create-jitar --workspace=packages/plugin-vite --if-present" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-json": "^6.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This plugin seems to be unused There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, removed |
||
"@rollup/plugin-node-resolve": "^15.0.2", | ||
"@rollup/plugin-replace": "^5.0.2", | ||
"@rollup/plugin-terser": "^0.4.1", | ||
"@rollup/plugin-typescript": "^11.1.0", | ||
"@types/express": "^4.17.17", | ||
"@types/express-http-proxy": "^1.6.3", | ||
"@types/fs-extra": "^11.0.1", | ||
|
@@ -46,6 +51,8 @@ | |
"eslint": "^8.38.0", | ||
"eslint-plugin-jitar": "0.0.1", | ||
"lerna": "^6.6.1", | ||
"rollup": "^3.20.2", | ||
"rollup-plugin-dts": "^5.3.0", | ||
"vite": "^4.2.1", | ||
"vitest": "^0.30.0" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
coverage | ||
build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this build? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not at the moment. We can add it if required later. |
||
dist | ||
lib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this lib? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, also removed |
||
cache | ||
node_modules | ||
**/*.tgz |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
coverage | ||
src | ||
test | ||
node_modules | ||
.eslintignore | ||
.eslintrc | ||
vite.config.ts | ||
dist/types | ||
tsconfig.json | ||
rollup.config.js | ||
*.tgz |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,31 @@ | |
"author": "Masking Technology <[email protected]> (https://jitar.dev)", | ||
"license": "MIT", | ||
"type": "module", | ||
"types": "dist/lib.d.ts", | ||
"types": "./dist/lib.d.ts", | ||
"sideEffects": true, | ||
"exports": { | ||
".": "./dist/lib.js" | ||
".": "./dist/lib.js", | ||
"./server": "./dist/server.js", | ||
"./client": "./dist/client.js" | ||
}, | ||
"scripts": { | ||
"lint": "eslint . --ext .ts", | ||
"build": "tsc -p tsconfig.json", | ||
"clean": "rm -rf dist build", | ||
"validate": "tsc -p tsconfig.json --noEmit", | ||
"build": "npm run clean && rollup -c", | ||
"clean": "rm -rf dist", | ||
"release": "npm run clean && npm run build && npm publish" | ||
}, | ||
"dependencies": { | ||
"@jitar/runtime": "^0.4.0", | ||
"@jitar/server-nodejs": "^0.4.0" | ||
"@jitar/server-nodejs": "^0.4.0", | ||
"express": "^4.18.2", | ||
"express-http-proxy": "^1.6.3", | ||
"fs-extra": "^11.1.1", | ||
"glob-promise": "6.0.2", | ||
"mime-types": "^2.1.35", | ||
"tslog": "^4.8.2", | ||
"yargs": "^17.7.1", | ||
"zod": "^3.21.4" | ||
}, | ||
"engines": { | ||
"node": ">=18.7" | ||
|
@@ -41,4 +52,4 @@ | |
"full stack", | ||
"web applications" | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
import terser from '@rollup/plugin-terser'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import replace from '@rollup/plugin-replace'; | ||
import dts from 'rollup-plugin-dts'; | ||
|
||
import { SERVER_EXTERNALS, REPLACE_VALUES } from './rollup.definitions.js'; | ||
|
||
export default [ | ||
{ | ||
external: SERVER_EXTERNALS, | ||
input: { | ||
server: 'src/server.ts', | ||
client: 'src/client.ts' | ||
}, | ||
output: { | ||
dir: 'dist', | ||
exports: 'named', | ||
format: 'module', | ||
plugins: [terser({ | ||
module: true, | ||
mangle: false | ||
})] | ||
}, | ||
plugins: [ | ||
typescript(), | ||
replace({ | ||
preventAssignment: true, | ||
values: REPLACE_VALUES | ||
}), | ||
nodeResolve() | ||
] | ||
}, | ||
{ | ||
external: [ | ||
'./client.js', | ||
'./server.js' | ||
], | ||
input: 'src/lib.ts', | ||
output: { | ||
file: 'dist/lib.js', | ||
format: 'module' | ||
}, | ||
plugins: [ | ||
typescript() | ||
] | ||
}, | ||
{ | ||
input: './dist/types/lib.d.ts', | ||
output: [{ file: 'dist/lib.d.ts', format: 'module' }], | ||
plugins: [dts({ | ||
respectExternal: true | ||
})], | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
export const SERVER_EXTERNALS = [ | ||
'express', | ||
'express-http-proxy', | ||
'fs-extra', | ||
'glob-promise', | ||
'mime-types', | ||
'tslog', | ||
'yargs', | ||
'zod' | ||
]; | ||
|
||
export const REPLACE_VALUES = { | ||
'RUNTIME_ERROR_LOCATION': '/jitar/client.js' | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
|
||
export { startClient, getClient } from '@jitar/runtime'; | ||
|
||
export * from './shared.js'; | ||
export | ||
{ | ||
HealthCheck, | ||
Middleware, | ||
NextHandler, | ||
Segment, | ||
Procedure, | ||
Implementation, | ||
Version, | ||
NamedParameter, | ||
ArrayParameter, | ||
ObjectParameter, | ||
BadRequest, | ||
Forbidden, | ||
NotFound, | ||
NotImplemented, | ||
PaymentRequired, | ||
ServerError, | ||
Teapot, | ||
Unauthorized, | ||
ClientNotFound, | ||
FileNotFound, | ||
ImplementationNotFound, | ||
InvalidClientId, | ||
InvalidParameterValue, | ||
InvalidSegmentFile, | ||
InvalidVersionNumber, | ||
MissingParameterValue, | ||
ModuleNotAccessible, | ||
ModuleNotLoaded, | ||
NoNodeAvailable, | ||
ProcedureNotAccessible, | ||
ProcedureNotFound, | ||
RepositoryNotAvailable, | ||
RuntimeNotAvailable, | ||
SegmentNotFound, | ||
UnknownParameter, | ||
startClient, | ||
getClient | ||
} from '@jitar/runtime'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
|
||
export { startServer, CorsMiddleware } from '@jitar/server-nodejs'; | ||
|
||
export * from './shared.js'; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2022", | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"module": "es2022", | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"declaration": true, | ||
"declarationDir": "./dist/types", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line seems to have tabs instead of spaces. |
||
"rootDir": "./src/", | ||
"moduleResolution": "node", | ||
"declaration": true, | ||
"outDir": "./dist", | ||
"removeComments": true, | ||
"esModuleInterop": true, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die we still need to igore the
lib
folder?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we don't