@forinda/kickjs-cli 8.14.4 → 8.14.6
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/bin.js +56 -1
- package/dist/{agent-docs-IMSfDW1v.mjs → agent-docs-C1fM3mXV.mjs} +3 -3
- package/dist/{agent-docs-IMSfDW1v.mjs.map → agent-docs-C1fM3mXV.mjs.map} +1 -1
- package/dist/{agent-docs-B4ENB4Jf.mjs → agent-docs-DLkqhKAx.mjs} +2 -2
- package/dist/{build-BhsFtlz-.mjs → build-B4vPtyvv.mjs} +3 -3
- package/dist/{build-BhsFtlz-.mjs.map → build-B4vPtyvv.mjs.map} +1 -1
- package/dist/{build-fe-IPSgY.mjs → build-C7756Hsu.mjs} +2 -2
- package/dist/{builtins-WhIqFKQq.mjs → builtins-CtquiRQB.mjs} +2 -2
- package/dist/{builtins-aD7X3E3D.mjs → builtins-DXacDUD_.mjs} +4 -4
- package/dist/cli.mjs +2 -2
- package/dist/{config-C8VZHQ4a.mjs → config-CI9pVF5P.mjs} +3 -3
- package/dist/{config-C8VZHQ4a.mjs.map → config-CI9pVF5P.mjs.map} +1 -1
- package/dist/{config-uQW9K9TV.mjs → config-D80wnWgv.mjs} +2 -2
- package/dist/{doctor-D7Voplu-.mjs → doctor-CfU8GbJz.mjs} +4 -4
- package/dist/{doctor-D7Voplu-.mjs.map → doctor-CfU8GbJz.mjs.map} +1 -1
- package/dist/{fullstack-CNN0RMJj.mjs → fullstack-BNgFfRiv.mjs} +4 -4
- package/dist/{fullstack-CNN0RMJj.mjs.map → fullstack-BNgFfRiv.mjs.map} +1 -1
- package/dist/{fullstack-Cz6m6I32.mjs → fullstack-CaIzq2C5.mjs} +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{package-manager-DjQ5hOIz.mjs → package-manager-BSW23HwO.mjs} +3 -3
- package/dist/{package-manager-DjQ5hOIz.mjs.map → package-manager-BSW23HwO.mjs.map} +1 -1
- package/dist/{package-manager-KXWql8Ih.mjs → package-manager-ZvCCh0kq.mjs} +2 -2
- package/dist/{plugin-Dmt8BaqI.mjs → plugin-CXaj2i5Y.mjs} +2 -2
- package/dist/{plugin-q3LTBltC.mjs → plugin-DKrL6WH5.mjs} +2 -2
- package/dist/{project-4oHY0jOl.mjs → project-Bwt2uuHp.mjs} +8 -6
- package/dist/project-Bwt2uuHp.mjs.map +1 -0
- package/dist/{project-D9FX1B56.mjs → project-Q1ml7trN.mjs} +7 -5
- package/dist/{project-root-D6NXawpn.mjs → project-root-DGZ8lAPG.mjs} +2 -2
- package/dist/{project-root-D4CQYHJy.mjs → project-root-dQZYvCXv.mjs} +3 -3
- package/dist/{project-root-D4CQYHJy.mjs.map → project-root-dQZYvCXv.mjs.map} +1 -1
- package/dist/{rolldown-runtime-C6kPX6_j.mjs → rolldown-runtime-B3K4rer-.mjs} +1 -1
- package/dist/{run-plugins-9FIERkDq.mjs → run-plugins-C9dOrOSt.mjs} +4 -4
- package/dist/{run-plugins-9FIERkDq.mjs.map → run-plugins-C9dOrOSt.mjs.map} +1 -1
- package/dist/{typegen-CNVeHcvE.mjs → typegen-BwnKoL1q.mjs} +5 -5
- package/dist/{typegen-CNVeHcvE.mjs.map → typegen-BwnKoL1q.mjs.map} +1 -1
- package/dist/{typegen-CA-hDh1k.mjs → typegen-VBagOQY4.mjs} +4 -4
- package/dist/{types-cg36SCgd.mjs → types-CHsKxl8b.mjs} +1 -1
- package/package.json +4 -4
- package/templates/template-inertia/files/src/client/main.tsx +9 -2
- package/templates/template-inertia/files/src/modules/pages/pages.test.ts +3 -0
- package/dist/project-4oHY0jOl.mjs.map +0 -1
package/bin.js
CHANGED
|
@@ -2,7 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
// ESM wrapper for the ESM CLI entry.
|
|
4
4
|
// Bin entries must be plain .js (not .mjs) for universal Node.js compatibility.
|
|
5
|
-
import
|
|
5
|
+
import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs'
|
|
6
|
+
import { dirname, join, sep } from 'node:path'
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
8
|
+
|
|
9
|
+
// A `kick` installed elsewhere (globally, or in a parent folder) run inside a
|
|
10
|
+
// project hands off to the project's own CLI. Otherwise both copies of
|
|
11
|
+
// @forinda/kickjs load into one process — this CLI's and the one kick.config.ts
|
|
12
|
+
// imports — each with its own DI container, and the project's version is the
|
|
13
|
+
// one that should answer.
|
|
14
|
+
//
|
|
15
|
+
// Only the project the command runs in counts: the nearest folder with a
|
|
16
|
+
// package.json, which has to list @forinda/kickjs-cli (as `kick new` writes it).
|
|
17
|
+
// It never looks past that folder, so a node_modules in a parent (/tmp, a
|
|
18
|
+
// shared drive) is never run. The folder and the CLI package must belong to
|
|
19
|
+
// the user running kick and not be writable by everyone; where there are no
|
|
20
|
+
// owners to check (Windows), only the current folder counts.
|
|
21
|
+
// KICK_NO_HANDOFF=1 opts out.
|
|
22
|
+
function ownedByMe(path) {
|
|
23
|
+
const { uid, mode } = statSync(path)
|
|
24
|
+
return uid === process.getuid() && (mode & 0o002) === 0
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function projectCli() {
|
|
28
|
+
if (process.env.KICK_NO_HANDOFF === '1') return undefined
|
|
29
|
+
const posix = typeof process.getuid === 'function'
|
|
30
|
+
let dir = process.cwd()
|
|
31
|
+
while (!existsSync(join(dir, 'package.json'))) {
|
|
32
|
+
if (!posix || dirname(dir) === dir) return undefined
|
|
33
|
+
dir = dirname(dir)
|
|
34
|
+
}
|
|
35
|
+
if (posix && !ownedByMe(dir)) return undefined
|
|
36
|
+
const { dependencies, devDependencies } = JSON.parse(
|
|
37
|
+
readFileSync(join(dir, 'package.json'), 'utf8'),
|
|
38
|
+
)
|
|
39
|
+
if ({ ...dependencies, ...devDependencies }['@forinda/kickjs-cli'] === undefined) return undefined
|
|
40
|
+
const pkg = join(dir, 'node_modules', '@forinda', 'kickjs-cli', 'package.json')
|
|
41
|
+
if (!existsSync(pkg)) return undefined
|
|
42
|
+
const root = realpathSync(dirname(pkg))
|
|
43
|
+
if (root === realpathSync(dirname(fileURLToPath(import.meta.url)))) return undefined
|
|
44
|
+
if (posix && !ownedByMe(root)) return undefined
|
|
45
|
+
const bin = JSON.parse(readFileSync(pkg, 'utf8')).bin
|
|
46
|
+
const file = typeof bin === 'string' ? bin : bin?.kick
|
|
47
|
+
if (typeof file !== 'string') return undefined
|
|
48
|
+
const target = realpathSync(join(root, file))
|
|
49
|
+
// The bin has to live in the package it came from.
|
|
50
|
+
return target.startsWith(root + sep) ? target : undefined
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let local
|
|
54
|
+
try {
|
|
55
|
+
local = projectCli()
|
|
56
|
+
} catch {
|
|
57
|
+
// Unreadable package.json or the like: run this copy.
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
import(local ? pathToFileURL(local).href : './dist/cli.mjs').catch((err) => {
|
|
6
61
|
console.error('Failed to load CLI:', err)
|
|
7
62
|
process.exit(1)
|
|
8
63
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.14.
|
|
2
|
+
* @forinda/kickjs-cli v8.14.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{t as e}from"./rolldown-runtime-
|
|
11
|
+
import{t as e}from"./rolldown-runtime-B3K4rer-.mjs";import{_ as t,i as n,n as r}from"./package-manager-BSW23HwO.mjs";import{i,p as a,s as o}from"./config-CI9pVF5P.mjs";import{join as s}from"node:path";import{existsSync as c,readFileSync as l}from"node:fs";function u(e,t){let n=e;return t===`fullstack`&&n!==`pnpm`?`${a(n,`dev:server`)} + ${a(n,`dev:web`)}`:a(n,`dev`)}function d(e,t,n){return`# CLAUDE.md — ${e}
|
|
12
12
|
|
|
13
13
|
**Read \`./.agents/AGENTS.md\` first.** It is the canonical, multi-agent
|
|
14
14
|
reference for this project (Claude, Copilot, Codex, Gemini, etc.) —
|
|
@@ -930,4 +930,4 @@ Codex / Cursor / Gemini / Claude Code without copy-pasting.
|
|
|
930
930
|
CLI template. Hand-edited content is overwritten — keep customisation
|
|
931
931
|
in \`.agents/COPILOT.local.md\`.
|
|
932
932
|
`}var _=/* @__PURE__ */ e({generateAgentDocs:()=>C});const v=`.agents`,y=/* @__PURE__ */ new Set([`rest`,`minimal`,`fullstack`,`inertia`]);function b(e,t){if(t)return t;try{let t=JSON.parse(l(s(e,`package.json`),`utf-8`));if(t.name)return t.name.replace(/^@[^/]+\//,``)}catch{}return e.split(`/`).findLast(Boolean)??`app`}async function x(e){try{return(await o(e))?.modules?.style===`class`?`class`:`define`}catch{return`define`}}async function S(e,t){if(t)return t;try{let t=(await o(e))?.pattern;if(t&&y.has(t))return t}catch{}return`rest`}async function C(e){let i=e.only??`all`,a=b(e.outDir,e.name),o=await r(e.pm,e.outDir),l=await S(e.outDir,e.template),u=await x(e.outDir),p=i===`agents`||i===`both`||i===`all`,_=i===`claude`||i===`both`||i===`all`,y=i===`skills`||i===`all`,C=i===`gemini`||i===`all`,w=i===`copilot`||i===`all`,T=[];if(p&&T.push({file:s(e.outDir,v,`AGENTS.md`),render:()=>f(a,l,o)}),_&&T.push({file:s(e.outDir,`CLAUDE.md`),render:()=>d(a,l,o)}),y)for(let t of m(a,l,o,u))T.push({file:s(e.outDir,v,`skills`,t.slug,`SKILL.md`),render:()=>t.content});C&&T.push({file:s(e.outDir,v,`GEMINI.md`),render:()=>h(a,l,o)}),w&&T.push({file:s(e.outDir,v,`COPILOT.md`),render:()=>g(a,l,o)});let E=[];for(let{file:r,render:i}of T)c(r)&&!e.force&&!await n({message:`${r.replace(e.outDir+`/`,``)} already exists. Overwrite?`,initialValue:!1})?console.log(` Skipped — existing ${r.replace(e.outDir+`/`,``)} preserved.`):(await t(r,i()),E.push(r));return E}export{C as n,_ as t};
|
|
933
|
-
//# sourceMappingURL=agent-docs-
|
|
933
|
+
//# sourceMappingURL=agent-docs-C1fM3mXV.mjs.map
|