Skip to content

Commit

Permalink
feat!: move to ESM only (#3118)
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin authored Sep 21, 2024
1 parent 98897f4 commit eb31e71
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 41 deletions.
21 changes: 6 additions & 15 deletions internals.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
declare module '#build/i18n.options.mjs' {
import type { DeepRequired } from 'ts-essentials'
/**
* stub type definition for @nuxtjs/i18n internally
*/
import type { LocaleObject, NuxtI18nOptions, VueI18nConfig } from '@nuxtjs/i18n'

type VueI18nConfig = import('./dist/types').VueI18nConfig
type NuxtI18nOptions = import('./dist/types').NuxtI18nOptions
type LocaleObject = import('./dist/types').LocaleObject
export type { LocaleObject }

type LocaleLoader = {
key: string
Expand All @@ -33,14 +29,7 @@ declare module '#build/i18n.options.mjs' {

declare module '#internal/i18n/options.mjs' {
import type { DeepRequired } from 'ts-essentials'

type VueI18nConfig = import('./dist/types').VueI18nConfig
type NuxtI18nOptions = import('./dist/types').NuxtI18nOptions
type LocaleObject = import('./dist/types').LocaleObject

/**
* stub type definition for @nuxtjs/i18n internally
*/
import type { LocaleObject, NuxtI18nOptions, VueI18nConfig } from '@nuxtjs/i18n'

type LocaleLoader = {
key: string
Expand All @@ -66,7 +55,9 @@ declare module '#internal/i18n/options.mjs' {
}

declare module '#internal/i18n/locale.detector.mjs' {
export const localeDetector: import('./dist/runtime/composables/server').LocaleDetector
import type { LocaleDetector } from '@nuxtjs/i18n/dist/runtime/composables/server'

export const localeDetector: LocaleDetector
}

declare module 'virtual:nuxt-i18n-logger' {
Expand Down
47 changes: 21 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"name": "@nuxtjs/i18n",
"description": "Internationalization for Nuxt",
"keywords": [
"nuxt",
"i18n",
"internationalization",
"nuxt-module"
],
"type": "module",
"version": "9.0.0-alpha.3",
"homepage": "https://i18n.nuxtjs.org",
"bugs": {
"url": "https://github.com/nuxt-modules/i18n/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nuxt-modules/i18n.git"
},
"license": "MIT",
"packageManager": "[email protected]",
"description": "Internationalization for Nuxt",
"contributors": [
{
"name": "Paul Gascou-Vaillancourt (@paulgv)"
Expand All @@ -31,24 +18,33 @@
"name": "Bobbie Goede (@BobbieGoede)"
}
],
"license": "MIT",
"homepage": "https://i18n.nuxtjs.org",
"repository": {
"type": "git",
"url": "git+https://github.com/nuxt-modules/i18n.git"
},
"bugs": {
"url": "https://github.com/nuxt-modules/i18n/issues"
},
"keywords": [
"nuxt",
"i18n",
"internationalization",
"nuxt-module"
],
"exports": {
".": {
"import": "./dist/module.mjs",
"require": "./dist/module.cjs",
"types": "./dist/types.d.ts"
},
"./internals": {
"types": "./internals.d.ts"
"types": "./dist/types.d.mts",
"import": "./dist/module.mjs"
},
"./package.json": "./package.json"
},
"imports": {
"#i18n": "./dist/runtime/composables/index.js"
},
"main": "./dist/module.cjs",
"module": "./dist/module.mjs",
"main": "./dist/module.mjs",
"types": "./dist/types.d.ts",
"type": "module",
"files": [
"dist",
"internals.d.ts"
Expand Down Expand Up @@ -81,7 +77,6 @@
"test:unit": "vitest run test",
"test:spec": "vitest run specs"
},
"packageManager": "[email protected]",
"pnpm": {
"overrides": {
"@nuxtjs/i18n": "link:.",
Expand Down

0 comments on commit eb31e71

Please sign in to comment.