4runr-os 2.10.9 → 2.10.13

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.
@@ -1,63 +1,63 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Post-install: install Gateway dependencies so "npm start" in apps/gateway works.
4
- * The published package copies gateway source+dist but not node_modules; install them here.
5
- */
6
-
7
- import { execSync } from 'child_process';
8
- import * as fs from 'fs';
9
- import * as path from 'path';
10
- import { fileURLToPath } from 'url';
11
-
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = path.dirname(__filename);
14
-
15
- const gatewayDir = path.join(__dirname, '..', 'apps', 'gateway');
16
- const packageJson = path.join(gatewayDir, 'package.json');
17
- const nodeModules = path.join(gatewayDir, 'node_modules');
18
-
19
- if (!fs.existsSync(packageJson)) {
20
- process.exit(0); // No gateway in this install
21
- }
22
-
23
- const prismaSchema = path.join(__dirname, '..', 'prisma', 'schema.prisma');
24
-
25
- function ensurePrismaClient() {
26
- if (!fs.existsSync(prismaSchema)) {
27
- return;
28
- }
29
- try {
30
- console.log('🔧 Prisma: generating client for Gateway (global 4runr-os install)...');
31
- execSync('npm run db:generate', {
32
- cwd: gatewayDir,
33
- stdio: 'inherit',
34
- shell: process.platform === 'win32',
35
- });
36
- console.log('✓ Prisma client ready for Gateway');
37
- } catch (err) {
38
- console.warn(
39
- '⚠️ prisma generate failed. OS auto-start Gateway may fail until you run:\n' +
40
- ' cd apps/gateway && npm run db:generate',
41
- );
42
- }
43
- }
44
-
45
- if (fs.existsSync(nodeModules) && fs.readdirSync(nodeModules).length > 0) {
46
- ensurePrismaClient();
47
- process.exit(0); // Deps already present (e.g. from prepublish) — still (re)generate Prisma
48
- }
49
-
50
- try {
51
- console.log('📦 Installing Gateway dependencies (one-time)...');
52
- execSync('npm install --omit=dev', {
53
- cwd: gatewayDir,
54
- stdio: 'inherit',
55
- shell: process.platform === 'win32',
56
- });
57
- console.log('✓ Gateway dependencies ready');
58
- } catch (err) {
59
- console.warn('⚠️ Gateway dependency install failed. Start gateway from repo with: cd apps/gateway && npm start');
60
- // Don't fail the main install
61
- }
62
-
63
- ensurePrismaClient();
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-install: install Gateway dependencies so "npm start" in apps/gateway works.
4
+ * The published package copies gateway source+dist but not node_modules; install them here.
5
+ */
6
+
7
+ import { execSync } from 'child_process';
8
+ import * as fs from 'fs';
9
+ import * as path from 'path';
10
+ import { fileURLToPath } from 'url';
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+
15
+ const gatewayDir = path.join(__dirname, '..', 'apps', 'gateway');
16
+ const packageJson = path.join(gatewayDir, 'package.json');
17
+ const nodeModules = path.join(gatewayDir, 'node_modules');
18
+
19
+ if (!fs.existsSync(packageJson)) {
20
+ process.exit(0); // No gateway in this install
21
+ }
22
+
23
+ const prismaSchema = path.join(__dirname, '..', 'prisma', 'schema.prisma');
24
+
25
+ function ensurePrismaClient() {
26
+ if (!fs.existsSync(prismaSchema)) {
27
+ return;
28
+ }
29
+ try {
30
+ console.log('🔧 Prisma: generating client for Gateway (global 4runr-os install)...');
31
+ execSync('npm run db:generate', {
32
+ cwd: gatewayDir,
33
+ stdio: 'inherit',
34
+ shell: process.platform === 'win32',
35
+ });
36
+ console.log('✓ Prisma client ready for Gateway');
37
+ } catch (err) {
38
+ console.warn(
39
+ '⚠️ prisma generate failed. OS auto-start Gateway may fail until you run:\n' +
40
+ ' cd apps/gateway && npm run db:generate',
41
+ );
42
+ }
43
+ }
44
+
45
+ if (fs.existsSync(nodeModules) && fs.readdirSync(nodeModules).length > 0) {
46
+ ensurePrismaClient();
47
+ process.exit(0); // Deps already present (e.g. from prepublish) — still (re)generate Prisma
48
+ }
49
+
50
+ try {
51
+ console.log('📦 Installing Gateway dependencies (one-time)...');
52
+ execSync('npm install --omit=dev', {
53
+ cwd: gatewayDir,
54
+ stdio: 'inherit',
55
+ shell: process.platform === 'win32',
56
+ });
57
+ console.log('✓ Gateway dependencies ready');
58
+ } catch (err) {
59
+ console.warn('⚠️ Gateway dependency install failed. Start gateway from repo with: cd apps/gateway && npm start');
60
+ // Don't fail the main install
61
+ }
62
+
63
+ ensurePrismaClient();