mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
feat(kit,nuxt,vite,webpack): support -nightly
extension (#23508)
This commit is contained in:
parent
2e02e2c5b1
commit
eb40409f23
2
.github/workflows/release-pr.yml
vendored
2
.github/workflows/release-pr.yml
vendored
@ -61,5 +61,5 @@ jobs:
|
|||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
body: `:rocket: Release triggered! You can now install [nuxt@npm:nuxt3@pr-${{ github.event.issue.number }}](https://www.npmjs.com/package/nuxt3/v/pr-${{ github.event.issue.number }})`
|
body: `:rocket: Release triggered! You can now install [nuxt@npm:nuxt-nightly@pr-${{ github.event.issue.number }}](https://www.npmjs.com/package/nuxt-nightly/v/pr-${{ github.event.issue.number }})`
|
||||||
})
|
})
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
---
|
---
|
||||||
title: "Edge Channel"
|
title: "Nightly Release Channel"
|
||||||
description: "Edge channel allows to use latest commits from the repository."
|
description: "The nightly release channel allows using Nuxt built directly from the latest commits to the repository."
|
||||||
---
|
---
|
||||||
|
|
||||||
# Edge Release Channel
|
# Nightly Release Channel
|
||||||
|
|
||||||
Nuxt 3 is landing commits, improvements, and bug fixes every day. You can opt-in to test them earlier before the next release.
|
Nuxt lands commits, improvements, and bug fixes every day. You can opt in to test them earlier before the next release.
|
||||||
|
|
||||||
After each commit is merged into the `main` branch of [nuxt/nuxt](https://github.com/nuxt/nuxt) and **passing all tests**, we trigger an automated npm release using GitHub Actions publishing Nuxt 3 packages.
|
After a commit is merged into the `main` branch of [nuxt/nuxt](https://github.com/nuxt/nuxt) and **passes all tests**, we trigger an automated npm release, using GitHub Actions.
|
||||||
|
|
||||||
You can opt in to use this release channel and avoid waiting for the next release and helping Nuxt by beta testing changes.
|
You can use these 'nightly' releases to beta test new features and changes.
|
||||||
|
|
||||||
The build and publishing method and quality of edge releases are the same as stable ones. The only difference is that you should often check the GitHub repository for updates. There is a slight chance of regressions not being caught during the review process and by the automated tests. Therefore, we internally use this channel to double-check everything before each release.
|
The build and publishing method and quality of these 'nightly' releases are the same as stable ones. The only difference is that you should often check the GitHub repository for updates. There is a slight chance of regressions not being caught during the review process and by the automated tests. Therefore, we internally use this channel to double-check everything before each release.
|
||||||
|
|
||||||
:::Alert
|
:::Alert
|
||||||
Features only available on the edge channel are marked with an alert in the documentation.
|
Features that are only available on the nightly release channel are marked with an alert in the documentation.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## Opting Into the Edge Channel
|
## Opting Into the Nightly Release Channel
|
||||||
|
|
||||||
Update `nuxt` dependency inside `package.json`:
|
Update `nuxt` dependency inside `package.json`:
|
||||||
|
|
||||||
@ -25,21 +25,21 @@ Update `nuxt` dependency inside `package.json`:
|
|||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
-- "nuxt": "^3.0.0"
|
-- "nuxt": "^3.0.0"
|
||||||
++ "nuxt": "npm:nuxt3@latest"
|
++ "nuxt": "npm:nuxt-nightly@latest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`) and reinstall dependencies.
|
Remove lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`) and reinstall dependencies.
|
||||||
|
|
||||||
## Opting Out From the Edge Channel
|
## Opting Out From the Nightly Release Channel
|
||||||
|
|
||||||
Update `nuxt` dependency inside `package.json`:
|
Update `nuxt` dependency inside `package.json`:
|
||||||
|
|
||||||
```diff [package.json]
|
```diff [package.json]
|
||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
-- "nuxt": "npm:nuxt3@latest"
|
-- "nuxt": "npm:nuxt-nightly@latest"
|
||||||
++ "nuxt": "^3.0.0"
|
++ "nuxt": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,10 +47,10 @@ Update `nuxt` dependency inside `package.json`:
|
|||||||
|
|
||||||
Remove lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`) and reinstall dependencies.
|
Remove lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`) and reinstall dependencies.
|
||||||
|
|
||||||
## Using Latest `nuxi` CLI From Edge
|
## Using Latest `nuxi` CLI From Nightly Release
|
||||||
|
|
||||||
:::Alert
|
:::Alert
|
||||||
All cli dependencies are bundled because of the building method for reducing `nuxi` package size. You can get dependency updates and CLI improvements using the edge channel.
|
All cli dependencies are bundled because of the building method for reducing `nuxi` package size. You can get dependency updates and CLI improvements using the nightly release channel.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
You can use `npx nuxi-edge@latest [command]` to try the latest version of the nuxi CLI.
|
You can use `npx nuxi-edge@latest [command]` to try the latest version of the nuxi CLI.
|
||||||
|
@ -26,7 +26,7 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
|||||||
// Apply dev as config override
|
// Apply dev as config override
|
||||||
opts.overrides.dev = !!opts.dev
|
opts.overrides.dev = !!opts.dev
|
||||||
|
|
||||||
const nearestNuxtPkg = await Promise.all(['nuxt3', 'nuxt', 'nuxt-edge']
|
const nearestNuxtPkg = await Promise.all(['nuxt-nightly', 'nuxt3', 'nuxt', 'nuxt-edge']
|
||||||
.map(pkg => resolvePackageJSON(pkg, { url: opts.cwd }).catch(() => null)))
|
.map(pkg => resolvePackageJSON(pkg, { url: opts.cwd }).catch(() => null)))
|
||||||
.then(r => (r.filter(Boolean) as string[]).sort((a, b) => b.length - a.length)[0])
|
.then(r => (r.filter(Boolean) as string[]).sort((a, b) => b.length - a.length)[0])
|
||||||
if (!nearestNuxtPkg) {
|
if (!nearestNuxtPkg) {
|
||||||
@ -75,7 +75,7 @@ export async function buildNuxt (nuxt: Nuxt): Promise<any> {
|
|||||||
|
|
||||||
// Nuxt 3
|
// Nuxt 3
|
||||||
if (nuxt.options._majorVersion === 3) {
|
if (nuxt.options._majorVersion === 3) {
|
||||||
const { build } = await tryImportModule('nuxt3', rootDir) || await importModule('nuxt', rootDir)
|
const { build } = await tryImportModule('nuxt-nightly', rootDir) || await tryImportModule('nuxt3', rootDir) || await importModule('nuxt', rootDir)
|
||||||
return build(nuxt)
|
return build(nuxt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +155,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
...nuxt.options.build.transpile.filter((i): i is string => typeof i === 'string'),
|
...nuxt.options.build.transpile.filter((i): i is string => typeof i === 'string'),
|
||||||
'nuxt/dist',
|
'nuxt/dist',
|
||||||
'nuxt3/dist',
|
'nuxt3/dist',
|
||||||
|
'nuxt-nightly/dist',
|
||||||
distDir
|
distDir
|
||||||
],
|
],
|
||||||
traceInclude: [
|
traceInclude: [
|
||||||
|
@ -14,7 +14,7 @@ interface ImportProtectionOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const vueAppPatterns = (nuxt: Nuxt) => [
|
export const vueAppPatterns = (nuxt: Nuxt) => [
|
||||||
[/^(nuxt3|nuxt)$/, '`nuxt3`/`nuxt` cannot be imported directly. Instead, import runtime Nuxt composables from `#app` or `#imports`.'],
|
[/^(nuxt|nuxt3|nuxt-nightly)$/, '`nuxt`/`nuxt3`/`nuxt-nightly` cannot be imported directly. Instead, import runtime Nuxt composables from `#app` or `#imports`.'],
|
||||||
[/^((|~|~~|@|@@)\/)?nuxt\.config(\.|$)/, 'Importing directly from a `nuxt.config` file is not allowed. Instead, use runtime config or a module.'],
|
[/^((|~|~~|@|@@)\/)?nuxt\.config(\.|$)/, 'Importing directly from a `nuxt.config` file is not allowed. Instead, use runtime config or a module.'],
|
||||||
[/(^|node_modules\/)@vue\/composition-api/],
|
[/(^|node_modules\/)@vue\/composition-api/],
|
||||||
...nuxt.options.modules.filter(m => typeof m === 'string').map((m: any) =>
|
...nuxt.options.modules.filter(m => typeof m === 'string').map((m: any) =>
|
||||||
|
@ -11,6 +11,7 @@ const testsToTriggerOn = [
|
|||||||
['.nuxt/nuxt.config', 'app.vue', false],
|
['.nuxt/nuxt.config', 'app.vue', false],
|
||||||
['nuxt', 'components/Component.vue', true],
|
['nuxt', 'components/Component.vue', true],
|
||||||
['nuxt3', 'components/Component.vue', true],
|
['nuxt3', 'components/Component.vue', true],
|
||||||
|
['nuxt-nightly', 'components/Component.vue', true],
|
||||||
['/root/node_modules/@vue/composition-api', 'components/Component.vue', true],
|
['/root/node_modules/@vue/composition-api', 'components/Component.vue', true],
|
||||||
['@vue/composition-api', 'components/Component.vue', true],
|
['@vue/composition-api', 'components/Component.vue', true],
|
||||||
['@nuxt/kit', 'components/Component.vue', true],
|
['@nuxt/kit', 'components/Component.vue', true],
|
||||||
|
@ -18,7 +18,7 @@ interface ComposableKeysOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const stringTypes = ['Literal', 'TemplateLiteral']
|
const stringTypes = ['Literal', 'TemplateLiteral']
|
||||||
const NUXT_LIB_RE = /node_modules\/nuxt3?\//
|
const NUXT_LIB_RE = /node_modules\/(nuxt|nuxt3|nuxt-nightly)\//
|
||||||
const SUPPORTED_EXT_RE = /\.(m?[jt]sx?|vue)/
|
const SUPPORTED_EXT_RE = /\.(m?[jt]sx?|vue)/
|
||||||
|
|
||||||
export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptions) => {
|
export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptions) => {
|
||||||
|
@ -68,7 +68,7 @@ export async function buildServer (ctx: ViteBuildContext) {
|
|||||||
'/__vue-jsx',
|
'/__vue-jsx',
|
||||||
'#app',
|
'#app',
|
||||||
/^nuxt(\/|$)/,
|
/^nuxt(\/|$)/,
|
||||||
/(nuxt|nuxt3)\/(dist|src|app)/
|
/(nuxt|nuxt3|nuxt-nightly)\/(dist|src|app)/
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite', 'server'),
|
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite', 'server'),
|
||||||
|
@ -118,7 +118,7 @@ function createViteNodeApp (ctx: ViteBuildContext, invalidates: Set<string> = ne
|
|||||||
const node: ViteNodeServer = new ViteNodeServer(viteServer, {
|
const node: ViteNodeServer = new ViteNodeServer(viteServer, {
|
||||||
deps: {
|
deps: {
|
||||||
inline: [
|
inline: [
|
||||||
/\/node_modules\/(.*\/)?(nuxt|nuxt3)\//,
|
/\/node_modules\/(.*\/)?(nuxt|nuxt3|nuxt-nightly)\//,
|
||||||
/^#/,
|
/^#/,
|
||||||
...transpile({ isServer: true, isDev: ctx.nuxt.options.dev })
|
...transpile({ isServer: true, isDev: ctx.nuxt.options.dev })
|
||||||
]
|
]
|
||||||
|
@ -47,6 +47,7 @@ function serverStandalone (ctx: WebpackConfigContext) {
|
|||||||
'#app',
|
'#app',
|
||||||
'nuxt',
|
'nuxt',
|
||||||
'nuxt3',
|
'nuxt3',
|
||||||
|
'nuxt-nightly',
|
||||||
'!',
|
'!',
|
||||||
'-!',
|
'-!',
|
||||||
'~',
|
'~',
|
||||||
|
@ -6,7 +6,7 @@ import { determineBumpType, loadWorkspace } from './_utils'
|
|||||||
const nightlyPackages = {
|
const nightlyPackages = {
|
||||||
nitropack: 'nitropack-edge',
|
nitropack: 'nitropack-edge',
|
||||||
h3: 'h3-nightly',
|
h3: 'h3-nightly',
|
||||||
nuxi: 'nuxi-edge'
|
nuxi: 'nuxi-nightly'
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
@ -27,7 +27,7 @@ async function main () {
|
|||||||
pkg.data.dependencies[name] = `npm:${nightlyName}@latest`
|
pkg.data.dependencies[name] = `npm:${nightlyName}@latest`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge')
|
const newname = pkg.data.name + '-nightly'
|
||||||
workspace.rename(pkg.data.name, newname)
|
workspace.rename(pkg.data.name, newname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user