@farthershore/cli 0.21.0 → 0.21.1

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 (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1719,7 +1719,7 @@ import react from "@vitejs/plugin-react";
1719
1719
  export default defineConfig({
1720
1720
  plugins: [react()],
1721
1721
  });
1722
- `}function jv(t){let e=t.productName??"Farther Shore Business";return[{path:"frontend/package.json",content:gE(t)},{path:"frontend/index.html",content:hE(e)},{path:"frontend/src/App.tsx",content:bE()},{path:"frontend/src/styles.css",content:vE()},{path:"frontend/src/styles/components.css",content:zv},{path:"frontend/STYLING.md",content:yE()},{path:"frontend/tsconfig.json",content:_E()},{path:"frontend/vite.config.ts",content:kE()}]}var Ei="business/business.config.ts",OE="0.8.0",TE="0.14.0";function CE(t){if(!t)throw new y(`--template is required. Choose one of: ${ke.join(", ")}.`,void 0,{code:"INIT_TEMPLATE_REQUIRED"});let e=t.toLowerCase();if(!ke.includes(e))throw new y(`Unknown template "${t}". Choose one of: ${ke.join(", ")}.`,void 0,{code:"INIT_TEMPLATE_UNKNOWN"});return e}var AE='limits: { requests: { rate: 600, interval: "minute" } },';function RE(t){let e=t.pricing,r=t.kind==="free",o=[` name: "${PE(t)}",`];r?o.push(" price: { free: true },"):e.recurring_fee_cents>0&&o.push(` price: { amount: ${e.recurring_fee_cents}, currency: "usd", interval: "${e.billing_interval}" },`);let n=(e.meters??[]).filter(i=>typeof i.dimension=="string").map(i=>`${i.dimension}: { micros: ${i.price_per_unit_micros??0} }`);if(n.length>0&&o.push(` meter: { ${n.join(", ")} },`),(e.grants??[]).length>0){let i=(e.grants??[]).map(op).join(", ");o.push(` grants: [${i}],`)}return e.trial_days>0&&o.push(` trialDays: ${e.trial_days},`),o.push(` ${AE}`),o}function Bv(t,e){let r=Fd(e),n=r.includes("api"),i=["Business","Plan","Requests","Surface"];n&&i.push("Feature");let s=[];s.push("import {");for(let c of i)s.push(` ${c},`);s.push('} from "@farthershore/business";'),s.push(""),s.push("@Business({"),s.push(' name: "my-business",'),s.push(' displayName: "My Business",'),s.push("})"),s.push("export default class MyBusiness {");for(let c of r)s.push(` @Surface("${c}")`),s.push(` ${NE(c)}Surface!: unknown;`),s.push("");s.push(" @Requests()"),s.push(" requests!: unknown;"),s.push(""),n&&(s.push(' @Feature("api", {'),s.push(' routes: { "GET /v1/example": {} },'),s.push(" })"),s.push(" apiFeature!: unknown;"),s.push("")),s.push(` @Plan("${t.kind}", {`);for(let c of RE(t))s.push(c);return s.push(" })"),s.push(` ${t.kind}!: unknown;`),s.push("}"),s.push(""),s.join(`
1722
+ `}function jv(t){let e=t.productName??"Farther Shore Business";return[{path:"frontend/package.json",content:gE(t)},{path:"frontend/index.html",content:hE(e)},{path:"frontend/src/App.tsx",content:bE()},{path:"frontend/src/styles.css",content:vE()},{path:"frontend/src/styles/components.css",content:zv},{path:"frontend/STYLING.md",content:yE()},{path:"frontend/tsconfig.json",content:_E()},{path:"frontend/vite.config.ts",content:kE()}]}var Ei="business/business.config.ts",OE="0.8.0",TE="0.15.0";function CE(t){if(!t)throw new y(`--template is required. Choose one of: ${ke.join(", ")}.`,void 0,{code:"INIT_TEMPLATE_REQUIRED"});let e=t.toLowerCase();if(!ke.includes(e))throw new y(`Unknown template "${t}". Choose one of: ${ke.join(", ")}.`,void 0,{code:"INIT_TEMPLATE_UNKNOWN"});return e}var AE='limits: { requests: { rate: 600, interval: "minute" } },';function RE(t){let e=t.pricing,r=t.kind==="free",o=[` name: "${PE(t)}",`];r?o.push(" price: { free: true },"):e.recurring_fee_cents>0&&o.push(` price: { amount: ${e.recurring_fee_cents}, currency: "usd", interval: "${e.billing_interval}" },`);let n=(e.meters??[]).filter(i=>typeof i.dimension=="string").map(i=>`${i.dimension}: { micros: ${i.price_per_unit_micros??0} }`);if(n.length>0&&o.push(` meter: { ${n.join(", ")} },`),(e.grants??[]).length>0){let i=(e.grants??[]).map(op).join(", ");o.push(` grants: [${i}],`)}return e.trial_days>0&&o.push(` trialDays: ${e.trial_days},`),o.push(` ${AE}`),o}function Bv(t,e){let r=Fd(e),n=r.includes("api"),i=["Business","Plan","Requests","Surface"];n&&i.push("Feature");let s=[];s.push("import {");for(let c of i)s.push(` ${c},`);s.push('} from "@farthershore/business";'),s.push(""),s.push("@Business({"),s.push(' name: "my-business",'),s.push(' displayName: "My Business",'),s.push("})"),s.push("export default class MyBusiness {");for(let c of r)s.push(` @Surface("${c}")`),s.push(` ${NE(c)}Surface!: unknown;`),s.push("");s.push(" @Requests()"),s.push(" requests!: unknown;"),s.push(""),n&&(s.push(' @Feature("api", {'),s.push(' routes: { "GET /v1/example": {} },'),s.push(" })"),s.push(" apiFeature!: unknown;"),s.push("")),s.push(` @Plan("${t.kind}", {`);for(let c of RE(t))s.push(c);return s.push(" })"),s.push(` ${t.kind}!: unknown;`),s.push("}"),s.push(""),s.join(`
1723
1723
  `)}function PE(t){return t.label.split(" \u2014 ")[0]??t.label}function NE(t){return t.replace(/-/g,"_")}function op(t){return Array.isArray(t)?`[${t.map(op).join(", ")}]`:t&&typeof t=="object"?`{ ${Object.entries(t).map(([r,o])=>`${/^[A-Za-z_$][\w$]*$/.test(r)?r:JSON.stringify(r)}: ${op(o)}`).join(", ")} }`:JSON.stringify(t)}function DE(t,e=Ei,r){let o=rp(e),n=u=>o==="."?u:`${o}/${u}`,i=IE(o)==="business"?rp(o):o,s=u=>i==="."?u:wE(i,u),c=jv({frontendSdkRange:TE}).map(u=>({path:s(u.path),content:u.content}));return[{path:s(".gitignore"),content:jE()},{path:e,content:Bv(t,r)},{path:n("package.json"),content:UE()},{path:n("tsconfig.json"),content:zE()},...c]}function UE(){return`${JSON.stringify({private:!0,type:"module",scripts:{build:"farthershore-manifest-build --out business-build.json",validate:"farthershore-manifest-build --out business-build.json"},dependencies:{"@farthershore/business":OE},devDependencies:{typescript:"^6.0.2"}},null,2)}
1724
1724
  `}function zE(){return`${JSON.stringify({compilerOptions:{target:"ES2022",useDefineForClassFields:!0,module:"NodeNext",moduleResolution:"NodeNext",strict:!0,noEmit:!0,skipLibCheck:!0},include:["**/*.ts"]},null,2)}
1725
1725
  `}function jE(){return["# OS",".DS_Store","Thumbs.db","","# Dependencies and local output","business/node_modules/","business/business-build.json","business/manifest-diagnostics.json","frontend/node_modules/","frontend/dist/","business-build.json","manifest-diagnostics.json","","# Local env + tooling",".env",".env.local",".vscode/",".idea/",""].join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farthershore/cli",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "FartherShore CLI — bootstrap and operate software businesses",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,7 +43,7 @@
43
43
  "vitest": "^4.1.6",
44
44
  "zod": "^4.3.6",
45
45
  "@farthershore/contracts": "0.62.0",
46
- "@farthershore/farthershore-js": "0.14.0",
46
+ "@farthershore/farthershore-js": "0.15.0",
47
47
  "@farthershore/business": "0.8.0"
48
48
  },
49
49
  "scripts": {