@scalar/nextjs-openapi 0.0.35 → 0.0.36
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 +11 -0
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +6 -8
- package/dist/path.d.ts.map +1 -1
- package/dist/path.js +2 -4
- package/package.json +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @scalar/nextjs-openapi
|
|
2
2
|
|
|
3
|
+
## 0.0.36
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fa6afe8: chore: code formatting
|
|
8
|
+
- Updated dependencies [54fdfcb]
|
|
9
|
+
- Updated dependencies [fa6afe8]
|
|
10
|
+
- @scalar/ts-to-openapi@0.0.5
|
|
11
|
+
- @scalar/types@0.0.33
|
|
12
|
+
- @scalar/nextjs-api-reference@0.5.9
|
|
13
|
+
|
|
3
14
|
## 0.0.35
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/openapi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAa9C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAa9C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,sBAAsB,CAAA;AA+B1B;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,YAAY,aAAa;eAmCxB,WAAW;CAiB/B,CAAA"}
|
package/dist/openapi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiReference } from '@scalar/nextjs-api-reference';
|
|
2
2
|
import { sync } from 'fast-glob';
|
|
3
|
-
import { readFileSync } from 'fs';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
4
|
import { createSourceFile, ScriptTarget, ScriptKind, JSDocParsingMode, createProgram } from 'typescript';
|
|
5
5
|
import { getPathSchema } from './path.js';
|
|
6
6
|
|
|
@@ -72,13 +72,11 @@ const OpenAPI = (config = {}) => {
|
|
|
72
72
|
return Response.json(spec);
|
|
73
73
|
}
|
|
74
74
|
// References
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})();
|
|
81
|
-
}
|
|
75
|
+
return await ApiReference({
|
|
76
|
+
spec: {
|
|
77
|
+
url: req.nextUrl.pathname + '/schema.json',
|
|
78
|
+
},
|
|
79
|
+
})();
|
|
82
80
|
},
|
|
83
81
|
};
|
|
84
82
|
};
|
package/dist/path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,UAAU,EAOhB,MAAM,YAAY,CAAA;AAiDnB;;GAEG;AACH,eAAO,MAAM,aAAa,eAAgB,UAAU,WAAW,OAAO,oCAsCrE,CAAA"}
|
package/dist/path.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { getJSDocFromNode, generateResponses, getSchemaFromTypeNode } from '@scalar/ts-to-openapi';
|
|
2
|
-
import { extname, join } from 'path';
|
|
2
|
+
import { extname, join } from 'node:path';
|
|
3
3
|
import { isFunctionDeclaration, isVariableStatement, isParameter, isTypeLiteralNode, isPropertySignature, isIdentifier } from 'typescript';
|
|
4
4
|
|
|
5
5
|
/** Check if identifier is a supported http method */
|
|
6
6
|
const checkForMethod = (identifier) => {
|
|
7
7
|
const method = identifier?.escapedText?.toLowerCase();
|
|
8
|
-
return method?.match(/^(get|post|put|patch|delete|head|options)$/)
|
|
9
|
-
? method
|
|
10
|
-
: null;
|
|
8
|
+
return method?.match(/^(get|post|put|patch|delete|head|options)$/) ? method : null;
|
|
11
9
|
};
|
|
12
10
|
const fileNameResolver = (source, target) => {
|
|
13
11
|
const sourceExt = extname(source);
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scalar",
|
|
17
17
|
"references"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.0.
|
|
19
|
+
"version": "0.0.36",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"fast-glob": "^3.3.2",
|
|
37
|
-
"@scalar/
|
|
38
|
-
"@scalar/ts-to-openapi": "0.0.
|
|
39
|
-
"@scalar/
|
|
37
|
+
"@scalar/types": "0.0.33",
|
|
38
|
+
"@scalar/ts-to-openapi": "0.0.5",
|
|
39
|
+
"@scalar/nextjs-api-reference": "0.5.9"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^20.17.10",
|
|
@@ -44,13 +44,15 @@
|
|
|
44
44
|
"@types/react-dom": "^19.0.2",
|
|
45
45
|
"next": "^15.1.1",
|
|
46
46
|
"openapi-types": "^12.1.3",
|
|
47
|
-
"@scalar/build-tooling": "0.1.
|
|
47
|
+
"@scalar/build-tooling": "0.1.13"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "scalar-build-rollup",
|
|
51
51
|
"dev": "next dev playground -p 5066",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"format": "scalar-format",
|
|
53
|
+
"format:check": "scalar-format-check",
|
|
54
|
+
"lint:check": "scalar-lint-check",
|
|
55
|
+
"lint:fix": "scalar-lint-fix",
|
|
54
56
|
"types:build": "scalar-types-build",
|
|
55
57
|
"types:check": "scalar-types-check"
|
|
56
58
|
}
|