@opinionated-ts/config 1.7.0 → 1.8.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 +42 -37
- package/dist/configs/release.mjs +0 -2
- package/dist/index.d.mts +14 -1
- package/dist/index.mjs +19 -2
- package/lefthook.yml +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -2,52 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
Opinionated, reusable TypeScript tooling configurations focused on performance, code quality, and developer experience.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## When to use?
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
+
The configurations prioritize:
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
26
|
+
## What's included
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
- [Typescript](./docs/tsconfig.md)
|
|
36
|
-
- [Commitlint](./docs/commitlint.md)
|
|
37
|
-
- [CSpell](./docs/cspell.md)
|
|
38
|
-
- [Oxfmt](./docs/oxfmt.md)
|
|
39
|
-
- [Oxlint](./docs/oxlint.md)
|
|
40
|
-
- [Lefthook](./docs/lefthook.md)
|
|
41
|
-
- [GitHub Actions](./docs/github-actions.md)
|
|
42
|
-
- [Release](./docs/release.md)
|
|
28
|
+
### Local Automatic Validations
|
|
43
29
|
|
|
44
|
-
|
|
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`) |
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
### Remote Automatic Validations
|
|
47
40
|
|
|
48
|
-
|
|
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
|
|
49
57
|
|
|
50
|
-
-
|
|
51
|
-
- Code quality
|
|
52
|
-
- Developer experience
|
|
53
|
-
- Modern tooling
|
|
58
|
+
Install the package and follow our [Installation, Usage & Configuration Guide](./docs/getting-started.md).
|
package/dist/configs/release.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import semanticReleaseConfig from "./configs/release.mjs";
|
|
2
|
-
|
|
2
|
+
//#region node_modules/@commitlint/types/lib/rules.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Rules always have a severity.
|
|
5
|
+
* Severity indicates what to do if the rule is found to be broken
|
|
6
|
+
* 0 - Disable this rule
|
|
7
|
+
* 1 - Warn for violations
|
|
8
|
+
* 2 - Error for violations
|
|
9
|
+
*/
|
|
10
|
+
declare enum RuleConfigSeverity {
|
|
11
|
+
Disabled = 0,
|
|
12
|
+
Warning = 1,
|
|
13
|
+
Error = 2
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
3
16
|
//#region src/configs/commitlint.d.ts
|
|
4
17
|
declare const commitlintConfig: {
|
|
5
18
|
extends: string[];
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import semanticReleaseConfig from "./configs/release.mjs";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
//#region node_modules/@commitlint/types/lib/rules.js
|
|
3
|
+
/**
|
|
4
|
+
* Rules always have a severity.
|
|
5
|
+
* Severity indicates what to do if the rule is found to be broken
|
|
6
|
+
* 0 - Disable this rule
|
|
7
|
+
* 1 - Warn for violations
|
|
8
|
+
* 2 - Error for violations
|
|
9
|
+
*/
|
|
10
|
+
var RuleConfigSeverity;
|
|
11
|
+
(function(RuleConfigSeverity) {
|
|
12
|
+
RuleConfigSeverity[RuleConfigSeverity["Disabled"] = 0] = "Disabled";
|
|
13
|
+
RuleConfigSeverity[RuleConfigSeverity["Warning"] = 1] = "Warning";
|
|
14
|
+
RuleConfigSeverity[RuleConfigSeverity["Error"] = 2] = "Error";
|
|
15
|
+
})(RuleConfigSeverity || (RuleConfigSeverity = {}));
|
|
16
|
+
var RuleConfigQuality;
|
|
17
|
+
(function(RuleConfigQuality) {
|
|
18
|
+
RuleConfigQuality[RuleConfigQuality["User"] = 0] = "User";
|
|
19
|
+
RuleConfigQuality[RuleConfigQuality["Qualified"] = 1] = "Qualified";
|
|
20
|
+
})(RuleConfigQuality || (RuleConfigQuality = {}));
|
|
4
21
|
const commitlintConfig = {
|
|
5
22
|
extends: ["@commitlint/config-conventional"],
|
|
6
23
|
rules: {
|
package/lefthook.yml
CHANGED