@forinda/kickjs-cli 5.5.1 → 5.8.0

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 (31) hide show
  1. package/README.md +1 -1
  2. package/dist/{run-plugins-tnHiahkq.mjs → builtins-CYSzLo7U.mjs} +2 -2
  3. package/dist/cli.mjs +4086 -2
  4. package/dist/config-ierHW69f.mjs +12 -0
  5. package/dist/{config-Buzo7RE1.mjs.map → config-ierHW69f.mjs.map} +1 -1
  6. package/dist/{generator-extension-m04pTdQi.mjs → generator-extension-BXLt3Tp_.mjs} +314 -78
  7. package/dist/generator-extension-BXLt3Tp_.mjs.map +1 -0
  8. package/dist/index.d.mts +141 -31
  9. package/dist/index.d.mts.map +1 -1
  10. package/dist/index.mjs +3 -2
  11. package/dist/index.mjs.map +1 -0
  12. package/dist/{plugin-BnIpCxAe.mjs → plugin-D_nBy6VP.mjs} +3 -3
  13. package/dist/{plugin-BnIpCxAe.mjs.map → plugin-D_nBy6VP.mjs.map} +1 -1
  14. package/dist/project-root-CqGZOrRR.mjs +12 -0
  15. package/dist/project-root-CqGZOrRR.mjs.map +1 -0
  16. package/dist/{rolldown-runtime-Dnwyy6jt.mjs → rolldown-runtime-B8-Ifyj3.mjs} +1 -1
  17. package/dist/{builtins-DXPOvADa.mjs → run-plugins-Cvgyo_th.mjs} +90 -288
  18. package/dist/run-plugins-Cvgyo_th.mjs.map +1 -0
  19. package/dist/{typegen-CYaoTJ6r.mjs → typegen-C3G375CR.mjs} +4 -4
  20. package/dist/{typegen-CYaoTJ6r.mjs.map → typegen-C3G375CR.mjs.map} +1 -1
  21. package/dist/{types-RTdCiPdS.mjs → types-Kj2ldTnQ.mjs} +2 -2
  22. package/dist/types-Kj2ldTnQ.mjs.map +1 -0
  23. package/package.json +7 -6
  24. package/dist/builtins-DXPOvADa.mjs.map +0 -1
  25. package/dist/builtins-DYktFyU-.mjs +0 -3952
  26. package/dist/config-Bu3PcPYn.mjs +0 -11
  27. package/dist/config-Buzo7RE1.mjs +0 -12
  28. package/dist/generator-extension-m04pTdQi.mjs.map +0 -1
  29. package/dist/plugin-DZZsizSI.mjs +0 -11
  30. package/dist/typegen-COED-VIb.mjs +0 -116
  31. package/dist/types-RTdCiPdS.mjs.map +0 -1
