first commit

This commit is contained in:
2024-10-22 00:23:28 +02:00
commit 22de3d65ee
5 changed files with 114 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
node_modules
build
npm-debug.log
.env
.DS_Store

13
LICENCE.txt Normal file
View File

@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

41
bin/index.js Executable file
View File

@@ -0,0 +1,41 @@
#! /usr/bin/env node
const path = require("node:path");
const { execSync } = require("child_process");
const readlineSync = require("readline-sync");
const variants = ["NestJS", "ExpressJS"];
const variant_branch_mapping = { NestJS: "nestjs", ExpressJS: "express" };
console.log("\x1b[34mBackend framework variants:\x1b[0m");
const variant = readlineSync.keyInSelect(
variants,
"\x1b[34m>\x1b[0m Choose backend framework",
);
if (variant < 0) {
console.log("\x1b[31mBye!\x1b[0m");
return;
} else {
const project_name = readlineSync.question(
"\x1b[34m>\x1b[0m Project name (empty for default): \x1b[0m",
);
const git_command =
"git clone -b " +
variant_branch_mapping[variants[variant]] +
" https://github.com/dqnid/full-stack-archetype.git " +
project_name;
console.log("\x1b[34mCloning the repo...\x1b[0m");
console.log("\x1b[34m-------------------\x1b[0m");
execSync(git_command, {
stdio: [0, 1, 2], // stdin, stdout, stderr
cwd: path.resolve(""),
});
console.log("\x1b[32m-----\x1b[0m");
console.log("\x1b[32mDone!\x1b[0m");
console.log("\x1b[32m-----\x1b[0m");
}

28
package-lock.json generated Normal file
View File

@@ -0,0 +1,28 @@
{
"name": "@dqnid/arch-bootstrap",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@dqnid/arch-bootstrap",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"readline-sync": "^1.4.10"
},
"bin": {
"arch-bootstrap": "bin/index.js"
}
},
"node_modules/readline-sync": {
"version": "1.4.10",
"resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz",
"integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==",
"license": "MIT",
"engines": {
"node": ">= 0.8.0"
}
}
}
}

27
package.json Normal file
View File

@@ -0,0 +1,27 @@
{
"name": "@dqnid/arch-bootstrap",
"version": "1.0.0",
"description": "NPX archetype bootstrap utility",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"bin": {
"@dqnid/arch-bootstrap": "bin/index.js"
},
"keywords": [
"npx",
"npm",
"node",
"nextjs",
"nestjs",
"express",
"mysql",
"docker"
],
"author": "Daniel Heras Quesada",
"license": "ISC",
"dependencies": {
"readline-sync": "^1.4.10"
}
}