Skip to content

Commit

Permalink
fix: restore ESM, upgrade packages (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
javierlinked authored Nov 19, 2024
1 parent 8449ab0 commit 4bed708
Show file tree
Hide file tree
Showing 7 changed files with 1,294 additions and 658 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
46 changes: 29 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@
"name": "@openapi-contrib/json-schema-to-openapi-schema",
"version": "0.0.0-development",
"description": "Converts a JSON Schema to OpenAPI Schema Object",
"bin": "bin/json-schema-to-openapi-schema.js",
"types": "dist/index.d.ts",
"files": [
"bin",
"dist"
"dist",
"CHANGELOG.md",
"LICENSE",
"package.json"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"bin": "bin/json-schema-to-openapi-schema.js",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"prepublish": "yarn build",
"build": "rimraf dist && tsc -p tsconfig.json",
"build": "rimraf dist && tsup src/index.ts --format esm,cjs --dts --clean",
"lint": "eslint . && prettier -c src",
"lint:fix": "eslint . --fix && prettier -c src -w",
"typecheck": "tsc --noEmit",
Expand All @@ -25,29 +36,30 @@
"node": ">=18"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^11.6.2",
"@apidevtools/json-schema-ref-parser": "^11.7.2",
"json-schema-walker": "^2.0.0",
"openapi-types": "^12.1.3",
"yargs": "^17.7.2"
},
"devDependencies": {
"@eslint/compat": "^1.0.3",
"@eslint/compat": "^1.2.3",
"@types/json-schema": "^7.0.15",
"c8": "^9.1.0",
"eslint": "^9.4.0",
"c8": "^10.1.2",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unused-imports": "^4.0.0",
"nock": "^13.5.4",
"prettier": "^3.3.0",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"typescript-eslint": "^7.11.0",
"vitest": "^1.6.0"
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-unused-imports": "^4.1.4",
"nock": "^13.5.6",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"tsup": "^8.3.5",
"typescript": "^5.6.3",
"typescript-eslint": "^8.15.0",
"vitest": "^2.1.5"
},
"prettier": {
"singleQuote": true,
"useTabs": true
},
"packageManager": "[email protected]"
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Options, SchemaType, SchemaTypeKeys } from './types';
import { Walker } from 'json-schema-walker';
import { allowedKeywords } from './const';
import type { OpenAPIV3 } from 'openapi-types';
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser/dist/lib/types';
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser';

class InvalidTypeError extends Error {
constructor(message: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser/dist/lib/types';
import type { ParserOptions } from '@apidevtools/json-schema-ref-parser/dist/lib/options';
import type { JSONSchema } from '@apidevtools/json-schema-ref-parser';
import type { ParserOptions } from '@apidevtools/json-schema-ref-parser';

export type addPrefixToObject = {
[K in keyof JSONSchema as `x-${K}`]: JSONSchema[K];
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"target": "es2020",
"allowJs": true,
Expand Down
File renamed without changes.
Loading

0 comments on commit 4bed708

Please sign in to comment.