You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variables for the web application need to go into the `.env` file.
17
17
Variables for the web component can be placed in `.env.webcomponent`.
18
18
19
-
20
19
## Available Scripts
21
20
22
21
In the project directory, you can run:
@@ -44,7 +43,6 @@ Your app is ready to be deployed!
44
43
45
44
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
46
45
47
-
48
46
## Testing
49
47
50
48
Automated unit tests can be run via the `yarn test` command. These unit tests are written using the JavaScript testing framework `Jest` and make use of the tools provided by the [React Testing Library](https://testing-library.com/docs/). Automated accessibility testing for components is available via the `jest-axe` library. This can be achieved using the `haveNoViolations` matcher provided by `jest-axe`, although this does not guarantee that the tested components have no accessibility issues.
@@ -57,35 +55,35 @@ The repo includes the Editor Web Component which shares components with the edit
57
55
58
56
### Embedding
59
57
60
-
The web component can be included in a page by using the `<editor-wc>` HTML element. It takes the following attributes
58
+
The web component can be included in a page by using the `<editor-wc>` HTML element. It takes the following attributes
61
59
62
-
*`code`: A preset blob of code to show in the editor pane.
63
-
*`sense_hat_always_enabled`: Show the Astro Pi Sense HAT emulator on page load
60
+
-`code`: A preset blob of code to show in the editor pane.
61
+
-`sense_hat_always_enabled`: Show the Astro Pi Sense HAT emulator on page load
64
62
65
63
### `yarn start:wc`
66
64
67
-
Runs the web component in development mode. Open [http://localhost:3001](http://localhost:3001) to view it in the browser.
65
+
Runs the web component in development mode. Open [http://localhost:3001](http://localhost:3001) to view it in the browser.
68
66
69
67
**NB** You need to have the main `yarn start` process running too.
70
68
71
-
It is possible to add query strings to control how the web component is configured. Any HTML attribute can be set on the query string, including `class`, `style` etc.
69
+
It is possible to add query strings to control how the web component is configured. Any HTML attribute can be set on the query string, including `class`, `style` etc.
72
70
73
71
For example, to load the page with the Sense Hat always showing, add [`?sense_hat_always_enabled` to the URL](http://localhost:3001?sense_hat_always_enabled)
74
72
75
73
## Deployment
76
74
77
-
Deployment is managed through Github actions. The UI is deployed to staging and production environments via an S3 bucket. This requires the following environment variables to be set
75
+
Deployment is managed through Github actions. The UI is deployed to staging and production environments via an S3 bucket. This requires the following environment variables to be set
78
76
79
-
*`AWS_ACCESS_KEY_ID`
80
-
*`AWS_REGION`
81
-
*`AWS_S3_BUCKET`
82
-
*`AWS_SECRET_ACCESS_KEY`
77
+
-`AWS_ACCESS_KEY_ID`
78
+
-`AWS_REGION`
79
+
-`AWS_S3_BUCKET`
80
+
-`AWS_SECRET_ACCESS_KEY`
83
81
84
-
Other variables that pertain to the app, rather than its deployment are set with defaults in the [build-and-deploy workflow](./.github/workflows/build-and-deploy.yml). These are also in `.env.example`.
82
+
Other variables that pertain to the app, rather than its deployment are set with defaults in the [build-and-deploy workflow](./.github/workflows/build-and-deploy.yml). These are also in `.env.example`.
85
83
86
84
### Review apps
87
85
88
-
Currently the build is deployed to both S3 and Heroku. The PR should get updated with the Heroku URL, and the web component demo is at `/web-component.html` on the Heroku review app domain.
86
+
Currently the build is deployed to both S3 and Heroku. The PR should get updated with the Heroku URL, and the web component demo is at `/web-component.html` on the Heroku review app domain.
0 commit comments