Photoshop Spaces Utils
======================


Usage
-----

Install `spaces-utils` via `npm`:

```bash
# Replace [version] with the latest one from https://git.corp.adobe.com/photoshop/spaces-utils/releases
npm install git+ssh://git@git.corp.adobe.com:photoshop/spaces-utils.git#[version] --save
```

#### Torq

If your project uses `torq-webpack`, you can use `spaces-utils` as a Torq library by adding the
following to your configuration object:

```javascript
config.addLibrary(require("spaces-utils"));
```

You can then import bindings from `spaces-utils` as follows:

```JavaScript
import { debug, warn } from "spaces-utils/log";
import { localize, LANGUAGE } from "spaces-utils/nls";
```

Certain modules require values passed via spaces-utils' configs. See [configs documentation](https://git.corp.adobe.com/photoshop/spaces-utils/blob/master/docs/configs.md) for details.

#### webpack

Another way to use `spaces-utils` is through webpack. [This repo](https://git.corp.adobe.com/photoshop/spaces-adapter-webpack2-example) shows how to configure [`spaces-adapter`](https://git.corp.adobe.com/photoshop/spaces-adapter) and `webpack2`, which will work for `spaces-utils` as well.

Development
-----------

The recommended way for development is working with an existing project that uses `spaces-utils`.

First, download the source code and install the dependencies:

```bash
git clone git@git.corp.adobe.com:photoshop/spaces-utils.git
cd spaces-utils
yarn install # Install dependencies. (https://yarnpkg.com/en/docs/install)
npm link
```

Then, link the local `spaces-utils` folder to your existing project:

```bash
cd path/to/your/project
npm link spaces-utils
gulp watch # replace this line with your project's watch/build command.
```

Now you can start making change to the local `spaces-utils` folder.

Debugging
---------

Please see the [Configs doc](./doc/configs.md).