@@ -1,11 +0,0 @@
1
- /**
2
- * @forinda/kickjs-cli v5.5.1
3
- *
4
- * Copyright (c) Felix Orinda
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- import{t as e}from"./rolldown-runtime-Dnwyy6jt.mjs";import{existsSync as t,readFileSync as n}from"node:fs";import{isAbsolute as r,join as i,relative as a,resolve as o}from"node:path";import{access as s,readFile as c}from"node:fs/promises";var l=e({BUILTIN_REPO_TYPES:()=>d,PACKAGE_MANAGERS:()=>u,defineConfig:()=>f,loadKickConfig:()=>_,resolveModuleConfig:()=>h,resolveTokenScope:()=>p,validateAssetMap:()=>v});const u=[`pnpm`,`npm`,`yarn`,`bun`],d=[`drizzle`,`inmemory`,`prisma`];function f(e){return e}function p(e,r){if(e?.tokenScope&&typeof e.tokenScope==`string`&&e.tokenScope.length>0){let t=m(e.tokenScope);if(t.length>0)return t}try{let e=i(r,`package.json`);if(t(e)){let t=JSON.parse(n(e,`utf-8`));if(typeof t.name==`string`&&t.name.length>0){let e=t.name.match(/^@([^/]+)\//),n=m(e?e[1]:t.name);if(n.length>0)return n}}}catch{}return`app`}function m(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,`-`).replace(/^-+|-+$/g,``).replace(/-{2,}/g,`-`)}function h(e){if(!e)return{};let t={dir:e.modules?.dir,repo:e.modules?.repo,schemaDir:e.modules?.schemaDir,pluralize:e.modules?.pluralize,prismaClientPath:e.modules?.prismaClientPath,style:e.modules?.style};return t.style!==void 0&&t.style!==`define`&&t.style!==`class`&&(console.warn(` Warning: modules.style '${t.style}' is not a valid value (expected 'define' or 'class'). Falling back to 'define'.`),t.style=`define`),t.repo&&typeof t.repo==`string`&&!d.includes(t.repo)&&console.warn(` Warning: modules.repo '${t.repo}' is not a built-in type (${d.join(`, `)}). It will generate a stub repository. Use { name: '${t.repo}' } to silence this warning.`),t}const g=[`kick.config.ts`,`kick.config.js`,`kick.config.mjs`,`kick.config.json`];async function _(e){for(let t of g){let n=i(e,t);try{await s(n)}catch{continue}if(t.endsWith(`.json`)){let e=await c(n,`utf-8`);return JSON.parse(e)}try{let{pathToFileURL:t}=await import(`node:url`),r=await import(t(n).href),i=r.default??r,a=v(i,e);for(let e of a)console.warn(` Warning: ${e}`);return i}catch{t.endsWith(`.ts`)&&console.warn(`Warning: Failed to load ${t}. TypeScript config files require a runtime loader (e.g. tsx, ts-node) or use kick.config.js/.mjs instead.`);continue}}return null}function v(e,n){let r=[];if(!e?.assetMap)return r;let i=o(n);for(let[a,s]of Object.entries(e.assetMap)){if(!a||a.includes(`/`)){r.push(`assetMap key '${a}' is invalid — must be a non-empty string without '/'`);continue}if(typeof s?.src!=`string`||s.src.length===0){r.push(`assetMap.${a} is missing a non-empty 'src' field`);continue}t(o(n,s.src))||r.push(`assetMap.${a}.src ('${s.src}') does not exist — typegen + build will fail`),s.dest&&y(o(n,s.dest),i)&&r.push(`assetMap.${a}.dest ('${s.dest}') resolves outside the project root — refusing to copy`)}return r}function y(e,t){let n=a(t,e);return n===``?!1:n.startsWith(`..`)||r(n)}export{p as a,h as i,l as n,_ as r,u as t};
@@ -1,12 +0,0 @@
1
- /**
2
- * @forinda/kickjs-cli v5.5.1
3
- *
4
- * Copyright (c) Felix Orinda
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- import{t as e}from"./rolldown-runtime-Dnwyy6jt.mjs";import{isAbsolute as t,join as n,relative as r,resolve as i}from"node:path";import{existsSync as a,readFileSync as o}from"node:fs";import{access as s,readFile as c}from"node:fs/promises";var l=e({BUILTIN_REPO_TYPES:()=>d,PACKAGE_MANAGERS:()=>u,defineConfig:()=>f,loadKickConfig:()=>_,resolveModuleConfig:()=>h,resolveTokenScope:()=>p,validateAssetMap:()=>v});const u=[`pnpm`,`npm`,`yarn`,`bun`],d=[`drizzle`,`inmemory`,`prisma`];function f(e){return e}function p(e,t){if(e?.tokenScope&&typeof e.tokenScope==`string`&&e.tokenScope.length>0){let t=m(e.tokenScope);if(t.length>0)return t}try{let e=n(t,`package.json`);if(a(e)){let t=JSON.parse(o(e,`utf-8`));if(typeof t.name==`string`&&t.name.length>0){let e=t.name.match(/^@([^/]+)\//),n=m(e?e[1]:t.name);if(n.length>0)return n}}}catch{}return`app`}function m(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,`-`).replace(/^-+|-+$/g,``).replace(/-{2,}/g,`-`)}function h(e){if(!e)return{};let t={dir:e.modules?.dir,repo:e.modules?.repo,schemaDir:e.modules?.schemaDir,pluralize:e.modules?.pluralize,prismaClientPath:e.modules?.prismaClientPath,style:e.modules?.style};return t.style!==void 0&&t.style!==`define`&&t.style!==`class`&&(console.warn(` Warning: modules.style '${t.style}' is not a valid value (expected 'define' or 'class'). Falling back to 'define'.`),t.style=`define`),t.repo&&typeof t.repo==`string`&&!d.includes(t.repo)&&console.warn(` Warning: modules.repo '${t.repo}' is not a built-in type (${d.join(`, `)}). It will generate a stub repository. Use { name: '${t.repo}' } to silence this warning.`),t}const g=[`kick.config.ts`,`kick.config.js`,`kick.config.mjs`,`kick.config.json`];async function _(e){for(let t of g){let r=n(e,t);try{await s(r)}catch{continue}if(t.endsWith(`.json`)){let e=await c(r,`utf-8`);return JSON.parse(e)}try{let{pathToFileURL:t}=await import(`node:url`),n=await import(t(r).href),i=n.default??n,a=v(i,e);for(let e of a)console.warn(` Warning: ${e}`);return i}catch{t.endsWith(`.ts`)&&console.warn(`Warning: Failed to load ${t}. TypeScript config files require a runtime loader (e.g. tsx, ts-node) or use kick.config.js/.mjs instead.`);continue}}return null}function v(e,t){let n=[];if(!e?.assetMap)return n;let r=i(t);for(let[o,s]of Object.entries(e.assetMap)){if(!o||o.includes(`/`)){n.push(`assetMap key '${o}' is invalid — must be a non-empty string without '/'`);continue}if(typeof s?.src!=`string`||s.src.length===0){n.push(`assetMap.${o} is missing a non-empty 'src' field`);continue}a(i(t,s.src))||n.push(`assetMap.${o}.src ('${s.src}') does not exist — typegen + build will fail`),s.dest&&y(i(t,s.dest),r)&&n.push(`assetMap.${o}.dest ('${s.dest}') resolves outside the project root — refusing to copy`)}return n}function y(e,n){let i=r(n,e);return i===``?!1:i.startsWith(`..`)||t(i)}export{h as a,_ as i,l as n,p as o,f as r,u as t};
12
- //# sourceMappingURL=config-Buzo7RE1.mjs.map