@genesislcap/build-kit 14.162.4 → 14.162.5
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/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/prompts.js +2 -2
- package/dist/utils/seed.commands.d.ts +19 -0
- package/dist/utils/seed.commands.d.ts.map +1 -0
- package/dist/utils/seed.commands.js +58 -0
- package/dist/utils/seed.processing.d.ts.map +1 -1
- package/dist/utils/seed.processing.js +4 -3
- package/package.json +3 -3
- package/src/index.ts +0 -2
- package/src/types/build-context.ts +0 -57
- package/src/types/config.ts +0 -269
- package/src/types/index.ts +0 -3
- package/src/types/pwa.ts +0 -67
- package/src/utils/archive.ts +0 -18
- package/src/utils/args.ts +0 -7
- package/src/utils/build-context.ts +0 -42
- package/src/utils/child-process.ts +0 -115
- package/src/utils/config.ts +0 -45
- package/src/utils/console.ts +0 -1
- package/src/utils/env.ts +0 -71
- package/src/utils/federation.ts +0 -40
- package/src/utils/fs.ts +0 -53
- package/src/utils/handlebars.ts +0 -61
- package/src/utils/https.ts +0 -29
- package/src/utils/index.ts +0 -21
- package/src/utils/json.ts +0 -12
- package/src/utils/npm.ts +0 -155
- package/src/utils/object.ts +0 -21
- package/src/utils/prompts.ts +0 -160
- package/src/utils/proxy.ts +0 -139
- package/src/utils/seed.fetching.ts +0 -257
- package/src/utils/seed.meta.ts +0 -34
- package/src/utils/seed.processing.ts +0 -100
- package/src/utils/seed.setup.ts +0 -101
- package/src/utils/time.ts +0 -1
- package/test/utils/args.test.ts +0 -17
- package/test/utils/build-context.test.ts +0 -68
- package/test/utils/env.test.ts +0 -212
- package/test/utils/handlebars.test.ts +0 -277
- package/test/utils/https.test.ts +0 -14
- package/test/utils/proxy.test.ts +0 -96
- package/test/utils/seed.fetching.test.ts +0 -145
- package/test/utils/seed.meta.test.ts +0 -33
- package/tsconfig.json +0 -18
package/test/utils/proxy.test.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
|
|
2
|
-
import type { ServerOptions } from 'http-proxy';
|
|
3
|
-
import type { DevProxies } from '../../src/utils/proxy';
|
|
4
|
-
import { convertWsEndpointToHTTP, createDevProxies, createDevProxy } from '../../src/utils/proxy';
|
|
5
|
-
|
|
6
|
-
const suite = createLogicSuite('dev server proxies');
|
|
7
|
-
|
|
8
|
-
suite('should convert websocket to http endpoints as expected', ({ runCases }) => {
|
|
9
|
-
runCases(convertWsEndpointToHTTP, [
|
|
10
|
-
[
|
|
11
|
-
['wss://public-foundation.genesislab.global/gwf/', 'gwf'],
|
|
12
|
-
'https://public-foundation.genesislab.global/',
|
|
13
|
-
],
|
|
14
|
-
[
|
|
15
|
-
['wss://public-foundation.genesislab.global/gwf/'],
|
|
16
|
-
'https://public-foundation.genesislab.global/gwf/',
|
|
17
|
-
],
|
|
18
|
-
[['wss://public-foundation.genesislab.global'], 'https://public-foundation.genesislab.global'],
|
|
19
|
-
[
|
|
20
|
-
['ws://public-foundation.genesislab.global/gwf/', 'gwf'],
|
|
21
|
-
'http://public-foundation.genesislab.global/',
|
|
22
|
-
],
|
|
23
|
-
[
|
|
24
|
-
['ws://public-foundation.genesislab.global/gwf/'],
|
|
25
|
-
'http://public-foundation.genesislab.global/gwf/',
|
|
26
|
-
],
|
|
27
|
-
[['ws://public-foundation.genesislab.global'], 'http://public-foundation.genesislab.global'],
|
|
28
|
-
[['wss://localhost:6060/gwf/', 'gwf'], 'https://localhost:6060/'],
|
|
29
|
-
[['ws://localhost:6060/gwf/', 'gwf'], 'http://localhost:6060/'],
|
|
30
|
-
[['ws://localhost:6060/gwf/'], 'http://localhost:6060/gwf/'],
|
|
31
|
-
[['ws://localhost:6060'], 'http://localhost:6060'],
|
|
32
|
-
]);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
suite('createDevProxy should return the expected proxy for given target', () => {
|
|
36
|
-
const proxy = createDevProxy({
|
|
37
|
-
target: 'https://rte.ie',
|
|
38
|
-
path: '/api',
|
|
39
|
-
options: {
|
|
40
|
-
ws: false,
|
|
41
|
-
cookieDomainRewrite: {
|
|
42
|
-
'old.domain': 'new.domain',
|
|
43
|
-
'*': '',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
const expectedProxy: DevProxies = {
|
|
48
|
-
['/api']: {
|
|
49
|
-
target: 'https://rte.ie',
|
|
50
|
-
secure: false,
|
|
51
|
-
changeOrigin: true,
|
|
52
|
-
cookieDomainRewrite: {
|
|
53
|
-
'old.domain': 'new.domain',
|
|
54
|
-
'*': '',
|
|
55
|
-
},
|
|
56
|
-
ws: false,
|
|
57
|
-
headers: {
|
|
58
|
-
origin: 'https://rte.ie',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
assert.equal(proxy, expectedProxy);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
suite('createDevProxy should return undefined when no target or API_HOST is set', () => {
|
|
66
|
-
assert.not.ok(createDevProxy({ path: '/api' }));
|
|
67
|
-
assert.not.ok(createDevProxy({}));
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
suite('createDevProxies should return default proxies for given target', () => {
|
|
71
|
-
const proxies = createDevProxies({ target: 'https://rte.ie' });
|
|
72
|
-
const expectedServerOptions: ServerOptions = {
|
|
73
|
-
target: 'https://rte.ie',
|
|
74
|
-
secure: false,
|
|
75
|
-
changeOrigin: true,
|
|
76
|
-
cookieDomainRewrite: 'localhost',
|
|
77
|
-
ws: true,
|
|
78
|
-
headers: {
|
|
79
|
-
origin: 'https://rte.ie',
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
const expectedProxies: DevProxies = {
|
|
83
|
-
['/sm']: expectedServerOptions,
|
|
84
|
-
['/sso']: expectedServerOptions,
|
|
85
|
-
['/gwf']: expectedServerOptions,
|
|
86
|
-
};
|
|
87
|
-
assert.equal(proxies, expectedProxies);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// TODO: Double-check this one vs API_HOST requirement to not be set (fails on dev machines vs works on CI)
|
|
91
|
-
// suite('createDevProxies should return undefined when no target or API_HOST is set', () => {
|
|
92
|
-
// assert.not.ok(createDevProxies({ paths: ['/sm', '/gwf'] }));
|
|
93
|
-
// assert.not.ok(createDevProxies());
|
|
94
|
-
// });
|
|
95
|
-
|
|
96
|
-
suite.run();
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { relative } from 'node:path';
|
|
2
|
-
import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
|
|
3
|
-
import { getSeedDirs, resolveGitSeed, resolveNPMSeed } from '../../src/utils';
|
|
4
|
-
|
|
5
|
-
const suite = createLogicSuite('resolveGitSeed');
|
|
6
|
-
|
|
7
|
-
const scenarios = [
|
|
8
|
-
{
|
|
9
|
-
description: 'defaulting',
|
|
10
|
-
args: [],
|
|
11
|
-
expected: {
|
|
12
|
-
repo: 'genesiscommunitysuccess/blank-app-seed',
|
|
13
|
-
ref: 'main',
|
|
14
|
-
id: `gh:genesiscommunitysuccess/blank-app-seed#main`,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
description: 'git user defaulting',
|
|
19
|
-
args: ['positions-app-seed'],
|
|
20
|
-
expected: {
|
|
21
|
-
repo: 'genesiscommunitysuccess/positions-app-seed',
|
|
22
|
-
ref: 'main',
|
|
23
|
-
id: `gh:genesiscommunitysuccess/positions-app-seed#main`,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
description: 'custom ref',
|
|
28
|
-
args: ['positions-app-seed', 'mytag'],
|
|
29
|
-
expected: {
|
|
30
|
-
repo: 'genesiscommunitysuccess/positions-app-seed',
|
|
31
|
-
ref: 'mytag',
|
|
32
|
-
id: `gh:genesiscommunitysuccess/positions-app-seed#mytag`,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
description: 'custom ref',
|
|
37
|
-
args: ['positions-app-seed', 'mytag', 'subfolder'],
|
|
38
|
-
expected: {
|
|
39
|
-
repo: 'genesiscommunitysuccess/positions-app-seed',
|
|
40
|
-
ref: 'mytag',
|
|
41
|
-
id: `gh:genesiscommunitysuccess/positions-app-seed/subfolder#mytag`,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
description: 'custom provider',
|
|
46
|
-
args: ['positions-app-seed', 'mytag', 'subfolder', 'bitbucket'],
|
|
47
|
-
expected: {
|
|
48
|
-
repo: 'genesiscommunitysuccess/positions-app-seed',
|
|
49
|
-
ref: 'mytag',
|
|
50
|
-
id: `bitbucket:genesiscommunitysuccess/positions-app-seed/subfolder#mytag`,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
scenarios.forEach((scenario) => {
|
|
56
|
-
suite(scenario.description, () => {
|
|
57
|
-
assert.equal(resolveGitSeed(...scenario.args), scenario.expected);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
suite.run();
|
|
62
|
-
|
|
63
|
-
const suite2 = createLogicSuite('resolveNPMSeed');
|
|
64
|
-
|
|
65
|
-
const scenarios2 = [
|
|
66
|
-
{
|
|
67
|
-
description: 'defaulting',
|
|
68
|
-
args: [],
|
|
69
|
-
expected: {
|
|
70
|
-
artifact: 'genesislcap/blank-app-seed',
|
|
71
|
-
ref: 'latest',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
description: 'custom seed',
|
|
76
|
-
args: ['positions-app-seed'],
|
|
77
|
-
expected: {
|
|
78
|
-
artifact: 'genesislcap/positions-app-seed',
|
|
79
|
-
ref: 'latest',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
description: 'custom ref',
|
|
84
|
-
args: ['positions-app-seed', 'prerelease'],
|
|
85
|
-
expected: {
|
|
86
|
-
artifact: 'genesislcap/positions-app-seed',
|
|
87
|
-
ref: 'prerelease',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
description: 'no scope',
|
|
92
|
-
args: ['my-seed', 'prerelease', 'false'],
|
|
93
|
-
expected: {
|
|
94
|
-
artifact: 'my-seed',
|
|
95
|
-
ref: 'prerelease',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
|
|
100
|
-
scenarios2.forEach((scenario) => {
|
|
101
|
-
suite(scenario.description, () => {
|
|
102
|
-
assert.equal(resolveNPMSeed(...scenario.args), scenario.expected);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
suite2.run();
|
|
107
|
-
|
|
108
|
-
const suite3 = createLogicSuite('getSeedDirs');
|
|
109
|
-
|
|
110
|
-
suite3('loading remote seed - init', async () => {
|
|
111
|
-
const dir = 'myapp';
|
|
112
|
-
const isInit = true;
|
|
113
|
-
const remote = true;
|
|
114
|
-
const result = getSeedDirs('blank-app-seed', dir, '', isInit, remote);
|
|
115
|
-
const genxDir = relative(process.cwd(), `${dir}/.genx`);
|
|
116
|
-
assert.equal(result, {
|
|
117
|
-
localPath: 'blank-app-seed',
|
|
118
|
-
dir,
|
|
119
|
-
subdir: '',
|
|
120
|
-
isLocalSeed: false,
|
|
121
|
-
genxDir,
|
|
122
|
-
extractedSeedDir: dir,
|
|
123
|
-
extractedSeedGenxDir: genxDir,
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
suite3('loading remote seed - add', async () => {
|
|
128
|
-
const dir = 'myapp';
|
|
129
|
-
const isInit = false;
|
|
130
|
-
const remote = true;
|
|
131
|
-
const result = getSeedDirs('blank-app-seed', dir, '', isInit, remote);
|
|
132
|
-
const genxDir = relative(process.cwd(), `${dir}/.genx`);
|
|
133
|
-
const extractedSeedGenxDir = relative(process.cwd(), `${dir}/.genx/tmp/.genx`);
|
|
134
|
-
assert.equal(result, {
|
|
135
|
-
localPath: 'blank-app-seed',
|
|
136
|
-
dir,
|
|
137
|
-
subdir: '',
|
|
138
|
-
isLocalSeed: false,
|
|
139
|
-
genxDir,
|
|
140
|
-
extractedSeedDir: `${dir}/.genx/tmp`,
|
|
141
|
-
extractedSeedGenxDir,
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
suite3.run();
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
|
|
2
|
-
import { loadGenxModule, loadSeed } from '../../src/utils';
|
|
3
|
-
|
|
4
|
-
const suite = createLogicSuite('loadSeed');
|
|
5
|
-
|
|
6
|
-
suite('loading local seed', async () => {
|
|
7
|
-
const result = await loadSeed('./test/fixtures/mock-seed/.genx');
|
|
8
|
-
assert.type(result.configure, 'function');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
suite.run();
|
|
12
|
-
|
|
13
|
-
const suite2 = createLogicSuite('loadGenxModule');
|
|
14
|
-
|
|
15
|
-
suite2('loading local seed', async () => {
|
|
16
|
-
const result = await loadGenxModule('./test/fixtures/mock-seed/.genx');
|
|
17
|
-
assert.equal(result, {
|
|
18
|
-
name: 'mock-seed',
|
|
19
|
-
description: 'Mock Seed',
|
|
20
|
-
version: '1.0.0',
|
|
21
|
-
license: 'Apache-2.0',
|
|
22
|
-
genxSeedConfig: {
|
|
23
|
-
processFiles: {
|
|
24
|
-
interpolateVariables: {
|
|
25
|
-
enabled: true,
|
|
26
|
-
include: ['.kt', '.md'],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
suite2.run();
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"declarationDir": "./dist",
|
|
5
|
-
"lib": [
|
|
6
|
-
"ES2015",
|
|
7
|
-
"ES2016",
|
|
8
|
-
"ES2017",
|
|
9
|
-
"ES2019",
|
|
10
|
-
],
|
|
11
|
-
"module": "commonjs",
|
|
12
|
-
"outDir": "./dist",
|
|
13
|
-
"rootDir": "./src",
|
|
14
|
-
},
|
|
15
|
-
"include": [
|
|
16
|
-
"src/**/*"
|
|
17
|
-
]
|
|
18
|
-
}
|