@ms-cloudpack/api-server 0.35.0 → 0.36.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/lib/apis/ensurePackageBundled.d.ts.map +1 -1
- package/lib/apis/ensurePackageBundled.js +24 -4
- package/lib/apis/ensurePackageBundled.js.map +1 -1
- package/lib/data/busSources.d.ts +14 -0
- package/lib/data/busSources.d.ts.map +1 -1
- package/lib/types/BundleTaskOptions.d.ts +8 -0
- package/lib/types/BundleTaskOptions.d.ts.map +1 -1
- package/lib/types/BundleTaskOptions.js.map +1 -1
- package/lib/types/TaskDescription.d.ts +10 -0
- package/lib/types/TaskDescription.d.ts.map +1 -1
- package/lib/types/TaskEndDescription.d.ts +10 -0
- package/lib/types/TaskEndDescription.d.ts.map +1 -1
- package/lib/types/TaskMessage.d.ts +3 -0
- package/lib/types/TaskMessage.d.ts.map +1 -1
- package/lib/types/TaskMessage.js +1 -0
- package/lib/types/TaskMessage.js.map +1 -1
- package/lib/types/TaskResponse.d.ts +14 -0
- package/lib/types/TaskResponse.d.ts.map +1 -1
- package/lib/types/TaskResult.d.ts +10 -0
- package/lib/types/TaskResult.d.ts.map +1 -1
- package/lib/utilities/TaskRunner.d.ts.map +1 -1
- package/lib/utilities/TaskRunner.js +21 -35
- package/lib/utilities/TaskRunner.js.map +1 -1
- package/lib/utilities/addOverride.js +1 -1
- package/lib/utilities/addOverride.js.map +1 -1
- package/lib/utilities/bundleTask.d.ts.map +1 -1
- package/lib/utilities/bundleTask.js +10 -8
- package/lib/utilities/bundleTask.js.map +1 -1
- package/lib/utilities/createBundleRequestForPackage.d.ts +2 -4
- package/lib/utilities/createBundleRequestForPackage.d.ts.map +1 -1
- package/lib/utilities/createBundleRequestForPackage.js +3 -10
- package/lib/utilities/createBundleRequestForPackage.js.map +1 -1
- package/lib/utilities/createBundleTask.d.ts.map +1 -1
- package/lib/utilities/createBundleTask.js +4 -3
- package/lib/utilities/createBundleTask.js.map +1 -1
- package/lib/utilities/formatBundleErrors.js +5 -9
- package/lib/utilities/formatBundleErrors.js.map +1 -1
- package/lib/utilities/getBundleLocation.d.ts +1 -0
- package/lib/utilities/getBundleLocation.d.ts.map +1 -1
- package/lib/utilities/getBundleLocation.js +11 -10
- package/lib/utilities/getBundleLocation.js.map +1 -1
- package/package.json +10 -10
|
@@ -2,7 +2,7 @@ import filenamify from 'filenamify';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { getCachePath } from './getCachePath.js';
|
|
4
4
|
export async function getBundleLocation(options, context) {
|
|
5
|
-
const { packagePath, shouldRecalculate } = options;
|
|
5
|
+
const { packagePath, shouldRecalculate, hash } = options;
|
|
6
6
|
const { packages, packageHashes } = context;
|
|
7
7
|
const definition = await packages.get(packagePath);
|
|
8
8
|
if (!definition) {
|
|
@@ -12,15 +12,16 @@ export async function getBundleLocation(options, context) {
|
|
|
12
12
|
throw new Error(`Package definition (package.json) missing name at "${packagePath}"`);
|
|
13
13
|
}
|
|
14
14
|
const { name, version } = definition;
|
|
15
|
-
const hashResult =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const hashResult = hash ||
|
|
16
|
+
(await packageHashes.get({
|
|
17
|
+
packagePath,
|
|
18
|
+
/**
|
|
19
|
+
* We don't use source hashing for location,
|
|
20
|
+
* because we do not want to create a new folder for each change in a package.
|
|
21
|
+
*/
|
|
22
|
+
isSourceHashingEnabled: false,
|
|
23
|
+
shouldRecalculate,
|
|
24
|
+
}));
|
|
24
25
|
// Derive where the output should be.
|
|
25
26
|
const folderName = `${filenamify(name, { replacement: '^' })}-${version}-${hashResult}`;
|
|
26
27
|
const outputPath = path.join(getCachePath(), folderName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBundleLocation.js","sourceRoot":"","sources":["../../src/utilities/getBundleLocation.ts"],"names":[],"mappings":"AAAA,OA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AAE,CAAC;IACxF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,UAAU,CAAC,CAAC;IAEzD,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import filenamify from 'filenamify';\nimport path from 'path';\nimport { getCachePath } from './getCachePath.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';\nimport type { PackageHashes } from '@ms-cloudpack/package-hashes';\n\nexport async function getBundleLocation(\n options: { packagePath: string; shouldRecalculate?: boolean; hash?: string },\n context: {\n packages: PackageDefinitionsCache;\n packageHashes: PackageHashes;\n },\n) {\n const { packagePath, shouldRecalculate, hash } = options;\n const { packages, packageHashes } = context;\n const definition = await packages.get(packagePath);\n\n if (!definition) {\n throw new Error(`Package definition (package.json) missing or invalid at \"${packagePath}\"`);\n }\n\n if (!definition.name) {\n throw new Error(`Package definition (package.json) missing name at \"${packagePath}\"`);\n }\n\n const { name, version } = definition;\n\n const hashResult =\n hash ||\n (await packageHashes.get({\n packagePath,\n /**\n * We don't use source hashing for location,\n * because we do not want to create a new folder for each change in a package.\n */\n isSourceHashingEnabled: false,\n shouldRecalculate,\n }));\n // Derive where the output should be.\n const folderName = `${filenamify(name, { replacement: '^' })}-${version}-${hashResult}`;\n const outputPath = path.join(getCachePath(), folderName);\n\n return {\n path: outputPath,\n folderName,\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"@lage-run/logger": "^1.3.0",
|
|
28
28
|
"@lage-run/scheduler": "^1.1.9",
|
|
29
29
|
"@lage-run/target-graph": "^0.8.9",
|
|
30
|
-
"@ms-cloudpack/bundler": "^0.19.
|
|
31
|
-
"@ms-cloudpack/common-types": "^0.2.
|
|
32
|
-
"@ms-cloudpack/config": "^0.
|
|
33
|
-
"@ms-cloudpack/create-express-app": "^1.6.
|
|
30
|
+
"@ms-cloudpack/bundler": "^0.19.2",
|
|
31
|
+
"@ms-cloudpack/common-types": "^0.2.1",
|
|
32
|
+
"@ms-cloudpack/config": "^0.19.0",
|
|
33
|
+
"@ms-cloudpack/create-express-app": "^1.6.2",
|
|
34
34
|
"@ms-cloudpack/data-bus": "^0.4.2",
|
|
35
35
|
"@ms-cloudpack/file-watcher": "^0.1.2",
|
|
36
|
-
"@ms-cloudpack/import-map": "^0.2.
|
|
36
|
+
"@ms-cloudpack/import-map": "^0.2.2",
|
|
37
37
|
"@ms-cloudpack/json-utilities": "^0.1.4",
|
|
38
|
-
"@ms-cloudpack/package-hashes": "^0.5.
|
|
39
|
-
"@ms-cloudpack/package-utilities": "^7.1.
|
|
38
|
+
"@ms-cloudpack/package-hashes": "^0.5.2",
|
|
39
|
+
"@ms-cloudpack/package-utilities": "^7.1.2",
|
|
40
40
|
"@ms-cloudpack/path-string-parsing": "^1.2.1",
|
|
41
41
|
"@ms-cloudpack/path-utilities": "^2.6.1",
|
|
42
|
-
"@ms-cloudpack/remote-cache": "^0.6.
|
|
43
|
-
"@ms-cloudpack/task-reporter": "^0.
|
|
42
|
+
"@ms-cloudpack/remote-cache": "^0.6.3",
|
|
43
|
+
"@ms-cloudpack/task-reporter": "^0.12.0",
|
|
44
44
|
"@ms-cloudpack/telemetry": "^0.5.1",
|
|
45
45
|
"@trpc/client": "^10.45.0",
|
|
46
46
|
"@trpc/server": "^10.45.0",
|