Compare commits

..

47 Commits

Author SHA1 Message Date
Pilou
57780ee645 Merge pull request #333 from nhost/changeset-release/main
chore: update versions
2022-04-03 15:35:58 +02:00
github-actions[bot]
aad8d22380 chore: update versions 2022-04-03 13:28:59 +00:00
Pilou
85d33c4de0 Merge pull request #332 from nhost/fix/auto-signin
fix: correct auto-signin bug introducted in previous version
2022-04-03 15:28:16 +02:00
Pierre-Louis Mercereau
ab3e2dcee9 refactor: remove log 2022-04-03 15:22:11 +02:00
Pierre-Louis Mercereau
12f4504b61 refactor: remove incorrect and unused snapshot script 2022-04-03 15:19:00 +02:00
Pierre-Louis Mercereau
71d7a11c96 refactor: correct script 2022-04-03 15:11:48 +02:00
Pierre-Louis Mercereau
16a6c5073e fix: correct auto-signin bug introducted in previous version 2022-04-03 15:05:13 +02:00
Pilou
3fcc86792a Merge branch 'main' into main 2022-04-03 13:40:31 +02:00
Pierre-Louis Mercereau
27909128e4 chore: bump versions to fix the workspace/package link bug 2022-04-02 11:25:38 +02:00
Pierre-Louis Mercereau
47c57ff665 ci: scope ci script 2022-03-10 13:12:08 +01:00
Pierre-Louis Mercereau
1cb330016b ci: wrap up 2022-03-10 13:06:17 +01:00
Pierre-Louis Mercereau
497652d1b4 ci: cd, not cp 2022-03-10 13:00:22 +01:00
Pierre-Louis Mercereau
20eb7aa381 ci: correct cp 2022-03-10 12:58:54 +01:00
Pierre-Louis Mercereau
4a3c2f92b1 ci: correct cp arg 2022-03-10 12:57:38 +01:00
Pierre-Louis Mercereau
5647e64265 ci: copy existing nhost project 2022-03-10 12:55:43 +01:00
Pierre-Louis Mercereau
c113debf46 ci: again 2022-03-10 12:52:49 +01:00
Pierre-Louis Mercereau
3f0ae4a58c ci: manually create nhost project 2022-03-10 12:50:36 +01:00
Pierre-Louis Mercereau
3d5b8183e8 ci: deactivate nhost 2022-03-10 12:47:38 +01:00
Pierre-Louis Mercereau
789ef8f783 ci: exec nhost in tmp 2022-03-10 12:44:45 +01:00
Pierre-Louis Mercereau
94df175ca3 ci: remove testing project 2022-03-10 12:41:24 +01:00
Pierre-Louis Mercereau
c8bcefb0e5 ci: remove testing project 2022-03-10 12:40:20 +01:00
Pierre-Louis Mercereau
fc52f59eb8 ci: again 2022-03-10 12:37:39 +01:00
Pierre-Louis Mercereau
a80389e5c7 ci: again 2022-03-10 12:30:57 +01:00
Pierre-Louis Mercereau
923276422b ci: desesperant 2022-03-10 12:28:43 +01:00
Pierre-Louis Mercereau
7c9192f3a0 ci: correct 2022-03-10 12:24:33 +01:00
Pierre-Louis Mercereau
51d139b7aa ci: single ci command 2022-03-10 12:21:58 +01:00
Pierre-Louis Mercereau
8fe1bdb6f7 ci: deactivate cache 2022-03-10 12:19:01 +01:00
Pierre-Louis Mercereau
5b288bc0d1 ci: add options 2022-03-10 12:18:38 +01:00
Pierre-Louis Mercereau
27cd769c76 ci: frozen lockfile 2022-03-10 12:16:08 +01:00
Pierre-Louis Mercereau
5bb370869d ci: clean 2022-03-10 12:13:57 +01:00
Pierre-Louis Mercereau
ec68f64db4 ci: 1.1.5 2022-03-10 12:11:48 +01:00
Pierre-Louis Mercereau
4cf8f146c9 ci: another turbo version 2022-03-10 12:08:16 +01:00
Pierre-Louis Mercereau
61cf317541 ci: decrease pnpm version 2022-03-10 12:04:03 +01:00
Pierre-Louis Mercereau
a2066c9b41 ci: increase depth 2022-03-10 12:02:25 +01:00
Pierre-Louis Mercereau
817b152704 ci: pwd 2022-03-10 12:00:40 +01:00
Pierre-Louis Mercereau
cc73494c91 ci: installl again 2022-03-10 11:58:05 +01:00
Pierre-Louis Mercereau
64ed4083b9 ci: reverse version 2022-03-10 11:54:12 +01:00
Pierre-Louis Mercereau
77e8c58cc6 ci: downgrade turborepo 2022-03-10 11:48:33 +01:00
Pierre-Louis Mercereau
0cd2eab309 ci: debug 2022-03-10 11:43:58 +01:00
Pierre-Louis Mercereau
7d8c843c74 ci: deactivate turbo cache 2022-03-10 11:41:34 +01:00
Pierre-Louis Mercereau
da1c2d6914 ci: add src to files 2022-03-10 11:38:58 +01:00
Pierre-Louis Mercereau
3a949301f9 ci: remove scope 2022-03-10 11:34:43 +01:00
Pierre-Louis Mercereau
585eebab49 ci: updated packages 2022-03-10 11:30:05 +01:00
Pierre-Louis Mercereau
45c3e4686e ci: debug 2022-03-10 11:26:04 +01:00
Pierre-Louis Mercereau
52f2e67952 ci: install dependencies 2022-03-10 11:22:24 +01:00
Pierre-Louis Mercereau
929774aa5b ci: matrix 2022-03-10 11:21:04 +01:00
Pierre-Louis Mercereau
e711e338e7 ci: clean ci 2022-03-10 11:18:56 +01:00
17 changed files with 86 additions and 42 deletions

