-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use prettier for code formatting (#28)
- Loading branch information
Showing
23 changed files
with
194 additions
and
179 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,10 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = { | ||
'extends': './node_modules/@krakenjs/grumbler-scripts/config/.eslintrc.js', | ||
extends: "./node_modules/@krakenjs/grumbler-scripts/config/.eslintrc.js", | ||
|
||
'globals': { | ||
__sdk__: true, | ||
__lebowski_pay__: true | ||
} | ||
globals: { | ||
__sdk__: true, | ||
__lebowski_pay__: true, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,32 +1,32 @@ | ||
name: "publish to npm" | ||
on: workflow_dispatch | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
fetch-depth: 0 | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: ⎔ Setup node | ||
# sets up the .npmrc file to publish to npm | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14" | ||
registry-url: "https://registry.npmjs.org" | ||
- name: ⎔ Setup node | ||
# sets up the .npmrc file to publish to npm | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: 📥 Download deps | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
- name: 📥 Download deps | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Configure git user | ||
run: | | ||
git config --global user.email ${{ github.actor }}@users.noreply.github.com | ||
git config --global user.name ${{ github.actor }} | ||
- name: ▶️ Run release | ||
run: npm run release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Configure git user | ||
run: | | ||
git config --global user.email ${{ github.actor }}@users.noreply.github.com | ||
git config --global user.name ${{ github.actor }} | ||
- name: ▶️ Run release | ||
run: npm run release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
npx lint-staged |
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,5 @@ | ||
build | ||
dist | ||
coverage | ||
flow-typed | ||
CHANGELOG.md |
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 @@ | ||
{} |
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
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
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,47 +1,47 @@ | ||
/* @flow */ | ||
/* eslint import/no-default-export: off */ | ||
|
||
import { getKarmaConfig } from '@krakenjs/grumbler-scripts/config/karma.conf'; | ||
import { getWebpackConfig } from '@krakenjs/grumbler-scripts/config/webpack.config'; | ||
import { getKarmaConfig } from "@krakenjs/grumbler-scripts/config/karma.conf"; | ||
import { getWebpackConfig } from "@krakenjs/grumbler-scripts/config/webpack.config"; | ||
|
||
import type { ExamplePayGlobalType } from './src/types'; | ||
import type { ExamplePayGlobalType } from "./src/types"; | ||
|
||
const examplePayGlobal : ExamplePayGlobalType = { | ||
serverConfig: { | ||
assetsUrl: 'https://paypal.com/assets/' | ||
} | ||
const examplePayGlobal: ExamplePayGlobalType = { | ||
serverConfig: { | ||
assetsUrl: "https://paypal.com/assets/", | ||
}, | ||
}; | ||
|
||
export default (karma : Object) => { | ||
const karmaConfig = getKarmaConfig(karma, { | ||
basePath: __dirname, | ||
webpack: getWebpackConfig({ | ||
vars: { | ||
__example_pay__: examplePayGlobal, | ||
|
||
__PORT__: 8000, | ||
__SDK_HOST__: 'test.paypal.com', | ||
__STAGE_HOST__: 'msmaster.qa.paypal.com', | ||
__HOST__: 'test.paypal.com', | ||
__HOSTNAME__: 'test.paypal.com', | ||
__PATH__: '/sdk/js', | ||
__VERSION__: '1.0.55', | ||
__NAMESPACE__: 'testpaypal' | ||
} | ||
}) | ||
}); | ||
|
||
karma.set({ | ||
...karmaConfig, | ||
|
||
files: [ | ||
{ | ||
pattern: 'test/paypal.js', | ||
included: true, | ||
served: true | ||
}, | ||
|
||
...karmaConfig.files | ||
] | ||
}); | ||
export default (karma: Object) => { | ||
const karmaConfig = getKarmaConfig(karma, { | ||
basePath: __dirname, | ||
webpack: getWebpackConfig({ | ||
vars: { | ||
__example_pay__: examplePayGlobal, | ||
|
||
__PORT__: 8000, | ||
__SDK_HOST__: "test.paypal.com", | ||
__STAGE_HOST__: "msmaster.qa.paypal.com", | ||
__HOST__: "test.paypal.com", | ||
__HOSTNAME__: "test.paypal.com", | ||
__PATH__: "/sdk/js", | ||
__VERSION__: "1.0.55", | ||
__NAMESPACE__: "testpaypal", | ||
}, | ||
}), | ||
}); | ||
|
||
karma.set({ | ||
...karmaConfig, | ||
|
||
files: [ | ||
{ | ||
pattern: "test/paypal.js", | ||
included: true, | ||
served: true, | ||
}, | ||
|
||
...karmaConfig.files, | ||
], | ||
}); | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
] | ||
"extends": ["config:base"] | ||
} |
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 |
---|---|---|
@@ -1,25 +1,26 @@ | ||
/* @flow */ | ||
|
||
import { getClientID } from '@paypal/sdk-client/src'; | ||
import { getClientID } from "@paypal/sdk-client/src"; | ||
|
||
export const ExamplePay = { | ||
render(options : {| buttonText : string |}, container : string) { | ||
|
||
if (!options.buttonText) { | ||
throw new Error(`Expected options.buttonText`); | ||
} | ||
|
||
const el = document.querySelector(container); | ||
render(options: {| buttonText: string |}, container: string) { | ||
if (!options.buttonText) { | ||
throw new Error(`Expected options.buttonText`); | ||
} | ||
|
||
if (!el) { | ||
throw new Error(`Can not find element: ${ container }`); | ||
} | ||
const el = document.querySelector(container); | ||
|
||
el.innerHTML = `<button client-id=${ getClientID() }>${ options.buttonText }</button>`; | ||
if (!el) { | ||
throw new Error(`Can not find element: ${container}`); | ||
} | ||
|
||
el.innerHTML = `<button client-id=${getClientID()}>${ | ||
options.buttonText | ||
}</button>`; | ||
}, | ||
}; | ||
|
||
export const EXAMPLE_CONSTANTS = { | ||
FOO: 'FOO', | ||
BAR: 'BAR' | ||
FOO: "FOO", | ||
BAR: "BAR", | ||
}; |
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,3 +1,3 @@ | ||
/* @flow */ | ||
|
||
export * from './component'; | ||
export * from "./component"; |
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,13 +1,11 @@ | ||
/* @flow */ | ||
|
||
export type ExamplePayServerConfigType = {| | ||
assetsUrl : string | ||
assetsUrl: string, | ||
|}; | ||
|
||
|
||
export type ExamplePayGlobalType = {| | ||
serverConfig : ExamplePayServerConfigType | ||
serverConfig: ExamplePayServerConfigType, | ||
|}; | ||
|
||
|
||
declare var __example_pay__ : ExamplePayGlobalType; | ||
declare var __example_pay__: ExamplePayGlobalType; |
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
Oops, something went wrong.