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: application builds #550

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
106a0fb
#296: first attempt
basmasking Mar 19, 2024
ff8d8d1
Merge branch 'main' into 296-protect-private-segment-functions-when-c…
petermasking Apr 3, 2024
e3f95ed
#296: second iteration
petermasking Apr 5, 2024
21d47a4
Merge branch 'main' into 296-protect-private-segment-functions-when-c…
petermasking May 13, 2024
a50ab79
#296: first working contact app
petermasking May 13, 2024
0a938f0
#296: fixed node-client example
basmasking May 13, 2024
6a2730c
#296: refoctored import strategy
petermasking May 14, 2024
de66ec4
#296: first draft of the new cache model
petermasking Aug 15, 2024
8cb3aae
#296: make it work
petermasking Aug 15, 2024
4b33599
#296: removed old caching code
petermasking Aug 21, 2024
98418a6
#296: first draft of the new runtime
petermasking Aug 21, 2024
0e20d15
#296: make it work again
petermasking Aug 21, 2024
f182a34
#296: make gateway work
petermasking Aug 22, 2024
e7d65d7
#296: make class deserialization work
petermasking Aug 22, 2024
d299ff5
#296: first draft of client creation
petermasking Aug 23, 2024
c8e1446
#296: test draft of the new vite plugin
petermasking Aug 23, 2024
26c05f8
#296: first draft of the cli with build command
petermasking Aug 27, 2024
4da27f3
#296: fist working full-stack setup
petermasking Aug 27, 2024
e0b8813
#296: make it good (part 1)
petermasking Aug 28, 2024
037ca36
#296: split off the services, health and middleware
petermasking Aug 28, 2024
8f29e95
#296: added server configuration
petermasking Aug 29, 2024
94bb7ab
#296: updated full-stack app
petermasking Aug 29, 2024
49335b4
#296: added server to services
petermasking Aug 29, 2024
6944aa2
#296: cleaned and refactored runtime
petermasking Aug 29, 2024
711d352
#296: separated type imports
petermasking Aug 30, 2024
68d8b09
#296: refactored server
petermasking Sep 2, 2024
6d542ac
#296: restored cors middleware
petermasking Sep 2, 2024
23ab49d
#296: static class resolving
petermasking Sep 5, 2024
df5a2a4
#296: client segmentation
petermasking Sep 6, 2024
369d7ff
#296: minified class serialization support
petermasking Sep 6, 2024
38d28ed
#296: configuration script mapping
petermasking Sep 6, 2024
c0f4c35
#296: added vite dev support
petermasking Sep 6, 2024
d5165be
#296: added config argument to the start command
petermasking Sep 6, 2024
fa3d8f1
#296: added basic logging library
petermasking Sep 6, 2024
4ce2fb0
#296: register worker procedures
petermasking Sep 6, 2024
9b46486
#296: added logging
petermasking Sep 6, 2024
b45ae3b
#296: implemented result status codes
petermasking Sep 9, 2024
02bc532
#296: implemented nested messages in logger
petermasking Sep 9, 2024
3fde737
#296: removed obsolete cache builder
petermasking Sep 9, 2024
56bb153
#296: moved validation logic to its own package
petermasking Sep 10, 2024
4f47eb6
#296: logging cli errors
petermasking Sep 10, 2024
f66b982
#296: caching finetuning
petermasking Sep 10, 2024
0c3ff28
#296: added basic CLI commands
petermasking Sep 10, 2024
ed0fd4e
#296: implemened dry-run mode (for CORS)
petermasking Sep 10, 2024
52d8243
#296: added fatal log type
petermasking Sep 10, 2024
d53aba8
#296: added strict validation option
petermasking Sep 10, 2024
e01ae49
#296: finalized setting up procedure runner
petermasking Sep 10, 2024
ed88dc2
#296: implemented index file support
petermasking Sep 10, 2024
a981691
#296: moved client and server to runtime
petermasking Sep 11, 2024
729acab
#296: start server improvements
petermasking Sep 11, 2024
ee08853
#296: cleaning up runtime
petermasking Sep 11, 2024
5bcae10
#296: removed obsolete remote file manager
petermasking Sep 11, 2024
a821b19
#296: refactored access control
petermasking Sep 13, 2024
46e2e39
#296: fixed worker registration with trust key
petermasking Sep 13, 2024
828835a
#296: updated construction example
petermasking Sep 13, 2024
ff3f8ea
#296: updated cors example
petermasking Sep 13, 2024
6a3d347
#296: updated data transportation example
petermasking Sep 13, 2024
7dda9ae
#296: updated error handling example
petermasking Sep 13, 2024
6a4f710
#296: updated health check example
petermasking Sep 13, 2024
aaf6d1b
#296: updated hello world example
petermasking Sep 13, 2024
4437c8d
#296: updated load balancing example
petermasking Sep 13, 2024
84346d7
#296: updated middleware example
petermasking Sep 13, 2024
3a7b29b
#296: removed obsolete concepts
petermasking Sep 13, 2024
33bba71
#296: updated segmentation example
petermasking Sep 13, 2024
78dedfe
#296: updated multi-version example
petermasking Sep 13, 2024
82bc1e9
#296: implemented export rewriting
petermasking Sep 19, 2024
04a4264
#296: self containing bundles
petermasking Sep 19, 2024
f327623
#296: improved vite plugin
petermasking Sep 19, 2024
4448e08
#296: build optimizations
petermasking Sep 20, 2024
ce638a4
#296: moved middleware from services to runtime
petermasking Sep 20, 2024
08c23ef
#296: removed obsolete implementation
petermasking Sep 20, 2024
f3a828a
#296: refactored the http implementation
petermasking Sep 21, 2024
b9d0290
#296: renamed caching to build
petermasking Sep 23, 2024
a5b5a19
#296: fixed bundle load issue
petermasking Sep 23, 2024
f8c694d
#296: refactored reflection package to analysis
petermasking Sep 24, 2024
533dd68
#296: testing and debugging client serialization
petermasking Sep 24, 2024
68b1077
#296: finished repository configuration
petermasking Sep 24, 2024
8669415
#296: fixed providing files from proxy
petermasking Sep 24, 2024
8131e3a
#296: fixed forwarding redirect response
petermasking Sep 24, 2024
dfd0037
#296: http improvements
petermasking Sep 24, 2024
e6e0977
#296: package consistency
petermasking Sep 25, 2024
32d9605
#296: moved health check management to runtime
petermasking Sep 25, 2024
b00842b
#296: added body limit configuration
petermasking Sep 26, 2024
6f44444
#296: refactored analysis tests
petermasking Sep 26, 2024
f78def7
#296: added CLI tests
petermasking Sep 26, 2024
c1834fe
#296: refactored execution tests
petermasking Sep 26, 2024
d62e9c8
#296: refactored serialization tests
petermasking Sep 26, 2024
e901582
#296: added tests for validation package
basmasking Sep 29, 2024
b47982c
#296: refactored health tests
petermasking Sep 30, 2024
dd8b55a
#296: refactored middleware tests
petermasking Sep 30, 2024
1e9a4cf
#296: added writer interface for testability
basmasking Oct 1, 2024
0070958
#296: created test
basmasking Oct 1, 2024
6b34200
#296: minimized the package json files for private packages
basmasking Oct 1, 2024
acce042
#296: refactored service tests
petermasking Oct 2, 2024
5dd45bc
#296: package cleanup
petermasking Oct 2, 2024
a5a952d
#296: fixed running tests
petermasking Oct 2, 2024
f4b1ded
#296: added execution manager tests
petermasking Oct 2, 2024
dbc1f96
#296: test consistency
petermasking Oct 2, 2024
5220ccd
#296: updated dependencies
petermasking Oct 2, 2024
ee4933e
#296: examples tests
petermasking Oct 2, 2024
27516bf
Merge branch 'main' into 296-protect-private-segment-functions-when-c…
petermasking Oct 2, 2024
c14273a
#296: merged main
petermasking Oct 2, 2024
9870426
#296: fixed execution test
petermasking Oct 2, 2024
34db86e
#296: fixed middleware tests
petermasking Oct 2, 2024
c6ea957
#296: added missing services dependency
petermasking Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"ignorePatterns": ["**/dist/**/*", "**/node_modules/**/*","**/coverage/**/*", "**/*config*", "packages/create-jitar/templates/*"],
"ignorePatterns": ["**/dist/**/*", "**/node_modules/**/*","**/coverage/**/*", "packages/create-jitar/templates/*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./packages/**/tsconfig.json"
Expand Down
4 changes: 1 addition & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ The following examples focus on one particular concept at a time. The examples a
1. [Multi Version](concepts/multi-version/README.md) - Demonstrates how to create multiple versions of a procedure.
1. [Data Transportation](concepts/data-transportation/README.md) - Demonstrates how to transport data between segmented procedures.
1. [Error handling](concepts/error-handling/README.md) - Demonstrates how to the error handling works.
1. [Node client](concepts/node-client/README.md) - Demonstrates how to start a Jitar server and client.
1. [Health checks](concepts/health-checks/README.md) - Demonstrates how to use health checks.
1. [Middleware](concepts/middleware/README.md) - Demonstrates how to use middleware.
1. [Cors](concepts/cors/README.md) - Demonstrates how to enable cors.
1. [Construction](concepts/construction/README.md) - Demonstrates how to use a set up and tear down scripts.
1. [Overrides](concepts/overrides/README.md) - Demonstrates how to use import overrides.

## Application examples

The following examples demonstrate how to build real-world applications using Jitar.

1. [Contact list](apps/contact-list/README.md) - Example of a full stack application build with React, MongoDB and Jitar.
1. [Full stack](apps/full-stack/README.md) - Example of a full stack application build with React, MongoDB and Jitar.
4 changes: 4 additions & 0 deletions examples/apps/full-stack/jitar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "./dist",
"target": "./dist"
}
14 changes: 8 additions & 6 deletions examples/apps/full-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build && tsc",
"standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json",
"repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json",
"gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json",
"worker": "node --experimental-network-imports dist/jitar.js --config=services/worker.json",
"proxy": "node --experimental-network-imports dist/jitar.js --config=services/proxy.json",
"build": "npm run build-domain && npm run build-webui",
"build-domain": "rm -rf dist && tsc -p tsconfig.build.json && jitar build",
"build-webui": "vite build",
"standalone": "jitar start --service=services/standalone.json",
"repo": "jitar start --service=services/repository.json",
"gateway": "jitar start --service=services/gateway.json",
"worker": "jitar start --service=services/worker.json",
"proxy": "jitar start --service=services/proxy.json",
"preview": "vite preview"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions examples/apps/full-stack/segments/client.segment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"./domain/contact/Contact": { "default": { } }
}
1 change: 1 addition & 0 deletions examples/apps/full-stack/segments/server.segment.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"./domain/contact/Contact": { "default": { } },
"./domain/contact/createContact": { "default": { "access": "public" } },
"./domain/contact/deleteContact": { "default": { "access": "public" } },
"./domain/contact/getContacts": { "default": { "access": "public" } }
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/full-stack/services/gateway.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"url": "http://127.0.0.1:3000",
"gateway": {
"repository": "http://127.0.0.1:2999"

}
}
3 changes: 2 additions & 1 deletion examples/apps/full-stack/services/standalone.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"setUp": ["./integrations/jitar/setUpDatabase"],
"tearDown": ["./integrations/jitar/tearDownDatabase"],
"healthChecks": ["./integrations/jitar/databaseHealthCheck"],
"middleware": ["./integrations/jitar/requestLogger"],
"standalone":
{
"segments": ["server"],
"assets": [ "index.html", "assets/**/*" ],
"middlewares": ["./integrations/jitar/requestLogger"],
"serveIndexOnNotFound": true
}
}
5 changes: 2 additions & 3 deletions examples/apps/full-stack/services/worker.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"url": "http://127.0.0.1:3001",
"setUp": ["./integrations/jitar/setUpDatabase"],
"tearDown": ["./integrations/jitar/tearDownDatabase"],
"middleware": ["./integrations/jitar/requestLogger"],
"healthChecks": ["./integrations/jitar/databaseHealthCheck"],
"worker":
{
"gateway": "http://127.0.0.1:3000",
"repository": "http://127.0.0.1:2999",
"segments": [ "server" ],
"middlewares": ["./integrations/jitar/requestLogger"]
"gateway": "http://127.0.0.1:3000"
}
}
9 changes: 0 additions & 9 deletions examples/apps/full-stack/src/jitar.ts

