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

v2.14.7 #8195

Merged
merged 27 commits into from
Oct 15, 2020
Merged

v2.14.7 #8195

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d7a8548
chore(deps): update all non-major dependencies (#8101)
renovate[bot] Sep 28, 2020
3aa02cf
chore(deps): update all non-major dependencies (#8131)
renovate[bot] Sep 30, 2020
79440f3
fix(vue-app): scrollRestoration hasn't set (#8055)
Kolobok12309 Sep 30, 2020
8abdc17
fix(vue-app): use mixin to provide `this.$nuxt` (#8068)
danielroe Sep 30, 2020
afc2e2a
chore(deps): lock file maintenance (#8126)
renovate[bot] Sep 30, 2020
61e93d0
Revert "fix(vue-app): use mixin to provide `this.$nuxt` (#8068)"
clarkdo Sep 30, 2020
dfaa196
chore(example): remove usage of axios in layout-transitions
Atinux Oct 6, 2020
34f3211
fix(generator): handle when no `routes.json` defined (#8166)
Atinux Oct 8, 2020
202f355
fix(cli): mode deprecation with explicit spa or universal flag (#8134)
clarkdo Oct 8, 2020
f0c1375
chore(deps): update all non-major dependencies (#8137)
renovate[bot] Oct 8, 2020
1b1ef37
chore(deps): update dependency upath to v2 (#8157)
renovate[bot] Oct 8, 2020
05353fc
chore(deps): lock file maintenance (#8147)
renovate[bot] Oct 8, 2020
81030be
fix(types): make `NuxtConfig` an interface (#8169)
danielroe Oct 9, 2020
00c9dc3
chore(deps): update dependency @types/node to ^12.12.67 (#8171)
renovate[bot] Oct 9, 2020
a748cf0
fix(types): add type for `serverMiddleware` object format (#8182)
danielroe Oct 10, 2020
a52b5af
chore(deps): lock file maintenance (#8191)
renovate[bot] Oct 13, 2020
9c4dac3
fix(vue-app): use getter to provide `this.$nuxt` (#8170)
danielroe Oct 13, 2020
5b87d1c
chore(deps): update all non-major dependencies (#8177)
renovate[bot] Oct 13, 2020
819afcd
fix(cli): avoid error about `nuxt-edge` if installed in parent `node_…
pi0 Oct 13, 2020
b533877
chore(deps): update all non-major dependencies (#8197)
renovate[bot] Oct 13, 2020
7e1ecfe
chore: update yarn.lock
pi0 Oct 13, 2020
5842a64
chore(deps): update dependency @nuxt/opencollective to ^0.3.2 (#8201)
renovate[bot] Oct 13, 2020
d9f4822
fix(cli): rebuild if process.env changes in nuxt.config (#8200)
pi0 Oct 14, 2020
c75ac80
fix(babel-preset-app): always transpile optional chaining and nullish…
pi0 Oct 14, 2020
044d07c
chore(deps): update all non-major dependencies to ^7.12.0 (#8207)
renovate[bot] Oct 15, 2020
7e7190b
fix: add better logs for DX with target option (#8206)
Atinux Oct 15, 2020
265d0e7
v2.14.7
pi0 Oct 15, 2020
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
8 changes: 4 additions & 4 deletions distributions/nuxt-start/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-start",
"version": "2.14.6",
"version": "2.14.7",
"description": "Starts Nuxt.js Application in production mode",
"keywords": [
"nuxt",
Expand Down Expand Up @@ -55,15 +55,15 @@
"dist"
],
"dependencies": {
"@nuxt/cli": "2.14.6",
"@nuxt/core": "2.14.6",
"@nuxt/cli": "2.14.7",
"@nuxt/core": "2.14.7",
"@nuxt/telemetry": "^1.2.3",
"node-fetch": "^2.6.1",
"vue": "^2.6.12",
"vue-client-only": "^2.0.0",
"vue-meta": "^2.4.0",
"vue-no-ssr": "^1.1.1",
"vue-router": "^3.4.3",
"vue-router": "^3.4.6",
"vuex": "^3.5.1"
},
"engines": {
Expand Down
14 changes: 7 additions & 7 deletions distributions/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt",
"version": "2.14.6",
"version": "2.14.7",
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
"keywords": [
"nuxt",
Expand Down Expand Up @@ -58,16 +58,16 @@
"postinstall": "opencollective || exit 0"
},
"dependencies": {
"@nuxt/builder": "2.14.6",
"@nuxt/cli": "2.14.6",
"@nuxt/builder": "2.14.7",
"@nuxt/cli": "2.14.7",
"@nuxt/components": "^1.1.0",
"@nuxt/core": "2.14.6",
"@nuxt/generator": "2.14.6",
"@nuxt/core": "2.14.7",
"@nuxt/generator": "2.14.7",
"@nuxt/loading-screen": "^2.0.2",
"@nuxt/opencollective": "^0.3.0",
"@nuxt/opencollective": "^0.3.2",
"@nuxt/static": "^1.0.0",
"@nuxt/telemetry": "^1.2.3",
"@nuxt/webpack": "2.14.6"
"@nuxt/webpack": "2.14.7"
},
"engines": {
"node": ">=8.9.0",
Expand Down
1 change: 0 additions & 1 deletion examples/layout-transitions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "example-layout-transitions",
"dependencies": {
"axios": "^0.19.0",
"nuxt": "latest"
},
"scripts": {
Expand Down
6 changes: 2 additions & 4 deletions examples/layout-transitions/pages/users-2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
</template>

<script>
import axios from 'axios'

export default {
async asyncData ({ query }) {
const page = +(query.page || 1)
const { data } = await axios.get(`https://reqres.in/api/users?page=${page}`)
const data = await fetch(`https://reqres.in/api/users?page=${page}`).then(res => res.json())
return {
page,
totalPages: data.total_pages,
Expand All @@ -50,7 +48,7 @@ export default {
watch: {
async '$route.query.page' (page) {
this.$nuxt.$loading.start()
const { data } = await axios.get(`https://reqres.in/api/users?page=${page}`)
const data = await fetch(`https://reqres.in/api/users?page=${page}`).then(res => res.json())
this.users = data.data
this.transitionName = this.getTransitionName(page)
this.page = +(page || 1)
Expand Down
4 changes: 1 addition & 3 deletions examples/layout-transitions/pages/users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
</template>

<script>
import axios from 'axios'

export default {
// Watch for $route.query.page to call Component methods (asyncData, fetch, validate, layout, etc.)
watchQuery: ['page'],
Expand All @@ -42,7 +40,7 @@ export default {
},
async asyncData ({ query }) {
const page = +(query.page || 1)
const { data } = await axios.get(`https://reqres.in/api/users?page=${page}`)
const data = await fetch(`https://reqres.in/api/users?page=${page}`).then(res => res.json())
return {
page,
totalPages: data.total_pages,
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.14.6",
"version": "2.14.7",
"npmClient": "yarn",
"useWorkspaces": true,
"conventionalCommits": true,
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"test:unit": "jest packages --forceExit"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/core": "^7.12.0",
"@babel/preset-env": "^7.12.0",
"@ls-lint/ls-lint": "^1.9.2",
"@nuxtjs/eslint-config": "^3.1.0",
"@rollup/plugin-alias": "^3.1.1",
Expand All @@ -45,11 +45,11 @@
"@vue/server-test-utils": "^1.1.0",
"@vue/test-utils": "^1.1.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0",
"babel-jest": "^26.5.2",
"consola": "^2.15.0",
"create-require": "^1.0.2",
"cross-spawn": "^7.0.3",
"eslint": "^7.9.0",
"eslint": "^7.11.0",
"eslint-multiplexer": "^2.0.0",
"esm": "^3.2.25",
"execa": "^3.4.0",
Expand All @@ -61,18 +61,18 @@
"got": "^11.7.0",
"improved-yarn-audit": "^2.3.1",
"is-wsl": "^2.2.0",
"jest": "^26.4.2",
"jest": "^26.5.3",
"jiti": "^0.1.11",
"jsdom": "^16.4.0",
"klaw-sync": "^6.0.0",
"lerna": "^3.22.1",
"lodash": "^4.17.20",
"node-fetch": "^2.6.1",
"node-sass": "^4.14.1",
"puppeteer-core": "^5.3.0",
"puppeteer-core": "^5.3.1",
"request": "^2.88.2",
"rimraf": "^3.0.2",
"rollup": "2.28.1",
"rollup": "2.30.0",
"rollup-plugin-license": "^2.2.0",
"sass-loader": "^8.0.2",
"sort-package-json": "^1.46.0",
Expand Down
14 changes: 8 additions & 6 deletions packages/babel-preset-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/babel-preset-app",
"version": "2.14.6",
"version": "2.14.7",
"description": "babel-preset-app for nuxt.js",
"repository": "nuxt/nuxt.js",
"license": "MIT",
Expand All @@ -10,13 +10,15 @@
],
"main": "src/index.js",
"dependencies": {
"@babel/core": "^7.11.6",
"@babel/helper-compilation-targets": "^7.10.4",
"@babel/core": "^7.12.0",
"@babel/helper-compilation-targets": "^7.12.0",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-decorators": "^7.10.5",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"@babel/runtime": "^7.11.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.0",
"@babel/plugin-proposal-optional-chaining": "^7.12.0",
"@babel/plugin-transform-runtime": "^7.12.0",
"@babel/preset-env": "^7.12.0",
"@babel/runtime": "^7.12.0",
"@vue/babel-preset-jsx": "^1.1.2",
"core-js": "^2.6.5"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/babel-preset-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ module.exports = (api, options = {}) => {
absoluteRuntime
}])

// https://github.com/nuxt/nuxt.js/issues/7722
if (envName === 'server') {
plugins.push(require('@babel/plugin-proposal-optional-chaining'))
plugins.push(require('@babel/plugin-proposal-nullish-coalescing-operator'))
}

return {
sourceType: 'unambiguous',
presets,
Expand Down
12 changes: 6 additions & 6 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/builder",
"version": "2.14.6",
"version": "2.14.7",
"repository": "nuxt/nuxt.js",
"license": "MIT",
"main": "dist/builder.js",
Expand All @@ -9,11 +9,11 @@
],
"dependencies": {
"@nuxt/devalue": "^1.2.4",
"@nuxt/utils": "2.14.6",
"@nuxt/vue-app": "2.14.6",
"@nuxt/webpack": "2.14.6",
"@nuxt/utils": "2.14.7",
"@nuxt/vue-app": "2.14.7",
"@nuxt/webpack": "2.14.7",
"chalk": "^3.0.0",
"chokidar": "^3.4.2",
"chokidar": "^3.4.3",
"consola": "^2.15.0",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
Expand All @@ -23,7 +23,7 @@
"pify": "^4.0.1",
"semver": "^7.3.2",
"serialize-javascript": "^5.0.1",
"upath": "^1.2.0"
"upath": "^2.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 2 additions & 4 deletions packages/builder/src/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import {
stripWhitespace,
isIndexFileAndFolder,
scanRequireTree,
TARGETS,
isFullStatic
TARGETS
} from '@nuxt/utils'

import Ignore from './ignore'
Expand Down Expand Up @@ -130,8 +129,7 @@ export default class Builder {
} else {
consola.info(`Bundling only for ${chalk.bold.green('client')} side`)
}
const target = isFullStatic(this.options) ? 'full static' : this.options.target
consola.info(`Target: ${chalk.bold.cyan(target)}`)
consola.info(`Target: ${chalk.bold.cyan(this.options.target)}`)
}

// Wait for nuxt ready
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/cli",
"version": "2.14.6",
"version": "2.14.7",
"repository": "nuxt/nuxt.js",
"license": "MIT",
"main": "dist/cli.js",
Expand All @@ -12,9 +12,9 @@
"dist"
],
"dependencies": {
"@nuxt/config": "2.14.6",
"@nuxt/config": "2.14.7",
"@nuxt/static": "^1.0.0",
"@nuxt/utils": "2.14.6",
"@nuxt/utils": "2.14.7",
"boxen": "^4.2.0",
"chalk": "^3.0.0",
"compression": "^1.7.4",
Expand All @@ -33,7 +33,7 @@
"pretty-bytes": "^5.4.1",
"serve-static": "^1.14.1",
"std-env": "^2.2.1",
"upath": "^1.2.0",
"upath": "^2.0.0",
"wrap-ansi": "^6.2.0"
},
"publishConfig": {
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/generate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TARGETS } from '@nuxt/utils'
import consola from 'consola'
import { common, locking } from '../options'
import { normalizeArg, createLock } from '../utils'
import { ensureBuild, generate } from '../utils/generate'
Expand Down Expand Up @@ -75,6 +76,7 @@ export default {

// Forcing static target anyway
config.target = TARGETS.static
consola.warn(`For using \`nuxt generate\`, your have to set \`target: 'static'\` in your \`nuxt.config\`\n 👉 Learn more about it on https://go.nuxtjs.dev/static-target`)

// Set flag to keep the prerendering behaviour
config._legacyGenerate = true
Expand Down
19 changes: 7 additions & 12 deletions packages/cli/src/run.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { existsSync } from 'fs'
import { resolve } from 'path'
import execa from 'execa'
import consola from 'consola'
import { name as pkgName } from '../package.json'
import NuxtCommand from './command'
import setup from './setup'
import getCommand from './commands'
import { isNuxtDir } from './utils/dir'

function packageExists (name) {
try {
require.resolve(name)
return true
} catch (e) {
return false
}
}

export default async function run (_argv, hooks = {}) {
// Check for not installing both nuxt and nuxt-edge
const dupPkg = '@nuxt/' + (pkgName === '@nuxt/cli-edge' ? 'cli' : 'cli-edge')
if (packageExists(dupPkg)) {
throw new Error('Both `nuxt` and `nuxt-edge` dependencies are installed! This is unsupported, please choose one and remove the other one from dependencies.')
const dupPkg = pkgName === '@nuxt/cli-edge' ? 'cli' : 'cli-edge'
const dupPkgJSON = resolve(__dirname, '../..' /* dist/../.. */, dupPkg, 'package.json')
if (existsSync(dupPkgJSON) && require(dupPkgJSON).name !== '@nuxt/' + dupPkg) {
consola.warn('Both `nuxt` and `nuxt-edge` dependencies are installed! Please choose one and remove the other one from dependencies.')
}

// Read from process.argv
Expand Down
9 changes: 5 additions & 4 deletions packages/cli/src/utils/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path'
import defaultsDeep from 'lodash/defaultsDeep'
import { loadNuxtConfig as _loadNuxtConfig, getDefaultNuxtConfig } from '@nuxt/config'
import { MODES } from '@nuxt/utils'

export async function loadNuxtConfig (argv, configContext) {
const rootDir = path.resolve(argv._[0] || '.')
Expand All @@ -18,9 +17,11 @@ export async function loadNuxtConfig (argv, configContext) {
}
})

// Nuxt Mode
options.mode =
(argv.spa && MODES.spa) || (argv.universal && MODES.universal) || options.mode
if (argv.spa === true) {
options.ssr = false
} else if (argv.universal === true) {
options.ssr = true
}

// Server options
options.server = defaultsDeep({
Expand Down
23 changes: 19 additions & 4 deletions packages/cli/src/utils/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,27 @@ export async function ensureBuild (cmd) {

const currentBuildSnapshot = await snapshot(snapshotOptions)

// Detect process.env usage in nuxt.config
const processEnv = {}
if (nuxt.options._nuxtConfigFile) {
const configSrc = await fs.readFile(nuxt.options._nuxtConfigFile)
const envRegex = /process.env.(\w+)/g
let match
// eslint-disable-next-line no-cond-assign
while (match = envRegex.exec(configSrc)) {
processEnv[match[1]] = process.env[match[1]]
}
}

// Current build meta
const currentBuild = {
// @ts-ignore
nuxtVersion: nuxt.constructor.version,
ssr: nuxt.options.ssr,
target: nuxt.options.target,
snapshot: currentBuildSnapshot
snapshot: currentBuildSnapshot,
env: nuxt.options.env,
'process.env': processEnv
}

// Check if build can be skipped
Expand All @@ -74,9 +88,10 @@ export async function ensureBuild (cmd) {
const previousBuild = destr(fs.readFileSync(nuxtBuildFile, 'utf-8')) || {}

// Quick diff
const needBuild = false
for (const field of ['nuxtVersion', 'ssr', 'target']) {
if (previousBuild[field] !== currentBuild[field]) {
let needBuild = false
for (const field of ['nuxtVersion', 'ssr', 'target', 'env', 'process.env']) {
if (JSON.stringify(previousBuild[field]) !== JSON.stringify(currentBuild[field])) {
needBuild = true
consola.info(`Doing webpack rebuild because ${field} changed`)
break
}
Expand Down