History log of /expo/packages/@expo/cli/src/export/embed/exportEmbedAsync.ts (Results 1 – 8 of 8)
Revision Date Author Comments
# 7c98c357 14-Sep-2023 Evan Bacon <[email protected]>

feat(cli, router, metro, asset): add basePath support (#23911)

# Why

- Add the ability to export websites for hosting from a custom path.
This is required for GitHub pages.
- Resolve ENG-9193

feat(cli, router, metro, asset): add basePath support (#23911)

# Why

- Add the ability to export websites for hosting from a custom path.
This is required for GitHub pages.
- Resolve ENG-9193
- Resolve https://github.com/expo/expo/issues/20562
- Resolve https://github.com/expo/router/issues/165

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

- Add `expo.experiments.basePath` which can be used during `npx expo
export` to modify how assets are referenced.
- Set the `publicPath` in Metro to output as expected.
- Add custom asset writing for web to support stripping the unused
prefix.

- It's unclear if this should also apply to native, and if we should
have platform-specific variations.
- Update Expo Router to support automatically adjusting paths to support
basePath in production builds.
<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

- [ ] New `expo export` test.

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>
Co-authored-by: Aman Mittal <[email protected]>

show more ...


# 429dc7fc 26-Aug-2023 Evan Bacon <[email protected]>

fix(expo, asset, cli)!: unify asset hashing (#24090)

# Why

Convert the `../` segments of the server URL to `_` to support
monorepos. This same transformation takes place in
`AssetSourceResolver

fix(expo, asset, cli)!: unify asset hashing (#24090)

# Why

Convert the `../` segments of the server URL to `_` to support
monorepos. This same transformation takes place in
`AssetSourceResolver.web` (expo-assets, expo-image) and
`persistMetroAssets` of Expo CLI, this originally came from the [Metro
opinion](https://github.com/react-native-community/cli/blob/2204d357379e2067cebe2791e90388f7e97fc5f5/packages/cli-plugin-metro/src/commands/bundle/getAssetDestPathIOS.ts#L19C5-L19C10).

The purpose is to ensure no URL like `/foo/../bar.png` is requested, as
the result would be `/bar.png` which wouldn't work. The of how to handle
this didn't come from us, but we do need to ensure it's unified. At a
high-level, this does prevent the usage of certain files, as
`/foo/../bar.png` will be `/foo/_bar.png`, meaning a file named
`/foo/_bar.png` cannot also exist. This logic, while applied at runtime,
is actually only valid for production exports as we don't move or alias
files in development. The only way to have valid development files is to
ensure `../` never appears in the URL, i.e. by using
`unstable_serverRoot`.

- Drop legacy `expo/tools/hashAssetFiles.js` in favor of `expo-asset`
version.
- Unify runtime logic of asset file loading for monorepos.
- Split out of https://github.com/expo/expo/pull/23911

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

show more ...


# fd2402c1 24-Aug-2023 Evan Bacon <[email protected]>

feat(cli): add monorepo asset support for export:embed (#24095)

# Why

- Pull in support for using the forked getAssets which supports
`EXPO_USE_METRO_WORKSPACE_ROOT` from
https://github.com/exp

feat(cli): add monorepo asset support for export:embed (#24095)

# Why

- Pull in support for using the forked getAssets which supports
`EXPO_USE_METRO_WORKSPACE_ROOT` from
https://github.com/expo/expo/issues/24027

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

- Drop unused `--generate-static-view-configs`
https://github.com/react-native-community/cli/pull/1970
- Update tests to use e2e fixture which has the expo package linked to
`packages`.
- Disable `watch` mode on metro when bundling for embed (we do this with
`npx expo export`).
- Use forked `getAssets` to support `EXPO_USE_METRO_WORKSPACE_ROOT`
correctly.
- Drop a bunch of unused option parsing.

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

- E2E bundling test.

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 8a424beb 11-Aug-2023 James Ide <[email protected]>

[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)

Why
---
Prettier 3 is out. Add support for it with this linter config.

**Note for reviewer:** the first commit is the one with th

[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)

Why
---
Prettier 3 is out. Add support for it with this linter config.

**Note for reviewer:** the first commit is the one with the actual
changes. The rest of this PR are changes to get the linter passing
(mostly autofix).

How
---
Update eslint-config-prettier and eslint-plugin-prettier. To address
deprecation warnings, also update typescript-eslint/parser and
typescript-eslint/eslint-plugin.
Because of an update to typescript-eslint/parser, we need to suppress
deprecation warnings (documented in a comment).

Regenerated test snapshots. Due to the upgraded dependencies, typecasts
and optional chaining are now auto-fixable by lint. This converts
warnings into autofixes.

Test Plan
---
`yarn test` in the linter config. Run `expotools check --all --fix-lint
--no-build --no-test --no-uniformity-check` to try this config on the
whole repo.

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# da5824c9 12-Jun-2023 Kudo Chien <[email protected]>

[cli] fix typecheck from react-native 0.72 upgrade (#22766)

# Why

follow up #22588 which disabled the cli typecheck

# How

using types from metro and fix typing issues

# Test Plan

cli

[cli] fix typecheck from react-native 0.72 upgrade (#22766)

# Why

follow up #22588 which disabled the cli typecheck

# How

using types from metro and fix typing issues

# Test Plan

cli ci passed

show more ...


# 6a750d06 08-Apr-2023 Evan Bacon <[email protected]>

feat(cli, metro-config): environment variable support (#21983)

# Why

- It's nice to be able to use uncommitted values in your app, based on
the environment. This feels very familiar to web devel

feat(cli, metro-config): environment variable support (#21983)

# Why

- It's nice to be able to use uncommitted values in your app, based on
the environment. This feels very familiar to web developers.
- Values that are prefixed with `EXPO_PUBLIC_` will be inlined in the
bundle when bundling normally (e.g. not for Node.js).
- `.env` files are loaded into memory and applied to the process during
a run. This also means that they're available in `app.config.js`.
- During development-only, environment variables are exposed on the
`process.env` object (non-enumerable) to ensure they're available
between fast refresh updates.
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

- Create new package `@expo/env` which is used to hydrate env variables
in a unified way. I plan to open another PR in `eas-cli` which uses this
package to fill in environment variables before uploading. NOTE:
environment variables that are defined in eas.json are not available in
Expo CLI when building locally, but are available in the cloud since
they'll be on the process, this means they effectively emulate
`.env.production`.
- Update templates to gitignore local env files.
- Add basic documentation to the versioned metro guide (more to come).


<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

- [ ] E2E rendering test
- [ ] E2E Node.js rendering test
- [x] Unit tests for serializer
- [x] Tests for env package

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

show more ...


# 000843d8 14-Mar-2023 Evan Bacon <[email protected]>

feat(cli): Set node env for metro config in `expo export:embed`. (#21644)

# Why

Ensure that users can use `process.env.NODE_ENV` in their
`metro.config.js` to control settings.

---------

C

feat(cli): Set node env for metro config in `expo export:embed`. (#21644)

# Why

Ensure that users can use `process.env.NODE_ENV` in their
`metro.config.js` to control settings.

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# b6b91c50 06-Mar-2023 Evan Bacon <[email protected]>

feat(cli)!: use Expo CLI to bundle production apps (#21396)

# Why

Most of our new Metro bundler features won't work unless we use Expo CLI
for every bundler operation (ex:
[aliases](https://git

feat(cli)!: use Expo CLI to bundle production apps (#21396)

# Why

Most of our new Metro bundler features won't work unless we use Expo CLI
for every bundler operation (ex:
[aliases](https://github.com/expo/expo/pull/21262)). Right now this is
the case when building for production on both platforms or building for
development on iOS.

> Using `npx expo start` when building from Xcode will be added in
another PR.

# How

This PR introduces a new "export:embed" command which is hidden from the
`--help` prompt. `npx expo export:embed` accepts the same arguments as
`npx react-native bundle` and passes them to the same internal function,
but it ensures we use the correct variation of Metro before doing such.

This change (and `start` PR) will add more steps for migrating to "Expo
CLI" but it will also remove the need for us to generate the
`metro.config.js` file in the project on `npx expo prebuild` since we
can now reliably default to `@expo/metro-config`.

The change should only apply to Metro bundler features (all application
code could be affected), but it won't obstruct Expo Modules Core or
using Expo CLI.

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

- All of our existing E2E tests should use the new command, if they
contain features like aliases then they'll work.
- Copied the changes from `@expo/cli` into a new project's node_modules,
added template changes:
- Built for production from Android Studio and Xcode.

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>
Co-authored-by: James Ide <[email protected]>

show more ...