@editframe/create 0.46.2 → 0.46.4

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.d.ts CHANGED
@@ -1 +1,19 @@
1
- export { };
1
+ #!/usr/bin/env node
2
+ import { PackageManager } from "./utils.js";
3
+
4
+ //#region src/index.d.ts
5
+ interface SuccessOutputOptions {
6
+ directoryName: string;
7
+ pkgManager: PackageManager;
8
+ depsInstalled: boolean;
9
+ skillsInstalled: boolean;
10
+ }
11
+ declare function buildSuccessOutput({
12
+ directoryName,
13
+ pkgManager,
14
+ depsInstalled,
15
+ skillsInstalled
16
+ }: SuccessOutputOptions): string;
17
+ //#endregion
18
+ export { buildSuccessOutput };
19
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -8,6 +8,20 @@ import chalk from "chalk";
8
8
  import prompts from "prompts";
9
9
 
10
10
  //#region src/index.ts
11
+ function buildSuccessOutput({ directoryName, pkgManager, depsInstalled, skillsInstalled }) {
12
+ let output = "";
13
+ output += chalk.green.bold(`\n✓ ${directoryName} created\n`);
14
+ output += `\n ${chalk.cyan(`cd ${directoryName}`)}\n`;
15
+ if (!depsInstalled) output += ` ${chalk.cyan(`${pkgManager} install`)}\n`;
16
+ output += ` ${chalk.cyan(getStartCommand(pkgManager))}\n`;
17
+ if (skillsInstalled) {
18
+ output += chalk.bold("\nThen prompt Cursor, Claude, or your AI agent with Editframe Skills\n");
19
+ output += chalk.dim(" • editframe-composition • editframe-motion-design • editframe-brand-video-generator\n");
20
+ output += chalk.dim(" • editframe-editor-gui • editframe-vite-plugin • editframe-webhooks\n");
21
+ }
22
+ output += `\n${chalk.dim("editframe.com/docs")}\n\n`;
23
+ return output;
24
+ }
11
25
  function showHelp(templates) {
12
26
  const usage = `
13
27
  ${chalk.bold("Usage:")}
@@ -146,32 +160,15 @@ async function main() {
146
160
  let skillsInstalled = false;
147
161
  if (!skipInstall) depsInstalled = await installDependencies(targetDir);
148
162
  if (installSkills) skillsInstalled = await installAgentSkills(targetDir);
149
- process.stderr.write(chalk.green.bold("\n✓ Project created successfully!\n"));
150
- if (depsInstalled) process.stderr.write(chalk.green("✓ Dependencies installed\n"));
151
- if (skillsInstalled) process.stderr.write(chalk.green("✓ AI agent skills installed\n"));
152
- process.stderr.write(chalk.bold("\nYour project is ready! 🎉\n\n"));
153
- process.stderr.write(chalk.bold("Next steps:\n"));
154
- process.stderr.write(chalk.cyan(` cd ${directoryName}\n`));
155
- if (!depsInstalled) process.stderr.write(chalk.cyan(` ${pkgManager} install\n`));
156
- process.stderr.write(chalk.cyan(` ${getStartCommand(pkgManager)}\n`));
157
- if (skillsInstalled) {
158
- process.stderr.write(chalk.bold("\nAI Agent Skills installed:\n"));
159
- process.stderr.write(chalk.dim(" • editframe-composition\n"));
160
- process.stderr.write(chalk.dim(" • editframe-motion-design\n"));
161
- process.stderr.write(chalk.dim(" • editframe-brand-video-generator\n"));
162
- process.stderr.write(chalk.dim(" • editframe-editor-gui\n"));
163
- process.stderr.write(chalk.dim(" • editframe-vite-plugin\n"));
164
- process.stderr.write(chalk.dim(" • editframe-webhooks\n"));
165
- process.stderr.write(chalk.bold("\nTry asking your AI agent:\n"));
166
- process.stderr.write(chalk.dim(" \"Create a 5-second video with fade-in text\"\n"));
167
- process.stderr.write(chalk.dim(" \"Add a waveform visualization\"\n"));
168
- process.stderr.write(chalk.dim(" \"Animate this element with spring physics\"\n"));
169
- }
170
- process.stderr.write(chalk.dim("\nDocumentation: https://editframe.com/docs\n"));
171
- process.stderr.write(chalk.dim("Happy coding! 🎬\n\n"));
163
+ process.stderr.write(buildSuccessOutput({
164
+ directoryName,
165
+ pkgManager,
166
+ depsInstalled,
167
+ skillsInstalled
168
+ }));
172
169
  }
173
170
  main();
174
171
 
175
172
  //#endregion
176
- export { };
173
+ export { buildSuccessOutput };
177
174
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["path","promptQuestions: prompts.PromptObject[]"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { access, cp, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { parseArgs } from \"node:util\";\nimport chalk from \"chalk\";\nimport prompts from \"prompts\";\nimport {\n getUserPkgManager,\n installDependencies,\n installAgentSkills,\n getStartCommand,\n} from \"./utils.js\";\n\nfunction showHelp(templates: string[]) {\n const usage = `\n${chalk.bold(\"Usage:\")}\n npm create @editframe -- [template] [options]\n\n${chalk.bold(\"Options:\")}\n -d, --directory <name> Project directory name\n --skip-install Skip dependency installation\n --skip-skills Skip agent skills installation\n -y, --yes Skip all prompts, use defaults\n -h, --help Show this help message\n\n${chalk.bold(\"Available Templates:\")}\n${templates.map((t) => ` - ${t}`).join(\"\\n\")}\n\n${chalk.bold(\"Examples:\")}\n ${chalk.dim(\"# Interactive mode (recommended)\")}\n npm create @editframe\n\n ${chalk.dim(\"# Specify template\")}\n npm create @editframe -- react\n\n ${chalk.dim(\"# Full non-interactive\")}\n npm create @editframe -- react -d my-app -y\n\n ${chalk.dim(\"# Skip auto-installation\")}\n npm create @editframe -- react --skip-install --skip-skills\n`;\n\n process.stdout.write(usage);\n}\n\nasync function checkDirectoryExists(path: string) {\n try {\n await access(path);\n return true;\n } catch (_error) {\n return false;\n }\n}\n\nasync function main() {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n // List of available starter templates\n const templates = await readdir(path.join(__dirname, \"templates\"));\n\n // Parse command line arguments\n const { values, positionals } = parseArgs({\n args: process.argv.slice(2),\n options: {\n help: {\n type: \"boolean\",\n short: \"h\",\n default: false,\n },\n directory: {\n type: \"string\",\n short: \"d\",\n },\n skipInstall: {\n type: \"boolean\",\n default: false,\n },\n skipSkills: {\n type: \"boolean\",\n default: false,\n },\n yes: {\n type: \"boolean\",\n short: \"y\",\n default: false,\n },\n },\n allowPositionals: true,\n });\n\n // Show help if requested\n if (values.help) {\n showHelp(templates);\n process.exit(0);\n }\n\n // Extract CLI arguments\n const cliTemplate = positionals[0];\n const cliDirectory = values.directory;\n const skipInstall = values.skipInstall;\n const skipSkills = values.skipSkills;\n const nonInteractive = values.yes;\n\n // Validate template if provided\n if (cliTemplate && !templates.includes(cliTemplate)) {\n process.stderr.write(chalk.red(`Error: Template \"${cliTemplate}\" does not exist.\\n\\n`));\n process.stderr.write(chalk.bold(\"Available templates:\\n\"));\n for (const t of templates) {\n process.stderr.write(` - ${t}\\n`);\n }\n process.stderr.write(chalk.dim(\"\\nRun with --help for more information.\\n\"));\n process.exit(1);\n }\n\n // Build prompts array - ask ALL questions upfront before any network calls\n const promptQuestions: prompts.PromptObject[] = [];\n\n if (!cliDirectory && !nonInteractive) {\n promptQuestions.push({\n type: \"text\",\n name: \"directoryName\",\n message: \"Enter the name of the directory to generate into:\",\n initial: \"my-project\",\n });\n }\n\n if (!cliTemplate && !nonInteractive) {\n promptQuestions.push({\n type: \"select\",\n name: \"templateName\",\n message: \"Choose a starter template:\",\n choices: templates.map((template) => ({\n title: template,\n value: template,\n })),\n });\n }\n\n // Ask about agent skills upfront (unless skipped via CLI)\n if (!skipSkills && !nonInteractive) {\n promptQuestions.push({\n type: \"confirm\",\n name: \"installSkills\",\n message: \"Install AI agent skills for better coding assistance?\",\n initial: true,\n });\n }\n\n // Prompt for all missing information at once\n const answers = promptQuestions.length > 0 ? await prompts(promptQuestions) : {};\n\n // Handle user cancellation\n if (\n (!cliDirectory && !nonInteractive && !answers.directoryName) ||\n (!cliTemplate && !nonInteractive && !answers.templateName)\n ) {\n process.stderr.write(chalk.red(\"\\nCancelled\\n\"));\n process.exit(1);\n }\n\n // Use CLI args or prompted values (with defaults for non-interactive mode)\n const directoryName = cliDirectory || answers.directoryName || \"my-project\";\n const templateName = cliTemplate || answers.templateName || templates[0];\n\n // Determine if skills should be installed\n const installSkills = !skipSkills && (nonInteractive || answers.installSkills !== false);\n\n const targetDir = path.join(process.cwd(), directoryName);\n const templateDir = path.join(__dirname, \"templates\", templateName);\n\n const exists = await checkDirectoryExists(targetDir);\n\n if (exists) {\n process.stderr.write(chalk.yellow(`Directory ${targetDir} already exists.\\n`));\n const { overwrite } = await prompts({\n type: \"confirm\",\n name: \"overwrite\",\n message: \"Directory already exists. Do you want to overwrite it?\",\n initial: false,\n });\n\n if (!overwrite) {\n process.stderr.write(chalk.red(\"Aborting...\\n\"));\n process.exit(1);\n }\n }\n\n process.stderr.write(`\\nCreating project in directory: ${targetDir}\\n`);\n process.stderr.write(`Using template: ${templateName}\\n\\n`);\n\n // Copy the selected template to the target directory\n await cp(templateDir, targetDir, { recursive: true });\n\n const pkgManager = getUserPkgManager();\n let depsInstalled = false;\n let skillsInstalled = false;\n\n // All questions have been asked - now do the work\n\n // Install dependencies unless skipped\n if (!skipInstall) {\n depsInstalled = await installDependencies(targetDir);\n }\n\n // Install agent skills unless skipped\n if (installSkills) {\n skillsInstalled = await installAgentSkills(targetDir);\n }\n\n // Success message\n process.stderr.write(chalk.green.bold(\"\\n✓ Project created successfully!\\n\"));\n\n if (depsInstalled) {\n process.stderr.write(chalk.green(\"✓ Dependencies installed\\n\"));\n }\n\n if (skillsInstalled) {\n process.stderr.write(chalk.green(\"✓ AI agent skills installed\\n\"));\n }\n\n process.stderr.write(chalk.bold(\"\\nYour project is ready! 🎉\\n\\n\"));\n\n // Next steps\n process.stderr.write(chalk.bold(\"Next steps:\\n\"));\n process.stderr.write(chalk.cyan(` cd ${directoryName}\\n`));\n\n if (!depsInstalled) {\n process.stderr.write(chalk.cyan(` ${pkgManager} install\\n`));\n }\n\n process.stderr.write(chalk.cyan(` ${getStartCommand(pkgManager)}\\n`));\n\n // Skills info\n if (skillsInstalled) {\n process.stderr.write(chalk.bold(\"\\nAI Agent Skills installed:\\n\"));\n process.stderr.write(chalk.dim(\" • editframe-composition\\n\"));\n process.stderr.write(chalk.dim(\" • editframe-motion-design\\n\"));\n process.stderr.write(chalk.dim(\" • editframe-brand-video-generator\\n\"));\n process.stderr.write(chalk.dim(\" • editframe-editor-gui\\n\"));\n process.stderr.write(chalk.dim(\" • editframe-vite-plugin\\n\"));\n process.stderr.write(chalk.dim(\" • editframe-webhooks\\n\"));\n\n process.stderr.write(chalk.bold(\"\\nTry asking your AI agent:\\n\"));\n process.stderr.write(chalk.dim(' \"Create a 5-second video with fade-in text\"\\n'));\n process.stderr.write(chalk.dim(' \"Add a waveform visualization\"\\n'));\n process.stderr.write(chalk.dim(' \"Animate this element with spring physics\"\\n'));\n }\n\n process.stderr.write(chalk.dim(\"\\nDocumentation: https://editframe.com/docs\\n\"));\n process.stderr.write(chalk.dim(\"Happy coding! 🎬\\n\\n\"));\n}\n\nmain();\n"],"mappings":";;;;;;;;;;AAeA,SAAS,SAAS,WAAqB;CACrC,MAAM,QAAQ;EACd,MAAM,KAAK,SAAS,CAAC;;;EAGrB,MAAM,KAAK,WAAW,CAAC;;;;;;;EAOvB,MAAM,KAAK,uBAAuB,CAAC;EACnC,UAAU,KAAK,MAAM,OAAO,IAAI,CAAC,KAAK,KAAK,CAAC;;EAE5C,MAAM,KAAK,YAAY,CAAC;IACtB,MAAM,IAAI,mCAAmC,CAAC;;;IAG9C,MAAM,IAAI,qBAAqB,CAAC;;;IAGhC,MAAM,IAAI,yBAAyB,CAAC;;;IAGpC,MAAM,IAAI,2BAA2B,CAAC;;;AAIxC,SAAQ,OAAO,MAAM,MAAM;;AAG7B,eAAe,qBAAqB,QAAc;AAChD,KAAI;AACF,QAAM,OAAOA,OAAK;AAClB,SAAO;UACA,QAAQ;AACf,SAAO;;;AAIX,eAAe,OAAO;CACpB,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;CAG9D,MAAM,YAAY,MAAM,QAAQ,KAAK,KAAK,WAAW,YAAY,CAAC;CAGlE,MAAM,EAAE,QAAQ,gBAAgB,UAAU;EACxC,MAAM,QAAQ,KAAK,MAAM,EAAE;EAC3B,SAAS;GACP,MAAM;IACJ,MAAM;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AAM,MAAM,KAAK,kCAAkC,CAAC;AAGnE,SAAQ,OAAO,MAAM,MAAM,KAAK,gBAAgB,CAAC;AACjD,SAAQ,OAAO,MAAM,MAAM,KAAK,QAAQ,cAAc,IAAI,CAAC;AAE3D,KAAI,CAAC,cACH,SAAQ,OAAO,MAAM,MAAM,KAAK,KAAK,WAAW,YAAY,CAAC;AAG/D,SAAQ,OAAO,MAAM,MAAM,KAAK,KAAK,gBAAgB,WAAW,CAAC,IAAI,CAAC;AAGtE,KAAI,iBAAiB;AACnB,UAAQ,OAAO,MAAM,MAAM,KAAK,iCAAiC,CAAC;AAClE,UAAQ,OAAO,MAAM,MAAM,IAAI,8BAA8B,CAAC;AAC9D,UAAQ,OAAO,MAAM,MAAM,IAAI,gCAAgC,CAAC;AAChE,UAAQ,OAAO,MAAM,MAAM,IAAI,wCAAwC,CAAC;AACxE,UAAQ,OAAO,MAAM,MAAM,IAAI,6BAA6B,CAAC;AAC7D,UAAQ,OAAO,MAAM,MAAM,IAAI,8BAA8B,CAAC;AAC9D,UAAQ,OAAO,MAAM,MAAM,IAAI,2BAA2B,CAAC;AAE3D,UAAQ,OAAO,MAAM,MAAM,KAAK,gCAAgC,CAAC;AACjE,UAAQ,OAAO,MAAM,MAAM,IAAI,oDAAkD,CAAC;AAClF,UAAQ,OAAO,MAAM,MAAM,IAAI,uCAAqC,CAAC;AACrE,UAAQ,OAAO,MAAM,MAAM,IAAI,mDAAiD,CAAC;;AAGnF,SAAQ,OAAO,MAAM,MAAM,IAAI,gDAAgD,CAAC;AAChF,SAAQ,OAAO,MAAM,MAAM,IAAI,uBAAuB,CAAC;;AAGzD,MAAM"}
1
+ {"version":3,"file":"index.js","names":["path","promptQuestions: prompts.PromptObject[]"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { access, cp, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { parseArgs } from \"node:util\";\nimport chalk from \"chalk\";\nimport prompts from \"prompts\";\nimport {\n getUserPkgManager,\n installDependencies,\n installAgentSkills,\n getStartCommand,\n type PackageManager,\n} from \"./utils.js\";\n\ninterface SuccessOutputOptions {\n directoryName: string;\n pkgManager: PackageManager;\n depsInstalled: boolean;\n skillsInstalled: boolean;\n}\n\nexport function buildSuccessOutput({\n directoryName,\n pkgManager,\n depsInstalled,\n skillsInstalled,\n}: SuccessOutputOptions): string {\n let output = \"\";\n\n output += chalk.green.bold(`\\n✓ ${directoryName} created\\n`);\n\n output += `\\n ${chalk.cyan(`cd ${directoryName}`)}\\n`;\n\n if (!depsInstalled) {\n output += ` ${chalk.cyan(`${pkgManager} install`)}\\n`;\n }\n\n output += ` ${chalk.cyan(getStartCommand(pkgManager))}\\n`;\n\n if (skillsInstalled) {\n output += chalk.bold(\"\\nThen prompt Cursor, Claude, or your AI agent with Editframe Skills\\n\");\n output += chalk.dim(\n \" • editframe-composition • editframe-motion-design • editframe-brand-video-generator\\n\",\n );\n output += chalk.dim(\n \" • editframe-editor-gui • editframe-vite-plugin • editframe-webhooks\\n\",\n );\n }\n\n output += `\\n${chalk.dim(\"editframe.com/docs\")}\\n\\n`;\n\n return output;\n}\n\nfunction showHelp(templates: string[]) {\n const usage = `\n${chalk.bold(\"Usage:\")}\n npm create @editframe -- [template] [options]\n\n${chalk.bold(\"Options:\")}\n -d, --directory <name> Project directory name\n --skip-install Skip dependency installation\n --skip-skills Skip agent skills installation\n -y, --yes Skip all prompts, use defaults\n -h, --help Show this help message\n\n${chalk.bold(\"Available Templates:\")}\n${templates.map((t) => ` - ${t}`).join(\"\\n\")}\n\n${chalk.bold(\"Examples:\")}\n ${chalk.dim(\"# Interactive mode (recommended)\")}\n npm create @editframe\n\n ${chalk.dim(\"# Specify template\")}\n npm create @editframe -- react\n\n ${chalk.dim(\"# Full non-interactive\")}\n npm create @editframe -- react -d my-app -y\n\n ${chalk.dim(\"# Skip auto-installation\")}\n npm create @editframe -- react --skip-install --skip-skills\n`;\n\n process.stdout.write(usage);\n}\n\nasync function checkDirectoryExists(path: string) {\n try {\n await access(path);\n return true;\n } catch (_error) {\n return false;\n }\n}\n\nasync function main() {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n // List of available starter templates\n const templates = await readdir(path.join(__dirname, \"templates\"));\n\n // Parse command line arguments\n const { values, positionals } = parseArgs({\n args: process.argv.slice(2),\n options: {\n help: {\n type: \"boolean\",\n short: \"h\",\n default: false,\n },\n directory: {\n type: \"string\",\n short: \"d\",\n },\n skipInstall: {\n type: \"boolean\",\n default: false,\n },\n skipSkills: {\n type: \"boolean\",\n default: false,\n },\n yes: {\n type: \"boolean\",\n short: \"y\",\n default: false,\n },\n },\n allowPositionals: true,\n });\n\n // Show help if requested\n if (values.help) {\n showHelp(templates);\n process.exit(0);\n }\n\n // Extract CLI arguments\n const cliTemplate = positionals[0];\n const cliDirectory = values.directory;\n const skipInstall = values.skipInstall;\n const skipSkills = values.skipSkills;\n const nonInteractive = values.yes;\n\n // Validate template if provided\n if (cliTemplate && !templates.includes(cliTemplate)) {\n process.stderr.write(chalk.red(`Error: Template \"${cliTemplate}\" does not exist.\\n\\n`));\n process.stderr.write(chalk.bold(\"Available templates:\\n\"));\n for (const t of templates) {\n process.stderr.write(` - ${t}\\n`);\n }\n process.stderr.write(chalk.dim(\"\\nRun with --help for more information.\\n\"));\n process.exit(1);\n }\n\n // Build prompts array - ask ALL questions upfront before any network calls\n const promptQuestions: prompts.PromptObject[] = [];\n\n if (!cliDirectory && !nonInteractive) {\n promptQuestions.push({\n type: \"text\",\n name: \"directoryName\",\n message: \"Enter the name of the directory to generate into:\",\n initial: \"my-project\",\n });\n }\n\n if (!cliTemplate && !nonInteractive) {\n promptQuestions.push({\n type: \"select\",\n name: \"templateName\",\n message: \"Choose a starter template:\",\n choices: templates.map((template) => ({\n title: template,\n value: template,\n })),\n });\n }\n\n // Ask about agent skills upfront (unless skipped via CLI)\n if (!skipSkills && !nonInteractive) {\n promptQuestions.push({\n type: \"confirm\",\n name: \"installSkills\",\n message: \"Install AI agent skills for better coding assistance?\",\n initial: true,\n });\n }\n\n // Prompt for all missing information at once\n const answers = promptQuestions.length > 0 ? await prompts(promptQuestions) : {};\n\n // Handle user cancellation\n if (\n (!cliDirectory && !nonInteractive && !answers.directoryName) ||\n (!cliTemplate && !nonInteractive && !answers.templateName)\n ) {\n process.stderr.write(chalk.red(\"\\nCancelled\\n\"));\n process.exit(1);\n }\n\n // Use CLI args or prompted values (with defaults for non-interactive mode)\n const directoryName = cliDirectory || answers.directoryName || \"my-project\";\n const templateName = cliTemplate || answers.templateName || templates[0];\n\n // Determine if skills should be installed\n const installSkills = !skipSkills && (nonInteractive || answers.installSkills !== false);\n\n const targetDir = path.join(process.cwd(), directoryName);\n const templateDir = path.join(__dirname, \"templates\", templateName);\n\n const exists = await checkDirectoryExists(targetDir);\n\n if (exists) {\n process.stderr.write(chalk.yellow(`Directory ${targetDir} already exists.\\n`));\n const { overwrite } = await prompts({\n type: \"confirm\",\n name: \"overwrite\",\n message: \"Directory already exists. Do you want to overwrite it?\",\n initial: false,\n });\n\n if (!overwrite) {\n process.stderr.write(chalk.red(\"Aborting...\\n\"));\n process.exit(1);\n }\n }\n\n process.stderr.write(`\\nCreating project in directory: ${targetDir}\\n`);\n process.stderr.write(`Using template: ${templateName}\\n\\n`);\n\n // Copy the selected template to the target directory\n await cp(templateDir, targetDir, { recursive: true });\n\n const pkgManager = getUserPkgManager();\n let depsInstalled = false;\n let skillsInstalled = false;\n\n // All questions have been asked - now do the work\n\n // Install dependencies unless skipped\n if (!skipInstall) {\n depsInstalled = await installDependencies(targetDir);\n }\n\n // Install agent skills unless skipped\n if (installSkills) {\n skillsInstalled = await installAgentSkills(targetDir);\n }\n\n process.stderr.write(\n buildSuccessOutput({ directoryName, pkgManager, depsInstalled, skillsInstalled }),\n );\n}\n\nmain();\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,mBAAmB,EACjC,eACA,YACA,eACA,mBAC+B;CAC/B,IAAI,S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C,kBAAkB,CAAC,QAAQ,cAC7C;AACA,UAAQ,OAAO,MAAM,MAAM,IAAI,gBAAgB,CAAC;AAChD,UAAQ,KAAK,EAAE;;CAIjB,MAAM,gBAAgB,gBAAgB,QAAQ,iBAAiB;CAC/D,MAAM,eAAe,eAAe,QAAQ,gBAAgB,UAAU;CAGtE,MAAM,gBAAgB,CAAC,eAAe,kBAAkB,QAAQ,kBAAkB;CAElF,MAAM,YAAY,KAAK,KAAK,QAAQ,KAAK,EAAE,cAAc;CACzD,MAAM,cAAc,KAAK,KAAK,WAAW,aAAa,aAAa;AAInE,KAFe,MAAM,qBAAqB,UAAU,EAExC;AACV,UAAQ,OAAO,MAAM,MAAM,OAAO,aAAa,UAAU,oBAAoB,CAAC;EAC9E,MAAM,EAAE,cAAc,MAAM,QAAQ;GAClC,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACV,CAAC;AAEF,MAAI,CAAC,WAAW;AACd,WAAQ,OAAO,MAAM,MAAM,IAAI,gBAAgB,CAAC;AAChD,WAAQ,KAAK,EAAE;;;AAInB,SAAQ,OAAO,MAAM,oCAAoC,UAAU,IAAI;AACvE,SAAQ,OAAO,MAAM,mBAAmB,aAAa,MAAM;AAG3D,OAAM,GAAG,aAAa,WAAW,EAAE,WAAW,MAAM,CAAC;CAErD,MAAM,aAAa,mBAAmB;CACtC,IAAI,gBAAgB;CACpB,IAAI,kBAAkB;AAKtB,KAAI,CAAC,YACH,iBAAgB,MAAM,oBAAoB,UAAU;AAItD,KAAI,cACF,mBAAkB,MAAM,mBAAmB,UAAU;AAGvD,SAAQ,OAAO,MACb,mBAAmB;EAAE;EAAe;EAAY;EAAe;EAAiB,CAAC,CAClF;;AAGH,MAAM"}
@@ -7,9 +7,9 @@
7
7
  "start": "editframe preview"
8
8
  },
9
9
  "dependencies": {
10
- "@editframe/cli": "0.46.2",
11
- "@editframe/elements": "0.46.2",
12
- "@editframe/vite-plugin": "0.46.2",
10
+ "@editframe/cli": "0.46.4",
11
+ "@editframe/elements": "0.46.4",
12
+ "@editframe/vite-plugin": "0.46.4",
13
13
  "tailwindcss": "^3.4.3",
14
14
  "vite": "^6.3.5",
15
15
  "vite-plugin-singlefile": "^2.0.1"
@@ -7,9 +7,9 @@
7
7
  "start": "editframe preview"
8
8
  },
9
9
  "dependencies": {
10
- "@editframe/cli": "0.46.2",
11
- "@editframe/react": "0.46.2",
12
- "@editframe/vite-plugin": "0.46.2",
10
+ "@editframe/cli": "0.46.4",
11
+ "@editframe/react": "0.46.4",
12
+ "@editframe/vite-plugin": "0.46.4",
13
13
  "@vitejs/plugin-react": "^4.3.1",
14
14
  "tailwindcss": "^3.4.3",
15
15
  "vite": "^6.3.5",
@@ -0,0 +1,5 @@
1
+ //#region src/utils.d.ts
2
+ type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
3
+ //#endregion
4
+ export { PackageManager };
5
+ //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/create",
3
- "version": "0.46.2",
3
+ "version": "0.46.4",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "create-editframe": "dist/index.js"