@opinionated-ts/config 1.6.0 → 1.8.0

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
@@ -2,50 +2,57 @@
2
2
 
3
3
  Opinionated, reusable TypeScript tooling configurations focused on performance, code quality, and developer experience.
4
4
 
5
- ## Installation
5
+ ## When to use?
6
6
 
7
- ```bash
8
- bun add -D @opinionated-ts/config
7
+ This package provides recommended, opinionated configurations designed to reduce project setup time and maintain consistent tooling across TypeScript projects.
9
8
 
10
- # npm install -D @opinionated-ts/config
11
- # pnpm add -D @opinionated-ts/config
12
- # yarn add -D @opinionated-ts/config
13
- ```
9
+ Use it when you want to:
14
10
 
15
- ## Usage
11
+ - Move fast without sacrificing code quality
12
+ - Keep a consistent developer experience across repositories
13
+ - Avoid repetitive configuration boilerplate
14
+ - Standardize tooling with a clear opinionated default
16
15
 
17
- Import the configurations you need:
16
+ The configurations prioritize:
18
17
 
19
- <!-- prettier-ignore -->
20
- ```ts
21
- import {
22
- commitlintConfig,
23
- cspellConfig,
24
- oxfmtConfig,
25
- oxlintConfig,
26
- } from "@opinionated-ts/config";
27
- ```
18
+ - **Performance** — Fast tooling and builds
19
+ - **Code quality** — Comprehensive linting and type checking
20
+ - **Developer experience** — Zero-friction setup and consistent workflows
21
+ - **Modern tooling** — Latest standards and best practices
28
22
 
29
- <!-- prettier-ignore -->
30
- Each configuration can be used directly as a recommended default or customized depending on the configuration system supported by each tool.
23
+ > [!NOTE]
24
+ > This package is designed primarily for **Bun** environments. The workflow validations and tool integrations are optimized for Bun's runtime and package manager.
31
25
 
32
- See the configuration guides for each tool:
26
+ ## What's included
33
27
 
34
- - [Typescript](./docs/tsconfig.md)
35
- - [Commitlint](./docs/commitlint.md)
36
- - [CSpell](./docs/cspell.md)
37
- - [Oxfmt](./docs/oxfmt.md)
38
- - [Oxlint](./docs/oxlint.md)
39
- - [Lefthook](./docs/lefthook.md)
40
- - [GitHub Actions](./docs/github-actions.md)
28
+ ### Local Automatic Validations
41
29
 
