@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.
- package/dist/chunk-ATVNYGRQ.js +61 -0
- package/dist/chunk-ATVNYGRQ.js.map +1 -0
- package/dist/chunk-GBH6DN5C.cjs +68 -0
- package/dist/chunk-GBH6DN5C.cjs.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/integration.cjs +2 -60
- package/dist/integration.cjs.map +1 -1
- package/dist/integration.js +1 -58
- package/dist/integration.js.map +1 -1
- package/package.json +1 -1
package/dist/integration.cjs
CHANGED
|
@@ -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
|
-
|
|
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
|
package/dist/integration.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"integration.cjs"}
|
package/dist/integration.js
CHANGED
|
@@ -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
|
package/dist/integration.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"integration.js"}
|