@kyro-cms/core 0.5.2 → 0.5.3

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.
@@ -1,68 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ var chunkGBH6DN5C_cjs = require('./chunk-GBH6DN5C.cjs');
3
4
  require('./chunk-G7VZBCD6.cjs');
4
- var path = require('path');
5
- var fs = require('fs');
6
5
 
7
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
6
 
9
- var path__default = /*#__PURE__*/_interopDefault(path);
10
- var fs__default = /*#__PURE__*/_interopDefault(fs);
11
7
 
12
- function kyro(options = {}) {
13
- const {
14
- configPath = "./kyro.config.ts",
15
- apiPath = "/api",
16
- adminPath = "/admin",
17
- admin = true
18
- } = options;
19
- return {
20
- name: "@kyro-cms/core",
21
- hooks: {
22
- "astro:config:setup": async ({ config, updateConfig, injectRoute, logger }) => {
23
- logger.info(`Setting up Kyro CMS (API: ${apiPath}, Admin: ${adminPath})`);
24
- const resolvedConfigPath = path__default.default.resolve(config.root.pathname, configPath);
25
- let finalConfigPath = resolvedConfigPath;
26
- if (!fs__default.default.existsSync(resolvedConfigPath)) {
27
- logger.warn(`Kyro config file not found at ${configPath}. The API will fail to boot if collections are needed.`);
28
- }
29
- updateConfig({
30
- vite: {
31
- resolve: {
32
- alias: {
33
- "kyro:config": finalConfigPath
34
- }
35
- },
36
- define: {
37
- __KYRO_API_PATH__: JSON.stringify(apiPath),
38
- __KYRO_ADMIN_PATH__: JSON.stringify(adminPath)
39
- }
40
- }
41
- });
42
- injectRoute({
43
- pattern: `${apiPath}/[...path]`,
44
- entrypoint: "@kyro-cms/core/api-handler"
45
- });
46
- if (admin) {
47
- try {
48
- const { ADMIN_ROUTES } = await import('@kyro-cms/admin/routes');
49
- for (const route of ADMIN_ROUTES) {
50
- const pattern = adminPath + route.pattern;
51
- injectRoute({
52
- pattern,
53
- entrypoint: route.entrypoint
54
- });
55
- }
56
- logger.info(`Mounted ${ADMIN_ROUTES.length} admin routes at ${adminPath}`);
57
- } catch (e) {
58
- logger.warn("Could not find @kyro-cms/admin/routes. Admin UI will not be available.");
59
- }
60
- }
61
- }
62
- }
63
- };
64
- }
65
-
66
- module.exports = kyro;
8
+ module.exports = chunkGBH6DN5C_cjs.kyro;
67
9
  //# sourceMappingURL=integration.cjs.map
