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

Public warehouse Package Configuration #59

Merged
merged 15 commits into from Jun 3, 2019
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# CHANGELOG

- [#59] Add documentation on what goes into a specific package
- Add proper swagger route for optional path variable `/assets/files` route
- [#57] Update `README.md`
- Add badges
Expand All @@ -21,3 +22,4 @@
[#53]: https://github.com/godaddy/warehouse.ai/pull/53
[#54]: https://github.com/godaddy/warehouse.ai/pull/54
[#57]: https://github.com/godaddy/warehouse.ai/pull/57
[#59]: https://github.com/godaddy/warehouse.ai/pull/59
42 changes: 42 additions & 0 deletions README.md
Expand Up @@ -51,6 +51,7 @@ painless as possible when issues arise.
- [Warehouse.ai Internals](#warehouseai-internals)
- [Data Models](#data-models)
- [Config options](#config-options)
- [Getting a package `warehouse.ai`-ready](#https://github.com/godaddy/warehouse.ai/tree/package-docs#getting-a-package-warehouseai---ready)
SivanMehta marked this conversation as resolved.
Show resolved Hide resolved
SivanMehta marked this conversation as resolved.
Show resolved Hide resolved
- [Local development environment](#local-development-environment)
- [Running tests](#running-tests)

Expand Down Expand Up @@ -351,6 +352,47 @@ Warehouse has the ability to use [passport-npm] to check authorization when
connecting via `npm`. An example of this can be found in the
[tests for npm auth][auth].

## Getting a package `warehouse.ai` - ready
SivanMehta marked this conversation as resolved.
Show resolved Hide resolved

Let's take a client-side package and augment it so that it can be properly consumed in `warehouse.ai`. In this case, we will be
SivanMehta marked this conversation as resolved.
Show resolved Hide resolved

- Building with `webpack`
- Localizing for 2 different locales `en-US`, and `es-MX`.
- Defaulting to minified files in test and production

First, add these parameters in your `package.json`:

```json
{
"scripts": {
"build": "webpack"
},
"build": "webpack",
"locales": [
"en-US",
"es-MX"
],
"publishConfig": {
"registry": "https://wherever-you-deployed-warehouse.ai"
}
}
```

This indicates to `warehouse.ai` that you're building with `webpack` for the appropriate locales. TODO: webpack config, other build types.
SivanMehta marked this conversation as resolved.
Show resolved Hide resolved

Next, add a `wrhs.toml` at the top-level directory, with following contents, indicating which assets are to be served by default in each environment:

```toml
[files]
dev = ['dist/css/compiled-code.css', 'dist/js/compiled-code.js']
test = ['dist/css/compiled-code.min.css', 'dist/js/compiled-code.min.js']
prod = ['dist/css/compiled-code.min.css', 'dist/js/compiled-code.min.js']
```

You see the full enumeration of options available [here](https://github.com/warehouseai/extract-config#wrhstoml).

That's literally it. You can now follow the guide for [releasing code](#releasing-code).

## Tests

Running the tests will require a running cassandra instance on your local
Expand Down