-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added support for state property storage
- Loading branch information
Showing
12 changed files
with
17,020 additions
and
66 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-commits: | ||
if: github.event_name == 'pull_request' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "npm" | ||
- run: npm ci --ignore-scripts | ||
- run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
# add/remove versions as we move support forward | ||
node-version: [16, 18] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npm run lint | ||
- 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 |
---|---|---|
|
@@ -62,4 +62,6 @@ typings/ | |
# next.js build output | ||
.next | ||
|
||
.DS_Store | ||
test/data | ||
|
||
.DS_Store |
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,13 @@ | ||
plugins: | ||
- "@semantic-release/commit-analyzer" | ||
- "@semantic-release/release-notes-generator" | ||
- "@semantic-release/github" | ||
- - "@semantic-release/changelog" | ||
- changelogFile: docs/CHANGELOG.md | ||
- "@semantic-release/npm" | ||
- - "@semantic-release/git" | ||
- assets: ["docs", "package.json"] | ||
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
preset: conventionalcommits | ||
branches: | ||
- main |
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,5 @@ | ||
/* eslint no-undef: 'off' */ | ||
|
||
process.on('unhandledRejection', error => { | ||
fail(error) | ||
}) |
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,8 @@ | ||
module.exports = { | ||
collectCoverageFrom: ['lib/**/*.js'], | ||
coverageReporters: ['json', 'text'], | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: ['test/data'], | ||
testMatch: ['**/test/**/*.[jt]s?(x)'], | ||
setupFiles: ['<rootDir>/config/jest.setup.js'], | ||
} |
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 @@ | ||
export interface ContextObject { | ||
installedAppId: string; | ||
locationId: string | ||
locale: string; | ||
authToken: string; | ||
refreshToken: string; | ||
config: any; | ||
state: any; | ||
} | ||
|
||
export interface FileContextStore { | ||
get(installedAppId: string): Promise<ContextObject>; | ||
put(installedAppId: string, context: ContextObject): Promise<void>; | ||
update(installedAppId: string, context: Partial<ContextObject>): Promise<void>; | ||
delete(installedAppId: string): Promise<void>; | ||
getItem(installedAppId: string, key: string): Promise<any>; | ||
putItem(installedAppId: string, key: string, value: any): Promise<void>; | ||
removeItem(installedAppId: string, key: string): Promise<void>; | ||
removeAllItems(installedAppId: string): Promise<void>; | ||
} |
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.