fix: correct the import of some hexo dependencies

pull/1271/head
ppoffice 2024-02-03 00:44:33 -08:00
parent 6f4ef15673
commit 0efbb3fe38
No known key found for this signature in database
GPG Key ID: D872802C1F2A16AA
14 changed files with 14 additions and 14 deletions

View File

@ -9,7 +9,7 @@ const { Migrator } = require('hexo-component-inferno/lib/core/migrate');
const { SchemaLoader } = require('hexo-component-inferno/lib/core/schema'); const { SchemaLoader } = require('hexo-component-inferno/lib/core/schema');
const { yellow } = require('./util/console'); const { yellow } = require('./util/console');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
function loadThemeConfig(hexo, cfgPaths) { function loadThemeConfig(hexo, cfgPaths) {
const configs = cfgPaths.map(cfgPath => fs.readFileSync(cfgPath)) const configs = cfgPaths.map(cfgPath => fs.readFileSync(cfgPath))

View File

@ -4,7 +4,7 @@ const createLogger = require('hexo-log');
const packageInfo = require('../package.json'); const packageInfo = require('../package.json');
const { yellow, red, green } = require('./util/console'); const { yellow, red, green } = require('./util/console');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = hexo => { module.exports = hexo => {
function checkDependency(name, reqVer) { function checkDependency(name, reqVer) {

View File

@ -2,7 +2,7 @@ const createLogger = require('hexo-log');
const deepmerge = require('deepmerge'); const deepmerge = require('deepmerge');
const Migration = require('hexo-component-inferno/lib/core/migrate').Migration; const Migration = require('hexo-component-inferno/lib/core/migrate').Migration;
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = class extends Migration { module.exports = class extends Migration {
constructor() { constructor() {

View File

@ -1,6 +1,6 @@
const createLogger = require('hexo-log'); const createLogger = require('hexo-log');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = hexo => { module.exports = hexo => {
logger.info('=== Registering Hexo extensions ==='); logger.info('=== Registering Hexo extensions ===');

View File

@ -1,6 +1,6 @@
const moment = require('moment'); const moment = require('moment');
const { Component, Fragment } = require('inferno'); const { Component, Fragment } = require('inferno');
const { toMomentLocale } = require('hexo/lib/plugins/helper/date'); const { toMomentLocale } = require('hexo/dist/plugins/helper/date');
const Paginator = require('hexo-component-inferno/lib/view/misc/paginator'); const Paginator = require('hexo-component-inferno/lib/view/misc/paginator');
const ArticleMedia = require('hexo-component-inferno/lib/view/common/article_media'); const ArticleMedia = require('hexo-component-inferno/lib/view/common/article_media');

View File

@ -1,6 +1,6 @@
const moment = require('moment'); const moment = require('moment');
const { Component, Fragment } = require('inferno'); const { Component, Fragment } = require('inferno');
const { toMomentLocale } = require('hexo/lib/plugins/helper/date'); const { toMomentLocale } = require('hexo/dist/plugins/helper/date');
const Share = require('./share'); const Share = require('./share');
const Donates = require('./donates'); const Donates = require('./donates');
const Comment = require('./comment'); const Comment = require('./comment');

View File

@ -2,7 +2,7 @@ const createLogger = require('hexo-log');
const { Component } = require('inferno'); const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view'); const view = require('hexo-component-inferno/lib/core/view');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = class extends Component { module.exports = class extends Component {
render() { render() {

View File

@ -2,7 +2,7 @@ const createLogger = require('hexo-log');
const { Component } = require('inferno'); const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view'); const view = require('hexo-component-inferno/lib/core/view');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = class extends Component { module.exports = class extends Component {
render() { render() {

View File

@ -2,7 +2,7 @@ const createLogger = require('hexo-log');
const { Component, Fragment } = require('inferno'); const { Component, Fragment } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view'); const view = require('hexo-component-inferno/lib/core/view');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = class extends Component { module.exports = class extends Component {
render() { render() {

View File

@ -1,5 +1,5 @@
const { Component, Fragment } = require('inferno'); const { Component, Fragment } = require('inferno');
const { toMomentLocale } = require('hexo/lib/plugins/helper/date'); const { toMomentLocale } = require('hexo/dist/plugins/helper/date');
const Plugins = require('./plugins'); const Plugins = require('./plugins');
module.exports = class extends Component { module.exports = class extends Component {

View File

@ -2,7 +2,7 @@ const createLogger = require('hexo-log');
const { Component } = require('inferno'); const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view'); const view = require('hexo-component-inferno/lib/core/view');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = class extends Component { module.exports = class extends Component {
render() { render() {

View File

@ -2,7 +2,7 @@ const createLogger = require('hexo-log');
const { Component } = require('inferno'); const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view'); const view = require('hexo-component-inferno/lib/core/view');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
module.exports = class extends Component { module.exports = class extends Component {
render() { render() {

View File

@ -3,7 +3,7 @@ const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view'); const view = require('hexo-component-inferno/lib/core/view');
const classname = require('hexo-component-inferno/lib/util/classname'); const classname = require('hexo-component-inferno/lib/util/classname');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
function formatWidgets(widgets) { function formatWidgets(widgets) {
const result = {}; const result = {};

View File

@ -1,7 +1,7 @@
/* global hexo */ /* global hexo */
const createLogger = require('hexo-log'); const createLogger = require('hexo-log');
const logger = typeof createLogger === 'function' ? createLogger() : createLogger.default(); const logger = createLogger.default();
/** /**
* Print welcome message * Print welcome message