@friggframework/devtools 2.0.0--canary.454.25d396a.0 → 2.0.0--canary.463.62579dd.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/frigg-cli/__tests__/unit/commands/db-setup.test.js +1 -1
- package/frigg-cli/__tests__/unit/utils/prisma-runner.test.js +486 -0
- package/frigg-cli/db-setup-command/index.js +1 -1
- package/frigg-cli/utils/prisma-runner.js +280 -0
- package/infrastructure/README.md +0 -51
- package/infrastructure/aws-discovery.js +2 -504
- package/infrastructure/aws-discovery.test.js +1 -447
- package/infrastructure/serverless-template.js +80 -465
- package/infrastructure/serverless-template.test.js +0 -91
- package/package.json +6 -8
- package/infrastructure/POSTGRES-CONFIGURATION.md +0 -630
- package/infrastructure/__tests__/postgres-config.test.js +0 -914
- package/infrastructure/scripts/build-prisma-layer.js +0 -394
|
@@ -1762,97 +1762,6 @@ describe('composeServerlessDefinition', () => {
|
|
|
1762
1762
|
});
|
|
1763
1763
|
});
|
|
1764
1764
|
|
|
1765
|
-
describe('Database Migration Lambda', () => {
|
|
1766
|
-
it('should include dbMigrate function in all deployments', async () => {
|
|
1767
|
-
const appDefinition = {
|
|
1768
|
-
name: 'test-app',
|
|
1769
|
-
integrations: []
|
|
1770
|
-
};
|
|
1771
|
-
|
|
1772
|
-
const result = await composeServerlessDefinition(appDefinition);
|
|
1773
|
-
|
|
1774
|
-
// Check dbMigrate function exists
|
|
1775
|
-
expect(result.functions.dbMigrate).toBeDefined();
|
|
1776
|
-
expect(result.functions.dbMigrate.handler).toBe(
|
|
1777
|
-
'node_modules/@friggframework/core/handlers/workers/db-migration.handler'
|
|
1778
|
-
);
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
|
-
it('should configure dbMigrate with correct settings', async () => {
|
|
1782
|
-
const appDefinition = {
|
|
1783
|
-
integrations: []
|
|
1784
|
-
};
|
|
1785
|
-
|
|
1786
|
-
const result = await composeServerlessDefinition(appDefinition);
|
|
1787
|
-
|
|
1788
|
-
const dbMigrate = result.functions.dbMigrate;
|
|
1789
|
-
|
|
1790
|
-
// Check timeout (5 minutes for long migrations)
|
|
1791
|
-
expect(dbMigrate.timeout).toBe(300);
|
|
1792
|
-
|
|
1793
|
-
// Check memory allocation (extra for Prisma CLI)
|
|
1794
|
-
expect(dbMigrate.memorySize).toBe(512);
|
|
1795
|
-
|
|
1796
|
-
// Check description
|
|
1797
|
-
expect(dbMigrate.description).toContain('database migrations');
|
|
1798
|
-
expect(dbMigrate.description).toContain('Prisma');
|
|
1799
|
-
});
|
|
1800
|
-
|
|
1801
|
-
it('should not have HTTP events (manual invocation only)', async () => {
|
|
1802
|
-
const appDefinition = {
|
|
1803
|
-
integrations: []
|
|
1804
|
-
};
|
|
1805
|
-
|
|
1806
|
-
const result = await composeServerlessDefinition(appDefinition);
|
|
1807
|
-
|
|
1808
|
-
const dbMigrate = result.functions.dbMigrate;
|
|
1809
|
-
|
|
1810
|
-
// Should have no events (manually invoked via AWS CLI)
|
|
1811
|
-
expect(dbMigrate.events).toBeUndefined();
|
|
1812
|
-
});
|
|
1813
|
-
|
|
1814
|
-
it('should include dbMigrate even with VPC enabled', async () => {
|
|
1815
|
-
const appDefinition = {
|
|
1816
|
-
vpc: {
|
|
1817
|
-
enable: true,
|
|
1818
|
-
management: 'discover'
|
|
1819
|
-
},
|
|
1820
|
-
integrations: []
|
|
1821
|
-
};
|
|
1822
|
-
|
|
1823
|
-
const result = await composeServerlessDefinition(appDefinition);
|
|
1824
|
-
|
|
1825
|
-
// dbMigrate should exist with VPC configuration
|
|
1826
|
-
expect(result.functions.dbMigrate).toBeDefined();
|
|
1827
|
-
|
|
1828
|
-
// Should have same VPC access as other functions
|
|
1829
|
-
expect(result.provider.vpc).toBeDefined();
|
|
1830
|
-
});
|
|
1831
|
-
|
|
1832
|
-
it('should include dbMigrate with database configuration', async () => {
|
|
1833
|
-
const appDefinition = {
|
|
1834
|
-
vpc: {
|
|
1835
|
-
enable: true,
|
|
1836
|
-
management: 'discover'
|
|
1837
|
-
},
|
|
1838
|
-
database: {
|
|
1839
|
-
postgres: {
|
|
1840
|
-
enable: true,
|
|
1841
|
-
management: 'discover'
|
|
1842
|
-
}
|
|
1843
|
-
},
|
|
1844
|
-
integrations: []
|
|
1845
|
-
};
|
|
1846
|
-
|
|
1847
|
-
const result = await composeServerlessDefinition(appDefinition);
|
|
1848
|
-
|
|
1849
|
-
// dbMigrate should exist alongside database configuration
|
|
1850
|
-
expect(result.functions.dbMigrate).toBeDefined();
|
|
1851
|
-
expect(result.provider.environment.DB_TYPE).toBe('postgresql');
|
|
1852
|
-
expect(result.provider.environment.DATABASE_URL).toBeDefined();
|
|
1853
|
-
});
|
|
1854
|
-
});
|
|
1855
|
-
|
|
1856
1765
|
describe('Edge Cases', () => {
|
|
1857
1766
|
it('should handle empty app definition', async () => {
|
|
1858
1767
|
const appDefinition = {};
|
package/package.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.463.62579dd.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-ec2": "^3.835.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.835.0",
|
|
8
|
-
"@aws-sdk/client-rds": "^3.906.0",
|
|
9
|
-
"@aws-sdk/client-secrets-manager": "^3.906.0",
|
|
10
8
|
"@aws-sdk/client-sts": "^3.835.0",
|
|
11
9
|
"@babel/eslint-parser": "^7.18.9",
|
|
12
10
|
"@babel/parser": "^7.25.3",
|
|
13
11
|
"@babel/traverse": "^7.25.3",
|
|
14
|
-
"@friggframework/schemas": "2.0.0--canary.
|
|
15
|
-
"@friggframework/test": "2.0.0--canary.
|
|
12
|
+
"@friggframework/schemas": "2.0.0--canary.463.62579dd.0",
|
|
13
|
+
"@friggframework/test": "2.0.0--canary.463.62579dd.0",
|
|
16
14
|
"@hapi/boom": "^10.0.1",
|
|
17
15
|
"@inquirer/prompts": "^5.3.8",
|
|
18
16
|
"axios": "^1.7.2",
|
|
@@ -34,8 +32,8 @@
|
|
|
34
32
|
"serverless-http": "^2.7.0"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
38
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
35
|
+
"@friggframework/eslint-config": "2.0.0--canary.463.62579dd.0",
|
|
36
|
+
"@friggframework/prettier-config": "2.0.0--canary.463.62579dd.0",
|
|
39
37
|
"aws-sdk-client-mock": "^4.1.0",
|
|
40
38
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
41
39
|
"jest": "^30.1.3",
|
|
@@ -70,5 +68,5 @@
|
|
|
70
68
|
"publishConfig": {
|
|
71
69
|
"access": "public"
|
|
72
70
|
},
|
|
73
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "62579dd537cdc5d96c3d36e2441e56778c3a160a"
|
|
74
72
|
}
|