@floegence/floe-webapp-init 0.81.2 → 0.81.5

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/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import n from"node:fs";import c from"node:path";import{fileURLToPath as d}from"node:url";import S from"prompts";import{red as a,bold as f,cyan as y,green as v}from"kolorist";const h=[{name:"minimal",value:"minimal",description:"Basic setup with FloeApp"},{name:"full",value:"full",description:"Full setup with sample pages"}],j={"_package.json":"package.json",_gitignore:".gitignore","_env.example":".env.example"};async function b(){console.log(`
2
+ import l from"node:fs";import r from"node:path";import{fileURLToPath as h}from"node:url";import S from"prompts";import{red as p,bold as f,cyan as y,green as v}from"kolorist";const w={"_package.json":"package.json",_gitignore:".gitignore","_env.example":".env.example"};function x(n,o,t){l.mkdirSync(o,{recursive:!0});for(const s of l.readdirSync(n,{withFileTypes:!0})){const a=s.name,i=r.join(n,a),c=w[a]||a,e=r.join(o,c);if(s.isDirectory())x(i,e);else{const m=l.openSync(i,l.constants.O_RDONLY|l.constants.O_NOFOLLOW);try{if(!l.fstatSync(m).isFile())throw new Error(`Template entry is not a regular file: ${i}`);const g=l.readFileSync(m);let u=g;if(t&&c==="package.json"){const d=JSON.parse(g.toString("utf-8"));d.name=t,u=JSON.stringify(d,null,2)+`
3
+ `}l.writeFileSync(e,u,{flag:"wx"})}finally{l.closeSync(m)}}}}const j=[{name:"minimal",value:"minimal",description:"Basic setup with FloeApp"},{name:"full",value:"full",description:"Full setup with sample pages"}];async function b(){console.log(`
3
4
  ${f(y("Floe Webapp"))}
4
- `);const l=process.argv.slice(2);let o=l[0],t;(l.includes("--help")||l.includes("-h"))&&(console.log(`Usage: npx @floegence/floe-webapp-init [project-name] [options]
5
+ `);const n=process.argv.slice(2);let o=n[0],t;(n.includes("--help")||n.includes("-h"))&&(console.log(`Usage: npx @floegence/floe-webapp-init [project-name] [options]
5
6
 
6
7
  Options:
7
8
  --template <name> Use a specific template (minimal, full)
@@ -11,14 +12,13 @@ Examples:
11
12
  npx @floegence/floe-webapp-init
12
13
  npx @floegence/floe-webapp-init my-app
13
14
  npx @floegence/floe-webapp-init my-app --template full
14
- `),process.exit(0));const i=l.indexOf("--template");if(i!==-1&&l[i+1]){const e=l[i+1];e==="minimal"||e==="full"?t=e:(console.log(a(`Invalid template: ${e}`)),console.log("Available templates: minimal, full"),process.exit(1)),o==="--template"&&(o=l[i+2])}const p=await S([{type:o?null:"text",name:"projectName",message:"Project name:",initial:"floe-app",validate:e=>e?/^[a-z0-9-_]+$/i.test(e)?!0:"Project name can only contain letters, numbers, hyphens, and underscores":"Project name is required"},{type:t?null:"select",name:"template",message:"Select a template:",choices:h.map(e=>({title:e.name,value:e.value,description:e.description}))}],{onCancel:()=>{console.log(a(`
15
- Operation cancelled`)),process.exit(1)}});o=o||p.projectName,t=t||p.template,(!o||!t)&&(console.log(a("Missing required information")),process.exit(1));const s=c.resolve(o);n.existsSync(s)&&n.readdirSync(s).length>0&&(console.log(a(`
15
+ `),process.exit(0));const s=n.indexOf("--template");if(s!==-1&&n[s+1]){const e=n[s+1];e==="minimal"||e==="full"?t=e:(console.log(p(`Invalid template: ${e}`)),console.log("Available templates: minimal, full"),process.exit(1)),o==="--template"&&(o=n[s+2])}const a=await S([{type:o?null:"text",name:"projectName",message:"Project name:",initial:"floe-app",validate:e=>e?/^[a-z0-9-_]+$/i.test(e)?!0:"Project name can only contain letters, numbers, hyphens, and underscores":"Project name is required"},{type:t?null:"select",name:"template",message:"Select a template:",choices:j.map(e=>({title:e.name,value:e.value,description:e.description}))}],{onCancel:()=>{console.log(p(`
16
+ Operation cancelled`)),process.exit(1)}});o=o||a.projectName,t=t||a.template,(!o||!t)&&(console.log(p("Missing required information")),process.exit(1));const i=r.resolve(o);l.existsSync(i)&&l.readdirSync(i).length>0&&(console.log(p(`
16
17
  Directory ${o} is not empty.`)),process.exit(1)),console.log(`
17
- Scaffolding project in ${y(s)}...
18
- `);const r=c.resolve(d(import.meta.url),"../../templates",t),m=c.resolve(d(import.meta.url),"../../skills");n.existsSync(r)||(console.log(a(`Template directory not found: ${r}`)),process.exit(1)),u(r,s);const x=c.join(s,"skills");n.existsSync(m)?u(m,x):console.log(a(`Warning: skill directory not found: ${m}`));const g=c.join(s,"package.json");if(n.existsSync(g)){const e=JSON.parse(n.readFileSync(g,"utf-8"));e.name=c.basename(o),n.writeFileSync(g,JSON.stringify(e,null,2)+`
19
- `)}console.log(v(`Done!
18
+ Scaffolding project in ${y(i)}...
19
+ `);const c=r.resolve(h(import.meta.url),"../../templates",t);l.existsSync(c)||(console.log(p(`Template directory not found: ${c}`)),process.exit(1)),x(c,i,r.basename(o)),console.log(v(`Done!
20
20
  `)),console.log(`Next steps:
21
21
  `),console.log(` cd ${f(o)}`),console.log(" pnpm install"),console.log(` pnpm dev
22
22
  `),console.log(`Skill package:
23
23
  `),console.log(` ${f("skills/floe-webapp/SKILL.md")}
24
- `)}function u(l,o){n.mkdirSync(o,{recursive:!0});for(const t of n.readdirSync(l)){const i=c.join(l,t),p=j[t]||t,s=c.join(o,p);n.statSync(i).isDirectory()?u(i,s):n.copyFileSync(i,s)}}b().catch(l=>{console.error(a("Error:"),l),process.exit(1)});
24
+ `)}b().catch(n=>{console.error(p("Error:"),n),process.exit(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-init",
3
- "version": "0.81.2",
3
+ "version": "0.81.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Scaffolding tool for Floe Webapp applications",
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@floegence/floe-webapp-core": "^0.49.0",
12
+ "@floegence/floe-webapp-core": "^0.81.5",
13
13
  "solid-js": "^1.9.3"
14
14
  },
15
15
  "devDependencies": {
@@ -18,5 +18,13 @@
18
18
  "typescript": "^5.7.2",
19
19
  "vite": "^6.0.7",
20
20
  "vite-plugin-solid": "^2.11.0"
21
+ },
22
+ "overrides": {
23
+ "dompurify": "^3.4.16"
24
+ },
25
+ "pnpm": {
26
+ "overrides": {
27
+ "dompurify": "^3.4.16"
28
+ }
21
29
  }
22
30
  }
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@floegence/floe-webapp-core": "^0.49.0",
12
+ "@floegence/floe-webapp-core": "^0.81.5",
13
13
  "solid-js": "^1.9.3"
14
14
  },
15
15
  "devDependencies": {
@@ -18,5 +18,13 @@
18
18
  "typescript": "^5.7.2",
19
19
  "vite": "^6.0.7",
20
20
  "vite-plugin-solid": "^2.11.0"
21
+ },
22
+ "overrides": {
23
+ "dompurify": "^3.4.16"
24
+ },
25
+ "pnpm": {
26
+ "overrides": {
27
+ "dompurify": "^3.4.16"
28
+ }
21
29
  }
22
30
  }