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
add scripts for specifically running integration tests, remove one last CDN link to aws-sdk and use the local version, and update docs as needed for the new ESM format without a required build
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,11 +66,14 @@ npm install
66
66
67
67
### Building
68
68
69
-
To build all packages in the repository, run:
69
+
The Host libraries work without a build. Only the Babylon Hosts library has a build step for generating type definition files, which is totally optional for use in TypeScript projects.
70
+
71
+
To run the build (which runs only the Babylon Host lib's type declaration build step), run:
70
72
```
71
73
npm run build
72
74
```
73
-
Distributable build artifacts will be generated into a `dist/` directory within each package folder.
75
+
76
+
Distributable build artifacts (type declaration files) will be generated into a `dist/` directory inside the Babylon Host lib.
74
77
75
78
### Testing
76
79
@@ -82,12 +85,14 @@ Example applications for Babylon.js can be found in the `packages/demos-babylon/
82
85
83
86
#### Unit Tests
84
87
85
-
If you've already built the packages, you can execute the unit tests for all packages using the command:
88
+
You can execute the unit tests for all packages using the command:
86
89
```
87
-
npm run test
90
+
npm test
88
91
```
89
92
90
-
Alternately, you can both build and run the unit tests with a single command:
93
+
Running the build is not necessary for running tests, as all source files as JavaScript modules that work as-is without transformation.
94
+
95
+
You can run both the Babylon build and the unit tests with a single command to ensure both work at the same time:
Copy file name to clipboardExpand all lines: README.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
3
3
Amazon Sumerian Hosts (Hosts) is an experimental open source project that aims to make it easy to create interactive animated 3D characters for Babylon.js, three.js, and other web 3D frameworks. It leverages AWS services including [Amazon Polly](https://aws.amazon.com/polly/) (text-to-speech) and [Amazon Lex](https://aws.amazon.com/lex/) (chatbot).
4
4
5
+
<!-- CONTINUE Update this after the Babylon fix -->
5
6
> **Compatibility**
6
7
>
7
-
> ⚠️ Hosts is currently compatible with **BabylonJS v4** (4.2.1+). There are know issues if you try to use Hosts with BabylonJS v5. If you would like to see support for BabylonJS v5 added, comment on [this enhancement request issue](https://github.com/aws-samples/amazon-sumerian-hosts/issues/155).
8
+
> ⚠️ Hosts is currently compatible with **BabylonJS v4** (4.2.1+). There are known issues if you try to use Hosts with BabylonJS v5. If you would like to see support for BabylonJS v5 added, comment on [this enhancement request issue](https://github.com/aws-samples/amazon-sumerian-hosts/issues/155).
8
9
>
9
10
> ✏️ Hosts have been tested with **Three.js v0.127.0**.
10
11
@@ -34,7 +35,7 @@ The easiest way to get started using the hosts is by using plugins we provide fo
34
35
35
36
Visit the [aws-tools-for-babylonjs-editor](https://github.com/aws-samples/aws-tools-for-babylonjs-editor/blob/main/README.md) repository for more details.
36
37
37
-
#### Using pre-built NPM modules
38
+
#### Using NPM modules
38
39
39
40
If you are creating applications outside of the Babylon.JS Editor, you can easily install the relevant Hosts module using NPM.
40
41
@@ -56,7 +57,20 @@ For full detail on the classes and methods available, see the [API Documentation
56
57
57
58
#### Building from source
58
59
59
-
Building from source is considered an advanced option. It is not recommended unless you need to heavily customize the core Hosts functionality. Instructions on how to build from source can be found in the [CONTRIBUTING](CONTRIBUTING.md) document.
60
+
Both the core Host lib and the Three.js Host lib do not have a build. You can
61
+
customize them by simply editing the .js files in your own fork, and simply
62
+
running a static server to run the apps.
63
+
64
+
The Babylon Host lib has a TypeScript build step *only* for creating output
65
+
type definitions from its .js files, and is otherwise not required for running
66
+
the Babylon demos: simply edit the JavaScript files, and start the static
67
+
server to run the demos.
68
+
69
+
If you need to build the type definitions for consumption in a TypeScript
70
+
project, then run `npm run build` at the root of the repo (after first running
71
+
`npm install` if you haven't already).
72
+
73
+
Find more details in [CONTRIBUTING](CONTRIBUTING.md).
Copy file name to clipboardExpand all lines: packages/amazon-sumerian-hosts-babylon/README.md
+70-34Lines changed: 70 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,49 +22,77 @@ More details can be found in [demos-babylon](https://github.com/aws-samples/amaz
22
22
23
23
Before you use Hosts in your applications, you will need to set up a few thing in your AWS account. For step-by-step instructions on setting up this required infrastructure, see [AWS-Infrastructure-Setup.md](https://github.com/aws-samples/amazon-sumerian-hosts/tree/mainline2.0/AWS-Infrastructure-Setup.md) in the root of this repository.
24
24
25
-
###Configurating the AWS SDK
25
+
## Configurating the Babylon HOST app
26
26
27
-
## Configuring Webpack
28
-
29
-
We recommend using a module bundler such as [Webpack](https://webpack.js.org/) to package and distribute your code. As BabylonJS relies on static singletons for certain features, it may be necessary to configure Webpack so that all modules and submodules use the same instance of BabylonJS. Add the following to `module.exports.resolve`:
30
-
31
-
```
32
-
resolve: {
33
-
...
34
-
modules: ['node_modules'],
35
-
alias: {
36
-
// configure all modules to point at the same instance of BabylonJS
The hosts will need to connect to Amazon Polly to convert text into audio assets. https://sdk.amazonaws.com/js/aws-sdk-2.645.0.min.js is a minified build of the AWS SDK for Javascript. For the latest version, see the [AWS SDK for JavaScript API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/).
56
-
57
-
And then configure the AWS SDK with our region and credentials:
40
+
This file has to be included first, so that it is available by the time the
41
+
rest of our code runs.
58
42
59
-
-```javascript
60
-
// Initialize AWS and create Polly service objects
Replace `<Enter Cognito Identity Pool ID here>` with the id you created in the [Prerequisites](#Prerequisites) section. Make sure to set the region to the one you created your Cognito Identity Pool in. Using CognitoIdentityCredentials is just one example of how you can authenticate your host to access Polly. See the [AWS SDK documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html) to see other credentials classes you can use.
59
+
The `importmap` script defines where dependencies are to be found, so
60
+
that code that has `import` statements will receive the expected libraries. For
61
+
example, the `imports.three` entry in the following import map (which is in JSON
62
+
format) defines where the `three` library will be fetched from when an import
63
+
statement like `import * as THREE from 'three'` is encountered in JavaScript.
64
+
For more info on import maps, see [Mozilla's import map
> Here the `cognitoIdentityPoolId` variable will contain the id you created and placed inside of `demo-credentials.js` in the [Prerequisites](#Prerequisites) section. Make sure to set the region to the one you created your Cognito Identity Pool in. Using CognitoIdentityCredentials is just one example of how you can authenticate your host to access Polly. See the [AWS SDK documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html) to see other credentials classes you can use.
68
96
69
97
### Instantiating the Host
70
98
@@ -172,6 +200,14 @@ Then, you can setup a simple button used for recording microphone input purpose
172
200
LexFeature also supports text input as well as a list of other events for tracking recording state for instance. See [LexFeature](https://aws-samples.github.io/amazon-sumerian-hosts/core_LexFeature.html) for more details.
173
201
174
202
### Next Steps
203
+
175
204
Now that you've demonstrated your hosts running locally, consider publishing them to the web via one of these related tutorials:
176
-
-[Publishing a Web Application Using AWS Amplify](https://docs.sumerian.amazonaws.com/tutorials/create/solutions/gltf-viewer-amplify-public/)
177
-
-[Privately Publish a Web Application Using AWS Amplify](https://docs.sumerian.amazonaws.com/tutorials/create/solutions/gltf-viewer-amplify-private/)
205
+
206
+
-[Hosting a static site on AWS Amplify](https://aws.amazon.com/getting-started/hands-on/host-static-website/)
207
+
-[Creating a static GitHub Pages site](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site)
208
+
-[Publishing a static site on Vercel from git](https://vercel.com/docs/deployments/git)
209
+
210
+
If you're more advanced, you probably want to set up a server that contains your
211
+
AWS key privately, so that it is not served publicy in via a static website.
212
+
You'd want to require user authentication, and proxy request through your server
213
+
so that the client-side code does not contain the key.
Copy file name to clipboardExpand all lines: packages/amazon-sumerian-hosts-babylon/test/integration_test/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,6 @@ npm install
16
16
17
17
## Running the Tests
18
18
19
-
Run `npm run start-babylon` from the repository root. This will start a local web server and open two tabs in your browser. One will provide a list of demos (from the `packages/demos-babylon` package.) The other will be the list of available integration tests. From this tab you can access and exercise each test.
19
+
Run `npm run start-babylon-tests` from the repository root. The tab will provide a list of available integration tests. From this tab you can access and exercise each test.
20
20
21
21
When you're finished runnin the tests, you can quit the local dev server by pressing CTRL-C in the same terminal in which you started the server.
Copy file name to clipboardExpand all lines: packages/amazon-sumerian-hosts-core/README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,13 @@ For a general introduction to Amazon Sumerian Hosts and examples of how to integ
4
4
5
5
Amazon Sumerian Hosts is an experimental open source project that aims to make it easy to create interactive animated 3D characters that can be rendered on the Web and leverage AWS Services such as [Amazon Polly](https://aws.amazon.com/polly/). The core API provides an abstraction layer so that these can be extended to support the Web rendering engine of your choice.
6
6
7
-
Refer to the [API Documentation](https://aws-samples.github.io/amazon-sumerian-hosts/) for more detailed information on the classes and methods available. Amazon Sumerian Hosts is a published [npm](https://www.npmjs.com/) package, so alternatively you can install in an existing Node.js project by running `npm install --save-dev @amazon-sumerian-hosts/core`. If you'd like to pull the GitHub repository and create your own build, see [Building the Repository](https://github.com/aws-samples/amazon-sumerian-hosts/blob/mainline2.0/README.md#building-the-repository) for prerequisites and instructions on how to do that.
7
+
Refer to the [API Documentation](https://aws-samples.github.io/amazon-sumerian-hosts/) for more detailed information on the classes and methods available. Amazon Sumerian Hosts is a published [npm](https://www.npmjs.com/) package, so alternatively you can install in an existing Node.js project by running `npm install --save-dev @amazon-sumerian-hosts/core`.
8
+
9
+
If you'd like to pull the GitHub repository and customize the hosts, a build is
10
+
not required unless you want to generate type defintions for use in TypeScript,
11
+
and the demos simply run on their own without a build step. See [Building from
Copy file name to clipboardExpand all lines: packages/amazon-sumerian-hosts-core/test/integration_test/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ npm install
18
18
19
19
Run `npm run start-core` from the repository root. This will start a local web server and open a web browser tab containing a list of available integration tests. From this tab you can access and exercise each test.
20
20
21
-
When you're finished runnin the tests, you can quit the local dev server by pressing CTRL-C in the same terminal in which you started the server.
21
+
When you're finished running the tests, you can quit the local dev server by pressing CTRL-C in the same terminal in which you started the server.
0 commit comments