@friggframework/devtools 2.0.0--canary.731.1c0b281.0 → 2.0.0--canary.730.541f199.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/infrastructure/README.md +0 -27
- package/infrastructure/__tests__/management-api-gateway-routes.test.js +0 -3
- package/infrastructure/__tests__/postgres-config.test.js +0 -3
- package/infrastructure/__tests__/scaffold-default-infrastructure.test.js +0 -3
- package/infrastructure/__tests__/scoped-environment.test.js +0 -3
- package/infrastructure/__tests__/ssm-preload-node-options.test.js +0 -3
- package/infrastructure/__tests__/template-generation.test.js +0 -3
- package/infrastructure/app-definition-schema-contract.test.js +0 -5
- package/infrastructure/domains/admin-scripts/admin-script-builder.js +0 -2
- package/infrastructure/domains/admin-scripts/admin-script-builder.test.js +0 -16
- package/infrastructure/domains/database/migration-builder.js +2 -21
- package/infrastructure/domains/database/migration-builder.test.js +0 -55
- package/infrastructure/domains/integration/integration-builder.js +0 -2
- package/infrastructure/domains/integration/integration-builder.test.js +0 -16
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +1 -13
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +0 -47
- package/infrastructure/domains/shared/utilities/prisma-layer-manager.js +12 -92
- package/infrastructure/domains/shared/utilities/prisma-layer-manager.test.js +6 -158
- package/infrastructure/infrastructure-composer.js +1 -12
- package/infrastructure/infrastructure-composer.test.js +0 -71
- package/infrastructure/scripts/build-prisma-layer.js +50 -136
- package/infrastructure/scripts/build-prisma-layer.test.js +0 -100
- package/package.json +7 -7
- package/infrastructure/__tests__/helpers/bundled-prisma-engine-excludes.js +0 -39
- package/infrastructure/domains/database/migration-engines.js +0 -93
- package/infrastructure/domains/database/migration-engines.test.js +0 -142
- package/infrastructure/domains/shared/lambda-architectures.js +0 -113
- package/infrastructure/domains/shared/lambda-architectures.test.js +0 -164
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
const micromatch = require('micromatch');
|
|
2
|
-
const {
|
|
3
|
-
LAMBDA_ARCHITECTURES,
|
|
4
|
-
resolveLambdaArchitecture,
|
|
5
|
-
prismaEngineFileNames,
|
|
6
|
-
foreignPrismaEngineExcludes,
|
|
7
|
-
bundledPrismaEngineExcludes,
|
|
8
|
-
} = require('./lambda-architectures');
|
|
9
|
-
|
|
10
|
-
describe('resolveLambdaArchitecture()', () => {
|
|
11
|
-
it('resolves to x86_64 with the rhel engine when the key is unset', () => {
|
|
12
|
-
expect(resolveLambdaArchitecture({})).toEqual({
|
|
13
|
-
name: 'x86_64',
|
|
14
|
-
prismaBinaryTarget: 'rhel-openssl-3.0.x',
|
|
15
|
-
explicit: false,
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('resolves an explicit x86_64', () => {
|
|
20
|
-
expect(resolveLambdaArchitecture({ architecture: 'x86_64' })).toEqual({
|
|
21
|
-
name: 'x86_64',
|
|
22
|
-
prismaBinaryTarget: 'rhel-openssl-3.0.x',
|
|
23
|
-
explicit: true,
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('resolves arm64 to the linux-arm64 engine', () => {
|
|
28
|
-
expect(resolveLambdaArchitecture({ architecture: 'arm64' })).toEqual({
|
|
29
|
-
name: 'arm64',
|
|
30
|
-
prismaBinaryTarget: 'linux-arm64-openssl-3.0.x',
|
|
31
|
-
explicit: true,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('throws on an unknown architecture, naming the accepted ones', () => {
|
|
36
|
-
expect(() =>
|
|
37
|
-
resolveLambdaArchitecture({ architecture: 'aarch64' })
|
|
38
|
-
).toThrow(/aarch64.*x86_64.*arm64/);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('uses the AWS architecture names as registry keys', () => {
|
|
42
|
-
expect(Object.keys(LAMBDA_ARCHITECTURES)).toEqual(['x86_64', 'arm64']);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe('prismaEngineFileNames()', () => {
|
|
47
|
-
it('names the schema engine and the query engine library the migrate CLI needs for a target', () => {
|
|
48
|
-
expect(prismaEngineFileNames('linux-arm64-openssl-3.0.x')).toEqual({
|
|
49
|
-
schemaEngine: 'schema-engine-linux-arm64-openssl-3.0.x',
|
|
50
|
-
queryEngineLibrary: 'libquery_engine-linux-arm64-openssl-3.0.x.so.node',
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
describe('foreignPrismaEngineExcludes()', () => {
|
|
56
|
-
const matches = (name, filePath) =>
|
|
57
|
-
micromatch([filePath], foreignPrismaEngineExcludes(name), {
|
|
58
|
-
dot: true,
|
|
59
|
-
}).length > 0;
|
|
60
|
-
|
|
61
|
-
const foreignEngineFiles = {
|
|
62
|
-
x86_64: [
|
|
63
|
-
'node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node',
|
|
64
|
-
'node_modules/@prisma/engines/schema-engine-darwin-arm64',
|
|
65
|
-
'node_modules/.prisma/client/query_engine-windows.dll.node',
|
|
66
|
-
'node_modules/@prisma/engines/query-engine-debian-openssl-3.0.x',
|
|
67
|
-
'node_modules/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node',
|
|
68
|
-
'node_modules/@prisma/engines/libquery_engine-linux-musl-openssl-3.0.x.so.node',
|
|
69
|
-
'node_modules/@prisma/engines/schema-engine-linux-arm64-openssl-3.0.x',
|
|
70
|
-
'node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-3.0.x.so.node',
|
|
71
|
-
],
|
|
72
|
-
arm64: [
|
|
73
|
-
'node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node',
|
|
74
|
-
'node_modules/.prisma/client/query_engine-windows.dll.node',
|
|
75
|
-
'node_modules/@prisma/engines/libquery_engine-linux-musl-openssl-3.0.x.so.node',
|
|
76
|
-
'node_modules/@prisma/engines/schema-engine-rhel-openssl-3.0.x',
|
|
77
|
-
'node_modules/@prisma/engines/libquery_engine-rhel-openssl-3.0.x.so.node',
|
|
78
|
-
],
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const targetEngineFiles = {
|
|
82
|
-
x86_64: [
|
|
83
|
-
'node_modules/@prisma/engines/schema-engine-rhel-openssl-3.0.x',
|
|
84
|
-
'node_modules/@prisma/engines/libquery_engine-rhel-openssl-3.0.x.so.node',
|
|
85
|
-
],
|
|
86
|
-
arm64: [
|
|
87
|
-
'node_modules/@prisma/engines/schema-engine-linux-arm64-openssl-3.0.x',
|
|
88
|
-
'node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-3.0.x.so.node',
|
|
89
|
-
],
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const nonEngineFiles = [
|
|
93
|
-
'node_modules/is-windows/index.js',
|
|
94
|
-
'node_modules/is-windows/package.json',
|
|
95
|
-
'node_modules/darwin-utils/lib/index.js',
|
|
96
|
-
'node_modules/some-pkg/lib/debian-release.js',
|
|
97
|
-
'node_modules/some-pkg/linux-musl-detect.js',
|
|
98
|
-
'node_modules/@prisma/engines/query_engine_bg.wasm',
|
|
99
|
-
'node_modules/.prisma/client/query_engine_bg.js',
|
|
100
|
-
'node_modules/some-pkg/dist/linux-arm64-notes.js',
|
|
101
|
-
'src/handlers/windows-handler.js',
|
|
102
|
-
];
|
|
103
|
-
|
|
104
|
-
it.each(['x86_64', 'arm64'])(
|
|
105
|
-
'matches every foreign engine file for %s',
|
|
106
|
-
(name) => {
|
|
107
|
-
foreignEngineFiles[name].forEach((file) =>
|
|
108
|
-
expect({ name, file, hit: matches(name, file) }).toEqual({
|
|
109
|
-
name,
|
|
110
|
-
file,
|
|
111
|
-
hit: true,
|
|
112
|
-
})
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
it.each(['x86_64', 'arm64'])(
|
|
118
|
-
'keeps the engine files of the %s target',
|
|
119
|
-
(name) => {
|
|
120
|
-
targetEngineFiles[name].forEach((file) =>
|
|
121
|
-
expect({ file, hit: matches(name, file) }).toEqual({
|
|
122
|
-
file,
|
|
123
|
-
hit: false,
|
|
124
|
-
})
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
it.each(['x86_64', 'arm64'])(
|
|
130
|
-
'keeps runtime files that only share a platform word with an engine for %s',
|
|
131
|
-
(name) => {
|
|
132
|
-
nonEngineFiles.forEach((file) =>
|
|
133
|
-
expect({ file, hit: matches(name, file) }).toEqual({
|
|
134
|
-
file,
|
|
135
|
-
hit: false,
|
|
136
|
-
})
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
it('never uses negation', () => {
|
|
142
|
-
['x86_64', 'arm64'].forEach((name) =>
|
|
143
|
-
foreignPrismaEngineExcludes(name).forEach((pattern) =>
|
|
144
|
-
expect(pattern.startsWith('!')).toBe(false)
|
|
145
|
-
)
|
|
146
|
-
);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
describe('bundledPrismaEngineExcludes()', () => {
|
|
151
|
-
it('adds nothing when the Prisma layer carries the engines', () => {
|
|
152
|
-
expect(bundledPrismaEngineExcludes({ architecture: 'arm64' }, true)).toEqual([]);
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
it.each([
|
|
156
|
-
[{}, 'x86_64'],
|
|
157
|
-
[{ architecture: 'x86_64' }, 'x86_64'],
|
|
158
|
-
[{ architecture: 'arm64' }, 'arm64'],
|
|
159
|
-
])('with the layer off, excludes the engines %j does not load', (appDefinition, name) => {
|
|
160
|
-
expect(bundledPrismaEngineExcludes(appDefinition, false)).toEqual(
|
|
161
|
-
foreignPrismaEngineExcludes(name)
|
|
162
|
-
);
|
|
163
|
-
});
|
|
164
|
-
});
|