Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert back to commons js #1975

Merged
merged 5 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/ts-json-schema-generator.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/usr/bin/env node
import("../dist/ts-json-schema-generator.js");

// eslint-disable-next-line @typescript-eslint/no-require-imports
require("../dist/ts-json-schema-generator.js");
17 changes: 9 additions & 8 deletions eslint.config.js
arthurfiorette marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
const eslint = require("@eslint/js");
const globals = require("globals");
const tseslint = require("typescript-eslint");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");

/** @type {import('@types/eslint').Linter.FlatConfig[]} */
export default tseslint.config(
module.exports = tseslint.config(
{
ignores: ["dist", "cjs", "build"],
ignores: ["dist", "cjs", "build", "eslint.config.js"],
},
eslint.configs.recommended,
{
Expand All @@ -21,10 +21,10 @@ export default tseslint.config(
],
extends: tseslint.configs.recommendedTypeChecked,
languageOptions: {
sourceType: "module",
sourceType: "commonjs",
parserOptions: {
project: "tsconfig.eslint.json",
tsconfigRootDir: import.meta.dirname,
tsconfigRootDir: __dirname,
},
},
rules: {
Expand Down Expand Up @@ -71,6 +71,7 @@ export default tseslint.config(
languageOptions: {
globals: {
...globals.jest,
...globals.commonjs,
},
},
},
Expand Down
81 changes: 37 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
"name": "ts-json-schema-generator",
"version": "2.0.0",
"description": "Generate JSON schema from your Typescript sources",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"bin": {
"ts-json-schema-generator": "./bin/ts-json-schema-generator.js"
},
"files": [
"dist",
"cjs",
"src",
"factory",
"index.*",
"ts-json-schema-generator.*"
"keywords": [
"ts",
"typescript",
"json",
"schema",
"jsonschema"
],
"repository": {
"type": "git",
"url": "git+https://github.com/vega/ts-json-schema-generator.git"
},
"license": "MIT",
"author": {
"name": "Alexander Evtushenko",
"email": "[email protected]"
Expand All @@ -30,24 +28,32 @@
"email": "[email protected]"
}
],
"repository": {
"type": "git",
"url": "https://github.com/vega/ts-json-schema-generator.git"
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"ts-json-schema-generator": "bin/ts-json-schema-generator.js"
},
"license": "MIT",
"keywords": [
"ts",
"typescript",
"json",
"schema",
"jsonschema"
"files": [
"dist",
"src",
"factory",
"index.*",
"ts-json-schema-generator.*"
],
"engines": {
"node": ">=18.0.0"
},
"exports": {
"import": "./dist/index.js",
"require": "./cjs/index.js"
"scripts": {
"build": "tsc",
"debug": "tsx --inspect-brk ts-json-schema-generator.ts",
"format": "eslint --fix",
"lint": "eslint",
"prepublishOnly": "yarn build",
"release": "yarn build && auto shipit",
"run": "tsx ts-json-schema-generator.ts",
"test": "jest test/ --verbose",
"test:coverage": "yarn jest test/ --collectCoverage=true",
"test:fast": "cross-env FAST_TEST=1 jest test/ --verbose",
"test:update": "cross-env UPDATE_SCHEMA=true yarn test:fast",
"watch": "tsc -w"
},
"dependencies": {
"@types/json-schema": "^7.0.15",
Expand Down Expand Up @@ -87,20 +93,7 @@
"vega": "^5.28.0",
"vega-lite": "^5.18.0"
},
"scripts": {
"prepublishOnly": "yarn build",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.json",
"watch": "tsc -w",
"lint": "eslint",
"format": "eslint --fix",
"test": "jest test/ --verbose",
"test:fast": "cross-env FAST_TEST=1 jest test/ --verbose",
"test:coverage": "yarn jest test/ --collectCoverage=true",
"test:update": "cross-env UPDATE_SCHEMA=true yarn test:fast",
"debug": "tsx --inspect-brk ts-json-schema-generator.ts",
"run": "tsx ts-json-schema-generator.ts",
"release": "yarn build && auto shipit"
"engines": {
"node": ">=18.0.0"
}
}
12 changes: 0 additions & 12 deletions tsconfig.cjs.json

This file was deleted.

4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "Node16",
"module": "CommonJS",
"moduleResolution": "Node",
"esModuleInterop": true,
"isolatedModules": false,
"experimentalDecorators": true,
Expand Down
Loading