This file was deleted.

21 changes: 21 additions & 0 deletions examples/apps/full-stack/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"paths": {
"^/*": ["./src/*"],
}
},
"include": ["src", "test"]
}
11 changes: 11 additions & 0 deletions examples/apps/full-stack/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"jsx": "react-jsx",
"rootDir": "./src",
"outDir": "./dist",
},
"include": ["src"],
"exclude": ["src/webui"]
}
23 changes: 3 additions & 20 deletions examples/apps/full-stack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"outDir": "dist",
"jsx": "react-jsx"
},
"include": ["src"],
"exclude": ["src/webui"],
"references": [{ "path": "./tsconfig.node.json" }]
}
}
}
9 changes: 0 additions & 9 deletions examples/apps/full-stack/tsconfig.node.json

This file was deleted.

5 changes: 4 additions & 1 deletion examples/apps/full-stack/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import react from '@vitejs/plugin-react';
import jitar from '@jitar/plugin-vite';

export default defineConfig({
build: {
emptyOutDir: false
},
plugins: [
react(),
jitar('src', 'domain', 'http://localhost:3000')
jitar({ sourceDir: 'src', targetDir: 'dist', jitarDir: 'domain', jitarUrl: 'http://localhost:3000', segments: ['client'] })
]
})
4 changes: 4 additions & 0 deletions examples/concepts/access-protection/jitar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "./dist",
"target": "./.jitar"
}
11 changes: 5 additions & 6 deletions examples/concepts/access-protection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"type": "module",
"private": true,
"scripts": {
"build": "tsc",
"standalone": "node --experimental-network-imports --env-file=.env dist/jitar.js --config=services/standalone.json",
"repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json",
"gateway": "node --experimental-network-imports --env-file=.env dist/jitar.js --config=services/gateway.json",
"worker-web": "node --experimental-network-imports --env-file=.env dist/jitar.js --config=services/web.json",
"worker-game": "node --experimental-network-imports --env-file=.env dist/jitar.js --config=services/game.json"
"build": "rm -rf dist .jitar && tsc && jitar build",
"standalone": "jitar start --service=services/standalone.json",
"gateway": "jitar start --service=services/gateway.json",
"worker-public": "jitar start --service=services/public.json",
"worker-protected": "jitar start --service=services/protected.json"
},
"dependencies": {
"jitar": "*"
Expand Down
1 change: 0 additions & 1 deletion examples/concepts/access-protection/services/gateway.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"url": "http://127.0.0.1:3000",
"gateway": {
"repository": "http://127.0.0.1:2999",
"trustKey": "${TRUST_KEY}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"worker":
{
"gateway": "http://127.0.0.1:3000",
"repository": "http://127.0.0.1:2999",
"segments": [ "protected" ],
"trustKey": "${TRUST_KEY}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"worker":
{
"gateway": "http://127.0.0.1:3000",
"repository": "http://127.0.0.1:2999",
"segments": [ "public" ],
"trustKey": "${TRUST_KEY}"
}
Expand Down
7 changes: 0 additions & 7 deletions examples/concepts/access-protection/services/repository.json

This file was deleted.

3 changes: 2 additions & 1 deletion examples/concepts/access-protection/services/standalone.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"url": "http://127.0.0.1:3000",
"standalone":
"worker":
{
"segments": ["public", "protected"],
"trustKey": "${TRUST_KEY}"
}
}
9 changes: 0 additions & 9 deletions examples/concepts/access-protection/src/jitar.ts

This file was deleted.

4 changes: 4 additions & 0 deletions examples/concepts/construction/jitar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "./dist",
"target": "./.jitar"
}
4 changes: 2 additions & 2 deletions examples/concepts/construction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"type": "module",
"scripts": {
"build": "tsc",
"standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json"
"build": "rm -rf dist .jitar && tsc && jitar build",
"standalone": "jitar start --service=services/standalone.json"
},
"dependencies": {
"jitar": "*"
Expand Down
4 changes: 3 additions & 1 deletion examples/concepts/construction/services/standalone.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"url": "http://127.0.0.1:3000",
"setUp": ["./setUpDatabase"],
"tearDown": ["./tearDownDatabase"],
"standalone": {}
"worker": {
"segments": ["default"]
}
}
9 changes: 0 additions & 9 deletions examples/concepts/construction/src/jitar.ts

This file was deleted.

4 changes: 4 additions & 0 deletions examples/concepts/cors/jitar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "./dist",
"target": "./.jitar"
}
12 changes: 5 additions & 7 deletions examples/concepts/cors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
"type": "module",
"private": true,
"scripts": {
"clean": "rimraf dist",
"compile": "tsc",
"clean": "rm -rf dist .jitar",
"compile": "tsc && jitar build",
"copy": "cpx -u 'src/index.html' dist",
"build": "npm-run-all clean copy compile",
"standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json",
"build": "npm run clean && npm run copy && npm run compile",
"standalone": "jitar start --service=services/standalone.json",
"client": "node dist/client.js"
},
"dependencies": {
"jitar": "*",
"express": "*"
},
"devDependencies": {
"cpx2": "*",
"npm-run-all": "*",
"rimraf": "*"
"cpx2": "*"
}
}
2 changes: 2 additions & 0 deletions examples/concepts/cors/requests.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

