Skip to content

Commit

Permalink
fix: separate cjs and mjs typings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 10, 2023
1 parent d65d669 commit e538acb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [v3.5.0](https://github.com/i18next/i18next-http-middleware/compare/v3.4.1...v3.5.0)
- fix: separate cjs and mjs typings

## [v3.4.1](https://github.com/i18next/i18next-http-middleware/compare/v3.4.0...v3.4.1)
- fix(languageDetector): handle es-419 special case [#65](https://github.com/i18next/i18next-http-middleware/pull/65)

Expand Down
1 change: 1 addition & 0 deletions index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './index.js';
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"private": false,
"type": "module",
"main": "./cjs/index.js",
"types": "./index.d.ts",
"types": "./index.d.mts",
"exports": {
"./package.json": "./package.json",
".": {
"types": {
"require": "./cjs/index.d.ts",
"import": "./esm/index.d.ts"
"import": "./esm/index.d.mts"
},
"module": "./esm/index.js",
"import": "./esm/index.js",
Expand All @@ -22,31 +22,31 @@
"default": "./cjs/index.js"
},
"./esm": {
"types": "./esm/index.d.ts",
"types": "./esm/index.d.mts",
"default": "./esm/index.js"
}
},
"module": "./esm/index.js",
"devDependencies": {
"@babel/cli": "7.23.0",
"@babel/core": "7.23.0",
"@babel/preset-env": "7.22.20",
"@babel/core": "7.23.3",
"@babel/preset-env": "7.23.3",
"@hapi/hapi": "^21.3.2",
"@types/express-serve-static-core": "^4.17.37",
"@koa/router": "12.0.0",
"@types/express-serve-static-core": "^4.17.41",
"@koa/router": "12.0.1",
"koa": "2.14.2",
"babel-plugin-add-module-exports": "1.0.4",
"eslint": "8.50.0",
"eslint": "8.53.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-n": "16.1.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-n": "16.3.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-require-path-exists": "1.1.9",
"eslint-plugin-standard": "5.0.0",
"expect.js": "0.3.1",
"express": "4.18.2",
"fastify": "4.23.2",
"i18next": "23.5.1",
"fastify": "4.24.3",
"i18next": "23.7.1",
"mocha": "10.2.0",
"supertest": "6.3.3",
"tsd": "0.29.0",
Expand All @@ -70,7 +70,7 @@
"license": "MIT",
"scripts": {
"lint": "eslint .",
"compile:esm": "rm -rf esm && mkdir esm && BABEL_ENV=esm babel lib -d esm && cp index.d.ts esm/index.d.ts",
"compile:esm": "rm -rf esm && mkdir esm && BABEL_ENV=esm babel lib -d esm && cp index.d.ts esm/index.d.ts && cp index.d.mts esm/index.d.mts",
"compile:cjs": "rm -rf cjs && mkdir cjs && BABEL_ENV=cjs babel lib -d cjs && cp index.d.ts cjs/index.d.ts && echo '{\"type\":\"commonjs\"}' > cjs/package.json",
"compile": "npm run compile:esm && npm run compile:cjs",
"build": "npm run compile",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"include": [
"test/types/*.test-d.ts",
"*.d.ts"
"*.d.ts",
"*.d.mts"
]
}

0 comments on commit e538acb

Please sign in to comment.