-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(packaging): configure rollup for jitar (#261)
- Loading branch information
1 parent
019ec62
commit d5238cc
Showing
53 changed files
with
3,957 additions
and
2,784 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
})], | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.