@rtorcato/js-tooling 2.1.0 → 2.1.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
@@ -1,244 +1,36 @@
1
1
  # js-tooling
2
2
 
3
- A comprehensive collection of JavaScript/TypeScript development tools and configurations for modern projects.
3
+ JavaScript and TypeScript tooling for Node.js, React, Next.js, and Vitest.
4
4
 
5
- ## Installation
6
-
7
- Install the package globally or use it directly with npx:
8
-
9
- ```bash
10
- # Install globally
11
- npm install -g @rtorcato/js-tooling
12
-
13
- # Or use with npx
14
- npx @rtorcato/js-tooling setup
15
- ```
16
-
17
- ## Getting started
18
-
19
- Use the interactive CLI to set up tooling for your project:
20
-
21
- ```bash
22
- npx @rtorcato/js-tooling setup
23
- ```
24
-
25
- Or import specific configurations:
26
-
27
- ```javascript
28
- import '@rtorcato/js-tooling/typescript/base';
29
- ```
30
-
31
- ## Available Tools
32
-
33
- This package includes configurations and presets for:
34
-
35
- - **TypeScript** - Base configurations for different project types
36
- - **ESLint** - Linting rules for JavaScript and TypeScript
37
- - **Prettier** - Code formatting configuration
38
- - **Biome** - Fast linter and formatter
39
- - **Vitest** - Testing framework configuration
40
- - **Jest** - Testing framework presets
41
- - **Commitlint** - Commit message linting
42
- - **Semantic Release** - Automated versioning and publishing
43
- - **GitHub Actions** - CI/CD workflow templates
44
- - **And more...**
45
-
46
- ## CI/CD Setup
47
-
48
- The package includes GitHub Actions workflows and semantic-release configuration. For automated publishing, set these secrets in your GitHub repository:
49
-
50
- 1. **`NPM_TOKEN`** - npm authentication token for publishing packages
51
- 2. **`GITHUB_TOKEN`** - automatically provided by GitHub Actions
52
-
53
- Repository settings: `https://github.com/your-username/your-repo/settings/secrets/actions`
54
-
55
- ## CLI Commands
56
-
57
- The package provides several CLI commands:
58
-
59
- ```bash
60
- # Interactive project setup wizard
61
- npx @rtorcato/js-tooling setup
62
-
63
- # Copy configuration files to current directory
64
- npx @rtorcato/js-tooling copy biome
65
- npx @rtorcato/js-tooling copy tsconfig
66
-
67
- # List all available configurations
68
- npx @rtorcato/js-tooling list
69
-
70
- # Diagnose drift between your project and our presets
71
- npx @rtorcato/js-tooling doctor
72
-
73
- # Run commit message helper
74
- npx @rtorcato/js-tooling commitmessage
75
-
76
- # Hello world example
77
- npx @rtorcato/js-tooling helloworld
78
- ```
79
-
80
- ### Doctor
81
-
82
- `doctor` audits an existing project against the presets and reports drift:
83
-
84
- ```bash
85
- npx @rtorcato/js-tooling doctor # current dir
86
- npx @rtorcato/js-tooling doctor -d ./app # specific dir
87
- npx @rtorcato/js-tooling doctor --json # machine-readable output
88
- ```
89
-
90
- For each tracked config (TypeScript, Biome, ESLint, Prettier, Vitest, Commitlint, `package.json`) it reports `ok`, `drift`, `missing`, or `not configured`, and exits non-zero on `drift` or `missing` — handy as a CI check.
91
-
92
- ## Configuration Usage
93
-
94
- ### Biome (Formatter & Linter)
95
-
96
- Since Biome doesn't support configuration extension, use the copy command to get the base configuration:
97
-
98
- ```bash
99
- # Copy base Biome configuration
100
- npx @rtorcato/js-tooling copy biome
101
- ```
102
-
103
- This creates a `biome.json` file with:
104
- - Tab indentation, 100 character line width
105
- - Single quotes, ES5 trailing commas
106
- - Recommended linting rules with sensible overrides
107
- - Smart file patterns excluding build directories
108
-
109
- After copying, customize for your project:
110
-
111
- ```json
112
- {
113
- "linter": {
114
- "rules": {
115
- "recommended": true,
116
- "suspicious": {
117
- "noExplicitAny": "error"
118
- }
119
- }
120
- }
121
- }
122
- ```
123
-
124
- ### TypeScript
125
-
126
- Import TypeScript configurations directly in your `tsconfig.json`:
127
-
128
- ```json
129
- {
130
- "extends": "@rtorcato/js-tooling/typescript/base"
131
- }
132
- ```
133
-
134
- Available configurations:
135
- - `typescript/base` - Base configuration for all projects
136
- - `typescript/react` - React-specific settings
137
- - `typescript/next` - Next.js optimized configuration
138
- - `typescript/node` - Node.js server configuration
139
- - `typescript/express` - Express.js API configuration
140
-
141
- ### ESLint
142
-
143
- ```javascript
144
- // eslint.config.js
145
- import baseConfig from '@rtorcato/js-tooling/eslint/base'
146
- import nextjsConfig from '@rtorcato/js-tooling/eslint/nextjs'
147
-
148
- export default [
149
- ...baseConfig,
150
- // Add project-specific rules
151
- ]
152
- ```
153
-
154
- ### Commitlint
155
-
156
- ```javascript
157
- // commitlint.config.js
158
- import config from '@rtorcato/js-tooling/commitlint/config'
159
- export default config
160
- ```
161
-
162
- ### Vitest
163
-
164
- ```javascript
165
- // vitest.config.js
166
- import { defineConfig } from 'vitest/config'
167
- import baseConfig from '@rtorcato/js-tooling/vitest/config'
168
-
169
- export default defineConfig({
170
- ...baseConfig,
171
- // Add project-specific settings
172
- })
173
- ```
174
-
175
- ### Semantic Release
176
-
177
- ```javascript
178
- // release.config.js
179
- import config from '@rtorcato/js-tooling/semantic-release/github'
180
- export default config
181
- ```
5
+ [![CI](https://github.com/rtorcato/js-tooling/actions/workflows/ci.yml/badge.svg)](https://github.com/rtorcato/js-tooling/actions/workflows/ci.yml)
6
+ [![npm version](https://badge.fury.io/js/@rtorcato%2Fjs-tooling.svg)](https://badge.fury.io/js/@rtorcato%2Fjs-tooling)
7
+ [![npm downloads](https://img.shields.io/npm/dm/@rtorcato%2Fjs-tooling)](https://www.npmjs.com/package/@rtorcato/js-tooling)
8
+ [![Bundle size](https://img.shields.io/bundlephobia/minzip/@rtorcato/js-tooling)](https://bundlephobia.com/package/@rtorcato/js-tooling)
9
+ [![Coverage](https://codecov.io/gh/rtorcato/js-tooling/branch/main/graph/badge.svg)](https://codecov.io/gh/rtorcato/js-tooling)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
182
11
 
183
- ## Using with Package Managers
12
+ Most tooling libraries give you one piece — just TypeScript configs, or just an ESLint preset. **js-tooling** covers the entire lifecycle: TypeScript, Biome/ESLint, Vitest/Jest, Commitlint, Husky, Semantic Release, and GitHub Actions CI — all wired together. The interactive `setup` wizard scaffolds everything in one shot; `doctor` checks an existing project for drift.
184
13
 
185
- ### With pnpm
186
- ```bash
187
- # Temporarily install and run
188
- pnpm --package=@rtorcato/js-tooling dlx setup
14
+ **[Full documentation →](https://rtorcato.github.io/js-tooling/)**
189
15
 
190
- # Or install globally
191
- pnpm add -g @rtorcato/js-tooling
192
- ```
16
+ ## Quick start
193
17
 
194
- ### With npm
195
18
  ```bash
196
- # Use directly
197
19
  npx @rtorcato/js-tooling setup
198
-
199
- # Or install globally
200
- npm install -g @rtorcato/js-tooling
201
20
  ```
202
21
 
203
- ## Development
204
-
205
- To work on this package locally:
206
-
207
- 1. Clone the repository:
208
- ```bash
209
- git clone https://github.com/rtorcato/js-tooling.git
210
- cd js-tooling
211
- ```
212
-
213
- 2. Install dependencies:
214
- ```bash
215
- pnpm install
216
- ```
22
+ ## What's new
217
23
 
218
- 3. Build the CLI:
219
- ```bash
220
- pnpm run build-cli
221
- ```
24
+ See [CHANGELOG.md](CHANGELOG.md) for the full history.
222
25
 
223
- 4. Link globally for testing:
224
- ```bash
225
- pnpm link --global
226
- ```
26
+ **v2.0.0** All 39 tool packages moved from `dependencies` to `peerDependencies`. Add them to your own `devDependencies`. Also ships: `doctor` subcommand, generator unit tests, Dependabot, CI matrix (Node 22 + 24).
227
27
 
228
- For more details, refer to the [pnpm link documentation](https://pnpm.io/cli/link).
229
-
230
- ## Status
231
-
232
- [![CI](https://github.com/rtorcato/js-tooling/actions/workflows/ci.yml/badge.svg)](https://github.com/rtorcato/js-tooling/actions/workflows/ci.yml)
233
- [![npm version](https://badge.fury.io/js/@rtorcato%2Fjs-tooling.svg)](https://badge.fury.io/js/@rtorcato%2Fjs-tooling)
234
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
235
- [![GitHub release (latest by date)](https://img.shields.io/github/v/release/rtorcato/js-tooling)](https://github.com/rtorcato/js-tooling/releases)
236
- [![GitHub issues](https://img.shields.io/github/issues/rtorcato/js-tooling)](https://github.com/rtorcato/js-tooling/issues)
28
+ **v1.1.0** Stricter commitlint limits, fix for CLI path resolution when copying configs.
237
29
 
238
30
  ## Contributing
239
31
 
240
- Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) and feel free to submit issues and pull requests.
32
+ Contributions welcome see [CONTRIBUTING.md](CONTRIBUTING.md).
241
33
 
242
34
  ## License
243
35
 
244
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
36
+ MIT see [LICENSE](LICENSE).
package/dist/cli/index.js CHANGED
@@ -1,9 +1,20 @@
1
1
  #!/usr/bin/env node
2
+ import path from 'node:path';
2
3
  import chalk from 'chalk';
3
4
  import { Command } from 'commander';
5
+ import fs from 'fs-extra';
4
6
  import packageJson from '../../package.json' with { type: 'json' };
5
7
  import { doctorCommand } from './commands/doctor.js';
6
8
  import { setupProject } from './commands/setup.js';
9
+ async function isSelfRepo(dir) {
10
+ try {
11
+ const pkg = await fs.readJson(path.join(dir, 'package.json'));
12
+ return pkg.name === '@rtorcato/js-tooling';
13
+ }
14
+ catch {
15
+ return false;
16
+ }
17
+ }
7
18
  const program = new Command();
8
19
  program
9
20
  .name('@rtorcato/js-tooling')
@@ -39,7 +50,7 @@ program
39
50
  console.log(` ${chalk.green('●')} ${chalk.bold(key)}: ${chalk.gray(desc)}`);
40
51
  });
41
52
  console.log();
42
- return;
53
+ process.exit(1);
43
54
  }
44
55
  const { source, target, desc } = availableConfigs[config];
45
56
  try {
@@ -96,6 +107,17 @@ program
96
107
  .option('-d, --directory <path>', 'Target directory to diagnose', process.cwd())
97
108
  .option('--json', 'Emit machine-readable JSON output')
98
109
  .action(doctorCommand);
110
+ program.hook('preAction', async (_, actionCommand) => {
111
+ const name = actionCommand.name();
112
+ if (name === 'setup' || name === 'doctor') {
113
+ const dir = actionCommand.opts().directory ?? process.cwd();
114
+ if (await isSelfRepo(dir)) {
115
+ console.log(chalk.yellow('\n⚠️ This command cannot be run inside the @rtorcato/js-tooling repo itself.\n'));
116
+ console.log(chalk.gray(' setup and doctor are for consumer projects, not for the tooling repo.\n'));
117
+ process.exit(0);
118
+ }
119
+ }
120
+ });
99
121
  // Handle unknown commands
100
122
  program.on('command:*', () => {
101
123
  console.error(chalk.red(`\n❌ Unknown command: ${program.args.join(' ')}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtorcato/js-tooling",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "JavaScript and TypeScript tooling for Node.js, React, Next.js, and Vitest.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -33,6 +33,7 @@
33
33
  "test": "vitest",
34
34
  "test:watch": "vitest --watch",
35
35
  "coverage": "vitest run --coverage",
36
+ "knip": "knip",
36
37
  "commit": "cz",
37
38
  "================================================": ""
38
39
  },
@@ -52,9 +53,12 @@
52
53
  "tooling/typescript/reset.d.ts",
53
54
  "tooling/vitest/vitest.config.mjs",
54
55
  "tooling/vitest/vitest.config.d.mts",
56
+ "tooling/vitest/vitest.config.react.mjs",
57
+ "tooling/vitest/vitest.config.react.d.mts",
58
+ "tooling/vitest/vitest.setup.mjs",
59
+ "tooling/vitest/vitest.setup.d.mts",
55
60
  "tooling/tsup/index.ts",
56
61
  "tooling/biome/biome.json",
57
- "tooling/biome/biome.jsonc",
58
62
  "tooling/semantic-release/*.mjs",
59
63
  "tooling/semantic-release/*.d.mts",
60
64
  "README.md"
@@ -99,6 +103,14 @@
99
103
  "types": "./tooling/vitest/vitest.config.d.mts",
100
104
  "import": "./tooling/vitest/vitest.config.mjs"
101
105
  },
106
+ "./vitest/react": {
107
+ "types": "./tooling/vitest/vitest.config.react.d.mts",
108
+ "import": "./tooling/vitest/vitest.config.react.mjs"
109
+ },
110
+ "./vitest/setup": {
111
+ "types": "./tooling/vitest/vitest.setup.d.mts",
112
+ "import": "./tooling/vitest/vitest.setup.mjs"
113
+ },
102
114
  "./tsup": "./tooling/tsup/index.ts",
103
115
  "./biome": "./tooling/biome/biome.json",
104
116
  "./semantic-release": {
@@ -116,14 +128,17 @@
116
128
  },
117
129
  "dependencies": {
118
130
  "chalk": "^5.6.2",
119
- "commander": "^14.0.1",
131
+ "commander": "^14.0.3",
120
132
  "fs-extra": "^11.3.2",
121
- "inquirer": "^12.10.0"
133
+ "inquirer": "^14.0.0"
122
134
  },
123
135
  "devDependencies": {
124
136
  "@biomejs/biome": "^2.3.0",
137
+ "@commitlint/types": "^20.0.0",
138
+ "@eslint/js": "^9.38.0",
139
+ "@ianvs/prettier-plugin-sort-imports": "^4.4.2",
125
140
  "@commitlint/cli": "^20.1.0",
126
- "@commitlint/config-conventional": "^20.0.0",
141
+ "@commitlint/config-conventional": "^21.0.1",
127
142
  "@next/eslint-plugin-next": "^16.0.0",
128
143
  "@playwright/test": "^1.56.1",
129
144
  "@semantic-release/changelog": "^6.0.3",
@@ -135,18 +150,17 @@
135
150
  "@semantic-release/release-notes-generator": "^14.1.0",
136
151
  "@total-typescript/ts-reset": "0.6.1",
137
152
  "@types/fs-extra": "^11.0.4",
138
- "@types/inquirer": "^9.0.9",
139
- "@types/node": "^24.9.1",
153
+ "@types/node": "^25.9.1",
140
154
  "@typescript-eslint/eslint-plugin": "^8.46.2",
141
155
  "@typescript-eslint/parser": "^8.46.2",
142
156
  "@vitejs/plugin-react": "^5.1.0",
143
157
  "@vitest/coverage-v8": "^4.0.3",
144
158
  "commitizen": "^4.3.1",
145
- "conventional-changelog-conventionalcommits": "^9.1.0",
159
+ "conventional-changelog-conventionalcommits": "^9.3.1",
146
160
  "cross-env": "^10.1.0",
147
161
  "cz-conventional-changelog": "^3.3.0",
148
162
  "esbuild": "^0.25.11",
149
- "esbuild-node-externals": "^1.18.0",
163
+ "esbuild-node-externals": "^1.22.0",
150
164
  "eslint": "9.38.0",
151
165
  "eslint-config-airbnb": "^19.0.4",
152
166
  "eslint-config-prettier": "10.1.8",
@@ -157,6 +171,7 @@
157
171
  "eslint-plugin-react": "^7.37.5",
158
172
  "eslint-plugin-react-hooks": "^7.0.0",
159
173
  "eslint-plugin-vitest": "0.5.4",
174
+ "jest": "^29.7.0",
160
175
  "husky": "^9.1.7",
161
176
  "is-ci": "^4.1.0",
162
177
  "lint-staged": "^16.2.6",
@@ -165,15 +180,19 @@
165
180
  "rimraf": "6.0.1",
166
181
  "semantic-release": "^25.0.1",
167
182
  "ts-jest": "^29.4.5",
168
- "tsup": "8.5.0",
183
+ "tsup": "8.5.1",
169
184
  "typescript": "^5.9.3",
170
185
  "typescript-eslint": "^8.60.0",
171
- "vitest": "4.0.3"
186
+ "vitest": "4.0.3",
187
+ "knip": "^5.61.3"
172
188
  },
173
189
  "peerDependencies": {
174
190
  "@biomejs/biome": "^2.0.0",
191
+ "@commitlint/types": "^20.0.0",
192
+ "@eslint/js": "^9.0.0",
193
+ "@ianvs/prettier-plugin-sort-imports": "^4.0.0",
175
194
  "@commitlint/cli": "^20.0.0",
176
- "@commitlint/config-conventional": "^20.0.0",
195
+ "@commitlint/config-conventional": "^21.0.1",
177
196
  "@next/eslint-plugin-next": "^16.0.0",
178
197
  "@playwright/test": "^1.50.0",
179
198
  "@semantic-release/changelog": "^6.0.0",
@@ -190,7 +209,7 @@
190
209
  "commitizen": "^4.0.0",
191
210
  "conventional-changelog-conventionalcommits": "^9.0.0",
192
211
  "cz-conventional-changelog": "^3.0.0",
193
- "esbuild": "^0.25.0",
212
+ "esbuild": "^0.25.0 || ^0.27.0 || ^0.28.0",
194
213
  "esbuild-node-externals": "^1.0.0",
195
214
  "eslint": ">=9.0.0",
196
215
  "eslint-config-airbnb": "^19.0.0",
@@ -202,6 +221,7 @@
202
221
  "eslint-plugin-react": "^7.0.0",
203
222
  "eslint-plugin-react-hooks": "^7.0.0",
204
223
  "eslint-plugin-vitest": "^0.5.0",
224
+ "jest": "^29.0.0",
205
225
  "husky": "^9.0.0",
206
226
  "lint-staged": ">=16.0.0",
207
227
  "prettier": "^3.0.0",
@@ -217,6 +237,15 @@
217
237
  "@biomejs/biome": {
218
238
  "optional": true
219
239
  },
240
+ "@commitlint/types": {
241
+ "optional": true
242
+ },
243
+ "@eslint/js": {
244
+ "optional": true
245
+ },
246
+ "@ianvs/prettier-plugin-sort-imports": {
247
+ "optional": true
248
+ },
220
249
  "@commitlint/cli": {
221
250
  "optional": true
222
251
  },
@@ -307,6 +336,9 @@
307
336
  "eslint-plugin-vitest": {
308
337
  "optional": true
309
338
  },
339
+ "jest": {
340
+ "optional": true
341
+ },
310
342
  "husky": {
311
343
  "optional": true
312
344
  },
@@ -338,6 +370,36 @@
338
370
  "optional": true
339
371
  }
340
372
  },
373
+ "knip": {
374
+ "entry": [
375
+ "src/cli/index.ts",
376
+ "src/cli/commands/doctor.ts",
377
+ "tooling/**/*.{mjs,ts}"
378
+ ],
379
+ "project": [
380
+ "src/**/*.ts",
381
+ "tooling/**/*.{mjs,ts}"
382
+ ],
383
+ "ignoreDependencies": [
384
+ "cross-env",
385
+ "@playwright/test",
386
+ "eslint-config-airbnb",
387
+ "eslint-config-prettier",
388
+ "eslint-config-turbo",
389
+ "eslint-plugin-jsx-a11y",
390
+ "eslint-plugin-react",
391
+ "eslint-plugin-react-hooks",
392
+ "eslint-plugin-vitest",
393
+ "ts-jest",
394
+ "@semantic-release/commit-analyzer",
395
+ "@semantic-release/exec",
396
+ "@semantic-release/github",
397
+ "@semantic-release/npm",
398
+ "@semantic-release/release-notes-generator",
399
+ "conventional-changelog-conventionalcommits",
400
+ "lint-staged"
401
+ ]
402
+ },
341
403
  "lint-staged": {
342
404
  "*.{js,ts,json,md}": [
343
405
  "pnpm exec biome lint --config-path=tooling/biome/biome.json",
@@ -345,9 +407,7 @@
345
407
  ]
346
408
  },
347
409
  "bin": {
348
- "js-tooling": "./dist/cli/index.js",
349
- "commitmessage": "scripts/commitmessage.sh",
350
- "helloworld": "scripts/helloworld.sh"
410
+ "js-tooling": "./dist/cli/index.js"
351
411
  },
352
412
  "config": {
353
413
  "commitizen": {
@@ -10,7 +10,7 @@ export default defineConfig({
10
10
  environment: 'node',
11
11
  coverage: {
12
12
  provider: 'v8',
13
- reporter: ['text', 'json', 'html'],
13
+ reporter: ['text', 'json', 'html', 'json-summary'],
14
14
  include: ['src/cli/generators/**/*.ts'],
15
15
  thresholds: {
16
16
  statements: 25,
@@ -0,0 +1,4 @@
1
+ import type { UserConfig } from 'vitest/config'
2
+
3
+ declare const config: UserConfig
4
+ export default config
@@ -0,0 +1,27 @@
1
+ import base from '@rtorcato/js-tooling/vitest/config'
2
+ import react from '@vitejs/plugin-react'
3
+ import { dirname, resolve } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { defineConfig, mergeConfig } from 'vitest/config'
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url))
8
+
9
+ export default mergeConfig(
10
+ base,
11
+ defineConfig({
12
+ plugins: [react()],
13
+ test: {
14
+ environment: 'jsdom',
15
+ include: ['src/**/*.{test,spec}.{js,jsx,ts,tsx}'],
16
+ css: true, // ← Vitest will stub every *.css / *.module.css import
17
+ exclude: ['OLD/**'],
18
+ setupFiles: ['./vitest.setup.ts'],
19
+ },
20
+ resolve: {
21
+ alias: [
22
+ { find: '@', replacement: resolve(__dirname, './src') },
23
+ { find: '~', replacement: resolve(__dirname, './src') },
24
+ ],
25
+ },
26
+ })
27
+ )
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,3 @@
1
+ import { vi } from 'vitest'
2
+
3
+ vi.mock('**/*.module.css', () => ({}))
package/scripts/README.md DELETED
@@ -1,8 +0,0 @@
1
- pnpx js-tooling commitmessage
2
- pnpx js-tooling version-bump
3
- pnpx js-tooling genpassword
4
-
5
- <!-- run before publish -->
6
- pnpm exec ./scripts/fix-bins.sh
7
-
8
- pnpm link --global
@@ -1,44 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # chmod +x scripts/commitmessage.sh
4
- set -e
5
-
6
- echo "Select commit type by number:"
7
- select type in "feat" "fix" "perf" "ci" "WIP" "chore" "docs" "test" "style" "refactor" "build" "BREAKING CHANGE" "revert"; do
8
- if [ -n "$type" ]; then
9
- break
10
- else
11
- echo "❌ Invalid selection. Try again."
12
- fi
13
- done
14
-
15
- if [[ "$type" =~ ^(feat|fix|perf)$ ]]; then
16
- echo "Select semantic version by number:"
17
- select semantic_version in "none" "patch" "minor" "major"; do
18
- [ -n "$semantic_version" ] && break
19
- done
20
- else
21
- semantic_version="none"
22
- fi
23
-
24
- read -p "Enter commit description: " description
25
- read -p "Skip CI? (y/n) [n]: " skip_ci
26
- skip_ci=${skip_ci:-n}
27
-
28
- msg="$type"
29
- [ "$semantic_version" != "none" ] && msg="$msg($semantic_version)"
30
- msg="$msg: $description"
31
- [ "$skip_ci" = "y" ] && msg="$msg [skip ci]"
32
-
33
- echo ""
34
- echo "🔍 Commit preview:"
35
- echo "$msg"
36
- read -p "Is this okay? (y/n): " confirm
37
- [ "$confirm" != "y" ] && echo "❌ Commit aborted." && exit 1
38
-
39
- git add -A
40
- git commit -m "$msg"
41
-
42
- echo ""
43
- read -p "Do you want to push the commit? (y/n): " push_confirm
44
- [ "$push_confirm" = "y" ] && git push || echo "🚫 Commit not pushed."
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # chmod +x scripts/helloworld.sh
4
-
5
- echo "👋 Hello, world from js-tooling!"