Skip to content

Commit c30e413

Browse files
committed
chore: update strongly typed package to be esm
1 parent b3e5fed commit c30e413

File tree

15 files changed

+62
-66
lines changed

15 files changed

+62
-66
lines changed

packages/container/libraries/strongly-typed/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/lib/**
33

44
/tsconfig.tsbuildinfo
5-
/tsconfig.cjs.tsbuildinfo
65
/tsconfig.esm.tsbuildinfo
76

87
# Test coverage report

packages/container/libraries/strongly-typed/.npmignore

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@
22
/coverage
33
/reports
44

5+
**/*.ts
56
**/*.spec.js
67
**/*.spec.js.map
7-
**/*.ts
8-
!lib/cjs/**/*.d.ts
9-
lib/esm/**/*.d.ts.map
10-
!lib/esm/index.d.ts
11-
!lib/esm/index.d.ts.map
8+
**/*.spec.d.ts.map
9+
**/*.spec-d.js
10+
**/*.spec-d.js.map
11+
**/*.spec-d.d.ts.map
12+
!lib/**/*.d.ts
1213

1314
.lintstagedrc.json
1415
eslint.config.mjs
1516
vitest.config.mjs
1617
vitest.config.stryker.mjs
1718
vitest.workspace.mjs
1819
prettier.config.mjs
19-
rollup.config.mjs
2020
stryker.config.mjs
21-
tsconfig.cjs.json
22-
tsconfig.cjs.tsbuildinfo
2321
tsconfig.esm.json
2422
tsconfig.esm.tsbuildinfo
2523
tsconfig.json
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
import { buildDefaultConfig } from '@inversifyjs/foundation-eslint-config';
22

3-
export default [...buildDefaultConfig()];
3+
import plugin from '@inversifyjs/eslint-plugin-require-extensions';
4+
5+
export default [
6+
...buildDefaultConfig(
7+
{
8+
'@typescript-eslint/consistent-type-imports': [
9+
'error',
10+
{
11+
disallowTypeAnnotations: true,
12+
fixStyle: 'inline-type-imports',
13+
prefer: 'type-imports',
14+
},
15+
],
16+
'require-extensions/require-extensions': 'error',
17+
'require-extensions/require-index': 'error',
18+
},
19+
{
20+
'require-extensions': plugin,
21+
},
22+
),
23+
];

packages/container/libraries/strongly-typed/package.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
},
66
"description": "InversifyJs strong type definitions",
77
"devDependencies": {
8+
"@inversifyjs/eslint-plugin-require-extensions": "workspace:*",
89
"@types/node": "24.10.13",
910
"@vitest/coverage-v8": "4.0.18",
1011
"eslint": "9.39.2",
1112
"prettier": "3.8.1",
1213
"reflect-metadata": "0.2.2",
1314
"rimraf": "6.1.3",
14-
"rollup": "4.57.1",
15-
"ts-loader": "9.5.4",
1615
"tslib": "2.8.1",
1716
"typescript": "5.9.3",
1817
"vitest": "4.0.18"
@@ -33,14 +32,10 @@
3332
"typescript"
3433
],
3534
"license": "MIT",
36-
"main": "lib/cjs/index.js",
37-
"module": "lib/esm/index.js",
3835
"exports": {
39-
".": {
40-
"import": "./lib/esm/index.js",
41-
"require": "./lib/cjs/index.js"
42-
}
36+
".": "./lib/index.js"
4337
},
38+
"type": "module",
4439
"name": "@inversifyjs/strongly-typed",
4540
"peerDependencies": {
4641
"inversify": "^7.11.0"
@@ -53,9 +48,7 @@
5348
"url": "git+https://github.com/inversify/monorepo.git"
5449
},
5550
"scripts": {
56-
"build": "pnpm run build:cjs && pnpm run build:esm",
57-
"build:cjs": "tsc --build tsconfig.cjs.json && pnpm exec foundation-ts-package-cjs ./lib/cjs",
58-
"build:esm": "rollup -c ./rollup.config.mjs && pnpm exec foundation-ts-package-esm ./lib/esm",
51+
"build": "tsc",
5952
"build:clean": "rimraf lib",
6053
"format": "prettier --write ./src",
6154
"lint": "eslint ./src",

packages/container/libraries/strongly-typed/rollup.config.mjs

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/container/libraries/strongly-typed/src/container.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'reflect-metadata/lite';
66

77
import { Container, injectable } from 'inversify';
88

9-
import { TypedContainer } from './index';
9+
import { TypedContainer } from './index.js';
1010

1111
describe('interfaces', () => {
1212
@injectable()

packages/container/libraries/strongly-typed/src/container.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22

33
import {
4-
BindingActivation,
5-
BindingDeactivation,
6-
BindToFluentSyntax,
4+
type BindingActivation,
5+
type BindingDeactivation,
6+
type BindToFluentSyntax,
77
Container,
8-
ContainerOptions,
9-
GetOptions,
10-
IsBoundOptions,
11-
Newable,
12-
ServiceIdentifier,
8+
type ContainerOptions,
9+
type GetOptions,
10+
type IsBoundOptions,
11+
type Newable,
12+
type ServiceIdentifier,
1313
} from 'inversify';
1414

15-
import { TypedContainerModule } from './module';
15+
import { type TypedContainerModule } from './module.js';
1616

1717
type IfAny<T, TYes, TNo> = 0 extends 1 & T ? TYes : TNo;
1818

packages/container/libraries/strongly-typed/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export {
66
Rebind,
77
RebindSync,
88
UnbindSync,
9-
} from './container';
10-
export type { TypedInject, TypedMultiInject } from './inject';
9+
} from './container.js';
10+
export type { TypedInject, TypedMultiInject } from './inject.js';
1111
export {
1212
TypedContainerModule,
1313
TypedContainerModuleLoadOptions,
14-
} from './module';
14+
} from './module.js';

packages/container/libraries/strongly-typed/src/inject.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'reflect-metadata/lite';
66

77
import { inject, injectable, multiInject } from 'inversify';
88

9-
import type { TypedInject, TypedMultiInject } from './inject';
9+
import type { TypedInject, TypedMultiInject } from './inject.js';
1010

1111
describe(inject, () => {
1212
@injectable()

packages/container/libraries/strongly-typed/src/inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
import type { BindingMap } from './container';
2+
import type { BindingMap } from './container.js';
33

44
type TypedDecorator<T> = <TTarget, TKey, TIndex>(
55
target: TTarget extends new (...args: any[]) => any

0 commit comments

Comments
 (0)