Skip to content

Commit

Permalink
chore: update to hexo 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ppoffice committed Feb 3, 2024
1 parent 7813b86 commit b1962d7
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, latest]
node-version: [14, latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion include/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ const fs = require('fs');
const path = require('path');
const util = require('util');
const crypto = require('crypto');
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const yaml = require('hexo-component-inferno/lib/util/yaml');
const { Migrator } = require('hexo-component-inferno/lib/core/migrate');
const { SchemaLoader } = require('hexo-component-inferno/lib/core/schema');
const { yellow } = require('./util/console');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

function loadThemeConfig(hexo, cfgPaths) {
const configs = cfgPaths.map(cfgPath => fs.readFileSync(cfgPath))
.map(cfgPath => yaml.parse(cfgPath));
Expand Down
4 changes: 3 additions & 1 deletion include/dependency.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* eslint no-process-exit: "off" */
const semver = require('semver');
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const packageInfo = require('../package.json');
const { yellow, red, green } = require('./util/console');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = hexo => {
function checkDependency(name, reqVer) {
try {
Expand Down
4 changes: 3 additions & 1 deletion include/migration/v2_v3.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const deepmerge = require('deepmerge');
const Migration = require('hexo-component-inferno/lib/core/migrate').Migration;

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = class extends Migration {
constructor() {
super('3.0.0', null);
Expand Down
4 changes: 3 additions & 1 deletion include/register.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = hexo => {
logger.info('=== Registering Hexo extensions ===');
Expand Down
4 changes: 3 additions & 1 deletion layout/common/comment.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = class extends Component {
render() {
const { config, page, helper } = this.props;
Expand Down
4 changes: 3 additions & 1 deletion layout/common/donates.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = class extends Component {
render() {
const { config, helper } = this.props;
Expand Down
4 changes: 3 additions & 1 deletion layout/common/plugins.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const { Component, Fragment } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = class extends Component {
render() {
const { site, config, page, helper, head } = this.props;
Expand Down
4 changes: 3 additions & 1 deletion layout/common/search.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = class extends Component {
render() {
const { config, helper } = this.props;
Expand Down
4 changes: 3 additions & 1 deletion layout/common/share.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

module.exports = class extends Component {
render() {
const { config, page, helper } = this.props;
Expand Down
4 changes: 3 additions & 1 deletion layout/common/widgets.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const logger = require('hexo-log')();
const createLogger = require('hexo-log');
const { Component } = require('inferno');
const view = require('hexo-component-inferno/lib/core/view');
const classname = require('hexo-component-inferno/lib/util/classname');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

function formatWidgets(widgets) {
const result = {};
if (Array.isArray(widgets)) {
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"url": "https://github.com/ppoffice/hexo-theme-icarus/issues"
},
"engines": {
"node": ">=12.4.0"
"node": ">=14"
},
"scripts": {
"lint": "eslint --ext .js --ext .jsx --ext .json ."
Expand All @@ -28,17 +28,17 @@
},
"dependencies": {
"bulma-stylus": "0.8.0",
"deepmerge": "^4.2.2",
"hexo": "^6.0.0",
"deepmerge": "^4.3.1",
"hexo": "^7.1.1",
"hexo-component-inferno": "^2.0.2",
"hexo-log": "^3.0.0",
"hexo-pagination": "^2.0.0",
"hexo-log": "^4.1.0",
"hexo-pagination": "^3.0.0",
"hexo-renderer-inferno": "^0.1.3",
"hexo-renderer-stylus": "^2.0.0",
"hexo-util": "^2.4.0",
"hexo-renderer-stylus": "^3.0.1",
"hexo-util": "^3.2.0",
"inferno": "^7.3.3",
"inferno-create-element": "^7.3.3",
"moment": "^2.22.2",
"semver": ">=5.0.0"
"moment": "^2.30.1",
"semver": "^7.5.4"
}
}
4 changes: 3 additions & 1 deletion scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* global hexo */
const logger = require('hexo-log')();
const createLogger = require('hexo-log');

const logger = typeof createLogger === "function" ? createLogger() : createLogger.default();

/**
* Print welcome message
Expand Down

0 comments on commit b1962d7

Please sign in to comment.