42
- ## Philosophy
30
+ | Category | Tool | Description |
31
+ | ------------------ | --------------------------------------------- | --------------------------------------------------------------------- |
32
+ | **Type checking** | [TypeScript](https://www.typescriptlang.org/) | Applied together with Oxlint via `typeCheck`/`typeAware` |
33
+ | **Linter** | [Oxlint](https://oxc.rs/) | Fast linting, pre-configured |
34
+ | **Formatter** | [Oxfmt](https://oxc.rs/) | Fast formatting, pre-configured |
35
+ | **Spellchecking** | [cspell](https://cspell.org/) | Pre-configured for English/Spanish |
36
+ | **Commit linting** | [commitlint](https://commitlint.js.org/) | Enforces [Conventional Commits](https://www.conventionalcommits.org/) |
37
+ | **Git hooks** | [lefthook](https://lefthook.dev/) | Wired up locally (`pre-commit`, `commit-msg`, `pre-push`) |
43
38
 
44
- This package provides recommended, opinionated configurations designed to reduce project setup time and maintain consistent tooling across TypeScript projects.
39
+ ### Remote Automatic Validations
45
40
 
46
- The configurations prioritize:
41
+ | Category | Tool | Description |
42
+ | ----------- | -------------------------------------------------------- | -------------------------------------------------------- |
43
+ | **CI/CD** | [GitHub Actions](https://github.com/features/actions) | Automated workflows for validation and release pipelines |
44
+ | **Release** | [Semantic Release](https://semantic-release.gitbook.io/) | Automated versioning and releases |
45
+
46
+ ## Getting started
47
+
48
+ ### Option 1: Start fast with the template
49
+
50
+ The easiest way to use this stack is to start from our ready-to-use template:
51
+
52
+ 👉 [@opinionated-ts/template](https://github.com/opinionated-ts/template)
53
+
54
+ It is already set up with the recommended defaults and tooling wiring.
55
+
56
+ ### Option 2: Add to an existing project
47
57
 
48
- - Performance
49
- - Code quality
50
- - Developer experience
51
- - Modern tooling
58
+ Install the package and follow our [Installation, Usage & Configuration Guide](./docs/getting-started.md).
@@ -0,0 +1,26 @@
1
+ //#region src/configs/release.d.ts
2
+ declare const semanticReleaseConfig: {
3
+ branches: (string | {
4
+ name: string;
5
+ prerelease: string;
6
+ channel: string;
7
+ })[];
8
+ plugins: (string | [string, {
9
+ preset: string;
10
+ }] | [string, {
11
+ preset: string;
12
+ presetConfig: {
13
+ types: ({
14
+ type: string;
15
+ section: string;
16
+ effect: "bump";
17
+ } | {
18
+ type: string;
19
+ section: string;
20
+ effect: "changelog";
21
+ })[];
22
+ };
23
+ }])[];
24
+ };
25
+ //#endregion
26
+ export { semanticReleaseConfig as default, semanticReleaseConfig };
@@ -0,0 +1,74 @@
1
+ import "conventional-changelog-conventionalcommits";
2
+ import "semantic-release";
3
+ //#region src/configs/release.ts
4
+ const semanticReleaseConfig = {
5
+ branches: [
6
+ "main",
7
+ {
8
+ name: "beta/*",
9
+ prerelease: "beta",
10
+ channel: "beta"
11
+ },
12
+ {
13
+ name: "next/*",
14
+ prerelease: "next",
15
+ channel: "next"
16
+ },
17
+ {
18
+ name: "insiders/*",
19
+ prerelease: "insiders",
20
+ channel: "insiders"
21
+ }
22
+ ],
23
+ plugins: [
24
+ ["@semantic-release/commit-analyzer", { preset: "conventionalcommits" }],
25
+ ["@semantic-release/release-notes-generator", {
26
+ preset: "conventionalcommits",
27
+ presetConfig: { types: [
28
+ {
29
+ type: "feat",
30
+ section: "🚀 New Features",
31
+ effect: "bump"
32
+ },
33
+ {
34
+ type: "fix",
35
+ section: "🐞 Bug Fixes",
36
+ effect: "bump"
37
+ },
38
+ {
39
+ type: "docs",
40
+ section: "📚 Documentation Improvements",
41
+ effect: "changelog"
42
+ },
43
+ {
44
+ type: "style",
45
+ section: "🎨 Code Style & Formatting",
46
+ effect: "changelog"
47
+ },
48
+ {
49
+ type: "refactor",
50
+ section: "🔧 Code Refactoring",
51
+ effect: "changelog"
52
+ },
53
+ {
54
+ type: "perf",
55
+ section: "⚡ Performance Improvements",
56
+ effect: "bump"
57
+ },
58
+ {
59
+ type: "test",
60
+ section: "🧪 Test Updates",
61
+ effect: "changelog"
62
+ },
63
+ {
64
+ type: "chore",
65
+ section: "🌀 Miscellaneous",
66
+ effect: "changelog"
67
+ }
68
+ ] }
69
+ }],
70
+ "@semantic-release/github"
71
+ ]
72
+ };
73
+ //#endregion
74
+ export { semanticReleaseConfig as default, semanticReleaseConfig };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import semanticReleaseConfig from "./configs/release.mjs";
1
2
  import { RuleConfigSeverity } from "@commitlint/types";
2
3
  //#region src/configs/commitlint.d.ts
3
4
  declare const commitlintConfig: {
@@ -48,4 +49,4 @@ declare const oxlintConfig: {
48
49
  plugins: ("import" | "jsx-a11y" | "node" | "oxc" | "promise" | "react" | "react-perf" | "typescript" | "unicorn")[];
49
50
  };
50
51
  //#endregion
51
- export { commitlintConfig, cspellConfig, oxfmtConfig, oxlintConfig };
52
+ export { commitlintConfig, cspellConfig, oxfmtConfig, oxlintConfig, semanticReleaseConfig as release };
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import semanticReleaseConfig from "./configs/release.mjs";
1
2
  import { RuleConfigSeverity } from "@commitlint/types";
2
3
  import "oxlint";
3
4
  const commitlintConfig = {
@@ -114,4 +115,4 @@ const oxlintConfig = {
114
115
  ]
115
116
  };
116
117
  //#endregion
117
- export { commitlintConfig, cspellConfig, oxfmtConfig, oxlintConfig };
118
+ export { commitlintConfig, cspellConfig, oxfmtConfig, oxlintConfig, semanticReleaseConfig as release };
package/lefthook.yml CHANGED
@@ -30,7 +30,7 @@ pre-push:
30
30
  parallel: true
31
31
  commands:
32
32
  run-tests:
33
- run: bun test
33
+ run: bun run tests || bun test
34
34
 
35
35
  run-audit:
36
36
  run: bun audit
package/package.json CHANGED
@@ -48,7 +48,8 @@
48
48
  ".": "./dist/index.mjs",
49
49
  "./package.json": "./package.json",
50
50
  "./lefthook.yml": "./lefthook.yml",
51
- "./tsconfig.json": "./tsconfig.json"
51
+ "./tsconfig.json": "./tsconfig.json",
52
+ "./release": "./dist/configs/release.mjs"
52
53
  },
53
54
  "publishConfig": {
54
55
  "access": "public"
@@ -77,6 +78,8 @@
77
78
  "devDependencies": {
78
79
  "@types/bun": "^1.4.0",
79
80
  "@types/node": "^26.2.0",
81
+ "conventional-changelog-conventionalcommits": "^10.4.0",
82
+ "semantic-release": "^25.0.9",
80
83
  "tsdown": "^0.22.14"
81
84
  },
82
85
  "peerDependencies": {
@@ -87,5 +90,5 @@
87
90
  "node": "^26.2.0"
88
91
  },
89
92
  "packageManager": "bun@1.4.0",
90
- "version": "1.6.0"
93
+ "version": "1.8.0"
91
94
  }