@antelopejs/dms 0.9.0 → 0.9.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/CHANGELOG.md +34 -0
- package/data/module-store/catalog.json +71 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/implementations/dms/frontend-modules.d.ts +2 -0
- package/dist/implementations/dms/frontend-modules.js +29 -1
- package/dist/implementations/dms/frontend-modules.js.map +1 -1
- package/dist/implementations/dms/frontend-ready.d.ts +8 -0
- package/dist/implementations/dms/frontend-ready.js +34 -0
- package/dist/implementations/dms/frontend-ready.js.map +1 -0
- package/dist/implementations/dms/manifest.d.ts +1 -0
- package/dist/implementations/dms/manifest.js.map +1 -1
- package/dist/implementations/dms/page.d.ts +2 -0
- package/dist/implementations/dms/page.js +16 -0
- package/dist/implementations/dms/page.js.map +1 -1
- package/dist/implementations/dms-auth/index.js +1 -1
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/store.d.ts +21 -0
- package/dist/routes/store.js +130 -0
- package/dist/routes/store.js.map +1 -0
- package/dist/store/activity.d.ts +2 -0
- package/dist/store/activity.js +12 -0
- package/dist/store/activity.js.map +1 -0
- package/dist/store/cache.d.ts +8 -0
- package/dist/store/cache.js +29 -0
- package/dist/store/cache.js.map +1 -0
- package/dist/store/catalog.d.ts +4 -0
- package/dist/store/catalog.js +69 -0
- package/dist/store/catalog.js.map +1 -0
- package/dist/store/compatibility.d.ts +3 -0
- package/dist/store/compatibility.js +45 -0
- package/dist/store/compatibility.js.map +1 -0
- package/dist/store/declarations.d.ts +18 -0
- package/dist/store/declarations.js +116 -0
- package/dist/store/declarations.js.map +1 -0
- package/dist/store/frontend-compatibility.d.ts +18 -0
- package/dist/store/frontend-compatibility.js +93 -0
- package/dist/store/frontend-compatibility.js.map +1 -0
- package/dist/store/interfaces.d.ts +6 -0
- package/dist/store/interfaces.js +126 -0
- package/dist/store/interfaces.js.map +1 -0
- package/dist/store/listing.d.ts +2 -0
- package/dist/store/listing.js +180 -0
- package/dist/store/listing.js.map +1 -0
- package/dist/store/operations.d.ts +8 -0
- package/dist/store/operations.js +254 -0
- package/dist/store/operations.js.map +1 -0
- package/dist/store/registry.d.ts +4 -0
- package/dist/store/registry.js +61 -0
- package/dist/store/registry.js.map +1 -0
- package/dist/store/requirements.d.ts +14 -0
- package/dist/store/requirements.js +81 -0
- package/dist/store/requirements.js.map +1 -0
- package/dist/store/runtime.d.ts +11 -0
- package/dist/store/runtime.js +78 -0
- package/dist/store/runtime.js.map +1 -0
- package/dist/store/tarball.d.ts +2 -0
- package/dist/store/tarball.js +80 -0
- package/dist/store/tarball.js.map +1 -0
- package/dist/store/types.d.ts +98 -0
- package/dist/store/types.js +3 -0
- package/dist/store/types.js.map +1 -0
- package/dist/test/unit/interfaces/dms/page-extension-ownership.test.js +1 -1
- package/dist/test/unit/interfaces/dms/page-extension-ownership.test.js.map +1 -1
- package/dist/test/unit/store/store.test.d.ts +1 -0
- package/dist/test/unit/store/store.test.js +127 -0
- package/dist/test/unit/store/store.test.js.map +1 -0
- package/dist/test/unit/utils/user-activity.test.js +4 -12
- package/dist/test/unit/utils/user-activity.test.js.map +1 -1
- package/dist/utils/user-activity.d.ts +1 -1
- package/dist/utils/user-activity.js +6 -3
- package/dist/utils/user-activity.js.map +1 -1
- package/dist/validation/store.schema.d.ts +39 -0
- package/dist/validation/store.schema.js +27 -0
- package/dist/validation/store.schema.js.map +1 -0
- package/frontend-vue/layers/dms-layout/app/build/components/pages/modules/ModuleStoreDependencyPicker.vue +136 -0
- package/frontend-vue/layers/dms-layout/app/build/components/pages/modules/ModuleStoreRequirements.vue +98 -0
- package/frontend-vue/layers/dms-layout/app/build/components/pages/modules/ModuleStoreTile.vue +247 -29
- package/frontend-vue/layers/dms-layout/app/build/components/pages/modules/ModuleTile.vue +19 -2
- package/frontend-vue/layers/dms-layout/app/build/utils/module-store-catalog.ts +186 -120
- package/frontend-vue/layers/dms-layout/app/build/utils/module-store-install.ts +146 -0
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStore.ts +109 -0
- package/frontend-vue/layers/dms-layout/app/custom-pages/modules.vue +335 -34
- package/frontend-vue/layers/dms-layout/app/types/module-store.ts +134 -0
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +107 -9
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +107 -9
- package/frontend-vue/package.json +3 -3
- package/frontend-vue/pnpm-lock.yaml +16 -22
- package/frontend-vue/tests/module-store-catalog.test.ts +270 -51
- package/frontend-vue/tests/top-list-card-period-badge-ssr.test.ts +212 -0
- package/package.json +5 -5
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readCatalogDocument = readCatalogDocument;
|
|
7
|
+
exports.loadStoreCatalog = loadStoreCatalog;
|
|
8
|
+
exports.findCatalogEntry = findCatalogEntry;
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
12
|
+
const config_1 = require("../config");
|
|
13
|
+
const BUNDLED_CATALOG_PATH = node_path_1.default.join(__dirname, "../../data/module-store/catalog.json");
|
|
14
|
+
const CATALOG_TTL_MS = 60 * 60 * 1000;
|
|
15
|
+
const CATALOG_FETCH_TIMEOUT_MS = 10_000;
|
|
16
|
+
const SUPPORTED_CATALOG_VERSION = 1;
|
|
17
|
+
let cachedRemote;
|
|
18
|
+
let bundled;
|
|
19
|
+
function isCatalogEntry(value) {
|
|
20
|
+
const entry = value;
|
|
21
|
+
return (typeof entry?.id === "string" &&
|
|
22
|
+
typeof entry.package === "string" &&
|
|
23
|
+
typeof entry.icon === "string" &&
|
|
24
|
+
typeof entry.category === "string");
|
|
25
|
+
}
|
|
26
|
+
function readCatalogDocument(document) {
|
|
27
|
+
const catalog = document;
|
|
28
|
+
if (catalog?.version !== SUPPORTED_CATALOG_VERSION) {
|
|
29
|
+
throw new Error(`Unsupported module catalog version: ${String(catalog?.version)}`);
|
|
30
|
+
}
|
|
31
|
+
return (catalog.modules ?? []).filter(isCatalogEntry);
|
|
32
|
+
}
|
|
33
|
+
function bundledCatalog() {
|
|
34
|
+
bundled ??= readCatalogDocument(JSON.parse((0, node_fs_1.readFileSync)(BUNDLED_CATALOG_PATH, "utf-8")));
|
|
35
|
+
return bundled;
|
|
36
|
+
}
|
|
37
|
+
async function fetchRemoteCatalog(url) {
|
|
38
|
+
const response = await fetch(url, {
|
|
39
|
+
signal: AbortSignal.timeout(CATALOG_FETCH_TIMEOUT_MS),
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error(`HTTP ${response.status}`);
|
|
43
|
+
}
|
|
44
|
+
return readCatalogDocument(await response.json());
|
|
45
|
+
}
|
|
46
|
+
async function loadStoreCatalog() {
|
|
47
|
+
const url = (0, config_1.getStoreConfig)().catalogUrl;
|
|
48
|
+
if (!url) {
|
|
49
|
+
return bundledCatalog();
|
|
50
|
+
}
|
|
51
|
+
const isFresh = cachedRemote?.url === url &&
|
|
52
|
+
Date.now() - cachedRemote.fetchedAt < CATALOG_TTL_MS;
|
|
53
|
+
if (isFresh && cachedRemote) {
|
|
54
|
+
return cachedRemote.modules;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const modules = await fetchRemoteCatalog(url);
|
|
58
|
+
cachedRemote = { url, fetchedAt: Date.now(), modules };
|
|
59
|
+
return modules;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
logging_1.Logging.Warn(`[DMS] Module catalog ${url} could not be read, using the bundled one: ${String(error)}`);
|
|
63
|
+
return cachedRemote?.url === url ? cachedRemote.modules : bundledCatalog();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function findCatalogEntry(id) {
|
|
67
|
+
return (await loadStoreCatalog()).find((entry) => entry.id === id);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/store/catalog.ts"],"names":[],"mappings":";;;;;AAsCA,kDAQC;AAuBD,4CAqBC;AAGD,4CAIC;AAjGD,qCAAuC;AACvC,0DAA6B;AAC7B,gEAA6D;AAC7D,sCAA2C;AAG3C,MAAM,oBAAoB,GAAG,mBAAI,CAAC,IAAI,CACpC,SAAS,EACT,sCAAsC,CACvC,CAAC;AACF,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAQpC,IAAI,YAAuC,CAAC;AAC5C,IAAI,OAAwC,CAAC;AAE7C,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,KAAK,GAAG,KAA0C,CAAC;IACzD,OAAO,CACL,OAAO,KAAK,EAAE,EAAE,KAAK,QAAQ;QAC7B,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QACjC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CACnC,CAAC;AACJ,CAAC;AAOD,SAAgB,mBAAmB,CAAC,QAAiB;IACnD,MAAM,OAAO,GAAG,QAAwC,CAAC;IACzD,IAAI,OAAO,EAAE,OAAO,KAAK,yBAAyB,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,uCAAuC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAClE,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AC;QACvD,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAO,CAAC,IAAI,CACV,wBAAwB,GAAG,8CAA8C,MAAM,CAAC,KAAK,CAAC,EAAE,CACzF,CAAC;QACF,OAAO,YAAY,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;IAC7E,CAAC;AACH,CAAC;AAGM,KAAK,UAAU,gBAAgB,CACpC,EAAU;IAEV,OAAO,CAAC,MAAM,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.installedInterfaceVersion = installedInterfaceVersion;
|
|
7
|
+
exports.isCompatible = isCompatible;
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const semver_1 = require("semver");
|
|
11
|
+
const registry_1 = require("./registry");
|
|
12
|
+
const PACKAGE_JSON = "package.json";
|
|
13
|
+
const INTERFACE_ENTRY = `${registry_1.INTERFACE_PACKAGE}/page`;
|
|
14
|
+
let interfaceVersion;
|
|
15
|
+
function readManifest(folder) {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse((0, node_fs_1.readFileSync)(node_path_1.default.join(folder, PACKAGE_JSON), "utf-8"));
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function installedInterfaceVersion() {
|
|
24
|
+
if (interfaceVersion)
|
|
25
|
+
return interfaceVersion;
|
|
26
|
+
let folder = node_path_1.default.dirname(require.resolve(INTERFACE_ENTRY));
|
|
27
|
+
while (folder !== node_path_1.default.dirname(folder)) {
|
|
28
|
+
const manifest = readManifest(folder);
|
|
29
|
+
if (manifest?.name === registry_1.INTERFACE_PACKAGE && manifest.version) {
|
|
30
|
+
interfaceVersion = manifest.version;
|
|
31
|
+
return interfaceVersion;
|
|
32
|
+
}
|
|
33
|
+
folder = node_path_1.default.dirname(folder);
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Cannot find the installed ${registry_1.INTERFACE_PACKAGE} version`);
|
|
36
|
+
}
|
|
37
|
+
function isCompatible(release, installedVersion) {
|
|
38
|
+
const range = release.interfaceRange
|
|
39
|
+
? (0, semver_1.validRange)(release.interfaceRange)
|
|
40
|
+
: null;
|
|
41
|
+
if (!range)
|
|
42
|
+
return true;
|
|
43
|
+
return (0, semver_1.satisfies)(installedVersion, range, { includePrerelease: true });
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../src/store/compatibility.ts"],"names":[],"mappings":";;;;;AA+BA,8DAYC;AAOD,oCASC;AA3DD,qCAAuC;AACvC,0DAA6B;AAC7B,mCAA+C;AAC/C,yCAA+C;AAG/C,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,eAAe,GAAG,GAAG,4BAAiB,OAAO,CAAC;AAOpD,IAAI,gBAAoC,CAAC;AAEzC,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CACf,IAAA,sBAAY,EAAC,mBAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CACpC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAOD,SAAgB,yBAAyB;IACvC,IAAI,gBAAgB;QAAE,OAAO,gBAAgB,CAAC;IAC9C,IAAI,MAAM,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IAC5D,OAAO,MAAM,KAAK,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,QAAQ,EAAE,IAAI,KAAK,4BAAiB,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC7D,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC;YACpC,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QACD,MAAM,GAAG,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6BAA6B,4BAAiB,UAAU,CAAC,CAAC;AAC5E,CAAC;AAOD,SAAgB,YAAY,CAC1B,OAAuB,EACvB,gBAAwB;IAExB,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc;QAClC,CAAC,CAAC,IAAA,mBAAU,EAAC,OAAO,CAAC,cAAc,CAAC;QACpC,CAAC,CAAC,IAAI,CAAC;IACT,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,IAAA,kBAAS,EAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModuleSourcePackage } from "@antelopejs/interface-core/config";
|
|
2
|
+
import type { StoreCatalogEntry, StoreDeclaration } from "./types";
|
|
3
|
+
interface ModuleDeclaration {
|
|
4
|
+
source?: unknown;
|
|
5
|
+
config?: unknown;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type ModuleDeclarationChanges = Partial<ModuleDeclaration>;
|
|
10
|
+
export declare class DeclarationsUnavailableError extends Error {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare function listCatalogDeclarations(catalog: readonly StoreCatalogEntry[]): Promise<Map<string, StoreDeclaration>>;
|
|
14
|
+
export declare function hasDeclaration(key: string): Promise<boolean>;
|
|
15
|
+
export declare function saveDeclaration(key: string, changes: ModuleDeclarationChanges): Promise<void>;
|
|
16
|
+
export declare function removeDeclaration(key: string): Promise<void>;
|
|
17
|
+
export declare function packageDeclarationSource(packageName: string, range: string): ModuleSourcePackage;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DeclarationsUnavailableError = void 0;
|
|
37
|
+
exports.listCatalogDeclarations = listCatalogDeclarations;
|
|
38
|
+
exports.hasDeclaration = hasDeclaration;
|
|
39
|
+
exports.saveDeclaration = saveDeclaration;
|
|
40
|
+
exports.removeDeclaration = removeDeclaration;
|
|
41
|
+
exports.packageDeclarationSource = packageDeclarationSource;
|
|
42
|
+
const coreModules = __importStar(require("@antelopejs/interface-core/modules"));
|
|
43
|
+
const PACKAGE_SOURCE_TYPE = "package";
|
|
44
|
+
const DECLARATIONS_TIMEOUT_MS = 5000;
|
|
45
|
+
const DECLARATION_FUNCTIONS = [
|
|
46
|
+
"ListModuleDeclarations",
|
|
47
|
+
"SaveModuleDeclaration",
|
|
48
|
+
"RemoveModuleDeclaration",
|
|
49
|
+
];
|
|
50
|
+
class DeclarationsUnavailableError extends Error {
|
|
51
|
+
constructor() {
|
|
52
|
+
super("This @antelopejs/core cannot edit antelope.config.ts: update it to one that implements the module declaration functions");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.DeclarationsUnavailableError = DeclarationsUnavailableError;
|
|
56
|
+
function isFunction(value) {
|
|
57
|
+
return typeof value === "function";
|
|
58
|
+
}
|
|
59
|
+
function declarationFunctions() {
|
|
60
|
+
const exported = { ...coreModules };
|
|
61
|
+
const functions = DECLARATION_FUNCTIONS.map((name) => exported[name]);
|
|
62
|
+
if (!functions.every(isFunction)) {
|
|
63
|
+
throw new DeclarationsUnavailableError();
|
|
64
|
+
}
|
|
65
|
+
const [list, save, remove] = functions;
|
|
66
|
+
return {
|
|
67
|
+
ListModuleDeclarations: list,
|
|
68
|
+
SaveModuleDeclaration: save,
|
|
69
|
+
RemoveModuleDeclaration: remove,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function withTimeout(call) {
|
|
73
|
+
let timer;
|
|
74
|
+
const timeout = new Promise((_, reject) => {
|
|
75
|
+
timer = setTimeout(() => reject(new DeclarationsUnavailableError()), DECLARATIONS_TIMEOUT_MS);
|
|
76
|
+
timer.unref();
|
|
77
|
+
});
|
|
78
|
+
return Promise.race([call, timeout]).finally(() => clearTimeout(timer));
|
|
79
|
+
}
|
|
80
|
+
function packageSource(declaration) {
|
|
81
|
+
const source = declaration.source;
|
|
82
|
+
return source?.type === PACKAGE_SOURCE_TYPE ? source : undefined;
|
|
83
|
+
}
|
|
84
|
+
async function listCatalogDeclarations(catalog) {
|
|
85
|
+
const declarations = await withTimeout(declarationFunctions().ListModuleDeclarations());
|
|
86
|
+
const byPackage = new Map(catalog.map((entry) => [entry.package, entry.id]));
|
|
87
|
+
const result = new Map();
|
|
88
|
+
for (const [key, declaration] of Object.entries(declarations)) {
|
|
89
|
+
const source = packageSource(declaration);
|
|
90
|
+
const id = source?.package ? byPackage.get(source.package) : undefined;
|
|
91
|
+
if (!id || !source?.package || result.has(id))
|
|
92
|
+
continue;
|
|
93
|
+
result.set(id, {
|
|
94
|
+
key,
|
|
95
|
+
package: source.package,
|
|
96
|
+
range: source.version ?? "",
|
|
97
|
+
disabled: declaration.disabled === true,
|
|
98
|
+
config: declaration.config,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
async function hasDeclaration(key) {
|
|
104
|
+
const declarations = await withTimeout(declarationFunctions().ListModuleDeclarations());
|
|
105
|
+
return Object.hasOwn(declarations, key);
|
|
106
|
+
}
|
|
107
|
+
function saveDeclaration(key, changes) {
|
|
108
|
+
return withTimeout(declarationFunctions().SaveModuleDeclaration(key, changes));
|
|
109
|
+
}
|
|
110
|
+
function removeDeclaration(key) {
|
|
111
|
+
return withTimeout(declarationFunctions().RemoveModuleDeclaration(key));
|
|
112
|
+
}
|
|
113
|
+
function packageDeclarationSource(packageName, range) {
|
|
114
|
+
return { type: PACKAGE_SOURCE_TYPE, package: packageName, version: range };
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["../../src/store/declarations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGA,0DAqBC;AAGD,wCAKC;AAED,0CAOC;AAED,8CAEC;AAGD,4DAKC;AAtJD,gFAAkE;AAGlE,MAAM,mBAAmB,GAAG,SAAkB,CAAC;AAK/C,MAAM,uBAAuB,GAAG,IAAI,CAAC;AA0BrC,MAAM,qBAAqB,GAA8C;IACvE,wBAAwB;IACxB,uBAAuB;IACvB,yBAAyB;CAC1B,CAAC;AASF,MAAa,4BAA6B,SAAQ,KAAK;IACrD;QACE,KAAK,CACH,yHAAyH,CAC1H,CAAC;IACJ,CAAC;CACF;AAND,oEAMC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,oBAAoB;IAC3B,MAAM,QAAQ,GAA4B,EAAE,GAAG,WAAW,EAAE,CAAC;IAC7D,MAAM,SAAS,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,4BAA4B,EAAE,CAAC;IAC3C,CAAC;IACD,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM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EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FrontendRequirement, FrontendVersionSource } from "./types";
|
|
2
|
+
export declare const FRONTEND_PACKAGE = "@antelopejs/dms-frontend";
|
|
3
|
+
export interface RunningFrontend {
|
|
4
|
+
version: string;
|
|
5
|
+
source: FrontendVersionSource;
|
|
6
|
+
}
|
|
7
|
+
type DeclaredRange = string | null;
|
|
8
|
+
export declare function releaseFrontendRange(packageName: string, version: string, projectPath: string): Promise<DeclaredRange | undefined>;
|
|
9
|
+
export declare function runningFrontend(projectPath: string): RunningFrontend | undefined;
|
|
10
|
+
export declare function supportsFrontend(range: string, version: string): boolean;
|
|
11
|
+
export interface FrontendRequirementInput {
|
|
12
|
+
range: string;
|
|
13
|
+
running: string;
|
|
14
|
+
projectPath: string;
|
|
15
|
+
replacedFolder?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function frontendRequirement(input: FrontendRequirementInput): Promise<FrontendRequirement | undefined>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FRONTEND_PACKAGE = void 0;
|
|
7
|
+
exports.releaseFrontendRange = releaseFrontendRange;
|
|
8
|
+
exports.runningFrontend = runningFrontend;
|
|
9
|
+
exports.supportsFrontend = supportsFrontend;
|
|
10
|
+
exports.frontendRequirement = frontendRequirement;
|
|
11
|
+
const node_fs_1 = require("node:fs");
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
const semver_1 = require("semver");
|
|
14
|
+
const frontend_modules_1 = require("../implementations/dms/frontend-modules");
|
|
15
|
+
const frontend_ready_1 = require("../implementations/dms/frontend-ready");
|
|
16
|
+
const cache_1 = require("./cache");
|
|
17
|
+
const registry_1 = require("./registry");
|
|
18
|
+
const tarball_1 = require("./tarball");
|
|
19
|
+
exports.FRONTEND_PACKAGE = "@antelopejs/dms-frontend";
|
|
20
|
+
const LAYER_MANIFEST = "frontend-vue/package.json";
|
|
21
|
+
const PACKAGE_JSON = "package.json";
|
|
22
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
23
|
+
const FAILED_LOOKUP_MS = 5 * 60 * 1000;
|
|
24
|
+
const RELEASE_RANGE_LIFETIMES = { found: Infinity, failed: FAILED_LOOKUP_MS };
|
|
25
|
+
const VERSIONS_LIFETIMES = { found: HOUR_MS, failed: FAILED_LOOKUP_MS };
|
|
26
|
+
const releaseRanges = (0, cache_1.createLookupCache)(RELEASE_RANGE_LIFETIMES);
|
|
27
|
+
const publishedVersions = (0, cache_1.createLookupCache)(VERSIONS_LIFETIMES);
|
|
28
|
+
function readManifest(file) {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse((0, node_fs_1.readFileSync)(file, "utf-8"));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function engineRange(manifest) {
|
|
37
|
+
const range = manifest?.engines?.[exports.FRONTEND_PACKAGE];
|
|
38
|
+
return typeof range === "string" && (0, semver_1.validRange)(range) ? range : null;
|
|
39
|
+
}
|
|
40
|
+
function releaseFrontendRange(packageName, version, projectPath) {
|
|
41
|
+
return releaseRanges.get(`${packageName}@${version}`, async () => {
|
|
42
|
+
const files = await (0, tarball_1.readPublishedFiles)(packageName, version, projectPath, [
|
|
43
|
+
LAYER_MANIFEST,
|
|
44
|
+
]);
|
|
45
|
+
const manifest = files.get(LAYER_MANIFEST);
|
|
46
|
+
return manifest
|
|
47
|
+
? engineRange(JSON.parse(manifest))
|
|
48
|
+
: null;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function runningFrontend(projectPath) {
|
|
52
|
+
const reported = (0, frontend_ready_1.getFrontendAcknowledgement)()?.version;
|
|
53
|
+
if (reported)
|
|
54
|
+
return { version: reported, source: "reported" };
|
|
55
|
+
const installed = readManifest(node_path_1.default.join(projectPath, "node_modules", exports.FRONTEND_PACKAGE, PACKAGE_JSON))?.version;
|
|
56
|
+
return installed ? { version: installed, source: "project" } : undefined;
|
|
57
|
+
}
|
|
58
|
+
function supportsFrontend(range, version) {
|
|
59
|
+
const line = (0, semver_1.coerce)(version)?.version ?? version;
|
|
60
|
+
return (0, semver_1.satisfies)(line, range);
|
|
61
|
+
}
|
|
62
|
+
function listPublishedVersions(projectPath) {
|
|
63
|
+
return publishedVersions.get(exports.FRONTEND_PACKAGE, async () => {
|
|
64
|
+
const versions = await (0, registry_1.npmView)(exports.FRONTEND_PACKAGE, ["versions"], projectPath);
|
|
65
|
+
return Array.isArray(versions) ? versions.map(String) : undefined;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function layersRefusing(version, replacedFolder) {
|
|
69
|
+
const isReplaced = (sourcePath) => replacedFolder !== undefined &&
|
|
70
|
+
!node_path_1.default.relative(replacedFolder, sourcePath).startsWith("..");
|
|
71
|
+
return (0, frontend_modules_1.GetFrontendModules)()
|
|
72
|
+
.filter((layer) => !isReplaced(layer.sourcePath))
|
|
73
|
+
.flatMap((layer) => {
|
|
74
|
+
const range = engineRange(readManifest(node_path_1.default.join(layer.sourcePath, PACKAGE_JSON)));
|
|
75
|
+
return range && !supportsFrontend(range, version)
|
|
76
|
+
? [{ name: layer.name, range }]
|
|
77
|
+
: [];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async function frontendRequirement(input) {
|
|
81
|
+
if (supportsFrontend(input.range, input.running))
|
|
82
|
+
return undefined;
|
|
83
|
+
const versions = (await listPublishedVersions(input.projectPath)) ?? [];
|
|
84
|
+
const target = (0, semver_1.maxSatisfying)(versions, input.range) ?? undefined;
|
|
85
|
+
return {
|
|
86
|
+
range: input.range,
|
|
87
|
+
running: input.running,
|
|
88
|
+
target,
|
|
89
|
+
command: target ? `pnpm add -D ${exports.FRONTEND_PACKAGE}@${target}` : undefined,
|
|
90
|
+
breaks: target ? layersRefusing(target, input.replacedFolder) : [],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=frontend-compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-compatibility.js","sourceRoot":"","sources":["../../src/store/frontend-compatibility.ts"],"names":[],"mappings":";;;;;;AA+DA,oDAcC;AAOD,0CASC;AAMD,4CAGC;AAgDD,kDAaC;AAnKD,qCAAuC;AACvC,0DAA6B;AAC7B,mCAAsE;AACtE,8EAA6E;AAC7E,0EAAmF;AACnF,mCAA4C;AAC5C,yCAAqC;AACrC,uCAA+C;AAOlC,QAAA,gBAAgB,GAAG,0BAA0B,CAAC;AAK3D,MAAM,cAAc,GAAG,2BAA2B,CAAC;AACnD,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/B,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,uBAAuB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AAC9E,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AAgBxE,MAAM,aAAa,GAAG,IAAA,yBAAiB,EAAgB,uBAAuB,CAAC,CAAC;AAChF,MAAM,iBAAiB,GAAG,IAAA,yBAAiB,EAAW,kBAAkB,CAAC,CAAC;AAE1E,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAoB,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;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K,EAAE,CAAC;YAC/B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACP,CAAC;AAgBM,KAAK,UAAU,mBAAmB,CACvC,KAA+B;IAE/B,IAAI,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IACnE,MAAM,QAAQ,GAAG,CAAC,MAAM,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;IACxE,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;IACjE,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM;QACN,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,eAAe,wBAAgB,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;QACzE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;KACnE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InterfaceImplementation, MissingInterface, PackageRelease, RuntimeModule } from "./types";
|
|
2
|
+
export declare function findImplementations(interfacePackage: string): Promise<InterfaceImplementation[]>;
|
|
3
|
+
export declare function implementedBy(localPath: string): Promise<string[]>;
|
|
4
|
+
export declare function implementedInterfaces(modules: readonly RuntimeModule[]): Promise<Set<string>>;
|
|
5
|
+
export declare function findMissingInterfaces(release: PackageRelease, implemented: ReadonlySet<string>, projectPath: string): Promise<MissingInterface[]>;
|
|
6
|
+
export declare function findDependents(module: RuntimeModule, running: readonly RuntimeModule[]): Promise<string[]>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findImplementations = findImplementations;
|
|
7
|
+
exports.implementedBy = implementedBy;
|
|
8
|
+
exports.implementedInterfaces = implementedInterfaces;
|
|
9
|
+
exports.findMissingInterfaces = findMissingInterfaces;
|
|
10
|
+
exports.findDependents = findDependents;
|
|
11
|
+
const promises_1 = require("node:fs/promises");
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
const cache_1 = require("./cache");
|
|
14
|
+
const registry_1 = require("./registry");
|
|
15
|
+
const INTERFACES_REGISTRY_URL = "https://raw.githubusercontent.com/AntelopeJS/interfaces/main";
|
|
16
|
+
const MANIFEST_FILE = "manifest.json";
|
|
17
|
+
const CORE_INTERFACE = "@antelopejs/interface-core";
|
|
18
|
+
const PACKAGE_SOURCE_TYPE = "package";
|
|
19
|
+
const PACKAGE_JSON = "package.json";
|
|
20
|
+
const FETCH_TIMEOUT_MS = 10_000;
|
|
21
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
22
|
+
const FAILED_LOOKUP_MS = 5 * 60 * 1000;
|
|
23
|
+
const LIFETIMES = { found: HOUR_MS, failed: FAILED_LOOKUP_MS };
|
|
24
|
+
const INTERFACE_NAME_PATTERN = /(^|\/)interface-/;
|
|
25
|
+
const registryDocuments = (0, cache_1.createLookupCache)(LIFETIMES);
|
|
26
|
+
const interfaceKinds = (0, cache_1.createLookupCache)(LIFETIMES);
|
|
27
|
+
function fetchRegistryDocument(file) {
|
|
28
|
+
return registryDocuments.get(file, async () => {
|
|
29
|
+
const response = await fetch(`${INTERFACES_REGISTRY_URL}/${file}`, {
|
|
30
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
|
|
31
|
+
});
|
|
32
|
+
if (!response.ok)
|
|
33
|
+
return undefined;
|
|
34
|
+
return (await response.json());
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async function registryFolders() {
|
|
38
|
+
const manifest = (await fetchRegistryDocument(MANIFEST_FILE));
|
|
39
|
+
return manifest?.interfaces ?? {};
|
|
40
|
+
}
|
|
41
|
+
function asImplementation(module) {
|
|
42
|
+
const { name, source } = module;
|
|
43
|
+
if (source?.type !== PACKAGE_SOURCE_TYPE || !source.package)
|
|
44
|
+
return undefined;
|
|
45
|
+
return { name: name ?? source.package, package: source.package };
|
|
46
|
+
}
|
|
47
|
+
async function findImplementations(interfacePackage) {
|
|
48
|
+
const folder = (await registryFolders())[interfacePackage];
|
|
49
|
+
if (!folder)
|
|
50
|
+
return [];
|
|
51
|
+
const manifest = (await fetchRegistryDocument(`interfaces/${folder}/${MANIFEST_FILE}`));
|
|
52
|
+
return (manifest?.modules ?? []).flatMap((module) => {
|
|
53
|
+
const implementation = asImplementation(module);
|
|
54
|
+
return implementation ? [implementation] : [];
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function kindOf(packageName, antelopeJs) {
|
|
58
|
+
const implemented = Array.isArray(antelopeJs.implements)
|
|
59
|
+
? antelopeJs.implements
|
|
60
|
+
: [];
|
|
61
|
+
const isModule = implemented.some((name) => name !== packageName);
|
|
62
|
+
if (isModule)
|
|
63
|
+
return "library";
|
|
64
|
+
return antelopeJs.standalone === true ? "standalone" : "required";
|
|
65
|
+
}
|
|
66
|
+
function newestManifest(view) {
|
|
67
|
+
const manifest = Array.isArray(view) ? view.at(-1) : view;
|
|
68
|
+
return manifest && typeof manifest === "object"
|
|
69
|
+
? manifest
|
|
70
|
+
: undefined;
|
|
71
|
+
}
|
|
72
|
+
async function interfaceKind(dependency, range, projectPath) {
|
|
73
|
+
const looksLikeInterface = INTERFACE_NAME_PATTERN.test(dependency) ||
|
|
74
|
+
dependency in (await registryFolders());
|
|
75
|
+
if (!looksLikeInterface)
|
|
76
|
+
return "library";
|
|
77
|
+
const kind = await interfaceKinds.get(`${dependency}@${range}`, async () => {
|
|
78
|
+
const antelopeJs = newestManifest(await (0, registry_1.npmView)(`${dependency}@${range}`, ["antelopeJs"], projectPath));
|
|
79
|
+
return antelopeJs ? kindOf(dependency, antelopeJs) : "library";
|
|
80
|
+
});
|
|
81
|
+
return kind ?? "library";
|
|
82
|
+
}
|
|
83
|
+
async function readModulePackage(localPath) {
|
|
84
|
+
try {
|
|
85
|
+
return JSON.parse(await (0, promises_1.readFile)(node_path_1.default.join(localPath, PACKAGE_JSON), "utf-8"));
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function implementedBy(localPath) {
|
|
92
|
+
const implemented = (await readModulePackage(localPath))?.antelopeJs
|
|
93
|
+
?.implements;
|
|
94
|
+
return Array.isArray(implemented) ? implemented.map(String) : [];
|
|
95
|
+
}
|
|
96
|
+
async function implementedInterfaces(modules) {
|
|
97
|
+
const lists = await Promise.all(modules.map((module) => implementedBy(module.localPath)));
|
|
98
|
+
return new Set([CORE_INTERFACE, ...lists.flat()]);
|
|
99
|
+
}
|
|
100
|
+
async function findMissingInterfaces(release, implemented, projectPath) {
|
|
101
|
+
const ownInterfaces = new Set(release.implements ?? []);
|
|
102
|
+
const unresolved = Object.entries(release.dependencies ?? {}).filter(([name]) => !implemented.has(name) && !ownInterfaces.has(name));
|
|
103
|
+
const kinds = await Promise.all(unresolved.map(([name, range]) => interfaceKind(name, range, projectPath)));
|
|
104
|
+
const missing = unresolved
|
|
105
|
+
.filter((_, index) => kinds[index] === "required")
|
|
106
|
+
.map(([name]) => name);
|
|
107
|
+
return Promise.all(missing.map(async (interfacePackage) => ({
|
|
108
|
+
interfacePackage,
|
|
109
|
+
candidates: await findImplementations(interfacePackage).catch(() => []),
|
|
110
|
+
})));
|
|
111
|
+
}
|
|
112
|
+
async function findDependents(module, running) {
|
|
113
|
+
const provided = await implementedBy(module.localPath);
|
|
114
|
+
if (provided.length === 0)
|
|
115
|
+
return [];
|
|
116
|
+
const others = running.filter((other) => other.id !== module.id);
|
|
117
|
+
const stillImplemented = await implementedInterfaces(others);
|
|
118
|
+
const orphaned = provided.filter((name) => !stillImplemented.has(name));
|
|
119
|
+
if (orphaned.length === 0)
|
|
120
|
+
return [];
|
|
121
|
+
const packages = await Promise.all(others.map((other) => readModulePackage(other.localPath)));
|
|
122
|
+
return others
|
|
123
|
+
.filter((_, index) => orphaned.some((name) => packages[index]?.dependencies?.[name]))
|
|
124
|
+
.map((other) => other.packageName ?? other.id);
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/store/interfaces.ts"],"names":[],"mappings":";;;;;AAiGA,kDAYC;AA6DD,sCAIC;AAGD,sDAOC;AAOD,sDAqBC;AAMD,wCAkBC;AA5OD,+CAA4C;AAC5C,0DAA6B;AAC7B,mCAA4C;AAC5C,yCAAqC;AAarC,MAAM,uBAAuB,GAC3B,8DAA8D,CAAC;AACjE,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,MAAM,cAAc,GAAG,4BAA4B,CAAC;AACpD,MAAM,mBAAmB,GAAG,SAAS,CAAC;AACtC,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/B,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AAE/D,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AA+BlD,MAAM,iBAAiB,GAAG,IAAA,yBAAiB,EAAU,SAAS,CAAC,CAAC;AAChE,MAAM,cAAc,GAAG,IAAA,yBAAiB,EAAgB,SAAS,CAAC,CAAC;AAQnE,SAAS,qBAAq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