mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
54 lines
2.2 KiB
Bash
Executable File
54 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
#==============================================================================#
|
|
# SETUP #
|
|
#==============================================================================#
|
|
|
|
# Start in scripts/integration-tests/ even if run from root directory
|
|
cd "$(dirname "$0")" || exit
|
|
|
|
source utils/local-registry.sh
|
|
source utils/cleanup.sh
|
|
|
|
# Echo every command being executed
|
|
set -x
|
|
|
|
# Clone vue-cli
|
|
git clone --depth=1 https://github.com/vuejs/vue-cli tmp/vue-cli
|
|
cd tmp/vue-cli || exit
|
|
|
|
#==============================================================================#
|
|
# TEST #
|
|
#==============================================================================#
|
|
|
|
# Don't use Yarn 2
|
|
export YARN_IGNORE_PATH=1
|
|
|
|
startLocalRegistry "$PWD"/../../verdaccio-config.yml
|
|
yarn install --ignore-engines # Remove --ignore-engines when vue-cli upgrades their lockfile to [email protected]
|
|
node "$PWD"/../../utils/bump-babel-dependencies.js resolutions
|
|
yarn lerna exec -- node "$PWD"/../../utils/bump-babel-dependencies.js resolutions
|
|
yarn install --ignore-engines # Remove --ignore-engines when vue-cli upgrades their lockfile to [email protected]
|
|
|
|
if [[ "$(node --version)" == v17.* ]]; then
|
|
# Remove this when https://github.com/webpack/webpack/issues/14532 is fixed
|
|
export NODE_OPTIONS=--openssl-legacy-provider
|
|
fi
|
|
|
|
# vue-cli's tests expect us to import regenerator-runtime from "regenerator-runtime/runtime",
|
|
# but we import it from @babel/runtime.
|
|
sed -i 's%toMatch(`regenerator-runtime/runtime`)%toMatch(`@babel/runtime/helpers/regenerator`)%' packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js
|
|
|
|
# Babel 8 adjustments
|
|
# This option is renamed in Babel 8
|
|
sed -i 's/legacy: decoratorsLegacy !== false/version: decoratorsLegacy === false ? "legacy": "2023-11"/g' packages/@vue/babel-preset-app/index.js
|
|
|
|
# Delete once https://github.com/jestjs/jest/pull/14109 is released
|
|
sed -i "s/blacklist/denylist/g" node_modules/babel-plugin-jest-hoist/build/index.js
|
|
|
|
# Test
|
|
CI=true yarn test -p babel,babel-preset-app
|
|
|
|
unset YARN_IGNORE_PATH
|
|
cleanup
|