nero-init 1.0.1 → 1.0.3

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.
@@ -0,0 +1,24 @@
1
+ # {{projectName}}
2
+
3
+ Opinionated CLI for <one-line purpose>.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i -g {{projectName}}
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ {{projectName}}
15
+ ```
16
+
17
+ ## Notes
18
+
19
+ - Defaults are intentional
20
+ - Optimized for my workflow
21
+
22
+ ## License
23
+
24
+ MIT
@@ -0,0 +1,25 @@
1
+ # dependencies
2
+ node_modules/
3
+
4
+ # build output
5
+ dist/
6
+
7
+ # env files
8
+ .env
9
+ .env.*
10
+ !.env.example
11
+
12
+ # npm / package artifacts
13
+ *.tgz
14
+
15
+ # logs
16
+ npm-debug.log*
17
+ pnpm-debug.log*
18
+ yarn-debug.log*
19
+ yarn-error.log*
20
+
21
+ # OS / editor junk
22
+ .DS_Store
23
+ .idea/
24
+ .vscode/
25
+ *.swp
@@ -13,6 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "dev": "tsx src/index.ts",
16
+ "clean": "rimraf dist",
16
17
  "build": "tsc",
17
18
  "typecheck": "tsc --noEmit",
18
19
  "test": "vitest",
@@ -42,6 +43,7 @@
42
43
  "@typescript-eslint/parser": "^8.53.1",
43
44
  "eslint": "^9.39.2",
44
45
  "prettier": "^3.8.1",
46
+ "rimraf": "^6.1.2",
45
47
  "tsx": "^4.21.0",
46
48
  "typescript": "^5.9.3",
47
49
  "vitest": "^4.0.18"
@@ -1,10 +1,10 @@
1
1
  import { args } from './args.js'
2
- import pkg from '../../package.json' with {type: "json"}
2
+ import pkg from '../../package.json' with { type: 'json' }
3
3
 
4
+ function printHelp(): void {
5
+ console.log(`
6
+ ${pkg.name} - a cli tool
4
7
 
5
- function printHelp(): void {
6
- console.log(`
7
- ${pkg} - a cli
8
8
  Usage:
9
9
  ${pkg.name} [options]
10
10
 
@@ -12,34 +12,37 @@ Options:
12
12
  -h, --help, help Show help
13
13
  -v, --version, version Show version
14
14
  `)
15
- }
15
+ }
16
16
 
17
17
  function printVersion(): void {
18
- console.log(`
18
+ console.log(`
19
19
  ${pkg.name} version ${pkg.version}
20
20
  `)
21
- }
21
+ }
22
22
  function printInvalidOptions(option: string): void {
23
- console.error(`
23
+ console.error(`
24
24
  unknown option: ${option}
25
25
  usage: ${pkg.name} [-v | --version] [-h | --help]
26
26
  `)
27
- }
27
+ }
28
28
 
29
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)
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 (
38
+ args.includes('-v') ||
39
+ args.includes('--version') ||
40
+ args.includes('version')
41
+ ) {
42
+ printVersion()
43
+ process.exit(0)
44
+ }
45
+
46
+ printInvalidOptions(args[0])
47
+ process.exit(2)
45
48
  }
@@ -0,0 +1,13 @@
1
+ # {{projectName}}
2
+
3
+ Minimal TypeScript library for <one-line purpose>.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import { something } from '{{projectName}}'
9
+ ```
10
+
11
+ ## License
12
+
13
+ MIT
@@ -0,0 +1,25 @@
1
+ # dependencies
2
+ node_modules/
3
+
4
+ # build output
5
+ dist/
6
+
7
+ # env files
8
+ .env
9
+ .env.*
10
+ !.env.example
11
+
12
+ # npm / package artifacts
13
+ *.tgz
14
+
15
+ # logs
16
+ npm-debug.log*
17
+ pnpm-debug.log*
18
+ yarn-debug.log*
19
+ yarn-error.log*
20
+
21
+ # OS / editor junk
22
+ .DS_Store
23
+ .idea/
24
+ .vscode/
25
+ *.swp
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "dev": "tsx src/index.ts",
16
+ "clean": "rimraf dist",
16
17
  "build": "tsc",
17
18
  "typecheck": "tsc --noEmit",
18
19
  "test": "vitest",
@@ -41,6 +42,7 @@
41
42
  "@typescript-eslint/parser": "^8.53.1",
42
43
  "eslint": "^9.39.2",
43
44
  "prettier": "^3.8.1",
45
+ "rimraf": "^6.1.2",
44
46
  "tsx": "^4.21.0",
45
47
  "typescript": "^5.9.3",
46
48
  "vitest": "^4.0.18"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nero-init",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Project scaffold for CLI, library and Web templates.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "scripts": {
18
18
  "dev": "tsx src/index.ts",
19
+ "clean": "rimraf dist",
19
20
  "build": "tsc && cp -r src/templates dist/",
20
21
  "format": "prettier --write .",
21
22
  "lint": "eslint .",
@@ -53,6 +54,7 @@
53
54
  "@typescript-eslint/parser": "^8.53.1",
54
55
  "eslint": "^9.39.2",
55
56
  "prettier": "^3.8.1",
57
+ "rimraf": "^6.1.2",
56
58
  "tsx": "^4.21.0",
57
59
  "typescript": "^5.9.3"
58
60
  },
@@ -1,40 +0,0 @@
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
- ]
@@ -1,40 +0,0 @@
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
- ];