diff --git a/components/empty-view/.eslintrc.json b/components/empty-view/.eslintrc.json index 52a46317..b1043e57 100644 --- a/components/empty-view/.eslintrc.json +++ b/components/empty-view/.eslintrc.json @@ -3,6 +3,6 @@ "root": true, "ignorePatterns": ["lib", "**/*.js"], "parserOptions": { - "project": ["./tsconfig.src.json"] + "project": ["./tsconfig.json"] } } diff --git a/components/empty-view/package.json b/components/empty-view/package.json index b2655d16..48409025 100644 --- a/components/empty-view/package.json +++ b/components/empty-view/package.json @@ -10,16 +10,17 @@ }, "license": "MIT", "author": "Axis Communications AB", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "files": [ - "lib" - ], + "type": "module", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "import": "./lib/index.js" + } + }, + "files": ["lib"], "scripts": { "prebuild": "pnpm run -C ../../illustrations build", - "build": "pnpm prebuild && pnpm build:cjs && pnpm build:esm", - "build:cjs": "tsc --module commonjs --outDir lib/cjs", - "build:esm": "tsc", + "build": "pnpm prebuild && tsc", "check:unused-deps": "depcheck . --config=depcheck.yml", "lint": "tsc --noEmit && eslint . --cache" }, diff --git a/components/empty-view/src/constants.ts b/components/empty-view/src/constants.ts index 3d9fbfd2..d93aa3f7 100644 --- a/components/empty-view/src/constants.ts +++ b/components/empty-view/src/constants.ts @@ -43,7 +43,7 @@ import { UnderConstructionDark, UnderConstructionLight, } from "@axiscommunications/fluent-illustrations"; -import { IllustrationKind } from "./types"; +import { IllustrationKind } from "./types.js"; export const Illustration: Record< IllustrationKind, diff --git a/components/empty-view/src/index.ts b/components/empty-view/src/index.ts index 009235fe..4fbb4588 100644 --- a/components/empty-view/src/index.ts +++ b/components/empty-view/src/index.ts @@ -3,4 +3,4 @@ export { MainEmptyView, PanelEmptyView, SubmenuEmptyView, -} from "./view"; +} from "./view.js"; diff --git a/components/empty-view/src/styles.ts b/components/empty-view/src/styles.ts index a5c54459..5eebb874 100644 --- a/components/empty-view/src/styles.ts +++ b/components/empty-view/src/styles.ts @@ -4,7 +4,7 @@ import { shorthands, tokens, } from "@fluentui/react-components"; -import { HtmlDivAttributesRestProps } from "./types"; +import { HtmlDivAttributesRestProps } from "./types.js"; export const useStyles = makeStyles({ container: { diff --git a/components/empty-view/src/view.tsx b/components/empty-view/src/view.tsx index 91ce5ec0..a7db47f3 100644 --- a/components/empty-view/src/view.tsx +++ b/components/empty-view/src/view.tsx @@ -11,13 +11,13 @@ import { import { useMediaQuery } from "@axiscommunications/fluent-hooks"; -import { useContainerStyle, useStyles } from "./styles"; +import { useContainerStyle, useStyles } from "./styles.js"; import { ContentProps, EmptyViewProps, HtmlDivAttributesRestProps, -} from "./types"; -import { Illustration } from "./constants"; +} from "./types.js"; +import { Illustration } from "./constants.js"; function ContainerSpacious( { children, className, ...rest }: PropsWithChildren< diff --git a/components/empty-view/tsconfig.json b/components/empty-view/tsconfig.json index a8c2d65f..9a3b5f10 100644 --- a/components/empty-view/tsconfig.json +++ b/components/empty-view/tsconfig.json @@ -1,6 +1,9 @@ { - "extends": "./tsconfig.src.json", + "extends": "../../tsconfig.base.json", + "include": ["src"], "compilerOptions": { + "module": "nodenext", + "moduleResolution": "nodenext", "outDir": "lib" } } diff --git a/components/empty-view/tsconfig.src.json b/components/empty-view/tsconfig.src.json deleted file mode 100644 index 1da8cb9e..00000000 --- a/components/empty-view/tsconfig.src.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": ["src", "vitest.config.ts"] -} diff --git a/components/password-input/package.json b/components/password-input/package.json index 82b230a7..49983264 100644 --- a/components/password-input/package.json +++ b/components/password-input/package.json @@ -10,8 +10,10 @@ }, "license": "MIT", "author": "Axis Communications AB", + "type": "module", "exports": { ".": { + "types": "./lib/index.d.ts", "require": "./lib/cjs/index.js", "import": "./lib/index.js" } @@ -19,9 +21,7 @@ "main": "lib/cjs/index.js", "module": "lib/index.js", "types": "lib/index.d.ts", - "files": [ - "lib" - ], + "files": ["lib"], "scripts": { "build": "pnpm build:cjs && pnpm build:esm", "build:cjs": "tsc --module commonjs --outDir lib/cjs", diff --git a/components/password-input/src/index.ts b/components/password-input/src/index.ts index 32685bca..e3dffeeb 100644 --- a/components/password-input/src/index.ts +++ b/components/password-input/src/index.ts @@ -1,3 +1,3 @@ -export { PasswordInput } from "./password-input"; -export { usePasswordInputStyles } from "./password-input.styles"; -export type { PasswordInputProps } from "./password-input.types"; +export { PasswordInput } from "./password-input.js"; +export { usePasswordInputStyles } from "./password-input.styles.js"; +export type { PasswordInputProps } from "./password-input.types.js"; diff --git a/components/password-input/src/password-input.tsx b/components/password-input/src/password-input.tsx index d4f2b09d..7fef1faf 100644 --- a/components/password-input/src/password-input.tsx +++ b/components/password-input/src/password-input.tsx @@ -7,8 +7,8 @@ import { } from "@fluentui/react-components"; import { EyeOffRegular, EyeRegular } from "@fluentui/react-icons"; -import { PasswordInputProps } from "./password-input.types"; -import { usePasswordInputStyles } from "./password-input.styles"; +import { PasswordInputProps } from "./password-input.types.js"; +import { usePasswordInputStyles } from "./password-input.styles.js"; export const PasswordInput: ForwardRefComponent = React .forwardRef((props: PasswordInputProps, ref) => { diff --git a/hooks/package.json b/hooks/package.json index 2b56904f..78045b02 100644 --- a/hooks/package.json +++ b/hooks/package.json @@ -10,22 +10,18 @@ }, "license": "MIT", "author": "Axis Communications AB", + "type": "module", "exports": { ".": { "require": "./lib/cjs/index.js", "import": "./lib/index.js" } }, - "main": "lib/cjs/index.js", - "module": "lib/index.js", - "types": "lib/index.d.ts", "files": [ "lib" ], "scripts": { - "build": "pnpm build:cjs && pnpm build:esm", - "build:cjs": "tsc --module commonjs --outDir lib/cjs", - "build:esm": "tsc", + "build": "tsc", "check:unused-deps": "depcheck . --config=depcheck.yml", "lint": "tsc --noEmit && eslint . --cache" }, diff --git a/hooks/src/index.ts b/hooks/src/index.ts index 1fee6d06..c7dafce5 100644 --- a/hooks/src/index.ts +++ b/hooks/src/index.ts @@ -1,2 +1,2 @@ -export { useMediaQuery } from "./use-media-query"; -export { usePageController } from "./use-page-controller"; +export { useMediaQuery } from "./use-media-query.js"; +export { usePageController } from "./use-page-controller.js"; diff --git a/hooks/tsconfig.json b/hooks/tsconfig.json index 9572a8ba..dac9a6b0 100644 --- a/hooks/tsconfig.json +++ b/hooks/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { + "module": "nodenext", + "moduleResolution": "nodenext", "outDir": "lib" }, "include": ["src"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2867283a..e5833cde 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7288,7 +7288,7 @@ snapshots: debug: 4.3.7 enhanced-resolve: 5.17.1 eslint: 8.57.1 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 @@ -7301,7 +7301,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: @@ -7332,7 +7332,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3