@open-mercato/cli 0.6.3-develop.3525.2.cc18b8a43f → 0.6.3-develop.3562.1.71049275ff
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/cli",
|
|
3
|
-
"version": "0.6.3-develop.
|
|
3
|
+
"version": "0.6.3-develop.3562.1.71049275ff",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@mikro-orm/decorators": "^7.0.17",
|
|
60
60
|
"@mikro-orm/migrations": "^7.0.17",
|
|
61
61
|
"@mikro-orm/postgresql": "^7.0.17",
|
|
62
|
-
"@open-mercato/queue": "0.6.3-develop.
|
|
63
|
-
"@open-mercato/shared": "0.6.3-develop.
|
|
62
|
+
"@open-mercato/queue": "0.6.3-develop.3562.1.71049275ff",
|
|
63
|
+
"@open-mercato/shared": "0.6.3-develop.3562.1.71049275ff",
|
|
64
64
|
"cross-spawn": "^7.0.6",
|
|
65
65
|
"pg": "8.21.0",
|
|
66
66
|
"semver": "^7.8.0",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"typescript": "^6.0.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@open-mercato/shared": "0.6.3-develop.
|
|
73
|
+
"@open-mercato/shared": "0.6.3-develop.3562.1.71049275ff"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@open-mercato/shared": "0.6.3-develop.
|
|
76
|
+
"@open-mercato/shared": "0.6.3-develop.3562.1.71049275ff",
|
|
77
77
|
"@types/jest": "^30.0.0",
|
|
78
78
|
"jest": "^30.4.2",
|
|
79
79
|
"ts-jest": "^29.4.9"
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
padByCodePointWidth,
|
|
7
7
|
run,
|
|
8
8
|
} from '../mercato'
|
|
9
|
+
import { pathIncludes } from '../lib/__tests__/path-helpers'
|
|
9
10
|
|
|
10
11
|
type MockChildAutoExit = { code: number | null; signal?: NodeJS.Signals | null } | undefined
|
|
11
12
|
type MockChildSpawnRouter = (args: string[]) => MockChildAutoExit
|
|
@@ -674,7 +675,7 @@ describe('server dev managed process exits', () => {
|
|
|
674
675
|
return {
|
|
675
676
|
...actual,
|
|
676
677
|
existsSync: jest.fn((candidate: string) =>
|
|
677
|
-
candidate
|
|
678
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
678
679
|
),
|
|
679
680
|
unlinkSync: jest.fn(),
|
|
680
681
|
}
|
|
@@ -691,7 +692,7 @@ describe('server dev managed process exits', () => {
|
|
|
691
692
|
}))
|
|
692
693
|
jest.doMock('child_process', () =>
|
|
693
694
|
buildMockChildProcessModule((args) =>
|
|
694
|
-
args[0]
|
|
695
|
+
pathIncludes(args[0] ?? '', 'next/dist/bin/next') ? { code: null, signal: 'SIGTERM' } : undefined,
|
|
695
696
|
),
|
|
696
697
|
)
|
|
697
698
|
|
|
@@ -715,7 +716,7 @@ describe('server dev managed process exits', () => {
|
|
|
715
716
|
return {
|
|
716
717
|
...actual,
|
|
717
718
|
existsSync: jest.fn((candidate: string) =>
|
|
718
|
-
candidate
|
|
719
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
719
720
|
),
|
|
720
721
|
unlinkSync: jest.fn(),
|
|
721
722
|
}
|
|
@@ -763,7 +764,7 @@ describe('server dev managed process exits', () => {
|
|
|
763
764
|
return {
|
|
764
765
|
...actual,
|
|
765
766
|
existsSync: jest.fn((candidate: string) =>
|
|
766
|
-
candidate
|
|
767
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
767
768
|
),
|
|
768
769
|
unlinkSync: jest.fn(),
|
|
769
770
|
}
|
|
@@ -792,7 +793,7 @@ describe('server dev managed process exits', () => {
|
|
|
792
793
|
|
|
793
794
|
jest.doMock('child_process', () =>
|
|
794
795
|
buildMockChildProcessModule((args) =>
|
|
795
|
-
args[0]
|
|
796
|
+
pathIncludes(args[0] ?? '', 'next/dist/bin/next') ? { code: null, signal: 'SIGTERM' } : undefined,
|
|
796
797
|
),
|
|
797
798
|
)
|
|
798
799
|
|
|
@@ -830,7 +831,7 @@ describe('server dev managed process exits', () => {
|
|
|
830
831
|
return {
|
|
831
832
|
...actual,
|
|
832
833
|
existsSync: jest.fn((candidate: string) =>
|
|
833
|
-
candidate
|
|
834
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
834
835
|
),
|
|
835
836
|
unlinkSync: jest.fn(),
|
|
836
837
|
}
|
|
@@ -859,7 +860,7 @@ describe('server dev managed process exits', () => {
|
|
|
859
860
|
|
|
860
861
|
jest.doMock('child_process', () =>
|
|
861
862
|
buildMockChildProcessModule((args) =>
|
|
862
|
-
args[0]
|
|
863
|
+
pathIncludes(args[0] ?? '', 'next/dist/bin/next') ? { code: null, signal: 'SIGTERM' } : undefined,
|
|
863
864
|
),
|
|
864
865
|
)
|
|
865
866
|
|
|
@@ -932,7 +933,7 @@ describe('server start managed process exits', () => {
|
|
|
932
933
|
return {
|
|
933
934
|
...actual,
|
|
934
935
|
existsSync: jest.fn((candidate: string) =>
|
|
935
|
-
candidate
|
|
936
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
936
937
|
),
|
|
937
938
|
}
|
|
938
939
|
})
|
|
@@ -949,7 +950,7 @@ describe('server start managed process exits', () => {
|
|
|
949
950
|
}))
|
|
950
951
|
jest.doMock('child_process', () =>
|
|
951
952
|
buildMockChildProcessModule((args) =>
|
|
952
|
-
args[0]
|
|
953
|
+
pathIncludes(args[0] ?? '', 'next/dist/bin/next') ? { code: null, signal: 'SIGTERM' } : undefined,
|
|
953
954
|
),
|
|
954
955
|
)
|
|
955
956
|
|
|
@@ -973,7 +974,7 @@ describe('server start managed process exits', () => {
|
|
|
973
974
|
return {
|
|
974
975
|
...actual,
|
|
975
976
|
existsSync: jest.fn((candidate: string) =>
|
|
976
|
-
candidate
|
|
977
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
977
978
|
),
|
|
978
979
|
}
|
|
979
980
|
})
|
|
@@ -1022,7 +1023,7 @@ describe('server start managed process exits', () => {
|
|
|
1022
1023
|
return {
|
|
1023
1024
|
...actual,
|
|
1024
1025
|
existsSync: jest.fn((candidate: string) =>
|
|
1025
|
-
candidate
|
|
1026
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
1026
1027
|
),
|
|
1027
1028
|
unlinkSync: jest.fn(),
|
|
1028
1029
|
}
|
|
@@ -1089,7 +1090,7 @@ describe('server start managed process exits', () => {
|
|
|
1089
1090
|
|
|
1090
1091
|
return {
|
|
1091
1092
|
spawn: jest.fn((_command: string, args: string[]) => {
|
|
1092
|
-
if (args[0]
|
|
1093
|
+
if (pathIncludes(args[0] ?? '', 'next/dist/bin/next')) {
|
|
1093
1094
|
nextSpawnCount += 1
|
|
1094
1095
|
if (nextSpawnCount === 1) {
|
|
1095
1096
|
queueMicrotask(() => envChangeCallback?.('/tmp/test-app/.env'))
|
|
@@ -1106,7 +1107,7 @@ describe('server start managed process exits', () => {
|
|
|
1106
1107
|
const exitCode = await mercado.run(['node', 'mercato', 'server', 'dev'])
|
|
1107
1108
|
const { spawn } = await import('child_process')
|
|
1108
1109
|
const nextSpawns = (spawn as jest.Mock).mock.calls.filter((call) =>
|
|
1109
|
-
call[1]?.[0]
|
|
1110
|
+
pathIncludes(call[1]?.[0] ?? '', 'next/dist/bin/next'),
|
|
1110
1111
|
)
|
|
1111
1112
|
|
|
1112
1113
|
expect(exitCode).toBe(0)
|
|
@@ -1132,7 +1133,7 @@ describe('server start managed process exits', () => {
|
|
|
1132
1133
|
return {
|
|
1133
1134
|
...actual,
|
|
1134
1135
|
existsSync: jest.fn((candidate: string) =>
|
|
1135
|
-
candidate
|
|
1136
|
+
pathIncludes(candidate, 'next/dist/bin/next') || pathIncludes(candidate, '@open-mercato/cli/bin/mercato'),
|
|
1136
1137
|
),
|
|
1137
1138
|
}
|
|
1138
1139
|
})
|
|
@@ -1159,7 +1160,7 @@ describe('server start managed process exits', () => {
|
|
|
1159
1160
|
|
|
1160
1161
|
jest.doMock('child_process', () =>
|
|
1161
1162
|
buildMockChildProcessModule((args) =>
|
|
1162
|
-
args[0]
|
|
1163
|
+
pathIncludes(args[0] ?? '', 'next/dist/bin/next') ? { code: null, signal: 'SIGTERM' } : undefined,
|
|
1163
1164
|
),
|
|
1164
1165
|
)
|
|
1165
1166
|
|
|
@@ -2,6 +2,7 @@ import fs from 'node:fs'
|
|
|
2
2
|
import os from 'node:os'
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
import { createDevEnvReloader, resolveDevEnvFilePaths } from '../dev-env-reload'
|
|
5
|
+
import { normalizeTestPath } from './path-helpers'
|
|
5
6
|
|
|
6
7
|
describe('dev env reload helpers', () => {
|
|
7
8
|
let appDir: string
|
|
@@ -15,7 +16,7 @@ describe('dev env reload helpers', () => {
|
|
|
15
16
|
})
|
|
16
17
|
|
|
17
18
|
it('resolves app env files in low-to-high dev precedence order', () => {
|
|
18
|
-
expect(resolveDevEnvFilePaths('/tmp/app')).toEqual([
|
|
19
|
+
expect(resolveDevEnvFilePaths('/tmp/app').map(normalizeTestPath)).toEqual([
|
|
19
20
|
'/tmp/app/.env',
|
|
20
21
|
'/tmp/app/.env.development',
|
|
21
22
|
'/tmp/app/.env.local',
|
|
@@ -13,6 +13,7 @@ import fs from 'node:fs'
|
|
|
13
13
|
import os from 'node:os'
|
|
14
14
|
import path from 'node:path'
|
|
15
15
|
import type { ModuleEntry, PackageResolver } from '../../resolver'
|
|
16
|
+
import { normalizeTestPath } from '../../__tests__/path-helpers'
|
|
16
17
|
|
|
17
18
|
describe('db commands security', () => {
|
|
18
19
|
describe('sanitizeModuleId', () => {
|
|
@@ -189,7 +190,7 @@ describe('resolveGeneratedMigrationPath', () => {
|
|
|
189
190
|
'/repo/src/modules/example/migrations',
|
|
190
191
|
)
|
|
191
192
|
|
|
192
|
-
expect(result).toBe('/repo/src/modules/example/migrations/Migration20260506101927.ts')
|
|
193
|
+
expect(normalizeTestPath(result)).toBe('/repo/src/modules/example/migrations/Migration20260506101927.ts')
|
|
193
194
|
})
|
|
194
195
|
|
|
195
196
|
it('keeps absolute MikroORM results unchanged', () => {
|
|
@@ -156,7 +156,7 @@ describe('integration cache and options', () => {
|
|
|
156
156
|
} finally {
|
|
157
157
|
fetchSpy.mockRestore()
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, 60000)
|
|
160
160
|
|
|
161
161
|
it('reuses an existing environment with checkout wrapper injections only when explicitly enabled', async () => {
|
|
162
162
|
const baseUrl = 'http://127.0.0.1:5001'
|
|
@@ -184,7 +184,7 @@ describe('integration cache and options', () => {
|
|
|
184
184
|
} finally {
|
|
185
185
|
fetchSpy.mockRestore()
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, 60000)
|
|
188
188
|
|
|
189
189
|
it('reuses an existing environment when /login returns a redirect status other than 302', async () => {
|
|
190
190
|
const baseUrl = 'http://127.0.0.1:5001'
|
|
@@ -216,7 +216,7 @@ describe('integration cache and options', () => {
|
|
|
216
216
|
} finally {
|
|
217
217
|
fetchSpy.mockRestore()
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, 60000)
|
|
220
220
|
|
|
221
221
|
it('reuses an existing environment when /login returns healthy HTML without static asset references', async () => {
|
|
222
222
|
const baseUrl = 'http://127.0.0.1:5001'
|
|
@@ -251,7 +251,7 @@ describe('integration cache and options', () => {
|
|
|
251
251
|
} finally {
|
|
252
252
|
fetchSpy.mockRestore()
|
|
253
253
|
}
|
|
254
|
-
},
|
|
254
|
+
}, 60000)
|
|
255
255
|
|
|
256
256
|
it('falls back to rebuilding when the ephemeral environment state is unreachable', async () => {
|
|
257
257
|
const baseUrl = 'http://127.0.0.1:5001'
|