From 393cbee938c8a79d5f97bc6c33fa25b6b15e07ec Mon Sep 17 00:00:00 2001 From: benitav Date: Tue, 14 Jan 2025 14:22:37 +0200 Subject: [PATCH 1/2] copy-assets update for RN Web --- .../react-native-and-expo/react-native-web-support.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client-sdk-references/react-native-and-expo/react-native-web-support.mdx b/client-sdk-references/react-native-and-expo/react-native-web-support.mdx index dfe31fd8..bb1e9a7e 100644 --- a/client-sdk-references/react-native-and-expo/react-native-web-support.mdx +++ b/client-sdk-references/react-native-and-expo/react-native-web-support.mdx @@ -30,10 +30,14 @@ For React Native for Web, workers need to be configured when instantiating `Powe To do this, copy the contents of `node_modules/@powersync/web/dist` to the root of your project (typically in the `public `directory). To make it easier to manage these files in the `public` directory, it is recommended to place the contents in a nested directory like `@powersync`. -You can run the following bash command to automate the copying process. It will create copy the contents to `/public/@powersync`. +The [`@powersync/web`](https://github.com/powersync-ja/powersync-js/tree/main/packages/web) package includes a CLI utility which can copy the required assets to the `public` directory (configurable with the `--output` option). ```bash -mkdir -p public/@powersync && cp -r node_modules/@powersync/web/dist/* public/@powersync/ +npx powersync-web copy-assets +``` +or +```bash +pnpm powersync-web copy-assets ``` ### 3\. Instantiate Web Workers From 981b88043c4371ecd0f20fa5f4e1c49ab0bb4531 Mon Sep 17 00:00:00 2001 From: benitav Date: Tue, 14 Jan 2025 14:36:31 +0200 Subject: [PATCH 2/2] Output example --- .../react-native-and-expo/react-native-web-support.mdx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client-sdk-references/react-native-and-expo/react-native-web-support.mdx b/client-sdk-references/react-native-and-expo/react-native-web-support.mdx index bb1e9a7e..58ac729d 100644 --- a/client-sdk-references/react-native-and-expo/react-native-web-support.mdx +++ b/client-sdk-references/react-native-and-expo/react-native-web-support.mdx @@ -33,11 +33,8 @@ To do this, copy the contents of `node_modules/@powersync/web/dist` to the root The [`@powersync/web`](https://github.com/powersync-ja/powersync-js/tree/main/packages/web) package includes a CLI utility which can copy the required assets to the `public` directory (configurable with the `--output` option). ```bash -npx powersync-web copy-assets -``` -or -```bash -pnpm powersync-web copy-assets +npx powersync-web copy-assets # Places assets into public/@powersync by default. Override with `--output path/from_current_working_dir`. +# or pnpm powersync-web copy-assets ``` ### 3\. Instantiate Web Workers