Skip to content

Commit

Permalink
fix: optimize tree-shakoing-for-devtools-pkgs (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon authored Sep 8, 2023
1 parent 2c7b358 commit f2e38ac
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
6 changes: 4 additions & 2 deletions packages/core-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
"jsdelivr": "dist/core-base.global.js",
"types": "dist/core-base.d.ts",
"dependencies": {
"@intlify/devtools-if": "workspace:*",
"@intlify/message-compiler": "workspace:*",
"@intlify/shared": "workspace:*",
"@intlify/shared": "workspace:*"
},
"devDependencies": {
"@intlify/devtools-if": "workspace:*",
"@intlify/vue-devtools": "workspace:*"
},
"engines": {
Expand Down
16 changes: 8 additions & 8 deletions packages/devtools-if/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ export interface IntlifyRecord {
types: Record<string, string | Symbol> // TODO
}

export const IntlifyDevToolsHooks = /* #__PURE__*/ {
I18nInit: 'i18n:init',
FunctionTranslate: 'function:translate'
} as const
export const enum IntlifyDevToolsHooks {
I18nInit = 'i18n:init',
FunctionTranslate = 'function:translate'
}

export type AdditionalPayloads = {
meta?: Record<string, unknown>
}

export type IntlifyDevToolsHooks =
(typeof IntlifyDevToolsHooks)[keyof typeof IntlifyDevToolsHooks]
// export type IntlifyDevToolsHooks =
// (typeof IntlifyDevToolsHooks)[keyof typeof IntlifyDevToolsHooks]

export type IntlifyDevToolsHookPayloads = {
[IntlifyDevToolsHooks.I18nInit]: {
Expand All @@ -35,8 +35,8 @@ export type IntlifyDevToolsHookPayloads = {
}

export type IntlifyDevToolsEmitterHooks = {
[IntlifyDevToolsHooks.I18nInit]: IntlifyDevToolsHookPayloads[typeof IntlifyDevToolsHooks.I18nInit]
[IntlifyDevToolsHooks.FunctionTranslate]: IntlifyDevToolsHookPayloads[typeof IntlifyDevToolsHooks.FunctionTranslate]
[IntlifyDevToolsHooks.I18nInit]: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks.I18nInit]
[IntlifyDevToolsHooks.FunctionTranslate]: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks.FunctionTranslate]
}

export type IntlifyDevToolsEmitter = Emittable<IntlifyDevToolsEmitterHooks>
2 changes: 1 addition & 1 deletion packages/vue-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"dependencies": {
"@intlify/core-base": "workspace:*",
"@intlify/shared": "workspace:*",
"@intlify/vue-devtools": "workspace:*",
"@vue/devtools-api": "^6.5.0"
},
"devDependencies": {
"@intlify/vue-devtools": "workspace:*",
"@intlify/devtools-if": "workspace:*"
},
"peerDependencies": {
Expand Down
24 changes: 15 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f2e38ac

Please sign in to comment.