@friggframework/devtools 2.0.0--canary.666.81647c4.0 → 2.0.0--canary.668.8e53aa9.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.
Files changed (26) hide show
  1. package/frigg-cli/README.md +1 -38
  2. package/frigg-cli/__tests__/unit/commands/build.test.js +0 -3
  3. package/frigg-cli/__tests__/unit/commands/deploy.test.js +0 -3
  4. package/frigg-cli/build-command/index.js +0 -6
  5. package/frigg-cli/deploy-command/index.js +0 -6
  6. package/frigg-cli/index.js +1 -13
  7. package/frigg-cli/init-command/backend-first-handler.js +46 -25
  8. package/frigg-cli/start-command/index.js +0 -4
  9. package/frigg-cli/start-command/start-command.test.js +0 -3
  10. package/infrastructure/create-frigg-infrastructure.js +1 -4
  11. package/infrastructure/docs/POSTGRES-CONFIGURATION.md +98 -60
  12. package/package.json +7 -7
  13. package/frigg-cli/__tests__/unit/commands/validate-wiring.test.js +0 -92
  14. package/frigg-cli/validate-command/__tests__/init-validation.test.js +0 -63
  15. package/frigg-cli/validate-command/__tests__/integrations-checks.test.js +0 -133
  16. package/frigg-cli/validate-command/__tests__/validate-app-definition.test.js +0 -326
  17. package/frigg-cli/validate-command/__tests__/validate-command.test.js +0 -241
  18. package/frigg-cli/validate-command/checks/config.js +0 -468
  19. package/frigg-cli/validate-command/checks/integrations.js +0 -274
  20. package/frigg-cli/validate-command/format-report.js +0 -58
  21. package/frigg-cli/validate-command/index.js +0 -107
  22. package/frigg-cli/validate-command/load-app-definition.js +0 -93
  23. package/frigg-cli/validate-command/schema-issues.js +0 -154
  24. package/frigg-cli/validate-command/validate-app-definition.js +0 -60
  25. package/infrastructure/app-definition-schema-contract.test.js +0 -607
  26. package/infrastructure/create-frigg-infrastructure.test.js +0 -51
@@ -1,51 +0,0 @@
1
- const fs = require('fs');
2
- const os = require('os');
3
- const path = require('path');
4
-
5
- jest.mock('@friggframework/core', () => ({
6
- findNearestBackendPackageJson: jest.fn(),
7
- }));
8
- jest.mock('./infrastructure-composer', () => ({
9
- composeServerlessDefinition: jest.fn(async () => ({ service: 'composed' })),
10
- }));
11
-
12
- const { findNearestBackendPackageJson } = require('@friggframework/core');
13
- const { composeServerlessDefinition } = require('./infrastructure-composer');
14
- const { createFriggInfrastructure } = require('./create-frigg-infrastructure');
15
-
16
- describe('createFriggInfrastructure', () => {
17
- let dir;
18
-
19
- beforeEach(() => {
20
- dir = fs.mkdtempSync(path.join(os.tmpdir(), 'frigg-infra-'));
21
- fs.writeFileSync(path.join(dir, 'package.json'), '{"name":"backend"}');
22
- fs.writeFileSync(
23
- path.join(dir, 'index.js'),
24
- `class Acme { static Definition = { name: 'acme' }; }
25
- module.exports = { Definition: { name: 'app', integrations: [Acme], user: { usePassword: true } } };`
26
- );
27
- findNearestBackendPackageJson.mockReturnValue(
28
- path.join(dir, 'package.json')
29
- );
30
- jest.spyOn(console, 'log').mockImplementation(() => {});
31
- });
32
-
33
- afterEach(() => {
34
- fs.rmSync(dir, { recursive: true, force: true });
35
- jest.restoreAllMocks();
36
- });
37
-
38
- it('composes the definition with the schema defaults applied (ADR-051)', async () => {
39
- await createFriggInfrastructure();
40
-
41
- const [definition] = composeServerlessDefinition.mock.calls[0];
42
- expect(definition.user).toEqual(
43
- expect.objectContaining({
44
- usePassword: true,
45
- individualUserRequired: true,
46
- })
47
- );
48
- expect(definition.integrations[0].Definition.name).toBe('acme');
49
- expect(typeof definition.integrations[0]).toBe('function');
50
- });
51
- });