From eb2c90aa1b3f847746ab7e7b3d1f5e6f41733efa Mon Sep 17 00:00:00 2001 From: Dominik Zogg Date: Wed, 26 Jul 2023 22:31:39 +0200 Subject: [PATCH] cjs + esm with @chubbyts/packaging v2 --- .eslintrc.js => .eslintrc.cjs | 0 README.md | 6 +++--- build.js | 1 + package.json | 26 ++++++++++++++++++-------- tsconfig.cjs.json | 1 + tsconfig.esm.json | 1 + tsconfig.json | 11 +---------- tsconfig.types.json | 1 + 8 files changed, 26 insertions(+), 21 deletions(-) rename .eslintrc.js => .eslintrc.cjs (100%) create mode 120000 build.js create mode 120000 tsconfig.cjs.json create mode 120000 tsconfig.esm.json mode change 100644 => 120000 tsconfig.json create mode 120000 tsconfig.types.json 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 b35d3cf..11efd70 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,15 @@ Dependency injection container creation by config, inspired by [mezzio-config][2 ## Requirements * node: 16 - * [@chubbyts/chubbyts-dic][3]: ^1.1.1 - * [@chubbyts/chubbyts-dic-types][4]: ^1.1.1 + * [@chubbyts/chubbyts-dic][3]: ^1.2.0 + * [@chubbyts/chubbyts-dic-types][4]: ^1.2.1 ## Installation Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-dic-config][1]. ```ts -npm i @chubbyts/chubbyts-dic-config@^1.1.1 +npm i @chubbyts/chubbyts-dic-config@^1.2.0 ``` ## Usage diff --git a/build.js b/build.js new file mode 120000 index 0000000..5ef468d --- /dev/null +++ b/build.js @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/build.js \ No newline at end of file diff --git a/package.json b/package.json index 44ed63a..6743c02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@chubbyts/chubbyts-dic-config", - "version": "1.1.1", + "type": "module", + "version": "1.2.0", "description": "Dependency injection container creation by config, inspired by laminas-config.", "keywords": [ "chubbyts", @@ -15,14 +16,14 @@ "license": "MIT", "repository": "chubbyts/chubbyts-dic-config", "scripts": { + "build": "node ./build.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,15 +46,24 @@ "files": [ "dist" ], + "exports": { + "./*": { + "types": "./*.d.ts", + "require": "./*.cjs", + "import": "./*.mjs", + "default": "./*.mjs" + } + }, "engines": { "node": ">=16" }, "dependencies": { - "@chubbyts/chubbyts-dic": "^1.1.1", - "@chubbyts/chubbyts-dic-types": "^1.1.1" + "@chubbyts/chubbyts-dic": "^1.2.0", + "@chubbyts/chubbyts-dic-types": "^1.2.1" }, "devDependencies": { - "@chubbyts/chubbyts-eslint": "^1.1.2", + "@chubbyts/chubbyts-eslint": "^2.0.3", + "@chubbyts/chubbyts-packaging": "^2.0.4", "@stryker-mutator/core": "^7.1.0", "@stryker-mutator/jest-runner": "^7.1.0", "@types/jest": "^29.5.3", 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