Skip to content

Commit

Permalink
chore: upgrade gridsome dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kriya committed Dec 17, 2023
1 parent e5ffd91 commit 7bc1b84
Show file tree
Hide file tree
Showing 20 changed files with 2,213 additions and 1,557 deletions.
15 changes: 4 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ module.exports = {
root: true,
extends: [
'plugin:node/recommended',
'plugin:vue-libs/recommended'
'plugin:vue/recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
env: {
jest: true
},
Expand All @@ -16,16 +19,6 @@ module.exports = {
rules: {
'node/no-unsupported-features/es-syntax': 'off'
}
},
{
files: [
'scripts/**/*.js',
'**/__tests__/**/*.js'
],
rules: {
'node/no-unpublished-require': 'off',
'node/no-extraneous-require': 'off'
}
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Gridsome sites are usually not connected to any database and can be hosted entir

## How to Contribute

Install [Node.js ^12.13.0 || ^14.0.0 || >=16.0.0](https://nodejs.org/en/download/) or higher and [Yarn classic](https://classic.yarnpkg.com/en/docs/install/).
Install [Node.js >=18.0.0](https://nodejs.org/en/download/) and [Yarn classic](https://classic.yarnpkg.com/en/docs/install/).

1. Clone this repository.
2. Create a new Gridsome project inside the `./projects` folder.
Expand Down
7 changes: 1 addition & 6 deletions gridsome/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
'plugin:import/errors',
'plugin:import/warnings'
],
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
allowImportExportEverywhere: true
},
env: {
jest: true,
node: true
Expand All @@ -21,7 +16,7 @@ module.exports = {
'semi': ['error', 'never'],
'no-console': 'off',
// Allow unresolved imports
'import/no-unresolved': 'off',
'import/no-unresolved': 'off'
},
overrides: [
{
Expand Down
4 changes: 2 additions & 2 deletions gridsome/lib/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class App {
const timer = hirestime()

const done = () => {
log(`${hook.label || hook.name} - ${timer(hirestime.S)}s`)
log(`${hook.label || hook.name} - ${timer.s()}s`)
if (callback) callback()
}

Expand All @@ -70,7 +70,7 @@ class App {

await this.hooks.bootstrap.promise()

log(`Bootstrap finish - ${timer(hirestime.S)}s`)
log(`Bootstrap finish - ${timer.s()}s`)

this.isBootstrapped = true

Expand Down
2 changes: 1 addition & 1 deletion gridsome/lib/app/build/executeQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function executeQueries (renderQueue, { context, pages, schema, graphql },
await fs.outputFile(entry.dataOutput, content)
}, { concurrency: sysinfo.cpus.physical })

log(`Execute GraphQL (${renderQueue.length} queries) - ${timer(hirestime.S)}s`)
log(`Execute GraphQL (${renderQueue.length} queries) - ${timer.s()}s`)
}

module.exports = executeQueries
2 changes: 1 addition & 1 deletion gridsome/lib/app/queue/FileProcessQueue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path')
const fs = require('fs-extra')
const md5File = require('md5-file/promise')
const md5File = require('md5-file')
const { forwardSlash } = require('../../utils')

class FileProcessQueue {
Expand Down
2 changes: 1 addition & 1 deletion gridsome/lib/app/queue/ImageProcessQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const sharp = require('sharp')
const crypto = require('crypto')
const mime = require('mime-types')
const colorString = require('color-string')
const md5File = require('md5-file/promise')
const md5File = require('md5-file')
const { forwardSlash } = require('../../utils')
const { reject, pickBy } = require('lodash')

Expand Down
10 changes: 5 additions & 5 deletions gridsome/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = async (context, args) => {

log()
logAllWarnings(app.context)
log(` Done in ${buildTime(hirestime.S)}s`)
log(` Done in ${buildTime.s()}s`)
log()

return app
Expand All @@ -64,7 +64,7 @@ async function runWebpack (app) {

const stats = await app.compiler.run()

log(`Compile assets - ${compileTime(hirestime.S)}s`)
log(`Compile assets - ${compileTime.s()}s`)

return stats
}
Expand Down Expand Up @@ -94,7 +94,7 @@ async function renderHTML (renderQueue, app, hash) {

worker.end()

log(`Render HTML (${renderQueue.length} files) - ${timer(hirestime.S)}s`)
log(`Render HTML (${renderQueue.length} files) - ${timer.s()}s`)
}

async function processFiles (files) {
Expand All @@ -105,7 +105,7 @@ async function processFiles (files) {
await fs.copy(file.filePath, file.destPath)
}

log(`Process files (${totalFiles} files) - ${timer(hirestime.S)}s`)
log(`Process files (${totalFiles} files) - ${timer.s()}s`)
}

async function processImages (images, config) {
Expand Down Expand Up @@ -143,7 +143,7 @@ async function processImages (images, config) {

worker.end()

writeLine(`Process images (${totalAssets} images) - ${timer(hirestime.S)}s\n`)
writeLine(`Process images (${totalAssets} images) - ${timer.s()}s\n`)

// Remove images that existed before this build started but isn't in use.
if (config.images.purge && existingImages.length) {
Expand Down
6 changes: 3 additions & 3 deletions gridsome/lib/graphql/extensions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ function addExtensionDirectives (schemaComposer, extensions, location) {
const extension = extensions[name]

const directive = new GraphQLDirective({
args: normalizeArgs(schemaComposer, extension.args),
name,
description: extension.description,
locations: [location],
name
args: normalizeArgs(schemaComposer, extension.args)
})

schemaComposer.addDirective(directive)
Expand Down Expand Up @@ -75,7 +75,7 @@ function applyFieldExtensions (typeComposer, customExtensions = {}) {
typeComposer.getFieldNames().forEach(fieldName => {
const directives = typeComposer
.getFieldDirectives(fieldName)
.filter(({ name }) => allFieldExtensions.hasOwnProperty(name))
.filter(({ name }) => Object.hasOwn(allFieldExtensions, name))

directives.forEach(({ name, args }) => {
const { apply } = allFieldExtensions[name] || {}
Expand Down
6 changes: 3 additions & 3 deletions gridsome/lib/graphql/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ exports.isRefFieldDefinition = function (field) {
return (
isPlainObject(field) &&
Object.keys(field).length === 2 &&
field.hasOwnProperty('typeName') &&
field.hasOwnProperty('isList')
Object.hasOwn(field, 'typeName') &&
Object.hasOwn(field, 'isList')
)
}

exports.isCreatedType = function (value) {
return isObject(value) && CreatedGraphQLType.hasOwnProperty(value.type)
return isObject(value) && Object.hasOwn(CreatedGraphQLType, value.type)
}

exports.createEnumType = options => ({ options, type: CreatedGraphQLType.Enum })
Expand Down
4 changes: 2 additions & 2 deletions gridsome/lib/plugins/TemplatesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const makePath = (object, { routeKeys, createPath }, dateField = 'date', slugify
const segments = values.map(value => {
if (
isPlainObject(value) &&
value.hasOwnProperty('typeName') &&
value.hasOwnProperty('id') &&
Object.hasOwn(value, 'typeName') &&
Object.hasOwn(value, 'id') &&
!Array.isArray(value.id)
) {
return String(value.id)
Expand Down
2 changes: 1 addition & 1 deletion gridsome/lib/store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Store {
addCollection (options, store) {
options = this.hooks.addCollection.call(options)

if (this.collections.hasOwnProperty(options.typeName)) {
if (Object.hasOwn(this.collections, options.typeName)) {
return this.getCollection(options.typeName)
}

Expand Down
2 changes: 1 addition & 1 deletion gridsome/lib/store/transformNodeContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function transformNodeContent (node, collection) {

// add transformer to content type to let it
// extend the node type when creating schema
if (mimeType && !_mimeTypes.hasOwnProperty(mimeType)) {
if (mimeType && !Object.hasOwn(_mimeTypes, mimeType)) {
_mimeTypes[mimeType] = transformer
}

Expand Down
4 changes: 2 additions & 2 deletions gridsome/lib/store/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ exports.isRefField = function (field) {
return (
isPlainObject(field) &&
Object.keys(field).length === 2 &&
field.hasOwnProperty('typeName') &&
field.hasOwnProperty('id')
Object.hasOwn(field, 'typeName') &&
Object.hasOwn(field, 'id')
)
}

Expand Down
58 changes: 29 additions & 29 deletions gridsome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,40 @@
"blog"
],
"dependencies": {
"@babel/code-frame": "^7.22.10",
"@babel/core": "^7.22.10",
"@babel/code-frame": "^7.23.5",
"@babel/core": "^7.23.6",
"@hapi/joi": "^15.1.1",
"@kriya/gridsome-cli": "^0.3.5-2",
"@kriya/gridsome-cli": "^0.3.6",
"@sindresorhus/slugify": "^1.1.2",
"@soda/friendly-errors-webpack-plugin": "^1.8.1",
"@vue/babel-preset-app": "^5.0.8",
"auto-bind": "^2.1.1",
"autoprefixer": "^9.8.8",
"babel-loader": "^8.3.0",
"autoprefixer": "^10.4.16",
"babel-loader": "^9.1.3",
"camelcase": "^5.3.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"chalk": "^2.4.2",
"chokidar": "^3.5.3",
"color-string": "^1.9.1",
"columnify": "^1.6.0",
"core-js": "^3.32.1",
"css-loader": "^5.2.7",
"css-minimizer-webpack-plugin": "^3.4.1",
"core-js": "^3.34.0",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"dotenv": "^6.2.0",
"enhanced-resolve": "^5.15.0",
"esbuild": "^0.19.2",
"esbuild": "^0.19.9",
"esbuild-loader": "^2.21.0",
"eventemitter3": "^3.1.2",
"eventemitter3": "^5.0.1",
"express": "^4.18.2",
"fastest-levenshtein": "^1.0.16",
"fs-extra": "^11.1.1",
"globby": "^9.2.0",
"fs-extra": "^11.2.0",
"globby": "~11.0.4",
"graphql-compose": "^9.0.10",
"graphql-http": "^1.21.0",
"graphql-http": "^1.22.0",
"graphql-playground-middleware-express": "^1.7.23",
"hash-sum": "^2.0.0",
"hirestime": "^3.2.2",
"html-webpack-plugin": "^5.5.3",
"hirestime": "^7.0.3",
"html-webpack-plugin": "^5.5.4",
"invariant": "^2.2.4",
"is-relative": "^1.0.0",
"is-url": "^1.2.4",
Expand All @@ -64,36 +64,36 @@
"lodash": "^4.17.21",
"lokijs": "^1.5.12",
"lru-cache": "^5.1.1",
"md5-file": "^4.0.0",
"md5-file": "^5.0.0",
"mime-types": "^2.1.35",
"mini-css-extract-plugin": "^1.6.2",
"mini-css-extract-plugin": "~1.6.2",
"moment": "^2.29.4",
"p-map": "^2.1.0",
"path-to-regexp": "^2.4.0",
"physical-cpu-count": "^2.0.0",
"portfinder": "^1.0.32",
"postcss": "^8.4.28",
"postcss-loader": "^6.2.1",
"postcss": "^8.4.32",
"postcss-loader": "^7.3.3",
"potrace": "^2.1.8",
"probe-image-size": "^4.1.1",
"probe-image-size": "^7.2.3",
"process": "^0.11.10",
"sharp": "^0.32.5",
"slash": "^2.0.0",
"sharp": "^0.32.6 ",
"slash": "~3.0.0",
"sockjs": "^0.3.24",
"sockjs-client": "^1.6.1",
"stack-trace": "^0.0.10",
"svgo": "^2.8.0",
"svgo": "^3.1.0",
"tapable": "^2.2.1",
"vue": "^2.7.14",
"vue-loader": "^15.10.2",
"vue": "~2.7.15",
"vue-loader": "~16.8.3",
"vue-meta": "^2.4.0",
"vue-router": "^3.6.5",
"vue-server-renderer": "^2.7.14",
"vue-router": "~3.6.5",
"vue-server-renderer": "^2.7.15",
"vue-style-loader": "^4.1.3",
"webpack": "^5.88.2",
"webpack": "^5.89.0",
"webpack-chain": "^6.5.1",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0",
"webpack-merge": "^5.10.0",
"yaml-loader": "^0.8.0"
},
"peerDependencies": {
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
"devDependencies": {
"@lerna/conventional-commits": "^3.22.0",
"babel-eslint": "^10.0.1",
"cheerio": "^1.0.0-rc.2",
"cheerio": "^1.0.0-rc.12",
"conventional-changelog": "^3.1.21",
"eslint": "^5.2.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-vue": "^9.3.0",
"eslint-plugin-vue-libs": "^3.0.0",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-vue": "^9.19.2",
"execa": "^6.0.0",
"jest": "^27.5.1",
"lerna": "^7.1.5",
"minimist": "^1.2.0",
"puppeteer": "^13.1.3",
"supertest": "^6.2.2"
"jest": "~27.5.1",
"lerna": "^8.0.1",
"minimist": "^1.2.8",
"puppeteer": "^19.11.1",
"supertest": "^6.3.3"
},
"engines": {
"node": ">=18",
Expand Down
3 changes: 1 addition & 2 deletions packages/plugin-robots/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fs = require('fs-extra')
const robotsTxt = require('generate-robotstxt')
const path = require('path')
const url = require('url')

const defaultEnv = 'development'

Expand Down Expand Up @@ -54,7 +53,7 @@ function RobotsPlugin (api, options) {
!Object.prototype.hasOwnProperty.call(userOptions, 'sitemap')
) {
userOptions.host = config.siteUrl || config.url
userOptions.sitemap = url.resolve(config.siteUrl, 'sitemap.xml')
userOptions.sitemap = new URL('sitemap.xml', config.siteUrl).href
}

const { policy, sitemap, host, output, configFile } = userOptions
Expand Down
10 changes: 9 additions & 1 deletion packages/vue-remark/src/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ module.exports = {
'quotes': ['error', 'single', { allowTemplateLiterals: true }],
'comma-dangle': ['error', 'never'],
'semi': ['error', 'never']
}
},
overrides: [
{
files: ['.eslintrc.js'],
rules: {
'no-undef': 'off'
}
}
]
}
Loading

0 comments on commit 7bc1b84

Please sign in to comment.