Skip to content

Commit

Permalink
Merge pull request #46 from inversify/feat/update-common-package-with…
Browse files Browse the repository at this point in the history
…-esm-support

Update common package with ESM modules support
  • Loading branch information
notaphplover authored Oct 25, 2024
2 parents 5033119 + 5dc74ff commit ea35fdb
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 8 deletions.
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"
}

0 comments on commit ea35fdb

Please sign in to comment.