Skip to content

Commit

Permalink
chore!: upgrade to nuxt 2.15
Browse files Browse the repository at this point in the history
BREAKING CHANGES: use `jiti` to require nuxt config on vercel
  • Loading branch information
danielroe committed Feb 15, 2021
1 parent afeb882 commit 1588c3b
Show file tree
Hide file tree
Showing 13 changed files with 8,929 additions and 9,755 deletions.
2,428 changes: 1,128 additions & 1,300 deletions examples/basic/yarn.lock

Large diffs are not rendered by default.

2,428 changes: 1,128 additions & 1,300 deletions examples/side-by-side/admin/yarn.lock

Large diffs are not rendered by default.

2,428 changes: 1,128 additions & 1,300 deletions examples/side-by-side/app/yarn.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
'lib/**/*.js',
'!lib/launcher.js'
],
setupFiles: ['<rootDir>/test/setup.js'],
modulePathIgnorePatterns: [
'/node_modules/',
'/node_modules_dev/',
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,39 @@
"dependencies": {
"@vercel/build-utils": "2.9.0",
"@vercel/node-bridge": "1.3.2",
"consola": "2.15.2",
"esm": "3.2.25",
"consola": "2.15.3",
"execa": "^5.0.0",
"fs-extra": "9.1.0",
"jiti": "^1.3.0",
"replace-in-file": "^6.2.0",
"resolve-from": "^5.0.0",
"semver": "7.3.4"
},
"devDependencies": {
"@nuxt/types": "^2.14.12",
"@nuxt/types": "^2.15.0",
"@nuxtjs/eslint-config": "^5.0.0",
"@release-it/conventional-changelog": "^2.0.0",
"@types/aws-lambda": "^8.10.71",
"@types/fs-extra": "^9.0.6",
"@types/aws-lambda": "^8.10.72",
"@types/fs-extra": "^9.0.7",
"@types/glob": "^7.1.3",
"@types/node": "^14.14.25",
"@types/node": "^14.14.28",
"@types/semver": "^7.3.4",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"@vercel/routing-utils": "1.9.2",
"codecov": "^3.8.1",
"eslint": "^7.19.0",
"eslint": "^7.20.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.5.0",
"eslint-plugin-vue": "^7.6.0",
"jest": "26.6.3",
"npm-run-all": "^4.1.5",
"nuxt": "2.14.12",
"release-it": "^14.3.0",
"siroc": "^0.6.3"
"nuxt": "2.15.0",
"release-it": "^14.4.0",
"siroc": "^0.6.6"
}
}
10 changes: 3 additions & 7 deletions src/launcher.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import type { RequestListener } from 'http'
import esmCompiler from 'esm'
import jiti from 'jiti'

const startTime = process.hrtime()

// Load Config
const esm = esmCompiler(module, {
cjs: {
dedefault: true
}
})
const nuxtConfig = esm('__NUXT_CONFIG__')
const load = jiti()
const nuxtConfig = load('__NUXT_CONFIG__')

// Create nuxt
const { Nuxt } = require('@nuxt/core__NUXT_SUFFIX__')
Expand Down
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SpawnOptions } from 'child_process'
import type { NuxtConfig as NuxtConfiguration } from '@nuxt/types'
import { glob, Files, PackageJson } from '@vercel/build-utils'
import consola from 'consola'
import esm from 'esm'
import jiti from 'jiti'
import execa, { ExecaReturnValue } from 'execa'
import fs from 'fs-extra'
import type { IOptions } from 'glob'
Expand Down Expand Up @@ -177,8 +177,8 @@ export function startStep (step: string): void {
}

export function getNuxtConfig (rootDir: string, nuxtConfigName: string): NuxtConfiguration {
const _esm = esm(module)
const nuxtConfigFile = _esm(path.resolve(rootDir, nuxtConfigName))
const load = jiti()
const nuxtConfigFile = load(path.resolve(rootDir, nuxtConfigName))
return nuxtConfigFile.default || nuxtConfigFile
}

Expand Down
2,798 changes: 1,379 additions & 1,419 deletions test/fixture-generated/www/yarn.lock

Large diffs are not rendered by default.

2,843 changes: 1,379 additions & 1,464 deletions test/fixture-ts/www/yarn.lock

Large diffs are not rendered by default.

2,798 changes: 1,379 additions & 1,419 deletions test/fixture/www/yarn.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions test/setup.js

This file was deleted.

2,911 changes: 1,388 additions & 1,523 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 1588c3b

Please sign in to comment.