From 9b34269e1022b4c8eb088d2911d25e26cbfc0d9c Mon Sep 17 00:00:00 2001 From: notaphplover Date: Fri, 25 Oct 2024 23:48:34 +0200 Subject: [PATCH 1/2] chore: add core package --- packages/container/libraries/core/.gitignore | 19 +++++ .../libraries/core/.lintstagedrc.json | 9 +++ packages/container/libraries/core/.npmignore | 17 ++++ packages/container/libraries/core/README.md | 6 ++ .../libraries/core/eslint.config.mjs | 3 + .../container/libraries/core/jest.config.mjs | 3 + .../libraries/core/jest.config.stryker.mjs | 9 +++ .../libraries/core/jest.js.config.mjs | 3 + .../container/libraries/core/package.json | 77 +++++++++++++++++++ .../libraries/core/prettier.config.mjs | 3 + .../container/libraries/core/src/index.ts | 1 + .../libraries/core/stryker.config.mjs | 3 + .../libraries/core/tsconfig.cjs.json | 10 +++ .../libraries/core/tsconfig.esm.json | 10 +++ .../container/libraries/core/tsconfig.json | 4 + 15 files changed, 177 insertions(+) create mode 100644 packages/container/libraries/core/.gitignore create mode 100644 packages/container/libraries/core/.lintstagedrc.json create mode 100644 packages/container/libraries/core/.npmignore create mode 100644 packages/container/libraries/core/README.md create mode 100644 packages/container/libraries/core/eslint.config.mjs create mode 100644 packages/container/libraries/core/jest.config.mjs create mode 100644 packages/container/libraries/core/jest.config.stryker.mjs create mode 100644 packages/container/libraries/core/jest.js.config.mjs create mode 100644 packages/container/libraries/core/package.json create mode 100644 packages/container/libraries/core/prettier.config.mjs create mode 100644 packages/container/libraries/core/src/index.ts create mode 100644 packages/container/libraries/core/stryker.config.mjs create mode 100644 packages/container/libraries/core/tsconfig.cjs.json create mode 100644 packages/container/libraries/core/tsconfig.esm.json create mode 100644 packages/container/libraries/core/tsconfig.json diff --git a/packages/container/libraries/core/.gitignore b/packages/container/libraries/core/.gitignore new file mode 100644 index 00000000..288feba2 --- /dev/null +++ b/packages/container/libraries/core/.gitignore @@ -0,0 +1,19 @@ +# Typescript compiled files +/lib/** + +/tsconfig.tsbuildinfo +/tsconfig.cjs.tsbuildinfo +/tsconfig.esm.tsbuildinfo + +# Test coverage report +/coverage + +# Test mutation report +/reports + +# node modules +/node_modules/ + +# Turborepo files +.turbo/ + diff --git a/packages/container/libraries/core/.lintstagedrc.json b/packages/container/libraries/core/.lintstagedrc.json new file mode 100644 index 00000000..0061dfc2 --- /dev/null +++ b/packages/container/libraries/core/.lintstagedrc.json @@ -0,0 +1,9 @@ +{ + "*.js": [ + "prettier --write" + ], + "*.ts": [ + "prettier --write", + "eslint" + ] +} diff --git a/packages/container/libraries/core/.npmignore b/packages/container/libraries/core/.npmignore new file mode 100644 index 00000000..2259a258 --- /dev/null +++ b/packages/container/libraries/core/.npmignore @@ -0,0 +1,17 @@ +**/*.spec.js +**/*.spec.js.map +**/*.ts +!lib/**/*.d.ts +lib/**/*.spec.d.ts + +.lintstagedrc.json +eslint.config.mjs +jest.config.mjs +jest.config.stryker.mjs +jest.js.config.mjs +prettier.config.mjs +stryker.config.mjs +tsconfig.json +tsconfig.cjs.json +tsconfig.esm.json +tsconfig.tsbuildinfo diff --git a/packages/container/libraries/core/README.md b/packages/container/libraries/core/README.md new file mode 100644 index 00000000..09903813 --- /dev/null +++ b/packages/container/libraries/core/README.md @@ -0,0 +1,6 @@ +[![Test coverage](https://codecov.io/gh/inversify/monorepo/branch/main/graph/badge.svg?flag=%40inversifyjs%2Fcore)](https://codecov.io/gh/inversify/monorepo/branch/main/graph/badge.svg?flag=%40inversifyjs%2Fcore) +[![npm version](https://img.shields.io/github/package-json/v/inversify/monorepo?filename=packages%2Fcontainer%2Flibraries%2Fcore%2Fpackage.json&style=plastic)](https://www.npmjs.com/package/@inversifyjs/core) + +# @inversifyjs/core + +Inversify monorepo core modules. diff --git a/packages/container/libraries/core/eslint.config.mjs b/packages/container/libraries/core/eslint.config.mjs new file mode 100644 index 00000000..42002283 --- /dev/null +++ b/packages/container/libraries/core/eslint.config.mjs @@ -0,0 +1,3 @@ +import myconfig from '@inversifyjs/foundation-eslint-config'; + +export default [...myconfig]; diff --git a/packages/container/libraries/core/jest.config.mjs b/packages/container/libraries/core/jest.config.mjs new file mode 100644 index 00000000..7425b9fa --- /dev/null +++ b/packages/container/libraries/core/jest.config.mjs @@ -0,0 +1,3 @@ +import { tsGlobalConfig } from '@inversifyjs/foundation-jest-config'; + +export default tsGlobalConfig; diff --git a/packages/container/libraries/core/jest.config.stryker.mjs b/packages/container/libraries/core/jest.config.stryker.mjs new file mode 100644 index 00000000..ec0166c4 --- /dev/null +++ b/packages/container/libraries/core/jest.config.stryker.mjs @@ -0,0 +1,9 @@ +import { getJestTsProjectConfig } from '@inversifyjs/foundation-jest-config'; + +const tsGlobalConfig = getJestTsProjectConfig( + 'All', + ['/node_modules', '.int.spec.ts'], + '.spec.ts', +); + +export default tsGlobalConfig; diff --git a/packages/container/libraries/core/jest.js.config.mjs b/packages/container/libraries/core/jest.js.config.mjs new file mode 100644 index 00000000..773dbb6f --- /dev/null +++ b/packages/container/libraries/core/jest.js.config.mjs @@ -0,0 +1,3 @@ +import { jsGlobalConfig } from '@inversifyjs/foundation-jest-config'; + +export default jsGlobalConfig; diff --git a/packages/container/libraries/core/package.json b/packages/container/libraries/core/package.json new file mode 100644 index 00000000..fe687a94 --- /dev/null +++ b/packages/container/libraries/core/package.json @@ -0,0 +1,77 @@ +{ + "author": "Roberto Pintos López", + "bugs": { + "url": "https://github.com/inversify/monorepo/issues" + }, + "description": "InversifyJs core package", + "devDependencies": { + "@eslint/js": "9.13.0", + "@jest/globals": "29.7.0", + "@stryker-mutator/core": "8.6.0", + "@stryker-mutator/jest-runner": "8.6.0", + "@stryker-mutator/typescript-checker": "8.6.0", + "@types/node": "20.17.1", + "@typescript-eslint/eslint-plugin": "8.11.0", + "@typescript-eslint/parser": "8.11.0", + "jest": "29.7.0", + "prettier": "3.3.3", + "rimraf": "6.0.1", + "ts-jest": "29.2.5", + "ts-node": "10.9.2", + "typescript": "5.6.3" + }, + "devEngines": { + "node": "^20.18.0", + "pnpm": "^9.12.1" + }, + "homepage": "https://inversify.io", + "keywords": [ + "dependency injection", + "dependency inversion", + "di", + "inversion of control container", + "ioc", + "javascript", + "node", + "typescript" + ], + "license": "MIT", + "main": "lib/cjs/index.js", + "module": "lib/esm/index.js", + "exports": { + ".": { + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js" + } + }, + "name": "@inversifyjs/core", + "os": [ + "darwin", + "linux" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inversify/monorepo.git" + }, + "scripts": { + "build": "pnpm run build:cjs && pnpm run build:esm", + "build:cjs": "tsc --build tsconfig.cjs.json && pnpm exec foundation-ts-package-cjs ./lib/cjs", + "build:esm": "tsc --build tsconfig.esm.json && pnpm exec foundation-ts-package-esm ./lib/esm", + "build:clean": "rimraf lib", + "format": "prettier --write ./src/**/*.ts", + "lint": "eslint ./src", + "prebuild": "pnpm run build:clean", + "test": "jest --config=jest.config.mjs --runInBand", + "test:integration:js": "pnpm run test:js --selectProjects Integration", + "test:js": "jest --config=jest.js.config.mjs --runInBand", + "test:js:coverage": "pnpm run test:unit:js --coverage", + "test:mutation": "stryker run", + "test:uncommitted": "pnpm run test --changedSince=HEAD", + "test:unit:js": "pnpm run test:js --selectProjects Unit" + }, + "sideEffects": false, + "version": "1.0.0" +} diff --git a/packages/container/libraries/core/prettier.config.mjs b/packages/container/libraries/core/prettier.config.mjs new file mode 100644 index 00000000..70361db5 --- /dev/null +++ b/packages/container/libraries/core/prettier.config.mjs @@ -0,0 +1,3 @@ +import config from '@inversifyjs/foundation-prettier-config'; + +export default config; diff --git a/packages/container/libraries/core/src/index.ts b/packages/container/libraries/core/src/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/packages/container/libraries/core/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/container/libraries/core/stryker.config.mjs b/packages/container/libraries/core/stryker.config.mjs new file mode 100644 index 00000000..c2513393 --- /dev/null +++ b/packages/container/libraries/core/stryker.config.mjs @@ -0,0 +1,3 @@ +import config from '@inversifyjs/foundation-stryker-config'; + +export default config; diff --git a/packages/container/libraries/core/tsconfig.cjs.json b/packages/container/libraries/core/tsconfig.cjs.json new file mode 100644 index 00000000..72630fb8 --- /dev/null +++ b/packages/container/libraries/core/tsconfig.cjs.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "extends": "@inversifyjs/foundation-typescript-config/tsconfig.base.cjs.json", + "compilerOptions": { + "outDir": "./lib/cjs", + "rootDir": "./src", + "tsBuildInfoFile": "tsconfig.cjs.tsbuildinfo" + }, + "include": ["src"] +} diff --git a/packages/container/libraries/core/tsconfig.esm.json b/packages/container/libraries/core/tsconfig.esm.json new file mode 100644 index 00000000..e597177d --- /dev/null +++ b/packages/container/libraries/core/tsconfig.esm.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "extends": "@inversifyjs/foundation-typescript-config/tsconfig.base.esm.json", + "compilerOptions": { + "outDir": "./lib/esm", + "rootDir": "./src", + "tsBuildInfoFile": "tsconfig.esm.tsbuildinfo" + }, + "include": ["src"] +} diff --git a/packages/container/libraries/core/tsconfig.json b/packages/container/libraries/core/tsconfig.json new file mode 100644 index 00000000..04a10c90 --- /dev/null +++ b/packages/container/libraries/core/tsconfig.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "extends": "./tsconfig.esm.json" +} From a46418773a852c16c3a5e2d2ab17b7a46e7dd2bc Mon Sep 17 00:00:00 2001 From: notaphplover Date: Fri, 25 Oct 2024 23:48:54 +0200 Subject: [PATCH 2/2] chore: update codecov config with core package --- codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codecov.yml b/codecov.yml index 567e5542..e6fe370c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,6 +5,9 @@ coverage: '@inversifyjs/common': flags: - '@inversifyjs/common' + '@inversifyjs/core': + flags: + - '@inversifyjs/core' '@inversifyjs/reflect-metadata-utils': flags: - '@inversifyjs/reflect-metadata-utils' @@ -12,6 +15,9 @@ flags: '@inversifyjs/common': paths: - packages/container/libraries/common/ + '@inversifyjs/core': + paths: + - packages/container/libraries/core/ '@inversifyjs/reflect-metadata-utils': paths: - packages/foundation/libraries/reflect-metadata-utils