68
10
  //# sourceMappingURL=integration.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/integration.ts"],"names":["path","fs"],"mappings":";;;;;;;;;;;AA2Be,SAAR,IAAA,CAAsB,OAAA,GAAkC,EAAC,EAAqB;AACnF,EAAA,MAAM;AAAA,IACJ,UAAA,GAAa,kBAAA;AAAA,IACb,OAAA,GAAU,MAAA;AAAA,IACV,SAAA,GAAY,QAAA;AAAA,IACZ,KAAA,GAAQ;AAAA,GACV,GAAI,OAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,KAAA,EAAO;AAAA,MACL,sBAAsB,OAAO,EAAE,QAAQ,YAAA,EAAc,WAAA,EAAa,QAAO,KAAM;AAC7E,QAAA,MAAA,CAAO,IAAA,CAAK,CAAA,0BAAA,EAA6B,OAAO,CAAA,SAAA,EAAY,SAAS,CAAA,CAAA,CAAG,CAAA;AAGxE,QAAA,MAAM,qBAAqBA,qBAAA,CAAK,OAAA,CAAQ,MAAA,CAAO,IAAA,CAAK,UAAU,UAAU,CAAA;AAExE,QAAA,IAAI,eAAA,GAAkB,kBAAA;AACtB,QAAA,IAAI,CAACC,mBAAA,CAAG,UAAA,CAAW,kBAAkB,CAAA,EAAG;AACtC,UAAA,MAAA,CAAO,IAAA,CAAK,CAAA,8BAAA,EAAiC,UAAU,CAAA,sDAAA,CAAwD,CAAA;AAAA,QAEjH;AAGA,QAAA,YAAA,CAAa;AAAA,UACX,IAAA,EAAM;AAAA,YACJ,OAAA,EAAS;AAAA,cACP,KAAA,EAAO;AAAA,gBACL,aAAA,EAAe;AAAA;AACjB,aACF;AAAA,YACA,MAAA,EAAQ;AAAA,cACN,iBAAA,EAAmB,IAAA,CAAK,SAAA,CAAU,OAAO,CAAA;AAAA,cACzC,mBAAA,EAAqB,IAAA,CAAK,SAAA,CAAU,SAAS;AAAA;AAC/C;AACF,SACD,CAAA;AAID,QAAA,WAAA,CAAY;AAAA,UACV,OAAA,EAAS,GAAG,OAAO,CAAA,UAAA,CAAA;AAAA,UACnB,UAAA,EAAY;AAAA,SACb,CAAA;AAGD,QAAA,IAAI,KAAA,EAAO;AACT,UAAA,IAAI;AAEF,YAAA,MAAM,EAAE,YAAA,EAAa,GAAI,MAAM,OAAO,wBAAwB,CAAA;AAE9D,YAAA,KAAA,MAAW,SAAS,YAAA,EAAc;AAChC,cAAA,MAAM,OAAA,GAAU,YAAY,KAAA,CAAM,OAAA;AAElC,cAAA,WAAA,CAAY;AAAA,gBACV,OAAA;AAAA,gBACA,YAAY,KAAA,CAAM;AAAA,eACnB,CAAA;AAAA,YACH;AACA,YAAA,MAAA,CAAO,KAAK,CAAA,QAAA,EAAW,YAAA,CAAa,MAAM,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAE,CAAA;AAAA,UAC3E,SAAS,CAAA,EAAG;AACV,YAAA,MAAA,CAAO,KAAK,wEAAwE,CAAA;AAAA,UACtF;AAAA,QACF;AAAA,MACF;AAAA;AACF,GACF;AACF","file":"integration.cjs","sourcesContent":["import type { AstroIntegration } from \"astro\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport interface KyroIntegrationOptions {\n /**\n * Path to the kyro configuration file relative to the project root.\n * Default: './kyro.config.ts'\n */\n configPath?: string;\n /**\n * Base path where the API should be mounted.\n * Default: '/api/kyro'\n */\n apiPath?: string;\n /**\n * Base path where the admin UI should be mounted.\n * Default: '/admin'\n */\n adminPath?: string;\n /**\n * Whether to mount the admin UI.\n * Default: true\n */\n admin?: boolean;\n}\n\nexport default function kyro(options: KyroIntegrationOptions = {}): AstroIntegration {\n const {\n configPath = \"./kyro.config.ts\",\n apiPath = \"/api\",\n adminPath = \"/admin\",\n admin = true,\n } = options;\n\n return {\n name: \"@kyro-cms/core\",\n hooks: {\n \"astro:config:setup\": async ({ config, updateConfig, injectRoute, logger }) => {\n logger.info(`Setting up Kyro CMS (API: ${apiPath}, Admin: ${adminPath})`);\n \n // Resolve config path\n const resolvedConfigPath = path.resolve(config.root.pathname, configPath);\n \n let finalConfigPath = resolvedConfigPath;\n if (!fs.existsSync(resolvedConfigPath)) {\n logger.warn(`Kyro config file not found at ${configPath}. The API will fail to boot if collections are needed.`);\n // If we had a default fallback, we could set it here\n }\n \n // Add Vite configuration so the API handler can import the config\n updateConfig({\n vite: {\n resolve: {\n alias: {\n \"kyro:config\": finalConfigPath,\n },\n },\n define: {\n __KYRO_API_PATH__: JSON.stringify(apiPath),\n __KYRO_ADMIN_PATH__: JSON.stringify(adminPath),\n },\n },\n });\n \n // Inject the core API routes\n // This mounts our Hono app or Astro endpoints to handle backend requests\n injectRoute({\n pattern: `${apiPath}/[...path]`,\n entrypoint: \"@kyro-cms/core/api-handler\",\n });\n \n // Inject admin routes if enabled\n if (admin) {\n try {\n // @ts-ignore\n const { ADMIN_ROUTES } = await import(\"@kyro-cms/admin/routes\");\n \n for (const route of ADMIN_ROUTES) {\n const pattern = adminPath + route.pattern;\n \n injectRoute({\n pattern,\n entrypoint: route.entrypoint,\n });\n }\n logger.info(`Mounted ${ADMIN_ROUTES.length} admin routes at ${adminPath}`);\n } catch (e) {\n logger.warn(\"Could not find @kyro-cms/admin/routes. Admin UI will not be available.\");\n }\n }\n },\n },\n };\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"integration.cjs"}
