From 44ad3d153a52746a56ebd6462063f09884f1fbe3 Mon Sep 17 00:00:00 2001 From: infoxicator Date: Tue, 16 Jun 2020 13:25:17 +0100 Subject: [PATCH 1/2] fix(generator): react-intl in externals --- packages/generator-one-app-module/__tests__/app.js | 4 ++-- packages/generator-one-app-module/generators/app/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/generator-one-app-module/__tests__/app.js b/packages/generator-one-app-module/__tests__/app.js index 8a1026de..503e3836 100644 --- a/packages/generator-one-app-module/__tests__/app.js +++ b/packages/generator-one-app-module/__tests__/app.js @@ -136,7 +136,7 @@ describe('generator-one-app-module', () => { assert.jsonFileContent('package.json', { 'one-amex': { bundler: { - externals: 'react-intl', + requiredExternals: ['react-intl'], }, }, }); @@ -199,7 +199,7 @@ describe('generator-one-app-module', () => { assert.jsonFileContent('package.json', { 'one-amex': { bundler: { - providesExternals: 'react-intl', + providedExternals: ['react-intl'], }, }, }); diff --git a/packages/generator-one-app-module/generators/app/index.js b/packages/generator-one-app-module/generators/app/index.js index ebdccbe8..5834ff3c 100644 --- a/packages/generator-one-app-module/generators/app/index.js +++ b/packages/generator-one-app-module/generators/app/index.js @@ -186,7 +186,7 @@ module.exports = class extends Generator { this.fs.extendJSON(this.destinationPath('package.json'), { 'one-amex': { bundler: { - externals: 'react-intl', + requiredExternals: ['react-intl'], }, }, }); @@ -205,7 +205,7 @@ module.exports = class extends Generator { this.fs.extendJSON(this.destinationPath('package.json'), { 'one-amex': { bundler: { - providesExternals: 'react-intl', + providedExternals: ['react-intl'], }, }, }); From 5f820ba8004241b106bc78795f66e39e26dfe6c5 Mon Sep 17 00:00:00 2001 From: infoxicator Date: Mon, 10 Aug 2020 16:06:21 +0100 Subject: [PATCH 2/2] test(webpack): mock read-pkg-up to avoid side effect --- .../__tests__/webpack/module/webpack.server.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/one-app-bundler/__tests__/webpack/module/webpack.server.spec.js b/packages/one-app-bundler/__tests__/webpack/module/webpack.server.spec.js index ff179a23..d6640e97 100644 --- a/packages/one-app-bundler/__tests__/webpack/module/webpack.server.spec.js +++ b/packages/one-app-bundler/__tests__/webpack/module/webpack.server.spec.js @@ -14,6 +14,10 @@ jest.spyOn(process, 'cwd').mockImplementation(() => __dirname.split('/__tests__')[0]); +jest.mock('read-pkg-up', () => ({ + sync: jest.fn(() => ({ pkg: { name: '@americanexpress/one-app-bundler', version: '6.8.0' } })), +})); + const webpackConfig = require('../../../webpack/module/webpack.server'); const { validateWebpackConfig } = require('../../../test-utils');