create-pylon 1.1.4-canary-20250326081519.38fd28392f698fadf4e134fd200bae2c496732a5 → 1.1.4-canary-20250327152421.e2dbba1e69d0539f8af5595b5598359c09c97ea9
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.js +24 -24
- package/dist/index.js.map +4 -4
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import i from"chalk";import{Option as
|
|
2
|
+
import i from"chalk";import{Option as h,program as D}from"commander";import c from"consola";import*as y from"fs";import N from"path";import w from"fs/promises";import _ from"path";var u="^2.0.0",g="^1.0.0",b={ALL:[{path:".gitignore",content:`# Logs
|
|
3
3
|
|
|
4
4
|
logs
|
|
5
5
|
_.log
|
|
@@ -242,10 +242,10 @@ jobs:
|
|
|
242
242
|
"build": "pylon build"
|
|
243
243
|
},
|
|
244
244
|
"dependencies": {
|
|
245
|
-
"@getcronit/pylon": "${
|
|
245
|
+
"@getcronit/pylon": "${u}",
|
|
246
246
|
},
|
|
247
247
|
"devDependencies": {
|
|
248
|
-
"@getcronit/pylon-dev": "${
|
|
248
|
+
"@getcronit/pylon-dev": "${g}",
|
|
249
249
|
"@types/bun": "^1.0.0"
|
|
250
250
|
},
|
|
251
251
|
"repository": {
|
|
@@ -313,11 +313,11 @@ ENTRYPOINT [ "bun", "run", "/usr/src/pylon/.pylon/index.js" ]
|
|
|
313
313
|
"build": "pylon build"
|
|
314
314
|
},
|
|
315
315
|
"dependencies": {
|
|
316
|
-
"@getcronit/pylon": "${
|
|
316
|
+
"@getcronit/pylon": "${u}",
|
|
317
317
|
"@hono/node-server": "^1.12.2"
|
|
318
318
|
},
|
|
319
319
|
"devDependencies": {
|
|
320
|
-
"@getcronit/pylon-dev": "${
|
|
320
|
+
"@getcronit/pylon-dev": "${g}"
|
|
321
321
|
},
|
|
322
322
|
"repository": {
|
|
323
323
|
"type": "git",
|
|
@@ -382,10 +382,10 @@ ENTRYPOINT [ "node", "/usr/src/pylon/.pylon/index.js" ]
|
|
|
382
382
|
"cf-typegen": "wrangler types"
|
|
383
383
|
},
|
|
384
384
|
"dependencies": {
|
|
385
|
-
"@getcronit/pylon": "${
|
|
385
|
+
"@getcronit/pylon": "${u}",
|
|
386
386
|
},
|
|
387
387
|
"devDependencies": {
|
|
388
|
-
"@getcronit/pylon-dev": "${
|
|
388
|
+
"@getcronit/pylon-dev": "${g}",
|
|
389
389
|
"@cloudflare/vitest-pool-workers": "^0.4.5",
|
|
390
390
|
"@cloudflare/workers-types": "^4.20240903.0",
|
|
391
391
|
"typescript": "^5.5.2",
|
|
@@ -516,8 +516,8 @@ compatibility_flags = ["nodejs_compat_v2"]
|
|
|
516
516
|
]
|
|
517
517
|
}`},{path:"deno.json",content:`{
|
|
518
518
|
"imports": {
|
|
519
|
-
"@getcronit/pylon-dev": "npm:@getcronit/pylon-dev@${
|
|
520
|
-
"@getcronit/pylon": "npm:@getcronit/pylon@${
|
|
519
|
+
"@getcronit/pylon-dev": "npm:@getcronit/pylon-dev@${g}",
|
|
520
|
+
"@getcronit/pylon": "npm:@getcronit/pylon@${u}"
|
|
521
521
|
},
|
|
522
522
|
"tasks": {
|
|
523
523
|
"dev": "pylon dev -c \\"deno run -A .pylon/index.js --config tsconfig.json\\"",
|
|
@@ -530,26 +530,26 @@ compatibility_flags = ["nodejs_compat_v2"]
|
|
|
530
530
|
"nodeModulesDir": "auto",
|
|
531
531
|
"packageManager": "deno"
|
|
532
532
|
}
|
|
533
|
-
`}]};var
|
|
533
|
+
`}]};var m=[{key:"bun",name:"Bun.js",website:"https://bunjs.dev",supportedFeatures:["auth","pages"]},{key:"node",name:"Node.js",website:"https://nodejs.org",supportedFeatures:["auth","pages"]},{key:"cf-workers",name:"Cloudflare Workers",website:"https://workers.cloudflare.com",supportedFeatures:["auth"]},{key:"deno",name:"Deno",website:"https://deno.land"}],v=[{key:"auth",name:"Authentication",website:"https://pylon.cronit.io/docs/authentication"},{key:"pages",name:"Pages",website:"https://pylon.cronit.io/docs/pages"}],A=(e,r)=>{let o=["app","PylonConfig"],t=[];r.includes("auth")&&(o.push("useAuth"),t.push("useAuth({issuer: 'https://test-0o6zvq.zitadel.cloud'})")),r.includes("pages")&&(o.push("usePages"),t.push("usePages()"));let n="";return n+=`import {${o.join(", ")}} from '@getcronit/pylon'
|
|
534
534
|
|
|
535
|
-
`,e==="node"&&(
|
|
536
|
-
`),
|
|
535
|
+
`,e==="node"&&(n+=`import {serve} from '@hono/node-server'
|
|
536
|
+
`),n+=`
|
|
537
537
|
|
|
538
|
-
`,
|
|
538
|
+
`,n+=`export const graphql = {
|
|
539
539
|
Query: {
|
|
540
540
|
hello: () => {
|
|
541
541
|
return 'Hello, world!'
|
|
542
542
|
}
|
|
543
543
|
},
|
|
544
544
|
Mutation: {}
|
|
545
|
-
}`,
|
|
545
|
+
}`,n+=`
|
|
546
546
|
|
|
547
|
-
`,e==="bun"||e==="cf-workers"?
|
|
548
|
-
`),
|
|
547
|
+
`,e==="bun"||e==="cf-workers"?n+="export default app":e==="node"?n+="serve(app, info => {\n console.log(`Server running at ${info.port}`)\n})":e==="deno"&&(n+=`Deno.serve({port: 3000}, app.fetch)
|
|
548
|
+
`),n+=`
|
|
549
549
|
|
|
550
|
-
`,
|
|
551
|
-
plugins: [${
|
|
552
|
-
}`,
|
|
550
|
+
`,n+=`export const config: PylonConfig = {
|
|
551
|
+
plugins: [${t.join(", ")}]
|
|
552
|
+
}`,n},M=async(e,r)=>{let o=`import '@getcronit/pylon'
|
|
553
553
|
|
|
554
554
|
declare module '@getcronit/pylon' {
|
|
555
555
|
interface Bindings {}
|
|
@@ -562,7 +562,7 @@ declare module '@getcronit/pylon' {
|
|
|
562
562
|
|
|
563
563
|
declare module '@getcronit/pylon/pages' {
|
|
564
564
|
interface PageData extends ReturnType<typeof useQuery> {}
|
|
565
|
-
}`),o},
|
|
565
|
+
}`),o},I=async(e,r)=>{let o={extends:"@getcronit/pylon/tsconfig.pylon.json",include:["pylon.d.ts","src/**/*.ts"]};return e==="cf-workers"&&o.include.push("worker-configuration.d.ts"),r.includes("pages")&&(o.compilerOptions={baseUrl:".",paths:{"@/*":["./*"]},jsx:"react-jsx"},o.include.push("pages","components",".pylon")),JSON.stringify(o,null,2)},S=async e=>{let r=[{path:"pages/layout.tsx",content:`import '../globals.css'
|
|
566
566
|
|
|
567
567
|
export default function RootLayout({children}: {children: React.ReactNode}) {
|
|
568
568
|
return (
|
|
@@ -864,18 +864,18 @@ function Button({
|
|
|
864
864
|
}
|
|
865
865
|
|
|
866
866
|
export {Button, buttonVariants}
|
|
867
|
-
`}];e.push(...r);let o=e.find(
|
|
867
|
+
`}];e.push(...r);let o=e.find(t=>t.path==="package.json");if(o){let t=JSON.parse(o.content);t.dependencies={...t.dependencies,"@gqty/react":"^3.1.0",gqty:"^3.4.0","@radix-ui/react-slot":"^1.1.2","class-variance-authority":"^0.7.1",clsx:"^2.1.1","lucide-react":"^0.474.0",react:"^19.0.0","react-dom":"^19.0.0","tailwind-merge":"^3.0.1",tailwindcss:"^4.0.4","tailwindcss-animate":"^1.0.7"},t.devDependencies={...t.devDependencies,"@tailwindcss/postcss":"^4.0.6","@types/react":"^19.0.8"},o.content=JSON.stringify(t,null,2)}return e},$=(e,r)=>{let o=e;return Object.entries(r).forEach(([t,n])=>{o=o.replaceAll(t,n)}),o},j=async e=>{let{destination:r,runtime:o,features:t}=e,n=b.ALL.concat(b[o]||[]).filter(l=>l.specificRuntimes?l.specificRuntimes.includes(o):!0),k=A(o,t),d=await I(o,t),p=await M(o,t);n.push({path:"tsconfig.json",content:d},{path:"pylon.d.ts",content:p},{path:"src/index.ts",content:k}),t.includes("pages")&&(n=await S(n));for(let l of n){let a=_.join(r,l.path);await w.mkdir(_.dirname(a),{recursive:!0}),await w.writeFile(a,$(l.content,e.variables))}};import B from"node:process";import{detect as L}from"package-manager-detector/detect";import U from"consola";async function f(e=B.cwd()){return(await L({cwd:e,onUnknown(o){U.warn("Unknown packageManager:",o)}}))?.agent||null}function E(e){if(e===null)return null;let[r]=e.split("@");switch(r){case"bun":return"bun";case"npm":return"npm run";case"yarn":return"yarn";case"pnpm":return"pnpm run";case"deno":return"deno task";default:return null}}import{existsSync as Y}from"node:fs";import{resolve as V}from"node:path";import F from"node:process";import{x as T}from"tinyexec";async function P(e,r={}){let o=r.packageManager||await f(r.cwd)||"npm",[t]=o.split("@");Array.isArray(e)||(e=[e]);let n=(typeof r.additionalArgs=="function"?r.additionalArgs(t,o):r.additionalArgs)||[];return r.preferOffline&&(o==="yarn@berry"?n.unshift("--cached"):n.unshift("--prefer-offline")),t==="pnpm"&&Y(V(r.cwd??F.cwd(),"pnpm-workspace.yaml"))&&n.unshift("-w","--prod=false"),T(t,[t==="yarn"?"add":"install",r.dev?"-D":"",...n,...e].filter(Boolean),{nodeOptions:{stdio:r.silent?"ignore":"inherit",cwd:r.cwd},throwOnError:!0})}import{PostHog as G}from"posthog-node";import z from"conf";import{readFileSync as q}from"fs";import{randomUUID as O}from"crypto";var J={distinctId:{type:"string",default:O()}},W=new z({projectName:"pylon",schema:J}),R=W.get("distinctId"),xe=O(),x=new G("phc_KN4qCOcCdkXp6sHLIuMWGRfzZWuNht69oqv5Kw5rGxj",{host:"https://eu.i.posthog.com",disabled:process.env.PYLON_DISABLE_TELEMETRY==="true"}),H=()=>{let e;try{e=JSON.parse(q("./package.json","utf8"))}catch{e={}}let r=e.dependencies||{},o=e.devDependencies||{},t=e.peerDependencies||{};return{dependencies:r,devDependencies:o,peerDependencies:t}},ke=H();var C="1.1.4-canary-20250327152421.e2dbba1e69d0539f8af5595b5598359c09c97ea9";D.name("create-pylon").version(C).arguments("[target]").addOption(new h("-i, --install","Install dependencies")).addOption(new h("-r, --runtime <runtime>","Runtime").choices(m.map(({key:e})=>e))).addOption(new h("--features [features...]","Features").choices(v.map(({key:e})=>e))).addOption(new h("-pm, --package-manager <packageManager>","Package manager")).action(Q);async function Q(e,r,o){c.log(`${o.name()} version ${o.version()}`);try{e||(e=await c.prompt("Where should the project be created?",{default:"./my-pylon",placeholder:"./my-pylon",cancel:"reject"}));let t="";if(e==="."?t=N.basename(process.cwd()):t=N.basename(e),!r.runtime){let a=await c.prompt("Select a runtime environment:",{type:"select",options:m.map(s=>({label:s.name,value:s.key,hint:s.website})),cancel:"reject"});r.runtime=a}let n=m.find(a=>a.key===r.runtime);if(!n)throw new Error(`Invalid runtime selected: ${r.runtime}`);if(!r.features){let a=await c.prompt("Configure features:",{type:"multiselect",options:v.filter(s=>n.supportedFeatures?.includes(s.key)).map(s=>({label:s.name,value:s.key,hint:s.website})),required:!1,cancel:"reject"});r.features=a}for(let a of r.features)if(!n.supportedFeatures?.includes(a))throw new Error(`Invalid feature selected: ${a}`);if(!await c.prompt(`Ready to create the project in ${i.blue(e)}?`,{type:"confirm",initial:!0,cancel:"reject"})){let a=new Error("Prompt cancelled.");throw a.name="ConsolaPromptCancelledError",a}if(y.existsSync(e)&&y.readdirSync(e).length>0&&!await c.prompt("Directory not empty. Continue?",{type:"confirm",cancel:"reject"})){let s=new Error("Prompt cancelled.");throw s.name="ConsolaPromptCancelledError",s}await j({variables:{__PYLON_NAME__:t},runtime:n.key,features:r.features,destination:e});let d=r.packageManager||await f(e)||"npm";r.install===void 0&&(r.install=await c.prompt(`Installed dependencies with ${d} now? You can also do this later.`,{type:"confirm",initial:!0,cancel:"reject"})),r.install&&await P([]),x.capture({distinctId:R,event:"create-pylon",properties:{runtime:n.key,features:r.features,packageManager:d,install:r.install}});let p=E(d),l=`
|
|
868
868
|
\u{1F389} ${i.green.bold("Pylon created successfully.")}
|
|
869
869
|
|
|
870
870
|
\u{1F4BB} ${i.cyan.bold("Continue Developing")}
|
|
871
871
|
${i.yellow("Change directories:")} cd ${i.blue(e)}
|
|
872
|
-
${i.yellow("Start dev server:")} ${
|
|
873
|
-
${
|
|
872
|
+
${i.yellow("Start dev server:")} ${p} dev
|
|
873
|
+
${n.key==="cf-workers"?`${i.yellow("Deploy:")} ${p} deploy`:""}
|
|
874
874
|
|
|
875
875
|
\u{1F4D6} ${i.cyan.bold("Explore Documentation")}
|
|
876
876
|
${i.underline.blue("https://pylon.cronit.io/docs")}
|
|
877
877
|
|
|
878
878
|
\u{1F4AC} ${i.cyan.bold("Join our Community")}
|
|
879
879
|
${i.underline.blue("https://discord.gg/cbJjkVrnHe")}
|
|
880
|
-
`;c.box(l)}catch(
|
|
880
|
+
`;c.box(l)}catch(t){c.error(t)}finally{await x.shutdown()}}D.parse();
|
|
881
881
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/create-directory/index.ts", "../src/create-directory/files.ts", "../src/install-pkg/detect.ts", "../src/install-pkg/install.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n\nimport chalk from 'chalk'\nimport {Option, program, type Command} from 'commander'\nimport consola from 'consola'\nimport * as fs from 'fs'\nimport path from 'path'\n\nimport {dirname} from 'path'\nimport {fileURLToPath} from 'url'\n\nimport {createDirectory, features, runtimes} from './create-directory'\nimport {\n detectPackageManager,\n getRunScript,\n installPackage,\n PackageManager\n} from './install-pkg'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\nconst version = (() => {\n return JSON.parse(\n fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8')\n ).version as string\n})()\n\nprogram\n .name('create-pylon')\n .version(version)\n .arguments('[target]')\n .addOption(new Option('-i, --install', 'Install dependencies'))\n .addOption(\n new Option('-r, --runtime <runtime>', 'Runtime').choices(\n runtimes.map(({key}) => key)\n )\n )\n .addOption(\n new Option('--features [features...]', 'Features').choices(\n features.map(({key}) => key)\n )\n )\n .addOption(\n new Option('-pm, --package-manager <packageManager>', 'Package manager')\n )\n .action(main)\n\ntype ArgOptions = {\n install?: boolean\n runtime: string\n features: string[]\n packageManager?: PackageManager\n}\n\nasync function main(\n targetDir: string | undefined,\n options: ArgOptions,\n command: Command\n) {\n consola.log(`${command.name()} version ${command.version()}`)\n\n try {\n if (!targetDir) {\n const answer = await consola.prompt(\n 'Where should the project be created?',\n {\n default: './my-pylon',\n placeholder: './my-pylon',\n cancel: 'reject'\n }\n )\n targetDir = answer\n }\n\n let projectName = ''\n\n if (targetDir === '.') {\n projectName = path.basename(process.cwd())\n } else {\n projectName = path.basename(targetDir)\n }\n\n if (!options.runtime) {\n const answer = await consola.prompt('Select a runtime environment:', {\n type: 'select',\n options: runtimes.map(r => ({\n label: r.name,\n value: r.key,\n hint: r.website\n })),\n cancel: 'reject'\n })\n options.runtime = answer\n }\n\n const runtime = runtimes.find(r => r.key === options.runtime)\n\n if (!runtime) {\n throw new Error(`Invalid runtime selected: ${options.runtime}`)\n }\n\n if (!options.features) {\n const answer = await consola.prompt('Configure features:', {\n type: 'multiselect',\n options: features\n .filter(f => runtime.supportedFeatures?.includes(f.key))\n .map(f => ({\n label: f.name,\n value: f.key,\n hint: f.website\n })),\n required: false,\n cancel: 'reject'\n })\n options.features = answer as any\n }\n\n // Check if options.features is valid\n for (const feature of options.features) {\n if (!runtime.supportedFeatures?.includes(feature)) {\n throw new Error(`Invalid feature selected: ${feature}`)\n }\n }\n\n // Summary of the selected options\n const confirmCreation = await consola.prompt(\n `Ready to create the project in ${chalk.blue(targetDir)}?`,\n {\n type: 'confirm',\n initial: true,\n cancel: 'reject'\n }\n )\n\n if (!confirmCreation) {\n const error = new Error('Prompt cancelled.')\n error.name = 'ConsolaPromptCancelledError'\n throw error\n }\n\n if (fs.existsSync(targetDir)) {\n if (fs.readdirSync(targetDir).length > 0) {\n const response = await consola.prompt(\n 'Directory not empty. Continue?',\n {\n type: 'confirm',\n cancel: 'reject'\n }\n )\n if (!response) {\n const error = new Error('Prompt cancelled.')\n error.name = 'ConsolaPromptCancelledError'\n throw error\n }\n }\n }\n\n await createDirectory({\n variables: {\n __PYLON_NAME__: projectName\n },\n runtime: runtime.key,\n features: options.features,\n destination: targetDir\n })\n\n const packageManager =\n options.packageManager || (await detectPackageManager(targetDir)) || 'npm'\n\n if (options.install === undefined) {\n options.install = await consola.prompt(\n `Installed dependencies with ${packageManager} now? You can also do this later.`,\n {\n type: 'confirm',\n initial: true,\n cancel: 'reject'\n }\n )\n }\n\n if (options.install) {\n await installPackage([])\n }\n\n const runScript = getRunScript(packageManager)\n\n const message = `\n \uD83C\uDF89 ${chalk.green.bold('Pylon created successfully.')}\n \n \uD83D\uDCBB ${chalk.cyan.bold('Continue Developing')}\n ${chalk.yellow('Change directories:')} cd ${chalk.blue(targetDir)}\n ${chalk.yellow('Start dev server:')} ${runScript} dev\n ${\n runtime.key === 'cf-workers'\n ? `${chalk.yellow('Deploy:')} ${runScript} deploy`\n : ''\n }\n \n \uD83D\uDCD6 ${chalk.cyan.bold('Explore Documentation')}\n ${chalk.underline.blue('https://pylon.cronit.io/docs')}\n \n \uD83D\uDCAC ${chalk.cyan.bold('Join our Community')}\n ${chalk.underline.blue('https://discord.gg/cbJjkVrnHe')}\n `\n\n consola.box(message)\n } catch (e) {\n consola.error(e)\n }\n}\n\nprogram.parse()\n", "import fs from 'fs/promises'\nimport path from 'path'\nimport {files} from './files'\n\nexport const runtimes = [\n {\n key: 'bun',\n name: 'Bun.js',\n website: 'https://bunjs.dev',\n supportedFeatures: ['auth', 'pages']\n },\n {\n key: 'node',\n name: 'Node.js',\n website: 'https://nodejs.org',\n supportedFeatures: ['auth', 'pages']\n },\n {\n key: 'cf-workers',\n name: 'Cloudflare Workers',\n website: 'https://workers.cloudflare.com',\n supportedFeatures: ['auth']\n },\n {\n key: 'deno',\n name: 'Deno',\n website: 'https://deno.land'\n }\n]\n\nexport const features = [\n {\n key: 'auth',\n name: 'Authentication',\n website: 'https://pylon.cronit.io/docs/authentication'\n },\n {\n key: 'pages',\n name: 'Pages',\n website: 'https://pylon.cronit.io/docs/pages'\n }\n]\n\nexport type Runtime = (typeof runtimes)[number]['key']\nexport type Feature = (typeof features)[number]['key']\n\ninterface CreateDirectoryOptions {\n variables: Record<string, string>\n destination: string\n runtime: Runtime\n features: Feature[]\n}\n\nconst makeIndexFile = (runtime: Runtime, features: Feature[]) => {\n const pylonImports: string[] = ['app', 'PylonConfig']\n const pylonConfigPlugins: string[] = []\n\n if (features.includes('auth')) {\n pylonImports.push('useAuth')\n pylonConfigPlugins.push(\n \"useAuth({issuer: 'https://test-0o6zvq.zitadel.cloud'})\"\n )\n }\n\n if (features.includes('pages')) {\n pylonImports.push('usePages')\n pylonConfigPlugins.push('usePages()')\n }\n\n let content: string = ''\n\n // Add imports\n content += `import {${pylonImports.join(', ')}} from '@getcronit/pylon'\\n\\n`\n\n if (runtime === 'node') {\n content += `import {serve} from '@hono/node-server'\\n`\n }\n\n content += '\\n\\n'\n\n // Add graphql\n content += `export const graphql = {\n Query: {\n hello: () => {\n return 'Hello, world!'\n }\n },\n Mutation: {}\n}`\n\n content += '\\n\\n'\n\n if (runtime === 'bun' || runtime === 'cf-workers') {\n content += `export default app`\n } else if (runtime === 'node') {\n content += `serve(app, info => {\n console.log(\\`Server running at \\${info.port}\\`)\n})`\n } else if (runtime === 'deno') {\n content += `Deno.serve({port: 3000}, app.fetch)\n`\n }\n\n content += '\\n\\n'\n\n content += `export const config: PylonConfig = {\n plugins: [${pylonConfigPlugins.join(', ')}]\n}`\n\n return content\n}\n\nconst makePylonDefinition = async (runtime: Runtime, features: Feature[]) => {\n let data = `import '@getcronit/pylon'\n\ndeclare module '@getcronit/pylon' {\n interface Bindings {}\n\n interface Variables {}\n}\n\n\n`\n\n if (features.includes('pages')) {\n data += `import {useQuery} from './.pylon/client'\n\ndeclare module '@getcronit/pylon/pages' {\n interface PageData extends ReturnType<typeof useQuery> {}\n}`\n }\n\n return data\n}\n\nconst makeTsConfig = async (runtime: Runtime, features: Feature[]) => {\n const data: any = {\n extends: '@getcronit/pylon/tsconfig.pylon.json',\n include: ['pylon.d.ts', 'src/**/*.ts']\n }\n\n if (runtime === 'cf-workers') {\n data.include.push('worker-configuration.d.ts')\n }\n\n if (features.includes('pages')) {\n data.compilerOptions = {\n baseUrl: '.',\n paths: {\n '@/*': ['./*']\n },\n jsx: 'react-jsx' // support JSX\n }\n\n data.include.push('pages', 'components', '.pylon')\n }\n\n return JSON.stringify(data, null, 2)\n}\n\nconst injectPagesFeatureFiles = async (\n files: {\n path: string\n content: string\n }[]\n) => {\n const pagesFiles = [\n {\n path: 'pages/layout.tsx',\n content: `import '../globals.css'\n\nexport default function RootLayout({children}: {children: React.ReactNode}) {\n return (\n <html lang=\"en\">\n <body>{children}</body>\n </html>\n )\n}\n`\n },\n {\n path: 'pages/page.tsx',\n content: `import { Button } from '@/components/ui/button'\nimport { PageProps } from '@getcronit/pylon/pages'\n\nconst Page: React.FC<PageProps> = props => {\n return (\n <div className=\"container\">\n <title>{props.data.hello}</title>\n <Button>Hello {props.data.hello}</Button>\n </div>\n )\n}\n\nexport default Page\n`\n },\n {\n path: 'globals.css',\n content: `@import 'tailwindcss';\n\n@plugin 'tailwindcss-animate';\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --color-background: hsl(var(--background));\n --color-foreground: hsl(var(--foreground));\n\n --color-card: hsl(var(--card));\n --color-card-foreground: hsl(var(--card-foreground));\n\n --color-popover: hsl(var(--popover));\n --color-popover-foreground: hsl(var(--popover-foreground));\n\n --color-primary: hsl(var(--primary));\n --color-primary-foreground: hsl(var(--primary-foreground));\n\n --color-secondary: hsl(var(--secondary));\n --color-secondary-foreground: hsl(var(--secondary-foreground));\n\n --color-muted: hsl(var(--muted));\n --color-muted-foreground: hsl(var(--muted-foreground));\n\n --color-accent: hsl(var(--accent));\n --color-accent-foreground: hsl(var(--accent-foreground));\n\n --color-destructive: hsl(var(--destructive));\n --color-destructive-foreground: hsl(var(--destructive-foreground));\n\n --color-border: hsl(var(--border));\n --color-input: hsl(var(--input));\n --color-ring: hsl(var(--ring));\n\n --color-chart-1: hsl(var(--chart-1));\n --color-chart-2: hsl(var(--chart-2));\n --color-chart-3: hsl(var(--chart-3));\n --color-chart-4: hsl(var(--chart-4));\n --color-chart-5: hsl(var(--chart-5));\n\n --color-sidebar: hsl(var(--sidebar-background));\n --color-sidebar-foreground: hsl(var(--sidebar-foreground));\n --color-sidebar-primary: hsl(var(--sidebar-primary));\n --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));\n --color-sidebar-accent: hsl(var(--sidebar-accent));\n --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));\n --color-sidebar-border: hsl(var(--sidebar-border));\n --color-sidebar-ring: hsl(var(--sidebar-ring));\n\n --radius-lg: var(--radius);\n --radius-md: calc(var(--radius) - 2px);\n --radius-sm: calc(var(--radius) - 4px);\n\n --animate-accordion-down: accordion-down 0.2s ease-out;\n --animate-accordion-up: accordion-up 0.2s ease-out;\n\n @keyframes accordion-down {\n from {\n height: 0;\n }\n to {\n height: var(--radix-accordion-content-height);\n }\n }\n @keyframes accordion-up {\n from {\n height: var(--radix-accordion-content-height);\n }\n to {\n height: 0;\n }\n }\n}\n\n/*\n The default border color has changed to \\`currentColor\\` in Tailwind CSS v4,\n so we've added these compatibility styles to make sure everything still\n looks the same as it did with Tailwind CSS v3.\n\n If we ever want to remove these styles, we need to add an explicit border\n color utility to any element that depends on these defaults.\n*/\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n border-color: var(--color-gray-200, currentColor);\n }\n}\n\n@layer utilities {\n body {\n font-family: Arial, Helvetica, sans-serif;\n }\n}\n\n@layer base {\n :root {\n --background: 0 0% 100%;\n --foreground: 0 0% 3.9%;\n --card: 0 0% 100%;\n --card-foreground: 0 0% 3.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 0 0% 3.9%;\n --primary: 0 0% 9%;\n --primary-foreground: 0 0% 98%;\n --secondary: 0 0% 96.1%;\n --secondary-foreground: 0 0% 9%;\n --muted: 0 0% 96.1%;\n --muted-foreground: 0 0% 45.1%;\n --accent: 0 0% 96.1%;\n --accent-foreground: 0 0% 9%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 0 0% 98%;\n --border: 0 0% 89.8%;\n --input: 0 0% 89.8%;\n --ring: 0 0% 3.9%;\n --chart-1: 12 76% 61%;\n --chart-2: 173 58% 39%;\n --chart-3: 197 37% 24%;\n --chart-4: 43 74% 66%;\n --chart-5: 27 87% 67%;\n --radius: 0.5rem;\n --sidebar-background: 0 0% 98%;\n --sidebar-foreground: 240 5.3% 26.1%;\n --sidebar-primary: 240 5.9% 10%;\n --sidebar-primary-foreground: 0 0% 98%;\n --sidebar-accent: 240 4.8% 95.9%;\n --sidebar-accent-foreground: 240 5.9% 10%;\n --sidebar-border: 220 13% 91%;\n --sidebar-ring: 217.2 91.2% 59.8%;\n }\n .dark {\n --background: 0 0% 3.9%;\n --foreground: 0 0% 98%;\n --card: 0 0% 3.9%;\n --card-foreground: 0 0% 98%;\n --popover: 0 0% 3.9%;\n --popover-foreground: 0 0% 98%;\n --primary: 0 0% 98%;\n --primary-foreground: 0 0% 9%;\n --secondary: 0 0% 14.9%;\n --secondary-foreground: 0 0% 98%;\n --muted: 0 0% 14.9%;\n --muted-foreground: 0 0% 63.9%;\n --accent: 0 0% 14.9%;\n --accent-foreground: 0 0% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 0 0% 98%;\n --border: 0 0% 14.9%;\n --input: 0 0% 14.9%;\n --ring: 0 0% 83.1%;\n --chart-1: 220 70% 50%;\n --chart-2: 160 60% 45%;\n --chart-3: 30 80% 55%;\n --chart-4: 280 65% 60%;\n --chart-5: 340 75% 55%;\n --sidebar-background: 240 5.9% 10%;\n --sidebar-foreground: 240 4.8% 95.9%;\n --sidebar-primary: 224.3 76.3% 48%;\n --sidebar-primary-foreground: 0 0% 100%;\n --sidebar-accent: 240 3.7% 15.9%;\n --sidebar-accent-foreground: 240 4.8% 95.9%;\n --sidebar-border: 240 3.7% 15.9%;\n --sidebar-ring: 217.2 91.2% 59.8%;\n }\n}\n\n@layer base {\n * {\n @apply border-border;\n }\n body {\n @apply bg-background text-foreground;\n }\n}\n\n/*\n ---break---\n*/\n\n@layer base {\n * {\n @apply border-border outline-ring/50;\n }\n body {\n @apply bg-background text-foreground;\n }\n}\n`\n },\n {\n path: 'postcss.config.js',\n content: `import tailwindPostCss from '@tailwindcss/postcss'\n\nexport default {\n plugins: [tailwindPostCss]\n}\n`\n },\n {\n path: 'components.json',\n content: `{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"new-york\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.js\",\n \"css\": \"globals.css\",\n \"baseColor\": \"zinc\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n },\n \"iconLibrary\": \"lucide\"\n}`\n },\n {\n path: 'lib/utils.ts',\n content: `import {clsx, type ClassValue} from 'clsx'\nimport {twMerge} from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}`\n },\n {\n path: 'components/ui/button.tsx',\n content: `import * as React from 'react'\nimport {Slot} from '@radix-ui/react-slot'\nimport {cva, type VariantProps} from 'class-variance-authority'\n\nimport {cn} from '@/lib/utils'\n\nconst buttonVariants = cva(\n \"inline-flexxx items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 focus-visible:ring-4 focus-visible:outline-1 aria-invalid:focus-visible:ring-0\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',\n destructive:\n 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline'\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9'\n }\n },\n defaultVariants: {\n variant: 'default',\n size: 'default'\n }\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({variant, size, className}))}\n {...props}\n />\n )\n}\n\nexport {Button, buttonVariants}\n`\n }\n ]\n\n files.push(...pagesFiles)\n\n // Overwrite the package.json file and add the necessary dependencies\n\n const packageJsonFile = files.find(file => file.path === 'package.json')\n\n if (packageJsonFile) {\n const packageJson = JSON.parse(packageJsonFile.content)\n\n packageJson.dependencies = {\n ...packageJson.dependencies,\n '@gqty/react': '^3.1.0',\n gqty: '^3.4.0',\n '@radix-ui/react-slot': '^1.1.2',\n 'class-variance-authority': '^0.7.1',\n clsx: '^2.1.1',\n 'lucide-react': '^0.474.0',\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n 'tailwind-merge': '^3.0.1',\n tailwindcss: '^4.0.4',\n 'tailwindcss-animate': '^1.0.7'\n }\n\n packageJson.devDependencies = {\n ...packageJson.devDependencies,\n '@tailwindcss/postcss': '^4.0.6',\n '@types/react': '^19.0.8'\n }\n\n packageJsonFile.content = JSON.stringify(packageJson, null, 2)\n }\n\n return files\n}\n\nconst injectVariablesInContent = (\n content: string,\n variables: Record<string, string>\n) => {\n let result = content\n\n Object.entries(variables).forEach(([key, value]) => {\n result = result.replaceAll(key, value)\n })\n\n return result\n}\n\nexport const createDirectory = async (options: CreateDirectoryOptions) => {\n const {destination, runtime, features} = options\n\n let runtimeFiles = files.ALL.concat(files[runtime] || []).filter(file => {\n if (!file.specificRuntimes) {\n return true\n }\n\n return file.specificRuntimes.includes(runtime)\n })\n\n const indexFile = makeIndexFile(runtime, features)\n const tsConfig = await makeTsConfig(runtime, features)\n const pylonDefinition = await makePylonDefinition(runtime, features)\n\n runtimeFiles.push(\n {\n path: 'tsconfig.json',\n content: tsConfig\n },\n {\n path: 'pylon.d.ts',\n content: pylonDefinition\n },\n {\n path: 'src/index.ts',\n content: indexFile\n }\n )\n\n if (features.includes('pages')) {\n runtimeFiles = await injectPagesFeatureFiles(runtimeFiles)\n }\n\n for (const file of runtimeFiles) {\n const filePath = path.join(destination, file.path)\n\n await fs.mkdir(path.dirname(filePath), {recursive: true})\n await fs.writeFile(\n filePath,\n injectVariablesInContent(file.content, options.variables)\n )\n }\n}\n", "import {Runtime} from '.'\n\nconst pylonVersion = '^2.0.0'\nconst pylonDevVersion = '^1.0.0'\n\nexport const files: {\n [key in Runtime | 'ALL']: {\n path: string\n content: string\n specificRuntimes?: Runtime[]\n }[]\n} = {\n ALL: [\n {\n path: '.gitignore',\n content: `# Logs\n\nlogs\n_.log\nnpm-debug.log_\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\n\nreport.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json\n\n# Runtime data\n\npids\n_.pid\n_.seed\n\\*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\n\nlib-cov\n\n# Coverage directory used by tools like istanbul\n\ncoverage\n\\*.lcov\n\n# nyc test coverage\n\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n\n.grunt\n\n# Bower dependency directory (https://bower.io/)\n\nbower_components\n\n# node-waf configuration\n\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\n\nbuild/Release\n\n# Dependency directories\n\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\n\nweb_modules/\n\n# TypeScript cache\n\n\\*.tsbuildinfo\n\n# Optional npm cache directory\n\n.npm\n\n# Optional eslint cache\n\n.eslintcache\n\n# Optional stylelint cache\n\n.stylelintcache\n\n# Microbundle cache\n\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n\n.node_repl_history\n\n# Output of 'npm pack'\n\n\\*.tgz\n\n# Yarn Integrity file\n\n.yarn-integrity\n\n# dotenv environment variable files\n\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n\n.cache\n.parcel-cache\n\n# Next.js build output\n\n.next\nout\n\n# Nuxt.js build / generate output\n\n.nuxt\ndist\n\n# Gatsby files\n\n.cache/\n\n# Comment in the public line in if your project uses Gatsby and not Next.js\n\n# https://nextjs.org/blog/next-9-1#public-directory-support\n\n# public\n\n# vuepress build output\n\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n\n.temp\n.cache\n\n# Docusaurus cache and generated files\n\n.docusaurus\n\n# Serverless directories\n\n.serverless/\n\n# FuseBox cache\n\n.fusebox/\n\n# DynamoDB Local files\n\n.dynamodb/\n\n# TernJS port file\n\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n\n.vscode-test\n\n# yarn v2\n\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.\\*\n\n# wrangler project\n\n.dev.vars\n.wrangler/\n\n# Pylon project\n.pylon\n`\n },\n {\n path: '.dockerignore',\n content: `node_modules\nDockerfile*\ndocker-compose*\n.dockerignore\n.git\n.gitignore\nREADME.md\nLICENSE\n.vscode\nMakefile\nhelm-charts\n.env\n.editorconfig\n.idea\ncoverage*\n`,\n specificRuntimes: ['node', 'bun']\n },\n {\n path: '.github/workflows/publish.yml',\n content: `name: publish\n\non: [push]\nenv:\n IMAGE_NAME: __PYLON_NAME__\n\njobs:\n # Push image to GitHub Packages.\n # See also https://docs.docker.com/docker-hub/builds/\n publish-container:\n runs-on: ubuntu-latest\n permissions:\n packages: write\n contents: read\n\n steps:\n - uses: actions/checkout@v4\n\n - name: Build image\n run: docker build . --file Dockerfile --tag $IMAGE_NAME\n\n - name: Log into registry\n run: echo \"\\${{ secrets.GITHUB_TOKEN }}\" | docker login ghcr.io -u \\${{ github.actor }} --password-stdin\n\n - name: Push image\n run: |\n IMAGE_ID=ghcr.io/\\${{ github.repository_owner }}/$IMAGE_NAME\n\n # Change all uppercase to lowercase\n IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')\n # Strip git ref prefix from version\n VERSION=$(echo \"\\${{ github.ref }}\" | sed -e 's,.*/\\\\(.*\\\\),\\\\1,')\n # Strip \"v\" prefix from tag name\n [[ \"\\${{ github.ref }}\" == \"refs/tags/\"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')\n # Use Docker \\`latest\\` tag convention\n [ \"$VERSION\" == \"main\" ] && VERSION=latest\n echo IMAGE_ID=$IMAGE_ID\n echo VERSION=$VERSION\n docker tag $IMAGE_NAME $IMAGE_ID:$VERSION\n docker push $IMAGE_ID:$VERSION\n\n# SPDX-License-Identifier: (EUPL-1.2)\n# Copyright \u00A9 2024 cronit KG`,\n specificRuntimes: ['node', 'bun']\n }\n ],\n bun: [\n {\n path: 'package.json',\n content: `{\n \"name\": \"__PYLON_NAME__\",\n \"private\": true,\n \"version\": \"0.0.1\",\n \"type\": \"module\",\n \"description\": \"Generated with \\`npm create pylon\\`\",\n \"scripts\": {\n \"dev\": \"pylon dev -c \\\\\"bun run .pylon/index.js\\\\\"\",\n \"build\": \"pylon build\"\n },\n \"dependencies\": {\n \"@getcronit/pylon\": \"${pylonVersion}\",\n },\n \"devDependencies\": {\n \"@getcronit/pylon-dev\": \"${pylonDevVersion}\",\n \"@types/bun\": \"^1.0.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\"\n },\n \"homepage\": \"https://pylon.cronit.io\",\n \"packageManager\": \"bun\"\n}\n`\n },\n {\n path: 'Dockerfile',\n content: `# use the official Bun image\n# see all versions at https://hub.docker.com/r/oven/bun/tags\nFROM oven/bun:1 as base\n\nLABEL description=\"Offical docker image for Pylon services (Bun)\"\nLABEL org.opencontainers.image.source=\"https://github.com/getcronit/pylon\"\nLABEL maintainer=\"office@cronit.io\"\n\nWORKDIR /usr/src/pylon\n\n\n# install dependencies into temp directory\n# this will cache them and speed up future builds\nFROM base AS install\nRUN mkdir -p /temp/dev\nCOPY package.json bun.lockb /temp/dev/\nRUN cd /temp/dev && bun install --frozen-lockfile\n\n# install with --production (exclude devDependencies)\nRUN mkdir -p /temp/prod\nCOPY package.json bun.lockb /temp/prod/\nRUN cd /temp/prod && bun install --frozen-lockfile --production\n\n# copy node_modules from temp directory\n# then copy all (non-ignored) project files into the image\nFROM install AS prerelease\nCOPY --from=install /temp/dev/node_modules node_modules\nCOPY . .\n\n# [optional] tests & build\nENV NODE_ENV=production\n\n# Create .pylon folder (mkdir)\nRUN mkdir -p .pylon\n# RUN bun test\nRUN bun run pylon build\n\n# copy production dependencies and source code into final image\nFROM base AS release\nCOPY --from=install /temp/prod/node_modules node_modules\nCOPY --from=prerelease /usr/src/pylon/.pylon .pylon\nCOPY --from=prerelease /usr/src/pylon/package.json .\n\n# run the app\nUSER bun\nEXPOSE 3000/tcp\nENTRYPOINT [ \"bun\", \"run\", \"/usr/src/pylon/.pylon/index.js\" ]\n`\n }\n ],\n node: [\n {\n path: 'package.json',\n content: `{\n \"name\": \"__PYLON_NAME__\",\n \"private\": true,\n \"version\": \"0.0.1\",\n \"type\": \"module\",\n \"description\": \"Generated with \\`npm create pylon\\`\",\n \"scripts\": {\n \"dev\": \"pylon dev -c \\\\\"node --enable-source-maps .pylon/index.js\\\\\"\",\n \"build\": \"pylon build\"\n },\n \"dependencies\": {\n \"@getcronit/pylon\": \"${pylonVersion}\",\n \"@hono/node-server\": \"^1.12.2\"\n },\n \"devDependencies\": {\n \"@getcronit/pylon-dev\": \"${pylonDevVersion}\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\"\n },\n \"homepage\": \"https://pylon.cronit.io\"\n}\n`\n },\n {\n path: 'Dockerfile',\n content: `# Use the official Node.js 20 image as the base\nFROM node:20-alpine as base\n\nLABEL description=\"Offical docker image for Pylon services (Node.js)\"\nLABEL org.opencontainers.image.source=\"https://github.com/getcronit/pylon\"\nLABEL maintainer=\"office@cronit.io\"\n\nWORKDIR /usr/src/pylon\n\n# install dependencies into a temp directory\n# this will cache them and speed up future builds\nFROM base AS install\nRUN mkdir -p /temp/dev\nCOPY package.json package-lock.json /temp/dev/\nRUN cd /temp/dev && npm ci\n\n# install with --production (exclude devDependencies)\nRUN mkdir -p /temp/prod\nCOPY package.json package-lock.json /temp/prod/\nRUN cd /temp/prod && npm ci --only=production\n\n# copy node_modules from temp directory\n# then copy all (non-ignored) project files into the image\nFROM install AS prerelease\nCOPY --from=install /temp/dev/node_modules node_modules\nCOPY . .\n\n# [optional] tests & build\nENV NODE_ENV=production\n\n# Create .pylon folder (mkdir)\nRUN mkdir -p .pylon\n# RUN npm test\nRUN npm run pylon build\n\n# copy production dependencies and source code into final image\nFROM base AS release\nCOPY --from=install /temp/prod/node_modules node_modules\nCOPY --from=prerelease /usr/src/pylon/.pylon .pylon\nCOPY --from=prerelease /usr/src/pylon/package.json .\n\n# run the app\nUSER node\nEXPOSE 3000/tcp\nENTRYPOINT [ \"node\", \"/usr/src/pylon/.pylon/index.js\" ]\n`\n }\n ],\n 'cf-workers': [\n {\n path: 'package.json',\n content: `{\n \"name\": \"__PYLON_NAME__\",\n \"type\": \"module\",\n \"description\": \"Generated with \\`npm create pylon\\`\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"scripts\": {\n \"deploy\": \"pylon build && wrangler deploy\",\n \"dev\": \"pylon dev -c \\\\\"wrangler dev\\\\\"\",\n \"cf-typegen\": \"wrangler types\"\n },\n \"dependencies\": {\n \"@getcronit/pylon\": \"${pylonVersion}\",\n },\n \"devDependencies\": {\n \"@getcronit/pylon-dev\": \"${pylonDevVersion}\",\n \"@cloudflare/vitest-pool-workers\": \"^0.4.5\",\n \"@cloudflare/workers-types\": \"^4.20240903.0\",\n \"typescript\": \"^5.5.2\",\n \"wrangler\": \"^3.60.3\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\"\n },\n \"homepage\": \"https://pylon.cronit.io\"\n}\n`\n },\n {\n path: 'wrangler.toml',\n content: `#:schema node_modules/wrangler/config-schema.json\nname = \"__PYLON_NAME__\"\nmain = \".pylon/index.js\"\ncompatibility_date = \"2024-09-03\"\ncompatibility_flags = [\"nodejs_compat_v2\"]\n\n# Automatically place your workloads in an optimal location to minimize latency.\n# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure\n# rather than the end user may result in better performance.\n# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement\n# [placement]\n# mode = \"smart\"\n\n# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)\n# Docs:\n# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables\n# Note: Use secrets to store sensitive data.\n# - https://developers.cloudflare.com/workers/configuration/secrets/\n# [vars]\n# MY_VARIABLE = \"production_value\"\n\n# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare\u2019s global network\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai\n# [ai]\n# binding = \"AI\"\n\n# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets\n# [[analytics_engine_datasets]]\n# binding = \"MY_DATASET\"\n\n# Bind a headless browser instance running on Cloudflare's global network.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering\n# [browser]\n# binding = \"MY_BROWSER\"\n\n# Bind a D1 database. D1 is Cloudflare\u2019s native serverless SQL database.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases\n# [[d1_databases]]\n# binding = \"MY_DB\"\n# database_name = \"my-database\"\n# database_id = \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n\n# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms\n# [[dispatch_namespaces]]\n# binding = \"MY_DISPATCHER\"\n# namespace = \"my-namespace\"\n\n# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.\n# Durable Objects can live for as long as needed. Use these when you need a long-running \"server\", such as in realtime apps.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects\n# [[durable_objects.bindings]]\n# name = \"MY_DURABLE_OBJECT\"\n# class_name = \"MyDurableObject\"\n\n# Durable Object migrations.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations\n# [[migrations]]\n# tag = \"v1\"\n# new_classes = [\"MyDurableObject\"]\n\n# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive\n# [[hyperdrive]]\n# binding = \"MY_HYPERDRIVE\"\n# id = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces\n# [[kv_namespaces]]\n# binding = \"MY_KV_NAMESPACE\"\n# id = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n# Bind an mTLS certificate. Use to present a client certificate when communicating with another service.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates\n# [[mtls_certificates]]\n# binding = \"MY_CERTIFICATE\"\n# certificate_id = \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n\n# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues\n# [[queues.producers]]\n# binding = \"MY_QUEUE\"\n# queue = \"my-queue\"\n\n# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues\n# [[queues.consumers]]\n# queue = \"my-queue\"\n\n# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets\n# [[r2_buckets]]\n# binding = \"MY_BUCKET\"\n# bucket_name = \"my-bucket\"\n\n# Bind another Worker service. Use this binding to call another Worker without network overhead.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings\n# [[services]]\n# binding = \"MY_SERVICE\"\n# service = \"my-service\"\n\n# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes\n# [[vectorize]]\n# binding = \"MY_INDEX\"\n# index_name = \"my-index\"\n`\n }\n ],\n deno: [\n {\n path: '.vscode/settings.json',\n content: `{\n \"deno.enablePaths\": [\n \"./\"\n ],\n \"editor.inlayHints.enabled\": \"off\"\n}`\n },\n {\n path: '.vscode/extensions.json',\n content: `{\n \"recommendations\": [\n \"denoland.vscode-deno\"\n ]\n}`\n },\n {\n path: 'deno.json',\n content: `{\n \"imports\": {\n \"@getcronit/pylon-dev\": \"npm:@getcronit/pylon-dev@${pylonDevVersion}\",\n \"@getcronit/pylon\": \"npm:@getcronit/pylon@${pylonVersion}\"\n },\n \"tasks\": {\n \"dev\": \"pylon dev -c \\\\\"deno run -A .pylon/index.js --config tsconfig.json\\\\\"\",\n \"build\": \"pylon build\"\n },\n \"compilerOptions\": {\n \"jsx\": \"precompile\",\n \"jsxImportSource\": \"hono/jsx\"\n },\n \"nodeModulesDir\": \"auto\",\n \"packageManager\": \"deno\"\n}\n`\n }\n ]\n}\n", "import type {Agent} from 'package-manager-detector'\nimport process from 'node:process'\nimport {detect} from 'package-manager-detector/detect'\nimport consola from 'consola'\n\nexport type {Agent} from 'package-manager-detector'\n\nexport type PackageManager = Agent\n\nexport async function detectPackageManager(\n cwd = process.cwd()\n): Promise<Agent | null> {\n const result = await detect({\n cwd,\n onUnknown(packageManager) {\n consola.warn('Unknown packageManager:', packageManager)\n return undefined\n }\n })\n\n return result?.agent || null\n}\n\ntype PackageManagerScript =\n | 'bun'\n | 'npm run'\n | 'yarn'\n | 'pnpm run'\n | 'deno task'\n\nexport function getRunScript(\n agentSpecifier: PackageManager | null\n): PackageManagerScript | null {\n if (agentSpecifier === null) return null\n\n const [agent] = agentSpecifier.split('@') // Extract agent name before '@'\n\n switch (agent) {\n case 'bun':\n return 'bun'\n case 'npm':\n return 'npm run'\n case 'yarn':\n return 'yarn'\n case 'pnpm':\n return 'pnpm run'\n case 'deno':\n return 'deno task'\n default:\n return null\n }\n}\n", "import {existsSync} from 'node:fs'\nimport {resolve} from 'node:path'\nimport process from 'node:process'\nimport {x} from 'tinyexec'\nimport {detectPackageManager} from './detect'\n\nexport interface InstallPackageOptions {\n cwd?: string\n dev?: boolean\n silent?: boolean\n packageManager?: string\n preferOffline?: boolean\n additionalArgs?:\n | string[]\n | ((agent: string, detectedAgent: string) => string[] | undefined)\n}\n\nexport async function installPackage(\n names: string | string[],\n options: InstallPackageOptions = {}\n) {\n const detectedAgent =\n options.packageManager || (await detectPackageManager(options.cwd)) || 'npm'\n const [agent] = detectedAgent.split('@')\n\n if (!Array.isArray(names)) names = [names]\n\n const args =\n (typeof options.additionalArgs === 'function'\n ? options.additionalArgs(agent, detectedAgent)\n : options.additionalArgs) || []\n\n if (options.preferOffline) {\n // yarn berry uses --cached option instead of --prefer-offline\n if (detectedAgent === 'yarn@berry') args.unshift('--cached')\n else args.unshift('--prefer-offline')\n }\n\n if (\n agent === 'pnpm' &&\n existsSync(resolve(options.cwd ?? process.cwd(), 'pnpm-workspace.yaml'))\n ) {\n args.unshift(\n '-w',\n /**\n * Prevent pnpm from removing installed devDeps while `NODE_ENV` is `production`\n * @see https://pnpm.io/cli/install#--prod--p\n */\n '--prod=false'\n )\n }\n\n return x(\n agent,\n [\n agent === 'yarn' ? 'add' : 'install',\n options.dev ? '-D' : '',\n ...args,\n ...names\n ].filter(Boolean),\n {\n nodeOptions: {\n stdio: options.silent ? 'ignore' : 'inherit',\n cwd: options.cwd\n },\n throwOnError: true\n }\n )\n}\n"],
|
|
5
|
-
"mappings": ";AAEA,OAAOA,MAAW,QAClB,OAAQ,UAAAC,EAAQ,WAAAC,MAA4B,YAC5C,OAAOC,MAAa,UACpB,UAAYC,MAAQ,KACpB,OAAOC,MAAU,OAEjB,OAAQ,WAAAC,MAAc,OACtB,OAAQ,iBAAAC,MAAoB,MCT5B,OAAOC,MAAQ,cACf,OAAOC,MAAU,OCCjB,IAAMC,EAAe,SACfC,EAAkB,SAEXC,EAMT,CACF,IAAK,CACH,CACE,KAAM,aACN,QAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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,EAAQ,UAAY,SACtBA,EAAQ,QAAU,MAAME,EAAQ,OAC9B,+BAA+BU,CAAc,oCAC7C,CACE,KAAM,UACN,QAAS,GACT,OAAQ,QACV,CACF,GAGEZ,EAAQ,SACV,MAAMc,EAAe,CAAC,CAAC,EAGzB,IAAMC,EAAYC,EAAaJ,CAAc,EAEvCK,EAAU;AAAA,gBACXR,EAAM,MAAM,KAAK,6BAA6B,CAAC;AAAA;AAAA,gBAE/CA,EAAM,KAAK,KAAK,qBAAqB,CAAC;AAAA,UACrCA,EAAM,OAAO,qBAAqB,CAAC,OAAOA,EAAM,KAAKV,CAAS,CAAC;AAAA,UAC/DU,EAAM,OAAO,mBAAmB,CAAC,IAAIM,CAAS;AAAA,UAE9CT,EAAQ,MAAQ,aACZ,GAAGG,EAAM,OAAO,SAAS,CAAC,IAAIM,CAAS,UACvC,EACN;AAAA;AAAA,gBAECN,EAAM,KAAK,KAAK,uBAAuB,CAAC;AAAA,UACvCA,EAAM,UAAU,KAAK,8BAA8B,CAAC;AAAA;AAAA,gBAErDA,EAAM,KAAK,KAAK,oBAAoB,CAAC;AAAA,UACpCA,EAAM,UAAU,KAAK,+BAA+B,CAAC;AAAA,MAG3DP,EAAQ,IAAIe,CAAO,CACrB,OAASC,EAAG,CACVhB,EAAQ,MAAMgB,CAAC,CACjB,CACF,CAEAzB,EAAQ,MAAM",
|
|
6
|
-
"names": ["chalk", "Option", "program", "consola", "fs", "path", "
|
|
3
|
+
"sources": ["../src/index.ts", "../src/create-directory/index.ts", "../src/create-directory/files.ts", "../src/install-pkg/detect.ts", "../src/install-pkg/install.ts", "../src/analytics.ts", "../package.json"],
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n\nimport chalk from 'chalk'\nimport {Option, program, type Command} from 'commander'\nimport consola from 'consola'\nimport * as fs from 'fs'\nimport path from 'path'\n\nimport {dirname} from 'path'\nimport {fileURLToPath} from 'url'\n\nimport {createDirectory, features, runtimes} from './create-directory'\nimport {\n detectPackageManager,\n getRunScript,\n installPackage,\n PackageManager\n} from './install-pkg'\nimport {analytics, distinctId} from './analytics'\n\nimport {version} from '../package.json'\n\nprogram\n .name('create-pylon')\n .version(version)\n .arguments('[target]')\n .addOption(new Option('-i, --install', 'Install dependencies'))\n .addOption(\n new Option('-r, --runtime <runtime>', 'Runtime').choices(\n runtimes.map(({key}) => key)\n )\n )\n .addOption(\n new Option('--features [features...]', 'Features').choices(\n features.map(({key}) => key)\n )\n )\n .addOption(\n new Option('-pm, --package-manager <packageManager>', 'Package manager')\n )\n .action(main)\n\ntype ArgOptions = {\n install?: boolean\n runtime: string\n features: string[]\n packageManager?: PackageManager\n}\n\nasync function main(\n targetDir: string | undefined,\n options: ArgOptions,\n command: Command\n) {\n consola.log(`${command.name()} version ${command.version()}`)\n\n try {\n if (!targetDir) {\n const answer = await consola.prompt(\n 'Where should the project be created?',\n {\n default: './my-pylon',\n placeholder: './my-pylon',\n cancel: 'reject'\n }\n )\n targetDir = answer\n }\n\n let projectName = ''\n\n if (targetDir === '.') {\n projectName = path.basename(process.cwd())\n } else {\n projectName = path.basename(targetDir)\n }\n\n if (!options.runtime) {\n const answer = await consola.prompt('Select a runtime environment:', {\n type: 'select',\n options: runtimes.map(r => ({\n label: r.name,\n value: r.key,\n hint: r.website\n })),\n cancel: 'reject'\n })\n options.runtime = answer\n }\n\n const runtime = runtimes.find(r => r.key === options.runtime)\n\n if (!runtime) {\n throw new Error(`Invalid runtime selected: ${options.runtime}`)\n }\n\n if (!options.features) {\n const answer = await consola.prompt('Configure features:', {\n type: 'multiselect',\n options: features\n .filter(f => runtime.supportedFeatures?.includes(f.key))\n .map(f => ({\n label: f.name,\n value: f.key,\n hint: f.website\n })),\n required: false,\n cancel: 'reject'\n })\n options.features = answer as any\n }\n\n // Check if options.features is valid\n for (const feature of options.features) {\n if (!runtime.supportedFeatures?.includes(feature)) {\n throw new Error(`Invalid feature selected: ${feature}`)\n }\n }\n\n // Summary of the selected options\n const confirmCreation = await consola.prompt(\n `Ready to create the project in ${chalk.blue(targetDir)}?`,\n {\n type: 'confirm',\n initial: true,\n cancel: 'reject'\n }\n )\n\n if (!confirmCreation) {\n const error = new Error('Prompt cancelled.')\n error.name = 'ConsolaPromptCancelledError'\n throw error\n }\n\n if (fs.existsSync(targetDir)) {\n if (fs.readdirSync(targetDir).length > 0) {\n const response = await consola.prompt(\n 'Directory not empty. Continue?',\n {\n type: 'confirm',\n cancel: 'reject'\n }\n )\n if (!response) {\n const error = new Error('Prompt cancelled.')\n error.name = 'ConsolaPromptCancelledError'\n throw error\n }\n }\n }\n\n await createDirectory({\n variables: {\n __PYLON_NAME__: projectName\n },\n runtime: runtime.key,\n features: options.features,\n destination: targetDir\n })\n\n const packageManager =\n options.packageManager || (await detectPackageManager(targetDir)) || 'npm'\n\n if (options.install === undefined) {\n options.install = await consola.prompt(\n `Installed dependencies with ${packageManager} now? You can also do this later.`,\n {\n type: 'confirm',\n initial: true,\n cancel: 'reject'\n }\n )\n }\n\n if (options.install) {\n await installPackage([])\n }\n\n analytics.capture({\n distinctId,\n event: 'create-pylon',\n properties: {\n runtime: runtime.key,\n features: options.features,\n packageManager,\n install: options.install\n }\n })\n\n const runScript = getRunScript(packageManager)\n\n const message = `\n \uD83C\uDF89 ${chalk.green.bold('Pylon created successfully.')}\n \n \uD83D\uDCBB ${chalk.cyan.bold('Continue Developing')}\n ${chalk.yellow('Change directories:')} cd ${chalk.blue(targetDir)}\n ${chalk.yellow('Start dev server:')} ${runScript} dev\n ${\n runtime.key === 'cf-workers'\n ? `${chalk.yellow('Deploy:')} ${runScript} deploy`\n : ''\n }\n \n \uD83D\uDCD6 ${chalk.cyan.bold('Explore Documentation')}\n ${chalk.underline.blue('https://pylon.cronit.io/docs')}\n \n \uD83D\uDCAC ${chalk.cyan.bold('Join our Community')}\n ${chalk.underline.blue('https://discord.gg/cbJjkVrnHe')}\n `\n\n consola.box(message)\n } catch (e) {\n consola.error(e)\n } finally {\n await analytics.shutdown()\n }\n}\n\nprogram.parse()\n", "import fs from 'fs/promises'\nimport path from 'path'\nimport {files} from './files'\n\nexport const runtimes = [\n {\n key: 'bun',\n name: 'Bun.js',\n website: 'https://bunjs.dev',\n supportedFeatures: ['auth', 'pages']\n },\n {\n key: 'node',\n name: 'Node.js',\n website: 'https://nodejs.org',\n supportedFeatures: ['auth', 'pages']\n },\n {\n key: 'cf-workers',\n name: 'Cloudflare Workers',\n website: 'https://workers.cloudflare.com',\n supportedFeatures: ['auth']\n },\n {\n key: 'deno',\n name: 'Deno',\n website: 'https://deno.land'\n }\n]\n\nexport const features = [\n {\n key: 'auth',\n name: 'Authentication',\n website: 'https://pylon.cronit.io/docs/authentication'\n },\n {\n key: 'pages',\n name: 'Pages',\n website: 'https://pylon.cronit.io/docs/pages'\n }\n]\n\nexport type Runtime = (typeof runtimes)[number]['key']\nexport type Feature = (typeof features)[number]['key']\n\ninterface CreateDirectoryOptions {\n variables: Record<string, string>\n destination: string\n runtime: Runtime\n features: Feature[]\n}\n\nconst makeIndexFile = (runtime: Runtime, features: Feature[]) => {\n const pylonImports: string[] = ['app', 'PylonConfig']\n const pylonConfigPlugins: string[] = []\n\n if (features.includes('auth')) {\n pylonImports.push('useAuth')\n pylonConfigPlugins.push(\n \"useAuth({issuer: 'https://test-0o6zvq.zitadel.cloud'})\"\n )\n }\n\n if (features.includes('pages')) {\n pylonImports.push('usePages')\n pylonConfigPlugins.push('usePages()')\n }\n\n let content: string = ''\n\n // Add imports\n content += `import {${pylonImports.join(', ')}} from '@getcronit/pylon'\\n\\n`\n\n if (runtime === 'node') {\n content += `import {serve} from '@hono/node-server'\\n`\n }\n\n content += '\\n\\n'\n\n // Add graphql\n content += `export const graphql = {\n Query: {\n hello: () => {\n return 'Hello, world!'\n }\n },\n Mutation: {}\n}`\n\n content += '\\n\\n'\n\n if (runtime === 'bun' || runtime === 'cf-workers') {\n content += `export default app`\n } else if (runtime === 'node') {\n content += `serve(app, info => {\n console.log(\\`Server running at \\${info.port}\\`)\n})`\n } else if (runtime === 'deno') {\n content += `Deno.serve({port: 3000}, app.fetch)\n`\n }\n\n content += '\\n\\n'\n\n content += `export const config: PylonConfig = {\n plugins: [${pylonConfigPlugins.join(', ')}]\n}`\n\n return content\n}\n\nconst makePylonDefinition = async (runtime: Runtime, features: Feature[]) => {\n let data = `import '@getcronit/pylon'\n\ndeclare module '@getcronit/pylon' {\n interface Bindings {}\n\n interface Variables {}\n}\n\n\n`\n\n if (features.includes('pages')) {\n data += `import {useQuery} from './.pylon/client'\n\ndeclare module '@getcronit/pylon/pages' {\n interface PageData extends ReturnType<typeof useQuery> {}\n}`\n }\n\n return data\n}\n\nconst makeTsConfig = async (runtime: Runtime, features: Feature[]) => {\n const data: any = {\n extends: '@getcronit/pylon/tsconfig.pylon.json',\n include: ['pylon.d.ts', 'src/**/*.ts']\n }\n\n if (runtime === 'cf-workers') {\n data.include.push('worker-configuration.d.ts')\n }\n\n if (features.includes('pages')) {\n data.compilerOptions = {\n baseUrl: '.',\n paths: {\n '@/*': ['./*']\n },\n jsx: 'react-jsx' // support JSX\n }\n\n data.include.push('pages', 'components', '.pylon')\n }\n\n return JSON.stringify(data, null, 2)\n}\n\nconst injectPagesFeatureFiles = async (\n files: {\n path: string\n content: string\n }[]\n) => {\n const pagesFiles = [\n {\n path: 'pages/layout.tsx',\n content: `import '../globals.css'\n\nexport default function RootLayout({children}: {children: React.ReactNode}) {\n return (\n <html lang=\"en\">\n <body>{children}</body>\n </html>\n )\n}\n`\n },\n {\n path: 'pages/page.tsx',\n content: `import { Button } from '@/components/ui/button'\nimport { PageProps } from '@getcronit/pylon/pages'\n\nconst Page: React.FC<PageProps> = props => {\n return (\n <div className=\"container\">\n <title>{props.data.hello}</title>\n <Button>Hello {props.data.hello}</Button>\n </div>\n )\n}\n\nexport default Page\n`\n },\n {\n path: 'globals.css',\n content: `@import 'tailwindcss';\n\n@plugin 'tailwindcss-animate';\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --color-background: hsl(var(--background));\n --color-foreground: hsl(var(--foreground));\n\n --color-card: hsl(var(--card));\n --color-card-foreground: hsl(var(--card-foreground));\n\n --color-popover: hsl(var(--popover));\n --color-popover-foreground: hsl(var(--popover-foreground));\n\n --color-primary: hsl(var(--primary));\n --color-primary-foreground: hsl(var(--primary-foreground));\n\n --color-secondary: hsl(var(--secondary));\n --color-secondary-foreground: hsl(var(--secondary-foreground));\n\n --color-muted: hsl(var(--muted));\n --color-muted-foreground: hsl(var(--muted-foreground));\n\n --color-accent: hsl(var(--accent));\n --color-accent-foreground: hsl(var(--accent-foreground));\n\n --color-destructive: hsl(var(--destructive));\n --color-destructive-foreground: hsl(var(--destructive-foreground));\n\n --color-border: hsl(var(--border));\n --color-input: hsl(var(--input));\n --color-ring: hsl(var(--ring));\n\n --color-chart-1: hsl(var(--chart-1));\n --color-chart-2: hsl(var(--chart-2));\n --color-chart-3: hsl(var(--chart-3));\n --color-chart-4: hsl(var(--chart-4));\n --color-chart-5: hsl(var(--chart-5));\n\n --color-sidebar: hsl(var(--sidebar-background));\n --color-sidebar-foreground: hsl(var(--sidebar-foreground));\n --color-sidebar-primary: hsl(var(--sidebar-primary));\n --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));\n --color-sidebar-accent: hsl(var(--sidebar-accent));\n --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));\n --color-sidebar-border: hsl(var(--sidebar-border));\n --color-sidebar-ring: hsl(var(--sidebar-ring));\n\n --radius-lg: var(--radius);\n --radius-md: calc(var(--radius) - 2px);\n --radius-sm: calc(var(--radius) - 4px);\n\n --animate-accordion-down: accordion-down 0.2s ease-out;\n --animate-accordion-up: accordion-up 0.2s ease-out;\n\n @keyframes accordion-down {\n from {\n height: 0;\n }\n to {\n height: var(--radix-accordion-content-height);\n }\n }\n @keyframes accordion-up {\n from {\n height: var(--radix-accordion-content-height);\n }\n to {\n height: 0;\n }\n }\n}\n\n/*\n The default border color has changed to \\`currentColor\\` in Tailwind CSS v4,\n so we've added these compatibility styles to make sure everything still\n looks the same as it did with Tailwind CSS v3.\n\n If we ever want to remove these styles, we need to add an explicit border\n color utility to any element that depends on these defaults.\n*/\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n border-color: var(--color-gray-200, currentColor);\n }\n}\n\n@layer utilities {\n body {\n font-family: Arial, Helvetica, sans-serif;\n }\n}\n\n@layer base {\n :root {\n --background: 0 0% 100%;\n --foreground: 0 0% 3.9%;\n --card: 0 0% 100%;\n --card-foreground: 0 0% 3.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 0 0% 3.9%;\n --primary: 0 0% 9%;\n --primary-foreground: 0 0% 98%;\n --secondary: 0 0% 96.1%;\n --secondary-foreground: 0 0% 9%;\n --muted: 0 0% 96.1%;\n --muted-foreground: 0 0% 45.1%;\n --accent: 0 0% 96.1%;\n --accent-foreground: 0 0% 9%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 0 0% 98%;\n --border: 0 0% 89.8%;\n --input: 0 0% 89.8%;\n --ring: 0 0% 3.9%;\n --chart-1: 12 76% 61%;\n --chart-2: 173 58% 39%;\n --chart-3: 197 37% 24%;\n --chart-4: 43 74% 66%;\n --chart-5: 27 87% 67%;\n --radius: 0.5rem;\n --sidebar-background: 0 0% 98%;\n --sidebar-foreground: 240 5.3% 26.1%;\n --sidebar-primary: 240 5.9% 10%;\n --sidebar-primary-foreground: 0 0% 98%;\n --sidebar-accent: 240 4.8% 95.9%;\n --sidebar-accent-foreground: 240 5.9% 10%;\n --sidebar-border: 220 13% 91%;\n --sidebar-ring: 217.2 91.2% 59.8%;\n }\n .dark {\n --background: 0 0% 3.9%;\n --foreground: 0 0% 98%;\n --card: 0 0% 3.9%;\n --card-foreground: 0 0% 98%;\n --popover: 0 0% 3.9%;\n --popover-foreground: 0 0% 98%;\n --primary: 0 0% 98%;\n --primary-foreground: 0 0% 9%;\n --secondary: 0 0% 14.9%;\n --secondary-foreground: 0 0% 98%;\n --muted: 0 0% 14.9%;\n --muted-foreground: 0 0% 63.9%;\n --accent: 0 0% 14.9%;\n --accent-foreground: 0 0% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 0 0% 98%;\n --border: 0 0% 14.9%;\n --input: 0 0% 14.9%;\n --ring: 0 0% 83.1%;\n --chart-1: 220 70% 50%;\n --chart-2: 160 60% 45%;\n --chart-3: 30 80% 55%;\n --chart-4: 280 65% 60%;\n --chart-5: 340 75% 55%;\n --sidebar-background: 240 5.9% 10%;\n --sidebar-foreground: 240 4.8% 95.9%;\n --sidebar-primary: 224.3 76.3% 48%;\n --sidebar-primary-foreground: 0 0% 100%;\n --sidebar-accent: 240 3.7% 15.9%;\n --sidebar-accent-foreground: 240 4.8% 95.9%;\n --sidebar-border: 240 3.7% 15.9%;\n --sidebar-ring: 217.2 91.2% 59.8%;\n }\n}\n\n@layer base {\n * {\n @apply border-border;\n }\n body {\n @apply bg-background text-foreground;\n }\n}\n\n/*\n ---break---\n*/\n\n@layer base {\n * {\n @apply border-border outline-ring/50;\n }\n body {\n @apply bg-background text-foreground;\n }\n}\n`\n },\n {\n path: 'postcss.config.js',\n content: `import tailwindPostCss from '@tailwindcss/postcss'\n\nexport default {\n plugins: [tailwindPostCss]\n}\n`\n },\n {\n path: 'components.json',\n content: `{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"new-york\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.js\",\n \"css\": \"globals.css\",\n \"baseColor\": \"zinc\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n },\n \"iconLibrary\": \"lucide\"\n}`\n },\n {\n path: 'lib/utils.ts',\n content: `import {clsx, type ClassValue} from 'clsx'\nimport {twMerge} from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}`\n },\n {\n path: 'components/ui/button.tsx',\n content: `import * as React from 'react'\nimport {Slot} from '@radix-ui/react-slot'\nimport {cva, type VariantProps} from 'class-variance-authority'\n\nimport {cn} from '@/lib/utils'\n\nconst buttonVariants = cva(\n \"inline-flexxx items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 focus-visible:ring-4 focus-visible:outline-1 aria-invalid:focus-visible:ring-0\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',\n destructive:\n 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline'\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9'\n }\n },\n defaultVariants: {\n variant: 'default',\n size: 'default'\n }\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({variant, size, className}))}\n {...props}\n />\n )\n}\n\nexport {Button, buttonVariants}\n`\n }\n ]\n\n files.push(...pagesFiles)\n\n // Overwrite the package.json file and add the necessary dependencies\n\n const packageJsonFile = files.find(file => file.path === 'package.json')\n\n if (packageJsonFile) {\n const packageJson = JSON.parse(packageJsonFile.content)\n\n packageJson.dependencies = {\n ...packageJson.dependencies,\n '@gqty/react': '^3.1.0',\n gqty: '^3.4.0',\n '@radix-ui/react-slot': '^1.1.2',\n 'class-variance-authority': '^0.7.1',\n clsx: '^2.1.1',\n 'lucide-react': '^0.474.0',\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n 'tailwind-merge': '^3.0.1',\n tailwindcss: '^4.0.4',\n 'tailwindcss-animate': '^1.0.7'\n }\n\n packageJson.devDependencies = {\n ...packageJson.devDependencies,\n '@tailwindcss/postcss': '^4.0.6',\n '@types/react': '^19.0.8'\n }\n\n packageJsonFile.content = JSON.stringify(packageJson, null, 2)\n }\n\n return files\n}\n\nconst injectVariablesInContent = (\n content: string,\n variables: Record<string, string>\n) => {\n let result = content\n\n Object.entries(variables).forEach(([key, value]) => {\n result = result.replaceAll(key, value)\n })\n\n return result\n}\n\nexport const createDirectory = async (options: CreateDirectoryOptions) => {\n const {destination, runtime, features} = options\n\n let runtimeFiles = files.ALL.concat(files[runtime] || []).filter(file => {\n if (!file.specificRuntimes) {\n return true\n }\n\n return file.specificRuntimes.includes(runtime)\n })\n\n const indexFile = makeIndexFile(runtime, features)\n const tsConfig = await makeTsConfig(runtime, features)\n const pylonDefinition = await makePylonDefinition(runtime, features)\n\n runtimeFiles.push(\n {\n path: 'tsconfig.json',\n content: tsConfig\n },\n {\n path: 'pylon.d.ts',\n content: pylonDefinition\n },\n {\n path: 'src/index.ts',\n content: indexFile\n }\n )\n\n if (features.includes('pages')) {\n runtimeFiles = await injectPagesFeatureFiles(runtimeFiles)\n }\n\n for (const file of runtimeFiles) {\n const filePath = path.join(destination, file.path)\n\n await fs.mkdir(path.dirname(filePath), {recursive: true})\n await fs.writeFile(\n filePath,\n injectVariablesInContent(file.content, options.variables)\n )\n }\n}\n", "import {Runtime} from '.'\n\nconst pylonVersion = '^2.0.0'\nconst pylonDevVersion = '^1.0.0'\n\nexport const files: {\n [key in Runtime | 'ALL']: {\n path: string\n content: string\n specificRuntimes?: Runtime[]\n }[]\n} = {\n ALL: [\n {\n path: '.gitignore',\n content: `# Logs\n\nlogs\n_.log\nnpm-debug.log_\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\n\nreport.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json\n\n# Runtime data\n\npids\n_.pid\n_.seed\n\\*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\n\nlib-cov\n\n# Coverage directory used by tools like istanbul\n\ncoverage\n\\*.lcov\n\n# nyc test coverage\n\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n\n.grunt\n\n# Bower dependency directory (https://bower.io/)\n\nbower_components\n\n# node-waf configuration\n\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\n\nbuild/Release\n\n# Dependency directories\n\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\n\nweb_modules/\n\n# TypeScript cache\n\n\\*.tsbuildinfo\n\n# Optional npm cache directory\n\n.npm\n\n# Optional eslint cache\n\n.eslintcache\n\n# Optional stylelint cache\n\n.stylelintcache\n\n# Microbundle cache\n\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n\n.node_repl_history\n\n# Output of 'npm pack'\n\n\\*.tgz\n\n# Yarn Integrity file\n\n.yarn-integrity\n\n# dotenv environment variable files\n\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n\n.cache\n.parcel-cache\n\n# Next.js build output\n\n.next\nout\n\n# Nuxt.js build / generate output\n\n.nuxt\ndist\n\n# Gatsby files\n\n.cache/\n\n# Comment in the public line in if your project uses Gatsby and not Next.js\n\n# https://nextjs.org/blog/next-9-1#public-directory-support\n\n# public\n\n# vuepress build output\n\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n\n.temp\n.cache\n\n# Docusaurus cache and generated files\n\n.docusaurus\n\n# Serverless directories\n\n.serverless/\n\n# FuseBox cache\n\n.fusebox/\n\n# DynamoDB Local files\n\n.dynamodb/\n\n# TernJS port file\n\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n\n.vscode-test\n\n# yarn v2\n\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.\\*\n\n# wrangler project\n\n.dev.vars\n.wrangler/\n\n# Pylon project\n.pylon\n`\n },\n {\n path: '.dockerignore',\n content: `node_modules\nDockerfile*\ndocker-compose*\n.dockerignore\n.git\n.gitignore\nREADME.md\nLICENSE\n.vscode\nMakefile\nhelm-charts\n.env\n.editorconfig\n.idea\ncoverage*\n`,\n specificRuntimes: ['node', 'bun']\n },\n {\n path: '.github/workflows/publish.yml',\n content: `name: publish\n\non: [push]\nenv:\n IMAGE_NAME: __PYLON_NAME__\n\njobs:\n # Push image to GitHub Packages.\n # See also https://docs.docker.com/docker-hub/builds/\n publish-container:\n runs-on: ubuntu-latest\n permissions:\n packages: write\n contents: read\n\n steps:\n - uses: actions/checkout@v4\n\n - name: Build image\n run: docker build . --file Dockerfile --tag $IMAGE_NAME\n\n - name: Log into registry\n run: echo \"\\${{ secrets.GITHUB_TOKEN }}\" | docker login ghcr.io -u \\${{ github.actor }} --password-stdin\n\n - name: Push image\n run: |\n IMAGE_ID=ghcr.io/\\${{ github.repository_owner }}/$IMAGE_NAME\n\n # Change all uppercase to lowercase\n IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')\n # Strip git ref prefix from version\n VERSION=$(echo \"\\${{ github.ref }}\" | sed -e 's,.*/\\\\(.*\\\\),\\\\1,')\n # Strip \"v\" prefix from tag name\n [[ \"\\${{ github.ref }}\" == \"refs/tags/\"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')\n # Use Docker \\`latest\\` tag convention\n [ \"$VERSION\" == \"main\" ] && VERSION=latest\n echo IMAGE_ID=$IMAGE_ID\n echo VERSION=$VERSION\n docker tag $IMAGE_NAME $IMAGE_ID:$VERSION\n docker push $IMAGE_ID:$VERSION\n\n# SPDX-License-Identifier: (EUPL-1.2)\n# Copyright \u00A9 2024 cronit KG`,\n specificRuntimes: ['node', 'bun']\n }\n ],\n bun: [\n {\n path: 'package.json',\n content: `{\n \"name\": \"__PYLON_NAME__\",\n \"private\": true,\n \"version\": \"0.0.1\",\n \"type\": \"module\",\n \"description\": \"Generated with \\`npm create pylon\\`\",\n \"scripts\": {\n \"dev\": \"pylon dev -c \\\\\"bun run .pylon/index.js\\\\\"\",\n \"build\": \"pylon build\"\n },\n \"dependencies\": {\n \"@getcronit/pylon\": \"${pylonVersion}\",\n },\n \"devDependencies\": {\n \"@getcronit/pylon-dev\": \"${pylonDevVersion}\",\n \"@types/bun\": \"^1.0.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\"\n },\n \"homepage\": \"https://pylon.cronit.io\",\n \"packageManager\": \"bun\"\n}\n`\n },\n {\n path: 'Dockerfile',\n content: `# use the official Bun image\n# see all versions at https://hub.docker.com/r/oven/bun/tags\nFROM oven/bun:1 as base\n\nLABEL description=\"Offical docker image for Pylon services (Bun)\"\nLABEL org.opencontainers.image.source=\"https://github.com/getcronit/pylon\"\nLABEL maintainer=\"office@cronit.io\"\n\nWORKDIR /usr/src/pylon\n\n\n# install dependencies into temp directory\n# this will cache them and speed up future builds\nFROM base AS install\nRUN mkdir -p /temp/dev\nCOPY package.json bun.lockb /temp/dev/\nRUN cd /temp/dev && bun install --frozen-lockfile\n\n# install with --production (exclude devDependencies)\nRUN mkdir -p /temp/prod\nCOPY package.json bun.lockb /temp/prod/\nRUN cd /temp/prod && bun install --frozen-lockfile --production\n\n# copy node_modules from temp directory\n# then copy all (non-ignored) project files into the image\nFROM install AS prerelease\nCOPY --from=install /temp/dev/node_modules node_modules\nCOPY . .\n\n# [optional] tests & build\nENV NODE_ENV=production\n\n# Create .pylon folder (mkdir)\nRUN mkdir -p .pylon\n# RUN bun test\nRUN bun run pylon build\n\n# copy production dependencies and source code into final image\nFROM base AS release\nCOPY --from=install /temp/prod/node_modules node_modules\nCOPY --from=prerelease /usr/src/pylon/.pylon .pylon\nCOPY --from=prerelease /usr/src/pylon/package.json .\n\n# run the app\nUSER bun\nEXPOSE 3000/tcp\nENTRYPOINT [ \"bun\", \"run\", \"/usr/src/pylon/.pylon/index.js\" ]\n`\n }\n ],\n node: [\n {\n path: 'package.json',\n content: `{\n \"name\": \"__PYLON_NAME__\",\n \"private\": true,\n \"version\": \"0.0.1\",\n \"type\": \"module\",\n \"description\": \"Generated with \\`npm create pylon\\`\",\n \"scripts\": {\n \"dev\": \"pylon dev -c \\\\\"node --enable-source-maps .pylon/index.js\\\\\"\",\n \"build\": \"pylon build\"\n },\n \"dependencies\": {\n \"@getcronit/pylon\": \"${pylonVersion}\",\n \"@hono/node-server\": \"^1.12.2\"\n },\n \"devDependencies\": {\n \"@getcronit/pylon-dev\": \"${pylonDevVersion}\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\"\n },\n \"homepage\": \"https://pylon.cronit.io\"\n}\n`\n },\n {\n path: 'Dockerfile',\n content: `# Use the official Node.js 20 image as the base\nFROM node:20-alpine as base\n\nLABEL description=\"Offical docker image for Pylon services (Node.js)\"\nLABEL org.opencontainers.image.source=\"https://github.com/getcronit/pylon\"\nLABEL maintainer=\"office@cronit.io\"\n\nWORKDIR /usr/src/pylon\n\n# install dependencies into a temp directory\n# this will cache them and speed up future builds\nFROM base AS install\nRUN mkdir -p /temp/dev\nCOPY package.json package-lock.json /temp/dev/\nRUN cd /temp/dev && npm ci\n\n# install with --production (exclude devDependencies)\nRUN mkdir -p /temp/prod\nCOPY package.json package-lock.json /temp/prod/\nRUN cd /temp/prod && npm ci --only=production\n\n# copy node_modules from temp directory\n# then copy all (non-ignored) project files into the image\nFROM install AS prerelease\nCOPY --from=install /temp/dev/node_modules node_modules\nCOPY . .\n\n# [optional] tests & build\nENV NODE_ENV=production\n\n# Create .pylon folder (mkdir)\nRUN mkdir -p .pylon\n# RUN npm test\nRUN npm run pylon build\n\n# copy production dependencies and source code into final image\nFROM base AS release\nCOPY --from=install /temp/prod/node_modules node_modules\nCOPY --from=prerelease /usr/src/pylon/.pylon .pylon\nCOPY --from=prerelease /usr/src/pylon/package.json .\n\n# run the app\nUSER node\nEXPOSE 3000/tcp\nENTRYPOINT [ \"node\", \"/usr/src/pylon/.pylon/index.js\" ]\n`\n }\n ],\n 'cf-workers': [\n {\n path: 'package.json',\n content: `{\n \"name\": \"__PYLON_NAME__\",\n \"type\": \"module\",\n \"description\": \"Generated with \\`npm create pylon\\`\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"scripts\": {\n \"deploy\": \"pylon build && wrangler deploy\",\n \"dev\": \"pylon dev -c \\\\\"wrangler dev\\\\\"\",\n \"cf-typegen\": \"wrangler types\"\n },\n \"dependencies\": {\n \"@getcronit/pylon\": \"${pylonVersion}\",\n },\n \"devDependencies\": {\n \"@getcronit/pylon-dev\": \"${pylonDevVersion}\",\n \"@cloudflare/vitest-pool-workers\": \"^0.4.5\",\n \"@cloudflare/workers-types\": \"^4.20240903.0\",\n \"typescript\": \"^5.5.2\",\n \"wrangler\": \"^3.60.3\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\"\n },\n \"homepage\": \"https://pylon.cronit.io\"\n}\n`\n },\n {\n path: 'wrangler.toml',\n content: `#:schema node_modules/wrangler/config-schema.json\nname = \"__PYLON_NAME__\"\nmain = \".pylon/index.js\"\ncompatibility_date = \"2024-09-03\"\ncompatibility_flags = [\"nodejs_compat_v2\"]\n\n# Automatically place your workloads in an optimal location to minimize latency.\n# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure\n# rather than the end user may result in better performance.\n# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement\n# [placement]\n# mode = \"smart\"\n\n# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)\n# Docs:\n# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables\n# Note: Use secrets to store sensitive data.\n# - https://developers.cloudflare.com/workers/configuration/secrets/\n# [vars]\n# MY_VARIABLE = \"production_value\"\n\n# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare\u2019s global network\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai\n# [ai]\n# binding = \"AI\"\n\n# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets\n# [[analytics_engine_datasets]]\n# binding = \"MY_DATASET\"\n\n# Bind a headless browser instance running on Cloudflare's global network.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering\n# [browser]\n# binding = \"MY_BROWSER\"\n\n# Bind a D1 database. D1 is Cloudflare\u2019s native serverless SQL database.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases\n# [[d1_databases]]\n# binding = \"MY_DB\"\n# database_name = \"my-database\"\n# database_id = \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n\n# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms\n# [[dispatch_namespaces]]\n# binding = \"MY_DISPATCHER\"\n# namespace = \"my-namespace\"\n\n# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.\n# Durable Objects can live for as long as needed. Use these when you need a long-running \"server\", such as in realtime apps.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects\n# [[durable_objects.bindings]]\n# name = \"MY_DURABLE_OBJECT\"\n# class_name = \"MyDurableObject\"\n\n# Durable Object migrations.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations\n# [[migrations]]\n# tag = \"v1\"\n# new_classes = [\"MyDurableObject\"]\n\n# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive\n# [[hyperdrive]]\n# binding = \"MY_HYPERDRIVE\"\n# id = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces\n# [[kv_namespaces]]\n# binding = \"MY_KV_NAMESPACE\"\n# id = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n# Bind an mTLS certificate. Use to present a client certificate when communicating with another service.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates\n# [[mtls_certificates]]\n# binding = \"MY_CERTIFICATE\"\n# certificate_id = \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n\n# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues\n# [[queues.producers]]\n# binding = \"MY_QUEUE\"\n# queue = \"my-queue\"\n\n# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues\n# [[queues.consumers]]\n# queue = \"my-queue\"\n\n# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets\n# [[r2_buckets]]\n# binding = \"MY_BUCKET\"\n# bucket_name = \"my-bucket\"\n\n# Bind another Worker service. Use this binding to call another Worker without network overhead.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings\n# [[services]]\n# binding = \"MY_SERVICE\"\n# service = \"my-service\"\n\n# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases.\n# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes\n# [[vectorize]]\n# binding = \"MY_INDEX\"\n# index_name = \"my-index\"\n`\n }\n ],\n deno: [\n {\n path: '.vscode/settings.json',\n content: `{\n \"deno.enablePaths\": [\n \"./\"\n ],\n \"editor.inlayHints.enabled\": \"off\"\n}`\n },\n {\n path: '.vscode/extensions.json',\n content: `{\n \"recommendations\": [\n \"denoland.vscode-deno\"\n ]\n}`\n },\n {\n path: 'deno.json',\n content: `{\n \"imports\": {\n \"@getcronit/pylon-dev\": \"npm:@getcronit/pylon-dev@${pylonDevVersion}\",\n \"@getcronit/pylon\": \"npm:@getcronit/pylon@${pylonVersion}\"\n },\n \"tasks\": {\n \"dev\": \"pylon dev -c \\\\\"deno run -A .pylon/index.js --config tsconfig.json\\\\\"\",\n \"build\": \"pylon build\"\n },\n \"compilerOptions\": {\n \"jsx\": \"precompile\",\n \"jsxImportSource\": \"hono/jsx\"\n },\n \"nodeModulesDir\": \"auto\",\n \"packageManager\": \"deno\"\n}\n`\n }\n ]\n}\n", "import type {Agent} from 'package-manager-detector'\nimport process from 'node:process'\nimport {detect} from 'package-manager-detector/detect'\nimport consola from 'consola'\n\nexport type {Agent} from 'package-manager-detector'\n\nexport type PackageManager = Agent\n\nexport async function detectPackageManager(\n cwd = process.cwd()\n): Promise<Agent | null> {\n const result = await detect({\n cwd,\n onUnknown(packageManager) {\n consola.warn('Unknown packageManager:', packageManager)\n return undefined\n }\n })\n\n return result?.agent || null\n}\n\ntype PackageManagerScript =\n | 'bun'\n | 'npm run'\n | 'yarn'\n | 'pnpm run'\n | 'deno task'\n\nexport function getRunScript(\n agentSpecifier: PackageManager | null\n): PackageManagerScript | null {\n if (agentSpecifier === null) return null\n\n const [agent] = agentSpecifier.split('@') // Extract agent name before '@'\n\n switch (agent) {\n case 'bun':\n return 'bun'\n case 'npm':\n return 'npm run'\n case 'yarn':\n return 'yarn'\n case 'pnpm':\n return 'pnpm run'\n case 'deno':\n return 'deno task'\n default:\n return null\n }\n}\n", "import {existsSync} from 'node:fs'\nimport {resolve} from 'node:path'\nimport process from 'node:process'\nimport {x} from 'tinyexec'\nimport {detectPackageManager} from './detect'\n\nexport interface InstallPackageOptions {\n cwd?: string\n dev?: boolean\n silent?: boolean\n packageManager?: string\n preferOffline?: boolean\n additionalArgs?:\n | string[]\n | ((agent: string, detectedAgent: string) => string[] | undefined)\n}\n\nexport async function installPackage(\n names: string | string[],\n options: InstallPackageOptions = {}\n) {\n const detectedAgent =\n options.packageManager || (await detectPackageManager(options.cwd)) || 'npm'\n const [agent] = detectedAgent.split('@')\n\n if (!Array.isArray(names)) names = [names]\n\n const args =\n (typeof options.additionalArgs === 'function'\n ? options.additionalArgs(agent, detectedAgent)\n : options.additionalArgs) || []\n\n if (options.preferOffline) {\n // yarn berry uses --cached option instead of --prefer-offline\n if (detectedAgent === 'yarn@berry') args.unshift('--cached')\n else args.unshift('--prefer-offline')\n }\n\n if (\n agent === 'pnpm' &&\n existsSync(resolve(options.cwd ?? process.cwd(), 'pnpm-workspace.yaml'))\n ) {\n args.unshift(\n '-w',\n /**\n * Prevent pnpm from removing installed devDeps while `NODE_ENV` is `production`\n * @see https://pnpm.io/cli/install#--prod--p\n */\n '--prod=false'\n )\n }\n\n return x(\n agent,\n [\n agent === 'yarn' ? 'add' : 'install',\n options.dev ? '-D' : '',\n ...args,\n ...names\n ].filter(Boolean),\n {\n nodeOptions: {\n stdio: options.silent ? 'ignore' : 'inherit',\n cwd: options.cwd\n },\n throwOnError: true\n }\n )\n}\n", "import {PostHog} from 'posthog-node'\nimport Conf from 'conf'\nimport {readFileSync} from 'fs'\nimport {randomUUID} from 'crypto'\n\nconst schema = {\n distinctId: {\n type: 'string',\n default: randomUUID()\n }\n}\n\nconst config = new Conf<{\n distinctId: string\n}>({\n projectName: 'pylon',\n schema\n})\n\nexport const distinctId = config.get('distinctId')\nexport const sessionId = randomUUID()\n\nexport const analytics = new PostHog(\n 'phc_KN4qCOcCdkXp6sHLIuMWGRfzZWuNht69oqv5Kw5rGxj',\n {\n host: 'https://eu.i.posthog.com',\n disabled: process.env.PYLON_DISABLE_TELEMETRY === 'true'\n }\n)\n\nconst getPylonDependencies = () => {\n // Read the package.json file in the current directory\n let packageJson\n\n try {\n packageJson = JSON.parse(readFileSync('./package.json', 'utf8'))\n } catch (error) {\n packageJson = {}\n }\n\n // Extract the dependencies\n const dependencies: object = packageJson.dependencies || {}\n const devDependencies: object = packageJson.devDependencies || {}\n const peerDependencies: object = packageJson.peerDependencies || {}\n\n return {dependencies, devDependencies, peerDependencies}\n}\n\nexport const dependencies = getPylonDependencies()\n\nexport const readPylonConfig = async () => {\n try {\n const config = await import(`${process.cwd()}/.pylon/config.js`)\n const data = config.config\n\n // Sanitize the config values\n const sanitizedData = JSON.parse(JSON.stringify(data)) as object\n\n // Check if the config is a empty object\n if (Object.keys(sanitizedData).length === 0) {\n return false\n }\n\n return sanitizedData\n } catch (error) {\n return false\n }\n}\n", "{\n \"name\": \"create-pylon\",\n \"type\": \"module\",\n \"version\": \"1.1.4-canary-20250327152421.e2dbba1e69d0539f8af5595b5598359c09c97ea9\",\n \"description\": \"CLI for creating a Pylon\",\n \"scripts\": {\n \"build\": \"rimraf ./dist && esbuild ./src/index.ts --bundle --platform=node --target=node18 --format=esm --minify --outdir=./dist --sourcemap=linked --packages=external\"\n },\n \"bin\": \"./dist/index.js\",\n \"files\": [\n \"dist\",\n \"templates\"\n ],\n \"author\": \"Nico Schett <nico.schett@cronit.io>\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/getcronit/pylon.git\",\n \"directory\": \"packages/create-pylon\"\n },\n \"homepage\": \"https://pylon.cronit.io\",\n \"dependencies\": {\n \"chalk\": \"^5.3.0\",\n \"commander\": \"^12.1.0\",\n \"conf\": \"^13.1.0\",\n \"consola\": \"^3.2.3\",\n \"package-manager-detector\": \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AQ,IACjB,SAAUP,EAAQ,SAClB,YAAaD,CACf,CAAC,EAED,IAAMc,EACJb,EAAQ,gBAAmB,MAAMc,EAAqBf,CAAS,GAAM,MAEnEC,EAAQ,UAAY,SACtBA,EAAQ,QAAU,MAAME,EAAQ,OAC9B,+BAA+BW,CAAc,oCAC7C,CACE,KAAM,UACN,QAAS,GACT,OAAQ,QACV,CACF,GAGEb,EAAQ,SACV,MAAMe,EAAe,CAAC,CAAC,EAGzBC,EAAU,QAAQ,CAChB,WAAAC,EACA,MAAO,eACP,WAAY,CACV,QAASV,EAAQ,IACjB,SAAUP,EAAQ,SAClB,eAAAa,EACA,QAASb,EAAQ,OACnB,CACF,CAAC,EAED,IAAMkB,EAAYC,EAAaN,CAAc,EAEvCO,EAAU;AAAA,gBACXV,EAAM,MAAM,KAAK,6BAA6B,CAAC;AAAA;AAAA,gBAE/CA,EAAM,KAAK,KAAK,qBAAqB,CAAC;AAAA,UACrCA,EAAM,OAAO,qBAAqB,CAAC,OAAOA,EAAM,KAAKX,CAAS,CAAC;AAAA,UAC/DW,EAAM,OAAO,mBAAmB,CAAC,IAAIQ,CAAS;AAAA,UAE9CX,EAAQ,MAAQ,aACZ,GAAGG,EAAM,OAAO,SAAS,CAAC,IAAIQ,CAAS,UACvC,EACN;AAAA;AAAA,gBAECR,EAAM,KAAK,KAAK,uBAAuB,CAAC;AAAA,UACvCA,EAAM,UAAU,KAAK,8BAA8B,CAAC;AAAA;AAAA,gBAErDA,EAAM,KAAK,KAAK,oBAAoB,CAAC;AAAA,UACpCA,EAAM,UAAU,KAAK,+BAA+B,CAAC;AAAA,MAG3DR,EAAQ,IAAIkB,CAAO,CACrB,OAASC,EAAG,CACVnB,EAAQ,MAAMmB,CAAC,CACjB,QAAE,CACA,MAAML,EAAU,SAAS,CAC3B,CACF,CAEAxB,EAAQ,MAAM",
|
|
6
|
+
"names": ["chalk", "Option", "program", "consola", "fs", "path", "fs", "path", "pylonVersion", "pylonDevVersion", "files", "runtimes", "features", "makeIndexFile", "runtime", "pylonImports", "pylonConfigPlugins", "content", "makePylonDefinition", "data", "makeTsConfig", "injectPagesFeatureFiles", "files", "pagesFiles", "packageJsonFile", "file", "packageJson", "injectVariablesInContent", "variables", "result", "key", "value", "createDirectory", "options", "destination", "runtimeFiles", "indexFile", "tsConfig", "pylonDefinition", "filePath", "path", "fs", "process", "detect", "consola", "detectPackageManager", "cwd", "packageManager", "getRunScript", "agentSpecifier", "agent", "existsSync", "resolve", "process", "x", "installPackage", "names", "options", "detectedAgent", "detectPackageManager", "agent", "args", "existsSync", "resolve", "process", "x", "PostHog", "Conf", "readFileSync", "randomUUID", "schema", "config", "distinctId", "sessionId", "analytics", "getPylonDependencies", "packageJson", "dependencies", "devDependencies", "peerDependencies", "version", "program", "version", "Option", "runtimes", "key", "features", "main", "targetDir", "options", "command", "consola", "projectName", "path", "answer", "r", "runtime", "f", "feature", "chalk", "error", "createDirectory", "packageManager", "detectPackageManager", "installPackage", "analytics", "distinctId", "runScript", "getRunScript", "message", "e"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pylon",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.4-canary-
|
|
4
|
+
"version": "1.1.4-canary-20250327152421.e2dbba1e69d0539f8af5595b5598359c09c97ea9",
|
|
5
5
|
"description": "CLI for creating a Pylon",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"chalk": "^5.3.0",
|
|
21
21
|
"commander": "^12.1.0",
|
|
22
|
+
"conf": "^13.1.0",
|
|
22
23
|
"consola": "^3.2.3",
|
|
23
24
|
"package-manager-detector": "^0.2.9",
|
|
25
|
+
"posthog-node": "^4.10.1",
|
|
24
26
|
"tinyexec": "^0.3.2"
|
|
25
27
|
},
|
|
26
28
|
"engines": {
|