View File

@@ -16,15 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# - name: Cache pnpm modules
# uses: actions/cache@v2
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.1.0
with:
@@ -41,10 +36,10 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
version: pnpm run ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm release
publish: pnpm run ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -29,10 +29,8 @@
"lint": "pnpm turbo run lint --stream",
"lint:fix": "pnpm turbo run lint:fix --stream",
"test": "pnpm turbo run test --scope='@nhost/*' --no-deps --include-dependencies",
"prerelease": "pnpm clean && pnpm install && pnpm build",
"release": "pnpm run prerelease && changeset publish && git push --follow-tags && git status && pnpm -r publish",
"ci:publish": "pnpm run build && changeset tag && git push --follow-tags && pnpm -r publish && git status",
"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"
},
"workspaces": [

View File

@@ -1,6 +1,13 @@
# @nhost/apollo
## 0.3.2
## 0.3.4
### Patch Changes
- Updated dependencies [16a6c50]
- @nhost/core@0.3.4
## 0.3.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "0.3.2",
"version": "0.3.4",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -1,6 +1,12 @@
# @nhost/core
## 0.3.2
## 0.3.4
### Patch Changes
- 16a6c50: Correct autoSignIn
## 0.3.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/core",
"version": "0.3.2",
"version": "0.3.4",
"description": "Nhost core client library",
"license": "MIT",
"keywords": [

View File

@@ -634,26 +634,31 @@ export const createAuthMachine = ({
options: rewriteRedirectTo(clientUrl, options)
}),
/**
* If autoSignIn is enabled, attempts to get the refreshToken from the current location's hash
* @returns
*/
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)
throw Error('window is undefined or location does not exist')
const { hash } = window.location
if (!hash) return
if (!hash) throw Error('No hash in window.location')
const params = new URLSearchParams(hash.slice(1))
const refreshToken = params.get('refreshToken')
if (refreshToken) {
const session = await postRequest('/token', {
refreshToken
})
// * 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.
// * 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)
const channel = new BroadcastChannel('nhost')
// TODO broadcat session instead of token
channel.postMessage(refreshToken)
return { session }
}
if (!refreshToken) throw Error('No refresh token in the location hash')
const session = await postRequest('/token', {
refreshToken
})
// * 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.
// * 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)
const channel = new BroadcastChannel('nhost')
// ? broadcat session instead of token ?
channel.postMessage(refreshToken)
return { session }
},
importRefreshToken: async () => {
const stringExpiresAt = await clientStorageGetter(NHOST_JWT_EXPIRES_AT_KEY)

View File

@@ -1,6 +1,13 @@
# @nhost/hasura-auth-js
## 1.0.3
## 1.0.5
### Patch Changes
- Updated dependencies [16a6c50]
- @nhost/core@0.3.4
## 1.0.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-auth-js",
"version": "1.0.3",
"version": "1.0.5",
"description": "Hasura-auth client",
"license": "MIT",
"keywords": [

View File

@@ -1,6 +1,13 @@
# @nhost/nextjs
## 1.0.4
## 1.0.6
### Patch Changes
- @nhost/nhost-js@1.0.5
- @nhost/react@0.4.4
## 1.0.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.0.4",
"version": "1.0.6",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,6 +1,12 @@
# @nhost/nhost-js
## 1.0.3
## 1.0.5
### Patch Changes
- @nhost/hasura-auth-js@1.0.5
## 1.0.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "1.0.3",
"version": "1.0.5",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [

View File

@@ -1,6 +1,13 @@
# @nhost/react-apollo
## 4.0.4
## 4.0.6
### Patch Changes
- @nhost/apollo@0.3.4
- @nhost/react@0.4.4
## 4.0.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "4.0.4",
"version": "4.0.6",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -1,6 +1,12 @@
# @nhost/react
## 0.4.2
## 0.4.4
### Patch Changes
- @nhost/nhost-js@1.0.5
## 0.4.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "0.4.2",
"version": "0.4.4",
"description": "Nhost React library",
"license": "MIT",
"keywords": [