@kyro-cms/core 0.12.63 → 0.12.65

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 (35) hide show
  1. package/dist/api-handler-graphql.cjs +1 -1
  2. package/dist/api-handler-graphql.js +1 -1
  3. package/dist/api-handler-trpc.cjs +1 -1
  4. package/dist/api-handler-trpc.js +1 -1
  5. package/dist/api-handler.cjs +1 -1
  6. package/dist/api-handler.js +1 -1
  7. package/dist/chunk-2F4WPCVA.cjs +120 -0
  8. package/dist/{chunk-ILSBJI77.cjs → chunk-7JCRN5ZH.cjs} +4 -4
  9. package/dist/{chunk-W2XYBPEJ.js → chunk-AXT3QPVM.js} +17 -17
  10. package/dist/{chunk-VZQWWZLY.js → chunk-H5BTDZXQ.js} +1 -1
  11. package/dist/chunk-HOX6BHKS.js +121 -0
  12. package/dist/chunk-JW4HRIVP.cjs +20 -0
  13. package/dist/{chunk-3WSFG6DS.js → chunk-QBYXAKHH.js} +1 -1
  14. package/dist/{chunk-5DWQGEM2.cjs → chunk-QO5ZWQA3.cjs} +13 -13
  15. package/dist/chunk-QXWQELAM.js +21 -0
  16. package/dist/{chunk-75BFTYBS.js → chunk-X473JI7Z.js} +14 -14
  17. package/dist/{chunk-DFDL5JIO.cjs → chunk-YFUH3SST.cjs} +16 -16
  18. package/dist/{chunk-YJZTUT7I.cjs → chunk-ZDMJOFKR.cjs} +1 -1
  19. package/dist/drizzle/index.cjs +1 -1
  20. package/dist/drizzle/index.js +1 -1
  21. package/dist/graphql/index.cjs +1 -1
  22. package/dist/graphql/index.js +1 -1
  23. package/dist/index.cjs +3 -3
  24. package/dist/index.js +1 -1
  25. package/dist/integration.cjs +1 -1
  26. package/dist/integration.d.cts +1 -0
  27. package/dist/integration.d.ts +1 -0
  28. package/dist/integration.js +1 -1
  29. package/dist/rest/index.cjs +1 -1
  30. package/dist/rest/index.js +1 -1
  31. package/package.json +2 -2
  32. package/dist/chunk-6424BWOB.cjs +0 -120
  33. package/dist/chunk-FJPY42VZ.cjs +0 -20
  34. package/dist/chunk-PCN6QV3Z.js +0 -21
  35. package/dist/chunk-QE7LORN4.js +0 -121
