-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from ma-residence/add-platform-header
Add platform header and more
- Loading branch information
Showing
14 changed files
with
4,795 additions
and
1,849 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": ["transform-class-properties", "transform-flow-strip-types", "transform-object-assign"], | ||
"presets": ["es2015"] | ||
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-flow-strip-types", "@babel/plugin-transform-object-assign"], | ||
"presets": ["@babel/preset-env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: JS-SDK CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
continuous_intergration: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [8, 10, 12] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Check lint | ||
run: npm run lint | ||
|
||
- name: Check static | ||
run: npm run flow | ||
|
||
- name: Check test | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Create npm package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
create_package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set env | ||
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/} | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12' | ||
registry-url: 'https://npm.pkg.github.com' | ||
scope: '@ma-residence' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build package | ||
run: npm run build | ||
|
||
- name: Create index.d.ts | ||
run: npx typescript ./dist/index.js --declaration --allowJs --emitDeclarationOnly --outDir ./dist | ||
|
||
- name: Set package version | ||
run: sed -i 's/RELEASE_VERSION/'"$RELEASE_VERSION"'/g' dist/package.json | ||
|
||
- name: Publish package | ||
run: | | ||
cd dist | ||
npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
node_modules/ | ||
.idea/ | ||
.DS_Store | ||
|
||
*.log | ||
dist/* | ||
!dist/package.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# js-sdk | ||
|
||
[![Build Status](https://travis-ci.com/ma-residence/js-sdk.svg?token=txabW3XnmBRNYuhMQNLm&branch=master)](https://travis-ci.com/ma-residence/js-sdk) | ||
|
||
A SDK for ma-residence API in Javascript. | ||
|
||
# Installation | ||
## Installation | ||
|
||
Update your bower.json: | ||
- Edit or create the .npmrc file and add these lines | ||
``` | ||
registry=https://registry.npmjs.org/ | ||
@ma-residence:registry=https://npm.pkg.github.com/ | ||
``` | ||
|
||
```json | ||
{ | ||
"dependencies": { | ||
"mr-js-sdk": "[email protected]:ma-residence/js-sdk.git" | ||
} | ||
} | ||
- Login to github: *The username is your github username, the password this your personal access token and the email this your github account email* | ||
``` | ||
npm login --registry=https://npm.pkg.github.com --scope=@ma-residence | ||
``` | ||
|
||
- Install package | ||
``` | ||
npm install @ma-residence/[email protected] | ||
# or | ||
npm add @ma-residence/[email protected] | ||
``` | ||
|
||
# Usage | ||
|
@@ -91,6 +97,7 @@ client.request("/foo", { | |
body: { | ||
foo: "foo" | ||
}, | ||
platform: "platform" | ||
}).then(function(response) { | ||
// Here you can check the response status, etc. | ||
// And we return the deserialize content | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@ma-residence/mr-js-sdk", | ||
"version": "1.0.5", | ||
"description": "ma-residence.fr js SDK", | ||
"main": "index.js", | ||
"publishConfig": { | ||
"registry": "https://npm.pkg.github.com/ma-residence" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "shh://github.com/ma-residence/js-sdk.git", | ||
"directory": "@ma-residence/mr-js-sdk" | ||
}, | ||
"author": "ma-residence", | ||
"license": "UNLICENSED", | ||
"bugs": { | ||
"url": "https://github.com/ma-residence/js-sdk/issues" | ||
}, | ||
"homepage": "https://github.com/ma-residence/js-sdk#readme" | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.