Skip to content

Commit 2be5f94

Browse files
committed
feat!: publish on npm
BREAKING CHANGE: please update your registry url to use the public registry instead of the private
1 parent 08cbd6c commit 2be5f94

13 files changed

+84
-48
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

33
#build
4-
**/build
4+
packages/**/build
5+
packages/**/docs
6+
packages/**/README.md
57

68
# dependencies
79
/node_modules

.yarnrc

-3
This file was deleted.

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ Take control of your Hubstairs Display.
55
- [Foreword](#foreword)
66
- [About](#about)
77
- Integrations
8-
- [React](./docs/REACT_INTEGRATION.md)
9-
- [Advanced](./docs/ADVANCED_INTEGRATION.md)
8+
- [React](docs/REACT_INTEGRATION.md)
9+
- [Advanced](docs/ADVANCED_INTEGRATION.md)
1010
- [Installation](#installation)
1111
- [Getting Started](#getting-started)
1212
- [Browser Support](#browser-support)
1313
- [Troubleshooting](#troubleshooting)
14-
- [Display Controller API](./docs/API.md#display-controller-api)
15-
- [Constructor](./docs/API.md#constructor)
16-
- [Events](./docs/API.md#events)
17-
- [Functions](./docs/API.md#functions)
18-
- [Contributing](./docs/CONTRIBUTING.md)
14+
- [Display Controller API](docs/API.md#display-controller-api)
15+
- [Constructor](docs/API.md#constructor)
16+
- [Events](docs/API.md#events)
17+
- [Functions](docs/API.md#functions)
18+
- [Contributing](docs/CONTRIBUTING.md)
1919

2020
## Foreword
2121

22-
This documentation evolves along with the development of the [Display Controller API](./docs/API.md#display-controller-api). This means that you can find options or features that are pretty new and they may not be totally stable. To mark those new things we use the following `badges`:
22+
This documentation evolves along with the development of the [Display Controller API](docs/API.md#display-controller-api). This means that you can find options or features that are pretty new and they may not be totally stable. To mark those new things we use the following `badges`:
2323

2424
- ![draft] : documentation is still "Work in progress" (it concerns only the documentation)
2525
- ![beta] : early option/feature, its usage may change
@@ -36,7 +36,7 @@ Features:
3636
- Access to content information
3737
- Call functions
3838

39-
Info: If you use `React` on your website, we recommend you to follow the [`React integration instructions`](./docs/REACT_INTEGRATION.md) instead. It allows you to manipulate your Display as a Component and keep the exact same features.
39+
Info: If you use `React` on your website, we recommend you to follow the [`React integration instructions`](docs/REACT_INTEGRATION.md) instead. It allows you to manipulate your Display as a Component and keep the exact same features.
4040

4141
## Installation
4242

@@ -48,11 +48,11 @@ npm i @hubstairs/display-js
4848
yarn add @hubstairs/display-js
4949
```
5050

51-
Info: If you do not use `npm` as a package manager, you can follow the [script integration instructions](./docs/ADVANCED_INTEGRATION.md#using-a-cdn)
51+
Info: If you do not use `npm` as a package manager, you can follow the [script integration instructions](docs/ADVANCED_INTEGRATION.md#using-a-cdn)
5252

5353
## Getting started
5454

55-
After having set your Display up on [Hubstairs™](https://app.hubstairs.com) you will received your `display id` and your access `token`. Those information are needed to instantiate your Display. Pass the parent `DOM element` to the [Display constructor](./docs/API#constructor).
55+
After having set your Display up on [Hubstairs™](https://app.hubstairs.com) you will received your `display id` and your access `token`. Those information are needed to instantiate your Display. Pass the parent `DOM element` to the [Display constructor](docs/API#constructor).
5656

5757
```html
5858
<div id="display">
@@ -90,7 +90,7 @@ display.nextScene().then(() => {
9090
})
9191
```
9292

93-
To go further there are [few advanced integration](./docs/ADVANCED_INTEGRATION.md) mode.
93+
To go further there are [few advanced integration](docs/ADVANCED_INTEGRATION.md) mode.
9494

9595
## Browser Support
9696

docs/ADVANCED_INTEGRATION.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Already have a Display on the page? Pass the iframe to the Display constructor and you are ready to go.
66

7-
> ⚠ This mode is incompatible with [`responsive` option](./API.md#constructor)
7+
> ⚠ This mode is incompatible with [`responsive` option](API.md#constructor)
88
99
```html
1010
<iframe
@@ -28,7 +28,7 @@ Already have a Display on the page? Pass the iframe to the Display constructor a
2828

2929
## Automatically with HTML attributes
3030

31-
When the library loads, it will scan your page for elements with Hubstairs attributes. Each element must have at least a `data-hubstairs-displayid` or `data-hubstairs-url` attribute to create the Display automatically. You can also add attributes for any of the [Display constructor options](./API.md#constructor) prefixed with `data-hubstairs`.
31+
When the library loads, it will scan your page for elements with Hubstairs attributes. Each element must have at least a `data-hubstairs-displayid` or `data-hubstairs-url` attribute to create the Display automatically. You can also add attributes for any of the [Display constructor options](API.md#constructor) prefixed with `data-hubstairs`.
3232

3333
```html
3434
<div data-hubstairs-displayid="5e417dbac5d2651adbe509ec" id="display"></div>

lerna.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"packages": [
55
"packages/*"
66
],
7+
"changelogPreset": "conventionalcommits",
78
"version": "0.2.0"
89
}

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"private": true,
44
"version": "0.0.0",
55
"license": "MIT",
6+
"homepage": "https:/www.hubstairs.com",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/hubstairs/display-controller.git"
10+
},
611
"author": "Guillaume HERTAULT <[email protected]>",
712
"workspaces": [
813
"packages/*"
@@ -14,6 +19,7 @@
1419
"@babel/core": "^7.11.1",
1520
"@babel/preset-env": "^7.11.0",
1621
"babel-eslint": "^10.1.0",
22+
"conventional-changelog-conventionalcommits": "^4.4.0",
1723
"eslint": "^7.6.0",
1824
"eslint-config-prettier": "^6.11.0",
1925
"eslint-plugin-compat": "^3.8.0",

packages/display-js/package.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
{
22
"name": "@hubstairs/display-js",
33
"version": "0.2.0",
4+
"homepage": "https:/www.hubstairs.com",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/hubstairs/display-controller.git"
8+
},
49
"description": "Interact with and control an embedded Hubstairs display.",
510
"license": "MIT",
611
"author": "Guillaume HERTAULT <[email protected]>",
712
"scripts": {
813
"start": "NODE_ENV=development rollup -c --watch",
14+
"prebuild": "cp ../../README.md . && cp -R ../../docs .",
915
"build": "NODE_ENV=production rollup -c",
1016
"lint": "eslint src",
1117
"test": "jest --config ../../jest.config.js --rootDir ."
1218
},
13-
"main": "build/display.js",
14-
"module": "build/display.esm.js",
19+
"main": "build/index.js",
20+
"module": "build/index.esm.js",
1521
"files": [
22+
"docs",
1623
"build"
1724
],
1825
"keywords": [
@@ -24,6 +31,9 @@
2431
"javascript",
2532
"postMessage"
2633
],
34+
"publishConfig": {
35+
"access": "public"
36+
},
2737
"devDependencies": {
2838
"@babel/cli": "^7.10.5",
2939
"@babel/core": "^7.11.1",

packages/display-js/rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import filesize from 'rollup-plugin-filesize'
77
import pkg from './package.json'
88

99
const globalName = 'Hubstairs.Controller'
10-
const input = './src/display.js'
10+
const input = './src/index.js'
1111

1212
const name = `${pkg.name} v${pkg.version}`
1313
const copyright = `(c) ${new Date().getFullYear()} Hubstairs`
File renamed without changes.

packages/display-js/src/display.test.js renamed to packages/display-js/src/index.test.js

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
/*global html*/
22

3-
import Display from './display'
3+
import Display from './index'
44
import { HubstairsError } from './lib/functions'
55

66
describe('constructor', () => {
77
test('accepts only Hubstairs embeds', () => {
88
expect(() => {
9-
void new Display(
10-
html`
11-
<div data-hubstairs-initialized><iframe></iframe></div>
12-
`,
13-
)
9+
void new Display(html` <div data-hubstairs-initialized><iframe></iframe></div> `)
1410
}).toThrow()
1511

1612
expect(() => {
1713
void new Display('string')
1814
}).toThrow()
1915

2016
expect(() => {
21-
void new Display(
22-
html`
23-
<iframe></iframe>
24-
`,
25-
)
17+
void new Display(html` <iframe></iframe> `)
2618
}).toThrow()
2719

2820
expect(() => {
29-
void new Display(
30-
html`
31-
<iframe src="https://www.youtube.com/embed/Uj3_KqkI9Zo"></iframe>
32-
`,
33-
)
21+
void new Display(html` <iframe src="https://www.youtube.com/embed/Uj3_KqkI9Zo"></iframe> `)
3422
}).toThrow()
3523
})
3624

@@ -81,11 +69,7 @@ describe('constructor', () => {
8169
})
8270

8371
test('throws if displayId is bad', async () => {
84-
const display1 = new Display(
85-
html`
86-
<div data-hubstairs-displayid="guihash"></div>
87-
`,
88-
)
72+
const display1 = new Display(html` <div data-hubstairs-displayid="guihash"></div> `)
8973
await expect(display1.ready()).rejects.toThrow()
9074
})
9175
})
@@ -94,11 +78,7 @@ describe('methods', () => {
9478
test('future calls to destroyed display should not not work', async () => {
9579
expect.assertions(4)
9680

97-
const display1 = new Display(
98-
html`
99-
<iframe id="to-destroy" src="https://display.hubstairs.com/v1/1234"></iframe>
100-
`,
101-
)
81+
const display1 = new Display(html` <iframe id="to-destroy" src="https://display.hubstairs.com/v1/1234"></iframe> `)
10282

10383
await expect(display1.destroy()).resolves.toBeUndefined()
10484
expect(document.querySelector('#to-destroy')).toBeFalsy()

packages/display-js/src/lib/embed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export function initializeEmbeds(parent = document) {
142142
* @return {void}
143143
*/
144144
export function resizeEmbeds(parent = document) {
145-
// Prevent execution if users include the display.js script multiple times.
145+
// Prevent execution if users include the display script multiple times.
146146
if (window.HubstairsDisplayResizeEmbeds_) {
147147
return
148148
}

packages/display-react/package.json

+11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
{
22
"name": "@hubstairs/display-react",
33
"version": "0.2.0",
4+
"homepage": "https:/www.hubstairs.com",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/hubstairs/display-controller.git"
8+
},
9+
"url": "https://github.com/hubstairs/display-controller",
410
"description": "Interact with and control an embedded Hubstairs display with a React component.",
511
"license": "MIT",
612
"author": "Guillaume HERTAULT <[email protected]>",
713
"scripts": {
814
"start": "NODE_ENV=development rollup -c --watch",
15+
"prebuild": "cp ../../README.md . && cp -R ../../docs .",
916
"build": "NODE_ENV=production rollup -c",
1017
"lint": "eslint src",
1118
"test": "jest --config ../../jest.config.js --rootDir . --passWithNoTests"
1219
},
1320
"main": "build/index.js",
1421
"module": "build/index.esm.js",
1522
"files": [
23+
"docs",
1624
"build"
1725
],
1826
"keywords": [
@@ -43,6 +51,9 @@
4351
"rollup": "^2.25.0",
4452
"rollup-plugin-filesize": "^9.0.2"
4553
},
54+
"publishConfig": {
55+
"access": "public"
56+
},
4657
"peerDependencies": {
4758
"react": ">= 16.8"
4859
},

yarn.lock

+29
Original file line numberDiff line numberDiff line change
@@ -3851,6 +3851,14 @@ compare-func@^1.3.1:
38513851
array-ify "^1.0.0"
38523852
dot-prop "^3.0.0"
38533853

3854+
compare-func@^2.0.0:
3855+
version "2.0.0"
3856+
resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3"
3857+
integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==
3858+
dependencies:
3859+
array-ify "^1.0.0"
3860+
dot-prop "^5.1.0"
3861+
38543862
compare-versions@^3.6.0:
38553863
version "3.6.0"
38563864
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62"
@@ -3917,6 +3925,15 @@ conventional-changelog-angular@^5.0.3:
39173925
compare-func "^1.3.1"
39183926
q "^1.5.1"
39193927

3928+
conventional-changelog-conventionalcommits@^4.4.0:
3929+
version "4.4.0"
3930+
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz#8d96687141c9bbd725a89b95c04966d364194cd4"
3931+
integrity sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==
3932+
dependencies:
3933+
compare-func "^2.0.0"
3934+
lodash "^4.17.15"
3935+
q "^1.5.1"
3936+
39203937
conventional-changelog-core@^3.1.6:
39213938
version "3.2.3"
39223939
resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz#b31410856f431c847086a7dcb4d2ca184a7d88fb"
@@ -4350,6 +4367,13 @@ dot-prop@^4.2.0:
43504367
dependencies:
43514368
is-obj "^1.0.0"
43524369

4370+
dot-prop@^5.1.0:
4371+
version "5.2.0"
4372+
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb"
4373+
integrity sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==
4374+
dependencies:
4375+
is-obj "^2.0.0"
4376+
43534377
[email protected], duplexer@^0.1.1:
43544378
version "0.1.1"
43554379
resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
@@ -5908,6 +5932,11 @@ is-obj@^1.0.0, is-obj@^1.0.1:
59085932
resolved "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
59095933
integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8=
59105934

5935+
is-obj@^2.0.0:
5936+
version "2.0.0"
5937+
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982"
5938+
integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==
5939+
59115940
is-plain-obj@^1.0.0, is-plain-obj@^1.1.0:
59125941
version "1.1.0"
59135942
resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"

0 commit comments

Comments
 (0)