diff --git a/examples/apps/full-stack/package.json b/examples/apps/full-stack/package.json index 137ac4a6..7ce98021 100644 --- a/examples/apps/full-stack/package.json +++ b/examples/apps/full-stack/package.json @@ -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": { diff --git a/examples/apps/full-stack/services/repository.json b/examples/apps/full-stack/services/repository.json index 066d5d35..66081dbc 100644 --- a/examples/apps/full-stack/services/repository.json +++ b/examples/apps/full-stack/services/repository.json @@ -2,7 +2,7 @@ "url": "http://127.0.0.1:2999", "repository": { - "assets": [ "index.html", "assets/**/*" ], + "assets": [ "index.html", "assets/**/*", "domain/**/*" ], "serveIndexOnNotFound": true } } \ No newline at end of file diff --git a/examples/apps/full-stack/services/standalone.json b/examples/apps/full-stack/services/standalone.json index 1dcfe277..49a4e739 100644 --- a/examples/apps/full-stack/services/standalone.json +++ b/examples/apps/full-stack/services/standalone.json @@ -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 } } \ No newline at end of file diff --git a/examples/apps/full-stack/services/worker.json b/examples/apps/full-stack/services/worker.json index dc86157e..b56ad66a 100644 --- a/examples/apps/full-stack/services/worker.json +++ b/examples/apps/full-stack/services/worker.json @@ -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"] } } \ No newline at end of file diff --git a/examples/apps/full-stack/tsconfig.base.json b/examples/apps/full-stack/tsconfig.base.json new file mode 100644 index 00000000..a3e75ece --- /dev/null +++ b/examples/apps/full-stack/tsconfig.base.json @@ -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"] +} \ No newline at end of file diff --git a/examples/apps/full-stack/tsconfig.build.json b/examples/apps/full-stack/tsconfig.build.json new file mode 100644 index 00000000..63022935 --- /dev/null +++ b/examples/apps/full-stack/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "noEmit": false, + "jsx": "react-jsx", + "rootDir": "./src", + "outDir": "./dist", + }, + "include": ["src"], + "exclude": ["src/webui"] +} \ No newline at end of file diff --git a/examples/apps/full-stack/tsconfig.json b/examples/apps/full-stack/tsconfig.json index c42b9ef8..0ab93b49 100644 --- a/examples/apps/full-stack/tsconfig.json +++ b/examples/apps/full-stack/tsconfig.json @@ -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" }] -} + } +} \ No newline at end of file diff --git a/examples/apps/full-stack/tsconfig.node.json b/examples/apps/full-stack/tsconfig.node.json deleted file mode 100644 index 9d31e2ae..00000000 --- a/examples/apps/full-stack/tsconfig.node.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "module": "ESNext", - "moduleResolution": "Node", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/examples/apps/full-stack/vite.config.ts b/examples/apps/full-stack/vite.config.ts index 607945cd..05617937 100644 --- a/examples/apps/full-stack/vite.config.ts +++ b/examples/apps/full-stack/vite.config.ts @@ -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')