Skip to content

Commit

Permalink
#296: fist working full-stack setup
Browse files Browse the repository at this point in the history
  • Loading branch information
petermasking committed Aug 27, 2024
1 parent 26c05f8 commit 4da27f3
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 47 deletions.
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": "node dist/jitar.shared.js --config=services/standalone.json",
"repo": "node dist/jitar.shared.js --config=services/repository.json",
"gateway": "node dist/jitar.shared.js --config=services/gateway.json",
"worker": "node dist/jitar.shared.js --config=services/worker.json",
"proxy": "node dist/jitar.shared.js --config=services/proxy.json",
"preview": "vite preview"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/full-stack/services/repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"url": "http://127.0.0.1:2999",
"repository":
{
"assets": [ "index.html", "assets/**/*" ],
"assets": [ "index.html", "assets/**/*", "domain/**/*" ],
"serveIndexOnNotFound": true
}
}
11 changes: 6 additions & 5 deletions examples/apps/full-stack/services/standalone.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"url": "http://127.0.0.1:3000",
"setUp": ["./integrations/jitar/setUpDatabase"],
"tearDown": ["./integrations/jitar/tearDownDatabase"],
"healthChecks": ["./integrations/jitar/databaseHealthCheck"],
"setUp": ["./integrations/jitar/setUpDatabase.shared.js"],
"tearDown": ["./integrations/jitar/tearDownDatabase.shared.js"],
"healthChecks": ["./integrations/jitar/databaseHealthCheck.shared.js"],
"standalone":
{
"assets": [ "index.html", "assets/**/*" ],
"middlewares": ["./integrations/jitar/requestLogger"],
"segments": ["server"],
"middlewares": ["./integrations/jitar/requestLogger.shared.js"],
"assets": [ "index.html", "assets/**/*", "domain/**/*" ],
"serveIndexOnNotFound": true
}
}
11 changes: 5 additions & 6 deletions examples/apps/full-stack/services/worker.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"url": "http://127.0.0.1:3001",
"setUp": ["./integrations/jitar/setUpDatabase"],
"tearDown": ["/integrations/jitar/tearDownDatabase"],
"healthChecks": ["/integrations/jitar/databaseHealthCheck"],
"setUp": ["./integrations/jitar/setUpDatabase.shared.js"],
"tearDown": ["./integrations/jitar/tearDownDatabase.shared.js"],
"healthChecks": ["./integrations/jitar/databaseHealthCheck.shared.js"],
"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",
"middlewares": ["./integrations/jitar/requestLogger.shared.js"]
}
}
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.

3 changes: 3 additions & 0 deletions examples/apps/full-stack/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ 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')
Expand Down

0 comments on commit 4da27f3

Please sign in to comment.