Skip to content

Commit c1b8708

Browse files
committed
Rename to @rebble/clay and pebble-dev/clay
1 parent b2e9ed2 commit c1b8708

File tree

5 files changed

+36
-57
lines changed

5 files changed

+36
-57
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thanks for checking out Clay. We accept pull requests from anybody, however we a
44
that you follow some conventions when contributing to Clay.
55

66
We have set up a
7-
[piece-of-cake](https://github.com/pebble/clay/issues?q=is%3Aopen+is%3Aissue+label%3Apiece-of-cake)
7+
[piece-of-cake](https://github.com/pebble-dev/clay/issues?q=is%3Aopen+is%3Aissue+label%3Apiece-of-cake)
88
label in GitHub issues for bugs/features that are easy to implement. These issues are
99
a great place to start for people that are new to the codebase.
1010

@@ -13,7 +13,7 @@ a great place to start for people that are new to the codebase.
1313

1414
- [Node](https://nodejs.org) (4.0 and later)
1515
- [Google Chrome](www.google.com/chrome) (To run tests)
16-
- [Pebble SDK](https://developer.pebble.com/sdk/) (optional)
16+
- [Pebble SDK](https://developer.rebble.io/sdk/) (optional)
1717

1818

1919
## Getting Started
@@ -192,7 +192,7 @@ adhering to the style guide.
192192

193193
## Getting Help
194194

195-
- Chat to us in the `#clay` channel on slack. http://slack.pbldev.io/
196-
- Visit the [Pebble Forums](https://forums.pebble.com/)
197-
- Tweet at [@pebbledev](https://twitter.com/pebbledev)
198-
- More options at https://developer.pebble.com/community/online/
195+
- Chat to us in the `#app-dev` channel on Discord. https://discordapp.com/invite/aRUAYFN
196+
- Visit the [Rebble Forums](https://forum.rebble.io/)
197+
- Skeet at [@rebble.io](https://bsky.app/profile/rebble.io)
198+
- More options at https://developer.rebble.io/community/online/

README.md

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,30 @@
11
# Clay
22
Clay is a JavaScript library that makes it easy to add offline configuration pages to your Pebble apps. All you need to get started is a couple lines of JavaScript and a JSON file; no servers or HTML required.
33

4-
Clay will by default automatically handle the 'showConfiguration' and 'webviewclosed' events traditionally implemented by developers to relay configuration settings to the watch side of the app. This step is not required when using Clay, since each config item is given the same `messageKey` as defined in `package.json` (or PebbleKit JS Message Keys on CloudPebble), and is automatically transmitted once the configuration page is submitted by the user. Developers can override this behavior by [handling the events manually](#handling-the-showconfiguration-and-webviewclosed-events-manually).
4+
Clay will by default automatically handle the 'showConfiguration' and 'webviewclosed' events traditionally implemented by developers to relay configuration settings to the watch side of the app. This step is not required when using Clay, since each config item is given the same `messageKey` as defined in `package.json`, and is automatically transmitted once the configuration page is submitted by the user. Developers can override this behavior by [handling the events manually](#handling-the-showconfiguration-and-webviewclosed-events-manually).
55

6-
Clay is distributed as a [Pebble package](https://developer.pebble.com/guides/pebble-packages/) so it is super easy to include in your project. If you are upgrading from v0.1.x of Clay you need to follow the [migration guide](#migrating-from-v01x-to-v1x) before you can get started.
6+
Clay is distributed as a [Pebble package](https://developer.rebble.io/guides/pebble-packages/) so it is super easy to include in your project. If you are upgrading from v0.1.x of Clay you need to follow the [migration guide](#migrating-from-v01x-to-v1x) before you can get started.
77

88
If you would like to contribute to Clay, check out the [contributing guide.](CONTRIBUTING.md)
99

1010
# Getting Started (SDK 3.13 or higher)
1111

12-
1. Run `pebble package install pebble-clay` to install the package in your project
12+
1. Run `pebble package install @rebble/clay` to install the package in your project
1313
2. Create a JSON file called `config.json` and place it in your `src/js` directory.
1414
3. In order for JSON files to work you may need to change a line in your `wscript` from `ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob('src/js/**/*.js'))` to `ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob(['src/js/**/*.js', 'src/js/**/*.json']))`.
1515
4. Your `index.js` (`app.js` in SDK 3) file needs to `require` clay and your config file, then be initialized. Clay will by default automatically handle the 'showConfiguration' and 'webviewclosed' events. Copy and paste the following into the top of your `index.js` file:
1616

1717
```javascript
18-
var Clay = require('pebble-clay');
18+
var Clay = require('@rebble/clay');
1919
var clayConfig = require('./config.json');
2020
var clay = new Clay(clayConfig);
2121
```
2222
5. Ensure `pebble.enableMultiJS` is set to true in your `package.json`.
2323
6. Next is the fun part - creating your config page. Edit your `config.json` file to build a layout of elements as described in the sections below.
24-
7. Make sure you have defined all of your `messageKeys` in your `package.json`. More info on how that works [here.](https://developer.pebble.com/guides/communication/using-pebblekit-js/#defining-keys)
25-
26-
# Getting Started (CloudPebble)
27-
28-
1. Ensure `JS Handling` is set to `CommonJS-style` in your project settings.
29-
2. Under `Dependencies` in the project navigation, enter `pebble-clay` as the `Package Name` and `^1.0.0` for the `Version`. You may use any specific version you like, however using `^1.0.0` will ensure you receive all minor version updates.
30-
4. Create a JavaScript file called `config.js` with the following content. This will act as your config's root array element, from which the rest of the page is built up:
31-
32-
```javascript
33-
module.exports = [];
34-
```
35-
5. Your `index.js` file needs to `require` clay and your config file, then be initialized. Clay will by default automatically handle the 'showConfiguration' and 'webviewclosed' events. Copy and paste the following into the top of your `app.js` file:
36-
37-
```javascript
38-
var Clay = require('pebble-clay');
39-
var clayConfig = require('./config');
40-
var clay = new Clay(clayConfig);
41-
```
42-
6. Next is the fun part - creating your config page. Edit your `config.js` file to build a layout of elements as described in the sections below.
43-
7. Make sure you have defined all of your message keys using `Automatic assignment` in your project settings. More info on how that works [here.](https://developer.pebble.com/guides/communication/using-pebblekit-js/#defining-keys)
44-
45-
# Getting Started (Pebble.js)
46-
If you are using [Pebble.js](https://developer.pebble.com/docs/pebblejs/) and would like to use Clay, The setup process is a little different. Pebble.js does not currently support message keys so you will have to use [v0.1.7](https://github.com/pebble/clay/releases/v0.1.7) of Clay. Follow the instructions in the [readme for that version.](https://github.com/pebble/clay/blob/v0.1.7/README.md)
24+
7. Make sure you have defined all of your `messageKeys` in your `package.json`. More info on how that works [here.](https://developer.rebble.io/guides/communication/using-pebblekit-js/#defining-keys)
4725

4826
# Getting Started (Rocky.js)
49-
If you are using [Rocky.js](https://developer.pebble.com/docs/rockyjs/) and would like to use Clay, please be aware that this is currently unsupported. It is possible to install the Clay package and override the 'showConfiguration' and 'webviewclosed' events and handle them manually, but Rocky.js does not currently support persistent storage, so the settings must be loaded from the phone each time. You can find an example of using Clay with Rocky.js [here](https://github.com/orviwan/rocky-leco-clay).
27+
If you are using [Rocky.js](https://developer.rebble.io/docs/rockyjs/) and would like to use Clay, please be aware that this is currently unsupported. It is possible to install the Clay package and override the 'showConfiguration' and 'webviewclosed' events and handle them manually, but Rocky.js does not currently support persistent storage, so the settings must be loaded from the phone each time. You can find an example of using Clay with Rocky.js [here](https://github.com/orviwan/rocky-leco-clay).
5028

5129
# Creating Your Config File
5230

@@ -369,7 +347,7 @@ The color picker will automatically show a different layout depending on the wat
369347
| id | string (unique) | Set this to a unique string to allow this item to be looked up using `Clay.getItemById()` in your [custom function](#custom-function). |
370348
| messageKey | string (unique) | The AppMessage key matching the `messageKey` item defined in your `package.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByMessageKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
371349
| label | string | The label that should appear next to this item. |
372-
| defaultValue | string OR int | The default color. One of the [64 colors](https://developer.pebble.com/guides/tools-and-resources/color-picker/) compatible with Pebble smartwatches. Always use the uncorrected value even if `sunlight` is true. The component will do the conversion internally. |
350+
| defaultValue | string OR int | The default color. One of the [64 colors](https://developer.rebble.io/guides/tools-and-resources/color-picker/) compatible with Pebble smartwatches. Always use the uncorrected value even if `sunlight` is true. The component will do the conversion internally. |
373351
| description | string | Optional sub-text to include below the component |
374352
| sunlight | boolean | Use the color-corrected sunlight color palette if `true`, else the uncorrected version. Defaults to `true` if not specified. |
375353
| layout | string OR array | Optional. Use a custom layout for the color picker. Defaults to automatically choosing the most appropriate layout for the connected watch. The layout is represented by a two dimensional array. Use `false` to insert blank spaces. You may also use one of the preset layouts by setting `layout` to: `"COLOR"`, `"GRAY"` or `"BLACK_WHITE"` |
@@ -480,7 +458,7 @@ A list of options where a user may choose more than one option to submit.
480458
|----------|------|-------------|
481459
| type | string | Set to `checkboxgroup`. |
482460
| id | string (unique) | Set this to a unique string to allow this item to be looked up using `Clay.getItemById()` in your [custom function](#custom-function). |
483-
| messageKey | string (unique) | The AppMessage key matching the `messageKey` item defined in your `package.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByMessageKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. **NOTE:** The checkboxgroup component will expect you to have defined a `messageKey` in your `package.json` using array syntax. In the example below, the matching entry in the `package.json` would be `favorite_food[3]`. In CloudPebble, you must use `Automatic assignment` for message keys and the `Key Array Length` must match the number of options in the checkboxgroup |
461+
| messageKey | string (unique) | The AppMessage key matching the `messageKey` item defined in your `package.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByMessageKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. **NOTE:** The checkboxgroup component will expect you to have defined a `messageKey` in your `package.json` using array syntax. In the example below, the matching entry in the `package.json` would be `favorite_food[3]`. |
484462
| label | string | The label that should appear next to this item. |
485463
| defaultValue | array of booleans | The default selected items. |
486464
| description | string | Optional sub-text to include below the component |
@@ -605,7 +583,7 @@ The submit button for the page. You **MUST** include this component somewhere in
605583

606584
### Message keys and array syntax
607585

608-
Clay supports (and requires in some cases) the use of array syntax for message keys. Also known as `Automatic assignment` in CloudPebble. More info [here.](https://developer.pebble.com/guides/communication/using-pebblekit-js/#defining-keys)
586+
Clay supports (and requires in some cases) the use of array syntax for message keys. More info [here.](https://developer.rebble.io/guides/communication/using-pebblekit-js/#defining-keys)
609587

610588
You can assign any component that does not return an array to a particular position in your message key. This is done by appending the position (zero indexed) wrapped in brackets to the end of the `messageKey` property. Do **NOT** include any spaces in your `messageKey`.
611589

@@ -685,7 +663,8 @@ Below is the full list of capabilities
685663
| PLATFORM_BASALT | Running on Pebble Time/Pebble Time Steel. |
686664
| PLATFORM_CHALK | Running on Pebble Time Round. |
687665
| PLATFORM_DIORITE | Running on Pebble 2 |
688-
| PLATFORM_EMERY | Running on Time 2. |
666+
| PLATFORM_EMERY | Running on Core Time 2. |
667+
| PLATFORM_FLINT | Running on Core 2 Duo. |
689668
| BW | Running on hardware that supports only black and white. |
690669
| COLOR | Running on hardware that supports 64 colors. |
691670
| MICROPHONE | Running on hardware that includes a microphone. |
@@ -807,7 +786,7 @@ Clay will by default, automatically handle the 'showConfiguration' and 'webviewc
807786
Example:
808787

809788
```javascript
810-
var Clay = require('pebble-clay');
789+
var Clay = require('@rebble/clay');
811790
var clayConfig = require('./config');
812791
var clayConfigAplite = require('./config-aplite');
813792
var clay = new Clay(clayConfig, null, { autoHandleEvents: false });
@@ -862,9 +841,9 @@ Pebble.addEventListener('webviewclosed', function(e) {
862841
| `.config` | Array | Copy of the config passed to the constructor and used for generating the page. |
863842
| `.customFn` | Function | Reference to the custom function passed to the constructor. **WARNING** this is a direct reference, not a copy of the custom function so any modification you make to it, will be reflected on the original as well |
864843
| `.meta` | Object | Contains information about the current user and watch. **WARNING** This will only be populated in the `showConfiguration` event handler. (See example above) |
865-
| `.meta.activeWatchInfo` | watchinfo\|null | An object containing information on the currently connected Pebble smartwatch or null if unavailable. Read more [here](https://developer.pebble.com/docs/js/Pebble/#getActiveWatchInfo). |
866-
| `.meta.accountToken` | String | A unique account token that is associated with the Pebble account of the current user. Read more [here](https://developer.pebble.com/docs/js/Pebble/#getAccountToken). |
867-
| `.meta.watchToken` | String | A unique token that can be used to identify a Pebble device. Read more [here](https://developer.pebble.com/docs/js/Pebble/#getWatchToken). |
844+
| `.meta.activeWatchInfo` | watchinfo\|null | An object containing information on the currently connected Pebble smartwatch or null if unavailable. Read more [here](https://developer.rebble.io/docs/js/Pebble/#getActiveWatchInfo). |
845+
| `.meta.accountToken` | String | A unique account token that is associated with the Pebble account of the current user. Read more [here](https://developer.rebble.io/docs/js/Pebble/#getAccountToken). |
846+
| `.meta.watchToken` | String | A unique token that can be used to identify a Pebble device. Read more [here](https://developer.rebble.io/docs/js/Pebble/#getWatchToken). |
868847
| `.meta.userData` | Any | A deep copy of the arbitrary data provided in the `options.userData`. Defaults to an empty object |
869848
| `.version` | String | The version of Clay currently being used. |
870849

@@ -929,7 +908,7 @@ Make sure to always wait for the config page to be built before manipulating ite
929908
##### app.js
930909

931910
```javascript
932-
var Clay = require('pebble-clay');
911+
var Clay = require('@rebble/clay');
933912
var clayConfig = require('./config');
934913
var customClay = require('./custom-clay');
935914
var userData = {token: 'abc123'}
@@ -992,9 +971,9 @@ This is the main way of talking to your generated config page. An instance of th
992971
| `.EVENTS.AFTER_DESTROY` | String | Dispatched after destroying the page. |
993972
| `.config` | Array | Reference to the config passed to the constructor and used for generating the page. |
994973
| `.meta` | Object | Contains information about the current user and watch |
995-
| `.meta.activeWatchInfo` | watchinfo\|null | An object containing information on the currently connected Pebble smartwatch or null if unavailable. Read more [here](https://developer.pebble.com/docs/js/Pebble/#getActiveWatchInfo). |
996-
| `.meta.accountToken` | String | A unique account token that is associated with the Pebble account of the current user. Read more [here](https://developer.pebble.com/docs/js/Pebble/#getAccountToken). |
997-
| `.meta.watchToken` | String | A unique token that can be used to identify a Pebble device. Read more [here](https://developer.pebble.com/docs/js/Pebble/#getWatchToken). |
974+
| `.meta.activeWatchInfo` | watchinfo\|null | An object containing information on the currently connected Pebble smartwatch or null if unavailable. Read more [here](https://developer.rebble.io/docs/js/Pebble/#getActiveWatchInfo). |
975+
| `.meta.accountToken` | String | A unique account token that is associated with the Pebble account of the current user. Read more [here](https://developer.rebble.io/docs/js/Pebble/#getAccountToken). |
976+
| `.meta.watchToken` | String | A unique token that can be used to identify a Pebble device. Read more [here](https://developer.rebble.io/docs/js/Pebble/#getWatchToken). |
998977
| `.meta.userData` | Any | The data passed in the `options.userData` of the [Clay constructor.](#clayarray-config-function-customfn-object-options) |
999978

1000979

@@ -1067,7 +1046,7 @@ Components are simple objects with the following properties.
10671046
Components must be registered before the config page is built. The easiest way to do this is in your `app.js` after you have initialized Clay:
10681047

10691048
```javascript
1070-
var Clay = require('pebble-clay');
1049+
var Clay = require('@rebble/clay');
10711050
var clayConfig = require('./config.json');
10721051
var clay = new Clay(clayConfig);
10731052

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var autoprefixerOptions = {
2727
};
2828

2929
var stringifyOptions = ['.html', '.tpl', '.css'];
30-
var versionMessage = '/* Clay - https://github.com/pebble/clay - Version: ' +
30+
var versionMessage = '/* Clay - https://github.com/pebble-dev/clay - Version: ' +
3131
clayPackage.version +
3232
' - Build Date: ' + new Date().toISOString() + ' */\n';
3333

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "pebble-clay",
3-
"version": "1.0.4",
2+
"name": "@rebble/clay",
3+
"version": "1.0.5",
44
"description": "Pebble Config Framework",
55
"scripts": {
66
"test-travis": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run --browsers chromeTravisCI",
@@ -15,7 +15,7 @@
1515
},
1616
"repository": {
1717
"type": "git",
18-
"url": "git+https://github.com/pebble/clay.git"
18+
"url": "git+https://github.com/pebble-dev/clay.git"
1919
},
2020
"keywords": [
2121
"pebble",
@@ -26,7 +26,7 @@
2626
"author": "Pebble Technology",
2727
"license": "MIT",
2828
"bugs": {
29-
"url": "https://github.com/pebble/clay/issues"
29+
"url": "https://github.com/pebble-dev/clay/issues"
3030
},
3131
"pebble": {
3232
"projectType": "package",
@@ -46,7 +46,7 @@
4646
"configurable"
4747
]
4848
},
49-
"homepage": "https://github.com/pebble/clay#readme",
49+
"homepage": "https://github.com/pebble-dev/clay#readme",
5050
"devDependencies": {
5151
"autoprefixer": "^10.4.22",
5252
"bourbon": "^4.2.6",

0 commit comments

Comments
 (0)