@ms-cloudpack/cli 0.4.5 → 0.6.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/CHANGELOG.json +70 -1
- package/CHANGELOG.md +30 -2
- package/lib/commands/start/TaskRunner.d.ts +33 -0
- package/lib/commands/start/TaskRunner.js +73 -0
- package/lib/commands/start/TaskRunner.js.map +1 -0
- package/lib/commands/start/bundleTask.d.ts +16 -0
- package/lib/commands/start/bundleTask.js +32 -0
- package/lib/commands/start/bundleTask.js.map +1 -0
- package/lib/commands/start/startApiServer.d.ts +5 -0
- package/lib/commands/start/startApiServer.js +14 -0
- package/lib/commands/start/startApiServer.js.map +1 -1
- package/lib/commands/start/startBundleServer.js +74 -107
- package/lib/commands/start/startBundleServer.js.map +1 -1
- package/lib/commands/start/taskRunner.test.d.ts +1 -0
- package/lib/commands/start/taskRunner.test.js +35 -0
- package/lib/commands/start/taskRunner.test.js.map +1 -0
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +10 -6
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,76 @@
|
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Sat,
|
|
5
|
+
"date": "Sat, 03 Sep 2022 08:15:01 GMT",
|
|
6
|
+
"tag": "@ms-cloudpack/cli_v0.6.0",
|
|
7
|
+
"version": "0.6.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "dake.3601@gmail.com",
|
|
12
|
+
"package": "@ms-cloudpack/cli",
|
|
13
|
+
"commit": "5edd43e769c3fa7fa1f2fb16952e0031f57cbb43",
|
|
14
|
+
"comment": "Add method of Task Runner deduplicates pending Tasks"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@ms-cloudpack/cli",
|
|
19
|
+
"comment": "Bump @ms-cloudpack/bundler to v0.3.10",
|
|
20
|
+
"commit": "ec909bf967a54b174cb1d50e7e55bd4b3ed02884"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@ms-cloudpack/cli",
|
|
25
|
+
"comment": "Bump @ms-cloudpack/package-utilities to v0.8.1",
|
|
26
|
+
"commit": "ec909bf967a54b174cb1d50e7e55bd4b3ed02884"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@ms-cloudpack/cli",
|
|
31
|
+
"comment": "Bump @ms-cloudpack/path-utilities to v0.3.2",
|
|
32
|
+
"commit": "ec909bf967a54b174cb1d50e7e55bd4b3ed02884"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"date": "Thu, 01 Sep 2022 08:12:24 GMT",
|
|
39
|
+
"tag": "@ms-cloudpack/cli_v0.5.0",
|
|
40
|
+
"version": "0.5.0",
|
|
41
|
+
"comments": {
|
|
42
|
+
"minor": [
|
|
43
|
+
{
|
|
44
|
+
"author": "dake.3601@gmail.com",
|
|
45
|
+
"package": "@ms-cloudpack/cli",
|
|
46
|
+
"commit": "3a3ed9727cf3a80c7656e0434febc250610b6600",
|
|
47
|
+
"comment": "Implementation of Task Runner"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@ms-cloudpack/cli",
|
|
52
|
+
"comment": "Bump @ms-cloudpack/bundler to v0.3.9",
|
|
53
|
+
"commit": "d56c24adad069eb83c7437c25da1c919fb01098b"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "Wed, 31 Aug 2022 08:12:30 GMT",
|
|
60
|
+
"tag": "@ms-cloudpack/cli_v0.4.6",
|
|
61
|
+
"version": "0.4.6",
|
|
62
|
+
"comments": {
|
|
63
|
+
"patch": [
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@ms-cloudpack/cli",
|
|
67
|
+
"comment": "Bump @ms-cloudpack/bundler to v0.3.8",
|
|
68
|
+
"commit": "aa8cea7a0691061923acdb979de5959bdab8a1e2"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"date": "Sat, 27 Aug 2022 08:13:49 GMT",
|
|
6
75
|
"tag": "@ms-cloudpack/cli_v0.4.5",
|
|
7
76
|
"version": "0.4.5",
|
|
8
77
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
# Change Log - @ms-cloudpack/cli
|
|
2
2
|
|
|
3
|
-
This log was last generated on Sat,
|
|
3
|
+
This log was last generated on Sat, 03 Sep 2022 08:15:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.6.0
|
|
8
|
+
|
|
9
|
+
Sat, 03 Sep 2022 08:15:01 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Add method of Task Runner deduplicates pending Tasks (dake.3601@gmail.com)
|
|
14
|
+
- Bump @ms-cloudpack/bundler to v0.3.10
|
|
15
|
+
- Bump @ms-cloudpack/package-utilities to v0.8.1
|
|
16
|
+
- Bump @ms-cloudpack/path-utilities to v0.3.2
|
|
17
|
+
|
|
18
|
+
## 0.5.0
|
|
19
|
+
|
|
20
|
+
Thu, 01 Sep 2022 08:12:24 GMT
|
|
21
|
+
|
|
22
|
+
### Minor changes
|
|
23
|
+
|
|
24
|
+
- Implementation of Task Runner (dake.3601@gmail.com)
|
|
25
|
+
- Bump @ms-cloudpack/bundler to v0.3.9
|
|
26
|
+
|
|
27
|
+
## 0.4.6
|
|
28
|
+
|
|
29
|
+
Wed, 31 Aug 2022 08:12:30 GMT
|
|
30
|
+
|
|
31
|
+
### Patches
|
|
32
|
+
|
|
33
|
+
- Bump @ms-cloudpack/bundler to v0.3.8
|
|
34
|
+
|
|
7
35
|
## 0.4.5
|
|
8
36
|
|
|
9
|
-
Sat, 27 Aug 2022 08:13:
|
|
37
|
+
Sat, 27 Aug 2022 08:13:49 GMT
|
|
10
38
|
|
|
11
39
|
### Patches
|
|
12
40
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Task<TReturn> {
|
|
2
|
+
name: string;
|
|
3
|
+
id: string;
|
|
4
|
+
execute: () => Promise<TReturn>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* TaskRunner class manages the state of Tasks.
|
|
8
|
+
* This class is to be called by the api server.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TaskRunner {
|
|
11
|
+
private _queue;
|
|
12
|
+
private _pendingTasks;
|
|
13
|
+
private _completedTasks;
|
|
14
|
+
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* The add method enqueues a Task and returns its Promise.
|
|
17
|
+
* If a Task with the same id has already been processed,
|
|
18
|
+
* it returns either the result or the promise.
|
|
19
|
+
*/
|
|
20
|
+
add<TReturn>(task: Task<TReturn>): Promise<TReturn>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns Task with id.
|
|
23
|
+
*/
|
|
24
|
+
get(id: string): any;
|
|
25
|
+
/**
|
|
26
|
+
* Returns if Task with id is pending.
|
|
27
|
+
*/
|
|
28
|
+
pending(id: string): Promise<any> | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes Task with id.
|
|
31
|
+
*/
|
|
32
|
+
delete(id: string): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import PQueue from 'p-queue';
|
|
2
|
+
const log = (...messages) => {
|
|
3
|
+
console.log(`TaskRunner:`, ...messages);
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* TaskRunner class manages the state of Tasks.
|
|
7
|
+
* This class is to be called by the api server.
|
|
8
|
+
*/
|
|
9
|
+
export class TaskRunner {
|
|
10
|
+
constructor() {
|
|
11
|
+
this._queue = new PQueue({ concurrency: 10 });
|
|
12
|
+
this._pendingTasks = new Map();
|
|
13
|
+
this._completedTasks = new Map();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The add method enqueues a Task and returns its Promise.
|
|
17
|
+
* If a Task with the same id has already been processed,
|
|
18
|
+
* it returns either the result or the promise.
|
|
19
|
+
*/
|
|
20
|
+
add(task) {
|
|
21
|
+
const { name, id, execute } = task;
|
|
22
|
+
// Check if we are already completed the task with that id.
|
|
23
|
+
const action = this._completedTasks.get(id);
|
|
24
|
+
if (action !== undefined) {
|
|
25
|
+
log(`Previous action found, returning: "${name}:${id}"`);
|
|
26
|
+
return action;
|
|
27
|
+
}
|
|
28
|
+
// Check if we are already running the task with that id.
|
|
29
|
+
const pending = this._pendingTasks.get(id);
|
|
30
|
+
if (pending !== undefined) {
|
|
31
|
+
log(`Previous action found, waiting: "${name}:${id}"`);
|
|
32
|
+
return pending;
|
|
33
|
+
}
|
|
34
|
+
// Create a promise to track the task.
|
|
35
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
36
|
+
this._queue
|
|
37
|
+
.add(execute)
|
|
38
|
+
.then((result) => {
|
|
39
|
+
// If an existing bundle was created, dispose.
|
|
40
|
+
// this._createdTasks.get(id)?.dispose?.();
|
|
41
|
+
// Update finished Tasks.
|
|
42
|
+
this._completedTasks.set(id, result);
|
|
43
|
+
resolve(result);
|
|
44
|
+
})
|
|
45
|
+
.catch(reject);
|
|
46
|
+
}).finally(() => {
|
|
47
|
+
this._pendingTasks.delete(id);
|
|
48
|
+
});
|
|
49
|
+
this._pendingTasks.set(id, resultPromise);
|
|
50
|
+
return resultPromise;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns Task with id.
|
|
54
|
+
*/
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
+
get(id) {
|
|
57
|
+
return this._completedTasks.get(id);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Returns if Task with id is pending.
|
|
61
|
+
*/
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
|
+
pending(id) {
|
|
64
|
+
return this._pendingTasks.get(id);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Deletes Task with id.
|
|
68
|
+
*/
|
|
69
|
+
delete(id) {
|
|
70
|
+
this._completedTasks.delete(id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=TaskRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskRunner.js","sourceRoot":"","sources":["../../../src/commands/start/TaskRunner.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAC;AAG7B,MAAM,GAAG,GAAG,CAAC,GAAG,QAAmB,EAAE,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC1C,CAAC,CAAC;AAQF;;;GAGG;AACH,MAAM,OAAO,UAAU;IAOrB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAU,IAAmB;QAC9B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEnC,2DAA2D;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5C,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,GAAG,CAAC,sCAAsC,IAAI,IAAI,EAA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AC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BundlerResult } from '@ms-cloudpack/bundler-types';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks a given bundle result.
|
|
4
|
+
*/
|
|
5
|
+
export interface BundleRequest {
|
|
6
|
+
id: string;
|
|
7
|
+
packageName: string;
|
|
8
|
+
version: string;
|
|
9
|
+
packagePath: string;
|
|
10
|
+
outputPath: string;
|
|
11
|
+
isExternal: boolean;
|
|
12
|
+
result?: BundlerResult;
|
|
13
|
+
isRebuildRequired?: boolean;
|
|
14
|
+
dispose?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function bundleTask(bundleRequest: BundleRequest, force?: boolean): Promise<BundleRequest>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { bundlePackage } from '@ms-cloudpack/bundler';
|
|
2
|
+
import { readJson, writeJson } from '@ms-cloudpack/json-utilities';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
const log = (...messages) => {
|
|
5
|
+
console.log(`BundleTask:`, ...messages);
|
|
6
|
+
};
|
|
7
|
+
export async function bundleTask(bundleRequest, force) {
|
|
8
|
+
const { packagePath, outputPath, isExternal } = bundleRequest;
|
|
9
|
+
// Rehydrate the result if not incremental.
|
|
10
|
+
if (isExternal && !force) {
|
|
11
|
+
bundleRequest.result = await readJson(path.join(outputPath, 'result.json'));
|
|
12
|
+
}
|
|
13
|
+
const isCacheUsable = bundleRequest.result?.errors?.length === 0;
|
|
14
|
+
// Only use cached result if it's successful.
|
|
15
|
+
if (!isCacheUsable) {
|
|
16
|
+
bundleRequest.result = await bundlePackage({
|
|
17
|
+
packagePath,
|
|
18
|
+
outputPath,
|
|
19
|
+
outputType: 'library',
|
|
20
|
+
incremental: !isExternal,
|
|
21
|
+
});
|
|
22
|
+
// Write the result to disk.
|
|
23
|
+
if (isExternal) {
|
|
24
|
+
await writeJson(path.join(outputPath, 'result.json'), bundleRequest.result);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
log(`Bundle cached, returning: "${bundleRequest.packageName}@${bundleRequest.version}"`);
|
|
29
|
+
}
|
|
30
|
+
return bundleRequest;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=bundleTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundleTask.js","sourceRoot":"","sources":["../../../src/commands/start/bundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,GAAG,GAAG,CAAC,GAAG,QAAmB,EAAE,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC1C,CAAC,CAAC;AAkBF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,aAA4B,EAAE,KAAe;IAC5E,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAE9D,2CAA2C;IAC3C,IAAI,UAAU,IAAI,CAAC,KAAK,EAAE;QACxB,aAAa,CAAC,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;KAC7E;IAED,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC;IAEjE,6CAA6C;IAC7C,IAAI,CAAC,aAAa,EAAE;QAClB,aAAa,CAAC,MAAM,GAAG,MAAM,aAAa,CAAC;YACzC,WAAW;YACX,UAAU;YACV,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,CAAC,UAAU;SACzB,CAAC,CAAC;QAEH,4BAA4B;QAC5B,IAAI,UAAU,EAAE;YACd,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;SAC7E;KACF;SAAM;QACL,GAAG,CAAC,8BAA8B,aAAa,CAAC,WAAW,IAAI,aAAa,CAAC,OAAO,GAAG,CAAC,CAAC;KAC1F;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Session } from './types.js';
|
|
2
|
+
import { type Task } from './TaskRunner.js';
|
|
2
3
|
export interface SessionStats {
|
|
3
4
|
status: 'idle' | 'pending';
|
|
4
5
|
remainingTasks: number;
|
|
@@ -12,6 +13,10 @@ export interface ApiServer {
|
|
|
12
13
|
notifyReload: () => void;
|
|
13
14
|
reportStart: (options: TaskStartDescription) => void;
|
|
14
15
|
reportEnd: (options: TaskEndDescription) => void;
|
|
16
|
+
addTask: <TReturn>(task: Task<TReturn>) => Promise<TReturn>;
|
|
17
|
+
getTask: (id: string) => any;
|
|
18
|
+
pendingTask: (id: string) => Promise<any> | undefined;
|
|
19
|
+
deleteTask: (id: string) => void;
|
|
15
20
|
close: () => void;
|
|
16
21
|
}
|
|
17
22
|
interface TaskError {
|
|
@@ -4,6 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import WebSocket, { WebSocketServer } from 'ws';
|
|
5
5
|
import { createDataBus } from '@ms-cloudpack/data-bus';
|
|
6
6
|
import { execSync } from 'child_process';
|
|
7
|
+
import { TaskRunner } from './TaskRunner.js';
|
|
7
8
|
/**
|
|
8
9
|
* The api server handles the data pub/sub (for things like reporting build status)
|
|
9
10
|
* and hosting the dashboard verb backend (for executing actions like loading vscode,
|
|
@@ -29,6 +30,7 @@ export async function startApiServer({ session }) {
|
|
|
29
30
|
totalWarnings: 0,
|
|
30
31
|
};
|
|
31
32
|
const allTasks = new Map();
|
|
33
|
+
const taskRunner = new TaskRunner();
|
|
32
34
|
bus.publish([session.id, 'status'], sessionStats);
|
|
33
35
|
// Create a websocket server which listens for subscriptions and verb requests,
|
|
34
36
|
// and broadcasts the data to all connected clients.
|
|
@@ -141,6 +143,18 @@ export async function startApiServer({ session }) {
|
|
|
141
143
|
bus.publish([session.id, 'status-details'], { tasks: Array.from(allTasks.values()) });
|
|
142
144
|
}
|
|
143
145
|
},
|
|
146
|
+
addTask: (task) => {
|
|
147
|
+
return taskRunner.add(task);
|
|
148
|
+
},
|
|
149
|
+
getTask: (id) => {
|
|
150
|
+
return taskRunner.get(id);
|
|
151
|
+
},
|
|
152
|
+
pendingTask: (id) => {
|
|
153
|
+
return taskRunner.pending(id);
|
|
154
|
+
},
|
|
155
|
+
deleteTask: (id) => {
|
|
156
|
+
taskRunner.delete(id);
|
|
157
|
+
},
|
|
144
158
|
close: () => server.close(),
|
|
145
159
|
};
|
|
146
160
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startApiServer.js","sourceRoot":"","sources":["../../../src/commands/start/startApiServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,EAAE,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"startApiServer.js","sourceRoot":"","sources":["../../../src/commands/start/startApiServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,EAAE,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE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ms-cloudpack/bundler';
|
|
2
1
|
import { createExpressApp } from '@ms-cloudpack/create-express-app';
|
|
3
|
-
import { readJson, writeJson } from '@ms-cloudpack/json-utilities';
|
|
4
2
|
import { isExternalPackage } from '@ms-cloudpack/package-utilities';
|
|
5
3
|
import { isFolder, slash } from '@ms-cloudpack/path-utilities';
|
|
6
4
|
import filenamify from 'filenamify';
|
|
@@ -10,6 +8,7 @@ import os from 'os';
|
|
|
10
8
|
import path from 'path';
|
|
11
9
|
import { parseRequestInfo } from './parseRequestInfo.js';
|
|
12
10
|
import chokidar from 'chokidar';
|
|
11
|
+
import { bundleTask } from './bundleTask.js';
|
|
13
12
|
const { ensureDir } = fsExtra;
|
|
14
13
|
// const bundleLookupPath = path.join(os.tmpdir(), 'cloudpack-output', 'all-bundles.json');
|
|
15
14
|
const log = (...messages) => {
|
|
@@ -21,8 +20,6 @@ const log = (...messages) => {
|
|
|
21
20
|
* on each request.
|
|
22
21
|
*/
|
|
23
22
|
export async function startBundleServer({ session, apiServer, }) {
|
|
24
|
-
const createdBundles = {};
|
|
25
|
-
const pendingBundles = {};
|
|
26
23
|
const { resolveMap } = session;
|
|
27
24
|
const { server, port } = await createExpressApp([5500, 5501, 5502, 5503], (app) => {
|
|
28
25
|
// Set up the express app routes.
|
|
@@ -54,7 +51,7 @@ export async function startBundleServer({ session, apiServer, }) {
|
|
|
54
51
|
}
|
|
55
52
|
// If it's an unrecognized package, 404.
|
|
56
53
|
if (!packagePath) {
|
|
57
|
-
log(`
|
|
54
|
+
log(`Response (404): "${packageName}@${version}${filePath}"`);
|
|
58
55
|
res
|
|
59
56
|
.status(404)
|
|
60
57
|
.send(`The requested package "${packageName}@${version}${filePath}" was not found in the resolve map.`);
|
|
@@ -69,94 +66,87 @@ export async function startBundleServer({ session, apiServer, }) {
|
|
|
69
66
|
});
|
|
70
67
|
// Derive where the output should be.
|
|
71
68
|
const outputPath = path.join(os.tmpdir(), 'cloudpack-output', `${filenamify(packageName)}-${version}-${bundleId}`);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
// Set up for bundling.
|
|
70
|
+
let action = apiServer.getTask(bundleId);
|
|
71
|
+
const pendingBundle = apiServer.pendingTask(bundleId);
|
|
72
|
+
const restart = action && !isFolder;
|
|
73
|
+
let bundling;
|
|
74
|
+
// Does it need to bundle?
|
|
75
|
+
if (!pendingBundle && (!action || restart)) {
|
|
76
|
+
// Bundling promise wrapper.
|
|
77
|
+
bundling = new Promise((resolve) => {
|
|
78
|
+
const bundleRequest = {
|
|
79
|
+
id: bundleId,
|
|
80
|
+
packageName,
|
|
81
|
+
version: version,
|
|
82
|
+
packagePath,
|
|
83
|
+
outputPath,
|
|
84
|
+
isExternal,
|
|
85
|
+
};
|
|
86
|
+
// Call to async helper so that we can await and call resolve.
|
|
87
|
+
(async () => {
|
|
88
|
+
// Start tracking work.
|
|
89
|
+
apiServer.reportStart({
|
|
85
90
|
id: bundleId,
|
|
86
|
-
packageName
|
|
87
|
-
|
|
88
|
-
packagePath,
|
|
91
|
+
name: `Bundle ${packageName}@${version}`,
|
|
92
|
+
inputPath: packagePath || '',
|
|
89
93
|
outputPath,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
});
|
|
95
|
+
try {
|
|
96
|
+
log(`No previous action found, bundling: "${packageName}@${version}"`);
|
|
97
|
+
await ensureDir(outputPath);
|
|
98
|
+
log(`Finished ensureDir: "${packageName}@${version}"`);
|
|
99
|
+
log(`Trying to bundle "${packageName}@${version}"`);
|
|
100
|
+
if (restart) {
|
|
101
|
+
// TODO: Implement apiServer.restart
|
|
102
|
+
apiServer.deleteTask(bundleId);
|
|
103
|
+
}
|
|
104
|
+
await apiServer.addTask({
|
|
97
105
|
name: `Bundle ${packageName}@${version}`,
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
id: bundleId,
|
|
107
|
+
execute: () => bundleTask(bundleRequest, force),
|
|
100
108
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// but TypeScript insists it is necessary.
|
|
107
|
-
if (packagePath) {
|
|
108
|
-
log(`Trying to bundle "${packageName}@${version}"`);
|
|
109
|
-
await bundle(bundleRequest, force);
|
|
110
|
-
// If this is going to be incremental, start a watcher to re-bundle when source
|
|
111
|
-
// changes.
|
|
112
|
-
if (!isExternal) {
|
|
113
|
-
initializeFileWatcher(session, bundleId, outputPath, bundleRequest, pendingBundles, apiServer);
|
|
114
|
-
log(`Bundle complete: ${outputPath}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
catch (_) {
|
|
119
|
-
/* no-op */
|
|
109
|
+
// If this is going to be incremental, start a watcher to re-bundle when source
|
|
110
|
+
// changes.
|
|
111
|
+
if (!isExternal) {
|
|
112
|
+
initializeFileWatcher(session, bundleId, outputPath, bundleRequest, apiServer);
|
|
113
|
+
log(`Bundle complete: ${outputPath}`);
|
|
120
114
|
}
|
|
121
115
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
|
-
errors: bundleRequest.result?.errors,
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
136
|
-
warnings: bundleRequest.result?.warnings,
|
|
137
|
-
});
|
|
138
|
-
resolve(bundleRequest);
|
|
116
|
+
catch (_) {
|
|
117
|
+
/* no-op */
|
|
118
|
+
}
|
|
119
|
+
resolve(bundleRequest);
|
|
120
|
+
// TODO: errors and warnings typings don't match up. We need to reconcile.
|
|
121
|
+
apiServer.reportEnd({
|
|
122
|
+
id: bundleId,
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
124
|
+
errors: bundleRequest.result?.errors,
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
warnings: bundleRequest.result?.warnings,
|
|
139
127
|
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
action = await pendingAction;
|
|
128
|
+
})();
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
else if (pendingBundle) {
|
|
132
|
+
log(`Previous action found, waiting: "${packageName}@${version}${filePath}"`);
|
|
146
133
|
}
|
|
147
134
|
else {
|
|
148
|
-
log(`
|
|
135
|
+
log(`Bundle cached, returning: "${packageName}@${version}${filePath}"`);
|
|
149
136
|
}
|
|
137
|
+
await apiServer.pendingTask(bundleId);
|
|
138
|
+
await bundling;
|
|
139
|
+
action = apiServer.getTask(bundleId);
|
|
150
140
|
// If this is a pre-built local package we haven't set up for incremental builds, set it up.
|
|
151
141
|
if (!isExternal && !action.dispose) {
|
|
152
|
-
initializeFileWatcher(session, bundleId, outputPath, action,
|
|
142
|
+
initializeFileWatcher(session, bundleId, outputPath, action, apiServer);
|
|
153
143
|
}
|
|
154
144
|
// At this point we should have an action completed.
|
|
155
145
|
if ((action.result?.errors?.length || 0) > 0) {
|
|
156
146
|
res.status(500).type('json').send(action);
|
|
157
147
|
}
|
|
158
148
|
else {
|
|
159
|
-
log(`
|
|
149
|
+
log(`Bundle returning: "${packageName}@${version}${filePath}"`);
|
|
160
150
|
// Try to return the result.
|
|
161
151
|
if (isExternal) {
|
|
162
152
|
res.setHeader('Cache-Control', 'public, max-age=31536000');
|
|
@@ -166,52 +156,26 @@ export async function startBundleServer({ session, apiServer, }) {
|
|
|
166
156
|
});
|
|
167
157
|
});
|
|
168
158
|
const url = `http://localhost:${port}`;
|
|
169
|
-
log(`
|
|
159
|
+
log(`started (${url})`);
|
|
170
160
|
return {
|
|
171
161
|
close: async () => {
|
|
172
|
-
// await writeJson(bundleLookupPath, createdBundles);
|
|
173
162
|
server.close();
|
|
174
163
|
},
|
|
175
164
|
port,
|
|
176
165
|
url,
|
|
177
166
|
};
|
|
178
167
|
}
|
|
179
|
-
|
|
180
|
-
const { packagePath, outputPath, isExternal } = bundleRequest;
|
|
181
|
-
// Rehydrate the result if not incremental.
|
|
182
|
-
if (isExternal && !force) {
|
|
183
|
-
bundleRequest.result = await readJson(path.join(outputPath, 'result.json'));
|
|
184
|
-
}
|
|
185
|
-
const isCacheUsable = bundleRequest.result?.errors?.length === 0;
|
|
186
|
-
// Only use cached result if it's successful.
|
|
187
|
-
if (!isCacheUsable) {
|
|
188
|
-
bundleRequest.result = await bundlePackage({
|
|
189
|
-
packagePath,
|
|
190
|
-
outputPath,
|
|
191
|
-
outputType: 'library',
|
|
192
|
-
incremental: !isExternal,
|
|
193
|
-
});
|
|
194
|
-
// Write the result to disk.
|
|
195
|
-
if (isExternal) {
|
|
196
|
-
await writeJson(path.join(outputPath, 'result.json'), bundleRequest.result);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
log(`Bundle cached, returning: "${bundleRequest.packageName}@${bundleRequest.version}"`);
|
|
201
|
-
}
|
|
202
|
-
return bundleRequest;
|
|
203
|
-
}
|
|
204
|
-
function initializeFileWatcher(session, bundleId, outputPath, bundleRequest, pendingBundles, apiServer) {
|
|
168
|
+
function initializeFileWatcher(session, bundleId, outputPath, bundleRequest, apiServer) {
|
|
205
169
|
const { id, packageName, packagePath, version } = bundleRequest;
|
|
206
170
|
let bundleOutput = bundleRequest.result;
|
|
207
171
|
log(`Initializing file watcher for ${packageName}@${version}`);
|
|
208
172
|
// TODO: This is a bit of a hack. We should be able to use the watch API, but it doesn't seem to work.
|
|
209
173
|
const watcher = chokidar.watch(path.join(packagePath, 'src')).on('change', (event) => {
|
|
210
|
-
if (!
|
|
174
|
+
if (!apiServer.pendingTask(id)) {
|
|
211
175
|
bundleRequest.isRebuildRequired = true;
|
|
212
176
|
log(`Detected change "${event}", rebuilding "${packageName}@${version}"`);
|
|
213
177
|
// eslint-disable-next-line no-async-promise-executor
|
|
214
|
-
|
|
178
|
+
new Promise(async (resolveIncremental) => {
|
|
215
179
|
do {
|
|
216
180
|
bundleRequest.isRebuildRequired = false;
|
|
217
181
|
log(`[Start] >> Bundling "${packageName}@${version}" to "${outputPath}"`);
|
|
@@ -224,7 +188,11 @@ function initializeFileWatcher(session, bundleId, outputPath, bundleRequest, pen
|
|
|
224
188
|
outputPath,
|
|
225
189
|
});
|
|
226
190
|
if (!bundleOutput?.rebuild) {
|
|
227
|
-
bundleOutput = (await
|
|
191
|
+
bundleOutput = (await apiServer.addTask({
|
|
192
|
+
name: `Bundle ${packageName}@${version}`,
|
|
193
|
+
id: bundleId,
|
|
194
|
+
execute: () => bundleTask(bundleRequest),
|
|
195
|
+
})).result;
|
|
228
196
|
}
|
|
229
197
|
else if (bundleOutput?.rebuild) {
|
|
230
198
|
bundleOutput = await bundleOutput.rebuild();
|
|
@@ -239,7 +207,6 @@ function initializeFileWatcher(session, bundleId, outputPath, bundleRequest, pen
|
|
|
239
207
|
});
|
|
240
208
|
log(`[ End ] << Bundled "${packageName}@${version}" (${bundleOutput?.outputFiles?.length || 0} file(s), ${bundleOutput?.errors?.length || 0} errors)`);
|
|
241
209
|
} while (bundleRequest.isRebuildRequired);
|
|
242
|
-
delete pendingBundles[id];
|
|
243
210
|
if (!bundleOutput?.errors?.length) {
|
|
244
211
|
log(`Notifying rebuild: ${packageName}@${version}`);
|
|
245
212
|
apiServer.notifyReload();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startBundleServer.js","sourceRoot":"","sources":["../../../src/commands/start/startBundleServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"startBundleServer.js","sourceRoot":"","sources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AC,KAAK,EAAE,CAAC;QAEhB,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, it, expect } from '@jest/globals';
|
|
2
|
+
import { TaskRunner } from './TaskRunner.js';
|
|
3
|
+
const tasks = [
|
|
4
|
+
{
|
|
5
|
+
name: 'Task 1',
|
|
6
|
+
id: '1',
|
|
7
|
+
execute: () => new Promise((r) => r('test value')),
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: 'Task 2',
|
|
11
|
+
id: '1',
|
|
12
|
+
execute: () => new Promise((r) => r('wrong value')),
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
describe('addTask', () => {
|
|
16
|
+
it('verify it resolves the promise', async () => {
|
|
17
|
+
const taskRunner = new TaskRunner();
|
|
18
|
+
expect(await taskRunner.add(tasks[0])).toEqual('test value');
|
|
19
|
+
});
|
|
20
|
+
it('verify it returns previous completed task with same id', async () => {
|
|
21
|
+
const taskRunner = new TaskRunner();
|
|
22
|
+
await taskRunner.add(tasks[0]);
|
|
23
|
+
// Task Runner should return task with same id
|
|
24
|
+
// since previous task is already completed.
|
|
25
|
+
expect(await taskRunner.add(tasks[1])).toEqual('test value');
|
|
26
|
+
});
|
|
27
|
+
it('verify it returns previous pending task with same id', async () => {
|
|
28
|
+
const taskRunner = new TaskRunner();
|
|
29
|
+
taskRunner.add(tasks[0]);
|
|
30
|
+
// Even though task[0].excute() and task[1].execute() return different strings,
|
|
31
|
+
// since their tasks share id, the task runner will return the promise of the first.
|
|
32
|
+
expect(await taskRunner.add(tasks[1])).toEqual('test value');
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=taskRunner.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskRunner.test.js","sourceRoot":"","sources":["../../../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QACpE,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;QAEpC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzB,+EAA+E;QAC/E,oFAAoF;QACpF,MAAM,CAAC,MAAM,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,20 +16,21 @@
|
|
|
16
16
|
"cloudpack": "./lib/cloudpack.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ms-cloudpack/bundler": "^0.3.
|
|
19
|
+
"@ms-cloudpack/bundler": "^0.3.10",
|
|
20
20
|
"@ms-cloudpack/create-express-app": "^0.1.0",
|
|
21
21
|
"@ms-cloudpack/data-bus": "^0.1.0",
|
|
22
22
|
"@ms-cloudpack/json-utilities": "^0.0.3",
|
|
23
23
|
"@ms-cloudpack/overlay": "^0.1.1",
|
|
24
|
-
"@ms-cloudpack/package-utilities": "^0.8.
|
|
25
|
-
"@ms-cloudpack/path-utilities": "^0.3.
|
|
24
|
+
"@ms-cloudpack/package-utilities": "^0.8.1",
|
|
25
|
+
"@ms-cloudpack/path-utilities": "^0.3.2",
|
|
26
26
|
"chokidar": "^3.5.3",
|
|
27
27
|
"commander": "^9.1.0",
|
|
28
28
|
"filenamify": "^5.1.0",
|
|
29
29
|
"fs-extra": "^10.1.0",
|
|
30
|
+
"glob": "^8.0.0",
|
|
30
31
|
"object-hash": "^3.0.0",
|
|
31
32
|
"open": "^8.4.0",
|
|
32
|
-
"
|
|
33
|
+
"p-queue": "^7.3.0",
|
|
33
34
|
"uuid": "^8.3.2"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
@@ -48,7 +49,10 @@
|
|
|
48
49
|
"build:watch": "cloudpack-scripts build-watch",
|
|
49
50
|
"build": "cloudpack-scripts build",
|
|
50
51
|
"lint:update": "cloudpack-scripts lint-update",
|
|
51
|
-
"lint": "cloudpack-scripts lint"
|
|
52
|
+
"lint": "cloudpack-scripts lint",
|
|
53
|
+
"test:update": "cloudpack-scripts test-update",
|
|
54
|
+
"test:watch": "cloudpack-scripts test-watch",
|
|
55
|
+
"test": "cloudpack-scripts test"
|
|
52
56
|
},
|
|
53
57
|
"files": [
|
|
54
58
|
"/lib"
|