nero-init 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -18,8 +18,77 @@ Creates opinionated starter templates for:
18
18
  npx nero-init
19
19
  ```
20
20
 
21
+ No arguments, no flags — just answer the prompts.
22
+
23
+ <br >
24
+
25
+ ## Folder Structure
26
+
27
+ ### CLI
28
+
29
+ ```bash
30
+ .
31
+ ├── src/ # Source code
32
+ │ ├── cli/ # CLI-specific logic
33
+ │ │ ├── args.ts # Command-line arguments
34
+ │ │ └── options.ts # CLI options & flags
35
+ │ └── index.ts # Entry point
36
+
37
+ ├── .github/
38
+ │ └── workflows/
39
+ │ └── ci.yaml # CI pipeline
40
+
41
+ ├── .gitignore # Git ignore rules
42
+ ├── .prettierrc # Prettier configuration
43
+ ├── .prettierignore # Prettier ignore rules
44
+
45
+ ├── eslint.config.ts # ESLint configuration
46
+ ├── tsconfig.json # TypeScript configuration
47
+ ├── vitest.config.ts # Test configuration
48
+
49
+ ├── package.json # Package metadata & scripts
50
+ ├── README.md # Project documentation
51
+ └── LICENSE # License
52
+ ```
53
+
54
+ <br >
55
+
56
+ ### Library
57
+
58
+ ```bash
59
+ .
60
+ ├── src/
61
+ │ └── index.ts # Library entry point (public API)
62
+
63
+ ├── .github/
64
+ │ └── workflows/
65
+ │ └── ci.yaml # CI pipeline
66
+
67
+ ├── .gitignore # Git ignore rules
68
+ ├── .prettierrc # Prettier configuration
69
+ ├── .prettierignore # Prettier ignore rules
70
+
71
+ ├── eslint.config.ts # ESLint (flat, TypeScript config)
72
+ ├── tsconfig.json # TypeScript configuration
73
+ ├── vitest.config.ts # Test configuration
74
+
75
+ ├── package.json # Package metadata & scripts
76
+ ├── README.md # Documentation
77
+ └── LICENSE # License
78
+ ```
79
+
21
80
  <br >
22
81
 
82
+ <!-- ### Web
83
+
84
+ Next.js template bootstrapped via `create-next-app@latest` and preconfigured with:
85
+
86
+ - Zod — schema validation
87
+ - Prisma — database ORM
88
+ - Supabase — auth & backend services
89
+
90
+ <br > -->
91
+
23
92
  ## License
24
93
 
25
94
  MIT
package/dist/renderer.js CHANGED
@@ -1,11 +1,17 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
- const TEMPLATE_ROOT = new URL('./templates/', import.meta.url);
3
+ import { fileURLToPath } from 'node:url';
4
+ const _filename = fileURLToPath(import.meta.url);
5
+ const _dirname = path.dirname(_filename);
6
+ const TEMPLATE_ROOT = path.resolve(_dirname, 'templates');
4
7
  export async function renderTemplate(template, answers) {
5
8
  const targetDir = path.resolve(process.cwd(), answers.projectName);
6
- const templateDir = path.resolve(TEMPLATE_ROOT.pathname, template.id);
9
+ const templateDir = path.resolve(TEMPLATE_ROOT, template.id);
10
+ if (!fs.existsSync(templateDir)) {
11
+ throw new Error(`Template ${template.id} not found at ${templateDir}`);
12
+ }
7
13
  if (fs.existsSync(targetDir)) {
8
- throw new Error(`Directory ${answers.projectName} already exists`);
14
+ throw new Error(`Directory "${answers.projectName}" already exists`);
9
15
  }
10
16
  fs.mkdirSync(targetDir, { recursive: true });
11
17
  copyDir(templateDir, targetDir, answers, template.placeholders);
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Enable corepack
16
+ run: corepack enable
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 18
21
+ cache: pnpm
22
+
23
+ - name: Install dependencies
24
+ run: pnpm install --frozen-lockfile
25
+
26
+ - name: Type check
27
+ run: pnpm run typecheck
28
+
29
+ - name: Lint
30
+ run: pnpm run lint
31
+
32
+ - name: Format check
33
+ run: pnpm run format:check
34
+
35
+ - name: Test
36
+ run: pnpm run test
@@ -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': 'off',
37
+ 'prefer-const': 'error',
38
+ },
39
+ },
40
+ ]
@@ -18,8 +18,8 @@
18
18
  "test": "vitest",
19
19
  "format": "prettier --write .",
20
20
  "format:check": "prettier --check .",
21
- "lint": "eslint .",
22
- "lint:fix": "eslint . --fix",
21
+ "lint": "eslint . --config eslint.config.ts",
22
+ "lint:fix": "eslint . --fix --config eslint.config.ts",
23
23
  "prepublishOnly": "npm run build",
24
24
  "postbuild": "chmod +x dist/index.js"
25
25
  },
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Enable corepack
16
+ run: corepack enable
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 18
21
+ cache: pnpm
22
+
23
+ - name: Install dependencies
24
+ run: pnpm install --frozen-lockfile
25
+
26
+ - name: Type check
27
+ run: pnpm run typecheck
28
+
29
+ - name: Lint
30
+ run: pnpm run lint
31
+
32
+ - name: Format check
33
+ run: pnpm run format:check
34
+
35
+ - name: Test
36
+ run: pnpm run test
@@ -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
+ ];
@@ -18,8 +18,8 @@
18
18
  "test": "vitest",
19
19
  "format": "prettier --write .",
20
20
  "format:check": "prettier --check .",
21
- "lint": "eslint .",
22
- "lint:fix": "eslint . --fix",
21
+ "lint": "eslint . --config eslint.config.ts",
22
+ "lint:fix": "eslint . --fix --config eslint.config.ts",
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "engines": {
@@ -29,7 +29,9 @@
29
29
  "type": "git",
30
30
  "url": "git+https://github.com/alcanivorax/{{projectName}}.git"
31
31
  },
32
- "keywords": [],
32
+ "keywords": [
33
+ "library"
34
+ ],
33
35
  "author": "alcanivorax",
34
36
  "license": "MIT",
35
37
  "packageManager": "pnpm@10.28.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nero-init",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Project scaffold for CLI, library and Web templates.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",