]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: fix canary bundling issues (#7907)
authorHaoqun Jiang <haoqunjiang@gmail.com>
Fri, 17 Mar 2023 08:47:48 +0000 (16:47 +0800)
committerGitHub <noreply@github.com>
Fri, 17 Mar 2023 08:47:48 +0000 (16:47 +0800)
1. correct the rollup config after the package name changed
2. fix the same-day patch version bump of canary releases

rollup.config.js
scripts/release.js

index 34a5ac62a3da6ad8d5cced97a847ecc6ea54f644..7645a0221edbbf05b44c61ca1a40010db83735a2 100644 (file)
@@ -102,7 +102,8 @@ function createConfig(format, output, plugins = []) {
   const isServerRenderer = name === 'server-renderer'
   const isNodeBuild = format === 'cjs'
   const isGlobalBuild = /global/.test(format)
-  const isCompatPackage = pkg.name === '@vue/compat'
+  const isCompatPackage =
+    pkg.name === '@vue/compat' || pkg.name === '@vue/compat-canary'
   const isCompatBuild = !!packageOptions.compat
   const isBrowserBuild =
     (isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
@@ -240,7 +241,10 @@ function createConfig(format, output, plugins = []) {
     // we are bundling forked consolidate.js in compiler-sfc which dynamically
     // requires a ton of template engines which should be ignored.
     let cjsIgnores = []
-    if (pkg.name === '@vue/compiler-sfc') {
+    if (
+      pkg.name === '@vue/compiler-sfc' ||
+      pkg.name === '@vue/compiler-sfc-canary'
+    ) {
       cjsIgnores = [
         ...Object.keys(consolidatePkg.devDependencies),
         'vm',
index 38982919d644a91f989655c2a73c3af5d720b635..55e01251e9d887bff0071f1b4d0ba58f3f177a4f 100644 (file)
@@ -95,14 +95,21 @@ async function main() {
         ['view', `${pkgName}@~${canaryVersion}`, 'version', '--json'],
         { stdio: 'pipe' }
       )
-      const versions = JSON.parse(stdout)
+      let versions = JSON.parse(stdout)
+      versions = Array.isArray(versions) ? versions : [versions]
       const latestSameDayPatch = /** @type {string} */ (
         semver.maxSatisfying(versions, `~${canaryVersion}`)
       )
       canaryVersion = /** @type {string} */ (
         semver.inc(latestSameDayPatch, 'patch')
       )
-    } catch (e) {}
+    } catch (e) {
+      if (/E404/.test(e.message)) {
+        // the first patch version on that day
+      } else {
+        throw e
+      }
+    }
 
     targetVersion = canaryVersion
   }