@@ -0,0 +1,21 @@
1
+ import {g}from'./chunk-Y2YAKDEQ.js';import i from'path';import _ from'fs';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
+ g();var l=n=>{let s=i.join(process.cwd(),"node_modules","@kyro-cms","core"),e=i.resolve(s,"src",`${n}.ts`);return _.existsSync(e)?e:i.resolve(s,"dist",`${n}.js`)},P=l("api-handler"),x=l("api-handler-graphql"),R=l("api-handler-trpc"),b=["@kyro-cms/core","@kyro-cms/admin","@kyro-cms/astro","@kyro-cms/ai"],N=["@kyro-cms/connect"],O=[...b,...N],E=["better-sqlite3","pg","mongodb","ioredis","sharp","ssh2","cpu-features","ssh2-sftp-client","nodemailer","jsonwebtoken","@mapbox/node-pre-gyp","mock-aws-s3","aws-sdk","nock","cloudflare:workers"],k=["crypto","node:crypto","module","node:module","fs","node:fs","fs/promises","node:fs/promises","path","node:path","util","node:util","stream","node:stream","events","node:events","url","node:url","http","node:http","https","node:https","os","node:os","child_process","node:child_process","assert","node:assert","zlib","node:zlib","buffer","node:buffer"],S=[...b,...E],v=[...O,...k,...E];function T(n={}){let{configPath:s="./kyro.config.ts",apiPath:e="/api",adminPath:r="/admin",admin:g=true,enableGraphQL:c=false,enableTRPC:p=false,enableWebSocket:d=false}=n;return {name:"@kyro-cms/core",hooks:{"astro:config:setup":async({config:u,updateConfig:h,injectRoute:a,logger:o,addDevToolbarApp:I})=>{if(o.info(`Setting up Kyro CMS (API: ${e}, Admin: ${r})`),e===r)throw new Error(`Kyro CMS: apiPath and adminPath cannot be the same ("${e}")`);let f=i.resolve(u.root.pathname,s),A=f;if(_.existsSync(f)||o.warn(`Kyro config file not found at ${s}. The API will fail to boot if collections are needed.`),h({security:{checkOrigin:false},vite:{ssr:{external:v},build:{rollupOptions:{external:S}},optimizeDeps:{exclude:S},server:{watch:{ignored:["**/*.db","**/*.db-*","**/data/**","**/public/uploads/**","**/.kyro/**"]}},plugins:[{name:"use-sync-external-store-shim-fix",enforce:"pre",resolveId(t){if(t==="use-sync-external-store/shim"||t==="use-sync-external-store/shim/index.js")return "\0virtual:use-sync-external-store-shim";if(t==="use-sync-external-store/shim/with-selector"||t==="use-sync-external-store/shim/with-selector.js")return "\0virtual:use-sync-external-store-shim-with-selector"},load(t){if(t==="\0virtual:use-sync-external-store-shim")return 'export { useSyncExternalStore } from "react";';if(t==="\0virtual:use-sync-external-store-shim-with-selector")return `
3
+ import { useSyncExternalStore, useMemo } from "react";
4
+ export function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
5
+ const memoizedSelector = useMemo(() => {
6
+ let last, lastSnap, hasMemo = false;
7
+ return (snap) => {
8
+ if (!hasMemo || !Object.is(lastSnap, snap)) {
9
+ const next = selector(snap);
10
+ if (!hasMemo || !(isEqual ? isEqual(last, next) : Object.is(last, next))) {
11
+ last = next; lastSnap = snap; hasMemo = true;
12
+ }
13
+ }
14
+ return last;
15
+ };
16
+ }, [selector, isEqual]);
17
+ const getSelection = () => memoizedSelector(getSnapshot());
18
+ const getServerSelection = getServerSnapshot != null ? () => memoizedSelector(getServerSnapshot()) : undefined;
19
+ return useSyncExternalStore(subscribe, getSelection, getServerSelection);
20
+ }
21
+ `}}],resolve:{alias:{debug:"debug/src/node.js","kyro:config":A}},define:{__KYRO_API_PATH__:JSON.stringify(e),__KYRO_ADMIN_PATH__:JSON.stringify(r),__KYRO_ENABLE_GRAPHQL__:JSON.stringify(c),__KYRO_ENABLE_TRPC__:JSON.stringify(p),__KYRO_ENABLE_WS__:JSON.stringify(d)}}}),a({pattern:`${e}/[...path]`,entrypoint:P}),c&&(a({pattern:`${e}/graphql`,entrypoint:x}),o.info(`GraphQL endpoint enabled at ${e}/graphql`)),p&&(a({pattern:`${e}/trpc/[...path]`,entrypoint:R}),o.info(`tRPC endpoint enabled at ${e}/trpc`)),d&&o.info("WebSocket support enabled (auto-starts at first request)"),g!==false)try{let m=(await import('@kyro-cms/admin/integration')).kyroAdmin({basePath:r,apiPath:e,configPath:s});m.hooks?.["astro:config:setup"]&&await m.hooks["astro:config:setup"]({config:u,updateConfig:h,injectRoute:a,logger:o});}catch{}}}}}export{T as a};