From 51cd35cb0437b6bcc5a00e83cd0fad3e66d9a309 Mon Sep 17 00:00:00 2001 From: Emily Xiong Date: Mon, 13 Feb 2023 14:23:06 -0500 Subject: [PATCH] feat(expo): upgrade expo-cli to 6.3.0 (#14944) --- e2e/expo/src/expo.test.ts | 9 ++++++++- packages/expo/migrations.json | 17 +++++++++++++++++ packages/expo/plugins/with-nx-webpack.ts | 9 ++++++++- packages/expo/src/utils/versions.ts | 6 +++--- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/e2e/expo/src/expo.test.ts b/e2e/expo/src/expo.test.ts index efff49151ffb1..66f2242120153 100644 --- a/e2e/expo/src/expo.test.ts +++ b/e2e/expo/src/expo.test.ts @@ -20,7 +20,7 @@ describe('expo', () => { ); afterEach(() => cleanupProject()); - it('should test, lint, export and prebuild', async () => { + it('should test, lint, export, export-web and prebuild', async () => { const appName = uniq('my-app'); const libName = uniq('lib'); const componentName = uniq('component'); @@ -52,6 +52,13 @@ describe('expo', () => { expect(exportResults.combinedOutput).toContain( 'Export was successful. Your exported files can be found' ); + checkFilesExist(`dist/apps/${appName}/metadata.json`); + + expect(() => { + runCLI(`export-web ${appName}`); + checkFilesExist(`apps/${appName}/web-build/index.html`); + checkFilesExist(`apps/${appName}/web-build/manifest.json`); + }).not.toThrow(); // set a mock package name for ios and android in expo's app.json const workspace = readResolvedConfiguration(); diff --git a/packages/expo/migrations.json b/packages/expo/migrations.json index bfac67d147419..59a4cfea575c6 100644 --- a/packages/expo/migrations.json +++ b/packages/expo/migrations.json @@ -602,6 +602,23 @@ "alwaysAddToPackageJson": false } } + }, + "15.7.2": { + "version": "15.7.2-beta.0", + "packages": { + "@expo/webpack-config": { + "version": "~18.0.1", + "alwaysAddToPackageJson": false + }, + "eas-cli": { + "version": "3.5.2", + "alwaysAddToPackageJson": false + }, + "expo-cli": { + "version": "6.3.0", + "alwaysAddToPackageJson": false + } + } } } } diff --git a/packages/expo/plugins/with-nx-webpack.ts b/packages/expo/plugins/with-nx-webpack.ts index 3d9ca4483f2b8..25f6277c32dcd 100644 --- a/packages/expo/plugins/with-nx-webpack.ts +++ b/packages/expo/plugins/with-nx-webpack.ts @@ -2,7 +2,7 @@ import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin'; import { resolve } from 'path'; /** - * This function add addtional rules to expo's webpack config to make expo web working + * This function add additional rules to expo's webpack config to make expo web working */ export async function withNxWebpack(config) { // add additional rule to load files under libs @@ -27,6 +27,13 @@ export async function withNxWebpack(config) { }); } + if (!config.resolve) { + config.resolve = {}; + } + if (!config.resolve.plugins) { + config.resolve.plugins = []; + } + const extensions = ['.ts', '.tsx', '.mjs', '.js', '.jsx']; const tsConfigPath = resolve('tsconfig.json'); diff --git a/packages/expo/src/utils/versions.ts b/packages/expo/src/utils/versions.ts index 442b4e864cb65..a8d96dc5637c8 100644 --- a/packages/expo/src/utils/versions.ts +++ b/packages/expo/src/utils/versions.ts @@ -2,12 +2,12 @@ export const nxVersion = require('../../package.json').version; export const expoVersion = '47.0.13'; export const expoMetroConfigVersion = '0.5.2'; -export const expoWebpackConfig = '~0.17.4'; +export const expoWebpackConfig = '~18.0.1'; export const expoSplashScreenVersion = '~0.17.5'; export const expoStatusBarVersion = '~1.4.2'; -export const deprecatedExpoCliVersion = '6.1.0'; // expo-cli +export const deprecatedExpoCliVersion = '6.3.0'; // expo-cli export const expoCliVersion = '0.4.11'; // @expo/cli -export const easCliVersion = '3.3.2'; +export const easCliVersion = '3.5.2'; export const babelPresetExpoVersion = '~9.2.2'; export const reactVersion = '18.1.0';