@@ -1,61 +1,4 @@
1
+ export { kyro as default } from './chunk-ATVNYGRQ.js';
1
2
  import './chunk-Z6ZWNWWR.js';
2
- import path from 'path';
3
- import fs from 'fs';
4
-
5
- function kyro(options = {}) {
6
- const {
7
- configPath = "./kyro.config.ts",
8
- apiPath = "/api",
9
- adminPath = "/admin",
10
- admin = true
11
- } = options;
12
- return {
13
- name: "@kyro-cms/core",
14
- hooks: {
15
- "astro:config:setup": async ({ config, updateConfig, injectRoute, logger }) => {
16
- logger.info(`Setting up Kyro CMS (API: ${apiPath}, Admin: ${adminPath})`);
17
- const resolvedConfigPath = path.resolve(config.root.pathname, configPath);
18
- let finalConfigPath = resolvedConfigPath;
19
- if (!fs.existsSync(resolvedConfigPath)) {
20
- logger.warn(`Kyro config file not found at ${configPath}. The API will fail to boot if collections are needed.`);
21
- }
22
- updateConfig({
23
- vite: {
24
- resolve: {
25
- alias: {
26
- "kyro:config": finalConfigPath
27
- }
28
- },
29
- define: {
30
- __KYRO_API_PATH__: JSON.stringify(apiPath),
31
- __KYRO_ADMIN_PATH__: JSON.stringify(adminPath)
32
- }
33
- }
34
- });
35
- injectRoute({
36
- pattern: `${apiPath}/[...path]`,
37
- entrypoint: "@kyro-cms/core/api-handler"
38
- });
39
- if (admin) {
40
- try {
41
- const { ADMIN_ROUTES } = await import('@kyro-cms/admin/routes');
42
- for (const route of ADMIN_ROUTES) {
43
- const pattern = adminPath + route.pattern;
44
- injectRoute({
45
- pattern,
46
- entrypoint: route.entrypoint
47
- });
48
- }
49
- logger.info(`Mounted ${ADMIN_ROUTES.length} admin routes at ${adminPath}`);
50
- } catch (e) {
51
- logger.warn("Could not find @kyro-cms/admin/routes. Admin UI will not be available.");
52
- }
53
- }
54
- }
55
- }
56
- };
57
- }
58
-
59
- export { kyro as default };
60
3
  //# sourceMappingURL=integration.js.map
