create-arcstack 0.1.1 → 0.1.2

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/bin/run.cjs CHANGED
@@ -38,6 +38,8 @@ let node_fs_promises = require("node:fs/promises");
38
38
  node_fs_promises = __toESM(node_fs_promises);
39
39
  let __antfu_install_pkg = require("@antfu/install-pkg");
40
40
  __antfu_install_pkg = __toESM(__antfu_install_pkg);
41
+ let node_process = require("node:process");
42
+ node_process = __toESM(node_process);
41
43
  let giget = require("giget");
42
44
  giget = __toESM(giget);
43
45
  let node_fs = require("node:fs");
@@ -123,11 +125,19 @@ var actions_default = class {
123
125
  }
124
126
  async complete(installed = false) {
125
127
  console.log("");
128
+ const installPath = "./" + (0, node_path.relative)(process.cwd(), this.location);
129
+ try {
130
+ (0, node_process.chdir)(node_path.default.join(process.cwd(), installPath));
131
+ } catch {}
126
132
  __h3ravel_shared.Logger.success("Your Arcstack project has been created successfully");
127
- __h3ravel_shared.Logger.parse([["cd", "cyan"], ["./" + (0, node_path.relative)(process.cwd(), this.location), "green"]]);
133
+ __h3ravel_shared.Logger.parse([
134
+ ["cd", "cyan"],
135
+ [installPath, "yellow"],
136
+ installPath === process.cwd() ? ["✔", "green"] : ["", "green"]
137
+ ], " ");
128
138
  if (!installed) __h3ravel_shared.Logger.parse([[await __h3ravel_shared.Resolver.getPakageInstallCommand(), "cyan"]]);
129
- __h3ravel_shared.Logger.parse([[await this.runCmd(), "cyan"], ["dev", "green"]], " ");
130
- __h3ravel_shared.Logger.parse([["Open http://localhost:3000", "cyan"]]);
139
+ __h3ravel_shared.Logger.parse([[await this.runCmd(), "cyan"], ["dev", "yellow"]], " ");
140
+ __h3ravel_shared.Logger.parse([["Open", "cyan"], ["http://localhost:3000", "yellow"]]);
131
141
  console.log("");
132
142
  __h3ravel_shared.Logger.parse([["Have any questions", "white"]]);
133
143
  __h3ravel_shared.Logger.parse([["Checkout our other projects -", "white"], ["https://toneflix.net/open-source", "yellow"]]);
package/bin/run.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.cjs","names":["templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","Resolver","Str","packageJsonScript","path","Command","AbortPromptError","ExitPromptError","Str","source: string","Actions","Logger","Kernel"],"sources":["../src/logo.ts","../src/templates.ts","../src/actions.ts","../src/utils.ts","../src/Commands/CreateArcstackCommand.ts","../src/run.ts"],"sourcesContent":["export const altLogo = String.raw`%c\n _ __ _ _ \n /_\\ _ __ ___/ _\\ |_ __ _ ___| | __\n //_\\\\| '__/ __\\ \\| __/ _\\ |/ __| |/ /\n/ _ \\ | | (___\\ \\ || (_| | (__| < \n\\_/ \\_/_| \\___\\__/\\__\\__,_|\\___|_|\\_\\\n \n`;\n","/*\n * create-h3ravel\n *\n * (c) H3ravel Framework\n *\n * The H3ravel framework and all it's base packages are\n * open-sourced software licensed under the MIT license.\n */\n\n/**\n * List of first party templates\n */\nexport const templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[] = [\n {\n name: \"Express Starter Kit\",\n alias: \"express\",\n hint: \"An Express application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n {\n name: \"H3 Starter Kit\",\n alias: \"h3\",\n hint: \"A H3 application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n];\n","import { Logger, Resolver, packageJsonScript } from \"@h3ravel/shared\";\nimport { basename, join, relative } from \"node:path\";\nimport { copyFile, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { detectPackageManager, installPackage } from \"@antfu/install-pkg\";\n\nimport { Str } from \"@h3ravel/support\";\nimport { downloadTemplate } from \"giget\";\nimport { existsSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\n\nexport default class {\n skipInstallation?: boolean;\n\n constructor(\n private location?: string,\n private appName?: string,\n private description?: string,\n ) {\n if (!this.location) {\n this.location = join(process.cwd(), \".temp\");\n }\n }\n\n async pm() {\n return (await detectPackageManager()) ?? \"npm\";\n }\n\n async runCmd(npx: boolean = false) {\n if (npx) return \"npx\";\n\n const pm = await this.pm();\n\n return pm === \"npm\" ? \"npm run\" : pm;\n }\n\n async download(template: string, install = false, auth?: string, overwrite = false) {\n if (this.location?.includes(\".temp\") || (overwrite && existsSync(this.location!))) {\n await rm(this.location!, { force: true, recursive: true });\n } else if (existsSync(this.location!)) {\n console.log(\"\\n\");\n Logger.parse(\n [\n [\" ERROR \", \"bgRed\"],\n [this.location!, [\"gray\", \"italic\"]],\n [\"is not empty.\", \"white\"],\n ],\n \" \",\n );\n console.log(\"\");\n process.exit(0);\n }\n\n this.skipInstallation = !install;\n this.removeLockFile();\n\n return await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n registry: await this.pm(),\n forceClean: false,\n });\n }\n\n async installPackage(name: string) {\n await installPackage(name, {\n cwd: this.location,\n silent: true,\n });\n }\n\n async complete(installed = false) {\n console.log(\"\");\n\n Logger.success(\"Your Arcstack project has been created successfully\");\n Logger.parse([\n [\"cd\", \"cyan\"],\n [\"./\" + relative(process.cwd(), this.location!), \"green\"],\n ]);\n if (!installed) {\n Logger.parse([[await Resolver.getPakageInstallCommand(), \"cyan\"]]);\n }\n\n Logger.parse(\n [\n [await this.runCmd(), \"cyan\"],\n [\"dev\", \"green\"],\n ],\n \" \",\n );\n Logger.parse([[\"Open http://localhost:3000\", \"cyan\"]]);\n\n console.log(\"\");\n\n Logger.parse([[\"Have any questions\", \"white\"]]);\n // Logger.parse([\n // [\"Join our Discord server -\", \"white\"],\n // [\"https://discord.gg/hsG2A8PuGb\", \"yellow\"],\n // ]);\n Logger.parse([\n [\"Checkout our other projects -\", \"white\"],\n [\"https://toneflix.net/open-source\", \"yellow\"],\n ]);\n }\n\n async cleanup() {\n const pkgPath = join(this.location!, \"package.json\");\n const pkg = await readFile(pkgPath!, \"utf-8\").then(JSON.parse);\n\n delete pkg.packageManager;\n pkg.name = Str.slugify(this.appName ?? basename(this.location!).replace(\".\", \"\"), \"-\");\n pkg.scripts = packageJsonScript;\n if (this.description) {\n pkg.description = this.description;\n }\n\n await Promise.allSettled([\n writeFile(pkgPath, JSON.stringify(pkg, null, 2)),\n this.removeLockFile(),\n rm(join(this.location!, \"pnpm-workspace.yaml\"), { force: true }),\n rm(join(this.location!, \"README.md\"), { force: true }),\n rm(join(this.location!, \".github\"), { force: true, recursive: true }),\n ]);\n }\n\n async removeLockFile() {\n if (!this.skipInstallation) {\n return;\n }\n\n await Promise.allSettled([\n unlink(join(this.location!, \"package-lock.json\")),\n unlink(join(this.location!, \"yarn.lock\")),\n unlink(join(this.location!, \"pnpm-lock.yaml\")),\n ]);\n }\n\n async getBanner() {\n return await readFile(join(process.cwd(), \"./logo.txt\"), \"utf-8\");\n }\n\n async copyExampleEnv() {\n const envPath = join(this.location!, \".env\");\n const exampleEnvPath = join(this.location!, \".env.example\");\n\n if (existsSync(exampleEnvPath)) {\n await copyFile(exampleEnvPath, envPath);\n }\n }\n}\n","import { readdir, rename } from \"node:fs/promises\";\n\nimport path from \"node:path\";\nimport { rm } from \"node:fs/promises\";\n\n/**\n * Removes all files in dirPath except the one specified by keepFileName\n *\n * @param dirPath\n * @param keepFileName\n */\nexport async function cleanDirectoryExcept(dirPath: string, keepFileName: string) {\n const files = await readdir(dirPath);\n\n for (const file of files) {\n if (file === keepFileName) continue;\n\n const fullPath = path.join(dirPath, file);\n\n await rm(fullPath, { recursive: true, force: true });\n }\n}\n\n/**\n * Moves all files from dirPath to parent directory and removes dirPath\n *\n * @param dirPath\n * @param parent\n */\nexport async function hoistDirectoryContents(parent: string, dirPath: string) {\n const source = path.isAbsolute(dirPath) ? dirPath : path.join(process.cwd(), dirPath);\n\n const targetParent = path.isAbsolute(parent) ? parent : path.join(process.cwd(), parent);\n\n if (!source.startsWith(targetParent)) {\n throw new Error(\"Source must be inside the parent directory\");\n }\n\n const entries = await readdir(source);\n\n for (const entry of entries) {\n const from = path.join(source, entry);\n const to = path.join(targetParent, entry);\n\n await rename(from, to);\n }\n\n await rm(source, { recursive: true });\n}\n","import { Command } from \"@h3ravel/musket\";\nimport { altLogo } from \"src/logo\";\nimport inquirer from \"inquirer\";\nimport { AbortPromptError, ExitPromptError } from \"@inquirer/core\";\nimport { basename, join } from \"node:path\";\nimport { templates } from \"src/templates\";\nimport { Str } from \"@h3ravel/support\";\nimport Actions from \"src/actions\";\nimport ora from \"ora\";\nimport { Logger } from \"@h3ravel/shared\";\nimport { cleanDirectoryExcept, hoistDirectoryContents } from \"src/utils\";\n\nexport class CreateArcstackCommand extends Command {\n protected signature = `create-arcstack\n {location?: The location where this project should be created relative to the current dir.}\n {--n|name?: The name of your project.}\n {--i|install: Install node_modules right away}\n {--t|token?: Kit repo authentication token.}\n {--d|desc?: Project Description.}\n {--k|kit?: Starter template kit.}\n {--p|pre: Download prerelease version if available.}\n {--o|overwrite: Overwrite the installation directory if it is not empty.}\n `;\n protected description = \"Display a personalized greeting.\";\n\n async handle() {\n const options = this.options();\n const pathName = this.argument(\"location\");\n\n console.log(altLogo, `font-family: monospace`);\n\n let { template } = await inquirer\n .prompt([\n {\n type: \"list\",\n name: \"template\",\n message: \"Choose starter template kit:\",\n choices: <never>templates.map((e) => ({\n name: e.name,\n value: e.alias,\n disabled: !e.source ? \"(Unavailable at this time)\" : false,\n })),\n default: \"full\",\n when: () => !options.kit,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { appName, description } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"appName\",\n message: \"What is the name of your project:\",\n default: `arcstack-${template}`,\n when: () => !options.name,\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Project Description:\",\n default: `Simple ${Str.of(template).ucfirst()}.js project created with Arcstack.`,\n when: () => !options.desc,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { location } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"location\",\n message: \"Installation location relative to the current dir:\",\n default: Str.slugify(options.name ?? appName ?? basename(process.cwd()), \"-\"),\n when: () => !pathName,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n /**\n * Find selected template kit\n */\n const kit = templates.find((e) => e.alias === template)!;\n\n let { install, token, pre } = await inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"pre\",\n message: `An alpha version of the ${kit.name.replace(/\\s*kit$/i, \"\").trim()} kit is available. Would you like to use it instead?`,\n default: false,\n when: () => kit.prereleaseSource && !options.pre,\n } as never,\n {\n type: \"input\",\n name: \"token\",\n message: \"Authentication token:\",\n when: () => options.kit && !options.token,\n },\n {\n type: \"confirm\",\n name: \"install\",\n message: \"Would you want to install node_modules right away:\",\n default: true,\n when: () => !options.install,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n pre = options.pre ?? pre;\n token = options.token ?? token;\n appName = options.name ?? appName;\n install = options.install ?? install;\n template = options.kit ?? template;\n location = pathName ?? location;\n description = options.description ?? description;\n\n /**\n * Validate selected kit\n */\n if (kit && !kit.source) {\n this.error(`ERROR: The ${kit.name} kit is not currently available`);\n process.exit(1);\n }\n\n const source: string = pre && kit.prereleaseSource ? kit.prereleaseSource! : kit.source;\n const actions = new Actions(join(process.cwd(), location), appName, description);\n const spinner = ora(`Loading Template...`).start();\n\n const result = await actions.download(source, install, token, options.overwrite);\n\n if (result.dir && kit.alias) {\n await cleanDirectoryExcept(result.dir, kit.alias);\n await hoistDirectoryContents(result.dir, join(result.dir, kit.alias));\n }\n\n spinner.info(Logger.parse([[\"Cleaning Up...\", \"green\"]], \"\", false)).start();\n await actions.cleanup();\n\n spinner.info(Logger.parse([[\"Initializing Project...\", \"green\"]], \"\", false)).start();\n await actions.copyExampleEnv();\n\n spinner.succeed(Logger.parse([[\"Project initialization complete!\", \"green\"]], \"\", false));\n\n await actions.complete(install);\n }\n}\n","#!/usr/bin/env node\n\nimport { CreateArcstackCommand } from \"./Commands/CreateArcstackCommand\";\nimport { Kernel } from \"@h3ravel/musket\";\n\nclass Application {}\n\nKernel.init(new Application(), {\n rootCommand: CreateArcstackCommand,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAMP,CACJ;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,EACD;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,CACF;;;;ACrBD,4BAAqB;CACnB;CAEA,YACE,AAAQC,UACR,AAAQC,SACR,AAAQC,aACR;EAHQ;EACA;EACA;AAER,MAAI,CAAC,KAAK,SACR,MAAK,+BAAgB,QAAQ,KAAK,EAAE,QAAQ;;CAIhD,MAAM,KAAK;AACT,SAAQ,qDAA4B,IAAK;;CAG3C,MAAM,OAAO,MAAe,OAAO;AACjC,MAAI,IAAK,QAAO;EAEhB,MAAM,KAAK,MAAM,KAAK,IAAI;AAE1B,SAAO,OAAO,QAAQ,YAAY;;CAGpC,MAAM,SAAS,UAAkB,UAAU,OAAO,MAAe,YAAY,OAAO;AAClF,MAAI,KAAK,UAAU,SAAS,QAAQ,IAAK,qCAAwB,KAAK,SAAU,CAC9E,gCAAS,KAAK,UAAW;GAAE,OAAO;GAAM,WAAW;GAAM,CAAC;mCACtC,KAAK,SAAU,EAAE;AACrC,WAAQ,IAAI,KAAK;AACjB,2BAAO,MACL;IACE,CAAC,WAAW,QAAQ;IACpB,CAAC,KAAK,U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BAAmB,IAAI,mBAAoB,IAAI;EACjF,MAAM,UAAU,IAAIC,oCAAa,QAAQ,KAAK,EAAE,SAAS,EAAE,SAAS,YAAY;EAChF,MAAM,2BAAc,sBAAsB,CAAC,OAAO;EAElD,MAAM,SAAS,MAAM,QAAQ,SAAS,QAAQ,SAAS,OAAO,QAAQ,UAAU;AAEhF,MAAI,OAAO,OAAO,IAAI,OAAO;AAC3B,SAAM,qBAAqB,OAAO,KAAK,IAAI,MAAM;AACjD,SAAM,uBAAuB,OAAO,yBAAU,OAAO,KAAK,IAAI,MAAM,CAAC;;AAGvE,UAAQ,KAAKC,wBAAO,MAAM,CAAC,CAAC,kBAAkB,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC,CAAC,OAAO;AAC5E,QAAM,QAAQ,SAAS;AAEvB,UAAQ,KAAKA,wBAAO,MAAM,CAAC,CAAC,2BAA2B,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC,CAAC,OAAO;AACrF,QAAM,QAAQ,gBAAgB;AAE9B,UAAQ,QAAQA,wBAAO,MAAM,CAAC,CAAC,oCAAoC,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC;AAEzF,QAAM,QAAQ,SAAS,QAAQ;;;;;;ACnKnC,IAAM,cAAN,MAAkB;AAElBC,wBAAO,KAAK,IAAI,aAAa,EAAE,EAC7B,aAAa,uBACd,CAAC"}
1
+ {"version":3,"file":"run.cjs","names":["templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","path","Resolver","Str","packageJsonScript","path","Command","AbortPromptError","ExitPromptError","Str","source: string","Actions","Logger","Kernel"],"sources":["../src/logo.ts","../src/templates.ts","../src/actions.ts","../src/utils.ts","../src/Commands/CreateArcstackCommand.ts","../src/run.ts"],"sourcesContent":["export const altLogo = String.raw`%c\n _ __ _ _ \n /_\\ _ __ ___/ _\\ |_ __ _ ___| | __\n //_\\\\| '__/ __\\ \\| __/ _\\ |/ __| |/ /\n/ _ \\ | | (___\\ \\ || (_| | (__| < \n\\_/ \\_/_| \\___\\__/\\__\\__,_|\\___|_|\\_\\\n \n`;\n","/*\n * create-h3ravel\n *\n * (c) H3ravel Framework\n *\n * The H3ravel framework and all it's base packages are\n * open-sourced software licensed under the MIT license.\n */\n\n/**\n * List of first party templates\n */\nexport const templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[] = [\n {\n name: \"Express Starter Kit\",\n alias: \"express\",\n hint: \"An Express application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n {\n name: \"H3 Starter Kit\",\n alias: \"h3\",\n hint: \"A H3 application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n];\n","import { Logger, Resolver, packageJsonScript } from \"@h3ravel/shared\";\nimport { copyFile, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { detectPackageManager, installPackage } from \"@antfu/install-pkg\";\nimport path, { basename, join, relative } from \"node:path\";\n\nimport { Str } from \"@h3ravel/support\";\nimport { chdir } from \"node:process\";\nimport { downloadTemplate } from \"giget\";\nimport { existsSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\n\nexport default class {\n skipInstallation?: boolean;\n\n constructor(\n private location?: string,\n private appName?: string,\n private description?: string,\n ) {\n if (!this.location) {\n this.location = join(process.cwd(), \".temp\");\n }\n }\n\n async pm() {\n return (await detectPackageManager()) ?? \"npm\";\n }\n\n async runCmd(npx: boolean = false) {\n if (npx) return \"npx\";\n\n const pm = await this.pm();\n\n return pm === \"npm\" ? \"npm run\" : pm;\n }\n\n async download(template: string, install = false, auth?: string, overwrite = false) {\n if (this.location?.includes(\".temp\") || (overwrite && existsSync(this.location!))) {\n await rm(this.location!, { force: true, recursive: true });\n } else if (existsSync(this.location!)) {\n console.log(\"\\n\");\n Logger.parse(\n [\n [\" ERROR \", \"bgRed\"],\n [this.location!, [\"gray\", \"italic\"]],\n [\"is not empty.\", \"white\"],\n ],\n \" \",\n );\n console.log(\"\");\n process.exit(0);\n }\n\n this.skipInstallation = !install;\n this.removeLockFile();\n\n return await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n registry: await this.pm(),\n forceClean: false,\n });\n }\n\n async installPackage(name: string) {\n await installPackage(name, {\n cwd: this.location,\n silent: true,\n });\n }\n\n async complete(installed = false) {\n console.log(\"\");\n\n const installPath = \"./\" + relative(process.cwd(), this.location!);\n\n try {\n chdir(path.join(process.cwd(), installPath));\n } catch {\n /** */\n }\n\n Logger.success(\"Your Arcstack project has been created successfully\");\n Logger.parse(\n [\n [\"cd\", \"cyan\"],\n [installPath, \"yellow\"],\n installPath === process.cwd() ? [\"✔\", \"green\"] : [\"\", \"green\"],\n ],\n \" \",\n );\n\n if (!installed) {\n Logger.parse([[await Resolver.getPakageInstallCommand(), \"cyan\"]]);\n }\n\n Logger.parse(\n [\n [await this.runCmd(), \"cyan\"],\n [\"dev\", \"yellow\"],\n ],\n \" \",\n );\n Logger.parse([\n [\"Open\", \"cyan\"],\n [\"http://localhost:3000\", \"yellow\"],\n ]);\n\n console.log(\"\");\n\n Logger.parse([[\"Have any questions\", \"white\"]]);\n // Logger.parse([\n // [\"Join our Discord server -\", \"white\"],\n // [\"https://discord.gg/hsG2A8PuGb\", \"yellow\"],\n // ]);\n Logger.parse([\n [\"Checkout our other projects -\", \"white\"],\n [\"https://toneflix.net/open-source\", \"yellow\"],\n ]);\n }\n\n async cleanup() {\n const pkgPath = join(this.location!, \"package.json\");\n const pkg = await readFile(pkgPath!, \"utf-8\").then(JSON.parse);\n\n delete pkg.packageManager;\n pkg.name = Str.slugify(this.appName ?? basename(this.location!).replace(\".\", \"\"), \"-\");\n pkg.scripts = packageJsonScript;\n if (this.description) {\n pkg.description = this.description;\n }\n\n await Promise.allSettled([\n writeFile(pkgPath, JSON.stringify(pkg, null, 2)),\n this.removeLockFile(),\n rm(join(this.location!, \"pnpm-workspace.yaml\"), { force: true }),\n rm(join(this.location!, \"README.md\"), { force: true }),\n rm(join(this.location!, \".github\"), { force: true, recursive: true }),\n ]);\n }\n\n async removeLockFile() {\n if (!this.skipInstallation) {\n return;\n }\n\n await Promise.allSettled([\n unlink(join(this.location!, \"package-lock.json\")),\n unlink(join(this.location!, \"yarn.lock\")),\n unlink(join(this.location!, \"pnpm-lock.yaml\")),\n ]);\n }\n\n async getBanner() {\n return await readFile(join(process.cwd(), \"./logo.txt\"), \"utf-8\");\n }\n\n async copyExampleEnv() {\n const envPath = join(this.location!, \".env\");\n const exampleEnvPath = join(this.location!, \".env.example\");\n\n if (existsSync(exampleEnvPath)) {\n await copyFile(exampleEnvPath, envPath);\n }\n }\n}\n","import { readdir, rename } from \"node:fs/promises\";\n\nimport path from \"node:path\";\nimport { rm } from \"node:fs/promises\";\n\n/**\n * Removes all files in dirPath except the one specified by keepFileName\n *\n * @param dirPath\n * @param keepFileName\n */\nexport async function cleanDirectoryExcept(dirPath: string, keepFileName: string) {\n const files = await readdir(dirPath);\n\n for (const file of files) {\n if (file === keepFileName) continue;\n\n const fullPath = path.join(dirPath, file);\n\n await rm(fullPath, { recursive: true, force: true });\n }\n}\n\n/**\n * Moves all files from dirPath to parent directory and removes dirPath\n *\n * @param dirPath\n * @param parent\n */\nexport async function hoistDirectoryContents(parent: string, dirPath: string) {\n const source = path.isAbsolute(dirPath) ? dirPath : path.join(process.cwd(), dirPath);\n\n const targetParent = path.isAbsolute(parent) ? parent : path.join(process.cwd(), parent);\n\n if (!source.startsWith(targetParent)) {\n throw new Error(\"Source must be inside the parent directory\");\n }\n\n const entries = await readdir(source);\n\n for (const entry of entries) {\n const from = path.join(source, entry);\n const to = path.join(targetParent, entry);\n\n await rename(from, to);\n }\n\n await rm(source, { recursive: true });\n}\n","import { Command } from \"@h3ravel/musket\";\nimport { altLogo } from \"src/logo\";\nimport inquirer from \"inquirer\";\nimport { AbortPromptError, ExitPromptError } from \"@inquirer/core\";\nimport { basename, join } from \"node:path\";\nimport { templates } from \"src/templates\";\nimport { Str } from \"@h3ravel/support\";\nimport Actions from \"src/actions\";\nimport ora from \"ora\";\nimport { Logger } from \"@h3ravel/shared\";\nimport { cleanDirectoryExcept, hoistDirectoryContents } from \"src/utils\";\n\nexport class CreateArcstackCommand extends Command {\n protected signature = `create-arcstack\n {location?: The location where this project should be created relative to the current dir.}\n {--n|name?: The name of your project.}\n {--i|install: Install node_modules right away}\n {--t|token?: Kit repo authentication token.}\n {--d|desc?: Project Description.}\n {--k|kit?: Starter template kit.}\n {--p|pre: Download prerelease version if available.}\n {--o|overwrite: Overwrite the installation directory if it is not empty.}\n `;\n protected description = \"Display a personalized greeting.\";\n\n async handle() {\n const options = this.options();\n const pathName = this.argument(\"location\");\n\n console.log(altLogo, `font-family: monospace`);\n\n let { template } = await inquirer\n .prompt([\n {\n type: \"list\",\n name: \"template\",\n message: \"Choose starter template kit:\",\n choices: <never>templates.map((e) => ({\n name: e.name,\n value: e.alias,\n disabled: !e.source ? \"(Unavailable at this time)\" : false,\n })),\n default: \"full\",\n when: () => !options.kit,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { appName, description } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"appName\",\n message: \"What is the name of your project:\",\n default: `arcstack-${template}`,\n when: () => !options.name,\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Project Description:\",\n default: `Simple ${Str.of(template).ucfirst()}.js project created with Arcstack.`,\n when: () => !options.desc,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { location } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"location\",\n message: \"Installation location relative to the current dir:\",\n default: Str.slugify(options.name ?? appName ?? basename(process.cwd()), \"-\"),\n when: () => !pathName,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n /**\n * Find selected template kit\n */\n const kit = templates.find((e) => e.alias === template)!;\n\n let { install, token, pre } = await inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"pre\",\n message: `An alpha version of the ${kit.name.replace(/\\s*kit$/i, \"\").trim()} kit is available. Would you like to use it instead?`,\n default: false,\n when: () => kit.prereleaseSource && !options.pre,\n } as never,\n {\n type: \"input\",\n name: \"token\",\n message: \"Authentication token:\",\n when: () => options.kit && !options.token,\n },\n {\n type: \"confirm\",\n name: \"install\",\n message: \"Would you want to install node_modules right away:\",\n default: true,\n when: () => !options.install,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n pre = options.pre ?? pre;\n token = options.token ?? token;\n appName = options.name ?? appName;\n install = options.install ?? install;\n template = options.kit ?? template;\n location = pathName ?? location;\n description = options.description ?? description;\n\n /**\n * Validate selected kit\n */\n if (kit && !kit.source) {\n this.error(`ERROR: The ${kit.name} kit is not currently available`);\n process.exit(1);\n }\n\n const source: string = pre && kit.prereleaseSource ? kit.prereleaseSource! : kit.source;\n const actions = new Actions(join(process.cwd(), location), appName, description);\n const spinner = ora(`Loading Template...`).start();\n\n const result = await actions.download(source, install, token, options.overwrite);\n\n if (result.dir && kit.alias) {\n await cleanDirectoryExcept(result.dir, kit.alias);\n await hoistDirectoryContents(result.dir, join(result.dir, kit.alias));\n }\n\n spinner.info(Logger.parse([[\"Cleaning Up...\", \"green\"]], \"\", false)).start();\n await actions.cleanup();\n\n spinner.info(Logger.parse([[\"Initializing Project...\", \"green\"]], \"\", false)).start();\n await actions.copyExampleEnv();\n\n spinner.succeed(Logger.parse([[\"Project initialization complete!\", \"green\"]], \"\", false));\n\n await actions.complete(install);\n }\n}\n","#!/usr/bin/env node\n\nimport { CreateArcstackCommand } from \"./Commands/CreateArcstackCommand\";\nimport { Kernel } from \"@h3ravel/musket\";\n\nclass Application {}\n\nKernel.init(new Application(), {\n rootCommand: CreateArcstackCommand,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAMP,CACJ;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,EACD;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,CACF;;;;ACpBD,4BAAqB;CACnB;CAEA,YACE,AAAQC,UACR,AAAQC,SACR,AAAQC,aACR;EAHQ;EACA;EACA;AAER,MAAI,CAAC,KAAK,SACR,MAAK,+BAAgB,QAAQ,KAAK,EAAE,QAAQ;;CAIhD,MAAM,KAAK;AACT,SAAQ,qDAA4B,IAAK;;CAG3C,MAAM,OAAO,MAAe,OAAO;AACjC,MAAI,IAAK,QAAO;EAEhB,MAAM,KAAK,MAAM,KAAK,IAAI;AAE1B,SAAO,OAAO,QAAQ,YAAY;;CAGpC,MAAM,SAAS,UAAkB,UAAU,OAAO,MAAe,YAAY,OAAO;AAClF,MAAI,KAAK,UAAU,SAAS,QAAQ,IAAK,qCAAwB,KAAK,SAAU,CAC9E,gCAAS,KAAK,UAAW;GAAE,OAAO;GAAM,WAAW;GAAM,CAAC;mCACtC,KAAK,SAAU,EAAE;AACrC,WAAQ,IAAI,KAAK;AACjB,2BAAO,MACL;IACE,CAAC,WAAW,QAAQ;IACpB,CAAC,KAAK,UAAW,CAAC,QAAQ,SAAS,CAAC;IACpC,CAAC,iBAAiB,QAAQ;IAC3B,EACD,IACD;AACD,WAAQ,IAAI,GAAG;AACf,WAAQ,KAAK,EAAE;;AAGjB,OAAK,mBAAmB,CAAC;AACzB,OAAK,gBAAgB;AAErB,SAAO,kCAAuB,UAAU;GACtC,KAAK,KAAK;GACV;GACA;GACA,UAAU,MAAM,K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AIC,oCAAa,QAAQ,KAAK,EAAE,SAAS,EAAE,SAAS,YAAY;EAChF,MAAM,2BAAc,sBAAsB,CAAC,OAAO;EAElD,MAAM,SAAS,MAAM,QAAQ,SAAS,QAAQ,SAAS,OAAO,QAAQ,UAAU;AAEhF,MAAI,OAAO,OAAO,IAAI,OAAO;AAC3B,SAAM,qBAAqB,OAAO,KAAK,IAAI,MAAM;AACjD,SAAM,uBAAuB,OAAO,yBAAU,OAAO,KAAK,IAAI,MAAM,CAAC;;AAGvE,UAAQ,KAAKC,wBAAO,MAAM,CAAC,CAAC,kBAAkB,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC,CAAC,OAAO;AAC5E,QAAM,QAAQ,SAAS;AAEvB,UAAQ,KAAKA,wBAAO,MAAM,CAAC,CAAC,2BAA2B,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC,CAAC,OAAO;AACrF,QAAM,QAAQ,gBAAgB;AAE9B,UAAQ,QAAQA,wBAAO,MAAM,CAAC,CAAC,oCAAoC,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC;AAEzF,QAAM,QAAQ,SAAS,QAAQ;;;;;;ACnKnC,IAAM,cAAN,MAAkB;AAElBC,wBAAO,KAAK,IAAI,aAAa,EAAE,EAC7B,aAAa,uBACd,CAAC"}
package/bin/run.js CHANGED
@@ -7,6 +7,7 @@ import { Str } from "@h3ravel/support";
7
7
  import { Logger, Resolver, packageJsonScript } from "@h3ravel/shared";
8
8
  import { copyFile, readFile, readdir, rename, rm, unlink, writeFile } from "node:fs/promises";
9
9
  import { detectPackageManager, installPackage } from "@antfu/install-pkg";
10
+ import { chdir } from "node:process";
10
11
  import { downloadTemplate } from "giget";
11
12
  import { existsSync } from "node:fs";
12
13
  import ora from "ora";
@@ -89,11 +90,19 @@ var actions_default = class {
89
90
  }
90
91
  async complete(installed = false) {
91
92
  console.log("");
93
+ const installPath = "./" + relative(process.cwd(), this.location);
94
+ try {
95
+ chdir(path.join(process.cwd(), installPath));
96
+ } catch {}
92
97
  Logger.success("Your Arcstack project has been created successfully");
93
- Logger.parse([["cd", "cyan"], ["./" + relative(process.cwd(), this.location), "green"]]);
98
+ Logger.parse([
99
+ ["cd", "cyan"],
100
+ [installPath, "yellow"],
101
+ installPath === process.cwd() ? ["✔", "green"] : ["", "green"]
102
+ ], " ");
94
103
  if (!installed) Logger.parse([[await Resolver.getPakageInstallCommand(), "cyan"]]);
95
- Logger.parse([[await this.runCmd(), "cyan"], ["dev", "green"]], " ");
96
- Logger.parse([["Open http://localhost:3000", "cyan"]]);
104
+ Logger.parse([[await this.runCmd(), "cyan"], ["dev", "yellow"]], " ");
105
+ Logger.parse([["Open", "cyan"], ["http://localhost:3000", "yellow"]]);
97
106
  console.log("");
98
107
  Logger.parse([["Have any questions", "white"]]);
99
108
  Logger.parse([["Checkout our other projects -", "white"], ["https://toneflix.net/open-source", "yellow"]]);
package/bin/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","names":["templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","source: string","Actions"],"sources":["../src/logo.ts","../src/templates.ts","../src/actions.ts","../src/utils.ts","../src/Commands/CreateArcstackCommand.ts","../src/run.ts"],"sourcesContent":["export const altLogo = String.raw`%c\n _ __ _ _ \n /_\\ _ __ ___/ _\\ |_ __ _ ___| | __\n //_\\\\| '__/ __\\ \\| __/ _\\ |/ __| |/ /\n/ _ \\ | | (___\\ \\ || (_| | (__| < \n\\_/ \\_/_| \\___\\__/\\__\\__,_|\\___|_|\\_\\\n \n`;\n","/*\n * create-h3ravel\n *\n * (c) H3ravel Framework\n *\n * The H3ravel framework and all it's base packages are\n * open-sourced software licensed under the MIT license.\n */\n\n/**\n * List of first party templates\n */\nexport const templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[] = [\n {\n name: \"Express Starter Kit\",\n alias: \"express\",\n hint: \"An Express application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n {\n name: \"H3 Starter Kit\",\n alias: \"h3\",\n hint: \"A H3 application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n];\n","import { Logger, Resolver, packageJsonScript } from \"@h3ravel/shared\";\nimport { basename, join, relative } from \"node:path\";\nimport { copyFile, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { detectPackageManager, installPackage } from \"@antfu/install-pkg\";\n\nimport { Str } from \"@h3ravel/support\";\nimport { downloadTemplate } from \"giget\";\nimport { existsSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\n\nexport default class {\n skipInstallation?: boolean;\n\n constructor(\n private location?: string,\n private appName?: string,\n private description?: string,\n ) {\n if (!this.location) {\n this.location = join(process.cwd(), \".temp\");\n }\n }\n\n async pm() {\n return (await detectPackageManager()) ?? \"npm\";\n }\n\n async runCmd(npx: boolean = false) {\n if (npx) return \"npx\";\n\n const pm = await this.pm();\n\n return pm === \"npm\" ? \"npm run\" : pm;\n }\n\n async download(template: string, install = false, auth?: string, overwrite = false) {\n if (this.location?.includes(\".temp\") || (overwrite && existsSync(this.location!))) {\n await rm(this.location!, { force: true, recursive: true });\n } else if (existsSync(this.location!)) {\n console.log(\"\\n\");\n Logger.parse(\n [\n [\" ERROR \", \"bgRed\"],\n [this.location!, [\"gray\", \"italic\"]],\n [\"is not empty.\", \"white\"],\n ],\n \" \",\n );\n console.log(\"\");\n process.exit(0);\n }\n\n this.skipInstallation = !install;\n this.removeLockFile();\n\n return await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n registry: await this.pm(),\n forceClean: false,\n });\n }\n\n async installPackage(name: string) {\n await installPackage(name, {\n cwd: this.location,\n silent: true,\n });\n }\n\n async complete(installed = false) {\n console.log(\"\");\n\n Logger.success(\"Your Arcstack project has been created successfully\");\n Logger.parse([\n [\"cd\", \"cyan\"],\n [\"./\" + relative(process.cwd(), this.location!), \"green\"],\n ]);\n if (!installed) {\n Logger.parse([[await Resolver.getPakageInstallCommand(), \"cyan\"]]);\n }\n\n Logger.parse(\n [\n [await this.runCmd(), \"cyan\"],\n [\"dev\", \"green\"],\n ],\n \" \",\n );\n Logger.parse([[\"Open http://localhost:3000\", \"cyan\"]]);\n\n console.log(\"\");\n\n Logger.parse([[\"Have any questions\", \"white\"]]);\n // Logger.parse([\n // [\"Join our Discord server -\", \"white\"],\n // [\"https://discord.gg/hsG2A8PuGb\", \"yellow\"],\n // ]);\n Logger.parse([\n [\"Checkout our other projects -\", \"white\"],\n [\"https://toneflix.net/open-source\", \"yellow\"],\n ]);\n }\n\n async cleanup() {\n const pkgPath = join(this.location!, \"package.json\");\n const pkg = await readFile(pkgPath!, \"utf-8\").then(JSON.parse);\n\n delete pkg.packageManager;\n pkg.name = Str.slugify(this.appName ?? basename(this.location!).replace(\".\", \"\"), \"-\");\n pkg.scripts = packageJsonScript;\n if (this.description) {\n pkg.description = this.description;\n }\n\n await Promise.allSettled([\n writeFile(pkgPath, JSON.stringify(pkg, null, 2)),\n this.removeLockFile(),\n rm(join(this.location!, \"pnpm-workspace.yaml\"), { force: true }),\n rm(join(this.location!, \"README.md\"), { force: true }),\n rm(join(this.location!, \".github\"), { force: true, recursive: true }),\n ]);\n }\n\n async removeLockFile() {\n if (!this.skipInstallation) {\n return;\n }\n\n await Promise.allSettled([\n unlink(join(this.location!, \"package-lock.json\")),\n unlink(join(this.location!, \"yarn.lock\")),\n unlink(join(this.location!, \"pnpm-lock.yaml\")),\n ]);\n }\n\n async getBanner() {\n return await readFile(join(process.cwd(), \"./logo.txt\"), \"utf-8\");\n }\n\n async copyExampleEnv() {\n const envPath = join(this.location!, \".env\");\n const exampleEnvPath = join(this.location!, \".env.example\");\n\n if (existsSync(exampleEnvPath)) {\n await copyFile(exampleEnvPath, envPath);\n }\n }\n}\n","import { readdir, rename } from \"node:fs/promises\";\n\nimport path from \"node:path\";\nimport { rm } from \"node:fs/promises\";\n\n/**\n * Removes all files in dirPath except the one specified by keepFileName\n *\n * @param dirPath\n * @param keepFileName\n */\nexport async function cleanDirectoryExcept(dirPath: string, keepFileName: string) {\n const files = await readdir(dirPath);\n\n for (const file of files) {\n if (file === keepFileName) continue;\n\n const fullPath = path.join(dirPath, file);\n\n await rm(fullPath, { recursive: true, force: true });\n }\n}\n\n/**\n * Moves all files from dirPath to parent directory and removes dirPath\n *\n * @param dirPath\n * @param parent\n */\nexport async function hoistDirectoryContents(parent: string, dirPath: string) {\n const source = path.isAbsolute(dirPath) ? dirPath : path.join(process.cwd(), dirPath);\n\n const targetParent = path.isAbsolute(parent) ? parent : path.join(process.cwd(), parent);\n\n if (!source.startsWith(targetParent)) {\n throw new Error(\"Source must be inside the parent directory\");\n }\n\n const entries = await readdir(source);\n\n for (const entry of entries) {\n const from = path.join(source, entry);\n const to = path.join(targetParent, entry);\n\n await rename(from, to);\n }\n\n await rm(source, { recursive: true });\n}\n","import { Command } from \"@h3ravel/musket\";\nimport { altLogo } from \"src/logo\";\nimport inquirer from \"inquirer\";\nimport { AbortPromptError, ExitPromptError } from \"@inquirer/core\";\nimport { basename, join } from \"node:path\";\nimport { templates } from \"src/templates\";\nimport { Str } from \"@h3ravel/support\";\nimport Actions from \"src/actions\";\nimport ora from \"ora\";\nimport { Logger } from \"@h3ravel/shared\";\nimport { cleanDirectoryExcept, hoistDirectoryContents } from \"src/utils\";\n\nexport class CreateArcstackCommand extends Command {\n protected signature = `create-arcstack\n {location?: The location where this project should be created relative to the current dir.}\n {--n|name?: The name of your project.}\n {--i|install: Install node_modules right away}\n {--t|token?: Kit repo authentication token.}\n {--d|desc?: Project Description.}\n {--k|kit?: Starter template kit.}\n {--p|pre: Download prerelease version if available.}\n {--o|overwrite: Overwrite the installation directory if it is not empty.}\n `;\n protected description = \"Display a personalized greeting.\";\n\n async handle() {\n const options = this.options();\n const pathName = this.argument(\"location\");\n\n console.log(altLogo, `font-family: monospace`);\n\n let { template } = await inquirer\n .prompt([\n {\n type: \"list\",\n name: \"template\",\n message: \"Choose starter template kit:\",\n choices: <never>templates.map((e) => ({\n name: e.name,\n value: e.alias,\n disabled: !e.source ? \"(Unavailable at this time)\" : false,\n })),\n default: \"full\",\n when: () => !options.kit,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { appName, description } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"appName\",\n message: \"What is the name of your project:\",\n default: `arcstack-${template}`,\n when: () => !options.name,\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Project Description:\",\n default: `Simple ${Str.of(template).ucfirst()}.js project created with Arcstack.`,\n when: () => !options.desc,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { location } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"location\",\n message: \"Installation location relative to the current dir:\",\n default: Str.slugify(options.name ?? appName ?? basename(process.cwd()), \"-\"),\n when: () => !pathName,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n /**\n * Find selected template kit\n */\n const kit = templates.find((e) => e.alias === template)!;\n\n let { install, token, pre } = await inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"pre\",\n message: `An alpha version of the ${kit.name.replace(/\\s*kit$/i, \"\").trim()} kit is available. Would you like to use it instead?`,\n default: false,\n when: () => kit.prereleaseSource && !options.pre,\n } as never,\n {\n type: \"input\",\n name: \"token\",\n message: \"Authentication token:\",\n when: () => options.kit && !options.token,\n },\n {\n type: \"confirm\",\n name: \"install\",\n message: \"Would you want to install node_modules right away:\",\n default: true,\n when: () => !options.install,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n pre = options.pre ?? pre;\n token = options.token ?? token;\n appName = options.name ?? appName;\n install = options.install ?? install;\n template = options.kit ?? template;\n location = pathName ?? location;\n description = options.description ?? description;\n\n /**\n * Validate selected kit\n */\n if (kit && !kit.source) {\n this.error(`ERROR: The ${kit.name} kit is not currently available`);\n process.exit(1);\n }\n\n const source: string = pre && kit.prereleaseSource ? kit.prereleaseSource! : kit.source;\n const actions = new Actions(join(process.cwd(), location), appName, description);\n const spinner = ora(`Loading Template...`).start();\n\n const result = await actions.download(source, install, token, options.overwrite);\n\n if (result.dir && kit.alias) {\n await cleanDirectoryExcept(result.dir, kit.alias);\n await hoistDirectoryContents(result.dir, join(result.dir, kit.alias));\n }\n\n spinner.info(Logger.parse([[\"Cleaning Up...\", \"green\"]], \"\", false)).start();\n await actions.cleanup();\n\n spinner.info(Logger.parse([[\"Initializing Project...\", \"green\"]], \"\", false)).start();\n await actions.copyExampleEnv();\n\n spinner.succeed(Logger.parse([[\"Project initialization complete!\", \"green\"]], \"\", false));\n\n await actions.complete(install);\n }\n}\n","#!/usr/bin/env node\n\nimport { CreateArcstackCommand } from \"./Commands/CreateArcstackCommand\";\nimport { Kernel } from \"@h3ravel/musket\";\n\nclass Application {}\n\nKernel.init(new Application(), {\n rootCommand: CreateArcstackCommand,\n});\n"],"mappings":";;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAMP,CACJ;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,EACD;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,CACF;;;;ACrBD,4BAAqB;CACnB;CAEA,YACE,AAAQC,UACR,AAAQC,SACR,AAAQC,aACR;EAHQ;EACA;EACA;AAER,MAAI,CAAC,KAAK,SACR,MAAK,WAAW,KAAK,QAAQ,KAAK,EAAE,QAAQ;;CAIhD,MAAM,KAAK;AACT,SAAQ,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,CAAC,CAAC,oCAAoC,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC;AAEzF,QAAM,QAAQ,SAAS,QAAQ;;;;;;ACnKnC,IAAM,cAAN,MAAkB;AAElB,OAAO,KAAK,IAAI,aAAa,EAAE,EAC7B,aAAa,uBACd,CAAC"}
1
+ {"version":3,"file":"run.js","names":["templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","source: string","Actions"],"sources":["../src/logo.ts","../src/templates.ts","../src/actions.ts","../src/utils.ts","../src/Commands/CreateArcstackCommand.ts","../src/run.ts"],"sourcesContent":["export const altLogo = String.raw`%c\n _ __ _ _ \n /_\\ _ __ ___/ _\\ |_ __ _ ___| | __\n //_\\\\| '__/ __\\ \\| __/ _\\ |/ __| |/ /\n/ _ \\ | | (___\\ \\ || (_| | (__| < \n\\_/ \\_/_| \\___\\__/\\__\\__,_|\\___|_|\\_\\\n \n`;\n","/*\n * create-h3ravel\n *\n * (c) H3ravel Framework\n *\n * The H3ravel framework and all it's base packages are\n * open-sourced software licensed under the MIT license.\n */\n\n/**\n * List of first party templates\n */\nexport const templates: {\n name: string;\n alias: \"express\" | \"h3\";\n hint: string;\n source: string;\n prereleaseSource?: string;\n}[] = [\n {\n name: \"Express Starter Kit\",\n alias: \"express\",\n hint: \"An Express application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n {\n name: \"H3 Starter Kit\",\n alias: \"h3\",\n hint: \"A H3 application starter kit\",\n source: \"github:toneflix/arcstack\",\n },\n];\n","import { Logger, Resolver, packageJsonScript } from \"@h3ravel/shared\";\nimport { copyFile, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { detectPackageManager, installPackage } from \"@antfu/install-pkg\";\nimport path, { basename, join, relative } from \"node:path\";\n\nimport { Str } from \"@h3ravel/support\";\nimport { chdir } from \"node:process\";\nimport { downloadTemplate } from \"giget\";\nimport { existsSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\n\nexport default class {\n skipInstallation?: boolean;\n\n constructor(\n private location?: string,\n private appName?: string,\n private description?: string,\n ) {\n if (!this.location) {\n this.location = join(process.cwd(), \".temp\");\n }\n }\n\n async pm() {\n return (await detectPackageManager()) ?? \"npm\";\n }\n\n async runCmd(npx: boolean = false) {\n if (npx) return \"npx\";\n\n const pm = await this.pm();\n\n return pm === \"npm\" ? \"npm run\" : pm;\n }\n\n async download(template: string, install = false, auth?: string, overwrite = false) {\n if (this.location?.includes(\".temp\") || (overwrite && existsSync(this.location!))) {\n await rm(this.location!, { force: true, recursive: true });\n } else if (existsSync(this.location!)) {\n console.log(\"\\n\");\n Logger.parse(\n [\n [\" ERROR \", \"bgRed\"],\n [this.location!, [\"gray\", \"italic\"]],\n [\"is not empty.\", \"white\"],\n ],\n \" \",\n );\n console.log(\"\");\n process.exit(0);\n }\n\n this.skipInstallation = !install;\n this.removeLockFile();\n\n return await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n registry: await this.pm(),\n forceClean: false,\n });\n }\n\n async installPackage(name: string) {\n await installPackage(name, {\n cwd: this.location,\n silent: true,\n });\n }\n\n async complete(installed = false) {\n console.log(\"\");\n\n const installPath = \"./\" + relative(process.cwd(), this.location!);\n\n try {\n chdir(path.join(process.cwd(), installPath));\n } catch {\n /** */\n }\n\n Logger.success(\"Your Arcstack project has been created successfully\");\n Logger.parse(\n [\n [\"cd\", \"cyan\"],\n [installPath, \"yellow\"],\n installPath === process.cwd() ? [\"✔\", \"green\"] : [\"\", \"green\"],\n ],\n \" \",\n );\n\n if (!installed) {\n Logger.parse([[await Resolver.getPakageInstallCommand(), \"cyan\"]]);\n }\n\n Logger.parse(\n [\n [await this.runCmd(), \"cyan\"],\n [\"dev\", \"yellow\"],\n ],\n \" \",\n );\n Logger.parse([\n [\"Open\", \"cyan\"],\n [\"http://localhost:3000\", \"yellow\"],\n ]);\n\n console.log(\"\");\n\n Logger.parse([[\"Have any questions\", \"white\"]]);\n // Logger.parse([\n // [\"Join our Discord server -\", \"white\"],\n // [\"https://discord.gg/hsG2A8PuGb\", \"yellow\"],\n // ]);\n Logger.parse([\n [\"Checkout our other projects -\", \"white\"],\n [\"https://toneflix.net/open-source\", \"yellow\"],\n ]);\n }\n\n async cleanup() {\n const pkgPath = join(this.location!, \"package.json\");\n const pkg = await readFile(pkgPath!, \"utf-8\").then(JSON.parse);\n\n delete pkg.packageManager;\n pkg.name = Str.slugify(this.appName ?? basename(this.location!).replace(\".\", \"\"), \"-\");\n pkg.scripts = packageJsonScript;\n if (this.description) {\n pkg.description = this.description;\n }\n\n await Promise.allSettled([\n writeFile(pkgPath, JSON.stringify(pkg, null, 2)),\n this.removeLockFile(),\n rm(join(this.location!, \"pnpm-workspace.yaml\"), { force: true }),\n rm(join(this.location!, \"README.md\"), { force: true }),\n rm(join(this.location!, \".github\"), { force: true, recursive: true }),\n ]);\n }\n\n async removeLockFile() {\n if (!this.skipInstallation) {\n return;\n }\n\n await Promise.allSettled([\n unlink(join(this.location!, \"package-lock.json\")),\n unlink(join(this.location!, \"yarn.lock\")),\n unlink(join(this.location!, \"pnpm-lock.yaml\")),\n ]);\n }\n\n async getBanner() {\n return await readFile(join(process.cwd(), \"./logo.txt\"), \"utf-8\");\n }\n\n async copyExampleEnv() {\n const envPath = join(this.location!, \".env\");\n const exampleEnvPath = join(this.location!, \".env.example\");\n\n if (existsSync(exampleEnvPath)) {\n await copyFile(exampleEnvPath, envPath);\n }\n }\n}\n","import { readdir, rename } from \"node:fs/promises\";\n\nimport path from \"node:path\";\nimport { rm } from \"node:fs/promises\";\n\n/**\n * Removes all files in dirPath except the one specified by keepFileName\n *\n * @param dirPath\n * @param keepFileName\n */\nexport async function cleanDirectoryExcept(dirPath: string, keepFileName: string) {\n const files = await readdir(dirPath);\n\n for (const file of files) {\n if (file === keepFileName) continue;\n\n const fullPath = path.join(dirPath, file);\n\n await rm(fullPath, { recursive: true, force: true });\n }\n}\n\n/**\n * Moves all files from dirPath to parent directory and removes dirPath\n *\n * @param dirPath\n * @param parent\n */\nexport async function hoistDirectoryContents(parent: string, dirPath: string) {\n const source = path.isAbsolute(dirPath) ? dirPath : path.join(process.cwd(), dirPath);\n\n const targetParent = path.isAbsolute(parent) ? parent : path.join(process.cwd(), parent);\n\n if (!source.startsWith(targetParent)) {\n throw new Error(\"Source must be inside the parent directory\");\n }\n\n const entries = await readdir(source);\n\n for (const entry of entries) {\n const from = path.join(source, entry);\n const to = path.join(targetParent, entry);\n\n await rename(from, to);\n }\n\n await rm(source, { recursive: true });\n}\n","import { Command } from \"@h3ravel/musket\";\nimport { altLogo } from \"src/logo\";\nimport inquirer from \"inquirer\";\nimport { AbortPromptError, ExitPromptError } from \"@inquirer/core\";\nimport { basename, join } from \"node:path\";\nimport { templates } from \"src/templates\";\nimport { Str } from \"@h3ravel/support\";\nimport Actions from \"src/actions\";\nimport ora from \"ora\";\nimport { Logger } from \"@h3ravel/shared\";\nimport { cleanDirectoryExcept, hoistDirectoryContents } from \"src/utils\";\n\nexport class CreateArcstackCommand extends Command {\n protected signature = `create-arcstack\n {location?: The location where this project should be created relative to the current dir.}\n {--n|name?: The name of your project.}\n {--i|install: Install node_modules right away}\n {--t|token?: Kit repo authentication token.}\n {--d|desc?: Project Description.}\n {--k|kit?: Starter template kit.}\n {--p|pre: Download prerelease version if available.}\n {--o|overwrite: Overwrite the installation directory if it is not empty.}\n `;\n protected description = \"Display a personalized greeting.\";\n\n async handle() {\n const options = this.options();\n const pathName = this.argument(\"location\");\n\n console.log(altLogo, `font-family: monospace`);\n\n let { template } = await inquirer\n .prompt([\n {\n type: \"list\",\n name: \"template\",\n message: \"Choose starter template kit:\",\n choices: <never>templates.map((e) => ({\n name: e.name,\n value: e.alias,\n disabled: !e.source ? \"(Unavailable at this time)\" : false,\n })),\n default: \"full\",\n when: () => !options.kit,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { appName, description } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"appName\",\n message: \"What is the name of your project:\",\n default: `arcstack-${template}`,\n when: () => !options.name,\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Project Description:\",\n default: `Simple ${Str.of(template).ucfirst()}.js project created with Arcstack.`,\n when: () => !options.desc,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n let { location } = await inquirer\n .prompt([\n {\n type: \"input\",\n name: \"location\",\n message: \"Installation location relative to the current dir:\",\n default: Str.slugify(options.name ?? appName ?? basename(process.cwd()), \"-\"),\n when: () => !pathName,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n /**\n * Find selected template kit\n */\n const kit = templates.find((e) => e.alias === template)!;\n\n let { install, token, pre } = await inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"pre\",\n message: `An alpha version of the ${kit.name.replace(/\\s*kit$/i, \"\").trim()} kit is available. Would you like to use it instead?`,\n default: false,\n when: () => kit.prereleaseSource && !options.pre,\n } as never,\n {\n type: \"input\",\n name: \"token\",\n message: \"Authentication token:\",\n when: () => options.kit && !options.token,\n },\n {\n type: \"confirm\",\n name: \"install\",\n message: \"Would you want to install node_modules right away:\",\n default: true,\n when: () => !options.install,\n },\n ])\n .catch((err) => {\n if (err instanceof AbortPromptError || err instanceof ExitPromptError) {\n this.info(\"Thanks for trying out our starter kit.\");\n process.exit(0);\n }\n return err;\n });\n\n pre = options.pre ?? pre;\n token = options.token ?? token;\n appName = options.name ?? appName;\n install = options.install ?? install;\n template = options.kit ?? template;\n location = pathName ?? location;\n description = options.description ?? description;\n\n /**\n * Validate selected kit\n */\n if (kit && !kit.source) {\n this.error(`ERROR: The ${kit.name} kit is not currently available`);\n process.exit(1);\n }\n\n const source: string = pre && kit.prereleaseSource ? kit.prereleaseSource! : kit.source;\n const actions = new Actions(join(process.cwd(), location), appName, description);\n const spinner = ora(`Loading Template...`).start();\n\n const result = await actions.download(source, install, token, options.overwrite);\n\n if (result.dir && kit.alias) {\n await cleanDirectoryExcept(result.dir, kit.alias);\n await hoistDirectoryContents(result.dir, join(result.dir, kit.alias));\n }\n\n spinner.info(Logger.parse([[\"Cleaning Up...\", \"green\"]], \"\", false)).start();\n await actions.cleanup();\n\n spinner.info(Logger.parse([[\"Initializing Project...\", \"green\"]], \"\", false)).start();\n await actions.copyExampleEnv();\n\n spinner.succeed(Logger.parse([[\"Project initialization complete!\", \"green\"]], \"\", false));\n\n await actions.complete(install);\n }\n}\n","#!/usr/bin/env node\n\nimport { CreateArcstackCommand } from \"./Commands/CreateArcstackCommand\";\nimport { Kernel } from \"@h3ravel/musket\";\n\nclass Application {}\n\nKernel.init(new Application(), {\n rootCommand: CreateArcstackCommand,\n});\n"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAMP,CACJ;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,EACD;CACE,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACT,CACF;;;;ACpBD,4BAAqB;CACnB;CAEA,YACE,AAAQC,UACR,AAAQC,SACR,AAAQC,aACR;EAHQ;EACA;EACA;AAER,MAAI,CAAC,KAAK,SACR,MAAK,WAAW,KAAK,QAAQ,KAAK,EAAE,QAAQ;;CAIhD,MAAM,KAAK;AACT,SAAQ,MAAM,sBAAsB,IAAK;;CAG3C,MAAM,OAAO,MAAe,OAAO;AACjC,MAAI,IAAK,QAAO;EAEhB,MAAM,KAAK,MAAM,KAAK,IAAI;AAE1B,SAAO,OAAO,QAAQ,YAAY;;CAGpC,MAAM,SAAS,UAAkB,UAAU,OAAO,MAAe,YAAY,OAAO;AAClF,M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C,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC;AAEzF,QAAM,QAAQ,SAAS,QAAQ;;;;;;ACnKnC,IAAM,cAAN,MAAkB;AAElB,OAAO,KAAK,IAAI,aAAa,EAAE,EAC7B,aAAa,uBACd,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-arcstack",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "description": "Scaffold new H3.js or Express.js applications using Toneflix's arcstack templates and starter kits",
6
6
  "main": "build/index.js",
7
7
  "private": false,