Skip to content

Commit 4bed708

Browse files
authored
fix: restore ESM, upgrade packages (#51)
1 parent 8449ab0 commit 4bed708

File tree

7 files changed

+1294
-658
lines changed

7 files changed

+1294
-658
lines changed

Diff for: .yarn/install-state.gz

60.3 KB
Binary file not shown.

Diff for: package.json

+29-17
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,27 @@
22
"name": "@openapi-contrib/json-schema-to-openapi-schema",
33
"version": "0.0.0-development",
44
"description": "Converts a JSON Schema to OpenAPI Schema Object",
5-
"bin": "bin/json-schema-to-openapi-schema.js",
6-
"types": "dist/index.d.ts",
75
"files": [
86
"bin",
9-
"dist"
7+
"dist",
8+
"CHANGELOG.md",
9+
"LICENSE",
10+
"package.json"
1011
],
12+
"exports": {
13+
".": {
14+
"types": "./dist/index.d.ts",
15+
"require": "./dist/index.js",
16+
"import": "./dist/index.mjs"
17+
}
18+
},
19+
"bin": "bin/json-schema-to-openapi-schema.js",
20+
"types": "dist/index.d.ts",
1121
"main": "dist/index.js",
22+
"module": "dist/index.mjs",
1223
"scripts": {
1324
"prepublish": "yarn build",
14-
"build": "rimraf dist && tsc -p tsconfig.json",
25+
"build": "rimraf dist && tsup src/index.ts --format esm,cjs --dts --clean",
1526
"lint": "eslint . && prettier -c src",
1627
"lint:fix": "eslint . --fix && prettier -c src -w",
1728
"typecheck": "tsc --noEmit",
@@ -25,29 +36,30 @@
2536
"node": ">=18"
2637
},
2738
"dependencies": {
28-
"@apidevtools/json-schema-ref-parser": "^11.6.2",
39+
"@apidevtools/json-schema-ref-parser": "^11.7.2",
2940
"json-schema-walker": "^2.0.0",
3041
"openapi-types": "^12.1.3",
3142
"yargs": "^17.7.2"
3243
},
3344
"devDependencies": {
34-
"@eslint/compat": "^1.0.3",
45+
"@eslint/compat": "^1.2.3",
3546
"@types/json-schema": "^7.0.15",
36-
"c8": "^9.1.0",
37-
"eslint": "^9.4.0",
47+
"c8": "^10.1.2",
48+
"eslint": "^9.15.0",
3849
"eslint-config-prettier": "^9.1.0",
39-
"eslint-plugin-prettier": "^5.1.3",
40-
"eslint-plugin-unused-imports": "^4.0.0",
41-
"nock": "^13.5.4",
42-
"prettier": "^3.3.0",
43-
"rimraf": "^5.0.7",
44-
"typescript": "^5.4.5",
45-
"typescript-eslint": "^7.11.0",
46-
"vitest": "^1.6.0"
50+
"eslint-plugin-prettier": "^5.2.1",
51+
"eslint-plugin-unused-imports": "^4.1.4",
52+
"nock": "^13.5.6",
53+
"prettier": "^3.3.3",
54+
"rimraf": "^6.0.1",
55+
"tsup": "^8.3.5",
56+
"typescript": "^5.6.3",
57+
"typescript-eslint": "^8.15.0",
58+
"vitest": "^2.1.5"
4759
},
4860
"prettier": {
4961
"singleQuote": true,
5062
"useTabs": true
5163
},
5264
"packageManager": "[email protected]"
53-
}
65+
}

Diff for: src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { Options, SchemaType, SchemaTypeKeys } from './types';
77
import { Walker } from 'json-schema-walker';
88
import { allowedKeywords } from './const';
99
import type { OpenAPIV3 } from 'openapi-types';
10-
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser/dist/lib/types';
10+
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser';
1111

1212
class InvalidTypeError extends Error {
1313
constructor(message: string) {

Diff for: src/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser/dist/lib/types';
2-
import type { ParserOptions } from '@apidevtools/json-schema-ref-parser/dist/lib/options';
1+
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser';
2+
import type { ParserOptions } from '@apidevtools/json-schema-ref-parser';
33

44
export type addPrefixToObject = {
55
[K in keyof JSONSchema as `x-${K}`]: JSONSchema[K];

Diff for: tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"compilerOptions": {
3-
"module": "commonjs",
43
"outDir": "dist",
54
"target": "es2020",
65
"allowJs": true,

Diff for: vite.config.ts renamed to vite.config.mjs

File renamed without changes.

0 commit comments

Comments
 (0)