@flisk-sh/flisk 1.3.199 → 1.3.201
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/cli/dist/cli.js +39 -16
- package/cli/dist/commands/open.js +16 -3
- package/cli/dist/utils/one-command.js +34 -0
- package/cli/dist/utils/project-templates.js +14 -0
- package/cli/dist/utils/stack-progress.js +66 -0
- package/cli/dist/utils/up-readiness.js +9 -2
- package/cli/dist-bundle/chunk-5ZSZ4WCI.js +2 -0
- package/cli/dist-bundle/chunk-GCFNSFW7.js +52 -0
- package/cli/dist-bundle/chunk-GNNN2WCF.js +4 -0
- package/cli/dist-bundle/{chunk-3SPYAO2E.js → chunk-KXKBWLTE.js} +1 -1
- package/cli/dist-bundle/{chunk-GW7N23FV.js → chunk-LYOSHFYU.js} +1 -1
- package/cli/dist-bundle/chunk-M6S25PIS.js +366 -0
- package/cli/dist-bundle/chunk-NC6KOYDN.js +2 -0
- package/cli/dist-bundle/chunk-R67UHACQ.js +24 -0
- package/cli/dist-bundle/chunk-S5EXKK7H.js +34 -0
- package/cli/dist-bundle/cli.js +203 -203
- package/cli/dist-bundle/cold-preflight-6Z4RBFKV.js +2 -0
- package/cli/dist-bundle/one-command-YP6L6MMM.js +5 -0
- package/cli/dist-bundle/open-SMKISRHH.js +2 -0
- package/cli/dist-bundle/project-WEC2GSR7.js +2 -0
- package/cli/dist-bundle/stack-progress-UVREHNNB.js +2 -0
- package/cli/dist-bundle/tilt-port-owner-67UVQJTX.js +2 -0
- package/cli/package.json +1 -1
- package/package.json +1 -1
- package/cli/dist-bundle/chunk-6357RMGA.js +0 -4
- package/cli/dist-bundle/chunk-7IWOM6M2.js +0 -5
- package/cli/dist-bundle/chunk-HSNRMF4B.js +0 -435
- package/cli/dist-bundle/chunk-KGKKDD4K.js +0 -2
- package/cli/dist-bundle/chunk-WMK2PS63.js +0 -34
- package/cli/dist-bundle/cold-preflight-WR2M53Z6.js +0 -2
- package/cli/dist-bundle/one-command-7OW747ML.js +0 -4
- package/cli/dist-bundle/open-635MSZHV.js +0 -2
- package/cli/dist-bundle/project-R7P6QBF4.js +0 -2
- package/cli/dist-bundle/project-templates-BHURA3LT.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
var t={demo:{repo:"https://github.com/flisk-sh/tdk-restaurant-example.git",description:"The demo stack: restaurant ops with reservations, kitchen and floor control"},restaurant:{repo:"https://github.com/flisk-sh/tdk-restaurant-example.git",description:"Restaurant ops: reservations, kitchen, floor control (Hono + Vite + Bun)"},saas:{repo:"https://github.com/flisk-sh/tdk-saas-starter.git",description:"SaaS starter: account dashboard and a working checkout button (Hono + Vite + Bun)"},erp:{repo:"https://github.com/flisk-sh/tdk-erp-system.git",description:"Enterprise ERP: 100 microservices across 7 business domains"},"user-management":{repo:"https://github.com/flisk-sh/tdk-user-management.git",description:"User/auth management services"},ecommerce:{repo:"https://github.com/flisk-sh/tdk-ecommerce-example.git",description:"Vue 3 storefront and Hono catalog API (needs Flisk 1.3.75+ for --framework vue)"},example:{repo:"https://github.com/flisk-sh/tdk-example.git",bundledPath:"examples/tdk-example",description:"Hono + Postgres + NATS worker + Vite example with a routed write path"},"agent-stack":{repo:"https://github.com/flisk-sh/tdk-agent-stack.git",description:"AI agent stack: Bun agent + MCP tool server + Postgres + NATS"}};export{t as a};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{a as O}from"./chunk-KGKKDD4K.js";import{b as N,c as pe,d as q,i as D,j as Y,n as J,o as I,q as C}from"./chunk-3SPYAO2E.js";import{H as z,J as G,L as E,Na as re,Ra as ae,Sa as se,Ua as ie,V as T,W as B,Wa as ce,Xa as le,Ya as de,aa as f,ba as y,ca as t,d as x,ja as ne,k as U,ka as W,la as V,m as P,s as F}from"./chunk-GW7N23FV.js";import{b as p}from"./chunk-CF46CD6R.js";import{execFileSync as ye}from"node:child_process";import{cpSync as be,existsSync as b,readdirSync as Se,readFileSync as K,writeFileSync as je}from"node:fs";import{basename as _e,dirname as we,join as j,resolve as M}from"node:path";import{cwd as ue}from"node:process";import{fileURLToPath as xe}from"node:url";import{Command as Pe}from"commander";var he="-y, --yes",ke="Skip prompts and confirmations; use defaults";function fe(e,o=ke){return e.option(he,o,!1)}async function ve(e,o=!0){let c=await I({message:e,initial:o});return c||T(),c}function Ne(e,o=1){e.valid||E(e.error??"Validation failed",o)}function De(e,o,c,a){return e.dryRun?(a?a():(console.log(`Dry run - ${o}`),console.log(`Would run: ${c}`)),!0):!1}async function Je(e,o){return await ve(e,!0)?!0:(o&&o(),!1)}var L=new Map;function me(e){e!==void 0?L.delete(e):L.clear()}function Ue(e=!1){let o=F(),c=o??"";if(!e){let r=L.get(c);if(r)return r}let{resources:a,problems:l}=o?ae(o):{resources:ie(),problems:[]},d=de(a),n=le(a);se(l);let g=a.filter(r=>!r.stack),m=new Map;for(let r of a)if(r.stack){let _=m.get(r.stack)||[];_.push(r),m.set(r.stack,_)}let k={resources:a,problems:l,stacks:d,stackNames:n,unassignedResources:g,resourcesByStack:m};return L.set(c,k),k}var A={proxy:{name:"proxy",description:"Traefik reverse proxy and API gateway for routing all services",category:"core",phase:"pre_alpha",enabled_by_default:!0,dependsOn:[]},verdaccio:{name:"verdaccio",description:"Verdaccio npm registry for package management and local publishing (Premium - requires TDK_LICENSE_KEY)",category:"premium",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[]},[x]:{name:x,description:"PostgreSQL database for data persistence and SQL operations",category:"core",phase:"pre_alpha",enabled_by_default:!0,dependsOn:[]},monitoring:{name:"monitoring",description:"SigNoz or SkyWalking observability platform for monitoring and tracing",category:"optional",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[x]},elk:{name:"elk",description:"Elasticsearch, Logstash, Kibana stack for log aggregation and analysis",category:"optional",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[]},debezium:{name:"debezium",description:"Change Data Capture for real-time data streaming from databases",category:"optional",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[x]},"golden-image":{name:"golden-image",description:"Pre-built Docker image layer for faster builds and smaller deployments",category:"optional",phase:"pre_alpha",enabled_by_default:!0,dependsOn:[]}};function H(e,o){try{return ce(e,o)}catch{return[]}}function Ee(e){return new Set([...e.phases.pre_alpha.enabledStacks,...e.phases.alpha.enabledStacks,...e.phases.beta.enabledStacks,...e.phases.out_of_scope.enabledStacks])}function Q(e,o){let c=Ee(e),a=o.filter(l=>!c.has(l));return a.length===0?(e.phases.pre_alpha.enabledStacks=Array.from(new Set(e.phases.pre_alpha.enabledStacks)),[]):(e.phases.pre_alpha.enabledStacks=Array.from(new Set([...e.phases.pre_alpha.enabledStacks,...a])),a)}function ft(e,o){let c=j(e,".tdk",U);if(!b(c))return[];let a=D(e),l=Q(a,H(e,o));return l.length>0&&N(c,a),l}function Ce(){return Object.values(A).filter(e=>e.enabled_by_default&&e.category==="core").map(e=>e.name)}function Oe(e,o){return o||(O[e]?.repo.split("/").pop()??e).replace(/\.git$/,"")}async function Ae(e,o,c){let a=O[e];if(!a){console.log(p.red(`
|
|
3
|
-
\u274C Unknown template: "${e}"`)),console.log(p.yellow(`
|
|
4
|
-
Available templates:`));for(let[n,g]of Object.entries(O))console.log(` ${p.cyan(n)} ${p.gray(`- ${g.description}`)}`);console.log(p.gray("\nOr run `flisk project` with no template for a blank project.")),process.exit(1)}let l=Oe(e,o);re(l)||z.invalidPath(l).exit();let d=M(ue(),l);b(d)&&Se(d).length>0&&z.directoryExists(d).exit(),B(`Cloning template: ${e}`),t(`${a.description}
|
|
5
|
-
`,0),t(`Source: ${a.bundledPath?"bundled Flisk example":a.repo}`,0),t(`Destination: ${d}
|
|
6
|
-
`,0);try{if(a.bundledPath){let n=M(we(xe(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");be(M(n,a.bundledPath),d,{recursive:!0});let g=_e(d).replace(/-/g,"_");for(let m of["services/platform/messaging/docker-compose.yml","services/shop/orders-api/service.json","services/shop/orders-api/src/index.ts","services/shop/orders-worker/service.json","services/shop/orders-worker/src/index.ts"]){let k=j(d,m),r=K(k,"utf-8");je(k,r.replaceAll("tdk_example",g))}}else ye("git",["clone",a.repo,d],{stdio:"inherit"})}catch{E(a.bundledPath?"Bundled example copy failed. Reinstall the Flisk CLI package and try again.":"git clone failed. Check you have git installed and network access.")}me(),console.log(p.green(`
|
|
7
|
-
\u2705 Cloned "${e}" into ${l}/`)),t(`
|
|
8
|
-
Next steps:`,0),t(`1. cd ${l}`),t("2. flisk doctor # check Docker/Tilt are ready"),t("3. flisk up # start the stack"),t(`
|
|
9
|
-
Runtime readiness:`,0);for(let n of c)t(n,0)}var R={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:Ce()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},mt=fe(new Pe("project")).description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(O).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--config-file <path>","Load project config from existing JSON file").action(async(e,o)=>{let{assertMachineReadyOrExit:c,detectRuntimePrerequisites:a,formatRuntimeNextSteps:l}=await import("./cold-preflight-WR2M53Z6.js");await c({scope:"scaffold"});let d=l(a());if(e){await G(async()=>Ae(e,o.path,d));return}await G(async()=>{let n=F();n||(n=ue(),y(`\u{1F680} Initializing new Flisk project...
|
|
10
|
-
`),t(`Location: ${n}
|
|
11
|
-
`,0));let g=j(n,".tdk"),m=j(g,U);if(o.check){let i=P.every(u=>b(j(n,".tdk",".tdk-out",u))),h=b(m);if(i&&h){let u=D(n);f("Project configuration is valid"),t(`Project: ${u.project.name}`,3),t(`Phases: ${Object.keys(u.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(p.yellow("\u26A0\uFE0F Project configuration incomplete:")),h||t(".tdk/project.json (not found)",3),!i)for(let u of P.filter(S=>!b(j(n,".tdk/.tdk-out",S))))t(`.tdk/.tdk-out/${u} (not found)`,3);t("Run `flisk project` to create them."),process.exit(1)}}B("Project Configuration"),t(`Project root: ${n}
|
|
12
|
-
`,0),b(g)||(pe(g),f("Created: .tdk/ directory"));let k=b(m);if(k&&!o.force){f(".tdk/project.json exists");let i=JSON.parse(K(m,"utf-8")),h=D(n),u=H(n),S=Q(h,u);if((S.length>0||!i.phases)&&N(m,h),S.length>0&&t(`Auto-enabled discovered service stacks: ${S.join(", ")}`,0),y(`
|
|
13
|
-
\u{1F4CB} Regenerating master configuration files...
|
|
14
|
-
`),await Y(n),V(n))f("Created: .env (the defaults work as-is)");else{let v=W(n);v.length>0&&f(`Updated: .env (added ${v.join(", ")}; existing values unchanged)`)}let $=q(n);$.length>0&&f(`Added to .gitignore: ${$.join(", ")}`),console.log(p.green(`
|
|
15
|
-
\u2705 Project configuration regenerated!`)),t(`
|
|
16
|
-
Generated in .tdk/.tdk-out/:`,0);for(let v of P)t(`- ${v}`);t(`
|
|
17
|
-
Runtime readiness:`,0);for(let v of d)t(v,0);return}if(k&&o.force&&!o.yes&&(console.log(p.red(`
|
|
18
|
-
\u26A0\uFE0F WARNING: --force will overwrite .tdk/project.json!`)),!await I({message:"This will reset your project configuration. Continue?",initial:!1}))){T();return}let r,_=H(n);if(o.configFile){let i=M(o.configFile);b(i)||E(`Config file not found: ${i}`);let h=K(i,"utf-8");r=JSON.parse(h),f(`Loaded config from: ${i}`)}else if(o.yes)r=JSON.parse(JSON.stringify(R)),r.project.name=n.split("/").pop()||"my-project",console.log(p.gray("Using default configuration (non-interactive mode)"));else{y(`\u{1F4DD} Project Setup Wizard
|
|
19
|
-
`);let i=await J({message:"Project name:",initial:n.split("/").pop()||"my-project",validate:s=>s.trim()!==""||"Project name is required"}),h=await J({message:"Project version:",initial:"1.0.0-alpha"}),u=Object.values(A).filter(s=>s.category==="core"&&s.phase==="pre_alpha"),S=new Set(u.map(s=>s.name)),te=await C({message:"Select Pre-Alpha enabled stacks (core infrastructure):",choices:[...u.map(s=>({title:s.description,value:s.name,selected:s.enabled_by_default})),..._.filter(s=>!S.has(s)).map(s=>({title:`${s} (discovered service stack)`,value:s,selected:!0}))]}),$=await C({message:"Select Alpha enabled stacks (core business):",choices:[{title:"api (Backend API)",value:"api"},{title:"app (Frontend app)",value:"app"}]}),v=await C({message:"Select Beta enabled stacks (extended features):",choices:[{title:"worker (Background jobs)",value:"worker"},{title:"migrator (Database migrations)",value:"migrator"}]}),w=await C({message:"Enable optional infrastructure (high resource):",choices:Object.values(A).filter(s=>s.category==="optional").concat(Object.values(A).filter(s=>s.category==="premium")).map(s=>({title:s.description,value:s.name,selected:s.enabled_by_default}))});y(`
|
|
20
|
-
\u{1F4C2} Service discovery`),t("What: folder patterns Flisk scans for a service.json in each match."),t("Where: type one or more globs, comma-separated."),t("How: saved as discovery.paths in .tdk/project.json - editable later."),t(`Example: ${R.discovery.paths.join(", ")}
|
|
21
|
-
`);let ge=await J({message:"Folders to scan:",initial:R.discovery.paths.join(", ")});r=JSON.parse(JSON.stringify(R)),r.project.name=i,r.project.version=h,r.phases.pre_alpha.enabledStacks=Array.from(new Set(te)),r.phases.alpha.enabledStacks=Array.from(new Set($)),r.phases.beta.enabledStacks=Array.from(new Set(v)),r.optional_infra.monitoring=w.includes("monitoring"),r.optional_infra.elk=w.includes("elk"),r.optional_infra.debezium=w.includes("debezium"),r.optional_infra.golden_image=w.includes("golden_image"),r.optional_infra.verdaccio=w.includes("verdaccio");let oe=ge.split(",").map(s=>s.trim()).filter(s=>s.length>0);r.discovery.paths=oe.length>0?oe:R.discovery.paths}let X=Q(r,_);if(X.length>0&&t(`Auto-enabled discovered service stacks: ${X.join(", ")}`,0),y(`
|
|
22
|
-
\u{1F4CB} Creating project configuration...
|
|
23
|
-
`),N(m,r),f("Created: .tdk/project.json"),t(`\u2192 Project: ${r.project.name}`),y(`
|
|
24
|
-
\u{1F4CB} Generating master configuration files...
|
|
25
|
-
`),await Y(n),y(`
|
|
26
|
-
\u{1F527} Setting up environment variables...
|
|
27
|
-
`),V(n))f("Created: .env (the defaults work as-is)");else{let i=W(n);i.length>0?f(`Updated: .env (added ${i.join(", ")}; existing values unchanged)`):f("Found: .env (environment already configured)")}let Z=ne(n);if(Z.missing.length>0){console.log(p.yellow(`
|
|
28
|
-
\u26A0\uFE0F Missing required environment variables:`));for(let i of Z.missing)t(`- ${i}`,1);t("\u2192 Edit .env and fill in these values before running `flisk up`",1)}let ee=q(n);ee.length>0&&f(`Added to .gitignore: ${ee.join(", ")}`),console.log(p.green(`
|
|
29
|
-
\u2705 Project configuration complete!`)),t(`
|
|
30
|
-
Generated files in .tdk/.tdk-out/:`,0);for(let i of P)t(`- ${i}`);t(`
|
|
31
|
-
Environment configuration:`,0),t("- .env (contains all required variables)"),t(`
|
|
32
|
-
Source file:`,0),t("- .tdk/project.json (edit this to change project structure)"),t(`
|
|
33
|
-
Next steps:`,0),t("1. flisk resource api --type backend --stack app # scaffold a service"),t("2. flisk up app # start it"),t(`
|
|
34
|
-
Runtime readiness:`,0);for(let i of d)t(i,0);t("\nAfter editing .tdk/project.json, run `flisk config regenerate`.",0)})});export{me as a,Ue as b,fe as c,Ne as d,De as e,Je as f,ft as g,Oe as h,Ae as i,mt as j};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{J as a,K as b,L as c,M as d,N as e,O as f,P as g,Q as h,R as i,S as j}from"./chunk-HSNRMF4B.js";import"./chunk-7IWOM6M2.js";import"./chunk-3SPYAO2E.js";import"./chunk-42IVF3YT.js";import"./chunk-GW7N23FV.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{c as MACHINE_CHECK_IDS,a as RUNTIME_CHECK_IDS,b as SCAFFOLD_CHECK_IDS,h as assertMachineReadyOrExit,i as detectRuntimePrerequisites,g as formatColdPreflight,j as formatRuntimeNextSteps,d as nodeTooOld,e as requireVerifiedDockerVersions,f as runColdPreflight};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import"./chunk-6EA4DGCY.js";import{spawn as l}from"node:child_process";import{readdirSync as d}from"node:fs";import{join as p}from"node:path";var m="Frontend URLs";function g(n){let r=n.split(`
|
|
3
|
-
`),t=r.findIndex(e=>e.includes(m));if(t!==-1)for(let e of r.slice(t+1)){let o=e.match(/^\s*-\s+\S+:\s+(https?:\/\/\S+)/);if(o)return o[1];if(e.trim()===""||e.includes("URLs:"))break}}function h(n){for(let r of n.split(`
|
|
4
|
-
`)){let t=r.trim();if(t.startsWith("{"))try{let e=JSON.parse(t),s=(e.data??{}).ok===!0;return{ok:s,error:s?void 0:e.errors?.[0]?.message??"the stack did not come up",raw:n}}catch{}}}function R(n,r,t=process.env,e=l){return new Promise(o=>{let s=e(process.execPath,[n,"up","--json"],{cwd:r,env:t,stdio:["inherit","pipe","pipe"]}),a="",i=!1,u=c=>{i||(i=!0,s.unref?.(),o(c))};s.stdout?.on("data",c=>{a+=String(c);let f=h(a);f&&u(f)}),s.stderr?.on("data",c=>{a+=String(c)}),s.on("error",c=>u({ok:!1,error:c.message,raw:a})),s.on("close",c=>u({ok:!1,error:`the stack stopped before it was ready (code ${c})`,raw:a}))})}function v(n,r){if(!r(n))return n;for(let t=2;t<1e3;t+=1){let e=`${n}-${t}`;if(!r(e))return e}return n}function k(n,r=4){let t=[],e=(o,s)=>{if(s>r)return;let a;try{a=d(o,{withFileTypes:!0}).map(i=>i.name)}catch{return}a.includes("package.json")&&t.push(o);for(let i of d(o,{withFileTypes:!0}))!i.isDirectory()||i.name==="node_modules"||i.name.startsWith(".")||e(p(o,i.name),s+1)};return e(n,0),t}async function D(n,r=w){let t=[];for(let e of k(n)){let o=await r("bun",["install"],e);t.push({dir:e,ok:o===0})}return t}function w(n,r,t){return new Promise(e=>{let o=l(n,r,{cwd:t,stdio:"ignore"});o.on("error",()=>e(1)),o.on("close",s=>e(s??1))})}export{g as findFrontendUrl,k as findServiceDirs,D as installServiceDependencies,v as nextAvailableProjectDir,h as parseStackEnvelope,R as runStackQuiet};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{e as a,f as b,g as c,h as d,i as e,j as f}from"./chunk-6357RMGA.js";import"./chunk-DTIHDMED.js";import"./chunk-7IWOM6M2.js";import"./chunk-GW7N23FV.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{d as findReadyFrontend,b as isFrontendReady,a as listFrontendTargets,f as openCommand,e as openFirstFrontend,c as pickReadyFrontend};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{g as a,h as b,i as c,j as d}from"./chunk-WMK2PS63.js";import"./chunk-KGKKDD4K.js";import"./chunk-3SPYAO2E.js";import"./chunk-42IVF3YT.js";import"./chunk-GW7N23FV.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{c as cloneProjectTemplate,a as enableDiscoveredStacks,d as projectCommand,b as templateTargetDir};
|