create-pylon 1.1.4-canary-20250217154612.a741aed487af884255718e875cdf358c6f9f5394 → 1.1.4-canary-20250219185527.acd776d2926f157322ce126c54d166214a549aac
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 +876 -11
- package/dist/index.js.map +4 -4
- package/package.json +3 -4
- package/templates/bun/default/Dockerfile +0 -47
- package/templates/bun/default/package.json +0 -23
- package/templates/bun/default/src/index.ts +0 -12
- package/templates/bun/default/tsconfig.json +0 -8
- package/templates/cf-workers/default/package.json +0 -25
- package/templates/cf-workers/default/src/index.ts +0 -12
- package/templates/cf-workers/default/tsconfig.json +0 -4
- package/templates/cf-workers/default/worker-configuration.d.ts +0 -3
- package/templates/cf-workers/default/wrangler.toml +0 -108
- package/templates/deno/default/.vscode/extensions.json +0 -5
- package/templates/deno/default/.vscode/settings.json +0 -6
- package/templates/deno/default/Dockerfile +0 -12
- package/templates/deno/default/deno.json +0 -15
- package/templates/deno/default/src/index.ts +0 -17
- package/templates/node/default/Dockerfile +0 -45
- package/templates/node/default/package.json +0 -23
- package/templates/node/default/src/index.ts +0 -15
- package/templates/shared/.dockerignore +0 -15
- package/templates/shared/.github/workflows/publish.yaml +0 -43
- package/templates/shared/.gitignore.example +0 -175
- package/templates/shared/pylon.d.ts +0 -7
- package/templates/shared/tsconfig.json +0 -4
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/detect-
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n\nimport {Option, program, type Command} from 'commander'\nimport consola from 'consola'\nimport {input, select, confirm} from '@inquirer/prompts'\nimport path from 'path'\nimport chalk from 'chalk'\nimport * as fs from 'fs'\n\nimport * as telemetry from '@getcronit/pylon-telemetry'\n\nimport {fileURLToPath} from 'url'\nimport {dirname} from 'path'\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\nfunction mkdirp(dir: string) {\n try {\n fs.mkdirSync(dir, {recursive: true})\n } catch (e) {\n if (e instanceof Error) {\n if ('code' in e && e.code === 'EEXIST') return\n }\n throw e\n }\n}\n\nconst runtimes: {\n key: string\n name: string\n website: string\n templates?: string[]\n}[] = [\n {\n key: 'bun',\n name: 'Bun.js',\n website: 'https://bunjs.dev',\n templates: ['default']\n },\n {\n key: 'node',\n name: 'Node.js',\n website: 'https://nodejs.org',\n templates: ['default']\n },\n {\n key: 'cf-workers',\n name: 'Cloudflare Workers',\n website: 'https://workers.cloudflare.com',\n templates: ['default']\n },\n {\n key: 'deno',\n name: 'Deno',\n website: 'https://deno.land',\n templates: ['default']\n }\n]\n\nconst templates: {\n key: string\n name: string\n description: string\n}[] = [\n {\n key: 'default',\n name: 'Default',\n description: 'Default template'\n },\n {\n key: 'database',\n name: 'Database (Prisma)',\n description: 'Template with Prisma ORM'\n }\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}\nconst readdirFilesSyncRecursive = (dir: string): string[] => {\n const run = (dir: string): string[] => {\n const result: string[] = []\n\n const files = fs.readdirSync(dir)\n\n files.forEach(file => {\n const filePath = path.join(dir, file)\n\n if (fs.statSync(filePath).isDirectory()) {\n result.push(...run(filePath))\n }\n\n // Only add files\n if (fs.statSync(filePath).isFile()) {\n result.push(filePath)\n }\n })\n\n return result\n }\n\n return run(dir).map(file => {\n return file.replace(dir, '.')\n })\n}\n\nconst createTemplate = async (options: {\n name: string\n runtime: string\n template: string\n target: string\n}) => {\n const {runtime, template, target} = options\n\n const runtimeName = runtimes.find(({key}) => key === runtime)?.name\n const templateName = templates.find(({key}) => key === template)?.name\n\n if (!runtimeName) {\n throw new Error(`Invalid runtime: ${runtime}`)\n }\n\n if (!templateName) {\n throw new Error(`Invalid template: ${template}`)\n }\n\n // The templates are stored in the `templates` directory\n const sharedTemplateDir = path.join(__dirname, '..', 'templates', 'shared')\n\n if (!fs.existsSync(sharedTemplateDir)) {\n throw new Error(`Shared templates not found: ${sharedTemplateDir}`)\n }\n\n const templateDir = path.join(__dirname, '..', 'templates', runtime, template)\n\n if (!fs.existsSync(templateDir)) {\n throw new Error(`Template not found: ${templateDir}`)\n }\n\n // The target directory is already created\n const targetDirectoryPath = path.join(process.cwd(), target)\n\n consola.start(`Creating pylon in ${targetDirectoryPath}`)\n\n const inject = (content: string) => {\n return injectVariablesInContent(content, {\n __PYLON_NAME__: options.name\n })\n }\n\n // Copy the shared template files\n readdirFilesSyncRecursive(sharedTemplateDir).forEach(file => {\n const source = path.join(sharedTemplateDir, file)\n let target = path.join(targetDirectoryPath, file)\n\n // Create folder recursively and copy file\n\n const targetDir = path.dirname(target)\n\n // Skip the .github/workflows directory for cf-workers runtime\n if (\n runtime === 'cf-workers' &&\n source.includes('.github/workflows/publish.yaml')\n ) {\n return\n }\n\n if (!fs.existsSync(targetDir)) {\n fs.mkdirSync(targetDir, {recursive: true})\n }\n\n // If the target ends with `.example`, remove the suffix.\n // This is useful for `.gitignore.example` files because they are not published in\n // the `create-pylon` package when named `.gitignore`.\n if (target.endsWith('.example')) {\n target = target.replace('.example', '')\n }\n\n const injectedContent = inject(fs.readFileSync(source, 'utf-8'))\n\n fs.writeFileSync(target, injectedContent)\n })\n\n // Copy the runtime specific template files\n readdirFilesSyncRecursive(templateDir).forEach(file => {\n const source = path.join(templateDir, file)\n let target = path.join(targetDirectoryPath, file)\n\n // Create folder recursively and copy file\n const targetDir = path.dirname(target)\n\n if (!fs.existsSync(targetDir)) {\n fs.mkdirSync(targetDir, {recursive: true})\n }\n\n // If the target ends with `.example`, remove the suffix.\n // This is useful for `.gitignore.example` files because they are not published in\n // the `create-pylon` package when named `.gitignore`.\n if (target.endsWith('.example')) {\n target = target.replace('.example', '')\n }\n\n const injectedContent = inject(fs.readFileSync(source, 'utf-8'))\n\n fs.writeFileSync(target, injectedContent)\n })\n\n consola.success(`Pylon created`)\n}\n\nimport {spawnSync} from 'child_process'\nimport {detectPackageManager, getRunScript, PackageManager} from './detect-pm'\n\nconst installDependencies = async (args: {\n target: string\n packageManager: PackageManager\n}) => {\n const target = path.resolve(args.target)\n const packageManager = args.packageManager\n\n let command = ''\n\n switch (packageManager) {\n case 'yarn':\n command = 'yarn'\n break\n case 'npm':\n command = 'npm install'\n break\n case 'pnpm':\n command = 'pnpm install'\n break\n case 'bun':\n command = 'bun install'\n break\n case 'deno':\n command = 'deno install'\n break\n default:\n throw new Error(`Invalid package manager: ${packageManager}`)\n }\n\n consola.start(`Installing dependencies using ${packageManager}`)\n\n const proc = spawnSync(command, {\n cwd: target,\n shell: true,\n stdio: 'inherit'\n })\n\n if (proc.status !== 0) {\n throw new Error(`Failed to install dependencies`)\n }\n\n consola.success(`Dependencies installed`)\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(new Option('-t, --template <template>', 'Template'))\n .addOption(\n new Option('-pm, --package-manager <packageManager>', 'Package manager')\n )\n .addOption(\n new Option(\n '--client',\n 'Enable client generation (https://pylon.cronit.io/docs/integrations/gqty)'\n )\n )\n .addOption(new Option('--client-path <clientPath>', 'Client path'))\n .addOption(new Option('--client-port <clientPort>', 'Client port'))\n .action(main)\n\ntype ArgOptions = {\n install: boolean\n runtime: string\n template: string\n packageManager?: PackageManager\n client?: boolean\n clientPath?: string\n clientPort?: string\n}\n\nconst getPreferredPmByRuntime = (\n runtime: string\n): PackageManager | undefined => {\n if (runtime === 'bun') {\n return 'bun'\n } else if (runtime === 'deno') {\n return 'deno'\n }\n}\n\nasync function main(\n targetDir: string | undefined,\n options: ArgOptions,\n command: Command\n) {\n try {\n consola.log(`${command.name()} version ${command.version()}`)\n\n const {\n install: installArg,\n runtime: runtimeArg,\n template: templateArg,\n packageManager: packageManagerArg,\n client: clientArg,\n clientPath: clientPathArg,\n clientPort: clientPortArg\n } = options\n\n let target = ''\n\n if (targetDir) {\n target = targetDir\n\n consola.success(`Using target directory \u2026 ${target}`)\n } else {\n const answer = await input({\n message: 'Target directory',\n default: 'my-pylon'\n })\n target = answer\n }\n\n let projectName = ''\n\n if (target === '.') {\n projectName = path.basename(process.cwd())\n } else {\n projectName = path.basename(target)\n }\n\n const runtimeName =\n runtimeArg ||\n (await select({\n message: 'Which runtime would you like to use?',\n choices: runtimes.map(runtime => ({\n name: `${runtime.name} (${runtime.website})`,\n value: runtime.key\n })),\n default: 0\n }))\n\n if (!runtimeName) {\n throw new Error('No runtime selected')\n }\n\n const runtime = runtimes.find(({key}) => key === runtimeName)\n\n if (!runtime) {\n throw new Error(`Invalid runtime selected: ${runtimeName}`)\n }\n\n const templateName =\n templateArg ||\n (await select({\n message: 'Which template would you like to use?',\n choices: templates\n .filter(template => runtime.templates?.includes(template.key))\n .map(template => ({\n name: template.name,\n value: template.key\n })),\n default: 0\n }))\n\n if (!templateName) {\n throw new Error('No template selected')\n }\n\n if (fs.existsSync(target)) {\n if (fs.readdirSync(target).length > 0) {\n const response = await confirm({\n message: 'Directory not empty. Continue?',\n default: false\n })\n if (!response) {\n process.exit(1)\n }\n }\n } else {\n mkdirp(target)\n }\n\n const install =\n installArg ||\n (await confirm({message: 'Would you like to install dependencies?'}))\n\n await createTemplate({\n name: projectName,\n runtime: runtimeName,\n template: templateName,\n target\n })\n\n const packageManager = detectPackageManager({\n preferredPm: getPreferredPmByRuntime(runtime.key),\n cwd: target\n })\n\n if (install) {\n await installDependencies({target, packageManager})\n }\n\n const client =\n clientArg ||\n (await confirm({\n message:\n 'Would you like to enable client generation? (https://pylon.cronit.io/docs/integrations/gqty)',\n default: false\n }))\n\n let clientRoot: string = ''\n let clientPath: string = ''\n let clientPort: string = ''\n\n if (client) {\n if (!clientPathArg) {\n clientRoot = await input({\n message: 'Path to the root where the client should be generated',\n default: '.'\n })\n\n clientPath = await input({\n message: 'Path to generate the client to',\n default: path.join(clientRoot, 'gqty/index.ts'),\n validate: value => {\n // Check if the path starts with the client root (take care of .)\n if (!value.startsWith(clientRoot === '.' ? '' : clientRoot)) {\n return 'Path must start with the client root'\n }\n\n return true\n }\n })\n }\n\n clientPort =\n clientPortArg ||\n (await input({\n message: 'Port of the pylon server to generate the client from',\n default: '3000'\n }))\n\n consola.start(`Updating pylon dev script to generate client`)\n\n let packagePath: string\n let scriptKey: string\n if (runtime.key === 'deno') {\n packagePath = path.join(target, 'deno.json')\n scriptKey = 'tasks'\n } else {\n packagePath = path.join(target, 'package.json')\n scriptKey = 'scripts'\n }\n\n const devScript = JSON.parse(fs.readFileSync(packagePath, 'utf-8'))\n\n devScript[scriptKey] = {\n ...devScript[scriptKey],\n dev:\n devScript[scriptKey].dev +\n ` --client --client-port ${clientPort} --client-path ${clientPath}`\n }\n\n fs.writeFileSync(packagePath, JSON.stringify(devScript, null, 2))\n\n consola.success(`Pylon dev script updated`)\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(target)}\n ${chalk.yellow('Start dev server:')} ${runScript} dev\n ${chalk.yellow('Deploy:')} ${runScript} deploy\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 await telemetry.sendCreateEvent({\n name: projectName,\n pylonCreateVersion: version,\n runtime: runtimeName,\n template: templateName,\n clientPath: clientPath || undefined,\n clientPort: parseInt(clientPort) || undefined\n })\n\n consola.box(message)\n } catch (e) {\n consola.error(e)\n }\n}\n\nprogram.parse()\n", "import * as fs from 'node:fs'\nimport * as path from 'node:path'\nimport process from 'node:process'\nimport {execSync} from 'node:child_process'\nimport consola from 'consola'\n\n// Helper function to check if a command exists\nfunction isCommandAvailable(command: string): boolean {\n try {\n execSync(`${command} --version`, {stdio: 'ignore'})\n return true\n } catch (e) {\n console.error(e)\n return false\n }\n}\n\n// Detect Bun\nfunction isBun(): boolean {\n // @ts-ignore: Bun may not be defined\n return typeof Bun !== 'undefined' && isCommandAvailable('bun')\n}\n\n// Detect npm\nfunction isNpm(): boolean {\n return process.env.npm_execpath?.includes('npm') ?? false\n}\n\n// Detect Yarn\nfunction isYarn(): boolean {\n return process.env.npm_execpath?.includes('yarn') ?? false\n}\n\n// Detect Deno\nfunction isDeno(): boolean {\n // @ts-ignore: Deno may not be defined\n return typeof Deno !== 'undefined' && isCommandAvailable('deno')\n}\n\n// Detect pnpm\nfunction isPnpm(): boolean {\n return process.env.npm_execpath?.includes('pnpm') ?? false\n}\n\n// Detect based on lock files\nfunction detectByLockFiles(cwd: string): PackageManager | null {\n if (fs.existsSync(path.join(cwd, 'bun.lockb'))) {\n return 'bun'\n }\n if (fs.existsSync(path.join(cwd, 'package-lock.json'))) {\n return 'npm'\n }\n if (fs.existsSync(path.join(cwd, 'yarn.lock'))) {\n return 'yarn'\n }\n if (\n fs.existsSync(path.join(cwd, 'deno.json')) ||\n fs.existsSync(path.join(cwd, 'deno.lock'))\n ) {\n return 'deno'\n }\n if (fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))) {\n return 'pnpm'\n }\n return null\n}\n\nexport type PackageManager =\n | 'bun'\n | 'npm'\n | 'yarn'\n | 'pnpm'\n | 'deno'\n | 'unknown'\n\n// Main detection function\nexport function detectPackageManager({\n preferredPm,\n cwd = process.cwd()\n}: {\n preferredPm?: PackageManager\n cwd?: string\n}): PackageManager {\n // Check the preferred package manager first\n if (preferredPm && isCommandAvailable(preferredPm)) {\n return preferredPm\n }\n\n // Proceed with detection logic\n if (isBun()) {\n return 'bun'\n }\n if (isNpm()) {\n return 'npm'\n }\n if (isPnpm()) {\n return 'pnpm'\n }\n if (isDeno()) {\n return 'deno'\n }\n if (isYarn()) {\n return 'yarn'\n }\n\n // Fallback to lock file detection\n const lockFileDetection = detectByLockFiles(cwd)\n if (lockFileDetection) {\n consola.info(`Detected package manager by lock file: ${lockFileDetection}`)\n if (isCommandAvailable(lockFileDetection)) {\n return lockFileDetection\n } else {\n consola.warn(\n `Lock file detected, but ${lockFileDetection} is not installed.`\n )\n }\n }\n\n return 'unknown'\n}\n\ntype PackageManagerScript =\n | 'bun'\n | 'npm run'\n | 'yarn'\n | 'pnpm run'\n | 'deno task'\n\n// Run script detection\nexport function getRunScript(pm: PackageManager): PackageManagerScript {\n switch (pm) {\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 // Default to npm run if unknown\n return 'npm run'\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAEA,OAAQ,UAAAA,EAAQ,WAAAC,MAA4B,YAC5C,OAAOC,MAAa,UACpB,OAAQ,SAAAC,EAAO,UAAAC,EAAQ,WAAAC,MAAc,oBACrC,OAAOC,MAAU,OACjB,OAAOC,MAAW,QAClB,UAAYC,MAAQ,KAEpB,UAAYC,MAAe,6BAE3B,OAAQ,iBAAAC,OAAoB,MAC5B,OAAQ,WAAAC,OAAc,OAqNtB,OAAQ,aAAAC,OAAgB,gBCjOxB,UAAYC,MAAQ,UACpB,UAAYC,MAAU,YACtB,OAAOC,MAAa,eACpB,OAAQ,YAAAC,MAAe,qBACvB,OAAOC,MAAa,UAGpB,SAASC,EAAmBC,EAA0B,CACpD,GAAI,CACF,OAAAH,EAAS,GAAGG,CAAO,aAAc,CAAC,MAAO,QAAQ,CAAC,EA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AAU,KAAK,+BAA+B,CAAC;AAAA,EAGvD,MAAgB,kBAAgB,CAC9B,KAAMf,EACN,mBAAoBjD,EACpB,QAASsB,EACT,SAAUC,EACV,WAAYiC,GAAc,OAC1B,WAAY,SAASC,CAAU,GAAK,MACtC,CAAC,EAED9B,EAAQ,IAAIoC,CAAO,CACrB,OAAS3D,EAAG,CACVuB,EAAQ,MAAMvB,CAAC,CACjB,CACF,CAEAiC,EAAQ,MAAM",
|
|
6
|
-
"names": ["
|
|
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))\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;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;AA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,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", "dirname", "fileURLToPath", "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", "__filename", "fileURLToPath", "__dirname", "dirname", "version", "path", "program", "Option", "runtimes", "key", "features", "main", "targetDir", "options", "command", "consola", "projectName", "answer", "r", "runtime", "f", "feature", "chalk", "error", "createDirectory", "packageManager", "detectPackageManager", "installPackage", "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-20250219185527.acd776d2926f157322ce126c54d166214a549aac",
|
|
5
5
|
"description": "CLI for creating a Pylon",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -17,12 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://pylon.cronit.io",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@inquirer/prompts": "^5.4.0",
|
|
21
20
|
"chalk": "^5.3.0",
|
|
22
21
|
"commander": "^12.1.0",
|
|
23
22
|
"consola": "^3.2.3",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
23
|
+
"package-manager-detector": "^0.2.9",
|
|
24
|
+
"tinyexec": "^0.3.2"
|
|
26
25
|
},
|
|
27
26
|
"engines": {
|
|
28
27
|
"node": ">=18.0.0"
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# use the official Bun image
|
|
2
|
-
# see all versions at https://hub.docker.com/r/oven/bun/tags
|
|
3
|
-
FROM oven/bun:1 as base
|
|
4
|
-
|
|
5
|
-
LABEL description="Offical docker image for Pylon services (Bun)"
|
|
6
|
-
LABEL org.opencontainers.image.source="https://github.com/getcronit/pylon"
|
|
7
|
-
LABEL maintainer="office@cronit.io"
|
|
8
|
-
|
|
9
|
-
WORKDIR /usr/src/pylon
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# install dependencies into temp directory
|
|
13
|
-
# this will cache them and speed up future builds
|
|
14
|
-
FROM base AS install
|
|
15
|
-
RUN mkdir -p /temp/dev
|
|
16
|
-
COPY package.json bun.lockb /temp/dev/
|
|
17
|
-
RUN cd /temp/dev && bun install --frozen-lockfile
|
|
18
|
-
|
|
19
|
-
# install with --production (exclude devDependencies)
|
|
20
|
-
RUN mkdir -p /temp/prod
|
|
21
|
-
COPY package.json bun.lockb /temp/prod/
|
|
22
|
-
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
|
23
|
-
|
|
24
|
-
# copy node_modules from temp directory
|
|
25
|
-
# then copy all (non-ignored) project files into the image
|
|
26
|
-
FROM install AS prerelease
|
|
27
|
-
COPY --from=install /temp/dev/node_modules node_modules
|
|
28
|
-
COPY . .
|
|
29
|
-
|
|
30
|
-
# [optional] tests & build
|
|
31
|
-
ENV NODE_ENV=production
|
|
32
|
-
|
|
33
|
-
# Create .pylon folder (mkdir)
|
|
34
|
-
RUN mkdir -p .pylon
|
|
35
|
-
# RUN bun test
|
|
36
|
-
RUN bun run pylon build
|
|
37
|
-
|
|
38
|
-
# copy production dependencies and source code into final image
|
|
39
|
-
FROM base AS release
|
|
40
|
-
COPY --from=install /temp/prod/node_modules node_modules
|
|
41
|
-
COPY --from=prerelease /usr/src/pylon/.pylon .pylon
|
|
42
|
-
COPY --from=prerelease /usr/src/pylon/package.json .
|
|
43
|
-
|
|
44
|
-
# run the app
|
|
45
|
-
USER bun
|
|
46
|
-
EXPOSE 3000/tcp
|
|
47
|
-
ENTRYPOINT [ "bun", "run", "/usr/src/pylon/.pylon/index.js" ]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "__PYLON_NAME__",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Generated with `npm create pylon`",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"dev": "pylon dev -c \"bun run .pylon/index.js\"",
|
|
9
|
-
"build": "pylon build"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@getcronit/pylon": "^2.0.0",
|
|
13
|
-
"bun-types": "^1.1.18"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@getcronit/pylon-dev": "^1.0.0"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "https://github.com/getcronit/pylon.git"
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://pylon.cronit.io"
|
|
23
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "__PYLON_NAME__",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"deploy": "pylon build && wrangler deploy",
|
|
7
|
-
"dev": "pylon dev -c \"wrangler dev\"",
|
|
8
|
-
"cf-typegen": "wrangler types"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"@getcronit/pylon": "^2.0.0"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@getcronit/pylon-dev": "^1.0.0",
|
|
15
|
-
"@cloudflare/vitest-pool-workers": "^0.4.5",
|
|
16
|
-
"@cloudflare/workers-types": "^4.20240903.0",
|
|
17
|
-
"typescript": "^5.5.2",
|
|
18
|
-
"wrangler": "^3.60.3"
|
|
19
|
-
},
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/getcronit/pylon.git"
|
|
23
|
-
},
|
|
24
|
-
"homepage": "https://pylon.cronit.io"
|
|
25
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#:schema node_modules/wrangler/config-schema.json
|
|
2
|
-
name = "__PYLON_NAME__"
|
|
3
|
-
main = ".pylon/index.js"
|
|
4
|
-
compatibility_date = "2024-09-03"
|
|
5
|
-
compatibility_flags = ["nodejs_compat_v2"]
|
|
6
|
-
|
|
7
|
-
# Automatically place your workloads in an optimal location to minimize latency.
|
|
8
|
-
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
|
|
9
|
-
# rather than the end user may result in better performance.
|
|
10
|
-
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
|
|
11
|
-
# [placement]
|
|
12
|
-
# mode = "smart"
|
|
13
|
-
|
|
14
|
-
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
|
|
15
|
-
# Docs:
|
|
16
|
-
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
17
|
-
# Note: Use secrets to store sensitive data.
|
|
18
|
-
# - https://developers.cloudflare.com/workers/configuration/secrets/
|
|
19
|
-
# [vars]
|
|
20
|
-
# MY_VARIABLE = "production_value"
|
|
21
|
-
|
|
22
|
-
# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network
|
|
23
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
24
|
-
# [ai]
|
|
25
|
-
# binding = "AI"
|
|
26
|
-
|
|
27
|
-
# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function.
|
|
28
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
29
|
-
# [[analytics_engine_datasets]]
|
|
30
|
-
# binding = "MY_DATASET"
|
|
31
|
-
|
|
32
|
-
# Bind a headless browser instance running on Cloudflare's global network.
|
|
33
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
34
|
-
# [browser]
|
|
35
|
-
# binding = "MY_BROWSER"
|
|
36
|
-
|
|
37
|
-
# Bind a D1 database. D1 is Cloudflare’s native serverless SQL database.
|
|
38
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
39
|
-
# [[d1_databases]]
|
|
40
|
-
# binding = "MY_DB"
|
|
41
|
-
# database_name = "my-database"
|
|
42
|
-
# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
43
|
-
|
|
44
|
-
# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers.
|
|
45
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
46
|
-
# [[dispatch_namespaces]]
|
|
47
|
-
# binding = "MY_DISPATCHER"
|
|
48
|
-
# namespace = "my-namespace"
|
|
49
|
-
|
|
50
|
-
# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
|
|
51
|
-
# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
|
|
52
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
53
|
-
# [[durable_objects.bindings]]
|
|
54
|
-
# name = "MY_DURABLE_OBJECT"
|
|
55
|
-
# class_name = "MyDurableObject"
|
|
56
|
-
|
|
57
|
-
# Durable Object migrations.
|
|
58
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations
|
|
59
|
-
# [[migrations]]
|
|
60
|
-
# tag = "v1"
|
|
61
|
-
# new_classes = ["MyDurableObject"]
|
|
62
|
-
|
|
63
|
-
# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers.
|
|
64
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
65
|
-
# [[hyperdrive]]
|
|
66
|
-
# binding = "MY_HYPERDRIVE"
|
|
67
|
-
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
68
|
-
|
|
69
|
-
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.
|
|
70
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
71
|
-
# [[kv_namespaces]]
|
|
72
|
-
# binding = "MY_KV_NAMESPACE"
|
|
73
|
-
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
74
|
-
|
|
75
|
-
# Bind an mTLS certificate. Use to present a client certificate when communicating with another service.
|
|
76
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
77
|
-
# [[mtls_certificates]]
|
|
78
|
-
# binding = "MY_CERTIFICATE"
|
|
79
|
-
# certificate_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
80
|
-
|
|
81
|
-
# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.
|
|
82
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
83
|
-
# [[queues.producers]]
|
|
84
|
-
# binding = "MY_QUEUE"
|
|
85
|
-
# queue = "my-queue"
|
|
86
|
-
|
|
87
|
-
# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.
|
|
88
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
89
|
-
# [[queues.consumers]]
|
|
90
|
-
# queue = "my-queue"
|
|
91
|
-
|
|
92
|
-
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.
|
|
93
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
94
|
-
# [[r2_buckets]]
|
|
95
|
-
# binding = "MY_BUCKET"
|
|
96
|
-
# bucket_name = "my-bucket"
|
|
97
|
-
|
|
98
|
-
# Bind another Worker service. Use this binding to call another Worker without network overhead.
|
|
99
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
100
|
-
# [[services]]
|
|
101
|
-
# binding = "MY_SERVICE"
|
|
102
|
-
# service = "my-service"
|
|
103
|
-
|
|
104
|
-
# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases.
|
|
105
|
-
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
106
|
-
# [[vectorize]]
|
|
107
|
-
# binding = "MY_INDEX"
|
|
108
|
-
# index_name = "my-index"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"imports": {
|
|
3
|
-
"@getcronit/pylon-dev": "npm:@getcronit/pylon-dev@^1.0.1",
|
|
4
|
-
"@getcronit/pylon": "npm:@getcronit/pylon@^2.2.1"
|
|
5
|
-
},
|
|
6
|
-
"tasks": {
|
|
7
|
-
"dev": "pylon dev -c 'deno run -A .pylon/index.js --config tsconfig.json'",
|
|
8
|
-
"build": "pylon build"
|
|
9
|
-
},
|
|
10
|
-
"compilerOptions": {
|
|
11
|
-
"jsx": "precompile",
|
|
12
|
-
"jsxImportSource": "hono/jsx"
|
|
13
|
-
},
|
|
14
|
-
"nodeModulesDir": "auto"
|
|
15
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Use the official Node.js 20 image as the base
|
|
2
|
-
FROM node:20-alpine as base
|
|
3
|
-
|
|
4
|
-
LABEL description="Offical docker image for Pylon services (Node.js)"
|
|
5
|
-
LABEL org.opencontainers.image.source="https://github.com/getcronit/pylon"
|
|
6
|
-
LABEL maintainer="office@cronit.io"
|
|
7
|
-
|
|
8
|
-
WORKDIR /usr/src/pylon
|
|
9
|
-
|
|
10
|
-
# install dependencies into a temp directory
|
|
11
|
-
# this will cache them and speed up future builds
|
|
12
|
-
FROM base AS install
|
|
13
|
-
RUN mkdir -p /temp/dev
|
|
14
|
-
COPY package.json package-lock.json /temp/dev/
|
|
15
|
-
RUN cd /temp/dev && npm ci
|
|
16
|
-
|
|
17
|
-
# install with --production (exclude devDependencies)
|
|
18
|
-
RUN mkdir -p /temp/prod
|
|
19
|
-
COPY package.json package-lock.json /temp/prod/
|
|
20
|
-
RUN cd /temp/prod && npm ci --only=production
|
|
21
|
-
|
|
22
|
-
# copy node_modules from temp directory
|
|
23
|
-
# then copy all (non-ignored) project files into the image
|
|
24
|
-
FROM install AS prerelease
|
|
25
|
-
COPY --from=install /temp/dev/node_modules node_modules
|
|
26
|
-
COPY . .
|
|
27
|
-
|
|
28
|
-
# [optional] tests & build
|
|
29
|
-
ENV NODE_ENV=production
|
|
30
|
-
|
|
31
|
-
# Create .pylon folder (mkdir)
|
|
32
|
-
RUN mkdir -p .pylon
|
|
33
|
-
# RUN npm test
|
|
34
|
-
RUN npm run pylon build
|
|
35
|
-
|
|
36
|
-
# copy production dependencies and source code into final image
|
|
37
|
-
FROM base AS release
|
|
38
|
-
COPY --from=install /temp/prod/node_modules node_modules
|
|
39
|
-
COPY --from=prerelease /usr/src/pylon/.pylon .pylon
|
|
40
|
-
COPY --from=prerelease /usr/src/pylon/package.json .
|
|
41
|
-
|
|
42
|
-
# run the app
|
|
43
|
-
USER node
|
|
44
|
-
EXPOSE 3000/tcp
|
|
45
|
-
ENTRYPOINT [ "node", "/usr/src/pylon/.pylon/index.js" ]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "__PYLON_NAME__",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Generated with `npm create pylon`",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"dev": "pylon dev -c \"node --enable-source-maps .pylon/index.js\"",
|
|
9
|
-
"build": "pylon build"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@getcronit/pylon": "^2.0.0",
|
|
13
|
-
"@hono/node-server": "^1.12.2"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@getcronit/pylon-dev": "^1.0.0"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "https://github.com/getcronit/pylon.git"
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://pylon.cronit.io"
|
|
23
|
-
}
|