Skip to content

Commit 985929d

Browse files
committed
chore(core): update package versions and file extensions to .mts
Updated `version` to `1.0.19` in `packages/core/package.json` and `1.0.7` in `packages/test-utils/package.json`. Changed main, types, and exports file extensions from `.d.ts` and `.cjs` to `.d.mts` and `.mjs` respectively for better compatibility with ES modules. Added `build.config.ts` for improved build configuration.
1 parent 905bbe5 commit 985929d

11 files changed

Lines changed: 463 additions & 1226 deletions

File tree

build.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5+
// @ts-ignore
6+
rollupOptions: {
7+
// for example, if you wish to continue to generate `.cjs` output
8+
emitCJS: true,
9+
},
10+
})
File renamed without changes.

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,25 @@
2828
},
2929
"exports": {
3030
".": {
31-
"types": "./dist/types.d.ts",
31+
"types": "./dist/types.d.mts",
3232
"default": "./dist/module.mjs"
3333
},
34-
"./utils": "./dist/utils.mjs"
34+
"./internals": "./internals.d.mts"
3535
},
36-
"main": "./dist/module.cjs",
36+
"main": "./dist/module.mjs",
3737
"typesVersions": {
3838
"*": {
39-
"*": [
40-
"./dist/*",
41-
"./*"
39+
".": [
40+
"./dist/types.d.mts"
41+
],
42+
"internals": [
43+
"./internals.d.mts"
4244
]
4345
}
4446
},
4547
"files": [
4648
"dist",
47-
"internals.d.ts"
49+
"internals.d.mts"
4850
],
4951
"scripts": {
5052
"prepack": "pnpm --filter \"./packages/**\" run build && nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && pnpm run client:build",
@@ -93,7 +95,7 @@
9395
"@nuxt/devtools": "^2.6.3",
9496
"@nuxt/devtools-ui-kit": "^2.6.3",
9597
"@nuxt/eslint-config": "^1.9.0",
96-
"@nuxt/module-builder": "^0.8.4",
98+
"@nuxt/module-builder": "^1.0.0",
9799
"@nuxt/schema": "^3.18.1 || ^4.0.0",
98100
"@nuxt/test-utils": "^3.19.2",
99101
"@playwright/test": "^1.55.0",

packages/core/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxt-i18n-micro-core",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"description": "",
55
"repository": "s00d/nuxt-i18n-micro",
66
"license": "MIT",
@@ -14,9 +14,14 @@
1414
"bugs": {
1515
"url": "https://github.com/s00d/nuxt-i18n-micro/issues"
1616
},
17-
"main": "dist/index.cjs",
18-
"module": "dist/index.mjs",
19-
"types": "dist/index.d.ts",
17+
"main": "dist/index.mjs",
18+
"types": "dist/index.d.mts",
19+
"exports": {
20+
".": {
21+
"types": "./dist/index.d.mts",
22+
"default": "./dist/index.mjs"
23+
}
24+
},
2025
"scripts": {
2126
"build": "vite build",
2227
"test": "jest",

packages/core/vite.config.mts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default defineConfig({
99
lib: {
1010
entry: resolve(__dirname, 'src/index.ts'),
1111
name: 'nuxt-i18n-micro-core',
12-
formats: ['cjs', 'es'],
13-
fileName: format => `index.${format === 'cjs' ? 'cjs' : 'mjs'}`,
12+
formats: ['es'],
13+
fileName: _format => `index.mjs`,
1414
},
1515
rollupOptions: {
1616
external: ['vue'],
@@ -20,6 +20,11 @@ export default defineConfig({
2020
},
2121
},
2222
plugins: [
23-
dts(),
23+
dts({
24+
outDir: 'dist',
25+
tsConfigPath: './tsconfig.json',
26+
insertTypesEntry: true,
27+
rollupTypes: true,
28+
}),
2429
],
2530
})

packages/test-utils/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxt-i18n-micro-test-utils",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "",
55
"repository": "s00d/nuxt-i18n-micro",
66
"license": "MIT",
@@ -14,9 +14,14 @@
1414
"bugs": {
1515
"url": "https://github.com/s00d/nuxt-i18n-micro/issues"
1616
},
17-
"main": "dist/index.cjs",
18-
"module": "dist/index.mjs",
19-
"types": "dist/index.d.ts",
17+
"main": "dist/index.mjs",
18+
"types": "dist/index.d.mts",
19+
"exports": {
20+
".": {
21+
"types": "./dist/index.d.mts",
22+
"default": "./dist/index.mjs"
23+
}
24+
},
2025
"scripts": {
2126
"build": "vite build",
2227
"test": "jest",

packages/test-utils/vite.config.mts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default defineConfig({
99
lib: {
1010
entry: resolve(__dirname, 'src/index.ts'),
1111
name: 'nuxt-i18n-micro-test-utils',
12-
formats: ['cjs', 'es'],
13-
fileName: format => `index.${format === 'cjs' ? 'cjs' : 'mjs'}`,
12+
formats: ['es'],
13+
fileName: _format => `index.mjs`,
1414
},
1515
rollupOptions: {
1616
external: ['vue'],
@@ -20,6 +20,14 @@ export default defineConfig({
2020
},
2121
},
2222
plugins: [
23-
dts(),
23+
dts({
24+
outDir: 'dist',
25+
tsConfigPath: './tsconfig.json',
26+
insertTypesEntry: true,
27+
rollupTypes: true,
28+
copyDtsFiles: false,
29+
skipDiagnostics: false,
30+
logLevel: 'info',
31+
}),
2432
],
2533
})

packages/types/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414
"bugs": {
1515
"url": "https://github.com/s00d/nuxt-i18n-micro/issues"
1616
},
17-
"main": "dist/index.cjs",
18-
"module": "dist/index.mjs",
19-
"types": "dist/index.d.ts",
17+
"main": "dist/index.mjs",
18+
"types": "dist/index.d.mts",
19+
"exports": {
20+
".": {
21+
"types": "./dist/index.d.mts",
22+
"default": "./dist/index.mjs"
23+
}
24+
},
2025
"scripts": {
2126
"build": "vite build",
2227
"test": "echo \"Error: no test specified\"",

packages/types/vite.config.mts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default defineConfig({
88
build: {
99
lib: {
1010
entry: resolve(__dirname, 'src/index.ts'),
11-
name: 'nuxt-i18n-micro-core',
12-
formats: ['cjs', 'es'],
13-
fileName: format => `index.${format === 'cjs' ? 'cjs' : 'mjs'}`,
11+
name: 'nuxt-i18n-micro-types',
12+
formats: ['es'],
13+
fileName: _format => `index.mjs`,
1414
},
1515
rollupOptions: {
1616
external: ['vue'],
@@ -20,6 +20,11 @@ export default defineConfig({
2020
},
2121
},
2222
plugins: [
23-
dts(),
23+
dts({
24+
outDir: 'dist',
25+
tsConfigPath: './tsconfig.json',
26+
insertTypesEntry: true,
27+
rollupTypes: true,
28+
}),
2429
],
2530
})

0 commit comments

Comments
 (0)