mage-obsidian 2.0.0 → 2.2.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/dist/cli/buildThemes.d.ts +3 -0
- package/dist/cli/buildThemes.d.ts.map +1 -0
- package/{src/cli/buildThemes.ts → dist/cli/buildThemes.js} +77 -121
- package/dist/cli/buildThemes.js.map +1 -0
- package/dist/config/default.d.ts +16 -0
- package/dist/config/default.d.ts.map +1 -0
- package/{src/config/default.ts → dist/config/default.js} +2 -11
- package/dist/config/default.js.map +1 -0
- package/dist/core/configResolver.d.ts +38 -0
- package/dist/core/configResolver.d.ts.map +1 -0
- package/{src/core/configResolver.ts → dist/core/configResolver.js} +21 -60
- package/dist/core/configResolver.js.map +1 -0
- package/dist/core/contractValidator.d.ts +16 -0
- package/dist/core/contractValidator.d.ts.map +1 -0
- package/{src/core/contractValidator.ts → dist/core/contractValidator.js} +3 -10
- package/dist/core/contractValidator.js.map +1 -0
- package/dist/core/cssResolver.d.ts +5 -0
- package/dist/core/cssResolver.d.ts.map +1 -0
- package/{src/core/cssResolver.ts → dist/core/cssResolver.js} +26 -53
- package/dist/core/cssResolver.js.map +1 -0
- package/dist/core/generateInterceptors.d.ts +10 -0
- package/dist/core/generateInterceptors.d.ts.map +1 -0
- package/{src/core/generateInterceptors.ts → dist/core/generateInterceptors.js} +55 -109
- package/dist/core/generateInterceptors.js.map +1 -0
- package/dist/core/generateJsconfig.d.ts +45 -0
- package/dist/core/generateJsconfig.d.ts.map +1 -0
- package/{src/core/generateJsconfig.ts → dist/core/generateJsconfig.js} +32 -55
- package/dist/core/generateJsconfig.js.map +1 -0
- package/dist/core/moduleResolver.d.ts +22 -0
- package/dist/core/moduleResolver.d.ts.map +1 -0
- package/{src/core/moduleResolver.ts → dist/core/moduleResolver.js} +28 -62
- package/dist/core/moduleResolver.js.map +1 -0
- package/dist/core/preCompileFiles.d.ts +6 -0
- package/dist/core/preCompileFiles.d.ts.map +1 -0
- package/{src/core/preCompileFiles.ts → dist/core/preCompileFiles.js} +22 -48
- package/dist/core/preCompileFiles.js.map +1 -0
- package/dist/core/preCompileMagentoFiles.d.ts +3 -0
- package/dist/core/preCompileMagentoFiles.d.ts.map +1 -0
- package/{src/core/preCompileMagentoFiles.ts → dist/core/preCompileMagentoFiles.js} +4 -10
- package/dist/core/preCompileMagentoFiles.js.map +1 -0
- package/dist/core/themeResolverSync.d.ts +6 -0
- package/dist/core/themeResolverSync.d.ts.map +1 -0
- package/{src/core/themeResolverSync.ts → dist/core/themeResolverSync.js} +25 -26
- package/dist/core/themeResolverSync.js.map +1 -0
- package/dist/runtime/i18nCore.d.ts +71 -0
- package/dist/runtime/i18nCore.d.ts.map +1 -0
- package/{src/runtime/i18nCore.ts → dist/runtime/i18nCore.js} +47 -49
- package/dist/runtime/i18nCore.js.map +1 -0
- package/dist/runtime/interceptorManager.d.ts +45 -0
- package/dist/runtime/interceptorManager.d.ts.map +1 -0
- package/{src/runtime/interceptorManager.ts → dist/runtime/interceptorManager.js} +14 -72
- package/dist/runtime/interceptorManager.js.map +1 -0
- package/dist/runtime/islands.d.ts +45 -0
- package/dist/runtime/islands.d.ts.map +1 -0
- package/{src/runtime/islands.ts → dist/runtime/islands.js} +5 -30
- package/dist/runtime/islands.js.map +1 -0
- package/dist/runtime/sectionStoreCore.d.ts +108 -0
- package/dist/runtime/sectionStoreCore.d.ts.map +1 -0
- package/{src/runtime/sectionStoreCore.ts → dist/runtime/sectionStoreCore.js} +23 -93
- package/dist/runtime/sectionStoreCore.js.map +1 -0
- package/dist/utils/findComponents.d.ts +17 -0
- package/dist/utils/findComponents.d.ts.map +1 -0
- package/dist/utils/findComponents.js +66 -0
- package/dist/utils/findComponents.js.map +1 -0
- package/dist/utils/runWithConcurrency.d.ts +10 -0
- package/dist/utils/runWithConcurrency.d.ts.map +1 -0
- package/{src/utils/runWithConcurrency.ts → dist/utils/runWithConcurrency.js} +3 -9
- package/dist/utils/runWithConcurrency.js.map +1 -0
- package/dist/vite/defaultNodeResolver.d.ts +9 -0
- package/dist/vite/defaultNodeResolver.d.ts.map +1 -0
- package/{src/vite/defaultNodeResolver.ts → dist/vite/defaultNodeResolver.js} +3 -1
- package/dist/vite/defaultNodeResolver.js.map +1 -0
- package/dist/vite/inheritAssetsModuleResolver.d.ts +8 -0
- package/dist/vite/inheritAssetsModuleResolver.d.ts.map +1 -0
- package/{src/vite/inheritAssetsModuleResolver.ts → dist/vite/inheritAssetsModuleResolver.js} +6 -20
- package/dist/vite/inheritAssetsModuleResolver.js.map +1 -0
- package/dist/vite/inheritModuleResolver.d.ts +8 -0
- package/dist/vite/inheritModuleResolver.d.ts.map +1 -0
- package/{src/vite/inheritModuleResolver.ts → dist/vite/inheritModuleResolver.js} +4 -9
- package/dist/vite/inheritModuleResolver.js.map +1 -0
- package/dist/vite/interceptorsPlugin.d.ts +10 -0
- package/dist/vite/interceptorsPlugin.d.ts.map +1 -0
- package/{src/vite/interceptorsPlugin.ts → dist/vite/interceptorsPlugin.js} +12 -29
- package/dist/vite/interceptorsPlugin.js.map +1 -0
- package/dist/vite/magentoHrmRewrite.d.ts +6 -0
- package/dist/vite/magentoHrmRewrite.d.ts.map +1 -0
- package/{src/vite/magentoHrmRewrite.ts → dist/vite/magentoHrmRewrite.js} +16 -15
- package/dist/vite/magentoHrmRewrite.js.map +1 -0
- package/dist/vite/sharedPlugins.d.ts +35 -0
- package/dist/vite/sharedPlugins.d.ts.map +1 -0
- package/{src/vite/sharedPlugins.ts → dist/vite/sharedPlugins.js} +7 -9
- package/dist/vite/sharedPlugins.js.map +1 -0
- package/dist/vite/themeSourceWatcher.d.ts +16 -0
- package/dist/vite/themeSourceWatcher.d.ts.map +1 -0
- package/{src/vite/themeSourceWatcher.ts → dist/vite/themeSourceWatcher.js} +19 -24
- package/dist/vite/themeSourceWatcher.js.map +1 -0
- package/dist/vite/unresolvedModuleGuard.d.ts +17 -0
- package/dist/vite/unresolvedModuleGuard.d.ts.map +1 -0
- package/{src/vite/unresolvedModuleGuard.ts → dist/vite/unresolvedModuleGuard.js} +27 -27
- package/dist/vite/unresolvedModuleGuard.js.map +1 -0
- package/package.json +60 -10
- package/.github/workflows/ci.yml +0 -38
- package/.github/workflows/publish.yml +0 -36
- package/.oxlintrc.json +0 -19
- package/.prettierignore +0 -7
- package/.prettierrc.json +0 -7
- package/eslint.config.js +0 -24
- package/pnpm-workspace.yaml +0 -4
- package/src/utils/findComponents.ts +0 -83
- package/tsconfig.json +0 -34
- package/vitest.config.js +0 -18
- /package/{src → dist}/config/eslint.js +0 -0
- /package/{src → dist}/templates/base_main_js_file.js +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// ConfigInterface::SCHEMA_VERSION on the PHP side; a mismatch means the module
|
|
3
3
|
// and the JS engine are out of sync and the contract cannot be trusted.
|
|
4
4
|
export const EXPECTED_SCHEMA_VERSION = "1.0.0";
|
|
5
|
-
|
|
6
5
|
// Top-level keys the engine reads off the generated contract. Kept in step with
|
|
7
6
|
// the JSON schema in module-modern-frontend/src/etc.
|
|
8
7
|
export const REQUIRED_CONTRACT_KEYS = [
|
|
@@ -22,7 +21,6 @@ export const REQUIRED_CONTRACT_KEYS = [
|
|
|
22
21
|
"THEME_FILES_PATH",
|
|
23
22
|
"LIB_PATH",
|
|
24
23
|
];
|
|
25
|
-
|
|
26
24
|
/**
|
|
27
25
|
* Validate the parsed frontend contract.
|
|
28
26
|
*
|
|
@@ -36,21 +34,16 @@ export function validateContract(config, expectedVersion = EXPECTED_SCHEMA_VERSI
|
|
|
36
34
|
if (config === null || typeof config !== "object" || Array.isArray(config)) {
|
|
37
35
|
return { ok: false, errors: ["Contract is not a JSON object."] };
|
|
38
36
|
}
|
|
39
|
-
|
|
40
37
|
const errors = [];
|
|
41
|
-
|
|
42
38
|
if (config.schema_version !== expectedVersion) {
|
|
43
|
-
errors.push(
|
|
44
|
-
`
|
|
45
|
-
`but the contract is "${config.schema_version ?? "(missing)"}".`,
|
|
46
|
-
);
|
|
39
|
+
errors.push(`Schema version mismatch: this build engine expects "${expectedVersion}" ` +
|
|
40
|
+
`but the contract is "${config.schema_version ?? "(missing)"}".`);
|
|
47
41
|
}
|
|
48
|
-
|
|
49
42
|
for (const key of REQUIRED_CONTRACT_KEYS) {
|
|
50
43
|
if (!Object.prototype.hasOwnProperty.call(config, key)) {
|
|
51
44
|
errors.push(`Missing required key "${key}".`);
|
|
52
45
|
}
|
|
53
46
|
}
|
|
54
|
-
|
|
55
47
|
return { ok: errors.length === 0, errors };
|
|
56
48
|
}
|
|
49
|
+
//# sourceMappingURL=contractValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractValidator.js","sourceRoot":"","sources":["../../src/core/contractValidator.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,+EAA+E;AAC/E,wEAAwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC;AAE/C,gFAAgF;AAChF,qDAAqD;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,gBAAgB;IAChB,MAAM;IACN,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,qBAAqB;IACrB,SAAS;IACT,kBAAkB;IAClB,oBAAoB;IACpB,wBAAwB;IACxB,oBAAoB;IACpB,mBAAmB;IACnB,uBAAuB;IACvB,kBAAkB;IAClB,UAAU;CACb,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,uBAAuB;IAC9E,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,gCAAgC,CAAC,EAAE,CAAC;IACrE,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,IAAI,MAAM,CAAC,cAAc,KAAK,eAAe,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CACP,uDAAuD,eAAe,IAAI;YACtE,wBAAwB,MAAM,CAAC,cAAc,IAAI,WAAW,IAAI,CACvE,CAAC;IACN,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,CAAC,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssResolver.d.ts","sourceRoot":"","sources":["../../src/core/cssResolver.ts"],"names":[],"mappings":"AAsFA,iBAAe,kBAAkB,CAAC,SAAS,KAAA,mBAmB1C;AAkBD,iBAAe,aAAa,CAAC,SAAS,KAAA,mBA0BrC;AAED,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,62 +1,40 @@
|
|
|
1
|
-
import themeResolver from "./themeResolverSync.
|
|
1
|
+
import themeResolver from "./themeResolverSync.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
THEME_CSS_FOLDER,
|
|
7
|
-
THEME_MODULE_WEB_PATH,
|
|
8
|
-
} from "../config/default.ts";
|
|
9
|
-
import { resolveFileByTheme, getAllJsVueFilesWithInheritanceCached } from "./moduleResolver.ts";
|
|
10
|
-
import configResolver from "./configResolver.ts";
|
|
3
|
+
import { MODULE_TEMPLATES_PATH, MODULE_WEB_PATH, THEME_CSS_FOLDER, THEME_MODULE_WEB_PATH, } from "../config/default.js";
|
|
4
|
+
import { resolveFileByTheme, getAllJsVueFilesWithInheritanceCached } from "./moduleResolver.js";
|
|
5
|
+
import configResolver from "./configResolver.js";
|
|
11
6
|
import fs from "node:fs/promises";
|
|
12
|
-
|
|
13
|
-
const { getMagentoConfig, getModuleDefinition, getThemeDefinition, getModulesConfigArray } =
|
|
14
|
-
configResolver;
|
|
15
|
-
|
|
7
|
+
const { getMagentoConfig, getModuleDefinition, getThemeDefinition, getModulesConfigArray } = configResolver;
|
|
16
8
|
const MODULE_CSS_EXTEND_FILE = getMagentoConfig().MODULE_CSS_EXTEND_FILE;
|
|
17
9
|
const THEME_CSS_SOURCE_FILE = getMagentoConfig().THEME_CSS_SOURCE_FILE;
|
|
18
|
-
|
|
19
|
-
async function getThemeImports(themeName, themeConfig?) {
|
|
10
|
+
async function getThemeImports(themeName, themeConfig) {
|
|
20
11
|
if (!themeConfig) {
|
|
21
12
|
themeConfig = await themeResolver.getThemeConfig(themeName);
|
|
22
13
|
}
|
|
23
14
|
const themeDefinition = getThemeDefinition(themeName);
|
|
24
15
|
const themePath = themeDefinition.src;
|
|
25
|
-
|
|
26
16
|
let imports = "";
|
|
27
17
|
if (themeConfig.includeCssSourceFromParentThemes && themeDefinition.parent) {
|
|
28
18
|
imports += await getThemeImports(themeDefinition.parent, themeConfig);
|
|
29
19
|
}
|
|
30
|
-
|
|
31
20
|
imports += `@import "${path.join(themePath, THEME_MODULE_WEB_PATH, THEME_CSS_FOLDER, THEME_CSS_SOURCE_FILE)}";\n`;
|
|
32
21
|
return imports;
|
|
33
22
|
}
|
|
34
|
-
|
|
35
23
|
function resolveModuleCssSourcePath(moduleName, themeName) {
|
|
36
|
-
let moduleConfigSourcePath = resolveFileByTheme(
|
|
37
|
-
themeName,
|
|
38
|
-
moduleName,
|
|
39
|
-
path.join("css", MODULE_CSS_EXTEND_FILE),
|
|
40
|
-
);
|
|
24
|
+
let moduleConfigSourcePath = resolveFileByTheme(themeName, moduleName, path.join("css", MODULE_CSS_EXTEND_FILE));
|
|
41
25
|
if (!moduleConfigSourcePath) {
|
|
42
26
|
const moduleDefinition = getModuleDefinition(moduleName);
|
|
43
|
-
moduleConfigSourcePath = path.join(
|
|
44
|
-
moduleDefinition.src,
|
|
45
|
-
MODULE_WEB_PATH,
|
|
46
|
-
"css",
|
|
47
|
-
MODULE_CSS_EXTEND_FILE,
|
|
48
|
-
);
|
|
27
|
+
moduleConfigSourcePath = path.join(moduleDefinition.src, MODULE_WEB_PATH, "css", MODULE_CSS_EXTEND_FILE);
|
|
49
28
|
}
|
|
50
29
|
return moduleConfigSourcePath;
|
|
51
30
|
}
|
|
52
|
-
|
|
53
31
|
// Walk the theme -> parent chain emitting a @source for each theme root so
|
|
54
32
|
// Tailwind scans the Twig/phtml templates of every theme in the inheritance
|
|
55
33
|
// chain (a child theme's classes plus everything it inherits unchanged).
|
|
56
34
|
async function getThemeTemplateSources(themeName) {
|
|
57
35
|
const theme = getThemeDefinition(themeName);
|
|
58
|
-
if (!theme)
|
|
59
|
-
|
|
36
|
+
if (!theme)
|
|
37
|
+
return "";
|
|
60
38
|
let sources = "";
|
|
61
39
|
if (theme.parent) {
|
|
62
40
|
sources += await getThemeTemplateSources(theme.parent);
|
|
@@ -64,7 +42,6 @@ async function getThemeTemplateSources(themeName) {
|
|
|
64
42
|
sources += `@source "${theme.src}";\n`;
|
|
65
43
|
return sources;
|
|
66
44
|
}
|
|
67
|
-
|
|
68
45
|
// Reads the source-scan opt-out: a theme (merged with its parents) lists the
|
|
69
46
|
// modules whose files Tailwind must NOT scan via `ignoredTailwindConfigFromModules`
|
|
70
47
|
// in theme.config.js — an array of module names, or "all" to skip every module.
|
|
@@ -77,7 +54,6 @@ async function getScanExclusions(themeName) {
|
|
|
77
54
|
excludedModules: new Set(Array.isArray(ignored) ? ignored : []),
|
|
78
55
|
};
|
|
79
56
|
}
|
|
80
|
-
|
|
81
57
|
// Templates (.twig/.phtml) are not auto-scanned by Tailwind in this pipeline
|
|
82
58
|
// (its base path is the Vite root, not the Magento tree), and the engine only
|
|
83
59
|
// emits @source for JS/Vue components. This registers the template dirs of
|
|
@@ -87,24 +63,23 @@ async function getScanExclusions(themeName) {
|
|
|
87
63
|
async function getTemplateSources(themeName) {
|
|
88
64
|
const { ignoreAllModules, excludedModules } = await getScanExclusions(themeName);
|
|
89
65
|
let sources = "";
|
|
90
|
-
|
|
91
66
|
if (!ignoreAllModules) {
|
|
92
67
|
for (const [moduleName, moduleConfig] of getModulesConfigArray()) {
|
|
93
|
-
if (excludedModules.has(moduleName))
|
|
68
|
+
if (excludedModules.has(moduleName))
|
|
69
|
+
continue;
|
|
94
70
|
const templatesDir = path.join(moduleConfig.src, MODULE_TEMPLATES_PATH);
|
|
95
71
|
try {
|
|
96
72
|
await fs.access(templatesDir);
|
|
97
73
|
sources += `@source "${templatesDir}";\n`;
|
|
98
|
-
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
99
76
|
// module ships no frontend templates
|
|
100
77
|
}
|
|
101
78
|
}
|
|
102
79
|
}
|
|
103
|
-
|
|
104
80
|
sources += await getThemeTemplateSources(themeName);
|
|
105
81
|
return sources;
|
|
106
82
|
}
|
|
107
|
-
|
|
108
83
|
async function getVueComponentsSource(themeName) {
|
|
109
84
|
const { ignoreAllModules, excludedModules } = await getScanExclusions(themeName);
|
|
110
85
|
const vueComponents = await getAllJsVueFilesWithInheritanceCached(themeName);
|
|
@@ -112,42 +87,40 @@ async function getVueComponentsSource(themeName) {
|
|
|
112
87
|
// "Theme" entries are the theme's own files and are always scanned.
|
|
113
88
|
const vueComponentSources = Object.entries(vueComponents)
|
|
114
89
|
.filter(([key]) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
90
|
+
const owner = key.split("/")[0];
|
|
91
|
+
if (owner === "Theme")
|
|
92
|
+
return true;
|
|
93
|
+
if (ignoreAllModules)
|
|
94
|
+
return false;
|
|
95
|
+
return !excludedModules.has(owner);
|
|
96
|
+
})
|
|
120
97
|
.map(([, url]) => `@source "${url}";\n`);
|
|
121
98
|
return vueComponentSources.join("");
|
|
122
99
|
}
|
|
123
|
-
|
|
124
100
|
async function getCssImports(themeName) {
|
|
125
101
|
const themeConfig = await themeResolver.getThemeConfig(themeName);
|
|
126
102
|
const excludedModules = new Set(themeConfig.ignoredCssFromModules || []);
|
|
127
103
|
const modulesConfig = getModulesConfigArray();
|
|
128
|
-
|
|
129
104
|
const cssSource = await getVueComponentsSource(themeName);
|
|
130
105
|
let cssImports = "";
|
|
131
|
-
|
|
132
106
|
if (themeConfig.ignoredCssFromModules !== "all") {
|
|
133
107
|
for (const [moduleName] of modulesConfig) {
|
|
134
|
-
if (excludedModules.has(moduleName))
|
|
135
|
-
|
|
108
|
+
if (excludedModules.has(moduleName))
|
|
109
|
+
continue;
|
|
136
110
|
const filePath = resolveModuleCssSourcePath(moduleName, themeName);
|
|
137
111
|
try {
|
|
138
112
|
await fs.access(filePath);
|
|
139
113
|
cssImports += `@import "${filePath}";\n`;
|
|
140
|
-
}
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
141
116
|
// ignore if file doesn't exist
|
|
142
117
|
}
|
|
143
118
|
}
|
|
144
119
|
}
|
|
145
|
-
|
|
146
120
|
cssImports += await getThemeImports(themeName);
|
|
147
|
-
|
|
148
121
|
const templateSources = await getTemplateSources(themeName);
|
|
149
122
|
return `${cssSource}${templateSources}\n${cssImports}`;
|
|
150
123
|
}
|
|
151
|
-
|
|
152
124
|
export default getCssImports;
|
|
153
125
|
export { getTemplateSources };
|
|
126
|
+
//# sourceMappingURL=cssResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssResolver.js","sourceRoot":"","sources":["../../src/core/cssResolver.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACH,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO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Y_INTERCEPTED = "originalIntercepted";
|
|
2
|
+
declare function registerInterceptors(themeName: any): Promise<Record<string, any[]>>;
|
|
3
|
+
declare function generateInterceptors(themeName: any): Promise<any>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
registerInterceptors: typeof registerInterceptors;
|
|
6
|
+
generateInterceptors: typeof generateInterceptors;
|
|
7
|
+
KEY_INTERCEPTED: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=generateInterceptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateInterceptors.d.ts","sourceRoot":"","sources":["../../src/core/generateInterceptors.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAmBrD,iBAAe,oBAAoB,CAAC,SAAS,KAAA,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAgD7E;AAED,iBAAe,oBAAoB,CAAC,SAAS,KAAA,gBAoJ5C;;;;;;AAsED,wBAIE"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import path from "path";
|
|
2
10
|
import { pathToFileURL } from "url";
|
|
3
|
-
import themeResolver from "./themeResolverSync.
|
|
4
|
-
import moduleResolver from "./moduleResolver.
|
|
5
|
-
import interceptorManager from "../runtime/interceptorManager.
|
|
6
|
-
import configResolver from "./configResolver.
|
|
7
|
-
|
|
11
|
+
import themeResolver from "./themeResolverSync.js";
|
|
12
|
+
import moduleResolver from "./moduleResolver.js";
|
|
13
|
+
import interceptorManager from "../runtime/interceptorManager.js";
|
|
14
|
+
import configResolver from "./configResolver.js";
|
|
8
15
|
const interceptorsRegisteredByTheme = new Map();
|
|
9
16
|
const generatedInterceptorsCache = new Map();
|
|
10
17
|
export const KEY_INTERCEPTED = "originalIntercepted";
|
|
11
|
-
|
|
12
18
|
/**
|
|
13
19
|
* Resolves the absolute path of a file using the cached file map
|
|
14
20
|
* @param {string} identifier
|
|
@@ -17,20 +23,17 @@ export const KEY_INTERCEPTED = "originalIntercepted";
|
|
|
17
23
|
*/
|
|
18
24
|
function resolvePathFromMap(identifier, fileMap) {
|
|
19
25
|
const [moduleName, relativePath] = identifier.split("::");
|
|
20
|
-
if (!moduleName || !relativePath)
|
|
21
|
-
|
|
26
|
+
if (!moduleName || !relativePath)
|
|
27
|
+
return null;
|
|
22
28
|
const parsed = path.parse(relativePath);
|
|
23
29
|
const keyPath = path.join(parsed.dir, parsed.name);
|
|
24
30
|
const key = `${moduleName}/${keyPath}`;
|
|
25
|
-
|
|
26
31
|
return fileMap[key] || null;
|
|
27
32
|
}
|
|
28
|
-
|
|
29
|
-
async function registerInterceptors(themeName): Promise<Record<string, any[]>> {
|
|
33
|
+
async function registerInterceptors(themeName) {
|
|
30
34
|
if (interceptorsRegisteredByTheme.has(themeName)) {
|
|
31
35
|
return interceptorsRegisteredByTheme.get(themeName);
|
|
32
36
|
}
|
|
33
|
-
|
|
34
37
|
const themeConfig = await themeResolver.getThemeConfig(themeName);
|
|
35
38
|
const modulesConfig = await moduleResolver.getModuleConfigByThemeConfig(themeName, themeConfig);
|
|
36
39
|
if (!modulesConfig || modulesConfig.interceptors === undefined) {
|
|
@@ -38,64 +41,52 @@ async function registerInterceptors(themeName): Promise<Record<string, any[]>> {
|
|
|
38
41
|
return {};
|
|
39
42
|
}
|
|
40
43
|
// Map<Target, Map<PluginName, PluginConfig>>
|
|
41
|
-
const interceptorsMap = new Map
|
|
42
|
-
for (const [interceptorName, interceptorDefinition] of Object.entries(
|
|
43
|
-
modulesConfig.interceptors,
|
|
44
|
-
) as [string, any][]) {
|
|
44
|
+
const interceptorsMap = new Map();
|
|
45
|
+
for (const [interceptorName, interceptorDefinition] of Object.entries(modulesConfig.interceptors)) {
|
|
45
46
|
const { target } = interceptorDefinition;
|
|
46
|
-
if (!interceptorName || !target)
|
|
47
|
-
|
|
47
|
+
if (!interceptorName || !target)
|
|
48
|
+
continue;
|
|
48
49
|
if (!interceptorsMap.has(target)) {
|
|
49
50
|
interceptorsMap.set(target, new Map());
|
|
50
51
|
}
|
|
51
|
-
|
|
52
52
|
const targetPlugins = interceptorsMap.get(target);
|
|
53
|
-
|
|
54
53
|
if (targetPlugins.has(interceptorName)) {
|
|
55
54
|
// Merge existing plugin config with new config (allows overriding sortOrder, active, etc.)
|
|
56
55
|
const existing = targetPlugins.get(interceptorName);
|
|
57
56
|
targetPlugins.set(interceptorName, { ...existing, ...interceptorDefinition });
|
|
58
|
-
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
59
|
targetPlugins.set(interceptorName, { ...interceptorDefinition });
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
|
|
63
62
|
// Convert Map to structured object and sort plugins
|
|
64
|
-
const result
|
|
63
|
+
const result = {};
|
|
65
64
|
for (const [target, pluginsMap] of interceptorsMap) {
|
|
66
65
|
const plugins = Array.from(pluginsMap.values())
|
|
67
66
|
.filter((p) => p.active !== false) // Filter out inactive plugins
|
|
68
67
|
.sort((a, b) => (a.sortOrder || 10) - (b.sortOrder || 10));
|
|
69
|
-
|
|
70
68
|
if (plugins.length > 0) {
|
|
71
69
|
result[target] = plugins;
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
|
|
75
72
|
interceptorsRegisteredByTheme.set(themeName, result);
|
|
76
73
|
return result;
|
|
77
74
|
}
|
|
78
|
-
|
|
79
75
|
async function generateInterceptors(themeName) {
|
|
80
76
|
if (generatedInterceptorsCache.has(themeName)) {
|
|
81
77
|
return generatedInterceptorsCache.get(themeName);
|
|
82
78
|
}
|
|
83
|
-
|
|
84
79
|
const interceptorsConfig = await registerInterceptors(themeName);
|
|
85
|
-
|
|
86
80
|
// Get all files map from cache
|
|
87
81
|
let allFilesMap;
|
|
88
82
|
try {
|
|
89
83
|
allFilesMap = moduleResolver.getAllJsVueFilesWithInheritanceCached(themeName);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
);
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
console.warn(`Cache not found for theme ${themeName} (${e.message}), falling back to async generation.`);
|
|
94
87
|
allFilesMap = await moduleResolver.getAllJsVueFilesWithInheritance(themeName);
|
|
95
88
|
}
|
|
96
|
-
|
|
97
89
|
const interceptors = {};
|
|
98
|
-
|
|
99
90
|
for (const [target, plugins] of Object.entries(interceptorsConfig)) {
|
|
100
91
|
// 1. Resolve Target Path
|
|
101
92
|
const targetPath = resolvePathFromMap(target, allFilesMap);
|
|
@@ -103,18 +94,16 @@ async function generateInterceptors(themeName) {
|
|
|
103
94
|
console.warn(`Target module not found for identifier: ${target}`);
|
|
104
95
|
continue;
|
|
105
96
|
}
|
|
106
|
-
|
|
107
97
|
let targetModule;
|
|
108
98
|
try {
|
|
109
|
-
targetModule = await import(pathToFileURL(targetPath).href);
|
|
110
|
-
}
|
|
99
|
+
targetModule = await import(__rewriteRelativeImportExtension(pathToFileURL(targetPath).href));
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
111
102
|
console.error(`Failed to import target module ${target}:`, e.message);
|
|
112
103
|
continue;
|
|
113
104
|
}
|
|
114
|
-
|
|
115
105
|
const targetExports = Object.keys(targetModule);
|
|
116
106
|
const methodsToIntercept = new Set();
|
|
117
|
-
|
|
118
107
|
// 3. Validate and Register Interceptors
|
|
119
108
|
const validInterceptors = [];
|
|
120
109
|
for (const interceptorConfig of plugins) {
|
|
@@ -123,65 +112,50 @@ async function generateInterceptors(themeName) {
|
|
|
123
112
|
console.warn(`Interceptor module not found: ${interceptorConfig.interceptor}`);
|
|
124
113
|
continue;
|
|
125
114
|
}
|
|
126
|
-
|
|
127
115
|
let interceptorModule;
|
|
128
116
|
try {
|
|
129
|
-
interceptorModule = await import(pathToFileURL(interceptorPath).href);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
e.message,
|
|
134
|
-
);
|
|
117
|
+
interceptorModule = await import(__rewriteRelativeImportExtension(pathToFileURL(interceptorPath).href));
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
console.error(`Failed to import interceptor module ${interceptorConfig.interceptor}:`, e.message);
|
|
135
121
|
continue;
|
|
136
122
|
}
|
|
137
|
-
|
|
138
123
|
const interceptorMethods = [];
|
|
139
124
|
for (const interceptorExport of Object.keys(interceptorModule)) {
|
|
140
125
|
let type, targetMethod;
|
|
141
|
-
|
|
142
126
|
if (interceptorExport.startsWith("before")) {
|
|
143
127
|
type = "before";
|
|
144
128
|
targetMethod = interceptorExport.substring(6);
|
|
145
|
-
}
|
|
129
|
+
}
|
|
130
|
+
else if (interceptorExport.startsWith("around")) {
|
|
146
131
|
type = "around";
|
|
147
132
|
targetMethod = interceptorExport.substring(6);
|
|
148
|
-
}
|
|
133
|
+
}
|
|
134
|
+
else if (interceptorExport.startsWith("after")) {
|
|
149
135
|
type = "after";
|
|
150
136
|
targetMethod = interceptorExport.substring(5);
|
|
151
|
-
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
152
139
|
continue;
|
|
153
140
|
}
|
|
154
|
-
|
|
155
141
|
// Check if target method exists in target module
|
|
156
142
|
if (!targetExports.includes(targetMethod) && targetMethod !== "default") {
|
|
157
143
|
const lowerFirst = targetMethod.charAt(0).toLowerCase() + targetMethod.slice(1);
|
|
158
144
|
if (targetExports.includes(lowerFirst)) {
|
|
159
145
|
targetMethod = lowerFirst;
|
|
160
|
-
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
161
148
|
// Skip invalid methods but don't crash the whole process?
|
|
162
149
|
// User requested error if not found.
|
|
163
|
-
throw new Error(
|
|
164
|
-
`Interceptor ${interceptorConfig.name} (${interceptorConfig.interceptor}) exports '${interceptorExport}' but target ${target} does not export '${targetMethod}'`,
|
|
165
|
-
);
|
|
150
|
+
throw new Error(`Interceptor ${interceptorConfig.name} (${interceptorConfig.interceptor}) exports '${interceptorExport}' but target ${target} does not export '${targetMethod}'`);
|
|
166
151
|
}
|
|
167
152
|
}
|
|
168
|
-
|
|
169
153
|
if (typeof targetModule[targetMethod] !== "function") {
|
|
170
|
-
console.warn(
|
|
171
|
-
`Interceptor ${interceptorConfig.name} (${interceptorConfig.interceptor}) exports '${interceptorExport}' but target ${target} export '${targetMethod}' is not a function.`,
|
|
172
|
-
);
|
|
154
|
+
console.warn(`Interceptor ${interceptorConfig.name} (${interceptorConfig.interceptor}) exports '${interceptorExport}' but target ${target} export '${targetMethod}' is not a function.`);
|
|
173
155
|
continue;
|
|
174
156
|
}
|
|
175
|
-
|
|
176
157
|
const methodKey = `${target}::${targetMethod}`;
|
|
177
|
-
interceptorManager.addInterceptor(
|
|
178
|
-
methodKey,
|
|
179
|
-
interceptorConfig.name,
|
|
180
|
-
type,
|
|
181
|
-
interceptorModule[interceptorExport],
|
|
182
|
-
interceptorConfig.sortOrder,
|
|
183
|
-
);
|
|
184
|
-
|
|
158
|
+
interceptorManager.addInterceptor(methodKey, interceptorConfig.name, type, interceptorModule[interceptorExport], interceptorConfig.sortOrder);
|
|
185
159
|
methodsToIntercept.add(targetMethod);
|
|
186
160
|
interceptorMethods.push({
|
|
187
161
|
exportName: interceptorExport,
|
|
@@ -190,7 +164,6 @@ async function generateInterceptors(themeName) {
|
|
|
190
164
|
sortOrder: interceptorConfig.sortOrder,
|
|
191
165
|
});
|
|
192
166
|
}
|
|
193
|
-
|
|
194
167
|
if (interceptorMethods.length > 0) {
|
|
195
168
|
validInterceptors.push({
|
|
196
169
|
...interceptorConfig,
|
|
@@ -199,19 +172,11 @@ async function generateInterceptors(themeName) {
|
|
|
199
172
|
});
|
|
200
173
|
}
|
|
201
174
|
}
|
|
202
|
-
|
|
203
175
|
// 4. Create Interceptor Proxy & Source Code
|
|
204
176
|
if (methodsToIntercept.size > 0) {
|
|
205
177
|
const wrapper = { ...targetModule };
|
|
206
178
|
const proxy = interceptorManager.intercept(wrapper, target, true);
|
|
207
|
-
|
|
208
|
-
const source = generateInterceptorCode(
|
|
209
|
-
target,
|
|
210
|
-
targetPath,
|
|
211
|
-
validInterceptors,
|
|
212
|
-
targetExports,
|
|
213
|
-
);
|
|
214
|
-
|
|
179
|
+
const source = generateInterceptorCode(target, targetPath, validInterceptors, targetExports);
|
|
215
180
|
interceptors[target] = {
|
|
216
181
|
proxy,
|
|
217
182
|
targetPath,
|
|
@@ -221,15 +186,12 @@ async function generateInterceptors(themeName) {
|
|
|
221
186
|
};
|
|
222
187
|
}
|
|
223
188
|
}
|
|
224
|
-
|
|
225
189
|
generatedInterceptorsCache.set(themeName, interceptors);
|
|
226
190
|
return interceptors;
|
|
227
191
|
}
|
|
228
|
-
|
|
229
192
|
function generateInterceptorCode(target, targetPath, interceptors, targetExports) {
|
|
230
193
|
const imports = [];
|
|
231
194
|
const registrations = [];
|
|
232
|
-
|
|
233
195
|
// Import PluginManager (Assuming it's available via alias or relative path in the build environment)
|
|
234
196
|
// For Vite, we might need to adjust this path or use a virtual module ID.
|
|
235
197
|
// Using a relative path from this service file might not work in the generated code context.
|
|
@@ -239,50 +201,34 @@ function generateInterceptorCode(target, targetPath, interceptors, targetExports
|
|
|
239
201
|
// names containing quotes/backslashes can't break (or inject into) the
|
|
240
202
|
// generated module. Identifiers (export names) come from Object.keys of a
|
|
241
203
|
// real ES module, so they are valid JS and used unquoted.
|
|
242
|
-
const resolvedInterceptorManagerPath = configResolver.resolveLibRealPath(
|
|
243
|
-
|
|
244
|
-
);
|
|
245
|
-
imports.push(
|
|
246
|
-
`import interceptorManager from ${JSON.stringify(resolvedInterceptorManagerPath)};`,
|
|
247
|
-
);
|
|
248
|
-
|
|
204
|
+
const resolvedInterceptorManagerPath = configResolver.resolveLibRealPath("mage-obsidian/runtime/interceptorManager");
|
|
205
|
+
imports.push(`import interceptorManager from ${JSON.stringify(resolvedInterceptorManagerPath)};`);
|
|
249
206
|
// Import Original Module
|
|
250
|
-
imports.push(
|
|
251
|
-
`import * as originalModule from ${JSON.stringify(`/@fs${targetPath}?${KEY_INTERCEPTED}`)};`,
|
|
252
|
-
);
|
|
253
|
-
|
|
207
|
+
imports.push(`import * as originalModule from ${JSON.stringify(`/@fs${targetPath}?${KEY_INTERCEPTED}`)};`);
|
|
254
208
|
// Import Interceptors
|
|
255
209
|
interceptors.forEach((interceptor, index) => {
|
|
256
210
|
const interceptorVar = `interceptor_${index}`;
|
|
257
|
-
imports.push(
|
|
258
|
-
`import * as ${interceptorVar} from ${JSON.stringify(`/@fs${interceptor.path}`)};`,
|
|
259
|
-
);
|
|
260
|
-
|
|
211
|
+
imports.push(`import * as ${interceptorVar} from ${JSON.stringify(`/@fs${interceptor.path}`)};`);
|
|
261
212
|
interceptor.methods.forEach((method) => {
|
|
262
213
|
const methodKey = `${target}::${method.targetMethod}`;
|
|
263
214
|
const sortOrder = Number.isFinite(method.sortOrder) ? method.sortOrder : 10;
|
|
264
|
-
registrations.push(
|
|
265
|
-
`interceptorManager.addInterceptor(${JSON.stringify(methodKey)}, ${JSON.stringify(interceptor.name)}, ${JSON.stringify(method.type)}, ${interceptorVar}.${method.exportName}, ${sortOrder});`,
|
|
266
|
-
);
|
|
215
|
+
registrations.push(`interceptorManager.addInterceptor(${JSON.stringify(methodKey)}, ${JSON.stringify(interceptor.name)}, ${JSON.stringify(method.type)}, ${interceptorVar}.${method.exportName}, ${sortOrder});`);
|
|
267
216
|
});
|
|
268
217
|
});
|
|
269
|
-
|
|
270
218
|
// Create Interceptor
|
|
271
219
|
const interceptorCode = `
|
|
272
220
|
const targetWrapper = { ...originalModule };
|
|
273
221
|
const proxy = interceptorManager.intercept(targetWrapper, ${JSON.stringify(target)}, true);
|
|
274
222
|
`;
|
|
275
|
-
|
|
276
223
|
// Exports
|
|
277
224
|
const exportsCode = targetExports
|
|
278
225
|
.map((exp) => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
226
|
+
if (exp === "default") {
|
|
227
|
+
return `export default proxy.default;`;
|
|
228
|
+
}
|
|
229
|
+
return `export const ${exp} = proxy.${exp};`;
|
|
230
|
+
})
|
|
284
231
|
.join("\n");
|
|
285
|
-
|
|
286
232
|
return `
|
|
287
233
|
${imports.join("\n")}
|
|
288
234
|
|
|
@@ -293,9 +239,9 @@ ${interceptorCode}
|
|
|
293
239
|
${exportsCode}
|
|
294
240
|
`;
|
|
295
241
|
}
|
|
296
|
-
|
|
297
242
|
export default {
|
|
298
243
|
registerInterceptors,
|
|
299
244
|
generateInterceptors,
|
|
300
245
|
KEY_INTERCEPTED,
|
|
301
246
|
};
|
|
247
|
+
//# sourceMappingURL=generateInterceptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateInterceptors.js","sourceRoot":"","sources":["../../src/core/generateInterceptors.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,MAAM,6BAA6B,GAAG,IAAI,GAAG,EAAE,CAAC;AAChD,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAErD;;;;;GAKG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