Skip to content

Commit

Permalink
build: remove wml dependency (#13014)
Browse files Browse the repository at this point in the history
* fix: remove dependency on wml and react-native script that used it

* fix: update CONTRIBUTING guide to remove react-native script and point to Verdaccio

* fix: remove proxy registry from yarn.lock

* fix: remove winston package

* chore: add CC0-1 to allowed licenses

* chore: rebuild yarn.lock after merge

* chore: increase analytics bundle size limits

* build: fix license name typo
  • Loading branch information
erinleigh90 authored Feb 16, 2024
1 parent e4ae0f6 commit 29c8d60
Show file tree
Hide file tree
Showing 6 changed files with 1,920 additions and 2,257 deletions.
1 change: 1 addition & 0 deletions .github/dependency-review/dependecy-review-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ allow-licenses:
- 'Unlicense'
- 'WTFPL'
- 'Zlib'
- 'CC0-1.0'
45 changes: 2 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ yarn run test --scope @aws-amplify/auth
**Yarn Linking**
The best way to develop locally and test is to link the individual package you’re working on and run lerna in watch mode.

Note: to test using the react-native framework you will need to use [Verdaccio](#verdaccio)

Run watch mode while editing (auth for example):

```
Expand All @@ -126,49 +128,6 @@ yarn link @aws-amplify/auth

Passing unit tests are only necessary if you’re looking to contribute a pull request. If you’re just playing locally, you don’t need them. However, if you’re contributing a pull request for anything other than making a change to the documentation, fixing a formatting issue in the code (i.e., white space, missing semi-colons) or another task that does not impact the functionality of the code, you will need to validate your proposed changes with passing unit tests.

**Using the setup-dev:react-native script to work with React-Native apps**

> Note: All the below commands to be run from the local amplify-js library root
To develop locally alongside a React-Native app, make sure to,

1. Finish the build steps mentioned in the section: `Setting up for local development` to set up your local `amplify-js` repository for development.

> Note: To set up a sample React-Native app -- configure your [development environment](https://reactnative.dev/docs/environment-setup) and [create an app](https://reactnative.dev/docs/environment-setup#creating-a-new-application). Note the path to the app as it is required in the next step.
2. Run the below command in the root of the amplify-js local repository with a package name (auth for example):
> Make sure to have [watchman](https://facebook.github.io/watchman/docs/install.html) installed before running the command below
```
npm run setup-dev:react-native -- --packages @aws-amplify/auth --target ~/path/to/your/rn/app/root
```

> Note: This script runs a continuous job in the newly opened tabs to watch, build and copy the changes unlike the usual linking method.
The options `--packages` is used to specify single or multiple package names and the `--target` option is used to specify the path to your sample React-Native app.
Optionally, you can use the shorthands flags `-p` and `-t` for packages and target path respectively.

> All scoped packages must be prefixed by `@aws-amplify/` . For example: `@aws-amplify/auth`
To develop multiple/all packages, provide the package names separated by a comma or the flag `--all` or `-a`:

```
npm run setup-dev:react-native -- --packages @aws-amplify/auth --target ~/path/to/your/rn/app/root
npm run setup-dev:react-native -- --all --target ~/path/to/your/rn/app/root
```

> Note: `--` right after the script name is important to provide the flags with their values.
**Debugging problems with the `setup-dev:react-native` script**

- If the WML command does not do anything after adding the links, watch its src file using watchman. Run the below from the root of this repository:

```
watchman watch node_modules/wml/src
```

- When using VScode, for the script to open a new terminal and tabs you will need to provide the editor accessiblity permissions.

#### Verdaccio

Verdaccio is a lightweight private npm proxy registry built in Node.js. Install [Verdaccio](https://verdaccio.org/docs/en/installation). You can setup Verdaccio to publish packages locally to test the changes.
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"description": "",
"scripts": {
"setup-dev": "yarn && yarn bootstrap && yarn link-all && yarn build",
"setup-dev:react-native": "node ./scripts/setup-dev-rn",
"bootstrap": "lerna bootstrap",
"test": "yarn test:no-datastore && yarn test:datastore && yarn test:license && yarn test:github-actions && yarn test:tsc-compliance",
"test:no-datastore": "lerna run test --stream --ignore @aws-amplify/datastore",
Expand Down Expand Up @@ -125,9 +124,7 @@
"uuid-validate": "^0.0.3",
"webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.7.0",
"webpack-cli": "^5.0.0",
"wml": "0.0.83",
"winston": "3.11.0"
"webpack-cli": "^5.0.0"
},
"resolutions": {
"@types/babel__traverse": "7.20.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,19 @@
"name": "[Analytics] record (Kinesis)",
"path": "./dist/esm/analytics/kinesis/index.mjs",
"import": "{ record }",
"limit": "44.56 kB"
"limit": "45.50 kB"
},
{
"name": "[Analytics] record (Kinesis Firehose)",
"path": "./dist/esm/analytics/kinesis-firehose/index.mjs",
"import": "{ record }",
"limit": "41.62 kB"
"limit": "42.50 kB"
},
{
"name": "[Analytics] record (Personalize)",
"path": "./dist/esm/analytics/personalize/index.mjs",
"import": "{ record }",
"limit": "45.50 kB"
"limit": "46.50 kB"
},
{
"name": "[Analytics] identifyUser (Pinpoint)",
Expand Down
244 changes: 0 additions & 244 deletions scripts/setup-dev-rn.js

This file was deleted.

Loading

0 comments on commit 29c8d60

Please sign in to comment.