Skip to content

Commit 47a4cbd

Browse files
authored
Merge pull request #9 from fleetbase/dev-v1.2.6
release v1.2.6
2 parents adb8c0b + a52c694 commit 47a4cbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6217
-464
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
"space-before-function-paren": 0,
2727
"comma-dangle": 0
2828
}
29-
}
29+
}

.github/stale.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ daysUntilStale: 20
44
daysUntilClose: 7
55
# Issues with these labels will never be considered stale
66
exemptLabels:
7-
- pinned
8-
- security
7+
- pinned
8+
- security
99
# Label to use when marking an issue as stale
1010
staleLabel: stale
1111
# Comment to post when marking an issue as stale. Set to `false` to disable
1212
markComment: >
13-
This issue has been automatically marked as stale because it has not had
14-
recent activity. It will be closed if no further activity occurs. Thank you
15-
for your contributions.
13+
This issue has been automatically marked as stale because it has not had
14+
recent activity. It will be closed if no further activity occurs. Thank you
15+
for your contributions.
1616
# Comment to post when closing a stale issue. Set to `false` to disable
17-
closeComment: false
17+
closeComment: false

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: fleetbase-js
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
branches: [master]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [18.x] # Build on Node.js 16
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- uses: actions/cache@v3
27+
id: npm-cache
28+
with:
29+
path: ~/.pnpm-store # Replace this with the path you want to cache
30+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-node-
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v2.0.1
35+
with:
36+
version: latest
37+
38+
- name: Install Dependencies
39+
run: pnpm install
40+
41+
- name: Build
42+
run: pnpm run bundle
43+
44+
npm_publish:
45+
needs: build
46+
runs-on: ubuntu-latest
47+
if: startsWith(github.ref, 'refs/tags/')
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Setup Node.js 18.x
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 18.x
55+
56+
- name: Setup pnpm
57+
uses: pnpm/action-setup@v2.0.1
58+
with:
59+
version: latest
60+
61+
- name: Install Dependencies
62+
run: pnpm install
63+
64+
- name: Build
65+
run: pnpm run bundle
66+
67+
- name: Set up npm
68+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
69+
70+
- name: Publish
71+
run: npm publish --access public
72+
73+
github_publish:
74+
needs: build
75+
runs-on: ubuntu-latest
76+
if: startsWith(github.ref, 'refs/tags/')
77+
steps:
78+
- uses: actions/checkout@v4
79+
80+
- name: Setup Node.js 18.x
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: 18.x
84+
85+
- name: Setup pnpm
86+
uses: pnpm/action-setup@v2.0.1
87+
with:
88+
version: latest
89+
90+
- name: Install Dependencies
91+
run: pnpm install
92+
93+
- name: Build
94+
run: pnpm run bundle
95+
96+
- name: Configure npm for GitHub registry
97+
run: |
98+
echo "@fleetbase:registry=https://npm.pkg.github.com/" >> ~/.npmrc
99+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
100+
101+
- name: Publish to GitHub registry
102+
run: npm publish

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
/.reify-cache
2020
/yarn.lock
2121
/package-lock.json
22-
.DS_Store
22+
.DS_Store
23+
verdaccio

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# compiled output
2+
/dist/
3+
/tmp/
4+
5+
# dependencies
6+
/node_modules/
7+
LICENSE.md
8+
README.md

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
module.exports = {
4+
trailingComma: 'es5',
5+
tabWidth: 4,
6+
semi: true,
7+
singleQuote: true,
8+
printWidth: 190,
9+
};

LICENSE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Copyright (c) 2021 Fleetbase Pte Ltd, All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44

5-
1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6-
2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7-
3) Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
88

9-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ const fleetbase = new Fleetbase('Your Public Key');
4848

4949
// create a place
5050
const speceNeedle = await fleetbase.places.create({
51-
name: 'Space Needle',
52-
street1: '400 Broad Street',
53-
city: 'Seattle',
54-
state: 'WA',
55-
country: 'US'
51+
name: 'Space Needle',
52+
street1: '400 Broad Street',
53+
city: 'Seattle',
54+
state: 'WA',
55+
country: 'US',
5656
});
5757
```
5858

@@ -65,32 +65,32 @@ const fleetbase = new Fleetbase('Your Secret Key');
6565

6666
// create a place
6767
const speceNeedle = await fleetbase.places.create({
68-
name: 'Space Needle',
69-
street1: '400 Broad Street',
70-
city: 'Seattle',
71-
state: 'WA',
72-
country: 'US'
68+
name: 'Space Needle',
69+
street1: '400 Broad Street',
70+
city: 'Seattle',
71+
state: 'WA',
72+
country: 'US',
7373
});
7474
```
7575

7676
## Create a custom adapter
7777

78-
You're able to create a custom adapter to handle network request in the Fleetbase SDK.
78+
You're able to create a custom adapter to handle network request in the Fleetbase SDK.
7979
The Fleetbase SDK ships with two standard adapters. The BrowserAdapter which is based on `fetch()` and
8080
the NodeAdapter based on axios.
8181

8282
```js
8383
import { Adapter } from '@fleetbase/sdk';
8484

8585
class CustomAdapter extends Adapter {
86-
constructor(config) {
87-
super(config);
88-
}
89-
90-
get() {}
91-
post() {}
92-
put() {}
93-
patch() {}
94-
delete() {}
86+
constructor(config) {
87+
super(config);
88+
}
89+
90+
get() {}
91+
post() {}
92+
put() {}
93+
patch() {}
94+
delete() {}
9595
}
9696
```

dist/@fleetbase/sdk.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)