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

fix: support -nightly nuxt releases and publish nuxi-nightly #248

Merged
merged 2 commits into from Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
!contains(github.event.head_commit.message, 'docs')
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc &&
pnpm changelogen --canary edge --publish
pnpm changelogen --canary nightly --publish
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: false
1 change: 1 addition & 0 deletions src/commands/info.ts
Expand Up @@ -56,6 +56,7 @@ export default defineCommand({
// Check nuxt version
const nuxtVersion =
getDepVersion('nuxt') ||
getDepVersion('nuxt-nightly') ||
getDepVersion('nuxt-edge') ||
getDepVersion('nuxt3') ||
'-'
Expand Down
8 changes: 6 additions & 2 deletions src/commands/test.ts
Expand Up @@ -42,7 +42,11 @@ export default defineCommand({
// @ts-ignore TODO
async function importTestUtils(): Promise<typeof import('@nuxt/test-utils')> {
let err
for (const pkg of ['@nuxt/test-utils-edge', '@nuxt/test-utils']) {
for (const pkg of [
'@nuxt/test-utils-nightly',
'@nuxt/test-utils-edge',
'@nuxt/test-utils',
]) {
try {
const exports = await import(pkg)
// Detect old @nuxt/test-utils
Expand All @@ -56,6 +60,6 @@ async function importTestUtils(): Promise<typeof import('@nuxt/test-utils')> {
}
console.error(err)
throw new Error(
'`@nuxt/test-utils-edge` seems missing. Run `npm i -D @nuxt/test-utils-edge` or `yarn add -D @nuxt/test-utils-edge` to install.',
'`@nuxt/test-utils` seems missing. Run `npm i -D @nuxt/test-utils` or `yarn add -D @nuxt/test-utils` to install.',
)
}
9 changes: 7 additions & 2 deletions src/utils/banner.ts
Expand Up @@ -5,8 +5,13 @@ export function showVersions(cwd: string) {
const getPkgVersion = (pkg: string) => {
return tryRequireModule(`${pkg}/package.json`, cwd)?.version || ''
}
const nuxtVersion = getPkgVersion('nuxt') || getPkgVersion('nuxt-edge')
const nitroVersion = getPkgVersion('nitropack')
const nuxtVersion =
getPkgVersion('nuxt') ||
getPkgVersion('nuxt-nightly') ||
getPkgVersion('nuxt3') ||
getPkgVersion('nuxt-edge')
const nitroVersion =
getPkgVersion('nitropack') || getPkgVersion('nitropack-edge')
console.log(
gray(
green(`Nuxt ${bold(nuxtVersion)}`) +
Expand Down
2 changes: 1 addition & 1 deletion src/utils/kit.ts
Expand Up @@ -31,7 +31,7 @@ export const loadKit = async (
}

async function tryResolveNuxt() {
for (const pkg of ['nuxt3', 'nuxt', 'nuxt-edge']) {
for (const pkg of ['nuxt-nightly', 'nuxt3', 'nuxt', 'nuxt-edge']) {
const path = await tryResolveModule(pkg)
if (path) {
return path
Expand Down