create-arkstack 0.1.2 → 0.1.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/bin/run.cjs +39 -26
- package/bin/run.cjs.map +1 -1
- package/bin/run.js +39 -26
- package/bin/run.js.map +1 -1
- package/package.json +1 -1
package/bin/run.cjs
CHANGED
|
@@ -67,13 +67,13 @@ const templates = [
|
|
|
67
67
|
name: "Express Starter Kit",
|
|
68
68
|
alias: "express",
|
|
69
69
|
hint: "An Express application starter kit",
|
|
70
|
-
source: "github:
|
|
70
|
+
source: "github:arkstack-hq/arkstack"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
name: "Express Lean Starter Kit",
|
|
74
74
|
alias: "express-lean",
|
|
75
75
|
hint: "A minimal Express application starter kit",
|
|
76
|
-
source: "github:
|
|
76
|
+
source: "github:arkstack-hq/arkstack",
|
|
77
77
|
lean: true,
|
|
78
78
|
baseAlias: "express"
|
|
79
79
|
},
|
|
@@ -81,18 +81,46 @@ const templates = [
|
|
|
81
81
|
name: "H3 Starter Kit",
|
|
82
82
|
alias: "h3",
|
|
83
83
|
hint: "A H3 application starter kit",
|
|
84
|
-
source: "github:
|
|
84
|
+
source: "github:arkstack-hq/arkstack"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: "H3 Lean Starter Kit",
|
|
88
88
|
alias: "h3-lean",
|
|
89
89
|
hint: "A minimal H3 application starter kit",
|
|
90
|
-
source: "github:
|
|
90
|
+
source: "github:arkstack-hq/arkstack",
|
|
91
91
|
lean: true,
|
|
92
92
|
baseAlias: "h3"
|
|
93
93
|
}
|
|
94
94
|
];
|
|
95
|
-
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/data.ts
|
|
98
|
+
const filesToRemove = [
|
|
99
|
+
"src/app",
|
|
100
|
+
"src/models",
|
|
101
|
+
"database",
|
|
102
|
+
"src/routes/api.ts",
|
|
103
|
+
"src/core/database.ts",
|
|
104
|
+
"prisma",
|
|
105
|
+
"prisma.config.ts",
|
|
106
|
+
"arkorm.config.ts",
|
|
107
|
+
"arkormx.config.ts",
|
|
108
|
+
"arkorm.config.js",
|
|
109
|
+
"arkormx.config.js",
|
|
110
|
+
"arkorm.config.mjs",
|
|
111
|
+
"arkormx.config.mjs"
|
|
112
|
+
];
|
|
113
|
+
const depsToRemove = [
|
|
114
|
+
"@prisma/adapter-pg",
|
|
115
|
+
"@arkstack/console",
|
|
116
|
+
"@prisma/client",
|
|
117
|
+
"@types/pg",
|
|
118
|
+
"pg",
|
|
119
|
+
"prisma",
|
|
120
|
+
"arkormx"
|
|
121
|
+
];
|
|
122
|
+
const depsToAdd = { "@arkstack/console-slim": "^0.1.4" };
|
|
123
|
+
const depsList = {
|
|
96
124
|
"@arkstack/common": "^0.1.4",
|
|
97
125
|
"@arkstack/console": "^0.1.4",
|
|
98
126
|
"@arkstack/contract": "^0.1.4",
|
|
@@ -138,6 +166,7 @@ var actions_default = class {
|
|
|
138
166
|
dir: this.location,
|
|
139
167
|
auth,
|
|
140
168
|
install,
|
|
169
|
+
provider: "github",
|
|
141
170
|
registry: await this.pm(),
|
|
142
171
|
forceClean: false
|
|
143
172
|
});
|
|
@@ -178,7 +207,7 @@ var actions_default = class {
|
|
|
178
207
|
delete pkg.scripts.dev;
|
|
179
208
|
pkg.name = __h3ravel_support.Str.slugify(this.appName ?? (0, node_path.basename)(this.location).replace(".", ""), "-");
|
|
180
209
|
if (this.description) pkg.description = this.description;
|
|
181
|
-
for (const [name, version] of Object.entries(
|
|
210
|
+
for (const [name, version] of Object.entries(depsList)) pkg.dependencies[name] = version;
|
|
182
211
|
await Promise.allSettled([
|
|
183
212
|
(0, node_fs_promises.writeFile)(pkgPath, JSON.stringify(pkg, null, 2)),
|
|
184
213
|
this.removeLockFile(),
|
|
@@ -206,41 +235,25 @@ var actions_default = class {
|
|
|
206
235
|
if ((0, node_fs.existsSync)(exampleEnvPath)) await (0, node_fs_promises.copyFile)(exampleEnvPath, envPath);
|
|
207
236
|
}
|
|
208
237
|
async makeLeanProfile(_kit) {
|
|
209
|
-
await Promise.allSettled(
|
|
210
|
-
"src/app",
|
|
211
|
-
"src/models",
|
|
212
|
-
"database",
|
|
213
|
-
"src/routes/api.ts",
|
|
214
|
-
"src/core/database.ts",
|
|
215
|
-
"prisma",
|
|
216
|
-
"prisma.config.ts",
|
|
217
|
-
"arkorm.config.ts",
|
|
218
|
-
"arkormx.config.ts"
|
|
219
|
-
].map((file) => (0, node_fs_promises.rm)((0, node_path.join)(this.location, file), {
|
|
238
|
+
await Promise.allSettled(filesToRemove.map((file) => (0, node_fs_promises.rm)((0, node_path.join)(this.location, file), {
|
|
220
239
|
force: true,
|
|
221
240
|
recursive: true
|
|
222
241
|
})));
|
|
223
242
|
const pkgPath = (0, node_path.join)(this.location, "package.json");
|
|
224
243
|
if ((0, node_fs.existsSync)(pkgPath)) {
|
|
225
244
|
const pkg = await (0, node_fs_promises.readFile)(pkgPath, "utf-8").then(JSON.parse);
|
|
226
|
-
for (const dep of
|
|
227
|
-
"@prisma/adapter-pg",
|
|
228
|
-
"@prisma/client",
|
|
229
|
-
"pg",
|
|
230
|
-
"prisma",
|
|
231
|
-
"arkormx",
|
|
232
|
-
"@types/pg"
|
|
233
|
-
]) {
|
|
245
|
+
for (const dep of depsToRemove) {
|
|
234
246
|
delete pkg.dependencies?.[dep];
|
|
235
247
|
delete pkg.devDependencies?.[dep];
|
|
236
248
|
}
|
|
249
|
+
for (const [name, version] of Object.entries(depsToAdd)) pkg.dependencies[name] = version;
|
|
237
250
|
await (0, node_fs_promises.writeFile)(pkgPath, JSON.stringify(pkg, null, 2));
|
|
238
251
|
}
|
|
239
252
|
for (const file of ["src/core/app.ts", "src/core/utils/request-handlers.ts"]) {
|
|
240
253
|
const filePath = (0, node_path.join)(this.location, file);
|
|
241
254
|
if (!(0, node_fs.existsSync)(filePath)) continue;
|
|
242
255
|
let content = await (0, node_fs_promises.readFile)(filePath, "utf-8");
|
|
243
|
-
content = content.replace("import { ModelNotFoundException } from 'arkormx'
|
|
256
|
+
content = content.replace("import { ModelNotFoundException } from 'arkormx'\n", "").replace("import { prisma } from 'src/core/database'\n", "").replace("import { Prisma } from '@prisma/client'\n", "").replace(" async shutdown () {\n await prisma.$disconnect()\n process.exit(0)\n }", " async shutdown () {\n process.exit(0)\n }").replace(" * Shuts down the application by disconnecting from the database and exiting the process.", " * Shuts down the application and exits the process.").replace(/\n\s*if \((?:err|cause) instanceof Prisma\.PrismaClientKnownRequestError && (?:err|cause)\.code === "P2025"\) \{\n\s*error\.code = 404\n\s*error\.message = `\$\{(?:err|cause)\.meta\?\.modelName\} not found!`\n\s*\}\n/g, "\n").replace(/\n\s*if \((?:err|cause) instanceof ModelNotFoundException\) \{\n\s*error\.code = 404\n\s*error\.message = `\$\{(?:err|cause)\.getModelName\(\)\} not found!`\n\s*\}\n/g, "\n");
|
|
244
257
|
await (0, node_fs_promises.writeFile)(filePath, content, "utf-8");
|
|
245
258
|
}
|
|
246
259
|
}
|
package/bin/run.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.cjs","names":["templates: {\n name: string;\n alias: 'express' | 'h3' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","path","Resolver","Str","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/CreateArkstackCommand.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' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[] = [\n {\n name: 'Express Starter Kit',\n alias: 'express',\n hint: 'An Express application starter kit',\n source: 'github:toneflix/arkstack',\n },\n {\n name: 'Express Lean Starter Kit',\n alias: 'express-lean',\n hint: 'A minimal Express application starter kit',\n source: 'github:toneflix/arkstack',\n lean: true,\n baseAlias: 'express',\n },\n {\n name: 'H3 Starter Kit',\n alias: 'h3',\n hint: 'A H3 application starter kit',\n source: 'github:toneflix/arkstack',\n },\n {\n name: 'H3 Lean Starter Kit',\n alias: 'h3-lean',\n hint: 'A minimal H3 application starter kit',\n source: 'github:toneflix/arkstack',\n lean: true,\n baseAlias: 'h3',\n },\n ]\n\nexport const dependencyTemplates = {\n '@arkstack/common': '^0.1.4',\n '@arkstack/console': '^0.1.4',\n '@arkstack/contract': '^0.1.4',\n '@arkstack/driver-express': '^0.1.4'\n}","import { Logger, Resolver } from '@h3ravel/shared'\nimport { copyFile, readFile, rm, unlink, 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 { dependencyTemplates } from './templates'\nimport { downloadTemplate } from 'giget'\nimport { existsSync } from 'node:fs'\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 const status = await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n registry: await this.pm(),\n forceClean: false,\n })\n\n return status\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 Arkstack 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 delete pkg.scripts.predev\n delete pkg.scripts.prebuild\n delete pkg.scripts.precmd\n delete pkg.scripts.build\n delete pkg.scripts.dev\n\n pkg.name = Str.slugify(\n this.appName ?? basename(this.location!).replace('.', ''), '-'\n )\n\n if (this.description) {\n pkg.description = this.description\n }\n\n for (const [name, version] of Object.entries(dependencyTemplates)) {\n pkg.dependencies[name] = version\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!, '.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 async makeLeanProfile (_kit: 'express' | 'h3') {\n const filesToRemove = [\n 'src/app',\n 'src/models',\n 'database',\n 'src/routes/api.ts',\n 'src/core/database.ts',\n 'prisma',\n 'prisma.config.ts',\n 'arkorm.config.ts',\n 'arkormx.config.ts',\n ]\n\n await Promise.allSettled(\n filesToRemove.map((file) => rm(join(this.location!, file), { force: true, recursive: true })),\n )\n\n const pkgPath = join(this.location!, 'package.json')\n if (existsSync(pkgPath)) {\n const pkg = await readFile(pkgPath, 'utf-8').then(JSON.parse)\n const depsToRemove = [\n '@prisma/adapter-pg',\n '@prisma/client',\n 'pg',\n 'prisma',\n 'arkormx',\n '@types/pg',\n ]\n\n for (const dep of depsToRemove) {\n delete pkg.dependencies?.[dep]\n delete pkg.devDependencies?.[dep]\n }\n\n await writeFile(pkgPath, JSON.stringify(pkg, null, 2))\n }\n\n const filesToPatch = [\n 'src/core/app.ts',\n 'src/core/utils/request-handlers.ts',\n ]\n\n for (const file of filesToPatch) {\n const filePath = join(this.location!, file)\n\n if (!existsSync(filePath)) {\n continue\n }\n\n let content = await readFile(filePath, 'utf-8')\n\n content = content\n .replace('import { ModelNotFoundException } from \\'arkormx\\';\\n', '')\n .replace('import { prisma } from \\'src/core/database\\';\\n', '')\n .replace('import { Prisma } from \\'@prisma/client\\';\\n', '')\n .replace(' async shutdown () {\\n await prisma.$disconnect();\\n process.exit(0);\\n }', ' async shutdown () {\\n process.exit(0);\\n }')\n .replace(\n ' * Shuts down the application by disconnecting from the database and exiting the process.',\n ' * Shuts down the application and exits the process.',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof Prisma\\.PrismaClientKnownRequestError && (?:err|cause)\\.code === \"P2025\"\\) \\{\\n\\s*error\\.code = 404;\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.meta\\?\\.modelName\\} not found!`;\\n\\s*\\}\\n/g,\n '\\n',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof ModelNotFoundException\\) \\{\\n\\s*error\\.code = 404;\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.getModelName\\(\\)\\} not found!`;\\n\\s*\\}\\n/g,\n '\\n',\n )\n\n await writeFile(filePath, content, 'utf-8')\n }\n\n }\n}\n","import { readdir, rename, rm } from 'node:fs/promises'\n\nimport path from 'node:path'\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 CreateArkstackCommand extends Command {\n protected signature = `create-arkstack\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 // const defaultName = pathName ? Str.of(pathName).afterLast(\"/\") : undefined;\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\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: `arkstack-${template}`,\n // default: defaultName ?? `arkstack-${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 Arkstack.`,\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\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\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\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 selectedAlias = (kit.baseAlias ?? kit.alias).replace(/-lean$/i, '') as 'express' | 'h3'\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 && selectedAlias) {\n await cleanDirectoryExcept(result.dir, selectedAlias)\n await hoistDirectoryContents(result.dir, join(result.dir, selectedAlias))\n }\n\n if (kit.lean) {\n spinner.info(Logger.parse([[\n 'Applying lean profile...',\n 'green',\n ]], '', false)).start()\n await actions.makeLeanProfile(selectedAlias)\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 { CreateArkstackCommand } from './Commands/CreateArkstackCommand'\nimport { Kernel } from '@h3ravel/musket'\n\nclass Application { }\n\nKernel.init(new Application(), {\n rootCommand: CreateArkstackCommand,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAQP;CACF;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF;AAEH,MAAa,sBAAsB;CACjC,oBAAoB;CACpB,qBAAqB;CACrB,sBAAsB;CACtB,4BAA4B;CAC7B;;;;AC7CD,4BAAqB;CACnB;CAEA,YACE,AAAQC,UACR,AAAQC,SACR,AAAQC,aACR;EAHQ;EACA;EACA;AAER,MAAI,CAAC,KAAK,SACR,MAAK,+BAAgB,QAAQ,KAAK,EAA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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;;;;;;AClLnC,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' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","path","Resolver","Str","path","Command","AbortPromptError","ExitPromptError","Str","source: string","Actions","Logger","Kernel"],"sources":["../src/logo.ts","../src/templates.ts","../src/data.ts","../src/actions.ts","../src/utils.ts","../src/Commands/CreateArkstackCommand.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' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[] = [\n {\n name: 'Express Starter Kit',\n alias: 'express',\n hint: 'An Express application starter kit',\n source: 'github:arkstack-hq/arkstack',\n },\n {\n name: 'Express Lean Starter Kit',\n alias: 'express-lean',\n hint: 'A minimal Express application starter kit',\n source: 'github:arkstack-hq/arkstack',\n lean: true,\n baseAlias: 'express',\n },\n {\n name: 'H3 Starter Kit',\n alias: 'h3',\n hint: 'A H3 application starter kit',\n source: 'github:arkstack-hq/arkstack',\n },\n {\n name: 'H3 Lean Starter Kit',\n alias: 'h3-lean',\n hint: 'A minimal H3 application starter kit',\n source: 'github:arkstack-hq/arkstack',\n lean: true,\n baseAlias: 'h3',\n },\n ]","export const filesToRemove = [\n 'src/app',\n 'src/models',\n 'database',\n 'src/routes/api.ts',\n 'src/core/database.ts',\n 'prisma',\n 'prisma.config.ts',\n 'arkorm.config.ts',\n 'arkormx.config.ts',\n 'arkorm.config.js',\n 'arkormx.config.js',\n 'arkorm.config.mjs',\n 'arkormx.config.mjs',\n]\n\nexport const depsToRemove = [\n '@prisma/adapter-pg',\n '@arkstack/console',\n '@prisma/client',\n '@types/pg',\n 'pg',\n 'prisma',\n 'arkormx',\n]\n\nexport const depsToAdd = {\n '@arkstack/console-slim': '^0.1.4',\n}\n\nexport const depsList = {\n '@arkstack/common': '^0.1.4',\n '@arkstack/console': '^0.1.4',\n '@arkstack/contract': '^0.1.4',\n '@arkstack/driver-express': '^0.1.4'\n}","import { Logger, Resolver } from '@h3ravel/shared'\nimport { copyFile, readFile, rm, unlink, writeFile } from 'node:fs/promises'\nimport { depsToAdd, depsToRemove, filesToRemove } from './data'\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 { depsList } from './data'\nimport { downloadTemplate } from 'giget'\nimport { existsSync } from 'node:fs'\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 const status = await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n provider: 'github',\n registry: await this.pm(),\n forceClean: false,\n })\n\n return status\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 Arkstack 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 delete pkg.scripts.predev\n delete pkg.scripts.prebuild\n delete pkg.scripts.precmd\n delete pkg.scripts.build\n delete pkg.scripts.dev\n\n pkg.name = Str.slugify(\n this.appName ?? basename(this.location!).replace('.', ''), '-'\n )\n\n if (this.description) {\n pkg.description = this.description\n }\n\n for (const [name, version] of Object.entries(depsList)) {\n pkg.dependencies[name] = version\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!, '.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 async makeLeanProfile (_kit: 'express' | 'h3') {\n await Promise.allSettled(\n filesToRemove.map((file) => rm(join(this.location!, file), { force: true, recursive: true })),\n )\n\n const pkgPath = join(this.location!, 'package.json')\n if (existsSync(pkgPath)) {\n const pkg = await readFile(pkgPath, 'utf-8').then(JSON.parse)\n\n for (const dep of depsToRemove) {\n delete pkg.dependencies?.[dep]\n delete pkg.devDependencies?.[dep]\n }\n\n for (const [name, version] of Object.entries(depsToAdd)) {\n pkg.dependencies[name] = version\n }\n\n await writeFile(pkgPath, JSON.stringify(pkg, null, 2))\n }\n\n const filesToPatch = [\n 'src/core/app.ts',\n 'src/core/utils/request-handlers.ts',\n ]\n\n for (const file of filesToPatch) {\n const filePath = join(this.location!, file)\n\n if (!existsSync(filePath)) {\n continue\n }\n\n let content = await readFile(filePath, 'utf-8')\n\n content = content\n .replace('import { ModelNotFoundException } from \\'arkormx\\'\\n', '')\n .replace('import { prisma } from \\'src/core/database\\'\\n', '')\n .replace('import { Prisma } from \\'@prisma/client\\'\\n', '')\n .replace(' async shutdown () {\\n await prisma.$disconnect()\\n process.exit(0)\\n }', ' async shutdown () {\\n process.exit(0)\\n }')\n .replace(\n ' * Shuts down the application by disconnecting from the database and exiting the process.',\n ' * Shuts down the application and exits the process.',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof Prisma\\.PrismaClientKnownRequestError && (?:err|cause)\\.code === \"P2025\"\\) \\{\\n\\s*error\\.code = 404\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.meta\\?\\.modelName\\} not found!`\\n\\s*\\}\\n/g,\n '\\n',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof ModelNotFoundException\\) \\{\\n\\s*error\\.code = 404\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.getModelName\\(\\)\\} not found!`\\n\\s*\\}\\n/g,\n '\\n',\n )\n\n await writeFile(filePath, content, 'utf-8')\n }\n\n }\n}\n","import { readdir, rename, rm } from 'node:fs/promises'\n\nimport path from 'node:path'\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 CreateArkstackCommand extends Command {\n protected signature = `create-arkstack\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 // const defaultName = pathName ? Str.of(pathName).afterLast(\"/\") : undefined;\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\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: `arkstack-${template}`,\n // default: defaultName ?? `arkstack-${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 Arkstack.`,\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\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\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\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 selectedAlias = (kit.baseAlias ?? kit.alias).replace(/-lean$/i, '') as 'express' | 'h3'\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 && selectedAlias) {\n await cleanDirectoryExcept(result.dir, selectedAlias)\n await hoistDirectoryContents(result.dir, join(result.dir, selectedAlias))\n }\n\n if (kit.lean) {\n spinner.info(Logger.parse([[\n 'Applying lean profile...',\n 'green',\n ]], '', false)).start()\n await actions.makeLeanProfile(selectedAlias)\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 { CreateArkstackCommand } from './Commands/CreateArkstackCommand'\nimport { Kernel } from '@h3ravel/musket'\n\nclass Application { }\n\nKernel.init(new Application(), {\n rootCommand: CreateArkstackCommand,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAQP;CACF;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF;;;;ACjDH,MAAa,gBAAgB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;AAED,MAAa,eAAe;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACH;AAED,MAAa,YAAY,EACrB,0BAA0B,UAC7B;AAED,MAAa,WAAW;CACpB,oBAAoB;CACpB,qBAAqB;CACrB,sBAAsB;CACtB,4BAA4B;CAC/B;;;;ACvBD,4BAAqB;CACnB;CAEA,YACE,AAAQC,UACR,AAAQC,SACR,AAAQC,aACR;EAHQ;EACA;EACA;AAER,MAAI,CAAC,KAAK,SACR,MAAK,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,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;;;;;;AClLnC,IAAM,cAAN,MAAkB;AAElBC,wBAAO,KAAK,IAAI,aAAa,EAAE,EAC7B,aAAa,uBACd,CAAC"}
|
package/bin/run.js
CHANGED
|
@@ -32,13 +32,13 @@ const templates = [
|
|
|
32
32
|
name: "Express Starter Kit",
|
|
33
33
|
alias: "express",
|
|
34
34
|
hint: "An Express application starter kit",
|
|
35
|
-
source: "github:
|
|
35
|
+
source: "github:arkstack-hq/arkstack"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
name: "Express Lean Starter Kit",
|
|
39
39
|
alias: "express-lean",
|
|
40
40
|
hint: "A minimal Express application starter kit",
|
|
41
|
-
source: "github:
|
|
41
|
+
source: "github:arkstack-hq/arkstack",
|
|
42
42
|
lean: true,
|
|
43
43
|
baseAlias: "express"
|
|
44
44
|
},
|
|
@@ -46,18 +46,46 @@ const templates = [
|
|
|
46
46
|
name: "H3 Starter Kit",
|
|
47
47
|
alias: "h3",
|
|
48
48
|
hint: "A H3 application starter kit",
|
|
49
|
-
source: "github:
|
|
49
|
+
source: "github:arkstack-hq/arkstack"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
name: "H3 Lean Starter Kit",
|
|
53
53
|
alias: "h3-lean",
|
|
54
54
|
hint: "A minimal H3 application starter kit",
|
|
55
|
-
source: "github:
|
|
55
|
+
source: "github:arkstack-hq/arkstack",
|
|
56
56
|
lean: true,
|
|
57
57
|
baseAlias: "h3"
|
|
58
58
|
}
|
|
59
59
|
];
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/data.ts
|
|
63
|
+
const filesToRemove = [
|
|
64
|
+
"src/app",
|
|
65
|
+
"src/models",
|
|
66
|
+
"database",
|
|
67
|
+
"src/routes/api.ts",
|
|
68
|
+
"src/core/database.ts",
|
|
69
|
+
"prisma",
|
|
70
|
+
"prisma.config.ts",
|
|
71
|
+
"arkorm.config.ts",
|
|
72
|
+
"arkormx.config.ts",
|
|
73
|
+
"arkorm.config.js",
|
|
74
|
+
"arkormx.config.js",
|
|
75
|
+
"arkorm.config.mjs",
|
|
76
|
+
"arkormx.config.mjs"
|
|
77
|
+
];
|
|
78
|
+
const depsToRemove = [
|
|
79
|
+
"@prisma/adapter-pg",
|
|
80
|
+
"@arkstack/console",
|
|
81
|
+
"@prisma/client",
|
|
82
|
+
"@types/pg",
|
|
83
|
+
"pg",
|
|
84
|
+
"prisma",
|
|
85
|
+
"arkormx"
|
|
86
|
+
];
|
|
87
|
+
const depsToAdd = { "@arkstack/console-slim": "^0.1.4" };
|
|
88
|
+
const depsList = {
|
|
61
89
|
"@arkstack/common": "^0.1.4",
|
|
62
90
|
"@arkstack/console": "^0.1.4",
|
|
63
91
|
"@arkstack/contract": "^0.1.4",
|
|
@@ -103,6 +131,7 @@ var actions_default = class {
|
|
|
103
131
|
dir: this.location,
|
|
104
132
|
auth,
|
|
105
133
|
install,
|
|
134
|
+
provider: "github",
|
|
106
135
|
registry: await this.pm(),
|
|
107
136
|
forceClean: false
|
|
108
137
|
});
|
|
@@ -143,7 +172,7 @@ var actions_default = class {
|
|
|
143
172
|
delete pkg.scripts.dev;
|
|
144
173
|
pkg.name = Str.slugify(this.appName ?? basename(this.location).replace(".", ""), "-");
|
|
145
174
|
if (this.description) pkg.description = this.description;
|
|
146
|
-
for (const [name, version] of Object.entries(
|
|
175
|
+
for (const [name, version] of Object.entries(depsList)) pkg.dependencies[name] = version;
|
|
147
176
|
await Promise.allSettled([
|
|
148
177
|
writeFile(pkgPath, JSON.stringify(pkg, null, 2)),
|
|
149
178
|
this.removeLockFile(),
|
|
@@ -171,41 +200,25 @@ var actions_default = class {
|
|
|
171
200
|
if (existsSync(exampleEnvPath)) await copyFile(exampleEnvPath, envPath);
|
|
172
201
|
}
|
|
173
202
|
async makeLeanProfile(_kit) {
|
|
174
|
-
await Promise.allSettled(
|
|
175
|
-
"src/app",
|
|
176
|
-
"src/models",
|
|
177
|
-
"database",
|
|
178
|
-
"src/routes/api.ts",
|
|
179
|
-
"src/core/database.ts",
|
|
180
|
-
"prisma",
|
|
181
|
-
"prisma.config.ts",
|
|
182
|
-
"arkorm.config.ts",
|
|
183
|
-
"arkormx.config.ts"
|
|
184
|
-
].map((file) => rm(join(this.location, file), {
|
|
203
|
+
await Promise.allSettled(filesToRemove.map((file) => rm(join(this.location, file), {
|
|
185
204
|
force: true,
|
|
186
205
|
recursive: true
|
|
187
206
|
})));
|
|
188
207
|
const pkgPath = join(this.location, "package.json");
|
|
189
208
|
if (existsSync(pkgPath)) {
|
|
190
209
|
const pkg = await readFile(pkgPath, "utf-8").then(JSON.parse);
|
|
191
|
-
for (const dep of
|
|
192
|
-
"@prisma/adapter-pg",
|
|
193
|
-
"@prisma/client",
|
|
194
|
-
"pg",
|
|
195
|
-
"prisma",
|
|
196
|
-
"arkormx",
|
|
197
|
-
"@types/pg"
|
|
198
|
-
]) {
|
|
210
|
+
for (const dep of depsToRemove) {
|
|
199
211
|
delete pkg.dependencies?.[dep];
|
|
200
212
|
delete pkg.devDependencies?.[dep];
|
|
201
213
|
}
|
|
214
|
+
for (const [name, version] of Object.entries(depsToAdd)) pkg.dependencies[name] = version;
|
|
202
215
|
await writeFile(pkgPath, JSON.stringify(pkg, null, 2));
|
|
203
216
|
}
|
|
204
217
|
for (const file of ["src/core/app.ts", "src/core/utils/request-handlers.ts"]) {
|
|
205
218
|
const filePath = join(this.location, file);
|
|
206
219
|
if (!existsSync(filePath)) continue;
|
|
207
220
|
let content = await readFile(filePath, "utf-8");
|
|
208
|
-
content = content.replace("import { ModelNotFoundException } from 'arkormx'
|
|
221
|
+
content = content.replace("import { ModelNotFoundException } from 'arkormx'\n", "").replace("import { prisma } from 'src/core/database'\n", "").replace("import { Prisma } from '@prisma/client'\n", "").replace(" async shutdown () {\n await prisma.$disconnect()\n process.exit(0)\n }", " async shutdown () {\n process.exit(0)\n }").replace(" * Shuts down the application by disconnecting from the database and exiting the process.", " * Shuts down the application and exits the process.").replace(/\n\s*if \((?:err|cause) instanceof Prisma\.PrismaClientKnownRequestError && (?:err|cause)\.code === "P2025"\) \{\n\s*error\.code = 404\n\s*error\.message = `\$\{(?:err|cause)\.meta\?\.modelName\} not found!`\n\s*\}\n/g, "\n").replace(/\n\s*if \((?:err|cause) instanceof ModelNotFoundException\) \{\n\s*error\.code = 404\n\s*error\.message = `\$\{(?:err|cause)\.getModelName\(\)\} not found!`\n\s*\}\n/g, "\n");
|
|
209
222
|
await writeFile(filePath, content, "utf-8");
|
|
210
223
|
}
|
|
211
224
|
}
|
package/bin/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","names":["templates: {\n name: string;\n alias: 'express' | 'h3' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\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/CreateArkstackCommand.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' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[] = [\n {\n name: 'Express Starter Kit',\n alias: 'express',\n hint: 'An Express application starter kit',\n source: 'github:toneflix/arkstack',\n },\n {\n name: 'Express Lean Starter Kit',\n alias: 'express-lean',\n hint: 'A minimal Express application starter kit',\n source: 'github:toneflix/arkstack',\n lean: true,\n baseAlias: 'express',\n },\n {\n name: 'H3 Starter Kit',\n alias: 'h3',\n hint: 'A H3 application starter kit',\n source: 'github:toneflix/arkstack',\n },\n {\n name: 'H3 Lean Starter Kit',\n alias: 'h3-lean',\n hint: 'A minimal H3 application starter kit',\n source: 'github:toneflix/arkstack',\n lean: true,\n baseAlias: 'h3',\n },\n ]\n\nexport const dependencyTemplates = {\n '@arkstack/common': '^0.1.4',\n '@arkstack/console': '^0.1.4',\n '@arkstack/contract': '^0.1.4',\n '@arkstack/driver-express': '^0.1.4'\n}","import { Logger, Resolver } from '@h3ravel/shared'\nimport { copyFile, readFile, rm, unlink, 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 { dependencyTemplates } from './templates'\nimport { downloadTemplate } from 'giget'\nimport { existsSync } from 'node:fs'\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 const status = await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n registry: await this.pm(),\n forceClean: false,\n })\n\n return status\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 Arkstack 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 delete pkg.scripts.predev\n delete pkg.scripts.prebuild\n delete pkg.scripts.precmd\n delete pkg.scripts.build\n delete pkg.scripts.dev\n\n pkg.name = Str.slugify(\n this.appName ?? basename(this.location!).replace('.', ''), '-'\n )\n\n if (this.description) {\n pkg.description = this.description\n }\n\n for (const [name, version] of Object.entries(dependencyTemplates)) {\n pkg.dependencies[name] = version\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!, '.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 async makeLeanProfile (_kit: 'express' | 'h3') {\n const filesToRemove = [\n 'src/app',\n 'src/models',\n 'database',\n 'src/routes/api.ts',\n 'src/core/database.ts',\n 'prisma',\n 'prisma.config.ts',\n 'arkorm.config.ts',\n 'arkormx.config.ts',\n ]\n\n await Promise.allSettled(\n filesToRemove.map((file) => rm(join(this.location!, file), { force: true, recursive: true })),\n )\n\n const pkgPath = join(this.location!, 'package.json')\n if (existsSync(pkgPath)) {\n const pkg = await readFile(pkgPath, 'utf-8').then(JSON.parse)\n const depsToRemove = [\n '@prisma/adapter-pg',\n '@prisma/client',\n 'pg',\n 'prisma',\n 'arkormx',\n '@types/pg',\n ]\n\n for (const dep of depsToRemove) {\n delete pkg.dependencies?.[dep]\n delete pkg.devDependencies?.[dep]\n }\n\n await writeFile(pkgPath, JSON.stringify(pkg, null, 2))\n }\n\n const filesToPatch = [\n 'src/core/app.ts',\n 'src/core/utils/request-handlers.ts',\n ]\n\n for (const file of filesToPatch) {\n const filePath = join(this.location!, file)\n\n if (!existsSync(filePath)) {\n continue\n }\n\n let content = await readFile(filePath, 'utf-8')\n\n content = content\n .replace('import { ModelNotFoundException } from \\'arkormx\\';\\n', '')\n .replace('import { prisma } from \\'src/core/database\\';\\n', '')\n .replace('import { Prisma } from \\'@prisma/client\\';\\n', '')\n .replace(' async shutdown () {\\n await prisma.$disconnect();\\n process.exit(0);\\n }', ' async shutdown () {\\n process.exit(0);\\n }')\n .replace(\n ' * Shuts down the application by disconnecting from the database and exiting the process.',\n ' * Shuts down the application and exits the process.',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof Prisma\\.PrismaClientKnownRequestError && (?:err|cause)\\.code === \"P2025\"\\) \\{\\n\\s*error\\.code = 404;\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.meta\\?\\.modelName\\} not found!`;\\n\\s*\\}\\n/g,\n '\\n',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof ModelNotFoundException\\) \\{\\n\\s*error\\.code = 404;\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.getModelName\\(\\)\\} not found!`;\\n\\s*\\}\\n/g,\n '\\n',\n )\n\n await writeFile(filePath, content, 'utf-8')\n }\n\n }\n}\n","import { readdir, rename, rm } from 'node:fs/promises'\n\nimport path from 'node:path'\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 CreateArkstackCommand extends Command {\n protected signature = `create-arkstack\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 // const defaultName = pathName ? Str.of(pathName).afterLast(\"/\") : undefined;\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\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: `arkstack-${template}`,\n // default: defaultName ?? `arkstack-${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 Arkstack.`,\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\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\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\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 selectedAlias = (kit.baseAlias ?? kit.alias).replace(/-lean$/i, '') as 'express' | 'h3'\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 && selectedAlias) {\n await cleanDirectoryExcept(result.dir, selectedAlias)\n await hoistDirectoryContents(result.dir, join(result.dir, selectedAlias))\n }\n\n if (kit.lean) {\n spinner.info(Logger.parse([[\n 'Applying lean profile...',\n 'green',\n ]], '', false)).start()\n await actions.makeLeanProfile(selectedAlias)\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 { CreateArkstackCommand } from './Commands/CreateArkstackCommand'\nimport { Kernel } from '@h3ravel/musket'\n\nclass Application { }\n\nKernel.init(new Application(), {\n rootCommand: CreateArkstackCommand,\n})\n"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAQP;CACF;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF;AAEH,MAAa,sBAAsB;CACjC,oBAAoB;CACpB,qBAAqB;CACrB,sBAAsB;CACtB,4BAA4B;CAC7B;;;;AC7CD,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,KAAM;AACV,SAAQ,MAAM,sBAAsB,IAAK;;CAG3C,MAAM,OAAQ,MAAe,OAAO;AAClC,MAAI,IAAK,QAAO;EAEhB,MAAM,KAAK,MAAM,KAAK,IAAI;AAE1B,SAAO,OAAO,QAA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IAAI,MAAM,CAAC,CAAC,OAAO;AACrF,QAAM,QAAQ,gBAAgB;AAE9B,UAAQ,QAAQ,OAAO,MAAM,CAAC,CAAC,oCAAoC,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC;AAEzF,QAAM,QAAQ,SAAS,QAAQ;;;;;;AClLnC,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' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[]","location?: string","appName?: string","description?: string","source: string","Actions"],"sources":["../src/logo.ts","../src/templates.ts","../src/data.ts","../src/actions.ts","../src/utils.ts","../src/Commands/CreateArkstackCommand.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' | 'express-lean' | 'h3-lean';\n hint: string;\n source: string;\n lean?: boolean;\n baseAlias?: 'express' | 'h3';\n prereleaseSource?: string;\n}[] = [\n {\n name: 'Express Starter Kit',\n alias: 'express',\n hint: 'An Express application starter kit',\n source: 'github:arkstack-hq/arkstack',\n },\n {\n name: 'Express Lean Starter Kit',\n alias: 'express-lean',\n hint: 'A minimal Express application starter kit',\n source: 'github:arkstack-hq/arkstack',\n lean: true,\n baseAlias: 'express',\n },\n {\n name: 'H3 Starter Kit',\n alias: 'h3',\n hint: 'A H3 application starter kit',\n source: 'github:arkstack-hq/arkstack',\n },\n {\n name: 'H3 Lean Starter Kit',\n alias: 'h3-lean',\n hint: 'A minimal H3 application starter kit',\n source: 'github:arkstack-hq/arkstack',\n lean: true,\n baseAlias: 'h3',\n },\n ]","export const filesToRemove = [\n 'src/app',\n 'src/models',\n 'database',\n 'src/routes/api.ts',\n 'src/core/database.ts',\n 'prisma',\n 'prisma.config.ts',\n 'arkorm.config.ts',\n 'arkormx.config.ts',\n 'arkorm.config.js',\n 'arkormx.config.js',\n 'arkorm.config.mjs',\n 'arkormx.config.mjs',\n]\n\nexport const depsToRemove = [\n '@prisma/adapter-pg',\n '@arkstack/console',\n '@prisma/client',\n '@types/pg',\n 'pg',\n 'prisma',\n 'arkormx',\n]\n\nexport const depsToAdd = {\n '@arkstack/console-slim': '^0.1.4',\n}\n\nexport const depsList = {\n '@arkstack/common': '^0.1.4',\n '@arkstack/console': '^0.1.4',\n '@arkstack/contract': '^0.1.4',\n '@arkstack/driver-express': '^0.1.4'\n}","import { Logger, Resolver } from '@h3ravel/shared'\nimport { copyFile, readFile, rm, unlink, writeFile } from 'node:fs/promises'\nimport { depsToAdd, depsToRemove, filesToRemove } from './data'\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 { depsList } from './data'\nimport { downloadTemplate } from 'giget'\nimport { existsSync } from 'node:fs'\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 const status = await downloadTemplate(template, {\n dir: this.location,\n auth,\n install,\n provider: 'github',\n registry: await this.pm(),\n forceClean: false,\n })\n\n return status\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 Arkstack 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 delete pkg.scripts.predev\n delete pkg.scripts.prebuild\n delete pkg.scripts.precmd\n delete pkg.scripts.build\n delete pkg.scripts.dev\n\n pkg.name = Str.slugify(\n this.appName ?? basename(this.location!).replace('.', ''), '-'\n )\n\n if (this.description) {\n pkg.description = this.description\n }\n\n for (const [name, version] of Object.entries(depsList)) {\n pkg.dependencies[name] = version\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!, '.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 async makeLeanProfile (_kit: 'express' | 'h3') {\n await Promise.allSettled(\n filesToRemove.map((file) => rm(join(this.location!, file), { force: true, recursive: true })),\n )\n\n const pkgPath = join(this.location!, 'package.json')\n if (existsSync(pkgPath)) {\n const pkg = await readFile(pkgPath, 'utf-8').then(JSON.parse)\n\n for (const dep of depsToRemove) {\n delete pkg.dependencies?.[dep]\n delete pkg.devDependencies?.[dep]\n }\n\n for (const [name, version] of Object.entries(depsToAdd)) {\n pkg.dependencies[name] = version\n }\n\n await writeFile(pkgPath, JSON.stringify(pkg, null, 2))\n }\n\n const filesToPatch = [\n 'src/core/app.ts',\n 'src/core/utils/request-handlers.ts',\n ]\n\n for (const file of filesToPatch) {\n const filePath = join(this.location!, file)\n\n if (!existsSync(filePath)) {\n continue\n }\n\n let content = await readFile(filePath, 'utf-8')\n\n content = content\n .replace('import { ModelNotFoundException } from \\'arkormx\\'\\n', '')\n .replace('import { prisma } from \\'src/core/database\\'\\n', '')\n .replace('import { Prisma } from \\'@prisma/client\\'\\n', '')\n .replace(' async shutdown () {\\n await prisma.$disconnect()\\n process.exit(0)\\n }', ' async shutdown () {\\n process.exit(0)\\n }')\n .replace(\n ' * Shuts down the application by disconnecting from the database and exiting the process.',\n ' * Shuts down the application and exits the process.',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof Prisma\\.PrismaClientKnownRequestError && (?:err|cause)\\.code === \"P2025\"\\) \\{\\n\\s*error\\.code = 404\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.meta\\?\\.modelName\\} not found!`\\n\\s*\\}\\n/g,\n '\\n',\n )\n .replace(\n /\\n\\s*if \\((?:err|cause) instanceof ModelNotFoundException\\) \\{\\n\\s*error\\.code = 404\\n\\s*error\\.message = `\\$\\{(?:err|cause)\\.getModelName\\(\\)\\} not found!`\\n\\s*\\}\\n/g,\n '\\n',\n )\n\n await writeFile(filePath, content, 'utf-8')\n }\n\n }\n}\n","import { readdir, rename, rm } from 'node:fs/promises'\n\nimport path from 'node:path'\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 CreateArkstackCommand extends Command {\n protected signature = `create-arkstack\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 // const defaultName = pathName ? Str.of(pathName).afterLast(\"/\") : undefined;\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\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: `arkstack-${template}`,\n // default: defaultName ?? `arkstack-${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 Arkstack.`,\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\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\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\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 selectedAlias = (kit.baseAlias ?? kit.alias).replace(/-lean$/i, '') as 'express' | 'h3'\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 && selectedAlias) {\n await cleanDirectoryExcept(result.dir, selectedAlias)\n await hoistDirectoryContents(result.dir, join(result.dir, selectedAlias))\n }\n\n if (kit.lean) {\n spinner.info(Logger.parse([[\n 'Applying lean profile...',\n 'green',\n ]], '', false)).start()\n await actions.makeLeanProfile(selectedAlias)\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 { CreateArkstackCommand } from './Commands/CreateArkstackCommand'\nimport { Kernel } from '@h3ravel/musket'\n\nclass Application { }\n\nKernel.init(new Application(), {\n rootCommand: CreateArkstackCommand,\n})\n"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;;;;ACYjC,MAAaA,YAQP;CACF;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACT;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF;;;;ACjDH,MAAa,gBAAgB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;AAED,MAAa,eAAe;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACH;AAED,MAAa,YAAY,EACrB,0BAA0B,UAC7B;AAED,MAAa,WAAW;CACpB,oBAAoB;CACpB,qBAAqB;CACrB,sBAAsB;CACtB,4BAA4B;CAC/B;;;;ACvBD,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,KAAM;AACV,SAAQ,MAAM,sBAAsB,IAAK;;CAG3C,MAAM,OAAQ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