meno-core 1.0.39 → 1.0.41
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/bin/cli.ts +33 -0
- package/build-astro.ts +172 -69
- package/dist/bin/cli.js +30 -2
- package/dist/bin/cli.js.map +2 -2
- package/dist/build-static.js +7 -7
- package/dist/chunks/{chunk-WK5XLASY.js → chunk-EQOSDQS2.js} +4 -4
- package/dist/chunks/{chunk-AIXKUVNG.js → chunk-IBR2F4IL.js} +4 -5
- package/dist/chunks/{chunk-AIXKUVNG.js.map → chunk-IBR2F4IL.js.map} +2 -2
- package/dist/chunks/{chunk-NV25WXCA.js → chunk-IGVQF5GY.js} +11 -7
- package/dist/chunks/chunk-IGVQF5GY.js.map +7 -0
- package/dist/chunks/{chunk-KULPBDC7.js → chunk-LBWIHPN7.js} +9 -3
- package/dist/chunks/chunk-LBWIHPN7.js.map +7 -0
- package/dist/chunks/{chunk-A6KWUEA6.js → chunk-MKB2J6AD.js} +9 -1
- package/dist/chunks/chunk-MKB2J6AD.js.map +7 -0
- package/dist/chunks/{chunk-P3FX5HJM.js → chunk-S2HXJTAF.js} +1 -1
- package/dist/chunks/chunk-S2HXJTAF.js.map +7 -0
- package/dist/chunks/{chunk-W6HDII4T.js → chunk-SK3TLNUP.js} +140 -114
- package/dist/chunks/chunk-SK3TLNUP.js.map +7 -0
- package/dist/chunks/{chunk-HNAS6BSS.js → chunk-SNUROC7E.js} +56 -6
- package/dist/chunks/{chunk-HNAS6BSS.js.map → chunk-SNUROC7E.js.map} +3 -3
- package/dist/chunks/{configService-TXBNUBBL.js → configService-MICL4S2L.js} +2 -2
- package/dist/chunks/{constants-5CRJRQNR.js → constants-ZEU4TZCA.js} +2 -2
- package/dist/entries/server-router.js +7 -7
- package/dist/lib/client/index.js +11 -6
- package/dist/lib/client/index.js.map +2 -2
- package/dist/lib/server/index.js +507 -1587
- package/dist/lib/server/index.js.map +4 -4
- package/dist/lib/shared/index.js +3 -3
- package/dist/lib/test-utils/index.js +1 -1
- package/lib/client/core/ComponentBuilder.ts +1 -1
- package/lib/client/core/builders/embedBuilder.ts +2 -2
- package/lib/client/routing/Router.tsx +6 -0
- package/lib/client/templateEngine.test.ts +178 -0
- package/lib/client/templateEngine.ts +1 -2
- package/lib/server/astro/cmsPageEmitter.ts +420 -0
- package/lib/server/astro/componentEmitter.ts +150 -17
- package/lib/server/astro/nodeToAstro.test.ts +1101 -0
- package/lib/server/astro/nodeToAstro.ts +869 -37
- package/lib/server/astro/pageEmitter.ts +43 -3
- package/lib/server/astro/tailwindMapper.ts +69 -8
- package/lib/server/astro/templateTransformer.ts +107 -0
- package/lib/server/index.ts +26 -3
- package/lib/server/routes/api/components.ts +62 -0
- package/lib/server/routes/api/core-routes.ts +8 -0
- package/lib/server/services/configService.ts +12 -0
- package/lib/server/ssr/htmlGenerator.ts +0 -5
- package/lib/server/ssr/imageMetadata.ts +3 -3
- package/lib/server/ssr/ssrRenderer.ts +78 -29
- package/lib/server/webflow/buildWebflow.ts +415 -0
- package/lib/server/webflow/index.ts +22 -0
- package/lib/server/webflow/nodeToWebflow.ts +423 -0
- package/lib/server/webflow/styleMapper.ts +241 -0
- package/lib/server/webflow/types.ts +196 -0
- package/lib/shared/constants.ts +4 -0
- package/lib/shared/types/components.ts +9 -4
- package/lib/shared/validation/propValidator.ts +2 -1
- package/lib/shared/validation/schemas.ts +4 -1
- package/package.json +1 -1
- package/templates/index-router.html +0 -5
- package/dist/chunks/chunk-A6KWUEA6.js.map +0 -7
- package/dist/chunks/chunk-KULPBDC7.js.map +0 -7
- package/dist/chunks/chunk-NV25WXCA.js.map +0 -7
- package/dist/chunks/chunk-P3FX5HJM.js.map +0 -7
- package/dist/chunks/chunk-W6HDII4T.js.map +0 -7
- /package/dist/chunks/{chunk-WK5XLASY.js.map → chunk-EQOSDQS2.js.map} +0 -0
- /package/dist/chunks/{configService-TXBNUBBL.js.map → configService-MICL4S2L.js.map} +0 -0
- /package/dist/chunks/{constants-5CRJRQNR.js.map → constants-ZEU4TZCA.js.map} +0 -0
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
parseJSON,
|
|
17
17
|
resolveSlugToPageId,
|
|
18
18
|
variableService
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SK3TLNUP.js";
|
|
20
20
|
import {
|
|
21
21
|
configService
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-MKB2J6AD.js";
|
|
23
23
|
import {
|
|
24
24
|
bundleFile,
|
|
25
25
|
createRuntimeServer,
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
} from "./chunk-LIHJ6OUH.js";
|
|
43
43
|
import {
|
|
44
44
|
isPathWithinRoot
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-S2HXJTAF.js";
|
|
46
46
|
import {
|
|
47
47
|
addItemUrls
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-IGVQF5GY.js";
|
|
49
49
|
import {
|
|
50
50
|
parseLocaleFromPath
|
|
51
51
|
} from "./chunk-PGH3ATYI.js";
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
SERVER_PORT,
|
|
57
57
|
WEBSOCKET_STATES,
|
|
58
58
|
init_constants
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-LBWIHPN7.js";
|
|
60
60
|
|
|
61
61
|
// lib/server/pageCache.ts
|
|
62
62
|
var PageCache = class {
|
|
@@ -1930,6 +1930,50 @@ async function handleComponentJavaScriptRoute(url, componentService) {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
});
|
|
1932
1932
|
}
|
|
1933
|
+
function handleComponentUsageRoute(pageService, componentService) {
|
|
1934
|
+
const usageMap = /* @__PURE__ */ new Map();
|
|
1935
|
+
function walkTree(node, fileName, filePath, fileType) {
|
|
1936
|
+
if (!node || typeof node !== "object") return;
|
|
1937
|
+
if (node.type === "component" && "component" in node && node.component) {
|
|
1938
|
+
const compName = node.component;
|
|
1939
|
+
if (!usageMap.has(compName)) {
|
|
1940
|
+
usageMap.set(compName, { count: 0, files: /* @__PURE__ */ new Map() });
|
|
1941
|
+
}
|
|
1942
|
+
const entry = usageMap.get(compName);
|
|
1943
|
+
entry.count++;
|
|
1944
|
+
entry.files.set(filePath, { name: fileName, path: filePath, type: fileType });
|
|
1945
|
+
}
|
|
1946
|
+
if ("children" in node && Array.isArray(node.children)) {
|
|
1947
|
+
for (const child of node.children) {
|
|
1948
|
+
if (child && typeof child === "object") {
|
|
1949
|
+
walkTree(child, fileName, filePath, fileType);
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
const pagePaths = pageService.getAllPagePaths();
|
|
1955
|
+
for (const path2 of pagePaths) {
|
|
1956
|
+
const pageData = pageService.getPageData(path2);
|
|
1957
|
+
if (pageData && "root" in pageData && pageData.root) {
|
|
1958
|
+
const name = path2 === "/" ? "index" : path2.replace(/^\//, "").replace(/\//g, "-");
|
|
1959
|
+
walkTree(pageData.root, name, path2, "page");
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
const allComponents = componentService.getAllComponents();
|
|
1963
|
+
for (const [compName, compDef] of Object.entries(allComponents)) {
|
|
1964
|
+
if (compDef.component?.structure) {
|
|
1965
|
+
walkTree(compDef.component.structure, compName, compName, "component");
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
const result = {};
|
|
1969
|
+
for (const [name, data] of usageMap) {
|
|
1970
|
+
result[name] = {
|
|
1971
|
+
count: data.count,
|
|
1972
|
+
files: Array.from(data.files.values())
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
return jsonResponse(result);
|
|
1976
|
+
}
|
|
1933
1977
|
|
|
1934
1978
|
// lib/server/routes/api/config.ts
|
|
1935
1979
|
async function handleConfigRoute() {
|
|
@@ -2237,6 +2281,12 @@ async function handleCoreApiRoutes(req, url, context) {
|
|
|
2237
2281
|
"Failed to fetch usage stats"
|
|
2238
2282
|
);
|
|
2239
2283
|
}
|
|
2284
|
+
if (url.pathname === API_ROUTES.COMPONENT_USAGE && req.method === "GET") {
|
|
2285
|
+
return await handleRouteError(
|
|
2286
|
+
() => Promise.resolve(handleComponentUsageRoute(pageService, componentService)),
|
|
2287
|
+
"Failed to fetch component usage"
|
|
2288
|
+
);
|
|
2289
|
+
}
|
|
2240
2290
|
if (url.pathname === "/api/slug-mappings" && req.method === "GET") {
|
|
2241
2291
|
return await handleRouteError(
|
|
2242
2292
|
() => Promise.resolve(handleSlugMappingsRoute(pageService)),
|
|
@@ -3167,4 +3217,4 @@ export {
|
|
|
3167
3217
|
createServer,
|
|
3168
3218
|
FileSystemPageProvider
|
|
3169
3219
|
};
|
|
3170
|
-
//# sourceMappingURL=chunk-
|
|
3220
|
+
//# sourceMappingURL=chunk-SNUROC7E.js.map
|