diff --git a/codecov.yml b/codecov.yml index 567e554..e6fe370 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 diff --git a/packages/container/libraries/core/.gitignore b/packages/container/libraries/core/.gitignore new file mode 100644 index 0000000..288feba --- /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 0000000..0061dfc --- /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 0000000..2259a25 --- /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 0000000..0990381 --- /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 0000000..4200228 --- /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 0000000..7425b9f --- /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 0000000..ec0166c --- /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 0000000..773dbb6 --- /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 0000000..fe687a9 --- /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 0000000..70361db --- /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 0000000..cb0ff5c --- /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 0000000..c251339 --- /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 0000000..72630fb --- /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 0000000..e597177 --- /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 0000000..04a10c9 --- /dev/null +++ b/packages/container/libraries/core/tsconfig.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "extends": "./tsconfig.esm.json" +}