GET http://localhost:3000/rpc/getWeatherForecast HTTP/1.1
5 changes: 3 additions & 2 deletions examples/concepts/cors/services/standalone.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"url": "http://127.0.0.1:3000",
"standalone":
"middleware": ["./handleCors"],
"worker":
{
"middlewares": ["./handleCors"]
"segments": ["server"]
}
}
9 changes: 0 additions & 9 deletions examples/concepts/cors/src/jitar.ts

This file was deleted.

4 changes: 4 additions & 0 deletions examples/concepts/data-transportation/jitar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "./dist",
"target": "./.jitar"
}
11 changes: 5 additions & 6 deletions examples/concepts/data-transportation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"type": "module",
"private": true,
"scripts": {
"build": "tsc",
"standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json",
"repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json",
"gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json",
"worker-account": "node --experimental-network-imports dist/jitar.js --config=services/account.json",
"worker-helpdesk": "node --experimental-network-imports dist/jitar.js --config=services/helpdesk.json"
"build": "rm -rf dist .jitar && tsc && jitar build",
"standalone": "jitar start --service=services/standalone.json",
"gateway": "jitar start --service=services/gateway.json",
"worker-account": "jitar start --service=services/account.json",
"worker-helpdesk": "jitar start --service=services/helpdesk.json"
},
"dependencies": {
"jitar": "*"
Expand Down
Loading