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

Add local config files #180

Merged
merged 23 commits into from
Apr 2, 2018
Merged
Show file tree
Hide file tree
Changes from 6 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
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Generic
node_modules/
*.map

# Project
tokens
targets/standalone/public/tokens
targets/standalone/public/happychat.css
targets/wordpress/assets/happychat.css
stats.json
*.local.json

# Targets dists
targets/**/happychat.css
targets/**/happychat.js
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A JavaScript library to embed customer-facing Happychat in any host.

## How to use it

Take the JavaScript bundle at [targets/dist/happychat.js](./targets/dist/happychat.js) and embed it within your project. It'd expose the `Happychat` global variable:
Take the JavaScript bundle at [targets/browser/happychat.js](./targets/browser/happychat.js) and embed it within your project. It'd expose the `Happychat` global variable:

Happychat.open({
nodeId: '<HTML node ID where the UI will be rendered>',
Expand All @@ -20,8 +20,8 @@ Note that:

### Targets

Two integration targets are implemented in this repository:

Three integration targets are implemented in this repository:
- Browser: Happychat embeddedable library that exposes the Happychat API through browser's `window`.
- Standalone: Happychat embedded in a bare HTML page.
- WordPress: Happychat exposed as a shortcode in a WordPress environment.

Expand Down
8 changes: 7 additions & 1 deletion docs/HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

Topics discussed:

* Configs
* OAuth ID
* Repository layout
* The library renders within an iframe

## Configs
Config files are loaded based on the environment from the `src/config` directory. If you need to override
some of the values you can create a `development.local.json` that will be ignored by git.
See [src/config/README.md](./src/config/README.md) for more info.

## OAuth ID

The standalone target uses the `oauth_client_id` at [targets/standalone/config/index.js](./targets/standalone/config/index.js) to authenticate requests to WordPress.com.
Expand All @@ -21,7 +27,7 @@ The WordPress target doesn't need one because it's a plugin that runs within a W
- `state`: Redux state tree.
- `ui`: React components - these are unconnected to state.
- `targets`: apps that use the Happychat library
- `dist`: the production-ready JS and CSS assets.
- `browser`: the production-ready JS and CSS assets.
- `standalone`: bare HTML page with Happychat embedded.
- `wordpress`: WordPress plugin that exposes `happychat` as a shortcode.

Expand Down
22 changes: 0 additions & 22 deletions index.js

This file was deleted.

Loading