@friggframework/devtools 2.0.0-next.53 → 2.0.0-next.54
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/frigg-cli/README.md +13 -14
- package/frigg-cli/__tests__/unit/commands/db-setup.test.js +267 -166
- package/frigg-cli/__tests__/unit/utils/database-validator.test.js +45 -14
- package/frigg-cli/__tests__/unit/utils/error-messages.test.js +44 -3
- package/frigg-cli/db-setup-command/index.js +75 -22
- package/frigg-cli/deploy-command/index.js +6 -3
- package/frigg-cli/utils/database-validator.js +18 -5
- package/frigg-cli/utils/error-messages.js +84 -12
- package/infrastructure/README.md +28 -0
- package/infrastructure/domains/database/migration-builder.js +26 -20
- package/infrastructure/domains/database/migration-builder.test.js +27 -0
- package/infrastructure/domains/integration/integration-builder.js +17 -13
- package/infrastructure/domains/integration/integration-builder.test.js +23 -0
- package/infrastructure/domains/networking/vpc-builder.js +240 -18
- package/infrastructure/domains/networking/vpc-builder.test.js +711 -13
- package/infrastructure/domains/networking/vpc-resolver.js +221 -40
- package/infrastructure/domains/networking/vpc-resolver.test.js +318 -18
- package/infrastructure/domains/security/kms-builder.js +55 -6
- package/infrastructure/domains/security/kms-builder.test.js +19 -1
- package/infrastructure/domains/shared/cloudformation-discovery.js +310 -13
- package/infrastructure/domains/shared/cloudformation-discovery.test.js +395 -0
- package/infrastructure/domains/shared/providers/aws-provider-adapter.js +41 -6
- package/infrastructure/domains/shared/providers/aws-provider-adapter.test.js +39 -0
- package/infrastructure/domains/shared/resource-discovery.js +17 -5
- package/infrastructure/domains/shared/resource-discovery.test.js +36 -0
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +30 -20
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +43 -0
- package/infrastructure/infrastructure-composer.js +11 -3
- package/infrastructure/scripts/build-prisma-layer.js +153 -78
- package/infrastructure/scripts/build-prisma-layer.test.js +27 -11
- package/layers/prisma/.build-complete +3 -0
- package/package.json +7 -7
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Validates database client selection logic
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const {
|
|
7
7
|
getGeneratedClientPackages,
|
|
8
8
|
getMigrationsPackages,
|
|
9
9
|
getMigrationSourcePath,
|
|
10
|
-
getMigrationDestinationPath
|
|
10
|
+
getMigrationDestinationPath,
|
|
11
11
|
} = require('./build-prisma-layer');
|
|
12
12
|
|
|
13
13
|
// Mock the log function
|
|
@@ -109,12 +109,18 @@ describe('getGeneratedClientPackages()', () => {
|
|
|
109
109
|
|
|
110
110
|
describe('getMigrationsPackages()', () => {
|
|
111
111
|
it('should extract database types from client packages', () => {
|
|
112
|
-
const clientPackages = [
|
|
112
|
+
const clientPackages = [
|
|
113
|
+
'generated/prisma-postgresql',
|
|
114
|
+
'generated/prisma-mongodb',
|
|
115
|
+
];
|
|
113
116
|
const migrations = getMigrationsPackages(clientPackages);
|
|
114
117
|
|
|
115
118
|
expect(migrations).toEqual([
|
|
116
|
-
{
|
|
117
|
-
|
|
119
|
+
{
|
|
120
|
+
dbType: 'postgresql',
|
|
121
|
+
clientPackage: 'generated/prisma-postgresql',
|
|
122
|
+
},
|
|
123
|
+
{ dbType: 'mongodb', clientPackage: 'generated/prisma-mongodb' },
|
|
118
124
|
]);
|
|
119
125
|
});
|
|
120
126
|
|
|
@@ -123,7 +129,10 @@ describe('getMigrationsPackages()', () => {
|
|
|
123
129
|
const migrations = getMigrationsPackages(clientPackages);
|
|
124
130
|
|
|
125
131
|
expect(migrations).toEqual([
|
|
126
|
-
{
|
|
132
|
+
{
|
|
133
|
+
dbType: 'postgresql',
|
|
134
|
+
clientPackage: 'generated/prisma-postgresql',
|
|
135
|
+
},
|
|
127
136
|
]);
|
|
128
137
|
});
|
|
129
138
|
|
|
@@ -137,9 +146,11 @@ describe('getMigrationSourcePath()', () => {
|
|
|
137
146
|
it('should return correct source path for database type', () => {
|
|
138
147
|
const searchPaths = ['/workspace/packages/core'];
|
|
139
148
|
const dbType = 'postgresql';
|
|
140
|
-
|
|
149
|
+
|
|
141
150
|
const sourcePath = getMigrationSourcePath(searchPaths, dbType);
|
|
142
|
-
expect(sourcePath).toBe(
|
|
151
|
+
expect(sourcePath).toBe(
|
|
152
|
+
'/workspace/packages/core/prisma-postgresql/migrations'
|
|
153
|
+
);
|
|
143
154
|
});
|
|
144
155
|
});
|
|
145
156
|
|
|
@@ -147,8 +158,13 @@ describe('getMigrationDestinationPath()', () => {
|
|
|
147
158
|
it('should return correct destination path for client package', () => {
|
|
148
159
|
const layerNodeModules = '/layers/prisma/nodejs/node_modules';
|
|
149
160
|
const clientPackage = 'generated/prisma-postgresql';
|
|
150
|
-
|
|
151
|
-
const destPath = getMigrationDestinationPath(
|
|
152
|
-
|
|
161
|
+
|
|
162
|
+
const destPath = getMigrationDestinationPath(
|
|
163
|
+
layerNodeModules,
|
|
164
|
+
clientPackage
|
|
165
|
+
);
|
|
166
|
+
expect(destPath).toBe(
|
|
167
|
+
'/layers/prisma/nodejs/node_modules/generated/prisma-postgresql/migrations'
|
|
168
|
+
);
|
|
153
169
|
});
|
|
154
170
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0-next.
|
|
4
|
+
"version": "2.0.0-next.54",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@babel/eslint-parser": "^7.18.9",
|
|
17
17
|
"@babel/parser": "^7.25.3",
|
|
18
18
|
"@babel/traverse": "^7.25.3",
|
|
19
|
-
"@friggframework/core": "2.0.0-next.
|
|
20
|
-
"@friggframework/schemas": "2.0.0-next.
|
|
21
|
-
"@friggframework/test": "2.0.0-next.
|
|
19
|
+
"@friggframework/core": "2.0.0-next.54",
|
|
20
|
+
"@friggframework/schemas": "2.0.0-next.54",
|
|
21
|
+
"@friggframework/test": "2.0.0-next.54",
|
|
22
22
|
"@hapi/boom": "^10.0.1",
|
|
23
23
|
"@inquirer/prompts": "^5.3.8",
|
|
24
24
|
"axios": "^1.7.2",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"validate-npm-package-name": "^5.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@friggframework/eslint-config": "2.0.0-next.
|
|
50
|
-
"@friggframework/prettier-config": "2.0.0-next.
|
|
49
|
+
"@friggframework/eslint-config": "2.0.0-next.54",
|
|
50
|
+
"@friggframework/prettier-config": "2.0.0-next.54",
|
|
51
51
|
"aws-sdk-client-mock": "^4.1.0",
|
|
52
52
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
53
53
|
"jest": "^30.1.3",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "d72f0af6966a5701fe2a4257139d40292972f92a"
|
|
83
83
|
}
|