Compare commits
49 Commits
@nhost/rea
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57780ee645 | ||
|
|
aad8d22380 | ||
|
|
85d33c4de0 | ||
|
|
ab3e2dcee9 | ||
|
|
12f4504b61 | ||
|
|
71d7a11c96 | ||
|
|
16a6c5073e | ||
|
|
3fcc86792a | ||
|
|
27909128e4 | ||
|
|
72371c72a1 | ||
|
|
d878414b10 | ||
|
|
47c57ff665 | ||
|
|
1cb330016b | ||
|
|
497652d1b4 | ||
|
|
20eb7aa381 | ||
|
|
4a3c2f92b1 | ||
|
|
5647e64265 | ||
|
|
c113debf46 | ||
|
|
3f0ae4a58c | ||
|
|
3d5b8183e8 | ||
|
|
789ef8f783 | ||
|
|
94df175ca3 | ||
|
|
c8bcefb0e5 | ||
|
|
fc52f59eb8 | ||
|
|
a80389e5c7 | ||
|
|
923276422b | ||
|
|
7c9192f3a0 | ||
|
|
51d139b7aa | ||
|
|
8fe1bdb6f7 | ||
|
|
5b288bc0d1 | ||
|
|
27cd769c76 | ||
|
|
5bb370869d | ||
|
|
ec68f64db4 | ||
|
|
4cf8f146c9 | ||
|
|
61cf317541 | ||
|
|
a2066c9b41 | ||
|
|
817b152704 | ||
|
|
cc73494c91 | ||
|
|
64ed4083b9 | ||
|
|
77e8c58cc6 | ||
|
|
0cd2eab309 | ||
|
|
7d8c843c74 | ||
|
|
da1c2d6914 | ||
|
|
3a949301f9 | ||
|
|
585eebab49 | ||
|
|
45c3e4686e | ||
|
|
52f2e67952 | ||
|
|
929774aa5b | ||
|
|
e711e338e7 |
25
.github/workflows/changesets.yaml
vendored
25
.github/workflows/changesets.yaml
vendored
@@ -16,29 +16,30 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
- name: Cache pnpm modules
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ~/.pnpm-store
|
fetch-depth: 0
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2.1.0
|
- uses: pnpm/action-setup@v2.1.0
|
||||||
with:
|
with:
|
||||||
version: 6.32.3
|
version: 6.32.3
|
||||||
run_install: true
|
# run_install: true
|
||||||
|
- name: Use Node.js 17
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '17.8.0'
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install
|
||||||
- name: Create PR or Publish release
|
- name: Create PR or Publish release
|
||||||
id: changesets
|
id: changesets
|
||||||
uses: changesets/action@v1
|
uses: changesets/action@v1
|
||||||
with:
|
with:
|
||||||
version: pnpm ci:version
|
version: pnpm run ci:version
|
||||||
commit: 'chore: update versions'
|
commit: 'chore: update versions'
|
||||||
title: 'chore: update versions'
|
title: 'chore: update versions'
|
||||||
publish: pnpm release
|
publish: pnpm run ci:publish
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
@@ -29,10 +29,8 @@
|
|||||||
"lint": "pnpm turbo run lint --stream",
|
"lint": "pnpm turbo run lint --stream",
|
||||||
"lint:fix": "pnpm turbo run lint:fix --stream",
|
"lint:fix": "pnpm turbo run lint:fix --stream",
|
||||||
"test": "pnpm turbo run test --scope='@nhost/*' --no-deps --include-dependencies",
|
"test": "pnpm turbo run test --scope='@nhost/*' --no-deps --include-dependencies",
|
||||||
"prerelease": "pnpm clean && pnpm install && pnpm build",
|
"ci:publish": "pnpm run build && changeset tag && git push --follow-tags && pnpm -r publish && git status",
|
||||||
"release": "pnpm run prerelease && changeset publish && git push --follow-tags && git status && pnpm -r publish",
|
|
||||||
"changeset": "changeset",
|
"changeset": "changeset",
|
||||||
"snapshot": "pnpm prerelease && changeset version --snapshot preview && pnpm install && changeset publish --tag preview",
|
|
||||||
"wait": "wait-on http://localhost:1337/v1/auth/healthz -i 500 -t 120000"
|
"wait": "wait-on http://localhost:1337/v1/auth/healthz -i 500 -t 120000"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost/apollo
|
# @nhost/apollo
|
||||||
|
|
||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [16a6c50]
|
||||||
|
- @nhost/core@0.3.4
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @nhost/core@0.3.2
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/apollo",
|
"name": "@nhost/apollo",
|
||||||
"version": "0.3.1",
|
"version": "0.3.4",
|
||||||
"description": "Nhost Apollo Client library",
|
"description": "Nhost Apollo Client library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,22 @@
|
|||||||
# @nhost/core
|
# @nhost/core
|
||||||
|
|
||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 16a6c50: Correct autoSignIn
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/core",
|
"name": "@nhost/core",
|
||||||
"version": "0.3.1",
|
"version": "0.3.4",
|
||||||
"description": "Nhost core client library",
|
"description": "Nhost core client library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -634,26 +634,31 @@ export const createAuthMachine = ({
|
|||||||
options: rewriteRedirectTo(clientUrl, options)
|
options: rewriteRedirectTo(clientUrl, options)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If autoSignIn is enabled, attempts to get the refreshToken from the current location's hash
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
autoSignIn: async () => {
|
autoSignIn: async () => {
|
||||||
|
// TODO throwing errors is not really important as they are captured by the xstate invoker
|
||||||
|
// * Still, keep them for the moment as it needs to be tested in every environemnt e.g. nodejs, expo, react-native...
|
||||||
if (typeof window === 'undefined' || !window.location)
|
if (typeof window === 'undefined' || !window.location)
|
||||||
throw Error('window is undefined or location does not exist')
|
throw Error('window is undefined or location does not exist')
|
||||||
const { hash } = window.location
|
const { hash } = window.location
|
||||||
if (!hash) return
|
if (!hash) throw Error('No hash in window.location')
|
||||||
const params = new URLSearchParams(hash.slice(1))
|
const params = new URLSearchParams(hash.slice(1))
|
||||||
const refreshToken = params.get('refreshToken')
|
const refreshToken = params.get('refreshToken')
|
||||||
if (refreshToken) {
|
if (!refreshToken) throw Error('No refresh token in the location hash')
|
||||||
const session = await postRequest('/token', {
|
const session = await postRequest('/token', {
|
||||||
refreshToken
|
refreshToken
|
||||||
})
|
})
|
||||||
// * remove hash from the current url after consumming the token
|
// * remove hash from the current url after consumming the token
|
||||||
// TODO remove the hash. For the moment, it is kept to avoid regression from the current SDK.
|
// TODO remove the hash. For the moment, it is kept to avoid regression from the current SDK.
|
||||||
// * Then, only `refreshToken` will be in the hash, while `type` will be sent by hasura-auth as a query parameter
|
// * Then, only `refreshToken` will be in the hash, while `type` will be sent by hasura-auth as a query parameter
|
||||||
// window.history.pushState({}, '', location.pathname)
|
// window.history.pushState({}, '', location.pathname)
|
||||||
const channel = new BroadcastChannel('nhost')
|
const channel = new BroadcastChannel('nhost')
|
||||||
// TODO broadcat session instead of token
|
// ? broadcat session instead of token ?
|
||||||
channel.postMessage(refreshToken)
|
channel.postMessage(refreshToken)
|
||||||
return { session }
|
return { session }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
importRefreshToken: async () => {
|
importRefreshToken: async () => {
|
||||||
const stringExpiresAt = await clientStorageGetter(NHOST_JWT_EXPIRES_AT_KEY)
|
const stringExpiresAt = await clientStorageGetter(NHOST_JWT_EXPIRES_AT_KEY)
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost/hasura-auth-js
|
# @nhost/hasura-auth-js
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [16a6c50]
|
||||||
|
- @nhost/core@0.3.4
|
||||||
|
|
||||||
|
## 1.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @nhost/core@0.3.2
|
||||||
|
|
||||||
## 1.0.2
|
## 1.0.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/hasura-auth-js",
|
"name": "@nhost/hasura-auth-js",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"description": "Hasura-auth client",
|
"description": "Hasura-auth client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
# @nhost/nextjs
|
# @nhost/nextjs
|
||||||
|
|
||||||
|
## 1.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@1.0.5
|
||||||
|
- @nhost/react@0.4.4
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @nhost/nhost-js@1.0.3
|
||||||
|
- @nhost/react@0.4.2
|
||||||
|
|
||||||
## 1.0.3
|
## 1.0.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/nextjs",
|
"name": "@nhost/nextjs",
|
||||||
"version": "1.0.3",
|
"version": "1.0.6",
|
||||||
"description": "Nhost NextJS library",
|
"description": "Nhost NextJS library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
# @nhost/nhost-js
|
# @nhost/nhost-js
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/hasura-auth-js@1.0.5
|
||||||
|
|
||||||
|
## 1.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @nhost/hasura-auth-js@1.0.3
|
||||||
|
|
||||||
## 1.0.2
|
## 1.0.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/nhost-js",
|
"name": "@nhost/nhost-js",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"description": "Nhost JavaScript SDK",
|
"description": "Nhost JavaScript SDK",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
# @nhost/react-apollo
|
# @nhost/react-apollo
|
||||||
|
|
||||||
|
## 4.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/apollo@0.3.4
|
||||||
|
- @nhost/react@0.4.4
|
||||||
|
|
||||||
|
## 4.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @nhost/apollo@0.3.2
|
||||||
|
- @nhost/react@0.4.2
|
||||||
|
|
||||||
## 4.0.3
|
## 4.0.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react-apollo",
|
"name": "@nhost/react-apollo",
|
||||||
"version": "4.0.3",
|
"version": "4.0.6",
|
||||||
"description": "Nhost React Apollo client",
|
"description": "Nhost React Apollo client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
# @nhost/react
|
# @nhost/react
|
||||||
|
|
||||||
|
## 0.4.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@1.0.5
|
||||||
|
|
||||||
|
## 0.4.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- correct dependencies
|
||||||
|
|
||||||
|
See this related issues:
|
||||||
|
|
||||||
|
- [nhost](https://github.com/nhost/nhost/issues/326)
|
||||||
|
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @nhost/nhost-js@1.0.3
|
||||||
|
|
||||||
## 0.4.1
|
## 0.4.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react",
|
"name": "@nhost/react",
|
||||||
"version": "0.4.1",
|
"version": "0.4.4",
|
||||||
"description": "Nhost React library",
|
"description": "Nhost React library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
Reference in New Issue
Block a user