@elysiajs/openapi 1.3.10 → 1.3.11

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.
@@ -44,7 +44,7 @@ var fromTypes = (targetFilePath, {
44
44
  throw new Error("Only .ts files are supported");
45
45
  if (targetFilePath.startsWith("./"))
46
46
  targetFilePath = targetFilePath.slice(2);
47
- const src = targetFilePath.startsWith("/") ? targetFilePath : (0, import_path.join)(projectRoot, targetFilePath);
47
+ let src = targetFilePath.startsWith("/") ? targetFilePath : (0, import_path.join)(projectRoot, targetFilePath);
48
48
  if (!(0, import_fs.existsSync)(src))
49
49
  throw new Error(
50
50
  `Couldn't find "${targetFilePath}" from ${projectRoot}`
@@ -56,7 +56,11 @@ var fromTypes = (targetFilePath, {
56
56
  (0, import_fs.rmSync)(tmpRoot, { recursive: true, force: true });
57
57
  (0, import_fs.mkdirSync)(tmpRoot, { recursive: true });
58
58
  const tsconfig = tsconfigPath.startsWith("/") ? tsconfigPath : (0, import_path.join)(projectRoot, tsconfigPath);
59
- const extendsRef = (0, import_fs.existsSync)(tsconfig) ? `"extends": "${(0, import_path.join)(projectRoot, "tsconfig.json")}",` : "";
59
+ let extendsRef = (0, import_fs.existsSync)(tsconfig) ? `"extends": "${(0, import_path.join)(projectRoot, "tsconfig.json")}",` : "";
60
+ if (typeof process !== "undefined" && process.platform === "win32") {
61
+ extendsRef = extendsRef.replace(/\\/g, "/");
62
+ src = src.replace(/\\/g, "/");
63
+ }
60
64
  (0, import_fs.writeFileSync)(
61
65
  (0, import_path.join)(tmpRoot, "tsconfig.json"),
62
66
  `{
@@ -27,7 +27,7 @@ var fromTypes = (targetFilePath, {
27
27
  throw new Error("Only .ts files are supported");
28
28
  if (targetFilePath.startsWith("./"))
29
29
  targetFilePath = targetFilePath.slice(2);
30
- const src = targetFilePath.startsWith("/") ? targetFilePath : join(projectRoot, targetFilePath);
30
+ let src = targetFilePath.startsWith("/") ? targetFilePath : join(projectRoot, targetFilePath);
31
31
  if (!existsSync(src))
32
32
  throw new Error(
33
33
  `Couldn't find "${targetFilePath}" from ${projectRoot}`
@@ -39,7 +39,11 @@ var fromTypes = (targetFilePath, {
39
39
  rmSync(tmpRoot, { recursive: true, force: true });
40
40
  mkdirSync(tmpRoot, { recursive: true });
41
41
  const tsconfig = tsconfigPath.startsWith("/") ? tsconfigPath : join(projectRoot, tsconfigPath);
42
- const extendsRef = existsSync(tsconfig) ? `"extends": "${join(projectRoot, "tsconfig.json")}",` : "";
42
+ let extendsRef = existsSync(tsconfig) ? `"extends": "${join(projectRoot, "tsconfig.json")}",` : "";
43
+ if (typeof process !== "undefined" && process.platform === "win32") {
44
+ extendsRef = extendsRef.replace(/\\/g, "/");
45
+ src = src.replace(/\\/g, "/");
46
+ }
43
47
  writeFileSync(
44
48
  join(tmpRoot, "tsconfig.json"),
45
49
  `{
package/package.json CHANGED
@@ -1,92 +1,92 @@
1
- {
2
- "name": "@elysiajs/openapi",
3
- "version": "1.3.10",
4
- "description": "Plugin for Elysia to auto-generate API documentation",
5
- "author": {
6
- "name": "saltyAom",
7
- "url": "https://github.com/SaltyAom",
8
- "email": "saltyaom@gmail.com"
9
- },
10
- "main": "./dist/cjs/index.js",
11
- "module": "./dist/index.mjs",
12
- "types": "./dist/index.d.ts",
13
- "exports": {
14
- "./package.json": "./package.json",
15
- ".": {
16
- "types": "./dist/index.d.ts",
17
- "import": "./dist/index.mjs",
18
- "require": "./dist/cjs/index.js"
19
- },
20
- "./gen": {
21
- "types": "./dist/gen/index.d.ts",
22
- "import": "./dist/gen/index.mjs",
23
- "require": "./dist/cjs/gen/index.js"
24
- },
25
- "./openapi": {
26
- "types": "./dist/openapi.d.ts",
27
- "import": "./dist/openapi.mjs",
28
- "require": "./dist/cjs/openapi.js"
29
- },
30
- "./scalar": {
31
- "types": "./dist/scalar/index.d.ts",
32
- "import": "./dist/scalar/index.mjs",
33
- "require": "./dist/cjs/scalar/index.js"
34
- },
35
- "./scalar/theme": {
36
- "types": "./dist/scalar/theme.d.ts",
37
- "import": "./dist/scalar/theme.mjs",
38
- "require": "./dist/cjs/scalar/theme.js"
39
- },
40
- "./swagger": {
41
- "types": "./dist/swagger/index.d.ts",
42
- "import": "./dist/swagger/index.mjs",
43
- "require": "./dist/cjs/swagger/index.js"
44
- },
45
- "./swagger/types": {
46
- "types": "./dist/swagger/types.d.ts",
47
- "import": "./dist/swagger/types.mjs",
48
- "require": "./dist/cjs/swagger/types.js"
49
- },
50
- "./types": {
51
- "types": "./dist/types.d.ts",
52
- "import": "./dist/types.mjs",
53
- "require": "./dist/cjs/types.js"
54
- }
55
- },
56
- "keywords": [
57
- "elysia",
58
- "openapi",
59
- "swagger",
60
- "scalar"
61
- ],
62
- "homepage": "https://github.com/elysiajs/elysia-openapi",
63
- "repository": {
64
- "type": "git",
65
- "url": "https://github.com/elysiajs/elysia-openapi"
66
- },
67
- "bugs": "https://github.com/elysiajs/elysia-openapi/issues",
68
- "license": "MIT",
69
- "scripts": {
70
- "dev": "bun run --watch example/index.ts",
71
- "test": "bun test && npm run test:node",
72
- "test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
73
- "build": "bun build.ts",
74
- "release": "npm run build && npm run test && npm publish --access public"
75
- },
76
- "peerDependencies": {
77
- "elysia": ">= 1.3.0"
78
- },
79
- "devDependencies": {
80
- "@apidevtools/swagger-parser": "^12.0.0",
81
- "@types/bun": "1.2.20",
82
- "@scalar/types": "^0.2.13",
83
- "elysia": "1.3.21",
84
- "eslint": "9.6.0",
85
- "tsup": "^8.5.0",
86
- "typescript": "^5.9.2"
87
- },
88
- "dependencies": {
89
- "@sinclair/typemap": "^0.10.1",
90
- "openapi-types": "^12.1.3"
91
- }
92
- }
1
+ {
2
+ "name": "@elysiajs/openapi",
3
+ "version": "1.3.11",
4
+ "description": "Plugin for Elysia to auto-generate API documentation",
5
+ "author": {
6
+ "name": "saltyAom",
7
+ "url": "https://github.com/SaltyAom",
8
+ "email": "saltyaom@gmail.com"
9
+ },
10
+ "main": "./dist/cjs/index.js",
11
+ "module": "./dist/index.mjs",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ "./package.json": "./package.json",
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.mjs",
18
+ "require": "./dist/cjs/index.js"
19
+ },
20
+ "./gen": {
21
+ "types": "./dist/gen/index.d.ts",
22
+ "import": "./dist/gen/index.mjs",
23
+ "require": "./dist/cjs/gen/index.js"
24
+ },
25
+ "./openapi": {
26
+ "types": "./dist/openapi.d.ts",
27
+ "import": "./dist/openapi.mjs",
28
+ "require": "./dist/cjs/openapi.js"
29
+ },
30
+ "./scalar": {
31
+ "types": "./dist/scalar/index.d.ts",
32
+ "import": "./dist/scalar/index.mjs",
33
+ "require": "./dist/cjs/scalar/index.js"
34
+ },
35
+ "./scalar/theme": {
36
+ "types": "./dist/scalar/theme.d.ts",
37
+ "import": "./dist/scalar/theme.mjs",
38
+ "require": "./dist/cjs/scalar/theme.js"
39
+ },
40
+ "./swagger": {
41
+ "types": "./dist/swagger/index.d.ts",
42
+ "import": "./dist/swagger/index.mjs",
43
+ "require": "./dist/cjs/swagger/index.js"
44
+ },
45
+ "./swagger/types": {
46
+ "types": "./dist/swagger/types.d.ts",
47
+ "import": "./dist/swagger/types.mjs",
48
+ "require": "./dist/cjs/swagger/types.js"
49
+ },
50
+ "./types": {
51
+ "types": "./dist/types.d.ts",
52
+ "import": "./dist/types.mjs",
53
+ "require": "./dist/cjs/types.js"
54
+ }
55
+ },
56
+ "keywords": [
57
+ "elysia",
58
+ "openapi",
59
+ "swagger",
60
+ "scalar"
61
+ ],
62
+ "homepage": "https://github.com/elysiajs/elysia-openapi",
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "https://github.com/elysiajs/elysia-openapi"
66
+ },
67
+ "bugs": "https://github.com/elysiajs/elysia-openapi/issues",
68
+ "license": "MIT",
69
+ "scripts": {
70
+ "dev": "bun run --watch example/index.ts",
71
+ "test": "bun test && npm run test:node",
72
+ "test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
73
+ "build": "bun build.ts",
74
+ "release": "npm run build && npm run test && npm publish --access public"
75
+ },
76
+ "peerDependencies": {
77
+ "elysia": ">= 1.3.0"
78
+ },
79
+ "devDependencies": {
80
+ "@apidevtools/swagger-parser": "^12.0.0",
81
+ "@types/bun": "1.2.20",
82
+ "@scalar/types": "^0.2.13",
83
+ "elysia": "1.3.21",
84
+ "eslint": "9.6.0",
85
+ "tsup": "^8.5.0",
86
+ "typescript": "^5.9.2"
87
+ },
88
+ "dependencies": {
89
+ "@sinclair/typemap": "^0.10.1",
90
+ "openapi-types": "^12.1.3"
91
+ }
92
+ }