@friggframework/devtools 2.0.0--canary.704.79d9a63.0 → 2.0.0--canary.680.daae24e.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/README.md +0 -14
- package/frigg-cli/README.md +0 -6
- package/frigg-cli/__tests__/unit/dependencies.test.js +5 -3
- package/frigg-cli/index.js +0 -3
- package/frigg-cli/package.json +3 -3
- package/infrastructure/README.md +4 -22
- package/infrastructure/__tests__/management-api-gateway-routes.test.js +335 -0
- package/infrastructure/domains/admin-scripts/admin-script-builder.js +48 -56
- package/infrastructure/domains/admin-scripts/admin-script-builder.test.js +7 -76
- package/infrastructure/domains/database/migration-builder.js +175 -182
- package/infrastructure/domains/database/migration-builder.test.js +5 -36
- package/infrastructure/domains/integration/integration-builder.js +61 -65
- package/infrastructure/domains/integration/integration-builder.test.js +8 -73
- package/infrastructure/domains/parameters/offload-utils.js +1 -0
- package/infrastructure/domains/shared/environment-builder.js +12 -1
- package/infrastructure/domains/shared/environment-builder.test.js +20 -0
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +148 -86
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +87 -96
- package/infrastructure/domains/shared/utilities/logging-config.js +4 -3
- package/infrastructure/domains/shared/utilities/logging-config.test.js +2 -1
- package/infrastructure/infrastructure-composer.test.js +3 -3
- package/package.json +8 -11
- package/frigg-cli/__tests__/unit/utils/node-version.test.js +0 -66
- package/frigg-cli/utils/node-version.js +0 -51
- package/infrastructure/__tests__/package-patterns-composition.test.js +0 -153
- package/infrastructure/domains/shared/utilities/framework-version.js +0 -14
- package/infrastructure/domains/shared/utilities/framework-version.test.js +0 -27
- package/infrastructure/domains/shared/utilities/package-patterns.js +0 -35
- package/infrastructure/domains/shared/utilities/package-patterns.test.js +0 -112
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const { OSLS_FRAMEWORK_VERSION } = require('./framework-version');
|
|
2
|
-
const semver = require('semver');
|
|
3
|
-
|
|
4
|
-
describe('OSLS_FRAMEWORK_VERSION (ADR-050)', () => {
|
|
5
|
-
it('is the osls 4 range Frigg targets', () => {
|
|
6
|
-
expect(OSLS_FRAMEWORK_VERSION).toBe('^4.4.0');
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it.each([
|
|
10
|
-
['4.4.0', true],
|
|
11
|
-
['4.9.1', true],
|
|
12
|
-
['4.3.9', false],
|
|
13
|
-
['3.78.0', false],
|
|
14
|
-
['5.0.0', false],
|
|
15
|
-
])('osls %s satisfies it: %s', (version, expected) => {
|
|
16
|
-
// osls compares frameworkVersion with semver.satisfies and fails
|
|
17
|
-
// with FRAMEWORK_VERSION_MISMATCH otherwise.
|
|
18
|
-
expect(semver.satisfies(version, OSLS_FRAMEWORK_VERSION)).toBe(expected);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('matches the osls range devtools and frigg-cli depend on', () => {
|
|
22
|
-
const devtools = require('../../../../package.json');
|
|
23
|
-
const cli = require('../../../../frigg-cli/package.json');
|
|
24
|
-
expect(devtools.devDependencies.osls).toBe(OSLS_FRAMEWORK_VERSION);
|
|
25
|
-
expect(cli.dependencies.osls).toBe(OSLS_FRAMEWORK_VERSION);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Function package patterns
|
|
3
|
-
*
|
|
4
|
-
* Utility Layer - Hexagonal Architecture
|
|
5
|
-
*
|
|
6
|
-
* osls 4 rejects `package.include` / `package.exclude` and only reads
|
|
7
|
-
* `package.patterns` (ADR-050). Builders keep their include and exclude lists
|
|
8
|
-
* and pass them through this helper, so one place owns the negation.
|
|
9
|
-
*
|
|
10
|
-
* osls resolves a function's files with `resolveFilePathsFromPatterns`: an
|
|
11
|
-
* ordered list evaluated last-match-wins. On osls 3 a function `exclude` was
|
|
12
|
-
* placed (negated) ahead of the function `include`. Frigg emits no
|
|
13
|
-
* service-level include, exclude or patterns, so `[!exclude..., include...]`
|
|
14
|
-
* reproduces the osls 3 order exactly, and is valid on osls 3 and osls 4.
|
|
15
|
-
*
|
|
16
|
-
* An exclude that already starts with `!` was treated by osls 3 as an include
|
|
17
|
-
* in exclude position; it is emitted un-negated in the same position here.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @param {Object} [lists]
|
|
22
|
-
* @param {string[]} [lists.include] - Globs to (re-)add after the excludes
|
|
23
|
-
* @param {string[]} [lists.exclude] - Globs to remove
|
|
24
|
-
* @returns {string[]} Value for `package.patterns`
|
|
25
|
-
*/
|
|
26
|
-
function toPackagePatterns({ include = [], exclude = [] } = {}) {
|
|
27
|
-
return [
|
|
28
|
-
...exclude.map((pattern) =>
|
|
29
|
-
pattern.startsWith('!') ? pattern.slice(1) : `!${pattern}`
|
|
30
|
-
),
|
|
31
|
-
...include,
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = { toPackagePatterns };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for the function package patterns helper (ADR-050)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const { toPackagePatterns } = require('./package-patterns');
|
|
6
|
-
const { nestedNodeModulesExcludes } = require('./nested-node-modules');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The ordered list osls 3 built in resolveFilePathsFromPatterns for a function
|
|
10
|
-
* that set `package.include` / `package.exclude` (no service-level patterns,
|
|
11
|
-
* which Frigg never emits, and before the dev-dependency patterns that both
|
|
12
|
-
* versions append identically).
|
|
13
|
-
*/
|
|
14
|
-
function osls3FunctionOrder({ include = [], exclude = [] }) {
|
|
15
|
-
const patterns = [];
|
|
16
|
-
exclude.forEach((p) => patterns.push(p.charAt(0) !== '!' ? `!${p}` : p.substring(1)));
|
|
17
|
-
include.forEach((p) => patterns.push(p));
|
|
18
|
-
return patterns;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The ordered list osls 3 and osls 4 build for a function that sets
|
|
23
|
-
* `package.patterns`: the patterns go in include position, unchanged.
|
|
24
|
-
*/
|
|
25
|
-
function patternsFunctionOrder(patterns) {
|
|
26
|
-
return [...patterns];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
describe('toPackagePatterns', () => {
|
|
30
|
-
const cases = [
|
|
31
|
-
{
|
|
32
|
-
name: 'excludes first (negated), then includes',
|
|
33
|
-
lists: {
|
|
34
|
-
include: ['ca.pem'],
|
|
35
|
-
exclude: ['node_modules/aws-sdk/**', '.env'],
|
|
36
|
-
},
|
|
37
|
-
expected: ['!node_modules/aws-sdk/**', '!.env', 'ca.pem'],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'an exclude that already starts with ! becomes an include in exclude position',
|
|
41
|
-
lists: {
|
|
42
|
-
include: [],
|
|
43
|
-
exclude: ['node_modules/**', '!node_modules/keep/**'],
|
|
44
|
-
},
|
|
45
|
-
expected: ['!node_modules/**', 'node_modules/keep/**'],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'an include re-adds a path that an exclude removed',
|
|
49
|
-
lists: {
|
|
50
|
-
include: ['config/ca.pem'],
|
|
51
|
-
exclude: ['config/**'],
|
|
52
|
-
},
|
|
53
|
-
expected: ['!config/**', 'config/ca.pem'],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'empty lists',
|
|
57
|
-
lists: { include: [], exclude: [] },
|
|
58
|
-
expected: [],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'only excludes',
|
|
62
|
-
lists: { exclude: ['test/**'] },
|
|
63
|
-
expected: ['!test/**'],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'only includes',
|
|
67
|
-
lists: { include: ['ca.pem'] },
|
|
68
|
-
expected: ['ca.pem'],
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
it.each(cases)('$name', ({ lists, expected }) => {
|
|
73
|
-
const patterns = toPackagePatterns(lists);
|
|
74
|
-
expect(patterns).toEqual(expected);
|
|
75
|
-
// Same evaluation order osls 3 applied to include/exclude.
|
|
76
|
-
expect(patternsFunctionOrder(patterns)).toEqual(osls3FunctionOrder(lists));
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('returns an empty list when called with no arguments', () => {
|
|
80
|
-
expect(toPackagePatterns()).toEqual([]);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('does not mutate its inputs', () => {
|
|
84
|
-
const exclude = ['a/**'];
|
|
85
|
-
const include = ['b'];
|
|
86
|
-
toPackagePatterns({ include, exclude });
|
|
87
|
-
expect(exclude).toEqual(['a/**']);
|
|
88
|
-
expect(include).toEqual(['b']);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
describe('with nestedNodeModulesExcludes output', () => {
|
|
92
|
-
it('negates the single catch-all glob by default', () => {
|
|
93
|
-
const exclude = nestedNodeModulesExcludes({}, true);
|
|
94
|
-
expect(toPackagePatterns({ exclude })).toEqual([
|
|
95
|
-
'!node_modules/**/node_modules/**',
|
|
96
|
-
]);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('negates every scoped glob when keepNestedNodeModules is set', () => {
|
|
100
|
-
const appDefinition = { lambda: { keepNestedNodeModules: true } };
|
|
101
|
-
const exclude = nestedNodeModulesExcludes(appDefinition, true);
|
|
102
|
-
const patterns = toPackagePatterns({ exclude });
|
|
103
|
-
|
|
104
|
-
expect(patterns).toEqual(exclude.map((p) => `!${p}`));
|
|
105
|
-
expect(patterns).toContain('!node_modules/**/node_modules/@friggframework/**');
|
|
106
|
-
expect(patterns).not.toContain('!node_modules/**/node_modules/**');
|
|
107
|
-
expect(patternsFunctionOrder(patterns)).toEqual(
|
|
108
|
-
osls3FunctionOrder({ exclude })
|
|
109
|
-
);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|