@ms-cloudpack/api-server 0.7.1 → 0.7.2
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/tsdoc-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addOverride.d.ts","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,EACD,OAAO,EAAE;IACP,QAAQ,EAAE,uBAAuB,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,
|
|
1
|
+
{"version":3,"file":"addOverride.d.ts","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,EACD,OAAO,EAAE;IACP,QAAQ,EAAE,uBAAuB,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,iBA0DF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addExportsMapEntry, findResolveMapEntry, getExportsMap } from '@ms-cloudpack/package-utilities';
|
|
2
2
|
import { slash } from '@ms-cloudpack/path-string-parsing';
|
|
3
3
|
import { parseRequestInfo } from './parseRequestInfo.js';
|
|
4
|
-
import {
|
|
4
|
+
import { readUserConfig, writeUserConfig } from '@ms-cloudpack/config';
|
|
5
5
|
/**
|
|
6
6
|
* The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path
|
|
7
7
|
* that isn't recognized. When the user trigers this override, we write it to the cloudpack user config, rather
|
|
@@ -27,8 +27,8 @@ export async function addOverride(options, context) {
|
|
|
27
27
|
}
|
|
28
28
|
// Get current exports. We want to add an additional entry to what's there - not replace the default exports,
|
|
29
29
|
// so we need the full map for the package.
|
|
30
|
-
const exports = await getExportsMap({ packagePath: entry.path },
|
|
31
|
-
// Now add the exports entry.
|
|
30
|
+
const exports = await getExportsMap({ packagePath: entry.path }, context);
|
|
31
|
+
// Now add the single new exports entry.
|
|
32
32
|
await addExportsMapEntry({
|
|
33
33
|
exports,
|
|
34
34
|
packagePath: entry.path,
|
|
@@ -38,24 +38,13 @@ export async function addOverride(options, context) {
|
|
|
38
38
|
const config = await readUserConfig(session.appPath);
|
|
39
39
|
// Ensure packageSettings exist.
|
|
40
40
|
config.packageSettings ??= [];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
config.packageSettings.push({
|
|
42
|
+
match: {
|
|
43
|
+
name: packageName,
|
|
44
|
+
version: entry.version?.match(/^\d+\.\d+\.\d+(-[a-z0-9.-]+)?$/) ? `^${entry.version}` : undefined,
|
|
45
|
+
},
|
|
46
|
+
exports,
|
|
46
47
|
});
|
|
47
|
-
// Initialize a new one if needed.
|
|
48
|
-
if (!setting) {
|
|
49
|
-
setting = {
|
|
50
|
-
match: {
|
|
51
|
-
name: packageName,
|
|
52
|
-
version: entry.version?.match(/^\d+\.\d+\.\d+(-[a-z0-9.-]+)?$/) ? `^${entry.version}` : undefined,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
config.packageSettings.push(setting);
|
|
56
|
-
}
|
|
57
|
-
// Update the exports.
|
|
58
|
-
setting.exports = exports;
|
|
59
48
|
// Write config.
|
|
60
49
|
await writeUserConfig(config, session.appPath);
|
|
61
50
|
console.debug(`Added override for "${packageName}" to "cloudpack.config.json".`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addOverride.js","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEzG,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"addOverride.js","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEzG,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAIC,EACD,OAGC;IAED,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACvD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtC,IAAI,UAAU,GAAG,SAAS,CAAC;IAE3B,IAAI,SAAS,EAAE;QACb,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACrE,UAAU,GAAG,EAAE,IAAI,EAAE,OA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ms-cloudpack/package-utilities';\nimport type { Session } from '../types/Session.js';\nimport { slash } from '@ms-cloudpack/path-string-parsing';\nimport { parseRequestInfo } from './parseRequestInfo.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { readUserConfig, writeUserConfig } from '@ms-cloudpack/config';\n\n/**\n * The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path\n * that isn't recognized. When the user trigers this override, we write it to the cloudpack user config, rather\n * than generated configs which could get \"reset\" on `init --reset`.\n */\nexport async function addOverride(\n options: {\n packageName: string;\n importPath: string;\n issuerUrl?: string;\n },\n context: {\n packages: PackageDefinitionsCache;\n session: Session;\n },\n) {\n const { packageName, importPath, issuerUrl } = options;\n const { session, packages } = context;\n let definition = undefined;\n\n if (issuerUrl) {\n const requestPath = slash(new URL(issuerUrl).pathname);\n const { packageName: name, version } = parseRequestInfo(requestPath);\n definition = { name, version };\n }\n\n const entry = findResolveMapEntry({\n packageName,\n resolveMap: session.resolveMap,\n definition,\n });\n\n if (entry === undefined) {\n console.error(`Could not find entry of package \"${packageName}\" in resolve map`);\n return;\n }\n\n // Get current exports. We want to add an additional entry to what's there - not replace the default exports,\n // so we need the full map for the package.\n const exports = await getExportsMap({ packagePath: entry.path }, context);\n\n // Now add the single new exports entry.\n await addExportsMapEntry(\n {\n exports,\n packagePath: entry.path,\n importPath,\n },\n { packages },\n );\n\n // Parse the user config if it exists.\n const config = await readUserConfig(session.appPath);\n\n // Ensure packageSettings exist.\n config.packageSettings ??= [];\n\n config.packageSettings.push({\n match: {\n name: packageName,\n version: entry.version?.match(/^\\d+\\.\\d+\\.\\d+(-[a-z0-9.-]+)?$/) ? `^${entry.version}` : undefined,\n },\n exports,\n });\n\n // Write config.\n await writeUserConfig(config, session.appPath);\n\n console.debug(`Added override for \"${packageName}\" to \"cloudpack.config.json\".`);\n\n // Instruct the package cache to reset, so that transforms can respect the modification to the exports map.\n packages.reset({ newConfig: config });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"@lage-run/target-graph": "^0.8.6",
|
|
19
19
|
"@lage-run/hasher": "^1.0.0",
|
|
20
20
|
"@ms-cloudpack/bundler-types": "^0.16.0",
|
|
21
|
-
"@ms-cloudpack/config": "^0.
|
|
21
|
+
"@ms-cloudpack/config": "^0.9.0",
|
|
22
22
|
"@ms-cloudpack/create-express-app": "^1.3.8",
|
|
23
23
|
"@ms-cloudpack/data-bus": "^0.3.1",
|
|
24
|
-
"@ms-cloudpack/package-utilities": "^5.0.
|
|
24
|
+
"@ms-cloudpack/package-utilities": "^5.0.1",
|
|
25
25
|
"@ms-cloudpack/path-string-parsing": "^1.0.3",
|
|
26
26
|
"@ms-cloudpack/task-reporter": "^0.6.0",
|
|
27
27
|
"@ms-cloudpack/telemetry": "^0.3.6",
|