jamdesk 1.1.165 → 1.1.167
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/dist/__tests__/unit/dev-workspace-symlinks.test.d.ts +2 -0
- package/dist/__tests__/unit/dev-workspace-symlinks.test.d.ts.map +1 -0
- package/dist/__tests__/unit/dev-workspace-symlinks.test.js +112 -0
- package/dist/__tests__/unit/dev-workspace-symlinks.test.js.map +1 -0
- package/dist/__tests__/unit/language-filter.test.d.ts +2 -0
- package/dist/__tests__/unit/language-filter.test.d.ts.map +1 -0
- package/dist/__tests__/unit/language-filter.test.js +166 -0
- package/dist/__tests__/unit/language-filter.test.js.map +1 -0
- package/dist/__tests__/unit/openapi-license-identifier.test.js +14 -4
- package/dist/__tests__/unit/openapi-license-identifier.test.js.map +1 -1
- package/dist/__tests__/unit/openapi-schema-patch-sync.test.js +24 -7
- package/dist/__tests__/unit/openapi-schema-patch-sync.test.js.map +1 -1
- package/dist/__tests__/unit/openapi-schema-runtime-patch.test.d.ts +2 -0
- package/dist/__tests__/unit/openapi-schema-runtime-patch.test.d.ts.map +1 -0
- package/dist/__tests__/unit/openapi-schema-runtime-patch.test.js +120 -0
- package/dist/__tests__/unit/openapi-schema-runtime-patch.test.js.map +1 -0
- package/dist/__tests__/unit/openapi-server-variable-description.test.js +14 -5
- package/dist/__tests__/unit/openapi-server-variable-description.test.js.map +1 -1
- package/dist/lib/deps.d.ts +10 -6
- package/dist/lib/deps.d.ts.map +1 -1
- package/dist/lib/deps.js +20 -8
- package/dist/lib/deps.js.map +1 -1
- package/dist/lib/language-filter.d.ts +31 -0
- package/dist/lib/language-filter.d.ts.map +1 -0
- package/dist/lib/language-filter.js +14 -0
- package/dist/lib/language-filter.js.map +1 -0
- package/dist/lib/openapi/patch-openapi-schemas-runtime.d.ts +24 -0
- package/dist/lib/openapi/patch-openapi-schemas-runtime.d.ts.map +1 -0
- package/dist/lib/openapi/patch-openapi-schemas-runtime.js +75 -0
- package/dist/lib/openapi/patch-openapi-schemas-runtime.js.map +1 -0
- package/dist/lib/openapi/validator.d.ts.map +1 -1
- package/dist/lib/openapi/validator.js +23 -0
- package/dist/lib/openapi/validator.js.map +1 -1
- package/package.json +3 -2
- package/scripts/patch-openapi-schemas.js +8 -3
- package/vendored/lib/build/error-parser.ts +73 -0
- package/vendored/lib/interrupt-auto-retry.ts +50 -0
- package/vendored/lib/openapi/patch-openapi-schemas-runtime.ts +83 -0
- package/vendored/lib/openapi/validator.ts +28 -0
- package/vendored/next.config.js +13 -1
- package/vendored/workspace-package-lock.json +2 -1
|
@@ -11,6 +11,25 @@ import path from 'path';
|
|
|
11
11
|
import type { OpenAPI } from 'openapi-types';
|
|
12
12
|
import type { ValidationResult, OpenApiValidationError } from './types';
|
|
13
13
|
import { formatOpenApiError, createFileNotFoundError } from './errors';
|
|
14
|
+
import { patchOpenApiSchemasInMemory } from './patch-openapi-schemas-runtime';
|
|
15
|
+
import { logger } from '../../shared/logger';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The self-heal tripwire warn is per-process, not per-spec: validateOpenApiSpecs()
|
|
19
|
+
* loops over every spec in docs.json, and a schema that can't be verified once
|
|
20
|
+
* can't be verified for any of them — without this flag a project with N specs
|
|
21
|
+
* logs the identical warning N times.
|
|
22
|
+
*/
|
|
23
|
+
let selfHealWarned = false;
|
|
24
|
+
|
|
25
|
+
function warnSelfHealOnce(): void {
|
|
26
|
+
if (selfHealWarned) return;
|
|
27
|
+
selfHealWarned = true;
|
|
28
|
+
logger.warn(
|
|
29
|
+
'[jamdesk] OpenAPI 3.1 meta-schema self-heal could not verify the expected schema shape; ' +
|
|
30
|
+
'validation may falsely reject server-variable descriptions or name-only licenses.'
|
|
31
|
+
);
|
|
32
|
+
}
|
|
14
33
|
|
|
15
34
|
/**
|
|
16
35
|
* Detect OpenAPI version from a parsed spec
|
|
@@ -82,6 +101,15 @@ export async function validateOpenApiSpec(
|
|
|
82
101
|
specPath: string,
|
|
83
102
|
projectDir: string
|
|
84
103
|
): Promise<ValidationResult> {
|
|
104
|
+
// Self-heal the 3.1 meta-schema before every validation: postinstall may
|
|
105
|
+
// never have run (npm 12 blocks install scripts by default). Idempotent,
|
|
106
|
+
// O(1) after the first call. A false return = heal couldn't verify the
|
|
107
|
+
// schema shape — warn (once per process) so users don't hit the original
|
|
108
|
+
// opaque error blind.
|
|
109
|
+
if (!patchOpenApiSchemasInMemory()) {
|
|
110
|
+
warnSelfHealOnce();
|
|
111
|
+
}
|
|
112
|
+
|
|
85
113
|
const isUrl = specPath.startsWith('http://') || specPath.startsWith('https://');
|
|
86
114
|
|
|
87
115
|
let target: string;
|
package/vendored/next.config.js
CHANGED
|
@@ -47,10 +47,22 @@ const nextConfig = {
|
|
|
47
47
|
],
|
|
48
48
|
},
|
|
49
49
|
// Keep swagger-parser external (uses Node.js APIs).
|
|
50
|
+
// @apidevtools/openapi-schemas MUST stay external alongside it — the pairing
|
|
51
|
+
// is load-bearing, not cosmetic. patchOpenApiSchemasInMemory() heals the
|
|
52
|
+
// openapi-schemas module singleton that swagger-parser reads at validate()
|
|
53
|
+
// time; if one package is external and the other is bundled, Next produces
|
|
54
|
+
// TWO module instances and the self-heal patches a bundled duplicate,
|
|
55
|
+
// verifies THAT copy, and returns true while swagger-parser keeps reading
|
|
56
|
+
// the untouched node_modules copy — a silent no-op that reports success.
|
|
57
|
+
// Pinned by build-service/__tests__/next-config-external-packages.test.ts.
|
|
50
58
|
// @terrastruct/d2 ships a WASM binary; keep it external so it loads from
|
|
51
59
|
// node_modules at runtime instead of being bundled by Turbopack — the
|
|
52
60
|
// same mitigation pattern used for the Shiki/oniguruma WASM landmine.
|
|
53
|
-
serverExternalPackages: [
|
|
61
|
+
serverExternalPackages: [
|
|
62
|
+
'@apidevtools/swagger-parser',
|
|
63
|
+
'@apidevtools/openapi-schemas',
|
|
64
|
+
'@terrastruct/d2',
|
|
65
|
+
],
|
|
54
66
|
// Turbopack config - only resolveAlias, NOT root (root causes caching issues)
|
|
55
67
|
turbopack: {
|
|
56
68
|
resolveAlias: {
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"": {
|
|
7
7
|
"name": "jamdesk-workspace",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@apidevtools/
|
|
9
|
+
"@apidevtools/openapi-schemas": "2.1.0",
|
|
10
|
+
"@apidevtools/swagger-parser": "12.1.0",
|
|
10
11
|
"@babel/standalone": "^8.0.4",
|
|
11
12
|
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
12
13
|
"@fortawesome/free-brands-svg-icons": "^7.1.0",
|