nero-init 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Roshan Singh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # nero-init
2
+
3
+ <br >
4
+
5
+ Minimal project scaffold for my personal workflow.
6
+
7
+ Creates opinionated starter templates for:
8
+
9
+ - CLI tools
10
+ - Libraries
11
+ - Web (coming soon)
12
+
13
+ <br >
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ npx nero-init
19
+ ```
20
+
21
+ <br >
22
+
23
+ ## License
24
+
25
+ MIT
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { promptUser } from './prompt.js';
3
+ import { selectTemplate } from './templates.js';
4
+ import { renderTemplate } from './renderer.js';
5
+ import { postInstall } from './install.js';
6
+ async function run() {
7
+ const answers = await promptUser();
8
+ const template = await selectTemplate(answers);
9
+ const render = await renderTemplate(template, answers);
10
+ const install = await postInstall(template, answers);
11
+ }
12
+ await run();
@@ -0,0 +1,109 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import chalk from 'chalk';
5
+ import ora from 'ora';
6
+ // Aesthetic gradient and box drawing characters
7
+ // Premium muted palette (dark-terminal friendly)
8
+ const theme = {
9
+ brand: '#7C7CFF', // Soft indigo (hero color)
10
+ accent: '#22D3EE', // Subtle cyan highlight
11
+ success: '#34D399', // Mint green
12
+ warning: '#FBBF24', // Amber (real warning color now 😄)
13
+ error: '#F87171', // Soft red
14
+ text: '#E5E7EB', // Light gray
15
+ muted: '#9CA3AF', // Muted gray
16
+ border: '#374151', // Slate border
17
+ };
18
+ const symbols = {
19
+ success: '✔',
20
+ warning: '!',
21
+ error: '×',
22
+ info: '•',
23
+ arrow: '›',
24
+ corner: '└─',
25
+ pipe: '│ ',
26
+ branch: '├─',
27
+ };
28
+ export async function postInstall(template, answers) {
29
+ const projectDir = path.resolve(process.cwd(), answers.projectName);
30
+ console.log();
31
+ printHeader();
32
+ console.log();
33
+ await initGit(projectDir);
34
+ printNextSteps(template, answers);
35
+ }
36
+ function printHeader() {
37
+ const title = 'Setting up your project';
38
+ const width = 48;
39
+ console.log(chalk.hex(theme.border)('┌' + '─'.repeat(width) + '┐'));
40
+ console.log(chalk.hex(theme.border)('│ ') +
41
+ chalk.bold.hex(theme.brand)(title) +
42
+ ' '.repeat(width - title.length - 1) +
43
+ chalk.hex(theme.border)('│'));
44
+ console.log(chalk.hex(theme.border)('└' + '─'.repeat(width) + '┘'));
45
+ }
46
+ async function initGit(dir) {
47
+ if (fs.existsSync(path.join(dir, '.git'))) {
48
+ console.log(chalk.hex(theme.muted)(` ${symbols.info} Git repository already exists`));
49
+ return;
50
+ }
51
+ const spinner = ora({
52
+ text: chalk.hex(theme.text)('Initializing git repository'),
53
+ prefixText: chalk.hex(theme.muted)('›'),
54
+ spinner: 'line',
55
+ }).start();
56
+ // Simulate a small delay for better UX
57
+ await new Promise((resolve) => setTimeout(resolve, 300));
58
+ try {
59
+ const result = spawnSync('git', ['init'], {
60
+ cwd: dir,
61
+ stdio: 'pipe',
62
+ });
63
+ if (result.status === 0) {
64
+ spinner.stopAndPersist({
65
+ symbol: chalk.hex(theme.success)(`${symbols.success}`),
66
+ text: chalk.hex(theme.success)('Git repository initialized'),
67
+ });
68
+ }
69
+ else {
70
+ spinner.stopAndPersist({
71
+ symbol: chalk.hex(theme.warning)(`${symbols.warning}`),
72
+ text: chalk.hex(theme.warning)('Git initialization skipped'),
73
+ });
74
+ console.log(chalk.hex(theme.muted)(` ${symbols.corner} No git binary found`));
75
+ }
76
+ }
77
+ catch (error) {
78
+ spinner.stopAndPersist({
79
+ symbol: chalk.hex('#EF4444')(`${symbols.error}`),
80
+ text: chalk.hex('#EF4444')('Failed to initialize git'),
81
+ });
82
+ console.log(chalk.hex(theme.muted)(` ${symbols.corner} Make sure git is installed`));
83
+ }
84
+ }
85
+ function printNextSteps(template, answers) {
86
+ console.log();
87
+ console.log(chalk.hex(theme.border)('─'.repeat(52)));
88
+ console.log();
89
+ console.log(chalk.bold.hex(theme.success)(` ${symbols.success} Project ready`));
90
+ console.log();
91
+ console.log(chalk.hex(theme.muted)(' Next steps'));
92
+ console.log();
93
+ const steps = [
94
+ `cd ${answers.projectName}`,
95
+ template.commands.install,
96
+ template.commands.dev,
97
+ template.commands.build,
98
+ ];
99
+ steps.forEach((cmd, i) => {
100
+ const connector = i === steps.length - 1 ? symbols.corner : symbols.branch;
101
+ console.log(chalk.hex(theme.muted)(` ${connector}`) +
102
+ chalk.hex(theme.brand).bold(` ${cmd}`));
103
+ });
104
+ console.log();
105
+ console.log(chalk.hex(theme.border)('─'.repeat(52)));
106
+ console.log();
107
+ console.log(chalk.hex(theme.muted)(' Enjoy unemployment.'));
108
+ console.log();
109
+ }
package/dist/prompt.js ADDED
@@ -0,0 +1,30 @@
1
+ import { input, select } from '@inquirer/prompts';
2
+ export async function promptUser() {
3
+ const projectName = await input({
4
+ message: 'Project name:',
5
+ default: 'nero-app',
6
+ validate(value) {
7
+ if (!value.trim())
8
+ return '✗ Project name cannot be empty';
9
+ if (value.includes(' '))
10
+ return '✗ Project name cannot contain spaces';
11
+ if (!/^[a-z0-9-_]+$/i.test(value))
12
+ return '✗ Use only letters, numbers, hyphens, and underscores';
13
+ return true;
14
+ },
15
+ transformer(value) {
16
+ return value;
17
+ },
18
+ });
19
+ const projectType = await select({
20
+ message: 'Select project type:',
21
+ choices: [
22
+ { name: 'cli', value: 'cli' },
23
+ { name: 'library', value: 'library' },
24
+ ],
25
+ });
26
+ return {
27
+ projectName,
28
+ type: projectType,
29
+ };
30
+ }
@@ -0,0 +1,47 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ const TEMPLATE_ROOT = new URL('./templates/', import.meta.url);
4
+ export async function renderTemplate(template, answers) {
5
+ const targetDir = path.resolve(process.cwd(), answers.projectName);
6
+ const templateDir = path.resolve(TEMPLATE_ROOT.pathname, template.id);
7
+ if (fs.existsSync(targetDir)) {
8
+ throw new Error(`Directory ${answers.projectName} already exists`);
9
+ }
10
+ fs.mkdirSync(targetDir, { recursive: true });
11
+ copyDir(templateDir, targetDir, answers, template.placeholders);
12
+ }
13
+ function copyDir(src, dest, answers, placeholders) {
14
+ const entries = fs.readdirSync(src, { withFileTypes: true });
15
+ for (const entry of entries) {
16
+ const srcPath = path.join(src, entry.name);
17
+ const outName = entry.name.startsWith('_')
18
+ ? `.${entry.name.slice(1)}`
19
+ : entry.name;
20
+ const destPath = path.join(dest, outName);
21
+ if (entry.isDirectory()) {
22
+ fs.mkdirSync(destPath, { recursive: true });
23
+ copyDir(srcPath, destPath, answers, placeholders);
24
+ continue;
25
+ }
26
+ const stat = fs.statSync(srcPath);
27
+ if (stat.isDirectory()) {
28
+ fs.mkdirSync(destPath, { recursive: true });
29
+ copyDir(srcPath, destPath, answers, placeholders);
30
+ continue;
31
+ }
32
+ // now it's GUARANTEED to be a file
33
+ let content = fs.readFileSync(srcPath, 'utf8');
34
+ content = applyPlaceholders(content, answers, placeholders);
35
+ fs.writeFileSync(destPath, content);
36
+ }
37
+ }
38
+ function applyPlaceholders(content, answers, placeholders) {
39
+ let result = content;
40
+ for (const key of placeholders) {
41
+ const value = answers[key];
42
+ if (value == null)
43
+ continue;
44
+ result = result.replaceAll(`{{${key}}}`, String(value));
45
+ }
46
+ return result;
47
+ }
@@ -0,0 +1,4 @@
1
+ dist
2
+ node_modules
3
+ pnpm-lock.yaml
4
+ assets
@@ -0,0 +1,6 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "printWidth": 80,
5
+ "trailingComma": "es5"
6
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Roshan Singh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
File without changes
@@ -0,0 +1,40 @@
1
+ import tseslint from '@typescript-eslint/eslint-plugin'
2
+ import parser from '@typescript-eslint/parser'
3
+
4
+ export default [
5
+ {
6
+ ignores: ['dist/**', 'node_modules/**', 'assets/**'],
7
+ },
8
+ {
9
+ files: ['**/*.ts'],
10
+
11
+ languageOptions: {
12
+ parser,
13
+ parserOptions: {
14
+ ecmaVersion: 'latest',
15
+ sourceType: 'module',
16
+ },
17
+ },
18
+ plugins: {
19
+ '@typescript-eslint': tseslint,
20
+ },
21
+ rules: {
22
+ // correctness
23
+ 'no-unused-vars': 'off',
24
+ '@typescript-eslint/no-unused-vars': [
25
+ 'error',
26
+ { argsIgnorePattern: '^_' },
27
+ ],
28
+
29
+ 'no-shadow': 'off',
30
+ '@typescript-eslint/no-shadow': 'error',
31
+
32
+ 'no-redeclare': 'off',
33
+ '@typescript-eslint/no-redeclare': 'error',
34
+
35
+ // sanity
36
+ 'no-console': 'error',
37
+ 'prefer-const': 'error',
38
+ },
39
+ },
40
+ ]
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "type": "module",
6
+ "bin": {
7
+ "{{projectName}}": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "dev": "tsx src/index.ts",
16
+ "build": "tsc",
17
+ "typecheck": "tsc --noEmit",
18
+ "test": "vitest",
19
+ "format": "prettier --write .",
20
+ "format:check": "prettier --check .",
21
+ "lint": "eslint .",
22
+ "lint:fix": "eslint . --fix",
23
+ "prepublishOnly": "npm run build",
24
+ "postbuild": "chmod +x dist/index.js"
25
+ },
26
+ "engines": {
27
+ "node": ">=18"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/alcanivorax/{{projectName}.git"
32
+ },
33
+ "keywords": [
34
+ "cli"
35
+ ],
36
+ "author": "alcanivorax",
37
+ "license": "MIT",
38
+ "packageManager": "pnpm@10.28.0",
39
+ "devDependencies": {
40
+ "@types/node": "^25.0.9",
41
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
42
+ "@typescript-eslint/parser": "^8.53.1",
43
+ "eslint": "^9.39.2",
44
+ "prettier": "^3.8.1",
45
+ "tsx": "^4.21.0",
46
+ "typescript": "^5.9.3",
47
+ "vitest": "^4.0.18"
48
+ }
49
+ }
@@ -0,0 +1 @@
1
+ export const args = process.argv.splice(2)
@@ -0,0 +1,45 @@
1
+ import { args } from './args.js'
2
+ import pkg from '../../package.json' with {type: "json"}
3
+
4
+
5
+ function printHelp(): void {
6
+ console.log(`
7
+ ${pkg} - a cli
8
+ Usage:
9
+ ${pkg.name} [options]
10
+
11
+ Options:
12
+ -h, --help, help Show help
13
+ -v, --version, version Show version
14
+ `)
15
+ }
16
+
17
+ function printVersion(): void {
18
+ console.log(`
19
+ ${pkg.name} version ${pkg.version}
20
+ `)
21
+ }
22
+ function printInvalidOptions(option: string): void {
23
+ console.error(`
24
+ unknown option: ${option}
25
+ usage: ${pkg.name} [-v | --version] [-h | --help]
26
+ `)
27
+ }
28
+
29
+ export function handleCliOptions(): void {
30
+ if(args.length === 0) return
31
+
32
+ if(args.includes('-h') || args.includes('--help') || args.includes('help')){
33
+ printHelp()
34
+ process.exit(0)
35
+ }
36
+
37
+ if(args.includes('-v') || args.includes('--version') || args.includes('version')) {
38
+ printVersion()
39
+ process.exit(0)
40
+ }
41
+
42
+
43
+ printInvalidOptions(args[0]);
44
+ process.exit(2)
45
+ }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ import pkg from '../package.json' with { type: 'json' }
4
+ import { handleCliOptions } from './cli/options.js'
5
+
6
+ async function run() {
7
+ handleCliOptions()
8
+ console.log(`${pkg.name} is running...`)
9
+ }
10
+
11
+ await run()
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+
7
+ "outDir": "dist",
8
+ "rootDir": "src",
9
+
10
+ "strict": true,
11
+ "skipLibCheck": true,
12
+
13
+ "esModuleInterop": true,
14
+ "resolveJsonModule": true,
15
+
16
+ "declaration": false,
17
+ "declarationMap": false,
18
+ "sourceMap": false,
19
+
20
+ "noEmitOnError": true,
21
+ "forceConsistentCasingInFileNames": true,
22
+
23
+ "types": ["node"]
24
+ },
25
+ "include": ["src", "index.ts"],
26
+ "exclude": [
27
+ "**/__tests__/**",
28
+ "**/__test__/**",
29
+ "**/*.test.ts",
30
+ "**/*.spec.ts"
31
+ ]
32
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vitest/config'
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ include: ['src/**/*.test.ts'],
6
+ },
7
+ })
@@ -0,0 +1,4 @@
1
+ dist
2
+ node_modules
3
+ pnpm-lock.yaml
4
+ assets
@@ -0,0 +1,6 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "printWidth": 80,
5
+ "trailingComma": "es5"
6
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 [Author]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
File without changes
@@ -0,0 +1,40 @@
1
+ import tseslint from "@typescript-eslint/eslint-plugin";
2
+ import parser from "@typescript-eslint/parser";
3
+
4
+ export default [
5
+ {
6
+ ignores: ["dist/**", "node_modules/**", "assets/**"],
7
+ },
8
+ {
9
+ files: ["**/*.ts"],
10
+
11
+ languageOptions: {
12
+ parser,
13
+ parserOptions: {
14
+ ecmaVersion: "latest",
15
+ sourceType: "module",
16
+ },
17
+ },
18
+ plugins: {
19
+ "@typescript-eslint": tseslint,
20
+ },
21
+ rules: {
22
+ // correctness
23
+ "no-unused-vars": "off",
24
+ "@typescript-eslint/no-unused-vars": [
25
+ "error",
26
+ { argsIgnorePattern: "^_" },
27
+ ],
28
+
29
+ "no-shadow": "off",
30
+ "@typescript-eslint/no-shadow": "error",
31
+
32
+ "no-redeclare": "off",
33
+ "@typescript-eslint/no-redeclare": "error",
34
+
35
+ // sanity
36
+ "no-console": "error",
37
+ "prefer-const": "error",
38
+ },
39
+ },
40
+ ];
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "dev": "tsx src/index.ts",
16
+ "build": "tsc",
17
+ "typecheck": "tsc --noEmit",
18
+ "test": "vitest",
19
+ "format": "prettier --write .",
20
+ "format:check": "prettier --check .",
21
+ "lint": "eslint .",
22
+ "lint:fix": "eslint . --fix",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/alcanivorax/{{projectName}}.git"
31
+ },
32
+ "keywords": [],
33
+ "author": "alcanivorax",
34
+ "license": "MIT",
35
+ "packageManager": "pnpm@10.28.0",
36
+ "devDependencies": {
37
+ "@types/node": "^25.0.9",
38
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
39
+ "@typescript-eslint/parser": "^8.53.1",
40
+ "eslint": "^9.39.2",
41
+ "prettier": "^3.8.1",
42
+ "tsx": "^4.21.0",
43
+ "typescript": "^5.9.3",
44
+ "vitest": "^4.0.18"
45
+ }
46
+ }
@@ -0,0 +1 @@
1
+ console.log("library");
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+
7
+ "outDir": "dist",
8
+ "rootDir": "src",
9
+
10
+ "strict": true,
11
+ "skipLibCheck": true,
12
+
13
+ "esModuleInterop": true,
14
+
15
+ "declaration": true,
16
+ "declarationMap": true,
17
+ "sourceMap": true,
18
+ "noEmitOnError": true,
19
+
20
+ "forceConsistentCasingInFileNames": true,
21
+ "types": ["node"]
22
+ },
23
+ "include": ["src"]
24
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vitest/config'
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ include: ['src/**/*.test.ts'],
6
+ },
7
+ })
@@ -0,0 +1,20 @@
1
+ [
2
+ {
3
+ "id": "cli",
4
+ "placeholders": ["projectName"],
5
+ "commands": {
6
+ "install": "pnpm install",
7
+ "dev": "pnpm dev",
8
+ "build": "pnpm build"
9
+ }
10
+ },
11
+ {
12
+ "id": "library",
13
+ "placeholders": ["projectName"],
14
+ "commands": {
15
+ "install": "pnpm install",
16
+ "dev": "pnpm dev",
17
+ "build": "pnpm build"
18
+ }
19
+ }
20
+ ]
@@ -0,0 +1,5 @@
1
+ import rawTemplates from './templates/templates.json' with { type: 'json' };
2
+ const templates = rawTemplates;
3
+ export async function selectTemplate(answers) {
4
+ return templates.find((t) => t.id === answers.type); // source: trust me!
5
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "nero-init",
3
+ "version": "1.0.0",
4
+ "description": "Project scaffold for CLI, library and Web templates.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "bin": {
15
+ "nero-init": "./dist/index.js"
16
+ },
17
+ "scripts": {
18
+ "dev": "tsx src/index.ts",
19
+ "build": "tsc && cp -r src/templates dist/",
20
+ "format": "prettier --write .",
21
+ "lint": "eslint .",
22
+ "prepublishOnly": "npm run build",
23
+ "postbuild": "chmod +x dist/index.js"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/alcanivorax/nero-init.git"
36
+ },
37
+ "keywords": [
38
+ "scaffold",
39
+ "project-generator",
40
+ "starter-template",
41
+ "cli",
42
+ "typescript",
43
+ "node",
44
+ "developer-tools",
45
+ "boilerplate"
46
+ ],
47
+ "author": "alcanivorax",
48
+ "license": "MIT",
49
+ "packageManager": "pnpm@10.28.0",
50
+ "devDependencies": {
51
+ "@types/node": "^25.0.9",
52
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
53
+ "@typescript-eslint/parser": "^8.53.1",
54
+ "eslint": "^9.39.2",
55
+ "prettier": "^3.8.1",
56
+ "tsx": "^4.21.0",
57
+ "typescript": "^5.9.3"
58
+ },
59
+ "dependencies": {
60
+ "@inquirer/prompts": "^8.2.0",
61
+ "chalk": "^5.6.2",
62
+ "ora": "^9.1.0"
63
+ }
64
+ }