Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to hookable package #24426

Merged
merged 3 commits into from Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/package.json
Expand Up @@ -29,7 +29,7 @@
"exit": "^0.1.2",
"fs-extra": "^10.1.0",
"globby": "^11.0.4",
"hable": "^3.0.0",
"hookable": "^4.4.1",
"lodash": "^4.17.21",
"minimist": "^1.2.8",
"opener": "1.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/command.js
Expand Up @@ -2,7 +2,7 @@
import path from 'path'
import consola from 'consola'
import minimist from 'minimist'
import Hookable from 'hable'
import Hookable from 'hookable'
import { name, version } from '../package.json'
import { forceExit } from './utils'
import { loadNuxtConfig } from './utils/config'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Expand Up @@ -16,7 +16,7 @@
"@nuxt/utils": "2.17.2",
"consola": "^3.2.3",
"fs-extra": "^10.1.0",
"hable": "^3.0.0",
"hookable": "^4.4.1",
"hash-sum": "^2.0.0",
"lodash": "^4.17.21"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/nuxt.js
@@ -1,7 +1,7 @@

import { isPlainObject } from 'lodash'
import consola from 'consola'
import Hookable from 'hable'
import Hookable from 'hookable'

import { defineAlias } from '@nuxt/utils'
import { getNuxtConfig } from '@nuxt/config'
Expand All @@ -23,6 +23,10 @@ export default class Nuxt extends Hookable {
this.resolver = new Resolver(this)
this.moduleContainer = new ModuleContainer(this)

// Add legacy methods for backwards compatibility
this.clearHooks = this.removeHooks.bind(this)
this.clearHook = this.removeHook.bind(this)

// Deprecated hooks
this.deprecateHooks({
// #3294 - 7514db73b25c23b8c14ebdafbb4e129ac282aabd
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/nuxt.test.js
@@ -1,7 +1,7 @@
import { defineAlias } from '@nuxt/utils'
import { getNuxtConfig } from '@nuxt/config'
import { Server } from '@nuxt/server'
import Hookable from 'hable'
import Hookable from 'hookable'

import Nuxt from '../src/nuxt'
import ModuleContainer from '../src/module'
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -7588,11 +7588,6 @@ gzip-size@^6.0.0:
dependencies:
duplexer "^0.1.2"

hable@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/hable/-/hable-3.0.0.tgz#6de089b2df946635cf8134b9e4859f1b62de255f"
integrity sha512-7+G0/2/COR8pwteYFqHIVYfQpuEiO2HXwJrhCBJVgrNrl9O5eaUoJVDGXUJX+0RpGncNVTuestexjk1afj01wQ==

handlebars@^4.7.7:
version "4.7.7"
resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
Expand Down Expand Up @@ -7770,6 +7765,11 @@ hmac-drbg@^1.0.1:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"

hookable@^4.4.1:
version "4.4.1"
resolved "https://registry.npmjs.org/hookable/-/hookable-4.4.1.tgz#3d7154ac7e1f6f147e50fef583832f2645b9f04f"
integrity sha512-KWjZM8C7IVT2qne5HTXjM6R6VnRfjfRlf/oCnHd+yFxoHO1DzOl6B9LzV/VqGQK/IrFewq+EG+ePVrE9Tpc3fg==

hosted-git-info@^2.1.4:
version "2.8.9"
resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
Expand Down