Skip to content

Commit 2fb4f46

Browse files
authored
chore: use "main" for main branch name (#230)
1 parent b736be3 commit 2fb4f46

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

.github/workflows/ci-cd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
workflow_dispatch:
77
branches:
8-
- master
8+
- main
99

1010
jobs:
1111
lint-commits:
@@ -47,7 +47,7 @@ jobs:
4747
needs: build
4848

4949
# don't run on forks
50-
if: ${{ github.repository_owner == 'SmartThingsCommunity' && github.ref == 'refs/heads/master' }}
50+
if: ${{ github.repository_owner == 'SmartThingsCommunity' && github.ref == 'refs/heads/main' }}
5151

5252
runs-on: ubuntu-latest
5353

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ We're always looking for more opinions on discussions in the issue tracker. It's
3434
- This repo is [commitizen friendly](https://github.com/commitizen/cz-cli), so you can use the `cz` cli to help create your commits.
3535
- Lint and test before submitting the pull request by running `$ npm test`
3636
- Write a convincing description of why we should land your pull request. Answer _why_ it's needed and provide use-cases.
37-
- Make the pull request from a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches) (not master)
37+
- Make the pull request from a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches) (not main)
3838
- You might be asked to do changes to your pull request. There's never a need to open another pull request – [just update the existing one.](https://github.com/RichardLitt/knowledge/blob/master/github/amending-a-commit-guide.md)
3939

4040
## [Finding contributions to work on](labels/help%20wanted)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p align="center">
44
<a href="https://www.npmjs.com/package/@smartthings/smartapp"><img src="https://badgen.net/npm/v/@smartthings/smartapp"/></a>
55
<a href="https://www.npmjs.com/package/@smartthings/smartapp"><img src="https://badgen.net/npm/license/@smartthings/smartapp"/></a>
6-
<a href="https://codecov.io/gh/SmartThingsCommunity/smartapp-sdk-nodejs"><img src="https://codecov.io/gh/SmartThingsCommunity/smartapp-sdk-nodejs/branch/master/graph/badge.svg"/></a>
6+
<a href="https://codecov.io/gh/SmartThingsCommunity/smartapp-sdk-nodejs"><img src="https://codecov.io/gh/SmartThingsCommunity/smartapp-sdk-nodejs/branch/main/graph/badge.svg"/></a>
77
<a href="https://status.badgen.net/"><img src="https://badgen.net/xo/status/@smartthings/smartapp"/></a>
88
<a href="https://lgtm.com/projects/g/SmartThingsCommunity/smartapp-sdk-nodejs/context:javascript"><img alt="Language grade: JavaScript" src="https://img.shields.io/lgtm/grade/javascript/g/SmartThingsCommunity/smartapp-sdk-nodejs.svg?logo=lgtm&logoWidth=18"/></a>
99
<a href="https://lgtm.com/projects/g/SmartThingsCommunity/smartapp-sdk-nodejs/alerts/"><img alt="Total alerts" src="https://img.shields.io/lgtm/alerts/g/SmartThingsCommunity/smartapp-sdk-nodejs.svg?logo=lgtm&logoWidth=18"/></a>

docs/V2_RELEASE_NOTES.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@
33
## Summary of major changes
44

55
Version 2.0.0 is a major new release that is not 100% backwardly compatible with the 1.X version, though for most
6-
SmartApps the changes required should be minor. Here are the areas where your app may need to be changed
6+
SmartApps the changes required should be minor. Here are the areas where your app may need to be changed
77
to use the V2 SDK:
88

99
### List methods now return arrays rather than objects with an items property
10-
Methods that return lists now return arrays rather that an object with the properties `items` and `_links`. Paging
11-
is done automatically by the API. The 1.X version of the SDK does not support paging at all in these methods, which
10+
Methods that return lists now return arrays rather that an object with the properties `items` and `_links`. Paging
11+
is done automatically by the API. The 1.X version of the SDK does not support paging at all in these methods, which
1212
can result in missed items, such as when a location has more than 200 devices.
1313

1414
This change was also made for consitency, since not all endpoints used the `items`
1515
object, and for convenience. Since the lists are of limited length and unordered,
16-
paging is of limited practical use. Most applications, such as displaying a sorted display of items require all pages
17-
to be retrieved. In the future methods with potentially unbounded numbers of items with inherient order, such as event
16+
paging is of limited practical use. Most applications, such as displaying a sorted display of items require all pages
17+
to be retrieved. In the future methods with potentially unbounded numbers of items with inherient order, such as event
1818
history, will include a paging mechanism.
1919

2020
### REST API calls are now handled by a separate package
21-
The [@smartthings/core-sdk](https://www.npmjs.com/package/@smartthings/core-sdk) package is now used
21+
The [@smartthings/core-sdk](https://www.npmjs.com/package/@smartthings/core-sdk) package is now used
2222
for all API calls. It can also be used in applications that are not SmartApps or API Access apps and
2323
therefore don't need to use this SDK.
2424

2525
### There's a new HTTP client
2626
As a result of the switch to use the [@smartthings/core-sdk](https://www.npmjs.com/package/@smartthings/core-sdk)
27-
for REST API calls, [Axios](https://www.npmjs.com/package/axios) is now used as the HTTP client rather than
28-
[request-promise-native](https://www.npmjs.com/package/request-promise-native) (which has been deprecated). As a result, the error object has changed. It's now an instance of the
29-
[AxiosError](https://github.com/axios/axios/blob/master/index.d.ts#L76-L92) class, so instead of accessing the
27+
for REST API calls, [Axios](https://www.npmjs.com/package/axios) is now used as the HTTP client rather than
28+
[request-promise-native](https://www.npmjs.com/package/request-promise-native) (which has been deprecated). As a result, the error object has changed. It's now an instance of the
29+
[AxiosError](https://github.com/axios/axios/blob/main/index.d.ts#L76-L92) class, so instead of accessing the
3030
status of an error response with `.catch(error => {error.statusCode})` you'd do so with
3131
`.catch(error => {error.response.status})`.
3232

3333
### All methods return a Promise
34-
All methods now return a Promise. Before there were some methods that returned void. There was also inconsistency
34+
All methods now return a Promise. Before there were some methods that returned void. There was also inconsistency
3535
in the response of methods that returned no data, with some returning an empty obhect `{}`, others returning an
36-
empty string `"`, and still others returning a status value `{"status": "success"}`. Now all such methods return
36+
empty string `"`, and still others returning a status value `{"status": "success"}`. Now all such methods return
3737
a status value.
3838

3939
## Installation
@@ -49,13 +49,13 @@ npm install @smartthings/smartapp@^1.18.0
4949

5050
##Usage
5151

52-
In-general you set up the SmartApp in the same was as before, as described in the
52+
In-general you set up the SmartApp in the same was as before, as described in the
5353
[README file](../README.md). All of the same configuration methods are supported. The major difference
54-
with the 1.X version is in methods that return lists.
54+
with the 1.X version is in methods that return lists.
5555

56-
With the 1.X version of the SDK and object is returned with an `items` property that is an array of the
56+
With the 1.X version of the SDK and object is returned with an `items` property that is an array of the
5757
items in the list and a `_links` proper with a url for the next page of items if there were more than
58-
200 items in the list.
58+
200 items in the list.
5959
```javascript
6060
const result = context.api.devices.list()
6161
for (const item of result.items) {
@@ -69,4 +69,3 @@ for (const item of items) {
6969
// ...
7070
}
7171
```
72-

0 commit comments

Comments
 (0)