61
4
  //# sourceMappingURL=integration.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/integration.ts"],"names":[],"mappings":";;;;AA2Be,SAAR,IAAA,CAAsB,OAAA,GAAkC,EAAC,EAAqB;AACnF,EAAA,MAAM;AAAA,IACJ,UAAA,GAAa,kBAAA;AAAA,IACb,OAAA,GAAU,MAAA;AAAA,IACV,SAAA,GAAY,QAAA;AAAA,IACZ,KAAA,GAAQ;AAAA,GACV,GAAI,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A,gBACV,OAAA;AAAA,gBACA,YAAY,KAAA,CAAM;AAAA,eACnB,CAAA;AAAA,YACH;AACA,YAAA,MAAA,CAAO,KAAK,CAAA,QAAA,EAAW,YAAA,CAAa,MAAM,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAE,CAAA;AAAA,UAC3E,SAAS,CAAA,EAAG;AACV,YAAA,MAAA,CAAO,KAAK,wEAAwE,CAAA;AAAA,UACtF;AAAA,QACF;AAAA,MACF;AAAA;AACF,GACF;AACF","file":"integration.js","sourcesContent":["import type { AstroIntegration } from \"astro\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport interface KyroIntegrationOptions {\n /**\n * Path to the kyro configuration file relative to the project root.\n * Default: './kyro.config.ts'\n */\n configPath?: string;\n /**\n * Base path where the API should be mounted.\n * Default: '/api/kyro'\n */\n apiPath?: string;\n /**\n * Base path where the admin UI should be mounted.\n * Default: '/admin'\n */\n adminPath?: string;\n /**\n * Whether to mount the admin UI.\n * Default: true\n */\n admin?: boolean;\n}\n\nexport default function kyro(options: KyroIntegrationOptions = {}): AstroIntegration {\n const {\n configPath = \"./kyro.config.ts\",\n apiPath = \"/api\",\n adminPath = \"/admin\",\n admin = true,\n } = options;\n\n return {\n name: \"@kyro-cms/core\",\n hooks: {\n \"astro:config:setup\": async ({ config, updateConfig, injectRoute, logger }) => {\n logger.info(`Setting up Kyro CMS (API: ${apiPath}, Admin: ${adminPath})`);\n \n // Resolve config path\n const resolvedConfigPath = path.resolve(config.root.pathname, configPath);\n \n let finalConfigPath = resolvedConfigPath;\n if (!fs.existsSync(resolvedConfigPath)) {\n logger.warn(`Kyro config file not found at ${configPath}. The API will fail to boot if collections are needed.`);\n // If we had a default fallback, we could set it here\n }\n \n // Add Vite configuration so the API handler can import the config\n updateConfig({\n vite: {\n resolve: {\n alias: {\n \"kyro:config\": finalConfigPath,\n },\n },\n define: {\n __KYRO_API_PATH__: JSON.stringify(apiPath),\n __KYRO_ADMIN_PATH__: JSON.stringify(adminPath),\n },\n },\n });\n \n // Inject the core API routes\n // This mounts our Hono app or Astro endpoints to handle backend requests\n injectRoute({\n pattern: `${apiPath}/[...path]`,\n entrypoint: \"@kyro-cms/core/api-handler\",\n });\n \n // Inject admin routes if enabled\n if (admin) {\n try {\n // @ts-ignore\n const { ADMIN_ROUTES } = await import(\"@kyro-cms/admin/routes\");\n \n for (const route of ADMIN_ROUTES) {\n const pattern = adminPath + route.pattern;\n \n injectRoute({\n pattern,\n entrypoint: route.entrypoint,\n });\n }\n logger.info(`Mounted ${ADMIN_ROUTES.length} admin routes at ${adminPath}`);\n } catch (e) {\n logger.warn(\"Could not find @kyro-cms/admin/routes. Admin UI will not be available.\");\n }\n }\n },\n },\n };\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"integration.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyro-cms/core",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support",
5
5
  "engines": {
6
6
  "node": ">=22"