nero-init 1.0.1 → 1.0.2

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
@@ -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,9 @@
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
-
5
- function printHelp(): void {
6
- console.log(`
7
- ${pkg} - a cli
4
+ function printHelp(): void {
5
+ console.log(`
6
+ ${pkg.name} - a cli tool
8
7
  Usage:
9
8
  ${pkg.name} [options]
10
9
 
@@ -12,34 +11,37 @@ Options:
12
11
  -h, --help, help Show help
13
12
  -v, --version, version Show version
14
13
  `)
15
- }
14
+ }
16
15
 
17
16
  function printVersion(): void {
18
- console.log(`
17
+ console.log(`
19
18
  ${pkg.name} version ${pkg.version}
20
19
  `)
21
- }
20
+ }
22
21
  function printInvalidOptions(option: string): void {
23
- console.error(`
22
+ console.error(`
24
23
  unknown option: ${option}
25
24
  usage: ${pkg.name} [-v | --version] [-h | --help]
26
25
  `)
27
- }
26
+ }
28
27
 
29
28
  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)
29
+ if (args.length === 0) return
30
+
31
+ if (args.includes('-h') || args.includes('--help') || args.includes('help')) {
32
+ printHelp()
33
+ process.exit(0)
34
+ }
35
+
36
+ if (
37
+ args.includes('-v') ||
38
+ args.includes('--version') ||
39
+ args.includes('version')
40
+ ) {
41
+ printVersion()
42
+ process.exit(0)
43
+ }
44
+
45
+ printInvalidOptions(args[0])
46
+ process.exit(2)
45
47
  }
@@ -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
@@ -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.2",
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
- ];