@venizia/dev-configs 0.2.1 → 0.3.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 +167 -33
- package/dist/{compile.d.ts → compilers/bun.d.ts} +1 -1
- package/dist/compilers/bun.d.ts.map +1 -0
- package/dist/{compile.js → compilers/bun.js} +8 -9
- package/dist/compilers/bun.js.map +1 -0
- package/dist/compilers/index.d.ts +2 -0
- package/dist/compilers/index.d.ts.map +1 -0
- package/dist/compilers/index.js +18 -0
- package/dist/compilers/index.js.map +1 -0
- package/dist/formatters/index.d.ts +3 -0
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/index.js +19 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/formatters/oxfmt.d.ts +14 -0
- package/dist/formatters/oxfmt.d.ts.map +1 -0
- package/dist/formatters/oxfmt.js +24 -0
- package/dist/formatters/oxfmt.js.map +1 -0
- package/dist/formatters/prettier.d.ts +3 -0
- package/dist/formatters/prettier.d.ts.map +1 -0
- package/dist/{prettier.js → formatters/prettier.js} +2 -2
- package/dist/formatters/prettier.js.map +1 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/linters/eslint.d.ts +20 -0
- package/dist/linters/eslint.d.ts.map +1 -0
- package/dist/linters/eslint.js +152 -0
- package/dist/linters/eslint.js.map +1 -0
- package/dist/linters/index.d.ts +5 -0
- package/dist/linters/index.d.ts.map +1 -0
- package/dist/linters/index.js +21 -0
- package/dist/linters/index.js.map +1 -0
- package/dist/linters/oxlint.d.ts +19 -0
- package/dist/linters/oxlint.d.ts.map +1 -0
- package/dist/linters/oxlint.js +166 -0
- package/dist/linters/oxlint.js.map +1 -0
- package/dist/linters/react.d.ts +58 -0
- package/dist/linters/react.d.ts.map +1 -0
- package/dist/linters/react.js +177 -0
- package/dist/linters/react.js.map +1 -0
- package/dist/linters/rules/common.d.ts +6 -0
- package/dist/linters/rules/common.d.ts.map +1 -0
- package/dist/linters/rules/common.js +3 -0
- package/dist/linters/rules/common.js.map +1 -0
- package/dist/linters/rules/eqeqeq.rule.d.ts +10 -0
- package/dist/linters/rules/eqeqeq.rule.d.ts.map +1 -0
- package/dist/linters/rules/eqeqeq.rule.js +13 -0
- package/dist/linters/rules/eqeqeq.rule.js.map +1 -0
- package/dist/linters/rules/index.d.ts +9 -0
- package/dist/linters/rules/index.d.ts.map +1 -0
- package/dist/linters/rules/index.js +25 -0
- package/dist/linters/rules/index.js.map +1 -0
- package/dist/linters/rules/naming-convention.rule.d.ts +20 -0
- package/dist/linters/rules/naming-convention.rule.d.ts.map +1 -0
- package/dist/linters/rules/naming-convention.rule.js +64 -0
- package/dist/linters/rules/naming-convention.rule.js.map +1 -0
- package/dist/linters/rules/no-restricted-imports.rule.d.ts +17 -0
- package/dist/linters/rules/no-restricted-imports.rule.d.ts.map +1 -0
- package/dist/linters/rules/no-restricted-imports.rule.js +19 -0
- package/dist/linters/rules/no-restricted-imports.rule.js.map +1 -0
- package/dist/linters/rules/no-restricted-properties.rule.d.ts +22 -0
- package/dist/linters/rules/no-restricted-properties.rule.d.ts.map +1 -0
- package/dist/linters/rules/no-restricted-properties.rule.js +24 -0
- package/dist/linters/rules/no-restricted-properties.rule.js.map +1 -0
- package/dist/linters/rules/no-unused-vars.rule.d.ts +12 -0
- package/dist/linters/rules/no-unused-vars.rule.d.ts.map +1 -0
- package/dist/linters/rules/no-unused-vars.rule.js +13 -0
- package/dist/linters/rules/no-unused-vars.rule.js.map +1 -0
- package/dist/linters/rules/prefer-nullish-coalescing.rule.d.ts +12 -0
- package/dist/linters/rules/prefer-nullish-coalescing.rule.d.ts.map +1 -0
- package/dist/linters/rules/prefer-nullish-coalescing.rule.js +13 -0
- package/dist/linters/rules/prefer-nullish-coalescing.rule.js.map +1 -0
- package/dist/linters/rules/switch-case-braces.rule.d.ts +10 -0
- package/dist/linters/rules/switch-case-braces.rule.d.ts.map +1 -0
- package/dist/linters/rules/switch-case-braces.rule.js +13 -0
- package/dist/linters/rules/switch-case-braces.rule.js.map +1 -0
- package/package.json +46 -16
- package/{tsconfig → src/tsconfig}/tsconfig.base.json +2 -2
- package/{tsconfig → src/tsconfig}/tsconfig.common.json +1 -1
- package/dist/compile.d.ts.map +0 -1
- package/dist/compile.js.map +0 -1
- package/dist/eslint.d.ts +0 -3
- package/dist/eslint.d.ts.map +0 -1
- package/dist/eslint.js +0 -25
- package/dist/eslint.js.map +0 -1
- package/dist/prettier.d.ts +0 -3
- package/dist/prettier.d.ts.map +0 -1
- package/dist/prettier.js.map +0 -1
- package/dist/react.d.ts +0 -32
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -111
- package/dist/react.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,35 +1,55 @@
|
|
|
1
1
|
# @venizia/dev-configs
|
|
2
2
|
|
|
3
|
-
The ESLint, Prettier and TypeScript settings every IGNIS package is built with. Install
|
|
4
|
-
dependency in an application that wants the same rules.
|
|
3
|
+
The oxlint, oxfmt, ESLint, Prettier and TypeScript settings every IGNIS package is built with. Install
|
|
4
|
+
it as a dev dependency in an application that wants the same rules.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
|
-
bun add -d @venizia/dev-configs eslint
|
|
9
|
+
bun add -d @venizia/dev-configs oxlint oxlint-tsgolint oxfmt eslint jiti typescript
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
`
|
|
13
|
-
|
|
12
|
+
`oxlint` (>=1.88.0), `oxlint-tsgolint` (>=7.0.2004), `oxfmt` (>=0.73.0), `eslint` (9 or 10),
|
|
13
|
+
`jiti` (>=2.2), `prettier` (3) and `typescript` (5 or 6) are optional peers. Install only the tools
|
|
14
|
+
you use. ESLint loads an `eslint.config.mts` through `jiti`, so a project with one needs it. A
|
|
15
|
+
project that still runs ESLint and Prettier installs `eslint prettier` and skips the oxc tools.
|
|
14
16
|
|
|
15
17
|
## Use it
|
|
16
18
|
|
|
17
|
-
Each tool takes one file.
|
|
19
|
+
Each tool takes one file. IGNIS keeps them in a `.configs/` folder and passes `-c` to each tool.
|
|
18
20
|
|
|
19
|
-
```
|
|
20
|
-
//
|
|
21
|
-
import {
|
|
21
|
+
```typescript
|
|
22
|
+
// .configs/oxlint.config.mts
|
|
23
|
+
import { defineConfig } from 'oxlint';
|
|
24
|
+
import { oxlintConfigs } from '@venizia/dev-configs/linters';
|
|
25
|
+
|
|
26
|
+
export default defineConfig(oxlintConfigs);
|
|
27
|
+
```
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
```typescript
|
|
30
|
+
// .configs/oxfmt.config.mts
|
|
31
|
+
import { defineConfig } from 'oxfmt';
|
|
32
|
+
import { oxfmtConfigs } from '@venizia/dev-configs/formatters';
|
|
33
|
+
|
|
34
|
+
export default defineConfig(oxfmtConfigs);
|
|
24
35
|
```
|
|
25
36
|
|
|
26
|
-
```
|
|
27
|
-
// .
|
|
28
|
-
import {
|
|
37
|
+
```typescript
|
|
38
|
+
// .configs/eslint.config.mts - the one rule oxlint cannot run yet
|
|
39
|
+
import { namingConventionConfigs } from '@venizia/dev-configs/linters';
|
|
40
|
+
|
|
41
|
+
export default namingConventionConfigs;
|
|
42
|
+
```
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
```bash
|
|
45
|
+
oxlint -c .configs/oxlint.config.mts --deny-warnings
|
|
46
|
+
eslint -c .configs/eslint.config.mts .
|
|
47
|
+
oxfmt -c .configs/oxfmt.config.mts --check "**/*.{ts,tsx,mts,js,mjs}"
|
|
31
48
|
```
|
|
32
49
|
|
|
50
|
+
`tsconfig.json` stays at the project root. Bun, the editor and oxlint's type-aware engine only find it
|
|
51
|
+
there.
|
|
52
|
+
|
|
33
53
|
```json
|
|
34
54
|
// tsconfig.json
|
|
35
55
|
{
|
|
@@ -63,14 +83,97 @@ earlier. Every IGNIS example does.
|
|
|
63
83
|
|
|
64
84
|
| Entry point | What it gives |
|
|
65
85
|
| :--- | :--- |
|
|
66
|
-
| `@venizia/dev-configs` |
|
|
67
|
-
| `@venizia/dev-configs/
|
|
86
|
+
| `@venizia/dev-configs` | Everything below, re-exported |
|
|
87
|
+
| `@venizia/dev-configs/compilers` | `BunCompiler` |
|
|
88
|
+
| `@venizia/dev-configs/formatters` | `oxfmtConfigs`, `prettierConfigs` |
|
|
89
|
+
| `@venizia/dev-configs/linters` | `oxlintConfigs`, `namingConventionConfigs`, `eslintConfigs`, `ReactEslintConfigs`, the rule classes and their types |
|
|
90
|
+
| `@venizia/dev-configs/tsconfig.base.json` | Target and lib ES2025, `module` Node16, strict mode with `noImplicitAny`, `strictPropertyInitialization` and `useUnknownInCatchVariables` off, `noEmitOnError`, tests excluded |
|
|
68
91
|
| `@venizia/dev-configs/tsconfig.common.json` | Extends the base and switches `module` and `moduleResolution` to `nodenext` |
|
|
69
92
|
|
|
70
93
|
## What each config sets
|
|
71
94
|
|
|
72
|
-
|
|
73
|
-
|
|
95
|
+
### oxlintConfigs
|
|
96
|
+
|
|
97
|
+
`oxlintConfigs` (type `OxlintConfig`) is a static port of the `eslintConfigs` rules, generated with
|
|
98
|
+
`@oxlint/migrate`. It enables the `typescript` and `unicorn` plugins and type-aware linting, so it needs
|
|
99
|
+
`oxlint-tsgolint`.
|
|
100
|
+
|
|
101
|
+
Not ported:
|
|
102
|
+
|
|
103
|
+
| Rule | Why |
|
|
104
|
+
| :--- | :--- |
|
|
105
|
+
| `@typescript-eslint/naming-convention` | oxlint has no equivalent yet - `namingConventionConfigs` runs it in ESLint |
|
|
106
|
+
| `@typescript-eslint/prefer-optional-chain` | In oxlint's nursery |
|
|
107
|
+
| `no-invalid-this` | `noImplicitThis` in `tsconfig.base.json` covers it |
|
|
108
|
+
| `n/prefer-node-protocol` | Maps to `unicorn/prefer-node-protocol` |
|
|
109
|
+
|
|
110
|
+
### namingConventionConfigs
|
|
111
|
+
|
|
112
|
+
`namingConventionConfigs` (type `Linter.Config[]`) sets only `@typescript-eslint/naming-convention`, with
|
|
113
|
+
the 15 LoopBack 4 selectors. It targets `.ts`, `.tsx`, `.mts` and `.cts`, and ignores `dist`, `build`,
|
|
114
|
+
`coverage`, `*.d.ts` and plain JavaScript. ESLint does not report unused disable comments in this
|
|
115
|
+
config, because oxlint owns the other rules.
|
|
116
|
+
|
|
117
|
+
### Rule classes
|
|
118
|
+
|
|
119
|
+
Each rule has a class with `static readonly NAME` and `static build(options)`. `build` returns the rule
|
|
120
|
+
entry with the IGNIS defaults. Every `severity` defaults to `'error'`.
|
|
121
|
+
|
|
122
|
+
| Class | Rule name | `build` options (default) |
|
|
123
|
+
| :--- | :--- | :--- |
|
|
124
|
+
| `EqeqeqRule` | `eqeqeq` | `mode`: `'always' \| 'smart'` (`'smart'`) |
|
|
125
|
+
| `NoUnusedVarsRule` | `no-unused-vars` | `vars` (`'all'`), `args` (`'none'`), `ignoreRestSiblings` (`false`) |
|
|
126
|
+
| `SwitchCaseBracesRule` | `unicorn/switch-case-braces` | `mode`: `'always' \| 'avoid'` (`'always'`) |
|
|
127
|
+
| `NoRestrictedImportsRule` | `no-restricted-imports` | `extraPaths`: `IRestrictedImportPath[]` (none), added to `PATHS` (lodash) |
|
|
128
|
+
| `NoRestrictedPropertiesRule` | `no-restricted-properties` | `extraProperties`: `IRestrictedProperty[]` (none), added to `SECURE_CONTEXT` (`crypto.randomUUID`) |
|
|
129
|
+
| `PreferNullishCoalescingRule` | `typescript/prefer-nullish-coalescing` | `ignoreConditionalTests`, `ignoreMixedLogicalExpressions`, `ignoreTernaryTests` (oxlint's own defaults) |
|
|
130
|
+
| `NamingConventionRule` | `@typescript-eslint/naming-convention` | `extraSelectors`: `TNamingSelector[]` (none), added after `SELECTORS` |
|
|
131
|
+
|
|
132
|
+
Types: `TRuleSeverity`, `TOxlintRuleEntry`, `TNamingSelector`, `IRestrictedImportPath`.
|
|
133
|
+
|
|
134
|
+
Replace a rule by key. This makes `==` an error everywhere and bans one more import:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
// .configs/oxlint.config.mts
|
|
138
|
+
import { defineConfig } from 'oxlint';
|
|
139
|
+
import {
|
|
140
|
+
EqeqeqRule,
|
|
141
|
+
NoRestrictedImportsRule,
|
|
142
|
+
oxlintConfigs,
|
|
143
|
+
} from '@venizia/dev-configs/linters';
|
|
144
|
+
|
|
145
|
+
export default defineConfig({
|
|
146
|
+
...oxlintConfigs,
|
|
147
|
+
rules: {
|
|
148
|
+
...oxlintConfigs.rules,
|
|
149
|
+
[EqeqeqRule.NAME]: EqeqeqRule.build({ mode: 'always' }),
|
|
150
|
+
[NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build({
|
|
151
|
+
extraPaths: [{ name: 'moment', message: 'Use TemporalHelper instead.' }],
|
|
152
|
+
}),
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### oxfmtConfigs and prettierConfigs
|
|
158
|
+
|
|
159
|
+
`oxfmtConfigs` (type `OxfmtConfig`) and `prettierConfigs` hold the same seven options, so the output
|
|
160
|
+
matches. oxfmt differs from Prettier on long union types, which it breaks with a leading `|` per line.
|
|
161
|
+
|
|
162
|
+
| Setting | Value |
|
|
163
|
+
| :--- | :--- |
|
|
164
|
+
| `printWidth` | `100` |
|
|
165
|
+
| `tabWidth` | `2` |
|
|
166
|
+
| `singleQuote` | `true` |
|
|
167
|
+
| `semi` | `true` |
|
|
168
|
+
| `trailingComma` | `'all'` |
|
|
169
|
+
| `bracketSpacing` | `true` |
|
|
170
|
+
| `arrowParens` | `'avoid'` |
|
|
171
|
+
|
|
172
|
+
### eslintConfigs
|
|
173
|
+
|
|
174
|
+
`eslintConfigs` keeps its shape and resolves to the same rules as before, but is now owned here instead
|
|
175
|
+
of wrapping `@minimaltech/eslint-node`: ESLint recommended, typescript-eslint, Prettier as a lint
|
|
176
|
+
rule, naming conventions, `curly`, `eslint-plugin-n`, plus these IGNIS rules:
|
|
74
177
|
|
|
75
178
|
| Rule | Setting |
|
|
76
179
|
| :--- | :--- |
|
|
@@ -79,6 +182,8 @@ lint rule, naming conventions, `curly`, `eslint-plugin-n`) plus these IGNIS rule
|
|
|
79
182
|
| `@typescript-eslint/no-namespace` | `error` |
|
|
80
183
|
| `unicorn/switch-case-braces` | `['error', 'always']` |
|
|
81
184
|
|
|
185
|
+
### ReactEslintConfigs
|
|
186
|
+
|
|
82
187
|
`ReactEslintConfigs.create({ plugins })` is `eslintConfigs` plus what a React frontend needs. The
|
|
83
188
|
plugins come in as options, so a backend installs none of them:
|
|
84
189
|
|
|
@@ -99,13 +204,13 @@ export default [
|
|
|
99
204
|
| :--- | :--- |
|
|
100
205
|
| React correctness (`jsx-key`, `no-children-prop`, `no-deprecated`, ... - 14 rules) | `error`, `.jsx`/`.tsx` |
|
|
101
206
|
| `jsx-a11y` basics (`alt-text`, `aria-props`, `aria-role`, ... - 9 rules) | `error`, `.jsx`/`.tsx` |
|
|
102
|
-
| `react-hooks/rules-of-hooks` / `exhaustive-deps` | `error
|
|
207
|
+
| `react-hooks/rules-of-hooks` / `exhaustive-deps` | `error`, every source file |
|
|
103
208
|
| `@typescript-eslint/consistent-type-imports` | `['error', { prefer: 'type-imports' }]` |
|
|
104
209
|
| `naming-convention` | the base rule, plus PascalCase functions (`function App()`), `.jsx`/`.tsx` |
|
|
105
|
-
| `no-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
210
|
+
| `no-restricted-properties` | `NoRestrictedPropertiesRule.build()` - bans `crypto.randomUUID` |
|
|
211
|
+
|
|
212
|
+
Nothing in the base is relaxed: frontend code meets the backend's standard, so a floating promise, a
|
|
213
|
+
`void`, a use before declaration or a shadowed name fails the lint as it does in a service.
|
|
109
214
|
|
|
110
215
|
Rules the automatic JSX runtime or `tsc` already enforce (`react-in-jsx-scope`, `prop-types`,
|
|
111
216
|
`jsx-no-undef`, ...) are left out.
|
|
@@ -116,17 +221,45 @@ Rules the automatic JSX runtime or `tsc` already enforce (`react-in-jsx-scope`,
|
|
|
116
221
|
- `consistent-type-imports` keeps the default `fixStyle`; a codebase that prefers
|
|
117
222
|
`inline-type-imports` sets it on top.
|
|
118
223
|
|
|
119
|
-
|
|
224
|
+
### ReactOxlintConfigs and reactNamingConventionConfigs
|
|
120
225
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
226
|
+
The oxlint version of the React preset. oxlint runs the React, hooks and `jsx-a11y` rules natively, so
|
|
227
|
+
nothing is passed in. Pair it with `reactNamingConventionConfigs` on the ESLint side:
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
// .configs/oxlint.config.mts
|
|
231
|
+
import { defineConfig } from 'oxlint';
|
|
232
|
+
import { ReactOxlintConfigs } from '@venizia/dev-configs/linters';
|
|
233
|
+
|
|
234
|
+
export default defineConfig(ReactOxlintConfigs.create());
|
|
235
|
+
|
|
236
|
+
// .configs/eslint.config.mts
|
|
237
|
+
import { reactNamingConventionConfigs } from '@venizia/dev-configs/linters';
|
|
238
|
+
|
|
239
|
+
export default reactNamingConventionConfigs;
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`ReactOxlintConfigs.create()` is `oxlintConfigs` plus the same rules as the ESLint table above, as
|
|
243
|
+
strict as the base. `react/no-deprecated` is left out: oxlint has no port of it. `crypto.randomUUID`
|
|
244
|
+
is banned because it exists only in a secure context (https, localhost), and is `undefined` on a
|
|
245
|
+
plain-http origin or in a WebView.
|
|
246
|
+
|
|
247
|
+
The presets start strict. An application that wants less overrides the rule after the preset:
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
const base = ReactOxlintConfigs.create();
|
|
251
|
+
|
|
252
|
+
export default defineConfig({
|
|
253
|
+
...base,
|
|
254
|
+
rules: { ...base.rules, 'typescript/no-floating-promises': 'warn' },
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
`reactNamingConventionConfigs` is `namingConventionConfigs` plus PascalCase functions in `.jsx` and
|
|
259
|
+
`.tsx` files. To ban `crypto.randomUUID` in a project without React, add
|
|
260
|
+
`[NoRestrictedPropertiesRule.NAME]: NoRestrictedPropertiesRule.build()` to its rules.
|
|
261
|
+
|
|
262
|
+
### BunCompiler
|
|
130
263
|
|
|
131
264
|
`BunCompiler.compile()` builds one Bun executable: minified, with a linked source map. The
|
|
132
265
|
compile target comes from `BUN_TARGET` and defaults to `bun-linux-x64`.
|
|
@@ -146,6 +279,7 @@ The root of the chain, with no IGNIS dependency: **dev-configs** -> inversion ->
|
|
|
146
279
|
|
|
147
280
|
- [Tooling configuration](https://ignis.venizia.ai/best-practices/code-style-standards/tooling)
|
|
148
281
|
- [TypeScript 6 and toolchain changelog](https://ignis.venizia.ai/changelogs/2026-03-31-typescript-6-and-toolchain)
|
|
282
|
+
- [oxlint and oxfmt changelog](https://ignis.venizia.ai/changelogs/2026-10-16-oxlint-oxfmt-migration)
|
|
149
283
|
- [Changelog](https://ignis.venizia.ai/changelogs/)
|
|
150
284
|
- [Source](https://github.com/VENIZIA-AI/ignis/blob/main/packages/dev-configs)
|
|
151
285
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../../src/compilers/bun.ts"],"names":[],"mappings":"AAIA,gHAAgH;AAChH,qBAAa,WAAW;IACtB;;;;OAIG;WACU,OAAO,CAClB,IAAI,GAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;KACtB,GACL,OAAO,CAAC,IAAI,CAAC;CAgCjB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BunCompiler = void 0;
|
|
4
|
-
const DEFAULT_ENTRYPOINT =
|
|
5
|
-
const DEFAULT_OUTFILE =
|
|
6
|
-
const DEFAULT_COMPILE_TARGET =
|
|
4
|
+
const DEFAULT_ENTRYPOINT = './dist/index.js';
|
|
5
|
+
const DEFAULT_OUTFILE = './dist/bin';
|
|
6
|
+
const DEFAULT_COMPILE_TARGET = 'bun-linux-x64';
|
|
7
7
|
/** Bundles and compiles a single Bun executable: minified, linked sourcemaps, target read from `BUN_TARGET`. */
|
|
8
8
|
class BunCompiler {
|
|
9
9
|
/**
|
|
@@ -15,12 +15,11 @@ class BunCompiler {
|
|
|
15
15
|
const { entrypoint = DEFAULT_ENTRYPOINT, outfile = DEFAULT_OUTFILE, target = Bun.env.BUN_TARGET ?? DEFAULT_COMPILE_TARGET, plugins = [], } = opts;
|
|
16
16
|
const built = await Bun.build({
|
|
17
17
|
entrypoints: [entrypoint],
|
|
18
|
-
target:
|
|
18
|
+
target: 'bun',
|
|
19
19
|
minify: { whitespace: true, syntax: true },
|
|
20
|
-
sourcemap:
|
|
20
|
+
sourcemap: 'linked',
|
|
21
21
|
throw: false,
|
|
22
22
|
compile: {
|
|
23
|
-
// `target` is read from an environment variable at runtime, so it cannot be checked against Bun's literal union at compile time.
|
|
24
23
|
target: target,
|
|
25
24
|
outfile,
|
|
26
25
|
},
|
|
@@ -31,10 +30,10 @@ class BunCompiler {
|
|
|
31
30
|
// create a circular workspace dependency, so a failed compile throws a plain `Error` instead.
|
|
32
31
|
throw new Error([
|
|
33
32
|
`[BunCompiler] compile failed for entrypoint "${entrypoint}":`,
|
|
34
|
-
...built.logs.map(
|
|
35
|
-
].join(
|
|
33
|
+
...built.logs.map(log => `[${log.level}] ${log.message}`),
|
|
34
|
+
].join('\n'));
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
exports.BunCompiler = BunCompiler;
|
|
40
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun.js","sourceRoot":"","sources":["../../src/compilers/bun.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,eAAe,GAAG,YAAY,CAAC;AACrC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,gHAAgH;AAChH,MAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,OAKI,EAAE;QAEN,MAAM,EACJ,UAAU,GAAG,kBAAkB,EAC/B,OAAO,GAAG,eAAe,EACzB,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,sBAAsB,EACrD,OAAO,GAAG,EAAE,GACb,GAAG,IAAI,CAAC;QAET,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC;YAC5B,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1C,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,MAAM,EAAE,MAAiC;gBACzC,OAAO;aACR;YACD,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,4FAA4F;YAC5F,8FAA8F;YAC9F,MAAM,IAAI,KAAK,CACb;gBACE,gDAAgD,UAAU,IAAI;gBAC9D,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;aAC1D,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA7CD,kCA6CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compilers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bun"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compilers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./oxfmt"), exports);
|
|
18
|
+
__exportStar(require("./prettier"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OxfmtConfig } from 'oxfmt';
|
|
2
|
+
/**
|
|
3
|
+
* The oxfmt port of `prettierConfigs` - the same seven options, so the output matches Prettier's.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // .configs/oxfmt.config.mts
|
|
7
|
+
* import { defineConfig } from 'oxfmt';
|
|
8
|
+
* import { oxfmtConfigs } from '@venizia/dev-configs/formatters';
|
|
9
|
+
*
|
|
10
|
+
* export default defineConfig(oxfmtConfigs);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const oxfmtConfigs: OxfmtConfig;
|
|
14
|
+
//# sourceMappingURL=oxfmt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxfmt.d.ts","sourceRoot":"","sources":["../../src/formatters/oxfmt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,WAQ1B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.oxfmtConfigs = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The oxfmt port of `prettierConfigs` - the same seven options, so the output matches Prettier's.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* // .configs/oxfmt.config.mts
|
|
9
|
+
* import { defineConfig } from 'oxfmt';
|
|
10
|
+
* import { oxfmtConfigs } from '@venizia/dev-configs/formatters';
|
|
11
|
+
*
|
|
12
|
+
* export default defineConfig(oxfmtConfigs);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
exports.oxfmtConfigs = {
|
|
16
|
+
bracketSpacing: true,
|
|
17
|
+
singleQuote: true,
|
|
18
|
+
printWidth: 100,
|
|
19
|
+
tabWidth: 2,
|
|
20
|
+
trailingComma: 'all',
|
|
21
|
+
arrowParens: 'avoid',
|
|
22
|
+
semi: true,
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=oxfmt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxfmt.js","sourceRoot":"","sources":["../../src/formatters/oxfmt.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACU,QAAA,YAAY,GAAgB;IACvC,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,IAAI;CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/formatters/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,eAAe,EAAE,MAQ7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../src/formatters/prettier.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAW;IACrC,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,IAAI;CACX,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./react"), exports);
|
|
17
|
+
__exportStar(require("./compilers"), exports);
|
|
18
|
+
__exportStar(require("./formatters"), exports);
|
|
19
|
+
__exportStar(require("./linters"), exports);
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,+CAA6B;AAC7B,4CAA0B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* The full ESLint preset, owned here: the LoopBack 4 rule set on the ESLint, typescript-eslint and
|
|
4
|
+
* Prettier recommended presets, type-aware through the project service. A project on oxlint uses
|
|
5
|
+
* `oxlintConfigs` + `namingConventionConfigs` instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare const eslintConfigs: Linter.Config[];
|
|
8
|
+
/**
|
|
9
|
+
* The one rule of `eslintConfigs` that oxlint cannot run yet, as a standalone ESLint preset to run
|
|
10
|
+
* next to `oxlintConfigs`. It needs no type information, so ESLint stays fast.
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* // .configs/eslint.config.mts
|
|
14
|
+
* import { namingConventionConfigs } from '@venizia/dev-configs/linters';
|
|
15
|
+
*
|
|
16
|
+
* export default namingConventionConfigs;
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const namingConventionConfigs: Linter.Config[];
|
|
20
|
+
//# sourceMappingURL=eslint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../src/linters/eslint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAwFrC;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAqCvC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAWlD,CAAC"}
|