Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin expanding Web SDK to be more encompassing of increased functionality in a dynamic (package-ful) way. #273

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions PUBLISH.md

This file was deleted.

62 changes: 52 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@ metaverse server provides global services that connect the users and domains.
See the user docs to [Understand the Architecture](https://docs.vircadia.dev/#understand-the-architecture).

This SDK provides interfaces to:
- Connect to domains.
- Use metaverse services.

- Connect to domains.
- Use metaverse services.

The SDK is written in TypeScript.
- [Project Configuration](CONFIGURATION.md)
- [Coding Standard](CODING_STANDARD.md)

- [Project Configuration](CONFIGURATION.md)
- [Coding Standard](CODING_STANDARD.md)

The SDK is published at NPM: https://www.npmjs.com/package/@vircadia/web-sdk

To learn more about using Vircadia's metaverse ecosystem, see the [Developer Documentation](https://docs.vircadia.dev).


## Prerequisites

### Node.js

https://nodejs.org/en/download/

**Node.js** version ≥ 10.13 ; LTS version ≥ 14.16 recommended
**Node.js** version ≥ 10.13 ; LTS version ≥ 14.16 recommended
**npm** version ≥ 6.4.1 ; LTS version ≥ 6.14 recommended

### Jest

[Jest](https://jestjs.io/) is used for unit testing. It is included as an NPM dev dependency, however, you may also install it globally if you want
to.
to.

## Project Setup

Expand All @@ -50,54 +51,65 @@ sync.

Note: Unix line endings (LF, `0A` character) are used. If using Windows it is recommended that you configure Git's global setting `core.autocrlf` to be `true`. This makes the files use Windows line endings (CRLF, `0D0A` characters) on your computer but stores the files in the Git repo with Linux line endings.


### Install NPM packages

```
npm install
```

Loads all the supporting NPM packages as defined in `package.json` into the `node_modules` directory.

## Development and Testing

### Compile and minify for development

```
npm run build
```

Does a development compile and packages the SDK into the `dist` directory.

### Hot-recompile for development

```
npm run watch
```

Does a development compile and enables webpack to watch the sources and recomile when source files change.
This is often useful when testing SDK development using the `example` tool.

### Compile and minify for production

```
npm run build-prod
```

Does a clean production compile and packages a releasable version of the SDK into the `dist` directory.

### Hot-recompile for production

```
npm run watch-prod
```

Does a clean production compile and enables webpack to watch the sources and recompile when the source files change.

### Clean the build directory

```
npm run clean
```

### Lint files

All files:

```
npm run lint
```

A specific directory or file:

```
npm run lint-path <path>
```
Expand All @@ -106,18 +118,22 @@ npm run lint-path <path>

Unit tests can be run without any external dependencies but integration tests require a domain server to be running on
`localhost` or other location specified in `./tests/test.config.json`. The location and other values of the config JSON can be
overridden with environment variables, using the same property names, but prefixed with "VIRCADIA_".
overridden with environment variables, using the same property names, but prefixed with "VIRCADIA\_".

All tests:

```
npm run test
```

Hot retest of all tests:

```
npm run test-watch
```

Specific tests (e.g., Packet.unit.test.js, all unit tests, all integration tests):

```
npm run test <partial-path>

Expand All @@ -127,19 +143,21 @@ npm run test .integration.
```

Run tests and report open handles:

```
npm run test-debug [<partial-path>]
```


### Generate docs

SDK API documentation:

```
npm run sdkdoc
```

Developer documentation (includes SDK API documentation):

```
npm run devdoc
```
Expand All @@ -151,3 +169,27 @@ Update contributors list in package.json:
```
npm run update-contributors
```

### Publishing to NPM

Build for release:

```
npm run clean
npm run build-prod
```

Package for release:

```
npm pack
```

This creates the SDK package, `vircadia-web-sdk-vvvv.v.v.tgz`.

Publish the package to https://npmjs.com:

```
npm login
npm publish --access public
```
Empty file.