@venizia/dev-configs 0.2.0-8 → 0.2.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/LICENSE.md +0 -1
- package/README.md +54 -104
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -72,7 +72,6 @@ Ignis uses the following open-source libraries. We are grateful to the authors a
|
|
|
72
72
|
|
|
73
73
|
| Library | License | Description |
|
|
74
74
|
|---------|---------|-------------|
|
|
75
|
-
| [Lodash](https://github.com/lodash/lodash) | MIT | Utility library |
|
|
76
75
|
| [reflect-metadata](https://github.com/rbuckton/reflect-metadata) | Apache-2.0 | Metadata reflection API |
|
|
77
76
|
|
|
78
77
|
### Documentation Dependencies
|
package/README.md
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
# @venizia/dev-configs
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
**Shared ESLint, Prettier, and TypeScript configs for the IGNIS ecosystem**
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/@venizia/dev-configs)
|
|
8
|
-
[](./LICENSE.md)
|
|
9
|
-
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://eslint.org/)
|
|
11
|
-
[](https://prettier.io/)
|
|
12
|
-
|
|
13
|
-
[Documentation](https://ignis.venizia.ai) •
|
|
14
|
-
[Best practices](https://ignis.venizia.ai/best-practices/) •
|
|
15
|
-
[Repository](https://github.com/VENIZIA-AI/ignis)
|
|
16
|
-
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
One source of truth for lint, format, and compile settings across every IGNIS package, example, and
|
|
22
|
-
downstream app. It ships three things: an ESLint flat config array, a Prettier config object, and two
|
|
23
|
-
`tsconfig` files - one base, one for NodeNext modules.
|
|
24
|
-
|
|
25
|
-
Reach for it when you are building on IGNIS and want the same rules the framework itself is written
|
|
26
|
-
under. Consumption is three lines per tool.
|
|
3
|
+
The ESLint, Prettier and TypeScript settings every IGNIS package is built with. Install it as a dev
|
|
4
|
+
dependency in an application that wants the same rules.
|
|
27
5
|
|
|
28
6
|
## Install
|
|
29
7
|
|
|
@@ -31,94 +9,76 @@ under. Consumption is three lines per tool.
|
|
|
31
9
|
bun add -d @venizia/dev-configs eslint prettier typescript
|
|
32
10
|
```
|
|
33
11
|
|
|
34
|
-
`eslint
|
|
35
|
-
|
|
12
|
+
`eslint` (9 or 10), `prettier` (3) and `typescript` (5 or 6) are optional peers. Install only the
|
|
13
|
+
tools you use.
|
|
36
14
|
|
|
37
15
|
## Use it
|
|
38
16
|
|
|
39
|
-
|
|
17
|
+
Each tool takes one file.
|
|
40
18
|
|
|
41
19
|
```javascript
|
|
20
|
+
// eslint.config.mjs
|
|
42
21
|
import { eslintConfigs } from '@venizia/dev-configs';
|
|
43
22
|
|
|
44
|
-
export default eslintConfigs;
|
|
23
|
+
export default [{ ignores: ['dist/'] }, ...eslintConfigs];
|
|
45
24
|
```
|
|
46
25
|
|
|
47
|
-
**`.prettierrc.mjs`**
|
|
48
|
-
|
|
49
26
|
```javascript
|
|
27
|
+
// .prettierrc.mjs
|
|
50
28
|
import { prettierConfigs } from '@venizia/dev-configs';
|
|
51
29
|
|
|
52
30
|
export default prettierConfigs;
|
|
53
31
|
```
|
|
54
32
|
|
|
55
|
-
**`tsconfig.json`**
|
|
56
|
-
|
|
57
33
|
```json
|
|
34
|
+
// tsconfig.json
|
|
58
35
|
{
|
|
59
36
|
"extends": "@venizia/dev-configs/tsconfig.common.json",
|
|
60
|
-
"compilerOptions": {
|
|
37
|
+
"compilerOptions": {
|
|
38
|
+
"outDir": "dist",
|
|
39
|
+
"rootDir": "src",
|
|
40
|
+
"experimentalDecorators": true,
|
|
41
|
+
"emitDecoratorMetadata": true
|
|
42
|
+
},
|
|
61
43
|
"include": ["src"]
|
|
62
44
|
}
|
|
63
45
|
```
|
|
64
46
|
|
|
65
|
-
|
|
47
|
+
## Declare the decorator flag in your own tsconfig
|
|
66
48
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
The base config sets `experimentalDecorators`. But Bun can miss a flag inherited through `extends`
|
|
50
|
+
when it runs your source. Parameter decorators are then dropped with no error, and an `@inject`
|
|
51
|
+
value is `undefined` at run time.
|
|
70
52
|
|
|
71
|
-
|
|
53
|
+
Declare `experimentalDecorators: true` in your application's own `tsconfig.json`, as in the example
|
|
54
|
+
earlier. Every IGNIS example does.
|
|
72
55
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
> **Bun does not resolve these flags through `extends`.** An application `tsconfig.json` must declare
|
|
79
|
-
> them inline, even when it already extends `tsconfig.common.json`.
|
|
56
|
+
| Flag | Base value | Why |
|
|
57
|
+
| :--- | :--- | :--- |
|
|
58
|
+
| `experimentalDecorators` | `true` | `@inject`, `@controller`, `@repository` and the other decorators need it |
|
|
59
|
+
| `emitDecoratorMetadata` | `true` | Optional. IGNIS reads `design:paramtypes` once, to validate a `@repository` constructor, and skips the check when the metadata is absent |
|
|
60
|
+
| `useDefineForClassFields` | `false` | Class fields are assigned, not defined, so a subclass field initializer does not shadow a value the base constructor set |
|
|
80
61
|
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
"extends": "@venizia/dev-configs/tsconfig.common.json",
|
|
84
|
-
"compilerOptions": {
|
|
85
|
-
"experimentalDecorators": true,
|
|
86
|
-
"emitDecoratorMetadata": true,
|
|
87
|
-
"useDefineForClassFields": false
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
```
|
|
62
|
+
## Entry points
|
|
91
63
|
|
|
92
|
-
|
|
93
|
-
|
|
64
|
+
| Entry point | What it gives |
|
|
65
|
+
| :--- | :--- |
|
|
66
|
+
| `@venizia/dev-configs` | `eslintConfigs` (flat config array), `prettierConfigs`, `BunCompiler` |
|
|
67
|
+
| `@venizia/dev-configs/tsconfig.base.json` | Target and lib ES2024, `module` Node16, strict mode with `noImplicitAny`, `strictPropertyInitialization` and `useUnknownInCatchVariables` off, `noEmitOnError`, tests excluded |
|
|
68
|
+
| `@venizia/dev-configs/tsconfig.common.json` | Extends the base and switches `module` and `moduleResolution` to `nodenext` |
|
|
94
69
|
|
|
95
70
|
## What each config sets
|
|
96
71
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
A flat config array (ESLint 9+; the legacy `.eslintrc` format is not supported). Three layers, later
|
|
100
|
-
ones winning:
|
|
101
|
-
|
|
102
|
-
| Layer | Source | Brings |
|
|
103
|
-
| :--- | :--- | :--- |
|
|
104
|
-
| 1 | `@minimaltech/eslint-common` | `eslint:recommended`, `typescript-eslint` recommended, `eslint-plugin-prettier` (format violations are lint errors), naming-convention rules |
|
|
105
|
-
| 2 | `@minimaltech/eslint-node` | `eslint-plugin-n`, LoopBack-style strict rules |
|
|
106
|
-
| 3 | this package | the IGNIS overrides below |
|
|
107
|
-
|
|
108
|
-
| Rule | Setting | Why |
|
|
109
|
-
| :--- | :--- | :--- |
|
|
110
|
-
| `@typescript-eslint/no-explicit-any` | `off` | framework generics need escape hatches; prefer a simple cast over a baroque one |
|
|
111
|
-
| `curly` | `['error', 'all']` | always braces, no single-line ifs |
|
|
112
|
-
| `unicorn/switch-case-braces` | `['error', 'always']` | braced `case` blocks so a `const` cannot leak between cases |
|
|
72
|
+
`eslintConfigs` is `@minimaltech/eslint-node` (ESLint recommended, typescript-eslint, Prettier as a
|
|
73
|
+
lint rule, naming conventions, `eslint-plugin-n`) plus three IGNIS rules:
|
|
113
74
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
```
|
|
75
|
+
| Rule | Setting |
|
|
76
|
+
| :--- | :--- |
|
|
77
|
+
| `@typescript-eslint/no-explicit-any` | `off` |
|
|
78
|
+
| `curly` | `['error', 'all']` |
|
|
79
|
+
| `unicorn/switch-case-braces` | `['error', 'always']` |
|
|
120
80
|
|
|
121
|
-
|
|
81
|
+
`prettierConfigs`:
|
|
122
82
|
|
|
123
83
|
| Setting | Value |
|
|
124
84
|
| :--- | :--- |
|
|
@@ -130,35 +90,25 @@ root and **must `include` the config files themselves** or ESLint fails on them:
|
|
|
130
90
|
| `bracketSpacing` | `true` |
|
|
131
91
|
| `arrowParens` | `'avoid'` |
|
|
132
92
|
|
|
133
|
-
|
|
93
|
+
`BunCompiler.compile()` builds one Bun executable: minified, with a linked source map. The
|
|
94
|
+
compile target comes from `BUN_TARGET` and defaults to `bun-linux-x64`.
|
|
134
95
|
|
|
135
|
-
|
|
96
|
+
```typescript
|
|
97
|
+
import { BunCompiler } from '@venizia/dev-configs';
|
|
136
98
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
| `tsconfig.base.json` | the foundation: `target`/`lib` ES2024, `module` Node16, the decorator flags, strict mode, `declaration` + source maps, `noEmitOnError` |
|
|
140
|
-
| `tsconfig.common.json` | applications: extends the base, switches `module` and `moduleResolution` to `nodenext` |
|
|
141
|
-
|
|
142
|
-
Strictness is deliberately balanced rather than maximal - `strict: true`, but `noImplicitAny`,
|
|
143
|
-
`strictPropertyInitialization`, and `useUnknownInCatchVariables` are `false` because DI-injected
|
|
144
|
-
properties and framework generics cannot satisfy them. `noUnusedLocals`, `noUnusedParameters`,
|
|
145
|
-
`noImplicitOverride`, and `noFallthroughCasesInSwitch` are on.
|
|
146
|
-
|
|
147
|
-
The base config `exclude`s tests (`**/*.test.ts`, `**/*.spec.ts`, `**/__tests__/**`). If your build
|
|
148
|
-
config re-includes them, remember `noEmitOnError: true` means one broken test aborts the whole emit.
|
|
99
|
+
await BunCompiler.compile({ entrypoint: './src/index.ts', outfile: './dist/app' });
|
|
100
|
+
```
|
|
149
101
|
|
|
150
|
-
##
|
|
102
|
+
## Where it sits
|
|
151
103
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
- It is the root of the build chain: `dev-configs -> inversion -> helpers -> boot -> core`.
|
|
155
|
-
- Use `tsc` directly. Never `npx`, `bunx`, or `bun x` for TypeScript compilation.
|
|
104
|
+
The root of the chain, with no IGNIS dependency: **dev-configs** -> inversion -> {filter, helpers}
|
|
105
|
+
-> {boot, kernel} -> connectors -> {core-worker, core-server} -> atlas.
|
|
156
106
|
|
|
157
107
|
## Links
|
|
158
108
|
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[Changelog](https://ignis.venizia.ai/changelogs/)
|
|
162
|
-
[
|
|
109
|
+
- [Tooling configuration](https://ignis.venizia.ai/best-practices/code-style-standards/tooling)
|
|
110
|
+
- [TypeScript 6 and toolchain changelog](https://ignis.venizia.ai/changelogs/2026-03-31-typescript-6-and-toolchain)
|
|
111
|
+
- [Changelog](https://ignis.venizia.ai/changelogs/)
|
|
112
|
+
- [Source](https://github.com/VENIZIA-AI/ignis/blob/main/packages/dev-configs)
|
|
163
113
|
|
|
164
114
|
MIT licensed - see [LICENSE.md](./LICENSE.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/dev-configs",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shareable development configurations for TypeScript projects: ESLint v9 flat config (with unicorn plugin), Prettier formatting, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages. 3-line consumption pattern per config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build-tools",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"license": "MIT",
|
|
59
59
|
"engines": {
|
|
60
|
-
"bun": ">=1.
|
|
60
|
+
"bun": ">=1.4"
|
|
61
61
|
},
|
|
62
62
|
"exports": {
|
|
63
63
|
".": {
|