@opsydyn/elysia-spectral 0.4.0 → 0.5.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/CHANGELOG.md +14 -0
- package/README.md +84 -2
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +2 -2
- package/dist/{core-D_ro1XEW.mjs → core-DTKNy6TU.mjs} +25 -5
- package/dist/{index-CMyl_MsI.d.mts → index-B4fxn0G6.d.mts} +4 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.1](https://github.com/opsydyn/elysia-spectral/compare/v0.5.0...v0.5.1) (2026-04-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* tighten public API surface and align LintRunResult.ok with threshold ([8ca3331](https://github.com/opsydyn/elysia-spectral/commit/8ca3331db59e5753d454e759730e3ecd931d2087))
|
|
9
|
+
|
|
10
|
+
## [0.5.0](https://github.com/opsydyn/elysia-spectral/compare/v0.4.0...v0.5.0) (2026-04-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add Bruno collection output via output.brunoCollectionPath ([45abcd6](https://github.com/opsydyn/elysia-spectral/commit/45abcd6225bd94098d5974a27ef2c7642614c77f))
|
|
16
|
+
|
|
3
17
|
## [0.4.0](https://github.com/opsydyn/elysia-spectral/compare/v0.3.0...v0.4.0) (2026-04-15)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -49,6 +49,8 @@ Current package scope:
|
|
|
49
49
|
|
|
50
50
|
- startup linting
|
|
51
51
|
- threshold-based failure
|
|
52
|
+
- first-party governance presets: `recommended`, `server`, `strict`
|
|
53
|
+
- RFC 9457 Problem Details enforcement (strict preset)
|
|
52
54
|
- repo-level and local rulesets
|
|
53
55
|
- YAML, JS, TS, and in-memory rulesets
|
|
54
56
|
- resolver pipeline for advanced ruleset loading
|
|
@@ -57,6 +59,7 @@ Current package scope:
|
|
|
57
59
|
- JUnit report output
|
|
58
60
|
- SARIF report output
|
|
59
61
|
- OpenAPI snapshot output
|
|
62
|
+
- Bruno collection output (OpenCollection YAML or JSON)
|
|
60
63
|
- reusable runtime for CI and tests
|
|
61
64
|
- opt-in healthcheck endpoint for cached and fresh runs
|
|
62
65
|
|
|
@@ -497,6 +500,47 @@ JUnit output lets CI systems that consume test XML (Buildkite, CircleCI, GitLab,
|
|
|
497
500
|
if: always()
|
|
498
501
|
```
|
|
499
502
|
|
|
503
|
+
### Generate a Bruno collection
|
|
504
|
+
|
|
505
|
+
Export the generated OpenAPI spec as a Bruno collection. Bruno is an open-source API client — generated collections let your team test API endpoints without manual import steps.
|
|
506
|
+
|
|
507
|
+
The output format is determined by the file extension:
|
|
508
|
+
|
|
509
|
+
- `.yml` / `.yaml` — OpenCollection YAML (recommended, Bruno v3.0.0+)
|
|
510
|
+
- `.json` — Bruno collection JSON (compatible with all Bruno versions)
|
|
511
|
+
|
|
512
|
+
```ts
|
|
513
|
+
// OpenCollection YAML — recommended
|
|
514
|
+
spectralPlugin({
|
|
515
|
+
output: {
|
|
516
|
+
brunoCollectionPath: './bruno/collection.yml'
|
|
517
|
+
}
|
|
518
|
+
})
|
|
519
|
+
|
|
520
|
+
// Bruno JSON — for older Bruno versions
|
|
521
|
+
spectralPlugin({
|
|
522
|
+
output: {
|
|
523
|
+
brunoCollectionPath: './bruno/collection.json'
|
|
524
|
+
}
|
|
525
|
+
})
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
The collection is written after each lint run — at startup, on healthcheck, or in CI. Commit it alongside the spec snapshot so it stays in sync with the API surface.
|
|
529
|
+
|
|
530
|
+
To regenerate in CI as part of your lint script:
|
|
531
|
+
|
|
532
|
+
```ts
|
|
533
|
+
const runtime = createOpenApiLintRuntime({
|
|
534
|
+
preset: 'strict',
|
|
535
|
+
output: {
|
|
536
|
+
specSnapshotPath: './reports/openapi-snapshot.json',
|
|
537
|
+
brunoCollectionPath: './bruno/collection.yml',
|
|
538
|
+
},
|
|
539
|
+
})
|
|
540
|
+
|
|
541
|
+
await runtime.run(app)
|
|
542
|
+
```
|
|
543
|
+
|
|
500
544
|
### Track OpenAPI snapshot drift
|
|
501
545
|
|
|
502
546
|
Commit the generated OpenAPI snapshot and use `git diff --exit-code` to detect when the API surface changes unexpectedly in a PR.
|
|
@@ -521,6 +565,41 @@ git commit -m "chore: add openapi snapshot"
|
|
|
521
565
|
|
|
522
566
|
If the snapshot has changed, the CI step fails and the diff is visible in the logs. Deliberate API changes are acknowledged by updating the committed snapshot — accidental ones are caught before they ship.
|
|
523
567
|
|
|
568
|
+
### Generate a typed client with openapi-ts
|
|
569
|
+
|
|
570
|
+
Use the committed OpenAPI snapshot as input to [`openapi-ts`](https://openapi-ts.dev) to keep a generated TypeScript client in sync with the API surface.
|
|
571
|
+
|
|
572
|
+
1. Install `openapi-ts`:
|
|
573
|
+
|
|
574
|
+
```bash
|
|
575
|
+
bun add -d @hey-api/openapi-ts
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
2. Add a codegen script to `package.json`:
|
|
579
|
+
|
|
580
|
+
```json
|
|
581
|
+
{
|
|
582
|
+
"scripts": {
|
|
583
|
+
"generate:client": "openapi-ts --input ./reports/openapi-snapshot.json --output ./src/generated/client --client @hey-api/client-fetch"
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
3. Chain it after the lint step in CI:
|
|
589
|
+
|
|
590
|
+
```yaml
|
|
591
|
+
- name: Lint OpenAPI spec
|
|
592
|
+
run: bun scripts/lint-openapi.ts
|
|
593
|
+
|
|
594
|
+
- name: Generate typed client
|
|
595
|
+
run: bun run generate:client
|
|
596
|
+
|
|
597
|
+
- name: Check for client drift
|
|
598
|
+
run: git diff --exit-code src/generated/client/
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
The lint gate runs first — if the spec is invalid the codegen step never runs. The drift check ensures the committed client always matches the current spec.
|
|
602
|
+
|
|
524
603
|
### Work on this repository locally
|
|
525
604
|
|
|
526
605
|
From the monorepo root:
|
|
@@ -564,6 +643,7 @@ type OpenApiLintArtifacts = {
|
|
|
564
643
|
junitReportPath?: string
|
|
565
644
|
sarifReportPath?: string
|
|
566
645
|
specSnapshotPath?: string
|
|
646
|
+
brunoCollectionPath?: string
|
|
567
647
|
}
|
|
568
648
|
|
|
569
649
|
type OpenApiLintSink = {
|
|
@@ -607,6 +687,8 @@ type SpectralPluginOptions = {
|
|
|
607
687
|
junitReportPath?: string
|
|
608
688
|
sarifReportPath?: string
|
|
609
689
|
specSnapshotPath?: string | true
|
|
690
|
+
/** .yml/.yaml → OpenCollection YAML (Bruno v3+), .json → Bruno collection JSON */
|
|
691
|
+
brunoCollectionPath?: string
|
|
610
692
|
pretty?: boolean
|
|
611
693
|
artifactWriteFailures?: ArtifactWriteFailureMode
|
|
612
694
|
sinks?: OpenApiLintSink[]
|
|
@@ -715,7 +797,7 @@ Example successful response:
|
|
|
715
797
|
|
|
716
798
|
The current output model has two layers:
|
|
717
799
|
|
|
718
|
-
- convenience options such as `jsonReportPath`, `junitReportPath`, `specSnapshotPath`, and `
|
|
800
|
+
- convenience options such as `jsonReportPath`, `junitReportPath`, `specSnapshotPath`, `sarifReportPath`, and `brunoCollectionPath`
|
|
719
801
|
- sink abstractions under `output.sinks`
|
|
720
802
|
|
|
721
803
|
The convenience options compile down to built-in sinks so the current API stays simple while the internal output model becomes extensible.
|
|
@@ -764,4 +846,4 @@ Production-grade linting needs more than a pass/fail boolean. The runtime tracks
|
|
|
764
846
|
|
|
765
847
|
### Project status
|
|
766
848
|
|
|
767
|
-
|
|
849
|
+
The package is actively developed toward a stable `v1`. Milestones 0.2 through 0.6 are complete. Ongoing work is tracked in [roadmap.md](../../roadmap.md).
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { LoadResolvedRulesetOptions, LoadedRuleset, OpenApiLintArtifactWriteError, OpenApiLintThresholdError, ResolvedRulesetCandidate, RulesetLoadError, RulesetResolver, RulesetResolverContext, RulesetResolverInput, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold,
|
|
1
|
+
import { _ as lintOpenApi, a as createOpenApiLintRuntime, c as LoadedRuleset, d as RulesetResolver, f as RulesetResolverContext, g as loadRuleset, h as loadResolvedRuleset, i as OpenApiLintArtifactWriteError, l as ResolvedRulesetCandidate, m as defaultRulesetResolvers, n as enforceThreshold, o as resolveStartupMode, p as RulesetResolverInput, r as shouldFail, s as LoadResolvedRulesetOptions, t as OpenApiLintThresholdError, u as RulesetLoadError } from "../index-B4fxn0G6.mjs";
|
|
2
|
+
export { LoadResolvedRulesetOptions, LoadedRuleset, OpenApiLintArtifactWriteError, OpenApiLintThresholdError, ResolvedRulesetCandidate, RulesetLoadError, RulesetResolver, RulesetResolverContext, RulesetResolverInput, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold, lintOpenApi, loadResolvedRuleset, loadRuleset, resolveStartupMode, shouldFail };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { OpenApiLintArtifactWriteError, OpenApiLintThresholdError, RulesetLoadError, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold,
|
|
1
|
+
import { a as enforceThreshold, d as RulesetLoadError, f as defaultRulesetResolvers, g as lintOpenApi, i as OpenApiLintThresholdError, m as loadRuleset, n as createOpenApiLintRuntime, o as shouldFail, p as loadResolvedRuleset, r as resolveStartupMode, t as OpenApiLintArtifactWriteError } from "../core-DTKNy6TU.mjs";
|
|
2
|
+
export { OpenApiLintArtifactWriteError, OpenApiLintThresholdError, RulesetLoadError, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold, lintOpenApi, loadResolvedRuleset, loadRuleset, resolveStartupMode, shouldFail };
|
|
@@ -7,6 +7,7 @@ import spectralRulesets from "@stoplight/spectral-rulesets";
|
|
|
7
7
|
import YAML from "yaml";
|
|
8
8
|
import signale from "signale";
|
|
9
9
|
import { styleText } from "node:util";
|
|
10
|
+
import { brunoToOpenCollection, openApiToBruno } from "@usebruno/converters";
|
|
10
11
|
//#region src/core/finding-guidance.ts
|
|
11
12
|
const guidanceByCode = {
|
|
12
13
|
"elysia-operation-summary": "Add detail.summary to the Elysia route options so generated docs and clients have a short operation label.",
|
|
@@ -408,7 +409,7 @@ const normalizeExtends = (value) => {
|
|
|
408
409
|
};
|
|
409
410
|
const resolveExtendsEntry = (value) => {
|
|
410
411
|
const resolved = extendsMap[value];
|
|
411
|
-
if (!resolved) throw new RulesetLoadError(`Unsupported ruleset extend target: ${value}.
|
|
412
|
+
if (!resolved) throw new RulesetLoadError(`Unsupported ruleset extend target: "${value}". Supported extend targets: spectral:oas.`);
|
|
412
413
|
return resolved;
|
|
413
414
|
};
|
|
414
415
|
const normalizeRules = (value, availableFunctions) => {
|
|
@@ -669,6 +670,17 @@ const buildSpecReference = (finding, specSnapshotPath) => {
|
|
|
669
670
|
return `${specSnapshotPath}#${finding.documentPointer}`;
|
|
670
671
|
};
|
|
671
672
|
//#endregion
|
|
673
|
+
//#region src/output/bruno-reporter.ts
|
|
674
|
+
const isYamlPath = (filePath) => filePath.endsWith(".yml") || filePath.endsWith(".yaml");
|
|
675
|
+
const writeBrunoCollection = async (outputPath, spec) => {
|
|
676
|
+
const resolvedPath = path.resolve(process.cwd(), outputPath);
|
|
677
|
+
const collection = openApiToBruno(spec);
|
|
678
|
+
const content = isYamlPath(outputPath) ? YAML.stringify(brunoToOpenCollection(collection)) : JSON.stringify(collection, null, 2);
|
|
679
|
+
await mkdir(path.dirname(resolvedPath), { recursive: true });
|
|
680
|
+
await writeFile(resolvedPath, content, "utf8");
|
|
681
|
+
return resolvedPath;
|
|
682
|
+
};
|
|
683
|
+
//#endregion
|
|
672
684
|
//#region src/output/json-reporter.ts
|
|
673
685
|
const DEFAULT_SPEC_SNAPSHOT_FILENAME = "open-api.json";
|
|
674
686
|
const writeJsonArtifact = async (artifactPath, payload, pretty = true) => {
|
|
@@ -867,6 +879,16 @@ const createOutputSinks = (options) => {
|
|
|
867
879
|
return { junitReportPath: writtenJunitReportPath };
|
|
868
880
|
}
|
|
869
881
|
});
|
|
882
|
+
const configuredBrunoCollectionPath = options.output?.brunoCollectionPath;
|
|
883
|
+
if (configuredBrunoCollectionPath) sinks.push({
|
|
884
|
+
name: "Bruno collection",
|
|
885
|
+
kind: "artifact",
|
|
886
|
+
async write(_result, context) {
|
|
887
|
+
const writtenPath = await writeBrunoCollection(configuredBrunoCollectionPath, context.spec);
|
|
888
|
+
reporter.artifact(`OpenAPI lint wrote Bruno collection to ${writtenPath}.`);
|
|
889
|
+
return { brunoCollectionPath: writtenPath };
|
|
890
|
+
}
|
|
891
|
+
});
|
|
870
892
|
if (configuredSarifReportPath) sinks.push({
|
|
871
893
|
name: "SARIF report",
|
|
872
894
|
kind: "artifact",
|
|
@@ -1176,6 +1198,7 @@ const createOpenApiLintRuntime = (options = {}) => {
|
|
|
1176
1198
|
else if (loadedRuleset.source?.path) reporter.ruleset(`OpenAPI lint loaded ruleset ${loadedRuleset.source.path}.`);
|
|
1177
1199
|
const result = await lintOpenApi(spec, loadedRuleset.ruleset);
|
|
1178
1200
|
result.source = source;
|
|
1201
|
+
result.ok = !shouldFail(result, options.failOn ?? "error");
|
|
1179
1202
|
await writeOutputSinks(result, spec, options, artifactWriteFailureMode);
|
|
1180
1203
|
runtime.latest = result;
|
|
1181
1204
|
reporter.complete("OpenAPI lint completed.");
|
|
@@ -1245,13 +1268,10 @@ const mergeArtifacts = (current, next) => ({
|
|
|
1245
1268
|
...current,
|
|
1246
1269
|
...next
|
|
1247
1270
|
});
|
|
1248
|
-
const isEnabled = (options = {}) => {
|
|
1249
|
-
return resolveStartupMode(options) !== "off";
|
|
1250
|
-
};
|
|
1251
1271
|
const resolveStartupMode = (options = {}) => {
|
|
1252
1272
|
if (options.startup?.mode) return options.startup.mode;
|
|
1253
1273
|
if (typeof options.enabled === "function") return options.enabled(process.env) ? "enforce" : "off";
|
|
1254
1274
|
return options.enabled === false ? "off" : "enforce";
|
|
1255
1275
|
};
|
|
1256
1276
|
//#endregion
|
|
1257
|
-
export {
|
|
1277
|
+
export { enforceThreshold as a, strict as c, RulesetLoadError as d, defaultRulesetResolvers as f, lintOpenApi as g, recommended as h, OpenApiLintThresholdError as i, server as l, loadRuleset as m, createOpenApiLintRuntime as n, shouldFail as o, loadResolvedRuleset as p, resolveStartupMode as r, presets as s, OpenApiLintArtifactWriteError as t, resolveReporter as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RulesetDefinition } from "@stoplight/spectral-core";
|
|
2
2
|
import { AnyElysia } from "elysia";
|
|
3
3
|
|
|
4
4
|
//#region src/types.d.ts
|
|
@@ -19,6 +19,7 @@ type OpenApiLintArtifacts = {
|
|
|
19
19
|
junitReportPath?: string;
|
|
20
20
|
sarifReportPath?: string;
|
|
21
21
|
specSnapshotPath?: string;
|
|
22
|
+
brunoCollectionPath?: string;
|
|
22
23
|
};
|
|
23
24
|
type OpenApiLintSinkContext = {
|
|
24
25
|
spec: Record<string, unknown>;
|
|
@@ -41,6 +42,7 @@ type SpectralPluginOptions = {
|
|
|
41
42
|
junitReportPath?: string;
|
|
42
43
|
sarifReportPath?: string;
|
|
43
44
|
specSnapshotPath?: string | true;
|
|
45
|
+
brunoCollectionPath?: string;
|
|
44
46
|
pretty?: boolean;
|
|
45
47
|
artifactWriteFailures?: ArtifactWriteFailureMode;
|
|
46
48
|
sinks?: OpenApiLintSink[];
|
|
@@ -93,9 +95,6 @@ type LintRunResult = {
|
|
|
93
95
|
artifacts?: OpenApiLintArtifacts;
|
|
94
96
|
findings: LintFinding[];
|
|
95
97
|
};
|
|
96
|
-
interface SpecProvider {
|
|
97
|
-
getSpec(): Promise<unknown>;
|
|
98
|
-
}
|
|
99
98
|
type OpenApiLintRuntimeFailure = {
|
|
100
99
|
name: string;
|
|
101
100
|
message: string;
|
|
@@ -151,9 +150,6 @@ declare const loadRuleset: (input?: RulesetResolverInput, baseDirOrOptions?: str
|
|
|
151
150
|
declare const loadResolvedRuleset: (input?: RulesetResolverInput, baseDirOrOptions?: string | LoadResolvedRulesetOptions) => Promise<LoadedRuleset>;
|
|
152
151
|
declare const defaultRulesetResolvers: RulesetResolver[];
|
|
153
152
|
//#endregion
|
|
154
|
-
//#region src/core/normalize-findings.d.ts
|
|
155
|
-
declare const normalizeFindings: (diagnostics: ISpectralDiagnostic[], spec: unknown) => LintRunResult;
|
|
156
|
-
//#endregion
|
|
157
153
|
//#region src/core/runtime.d.ts
|
|
158
154
|
declare const createOpenApiLintRuntime: (options?: SpectralPluginOptions) => OpenApiLintRuntime;
|
|
159
155
|
declare class OpenApiLintArtifactWriteError extends Error {
|
|
@@ -161,7 +157,6 @@ declare class OpenApiLintArtifactWriteError extends Error {
|
|
|
161
157
|
readonly cause: unknown;
|
|
162
158
|
constructor(artifact: string, cause: unknown);
|
|
163
159
|
}
|
|
164
|
-
declare const isEnabled: (options?: SpectralPluginOptions) => boolean;
|
|
165
160
|
declare const resolveStartupMode: (options?: SpectralPluginOptions) => StartupLintMode;
|
|
166
161
|
//#endregion
|
|
167
162
|
//#region src/core/thresholds.d.ts
|
|
@@ -170,8 +165,7 @@ declare class OpenApiLintThresholdError extends Error {
|
|
|
170
165
|
readonly result: LintRunResult;
|
|
171
166
|
constructor(threshold: SeverityThreshold, result: LintRunResult);
|
|
172
167
|
}
|
|
173
|
-
declare const exceedsThreshold: (severity: LintSeverity, threshold: SeverityThreshold) => boolean;
|
|
174
168
|
declare const shouldFail: (result: LintRunResult, threshold: SeverityThreshold) => boolean;
|
|
175
169
|
declare const enforceThreshold: (result: LintRunResult, threshold: SeverityThreshold) => void;
|
|
176
170
|
//#endregion
|
|
177
|
-
export {
|
|
171
|
+
export { SeverityThreshold as A, OpenApiLintArtifacts as C, OpenApiLintSink as D, OpenApiLintRuntimeStatus as E, SpectralPluginOptions as M, StartupLintMode as N, OpenApiLintSinkContext as O, LintSeverity as S, OpenApiLintRuntimeFailure as T, lintOpenApi as _, createOpenApiLintRuntime as a, LintRunResult as b, LoadedRuleset as c, RulesetResolver as d, RulesetResolverContext as f, loadRuleset as g, loadResolvedRuleset as h, OpenApiLintArtifactWriteError as i, SpectralLogger as j, PresetName as k, ResolvedRulesetCandidate as l, defaultRulesetResolvers as m, enforceThreshold as n, resolveStartupMode as o, RulesetResolverInput as p, shouldFail as r, LoadResolvedRulesetOptions as s, OpenApiLintThresholdError as t, RulesetLoadError as u, ArtifactWriteFailureMode as v, OpenApiLintRuntime as w, LintRunSource as x, LintFinding as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as SeverityThreshold, C as OpenApiLintArtifacts, D as OpenApiLintSink, E as OpenApiLintRuntimeStatus, M as SpectralPluginOptions, N as StartupLintMode, O as OpenApiLintSinkContext, S as LintSeverity, T as OpenApiLintRuntimeFailure, _ as lintOpenApi, a as createOpenApiLintRuntime, b as LintRunResult, c as LoadedRuleset, d as RulesetResolver, f as RulesetResolverContext, g as loadRuleset, h as loadResolvedRuleset, i as OpenApiLintArtifactWriteError, j as SpectralLogger, k as PresetName, l as ResolvedRulesetCandidate, m as defaultRulesetResolvers, n as enforceThreshold, o as resolveStartupMode, p as RulesetResolverInput, r as shouldFail, s as LoadResolvedRulesetOptions, t as OpenApiLintThresholdError, u as RulesetLoadError, v as ArtifactWriteFailureMode, w as OpenApiLintRuntime, x as LintRunSource, y as LintFinding } from "./index-B4fxn0G6.mjs";
|
|
2
2
|
import { RulesetDefinition } from "@stoplight/spectral-core";
|
|
3
3
|
import { Elysia } from "elysia";
|
|
4
4
|
|
|
@@ -72,4 +72,4 @@ declare const strict: RulesetDefinition;
|
|
|
72
72
|
//#region src/presets/index.d.ts
|
|
73
73
|
declare const presets: Record<PresetName, RulesetDefinition>;
|
|
74
74
|
//#endregion
|
|
75
|
-
export { ArtifactWriteFailureMode, LintFinding, LintRunResult, LintRunSource, LintSeverity, LoadResolvedRulesetOptions, LoadedRuleset, OpenApiLintArtifactWriteError, OpenApiLintArtifacts, OpenApiLintRuntime, OpenApiLintRuntimeFailure, OpenApiLintRuntimeStatus, OpenApiLintSink, OpenApiLintSinkContext, OpenApiLintThresholdError, PresetName, ResolvedRulesetCandidate, RulesetLoadError, RulesetResolver, RulesetResolverContext, RulesetResolverInput, SeverityThreshold,
|
|
75
|
+
export { ArtifactWriteFailureMode, LintFinding, LintRunResult, LintRunSource, LintSeverity, LoadResolvedRulesetOptions, LoadedRuleset, OpenApiLintArtifactWriteError, OpenApiLintArtifacts, OpenApiLintRuntime, OpenApiLintRuntimeFailure, OpenApiLintRuntimeStatus, OpenApiLintSink, OpenApiLintSinkContext, OpenApiLintThresholdError, PresetName, ResolvedRulesetCandidate, RulesetLoadError, RulesetResolver, RulesetResolverContext, RulesetResolverInput, SeverityThreshold, SpectralLogger, SpectralPluginOptions, StartupLintMode, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold, lintOpenApi, loadResolvedRuleset, loadRuleset, presets, recommended, resolveStartupMode, server, shouldFail, spectralPlugin, strict };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as enforceThreshold, c as strict, d as RulesetLoadError, f as defaultRulesetResolvers, g as lintOpenApi, h as recommended, i as OpenApiLintThresholdError, l as server, m as loadRuleset, n as createOpenApiLintRuntime, o as shouldFail, p as loadResolvedRuleset, r as resolveStartupMode, s as presets, t as OpenApiLintArtifactWriteError, u as resolveReporter } from "./core-DTKNy6TU.mjs";
|
|
2
2
|
import { Elysia } from "elysia";
|
|
3
3
|
//#region src/plugin.ts
|
|
4
4
|
const spectralPlugin = (options = {}) => {
|
|
@@ -82,4 +82,4 @@ const spectralPlugin = (options = {}) => {
|
|
|
82
82
|
return plugin;
|
|
83
83
|
};
|
|
84
84
|
//#endregion
|
|
85
|
-
export { OpenApiLintArtifactWriteError, OpenApiLintThresholdError, RulesetLoadError, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold,
|
|
85
|
+
export { OpenApiLintArtifactWriteError, OpenApiLintThresholdError, RulesetLoadError, createOpenApiLintRuntime, defaultRulesetResolvers, enforceThreshold, lintOpenApi, loadResolvedRuleset, loadRuleset, presets, recommended, resolveStartupMode, server, shouldFail, spectralPlugin, strict };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opsydyn/elysia-spectral",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Thin Elysia plugin that lints generated OpenAPI documents with Spectral.",
|
|
5
|
-
"packageManager": "bun@1.
|
|
5
|
+
"packageManager": "bun@1.3.11",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -71,6 +71,8 @@
|
|
|
71
71
|
"@stoplight/spectral-functions": "^1.10.2",
|
|
72
72
|
"@stoplight/spectral-parsers": "^1.0.4",
|
|
73
73
|
"@stoplight/spectral-rulesets": "^1.22.1",
|
|
74
|
+
"@usebruno/converters": "^0.18.1",
|
|
75
|
+
"@usebruno/lang": "^0.35.0",
|
|
74
76
|
"signale": "^1.4.0",
|
|
75
77
|
"yaml": "^2.8.1"
|
|
76
78
|
},
|