@tbox.cn/app-cli 1.0.0-alpha.7 → 1.0.0-alpha.9
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-M4PMIFN7.js → chunk-KOSAMSUA.js} +7 -7
- package/dist/{chunk-SBUQHMW4.js → chunk-QB7CUR3M.js} +1 -1
- package/dist/{chunk-ZSKUWMTY.js → chunk-XVKL45DC.js} +1 -1
- package/dist/core.js +1 -1
- package/dist/{declared-LRF2J6XQ.js → declared-FHINMPPU.js} +1 -1
- package/dist/index.js +111 -93
- package/package.json +4 -4
- package/scaffold/app-tool-view/apps/server/src/tools/__ID__.tool.ts +28 -0
- package/scaffold/app-tool-view/scaffold.json +1 -0
- package/scaffold/archetypes/README.md +0 -27
- package/scaffold/archetypes/activity-list/card.tsx.tpl +0 -55
- package/scaffold/archetypes/bill/card.tsx.tpl +0 -38
- package/scaffold/archetypes/entity-list/card.tsx.tpl +0 -43
- package/scaffold/archetypes/hero-stats/card.tsx.tpl +0 -35
- package/scaffold/archetypes/info/card.tsx.tpl +0 -28
- package/scaffold/archetypes/route/card.tsx.tpl +0 -34
- package/scaffold/archetypes/ticket-list/card.tsx.tpl +0 -49
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as s,n as a}from"./chunk-
|
|
2
|
+
import{b as s,n as a}from"./chunk-KOSAMSUA.js";import{existsSync as l}from"fs";import{readFileSync as u}from"fs";import{readdir as d}from"fs/promises";import n from"path";function m(o){let e=n.join(o,"tbox.module.json");if(!l(e))return null;try{let r=s(JSON.parse(u(e,"utf8")));return r.ok?r.value:null}catch{return null}}async function w(o){let e=n.join(o,"packages"),r=[];if(!l(e))return r;let p=await d(e,{withFileTypes:!0});for(let t of p){if(!t.isDirectory())continue;let i=n.join(e,t.name);if(!l(n.join(i,"package.json")))continue;let c=m(i);c&&r.push({id:c.id??t.name,dir:i,descriptor:c})}return r.sort((t,i)=>t.id.localeCompare(i.id))}async function A(o){return a(o)}export{m as a,w as b,A as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{e as tt,f as et,g as nt,h as rt,i as st,j as it,k as ot}from"./chunk-
|
|
2
|
+
import{e as tt,f as et,g as nt,h as rt,i as st,j as it,k as ot}from"./chunk-KOSAMSUA.js";import{existsSync as Rt}from"fs";import jt from"path";var Dt=[{path:"apps/server/src/modules.ts",kind:"server-modules"},{path:"apps/client/src/modules.ts",kind:"client-modules"}];function $e(e){let t=Dt.filter(n=>!Rt(jt.join(e,n.path))).map(n=>n.path);if(t.length>0)throw new Error(`本应用无模块装配面(${t.join("、")} 缺席)——该模板不支持模块系统,不能安装模块或 Provider`)}function Pt(e){return e.split(/[^A-Za-z0-9]+/).filter(Boolean).map((t,n)=>n===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function I(e,t){return Pt(t)}function Ee(e,t){return D[e].contributes(t)}function R(e){return e.replace(/^@[^/]+\//,"").replace(/\/(server|client)$/,"").replace(/\/$/,"")}var D={"server-modules":{mapMarker:"register",importExport:"serverModule",importSuffix:"server",entryPattern:/^\s*([A-Za-z_$][\w$]*),\s*$/,header:"const modules = [",footer:"];",contributes:e=>e.hasServerEntry},"client-modules":{mapMarker:"register",importExport:"clientModule",importSuffix:"client",entryPattern:/^\s*([A-Za-z_$][\w$]*),\s*$/,header:"const modules = [",footer:"];",contributes:e=>e.hasClientEntry}},B=/^import\s*\{\s*([\w$]+)\s+as\s+([\w$]+)\s*\}\s*from\s*['"]([^'"]+)['"];\s*$/,K=/^\]\s*(?:as\s+const)?;\s*$/;function j(e,t){let n=`// @tbox:${t}-begin`,r=`// @tbox:${t}-end`,s=e.indexOf(n);if(s===-1)return null;let i=e.indexOf(r,s);if(i===-1)return null;let o=s+n.length;return{block:e.slice(o,i),start:o,end:i}}function O(e,t,n){return e.slice(0,t.start)+n+e.slice(t.end)}function Me(e,t){let n=D[t],r=[],s=[],i=[],o=j(e,"imports");if(o)for(let p of o.block.split(/\r?\n/)){let f=p.match(B);f?r.push(R(f[3])):p.trim()&&s.push(`imports: ${p.trim()}`)}else i.push("imports");let c=j(e,n.mapMarker);if(c){let p=c.block.split(/\r?\n/),f=p.findIndex(m=>m.trim().startsWith(n.header)),d=[...p].reverse().findIndex(m=>K.test(m.trim())),x=d===-1?-1:p.length-1-d;if(f===-1||x<=f)i.push(n.mapMarker);else for(let m of p.slice(f+1,x))!m.match(n.entryPattern)&&m.trim()&&s.push(`${n.mapMarker}: ${m.trim()}`)}else i.push(n.mapMarker);let a=new Map;if(o)for(let p of o.block.split(/\r?\n/)){let f=p.match(B);f&&a.set(f[2],R(f[3]))}let u=[];if(c){let p=c.block.split(/\r?\n/),f=p.findIndex(m=>m.trim().startsWith(n.header)),d=[...p].reverse().findIndex(m=>K.test(m.trim())),x=d===-1?-1:p.length-1-d;if(f!==-1&&x>f)for(let m of p.slice(f+1,x)){let h=m.match(n.entryPattern);if(h){let b=a.get(h[1]);b&&u.push(b)}}}return{moduleIds:[...new Set([...r,...u])],nonStandardLines:s,broken:i}}function Se(e,t,n,r=!1){let s=D[t],i=[],o=n.filter(s.contributes),c=new Map(o.map(l=>[I(t,l.id),l])),a=e,u=!1,p=j(a,"imports");if(!p)return i.push(`[${t}] imports 锚区缺失/破坏,跳过`),{content:a,changed:u,warnings:i,moduleIds:[]};let f=p.block.split(/\r?\n/),d=[];for(let l of f){let g=l.match(B);if(!g){if(l.trim()==="")continue;r||i.push(`[${t}] imports 锚区非标行保留: ${l.trim()}`),r||d.push(l);continue}let k=g[2],It=g[3],A=c.get(k);A&&R(A.pkg)===R(It)?d.push(l):(A&&d.push(at(t,k,A.pkg)),u=!0)}for(let l of o){let g=I(t,l.id);d.some(k=>k.includes(`as ${g} } from`))||(d.push(at(t,g,l.pkg)),u=!0)}let x=z(d.join(`
|
|
3
3
|
`));x!==p.block&&(a=O(a,p,x),u=!0);let m=j(a,s.mapMarker);if(!m)return i.push(`[${t}] ${s.mapMarker} 锚区缺失/破坏,跳过`),{content:a,changed:u,warnings:i,moduleIds:[]};let h=m.block.split(/\r?\n/),b=h.findIndex(l=>l.trim().startsWith(s.header)),$=[...h].reverse().findIndex(l=>K.test(l.trim())),v=$===-1?-1:h.length-1-$;if(b===-1||v<=b){if(r){let l=z([s.header,...o.map(g=>W(t,I(t,g.id))),s.footer].join(`
|
|
4
4
|
`));return l!==m.block&&(a=O(a,m,l),u=!0),{content:a,changed:u,warnings:i,moduleIds:o.map(g=>g.id)}}return i.push(`[${t}] ${s.mapMarker} 锚区结构不符合预期,降级为告警不覆盖`),{content:a,changed:u,warnings:i,moduleIds:[]}}let E=h.slice(0,b),St=h.slice(v+1),Ft=h.slice(b+1,v),M=[];for(let l of Ft){let g=l.match(s.entryPattern);if(!g){if(l.trim()==="")continue;r||i.push(`[${t}] ${s.mapMarker} 锚区非标行保留: ${l.trim()}`),r||M.push(l);continue}let k=g[1];c.has(k)?M.push(W(t,k)):u=!0}for(let l of o){let g=I(t,l.id);M.some(k=>k.includes(g))||(M.push(W(t,g)),u=!0)}let At=h[v],Q=z([...E,s.header,...M,At,...St].join(`
|
|
5
5
|
`));return Q!==m.block&&(a=O(a,m,Q),u=!0),{content:a,changed:u,warnings:i,moduleIds:o.map(l=>l.id)}}function z(e){let t=e.split(/\r?\n/);for(;t.length>0&&t[0].trim()==="";)t.shift();for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();return`
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{C as m,L as a,M as f,N as c,O as x,e,h as o,m as r,n as t,p,t as s}from"./chunk-
|
|
2
|
+
import{C as m,L as a,M as f,N as c,O as x,e,h as o,m as r,n as t,p,t as s}from"./chunk-XVKL45DC.js";import{b as d,d as l}from"./chunk-KOSAMSUA.js";import"./chunk-IBFYJ3GA.js";export{p as THEME_ID_RE,a as TarballSource,m as assertValidModuleId,c as cliScaffoldAsset,f as detectContext,r as embeddedPackageDepIssues,x as expandScaffoldAsset,t as findInRepoModuleDir,s as locateThemeWiring,d as parseModuleDescriptor,o as resolveWorkspaceCatalog,e as syncAssemblyFile,l as writeAtomic};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-QB7CUR3M.js";import"./chunk-KOSAMSUA.js";import"./chunk-IBFYJ3GA.js";export{c as collectDeclared,b as listLocalModules,a as readComponentFile};
|