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

Update common package with ESM modules support #46

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/sweet-shrimps-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inversifyjs/common": minor
---

Added ESM modules support
2 changes: 2 additions & 0 deletions packages/container/libraries/common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/lib/**

/tsconfig.tsbuildinfo
/tsconfig.cjs.tsbuildinfo
/tsconfig.esm.tsbuildinfo

# Test coverage report
/coverage
Expand Down
13 changes: 11 additions & 2 deletions packages/container/libraries/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@
"typescript"
],
"license": "MIT",
"main": "lib/index.js",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"exports": {
".": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
}
},
"name": "@inversifyjs/common",
"os": [
"darwin",
Expand All @@ -50,7 +57,9 @@
"url": "git+https://github.com/inversify/monorepo.git"
},
"scripts": {
"build": "tsc --build tsconfig.json",
"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",
Expand Down
10 changes: 10 additions & 0 deletions packages/container/libraries/common/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -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"]
}
10 changes: 10 additions & 0 deletions packages/container/libraries/common/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -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"]
}
7 changes: 1 addition & 6 deletions packages/container/libraries/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "@inversifyjs/foundation-typescript-config/tsconfig.base.cjs.json",
"compilerOptions": {
"outDir": "./lib",
"rootDir": "./src"
},
"include": ["src"]
"extends": "./tsconfig.esm.json"
}