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.
Files changed (67) hide show
  1. package/bin/cli.ts +33 -0
  2. package/build-astro.ts +172 -69
  3. package/dist/bin/cli.js +30 -2
  4. package/dist/bin/cli.js.map +2 -2
  5. package/dist/build-static.js +7 -7
  6. package/dist/chunks/{chunk-WK5XLASY.js → chunk-EQOSDQS2.js} +4 -4
  7. package/dist/chunks/{chunk-AIXKUVNG.js → chunk-IBR2F4IL.js} +4 -5
  8. package/dist/chunks/{chunk-AIXKUVNG.js.map → chunk-IBR2F4IL.js.map} +2 -2
  9. package/dist/chunks/{chunk-NV25WXCA.js → chunk-IGVQF5GY.js} +11 -7
  10. package/dist/chunks/chunk-IGVQF5GY.js.map +7 -0
  11. package/dist/chunks/{chunk-KULPBDC7.js → chunk-LBWIHPN7.js} +9 -3
  12. package/dist/chunks/chunk-LBWIHPN7.js.map +7 -0
  13. package/dist/chunks/{chunk-A6KWUEA6.js → chunk-MKB2J6AD.js} +9 -1
  14. package/dist/chunks/chunk-MKB2J6AD.js.map +7 -0
  15. package/dist/chunks/{chunk-P3FX5HJM.js → chunk-S2HXJTAF.js} +1 -1
  16. package/dist/chunks/chunk-S2HXJTAF.js.map +7 -0
  17. package/dist/chunks/{chunk-W6HDII4T.js → chunk-SK3TLNUP.js} +140 -114
  18. package/dist/chunks/chunk-SK3TLNUP.js.map +7 -0
  19. package/dist/chunks/{chunk-HNAS6BSS.js → chunk-SNUROC7E.js} +56 -6
  20. package/dist/chunks/{chunk-HNAS6BSS.js.map → chunk-SNUROC7E.js.map} +3 -3
  21. package/dist/chunks/{configService-TXBNUBBL.js → configService-MICL4S2L.js} +2 -2
  22. package/dist/chunks/{constants-5CRJRQNR.js → constants-ZEU4TZCA.js} +2 -2
  23. package/dist/entries/server-router.js +7 -7
  24. package/dist/lib/client/index.js +11 -6
  25. package/dist/lib/client/index.js.map +2 -2
  26. package/dist/lib/server/index.js +507 -1587
  27. package/dist/lib/server/index.js.map +4 -4
  28. package/dist/lib/shared/index.js +3 -3
  29. package/dist/lib/test-utils/index.js +1 -1
  30. package/lib/client/core/ComponentBuilder.ts +1 -1
  31. package/lib/client/core/builders/embedBuilder.ts +2 -2
  32. package/lib/client/routing/Router.tsx +6 -0
  33. package/lib/client/templateEngine.test.ts +178 -0
  34. package/lib/client/templateEngine.ts +1 -2
  35. package/lib/server/astro/cmsPageEmitter.ts +420 -0
  36. package/lib/server/astro/componentEmitter.ts +150 -17
  37. package/lib/server/astro/nodeToAstro.test.ts +1101 -0
  38. package/lib/server/astro/nodeToAstro.ts +869 -37
  39. package/lib/server/astro/pageEmitter.ts +43 -3
  40. package/lib/server/astro/tailwindMapper.ts +69 -8
  41. package/lib/server/astro/templateTransformer.ts +107 -0
  42. package/lib/server/index.ts +26 -3
  43. package/lib/server/routes/api/components.ts +62 -0
  44. package/lib/server/routes/api/core-routes.ts +8 -0
  45. package/lib/server/services/configService.ts +12 -0
  46. package/lib/server/ssr/htmlGenerator.ts +0 -5
  47. package/lib/server/ssr/imageMetadata.ts +3 -3
  48. package/lib/server/ssr/ssrRenderer.ts +78 -29
  49. package/lib/server/webflow/buildWebflow.ts +415 -0
  50. package/lib/server/webflow/index.ts +22 -0
  51. package/lib/server/webflow/nodeToWebflow.ts +423 -0
  52. package/lib/server/webflow/styleMapper.ts +241 -0
  53. package/lib/server/webflow/types.ts +196 -0
  54. package/lib/shared/constants.ts +4 -0
  55. package/lib/shared/types/components.ts +9 -4
  56. package/lib/shared/validation/propValidator.ts +2 -1
  57. package/lib/shared/validation/schemas.ts +4 -1
  58. package/package.json +1 -1
  59. package/templates/index-router.html +0 -5
  60. package/dist/chunks/chunk-A6KWUEA6.js.map +0 -7
  61. package/dist/chunks/chunk-KULPBDC7.js.map +0 -7
  62. package/dist/chunks/chunk-NV25WXCA.js.map +0 -7
  63. package/dist/chunks/chunk-P3FX5HJM.js.map +0 -7
  64. package/dist/chunks/chunk-W6HDII4T.js.map +0 -7
  65. /package/dist/chunks/{chunk-WK5XLASY.js.map → chunk-EQOSDQS2.js.map} +0 -0
  66. /package/dist/chunks/{configService-TXBNUBBL.js.map → configService-MICL4S2L.js.map} +0 -0
  67. /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-W6HDII4T.js";
19
+ } from "./chunk-SK3TLNUP.js";
20
20
  import {
21
21
  configService
22
- } from "./chunk-A6KWUEA6.js";
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-P3FX5HJM.js";
45
+ } from "./chunk-S2HXJTAF.js";
46
46
  import {
47
47
  addItemUrls
48
- } from "./chunk-NV25WXCA.js";
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-KULPBDC7.js";
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-HNAS6BSS.js.map
3220
+ //# sourceMappingURL=chunk-SNUROC7E.js.map