@dimensional-innovations/tool-config 4.0.0 → 5.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/LICENSE +1 -1
- package/README.md +7 -120
- package/dist/cli/index.js +1812 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +401 -0
- package/dist/index.js +2644 -0
- package/dist/index.js.map +1 -0
- package/package.json +22 -15
- package/bin/lib/ci-setup.js +0 -142
- package/bin/lib/formatting.js +0 -103
- package/bin/lib/handlers/eslint.js +0 -61
- package/bin/lib/handlers/prettier.js +0 -83
- package/bin/lib/handlers/semantic-release.js +0 -60
- package/bin/lib/handlers/stylelint.js +0 -85
- package/bin/lib/handlers/typescript.js +0 -156
- package/bin/lib/package-manager.js +0 -201
- package/bin/lib/ui.js +0 -239
- package/bin/lib/uninstall.js +0 -199
- package/bin/lib/validators.js +0 -28
- package/bin/setup-tool-config.js +0 -442
- package/src/detectors.js +0 -286
- package/src/index.js +0 -69
- package/src/tools/eslint/index.js +0 -282
- package/src/tools/eslint/presets/base.js +0 -75
- package/src/tools/eslint/presets/environments/browser.js +0 -16
- package/src/tools/eslint/presets/environments/node.js +0 -21
- package/src/tools/eslint/presets/environments/universal.js +0 -18
- package/src/tools/eslint/presets/frameworks/angular.js +0 -80
- package/src/tools/eslint/presets/frameworks/astro.js +0 -43
- package/src/tools/eslint/presets/frameworks/node.js +0 -63
- package/src/tools/eslint/presets/frameworks/react.js +0 -81
- package/src/tools/eslint/presets/frameworks/solid.js +0 -50
- package/src/tools/eslint/presets/frameworks/svelte.js +0 -65
- package/src/tools/eslint/presets/frameworks/vanilla.js +0 -22
- package/src/tools/eslint/presets/frameworks/vue.js +0 -159
- package/src/tools/eslint/presets/imports.js +0 -47
- package/src/tools/eslint/presets/typescript.js +0 -142
- package/src/tools/prettier/README.md +0 -398
- package/src/tools/prettier/index.js +0 -132
- package/src/tools/prettier/presets/base.js +0 -36
- package/src/tools/prettier/presets/frameworks/astro.js +0 -15
- package/src/tools/prettier/presets/frameworks/react.js +0 -15
- package/src/tools/prettier/presets/frameworks/svelte.js +0 -22
- package/src/tools/prettier/presets/frameworks/vanilla.js +0 -13
- package/src/tools/prettier/presets/frameworks/vue.js +0 -21
- package/src/tools/prettier/presets/prettierignore.js +0 -57
- package/src/tools/semantic-release/CI_SETUP.md +0 -66
- package/src/tools/semantic-release/README.md +0 -533
- package/src/tools/semantic-release/index.js +0 -130
- package/src/tools/semantic-release/presets/default.js +0 -37
- package/src/tools/semantic-release/presets/library.js +0 -58
- package/src/tools/semantic-release/presets/monorepo.js +0 -48
- package/src/tools/semantic-release/templates/.gitlab-ci.yml +0 -89
- package/src/tools/semantic-release/templates/bitbucket-pipelines.yml +0 -100
- package/src/tools/semantic-release/templates/github-workflow.yml +0 -107
- package/src/tools/stylelint/README.md +0 -425
- package/src/tools/stylelint/index.js +0 -195
- package/src/tools/stylelint/presets/base.js +0 -50
- package/src/tools/stylelint/presets/css-modules.js +0 -43
- package/src/tools/stylelint/presets/frameworks/react.js +0 -18
- package/src/tools/stylelint/presets/frameworks/svelte.js +0 -28
- package/src/tools/stylelint/presets/frameworks/vanilla.js +0 -14
- package/src/tools/stylelint/presets/frameworks/vue.js +0 -38
- package/src/tools/stylelint/presets/scss.js +0 -83
- package/src/tools/stylelint/presets/tailwind.js +0 -49
- package/src/tools/typescript/README.md +0 -665
- package/src/tools/typescript/checker-detection.js +0 -113
- package/src/tools/typescript/index.js +0 -202
- package/src/tools/typescript/presets/base.js +0 -58
- package/src/tools/typescript/presets/environments/browser.js +0 -10
- package/src/tools/typescript/presets/environments/node.js +0 -11
- package/src/tools/typescript/presets/environments/universal.js +0 -11
- package/src/tools/typescript/presets/frameworks/angular.js +0 -11
- package/src/tools/typescript/presets/frameworks/astro.js +0 -11
- package/src/tools/typescript/presets/frameworks/electron.js +0 -100
- package/src/tools/typescript/presets/frameworks/node.js +0 -12
- package/src/tools/typescript/presets/frameworks/react.js +0 -10
- package/src/tools/typescript/presets/frameworks/solid.js +0 -11
- package/src/tools/typescript/presets/frameworks/svelte.js +0 -10
- package/src/tools/typescript/presets/frameworks/vanilla.js +0 -9
- package/src/tools/typescript/presets/frameworks/vue.js +0 -17
- package/src/utils/ignore-patterns.js +0 -157
- package/src/utils/package-reader.js +0 -42
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ export default await createConfig('eslint')
|
|
|
74
74
|
```javascript
|
|
75
75
|
import { createConfig } from '@dimensional-innovations/tool-config'
|
|
76
76
|
|
|
77
|
-
export default createConfig('prettier')
|
|
77
|
+
export default await createConfig('prettier')
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
**Stylelint** (`stylelint.config.js`):
|
|
@@ -82,7 +82,7 @@ export default createConfig('prettier')
|
|
|
82
82
|
```javascript
|
|
83
83
|
import { createConfig } from '@dimensional-innovations/tool-config'
|
|
84
84
|
|
|
85
|
-
export default createConfig('stylelint')
|
|
85
|
+
export default await createConfig('stylelint')
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
**TypeScript** (`tsconfig.json`):
|
|
@@ -106,7 +106,7 @@ Or use the factory function to generate framework-specific TypeScript configs pr
|
|
|
106
106
|
```javascript
|
|
107
107
|
import { createConfig } from '@dimensional-innovations/tool-config'
|
|
108
108
|
|
|
109
|
-
export default createConfig('semantic-release')
|
|
109
|
+
export default await createConfig('semantic-release')
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
That's it! The configs will automatically detect your framework and TypeScript setup.
|
|
@@ -269,7 +269,7 @@ createConfig('semantic-release', {
|
|
|
269
269
|
export default await createConfig('eslint')
|
|
270
270
|
|
|
271
271
|
// prettier.config.js - automatically formats JSX
|
|
272
|
-
export default createConfig('prettier')
|
|
272
|
+
export default await createConfig('prettier')
|
|
273
273
|
```
|
|
274
274
|
|
|
275
275
|
### Vue
|
|
@@ -287,8 +287,7 @@ export default createConfig('prettier')
|
|
|
287
287
|
|
|
288
288
|
**Prettier features:**
|
|
289
289
|
|
|
290
|
-
- SFC (Single File Component) formatting
|
|
291
|
-
- `prettier-plugin-vue` integration
|
|
290
|
+
- SFC (Single File Component) formatting (built-in to Prettier 3.x)
|
|
292
291
|
|
|
293
292
|
**Stylelint features:**
|
|
294
293
|
|
|
@@ -299,7 +298,7 @@ export default createConfig('prettier')
|
|
|
299
298
|
|
|
300
299
|
```javascript
|
|
301
300
|
// stylelint.config.js - automatically handles .vue files
|
|
302
|
-
export default createConfig('stylelint')
|
|
301
|
+
export default await createConfig('stylelint')
|
|
303
302
|
|
|
304
303
|
// npm scripts
|
|
305
304
|
{
|
|
@@ -366,7 +365,6 @@ npx @dimensional-innovations/tool-config
|
|
|
366
365
|
- Auto-detects framework and TypeScript
|
|
367
366
|
- Creates config files automatically
|
|
368
367
|
- Adds scripts to package.json (including `check-all` for multiple tools)
|
|
369
|
-
- Automated CI/CD pipeline setup
|
|
370
368
|
- **Uninstall support** - Clean removal of configs and scripts
|
|
371
369
|
- Supports dry-run mode
|
|
372
370
|
|
|
@@ -384,11 +382,6 @@ npx @dimensional-innovations/tool-config stylelint # Setup Stylelint only
|
|
|
384
382
|
# Setup all tools
|
|
385
383
|
npx @dimensional-innovations/tool-config --all # Setup all tools at once
|
|
386
384
|
|
|
387
|
-
# CI/CD setup
|
|
388
|
-
npx @dimensional-innovations/tool-config --ci gitlab # Setup GitLab CI/CD
|
|
389
|
-
npx @dimensional-innovations/tool-config --ci github # Setup GitHub Actions
|
|
390
|
-
npx @dimensional-innovations/tool-config --setup-ci # Interactive CI setup
|
|
391
|
-
|
|
392
385
|
# Preview mode
|
|
393
386
|
npx @dimensional-innovations/tool-config --dry-run # Preview without creating files
|
|
394
387
|
|
|
@@ -408,9 +401,6 @@ npx @dimensional-innovations/tool-config --uninstall eslint
|
|
|
408
401
|
# Uninstall all detected tools
|
|
409
402
|
npx @dimensional-innovations/tool-config --uninstall --all
|
|
410
403
|
|
|
411
|
-
# Remove CI/CD configuration
|
|
412
|
-
npx @dimensional-innovations/tool-config --uninstall --ci
|
|
413
|
-
|
|
414
404
|
# Preview uninstall
|
|
415
405
|
npx @dimensional-innovations/tool-config --uninstall --dry-run
|
|
416
406
|
```
|
|
@@ -424,111 +414,8 @@ The uninstall command includes safety features to protect your customizations:
|
|
|
424
414
|
- Only removes auto-generated package.json scripts
|
|
425
415
|
- Preserves custom scripts with the same names
|
|
426
416
|
- Supports dry-run to preview what will be removed
|
|
427
|
-
- Cleans up empty directories (e.g., `.github/workflows`)
|
|
428
417
|
- Idempotent - safe to run multiple times
|
|
429
418
|
|
|
430
|
-
**CI/CD Integration:**
|
|
431
|
-
|
|
432
|
-
When you select `semantic-release` in interactive mode, the CLI will automatically prompt you to setup CI/CD for automated releases. Or use the `--ci` flag to setup CI/CD directly:
|
|
433
|
-
|
|
434
|
-
```bash
|
|
435
|
-
# Interactive: prompts for provider if not detected
|
|
436
|
-
npx @dimensional-innovations/tool-config --setup-ci
|
|
437
|
-
|
|
438
|
-
# Direct: specify provider
|
|
439
|
-
npx @dimensional-innovations/tool-config --ci gitlab
|
|
440
|
-
npx @dimensional-innovations/tool-config --ci github
|
|
441
|
-
npx @dimensional-innovations/tool-config --ci bitbucket
|
|
442
|
-
|
|
443
|
-
# Combined: setup semantic-release + CI/CD
|
|
444
|
-
npx @dimensional-innovations/tool-config semantic-release --ci
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
The CLI will:
|
|
448
|
-
|
|
449
|
-
- Auto-detect your git provider (GitLab/GitHub/Bitbucket)
|
|
450
|
-
- Copy the appropriate CI/CD template
|
|
451
|
-
- Show environment variable configuration instructions
|
|
452
|
-
- Guide you through the setup process
|
|
453
|
-
|
|
454
|
-
## CI/CD Setup
|
|
455
|
-
|
|
456
|
-
Ready-to-use CI/CD templates for GitLab CI, GitHub Actions, and Bitbucket Pipelines.
|
|
457
|
-
|
|
458
|
-
### Automated Setup (Recommended)
|
|
459
|
-
|
|
460
|
-
The CLI tool can automatically setup CI/CD for you:
|
|
461
|
-
|
|
462
|
-
```bash
|
|
463
|
-
npx @dimensional-innovations/tool-config --ci gitlab # Or github, bitbucket
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
This will:
|
|
467
|
-
|
|
468
|
-
- Auto-detect your git provider
|
|
469
|
-
- Copy the appropriate template
|
|
470
|
-
- Show configuration instructions
|
|
471
|
-
|
|
472
|
-
### Manual Setup
|
|
473
|
-
|
|
474
|
-
Alternatively, copy templates manually from [src/tools/semantic-release/templates/](./src/tools/semantic-release/templates/).
|
|
475
|
-
|
|
476
|
-
Each template includes:
|
|
477
|
-
|
|
478
|
-
- **Lint Stage** - Runs ESLint, Prettier, and Stylelint
|
|
479
|
-
- **Test Stage** - Runs tests with coverage reporting
|
|
480
|
-
- **Release Stage** - Automated semantic-release (main branch only)
|
|
481
|
-
|
|
482
|
-
### GitLab CI
|
|
483
|
-
|
|
484
|
-
```bash
|
|
485
|
-
cp node_modules/@dimensional-innovations/tool-config/src/tools/semantic-release/templates/.gitlab-ci.yml .gitlab-ci.yml
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
Configure these CI/CD variables in GitLab:
|
|
489
|
-
|
|
490
|
-
- `GL_TOKEN`: GitLab Personal Access Token
|
|
491
|
-
- `NPM_TOKEN`: npm authentication token
|
|
492
|
-
|
|
493
|
-
### GitHub Actions
|
|
494
|
-
|
|
495
|
-
```bash
|
|
496
|
-
mkdir -p .github/workflows
|
|
497
|
-
cp node_modules/@dimensional-innovations/tool-config/src/tools/semantic-release/templates/github-workflow.yml .github/workflows/ci.yml
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
Configure these secrets in GitHub:
|
|
501
|
-
|
|
502
|
-
- `GITHUB_TOKEN`: Automatically provided
|
|
503
|
-
- `NPM_TOKEN`: npm authentication token
|
|
504
|
-
|
|
505
|
-
### Bitbucket Pipelines
|
|
506
|
-
|
|
507
|
-
```bash
|
|
508
|
-
cp node_modules/@dimensional-innovations/tool-config/src/tools/semantic-release/templates/bitbucket-pipelines.yml bitbucket-pipelines.yml
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
Configure this repository variable in Bitbucket:
|
|
512
|
-
|
|
513
|
-
- `NPM_TOKEN`: npm authentication token
|
|
514
|
-
|
|
515
|
-
See [CI_SETUP.md](./src/tools/semantic-release/CI_SETUP.md) for detailed configuration instructions.
|
|
516
|
-
|
|
517
|
-
## Examples
|
|
518
|
-
|
|
519
|
-
See the [`examples/`](./examples/) directory for complete working examples:
|
|
520
|
-
|
|
521
|
-
- [React App](./examples/react-app/) - TypeScript, CSS Modules
|
|
522
|
-
- [Vue App](./examples/vue-app/) - Composition API, Scoped Styles
|
|
523
|
-
- [Svelte App](./examples/svelte-app/) - Svelte 5, Component Styles
|
|
524
|
-
- [Solid App](./examples/solid-app/) - TypeScript, Reactive Primitives
|
|
525
|
-
- [Astro App](./examples/astro-app/) - Multi-framework, TypeScript
|
|
526
|
-
- [Angular App](./examples/angular-app/) - TypeScript, Standalone Components
|
|
527
|
-
- [Node Backend](./examples/node-backend/) - Express, TypeScript
|
|
528
|
-
- [Vanilla JS](./examples/vanilla-js/) - Pure JavaScript, no framework
|
|
529
|
-
|
|
530
|
-
Each example includes all 5 tool configurations and npm scripts.
|
|
531
|
-
|
|
532
419
|
## Advanced Usage
|
|
533
420
|
|
|
534
421
|
**Monorepo Support:**
|
|
@@ -611,7 +498,7 @@ export default await createConfig('eslint', {
|
|
|
611
498
|
**Stylelint** - Extend ignoreFiles:
|
|
612
499
|
|
|
613
500
|
```javascript
|
|
614
|
-
export default createConfig('stylelint', {
|
|
501
|
+
export default await createConfig('stylelint', {
|
|
615
502
|
ignoreFiles: ['**/*.min.css', 'vendor/**']
|
|
616
503
|
})
|
|
617
504
|
```
|