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.
Files changed (41) hide show
  1. package/dist/__tests__/unit/dev-workspace-symlinks.test.d.ts +2 -0
  2. package/dist/__tests__/unit/dev-workspace-symlinks.test.d.ts.map +1 -0
  3. package/dist/__tests__/unit/dev-workspace-symlinks.test.js +112 -0
  4. package/dist/__tests__/unit/dev-workspace-symlinks.test.js.map +1 -0
  5. package/dist/__tests__/unit/language-filter.test.d.ts +2 -0
  6. package/dist/__tests__/unit/language-filter.test.d.ts.map +1 -0
  7. package/dist/__tests__/unit/language-filter.test.js +166 -0
  8. package/dist/__tests__/unit/language-filter.test.js.map +1 -0
  9. package/dist/__tests__/unit/openapi-license-identifier.test.js +14 -4
  10. package/dist/__tests__/unit/openapi-license-identifier.test.js.map +1 -1
  11. package/dist/__tests__/unit/openapi-schema-patch-sync.test.js +24 -7
  12. package/dist/__tests__/unit/openapi-schema-patch-sync.test.js.map +1 -1
  13. package/dist/__tests__/unit/openapi-schema-runtime-patch.test.d.ts +2 -0
  14. package/dist/__tests__/unit/openapi-schema-runtime-patch.test.d.ts.map +1 -0
  15. package/dist/__tests__/unit/openapi-schema-runtime-patch.test.js +120 -0
  16. package/dist/__tests__/unit/openapi-schema-runtime-patch.test.js.map +1 -0
  17. package/dist/__tests__/unit/openapi-server-variable-description.test.js +14 -5
  18. package/dist/__tests__/unit/openapi-server-variable-description.test.js.map +1 -1
  19. package/dist/lib/deps.d.ts +10 -6
  20. package/dist/lib/deps.d.ts.map +1 -1
  21. package/dist/lib/deps.js +20 -8
  22. package/dist/lib/deps.js.map +1 -1
  23. package/dist/lib/language-filter.d.ts +31 -0
  24. package/dist/lib/language-filter.d.ts.map +1 -0
  25. package/dist/lib/language-filter.js +14 -0
  26. package/dist/lib/language-filter.js.map +1 -0
  27. package/dist/lib/openapi/patch-openapi-schemas-runtime.d.ts +24 -0
  28. package/dist/lib/openapi/patch-openapi-schemas-runtime.d.ts.map +1 -0
  29. package/dist/lib/openapi/patch-openapi-schemas-runtime.js +75 -0
  30. package/dist/lib/openapi/patch-openapi-schemas-runtime.js.map +1 -0
  31. package/dist/lib/openapi/validator.d.ts.map +1 -1
  32. package/dist/lib/openapi/validator.js +23 -0
  33. package/dist/lib/openapi/validator.js.map +1 -1
  34. package/package.json +3 -2
  35. package/scripts/patch-openapi-schemas.js +8 -3
  36. package/vendored/lib/build/error-parser.ts +73 -0
  37. package/vendored/lib/interrupt-auto-retry.ts +50 -0
  38. package/vendored/lib/openapi/patch-openapi-schemas-runtime.ts +83 -0
  39. package/vendored/lib/openapi/validator.ts +28 -0
  40. package/vendored/next.config.js +13 -1
  41. 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;
@@ -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: ['@apidevtools/swagger-parser', '@terrastruct/d2'],
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/swagger-parser": "^12.1.0",
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",