@wolsok/nx-aws-cdk-v2 4.2.6 → 4.2.7
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/LICENSE +25 -0
- package/package.json +1 -1
- package/src/utils/executor.util.js +30 -19
- package/src/utils/executor.util.js.map +1 -1
- package/src/utils/testing.d.ts +0 -20
- package/src/utils/testing.js +0 -60
- package/src/utils/testing.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
Scope
|
|
2
|
+
|
|
3
|
+
The MIT License below covers this repository except the following
|
|
4
|
+
directories, each of which holds its own proprietary LICENSE (all rights
|
|
5
|
+
reserved, use only with the owner's written permission) for every version
|
|
6
|
+
released after that LICENSE was added; earlier versions stay under MIT:
|
|
7
|
+
|
|
8
|
+
- apps/rollapolla-analog
|
|
9
|
+
- apps/korbjaeger
|
|
10
|
+
- apps/korbjaeger-functions
|
|
11
|
+
- apps/korbjaeger-cdk
|
|
12
|
+
- libs/features/basketball-data
|
|
13
|
+
- libs/features/korbjaeger-account
|
|
14
|
+
- libs/features/korbjaeger-antworten
|
|
15
|
+
- libs/features/korbjaeger-auswahl
|
|
16
|
+
- tools/korbjaeger
|
|
17
|
+
|
|
18
|
+
The root files firebase.rollapolla-analog.json (RollaPolla) and
|
|
19
|
+
firebase.korbjaeger.json (Korbjäger) fall under the proprietary LICENSE of
|
|
20
|
+
their app.
|
|
21
|
+
|
|
22
|
+
Third-party code keeps its own licence and notices.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
1
26
|
MIT License
|
|
2
27
|
|
|
3
28
|
Copyright (c) 2022 Wolfram Sokollek
|
package/package.json
CHANGED
|
@@ -91,14 +91,7 @@ function runCommandProcess(command, cwd) {
|
|
|
91
91
|
env: process.env,
|
|
92
92
|
cwd: cwd,
|
|
93
93
|
});
|
|
94
|
-
|
|
95
|
-
const processExitListener = () => childProcess.kill();
|
|
96
|
-
process.on('exit', processExitListener);
|
|
97
|
-
process.on('SIGTERM', processExitListener);
|
|
98
|
-
process.stdin.on('data', (data) => {
|
|
99
|
-
childProcess.stdin?.write(data);
|
|
100
|
-
childProcess.stdin?.end();
|
|
101
|
-
});
|
|
94
|
+
const unbindFromParentProcess = bindToParentProcess(childProcess);
|
|
102
95
|
childProcess.stdout?.on('data', (data) => {
|
|
103
96
|
process.stdout.write(data);
|
|
104
97
|
});
|
|
@@ -106,18 +99,36 @@ function runCommandProcess(command, cwd) {
|
|
|
106
99
|
process.stderr.write(err);
|
|
107
100
|
});
|
|
108
101
|
childProcess.on('close', (code) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
resolve(false);
|
|
114
|
-
}
|
|
115
|
-
process.removeListener('exit', processExitListener);
|
|
116
|
-
if (process.stdin.isTTY) {
|
|
117
|
-
process.stdin.end();
|
|
118
|
-
}
|
|
119
|
-
process.stdin.removeListener('data', processExitListener);
|
|
102
|
+
unbindFromParentProcess();
|
|
103
|
+
resolve(code === 0);
|
|
120
104
|
});
|
|
121
105
|
});
|
|
122
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Ties the child to the parent process: the child is killed when the parent
|
|
109
|
+
* exits or gets SIGTERM, and the parent's stdin is forwarded to it once.
|
|
110
|
+
* Returns the function that removes every listener this added and pauses
|
|
111
|
+
* stdin again once no other `data` listener is left (Node keeps a stream
|
|
112
|
+
* flowing after its last `data` listener goes, which keeps the process alive).
|
|
113
|
+
*/
|
|
114
|
+
function bindToParentProcess(childProcess) {
|
|
115
|
+
const killChild = () => childProcess.kill();
|
|
116
|
+
const forwardStdin = (data) => {
|
|
117
|
+
childProcess.stdin?.write(data);
|
|
118
|
+
childProcess.stdin?.end();
|
|
119
|
+
};
|
|
120
|
+
process.on('exit', killChild);
|
|
121
|
+
process.on('SIGTERM', killChild);
|
|
122
|
+
// Resumed explicitly: a stream paused by an earlier run's cleanup stays
|
|
123
|
+
// paused when a `data` listener is added.
|
|
124
|
+
process.stdin.on('data', forwardStdin).resume();
|
|
125
|
+
return () => {
|
|
126
|
+
process.removeListener('exit', killChild);
|
|
127
|
+
process.removeListener('SIGTERM', killChild);
|
|
128
|
+
process.stdin.removeListener('data', forwardStdin);
|
|
129
|
+
if (process.stdin.listenerCount('data') === 0) {
|
|
130
|
+
process.stdin.pause();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
123
134
|
//# sourceMappingURL=executor.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.util.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/executor.util.ts"],"names":[],"mappings":";;;AAmBA,kDAiBC;AAeD,sDAgBC;AAED,8BAaC;AAED,sCA+BC;AAED,
|
|
1
|
+
{"version":3,"file":"executor.util.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/executor.util.ts"],"names":[],"mappings":";;;AAmBA,kDAiBC;AAeD,sDAgBC;AAED,8BAaC;AAED,sCA+BC;AAED,8CA2BC;;AAhJD,iDAAwD;AAIxD,uCAKoB;AAGpB,wDAAkC;AAElC;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,OAAwB;IAI1D,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW;QACjC,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,iDACE,OAAO,CAAC,WAAW,IAAI,mBACzB,IAAI,CACL,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAChF,CAAC;AAEY,QAAA,gBAAgB,GAAG,CAAC,QAAQ,CAAC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O,GAAG,EAAE;QACV,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC1C,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9C,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/src/utils/testing.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ChildProcess } from 'child_process';
|
|
2
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
3
|
-
export declare function mockExecutorContext(executorName: string, workspaceVersion?: number): ExecutorContext;
|
|
4
|
-
/** A mock implementation for `exec` that hands out a new `FakeChildProcess`. */
|
|
5
|
-
export declare function spawnFakeChildProcess(): ChildProcess;
|
|
6
|
-
/** The part of a mocked `exec` that tells which processes it returned. */
|
|
7
|
-
interface SpawningMock {
|
|
8
|
-
mock: {
|
|
9
|
-
results: ReadonlyArray<{
|
|
10
|
-
value: unknown;
|
|
11
|
-
}>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Starts an executor, then lets the process the mocked `exec` spawned last
|
|
16
|
-
* close with `exitCode`, and returns the executor's result. The executor has
|
|
17
|
-
* to call `exec` before its first `await`, as `runCommandProcess` does.
|
|
18
|
-
*/
|
|
19
|
-
export declare function runExecutorToExit<T>(exec: SpawningMock, run: () => Promise<T>, exitCode?: number): Promise<T>;
|
|
20
|
-
export {};
|
package/src/utils/testing.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mockExecutorContext = mockExecutorContext;
|
|
4
|
-
exports.spawnFakeChildProcess = spawnFakeChildProcess;
|
|
5
|
-
exports.runExecutorToExit = runExecutorToExit;
|
|
6
|
-
const events_1 = require("events");
|
|
7
|
-
function mockExecutorContext(executorName, workspaceVersion = 2) {
|
|
8
|
-
return {
|
|
9
|
-
projectName: 'proj',
|
|
10
|
-
root: '/root',
|
|
11
|
-
cwd: '/root',
|
|
12
|
-
nxJsonConfiguration: {},
|
|
13
|
-
projectsConfigurations: {
|
|
14
|
-
version: workspaceVersion,
|
|
15
|
-
projects: {
|
|
16
|
-
proj: {
|
|
17
|
-
root: 'apps/proj',
|
|
18
|
-
targets: {
|
|
19
|
-
test: {
|
|
20
|
-
executor: `@wolsok/nx-aws-cdk-v2:${executorName}`,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
projectGraph: { nodes: {}, dependencies: {} },
|
|
27
|
-
target: {
|
|
28
|
-
executor: `@wolsok/nx-aws-cdk-v2:${executorName}`,
|
|
29
|
-
},
|
|
30
|
-
isVerbose: true,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/** Stands in for the cdk process a mocked `child_process.exec` spawns. */
|
|
34
|
-
class FakeChildProcess extends events_1.EventEmitter {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.stdout = new events_1.EventEmitter();
|
|
38
|
-
this.stderr = new events_1.EventEmitter();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/** A mock implementation for `exec` that hands out a new `FakeChildProcess`. */
|
|
42
|
-
function spawnFakeChildProcess() {
|
|
43
|
-
return new FakeChildProcess();
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Starts an executor, then lets the process the mocked `exec` spawned last
|
|
47
|
-
* close with `exitCode`, and returns the executor's result. The executor has
|
|
48
|
-
* to call `exec` before its first `await`, as `runCommandProcess` does.
|
|
49
|
-
*/
|
|
50
|
-
async function runExecutorToExit(exec, run, exitCode = 0) {
|
|
51
|
-
const result = run();
|
|
52
|
-
const spawned = exec.mock.results.at(-1)?.value;
|
|
53
|
-
if (!(spawned instanceof FakeChildProcess)) {
|
|
54
|
-
await result;
|
|
55
|
-
throw new Error('The executor spawned no FakeChildProcess through exec.');
|
|
56
|
-
}
|
|
57
|
-
spawned.emit('close', exitCode);
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=testing.js.map
|
package/src/utils/testing.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/testing.ts"],"names":[],"mappings":";;AAKA,kDA4BC;AASD,sDAEC;AAYD,8CAaC;AApED,mCAAsC;AAItC,SAAgB,mBAAmB,CACjC,YAAoB,EACpB,gBAAgB,GAAG,CAAC;IAEpB,OAAO;QACL,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,OAAO;QACZ,mBAAmB,EAAE,EAAE;QACvB,sBAAsB,EAAE;YACtB,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE;gBACR,IAAI,EAAE;oBACJ,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE;wBACP,IAAI,EAAE;4BACJ,QAAQ,EAAE,yBAAyB,YAAY,EAAE;yBAClD;qBACF;iBACF;aACF;SACF;QACD,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;QAC7C,MAAM,EAAE;YACN,QAAQ,EAAE,yBAAyB,YAAY,EAAE;SAClD;QACD,SAAS,EAAE,IAAI;KAChB,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,MAAM,gBAAiB,SAAQ,qBAAY;IAA3C;;QACkB,WAAM,GAAG,IAAI,qBAAY,EAAE,CAAC;QAC5B,WAAM,GAAG,IAAI,qBAAY,EAAE,CAAC;IAC9C,CAAC;CA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