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(@angular/cli): keep relative migration paths during update analysis #21866

Merged
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
6 changes: 1 addition & 5 deletions packages/angular/cli/src/commands/update/schematic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,9 @@ function _performUpdate(
return;
}

const collection =
(target.updateMetadata.migrations.match(/^[./]/) ? name + '/' : '') +
target.updateMetadata.migrations;

externalMigrations.push({
package: name,
collection,
collection: target.updateMetadata.migrations,
from: installed.version,
to: target.version,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ async function setupLocalize(
};

const i18nRule: webpack.RuleSetRule = {
test: /\.(?:[cm]?js|ts)$/,
test: /\.[cm]?[tj]sx?$/,
enforce: 'post',
use: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export async function execute(
module: {
rules: [
{
test: /\.[t|j]s$/,
test: /\.[cm]?[tj]sx?$/,
loader: require.resolve('./ivy-extract-loader'),
options: {
messageHandler: (messages: LocalizeMessage[]) => ivyMessages.push(...messages),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config

if (scriptsSourceMap || stylesSourceMap) {
extraRules.push({
test: /\.m?js$/,
test: /\.[cm]?jsx?$/,
enforce: 'pre',
loader: require.resolve('source-map-loader'),
options: {
Expand Down Expand Up @@ -381,7 +381,7 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config
sideEffects: true,
},
{
test: /\.[cm]?js$|\.tsx?$/,
test: /\.[cm]?[tj]sx?$/,
// The below is needed due to a bug in `@babel/runtime`. See: https://github.com/babel/babel/issues/12824
resolve: { fullySpecified: false },
exclude: [/[/\\](?:core-js|@babel|tslib|web-animations-js|web-streams-polyfill)[/\\]/],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function getTestConfig(
}

extraRules.push({
test: /\.(jsx?|tsx?)$/,
test: /\.[cm]?[tj]sx?$/,
loader: require.resolve('@jsdevtools/coverage-istanbul-loader'),
options: { esModules: true },
enforce: 'post',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module.exports = {
plugins: [new ngToolsWebpack.AngularWebpackPlugin()],
module: {
rules: [
// rxjs 6 requires directory imports which are not support in ES modules.
// Disabling `fullySpecified` allows Webpack to ignore this but this is
// not ideal because it currently disables ESM behavior import for all JS files.
{ test: /\.[m]?js$/, resolve: { fullySpecified: false } },
{ test: /\.scss$/, use: ['sass-loader'], type: 'asset/source' },
{ test: /\.html$/, type: 'asset/source' },
{ test: /\.ts$/, loader: ngToolsWebpack.AngularWebpackLoaderPath },
Expand Down