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

build: fix canary bundling issues #7907

Merged
merged 1 commit into from
Mar 17, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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',
Expand Down
11 changes: 9 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down