diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/README.md b/README.md index c4d5e10..fb44793 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Http Request/Response with middleware and handler, [PSR-15][2] inspired. ## Requirements * node: 16 - * [chubbyts/chubbyts-http-types][3]: ^1.1.1 + * [chubbyts/chubbyts-http-types][3]: ^1.2.2 * [qs][4]: ^6.11.1 ## Installation @@ -32,7 +32,7 @@ Http Request/Response with middleware and handler, [PSR-15][2] inspired. Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-http][1]. ```ts -npm i @chubbyts/chubbyts-http@^1.1.1 +npm i @chubbyts/chubbyts-http@^1.2.0 ``` ## Copyright diff --git a/package.json b/package.json index 6888131..70b1637 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@chubbyts/chubbyts-http", - "version": "1.1.1", + "type": "module", + "version": "1.2.0", "description": "Http Request/Response with middleware and handler, PSR-15 inspired.", "keywords": [ "chubbyts", @@ -15,14 +16,14 @@ "license": "MIT", "repository": "chubbyts/chubbyts-http", "scripts": { + "build": "rm -rf ./dist && tsc -b ./tsconfig.types.json ./tsconfig.esm.json ./tsconfig.cjs.json && node ./rename-commonjs.js", "cs-fix": "prettier --write src tests", "cs": "prettier --check src tests", + "infection": "stryker run", "lint-fix": "eslint src tests --fix", "lint": "eslint src tests", - "test": "jest", - "infection": "stryker run", - "build": "rm -Rf dist && tsc", - "prepare": "npm run build" + "prepare": "npm run build", + "test": "jest" }, "jest": { "preset": "ts-jest", @@ -45,19 +46,28 @@ "files": [ "dist" ], + "exports": { + "./*": { + "types": "./*.d.ts", + "require": "./*.cjs", + "import": "./*.js", + "default": "./*.js" + } + }, "engines": { "node": ">=16" }, "dependencies": { - "@chubbyts/chubbyts-http-types": "^1.1.1", + "@chubbyts/chubbyts-http-types": "^1.2.2", "qs": "^6.11.2" }, "devDependencies": { - "@chubbyts/chubbyts-eslint": "^1.1.2", - "@stryker-mutator/core": "^7.1.0", - "@stryker-mutator/jest-runner": "^7.1.0", + "@chubbyts/chubbyts-eslint": "^2.0.2", + "@chubbyts/chubbyts-packaging": "^1.0.3", + "@stryker-mutator/core": "^7.1.1", + "@stryker-mutator/jest-runner": "^7.1.1", "@types/jest": "^29.5.3", - "@types/node": "^20.4.1", + "@types/node": "^20.4.4", "@types/qs": "^6.9.7", "jest": "^29.6.1", "prettier": "^3.0.0", diff --git a/rename-commonjs.js b/rename-commonjs.js new file mode 120000 index 0000000..25ca74a --- /dev/null +++ b/rename-commonjs.js @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/rename-commonjs.js \ No newline at end of file diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 120000 index 0000000..6bb8085 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/tsconfig.cjs.json \ No newline at end of file diff --git a/tsconfig.esm.json b/tsconfig.esm.json new file mode 120000 index 0000000..7e43d74 --- /dev/null +++ b/tsconfig.esm.json @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/tsconfig.esm.json \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 619956e..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "target": "es2019", - "module": "commonjs", - "outDir": "dist", - "strict": true, - "declaration": true - }, - "include": ["src"] -} diff --git a/tsconfig.json b/tsconfig.json new file mode 120000 index 0000000..960dc3d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/tsconfig.json \ No newline at end of file diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 120000 index 0000000..aee4f8e --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/tsconfig.types.json \ No newline at end of file