@hamak/smart-data-dico 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/dist/server.mjs +82212 -0
- package/bin/cli.js +28 -17
- package/frontend/dist/assets/index-1b53cffe.js +431 -0
- package/frontend/dist/assets/index-fa72a51a.css +1 -0
- package/frontend/dist/index.html +15 -0
- package/package.json +28 -27
- package/backend/package.json +0 -51
- package/backend/src/__tests__/integration/api.test.ts +0 -149
- package/backend/src/__tests__/setup.ts +0 -24
- package/backend/src/__tests__/utils/testUtils.ts +0 -76
- package/backend/src/adapters/EntityFileAdapter.ts +0 -154
- package/backend/src/adapters/YamlFileInfoEnricher.ts +0 -52
- package/backend/src/controllers/authController.ts +0 -131
- package/backend/src/controllers/diagramController.ts +0 -143
- package/backend/src/controllers/dictionaryController.ts +0 -306
- package/backend/src/controllers/importExportController.ts +0 -64
- package/backend/src/controllers/perspectiveController.ts +0 -90
- package/backend/src/controllers/serviceController.ts +0 -418
- package/backend/src/controllers/stereotypeController.ts +0 -59
- package/backend/src/controllers/versionController.ts +0 -226
- package/backend/src/kernel/config.ts +0 -43
- package/backend/src/middleware/auth.ts +0 -128
- package/backend/src/middleware/jwtAuth.ts +0 -100
- package/backend/src/models/Dictionary.ts +0 -38
- package/backend/src/models/EntitySchema.ts +0 -393
- package/backend/src/models/__tests__/Dictionary.test.ts +0 -92
- package/backend/src/models/__tests__/EntitySchema.test.ts +0 -119
- package/backend/src/routes/index.ts +0 -120
- package/backend/src/scripts/migrate-to-uuid.ts +0 -24
- package/backend/src/server.ts +0 -158
- package/backend/src/services/__mocks__/entityService.ts +0 -38
- package/backend/src/services/__mocks__/serviceService.ts +0 -88
- package/backend/src/services/__mocks__/versionService.ts +0 -38
- package/backend/src/services/__tests__/dictionaryService.test.ts +0 -74
- package/backend/src/services/diagramService.ts +0 -165
- package/backend/src/services/dictionaryService.ts +0 -582
- package/backend/src/services/entityService.ts +0 -102
- package/backend/src/services/exportService.ts +0 -172
- package/backend/src/services/importService.ts +0 -208
- package/backend/src/services/perspectiveService.ts +0 -276
- package/backend/src/services/qualityService.ts +0 -121
- package/backend/src/services/serviceService.ts +0 -763
- package/backend/src/services/stereotypeService.ts +0 -98
- package/backend/src/services/versionService.ts +0 -135
- package/backend/src/setupTests.ts +0 -12
- package/backend/src/utils/__mocks__/fileOperations.ts +0 -116
- package/backend/src/utils/fileOperations.ts +0 -602
- package/backend/src/utils/logger.ts +0 -38
- package/backend/src/utils/migration.ts +0 -254
- package/backend/src/utils/swagger.ts +0 -358
- package/backend/src/utils/uuid.ts +0 -41
- package/backend/tsconfig.json +0 -20
package/bin/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
|
-
import { dirname, join, resolve } from 'path';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
5
|
import { existsSync, mkdirSync, cpSync } from 'fs';
|
|
6
6
|
import { spawn } from 'child_process';
|
|
7
7
|
|
|
@@ -25,7 +25,7 @@ if (flags.help) {
|
|
|
25
25
|
|
|
26
26
|
Usage:
|
|
27
27
|
smart-data-dico [options]
|
|
28
|
-
npx smart-data-dico [options]
|
|
28
|
+
npx @hamak/smart-data-dico [options]
|
|
29
29
|
|
|
30
30
|
Options:
|
|
31
31
|
--port <number> Server port (default: 3001)
|
|
@@ -59,14 +59,33 @@ if (!existsSync(dataDir)) {
|
|
|
59
59
|
mkdirSync(join(dataDir, 'perspectives'), { recursive: true });
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
// Determine how to run the server:
|
|
63
|
+
// 1. Bundled (production/npm): single .mjs file, run with node — no deps needed
|
|
64
|
+
// 2. Source (dev): TypeScript source, run with tsx
|
|
65
|
+
const bundledServer = join(PKG_ROOT, 'backend', 'dist', 'server.mjs');
|
|
66
|
+
const sourceServer = join(PKG_ROOT, 'backend', 'src', 'server.ts');
|
|
67
|
+
|
|
68
|
+
let bin, binArgs;
|
|
69
|
+
|
|
70
|
+
if (existsSync(bundledServer)) {
|
|
71
|
+
// Production: bundled server — all deps inlined, just node
|
|
72
|
+
bin = process.execPath; // 'node'
|
|
73
|
+
binArgs = [bundledServer];
|
|
74
|
+
} else if (existsSync(sourceServer)) {
|
|
75
|
+
// Development: run TypeScript source via tsx
|
|
76
|
+
const tsxPaths = [
|
|
77
|
+
join(PKG_ROOT, 'node_modules', '.bin', 'tsx'),
|
|
78
|
+
join(PKG_ROOT, 'backend', 'node_modules', '.bin', 'tsx'),
|
|
79
|
+
];
|
|
80
|
+
bin = tsxPaths.find(p => existsSync(p)) || 'npx';
|
|
81
|
+
binArgs = bin.endsWith('npx') ? ['tsx', sourceServer] : [sourceServer];
|
|
82
|
+
} else {
|
|
83
|
+
console.error('Error: No server found (neither bundled nor source).');
|
|
67
84
|
process.exit(1);
|
|
68
85
|
}
|
|
69
86
|
|
|
87
|
+
const frontendDist = join(PKG_ROOT, 'frontend', 'dist');
|
|
88
|
+
|
|
70
89
|
console.log(`
|
|
71
90
|
Smart Data Dictionary
|
|
72
91
|
|
|
@@ -76,16 +95,8 @@ console.log(`
|
|
|
76
95
|
Frontend: ${existsSync(frontendDist) ? 'bundled' : 'dev (use frontend dev server on :3000)'}
|
|
77
96
|
`);
|
|
78
97
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
join(PKG_ROOT, 'node_modules', '.bin', 'tsx'),
|
|
82
|
-
join(PKG_ROOT, 'backend', 'node_modules', '.bin', 'tsx'),
|
|
83
|
-
];
|
|
84
|
-
let tsxBin = tsxPaths.find(p => existsSync(p)) || 'npx';
|
|
85
|
-
const tsxArgs = tsxBin === 'npx' ? ['tsx', serverTs] : [serverTs];
|
|
86
|
-
|
|
87
|
-
const child = spawn(tsxBin, tsxArgs, {
|
|
88
|
-
cwd: join(PKG_ROOT, 'backend'),
|
|
98
|
+
const child = spawn(bin, binArgs, {
|
|
99
|
+
cwd: PKG_ROOT,
|
|
89
100
|
env: {
|
|
90
101
|
...process.env,
|
|
91
102
|
PORT: port,
|