diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh new file mode 100644 index 0000000000..ca2720e08a --- /dev/null +++ b/.husky/_/husky.sh @@ -0,0 +1,30 @@ +#!/bin/sh +if [ -z "$husky_skip_init" ]; then + debug () { + [ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1" + } + + readonly hook_name="$(basename "$0")" + debug "starting $hook_name..." + + if [ "$HUSKY" = "0" ]; then + debug "HUSKY env variable is set to 0, skipping hook" + exit 0 + fi + + if [ -f ~/.huskyrc ]; then + debug "sourcing ~/.huskyrc" + . ~/.huskyrc + fi + + export readonly husky_skip_init=1 + sh -e "$0" "$@" + exitCode="$?" + + if [ $exitCode != 0 ]; then + echo "husky - $hook_name hook exited with code $exitCode (error)" + exit $exitCode + fi + + exit 0 +fi diff --git a/.npmrc b/.npmrc index 5736eddb51..df9588e268 100644 --- a/.npmrc +++ b/.npmrc @@ -1,5 +1,6 @@ registry=https://registry.yarnpkg.com/ -@imploy:registry=https://npm.pkg.github.com +@chainsafe:registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_AUTH_TOKEN} +//registry.npmjs.org always-auth=true \ No newline at end of file diff --git a/package.json b/package.json index 52286cb0dd..c33095a0dd 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "scripts": { "postinstall": "yarn build:common", "build:common": "yarn build:theme && yarn build:components && yarn build:contexts", - "build:contexts": "yarn wsrun -t -p @imploy/common-contexts -c build", + "build:contexts": "yarn wsrun -t -p @chainsafe/common-contexts -c build", "build:components": "yarn wsrun -t -p @chainsafe/common-components -c build", "build:theme": "yarn wsrun -t -p @chainsafe/common-theme -c build", "build:storybook": "yarn wsrun -p @chainsafe/common-components -c build:storybook", diff --git a/packages/common-contexts/package.json b/packages/common-contexts/package.json index 533dbb5650..c18b91f3bd 100644 --- a/packages/common-contexts/package.json +++ b/packages/common-contexts/package.json @@ -1,5 +1,5 @@ { - "name": "@imploy/common-contexts", + "name": "@chainsafe/common-contexts", "version": "1.0.0", "description": "Common contexts", "author": "Michael Yankelev ", @@ -14,7 +14,7 @@ "start": "rollup -c -w" }, "dependencies": { - "@imploy/api-client": "1.3.4", + "@chainsafe/files-api-client": "1.3.4", "axios": "^0.21.1", "pbkdf2": "^3.1.1", "tweetnacl": "^1.0.3", diff --git a/packages/common-contexts/src/ImployApiContext/ImployApiContext.tsx b/packages/common-contexts/src/ImployApiContext/ImployApiContext.tsx index 4ecfbd40f8..deea965729 100644 --- a/packages/common-contexts/src/ImployApiContext/ImployApiContext.tsx +++ b/packages/common-contexts/src/ImployApiContext/ImployApiContext.tsx @@ -6,7 +6,7 @@ import { ImployApiClient, Token, Provider, -} from "@imploy/api-client" +} from "@chainsafe/files-api-client" import jwtDecode from "jwt-decode" import { signMessage } from "./utils" import axios from "axios" diff --git a/packages/common-modules/package.json b/packages/common-modules/package.json index 544fb64778..a0ae634a7d 100644 --- a/packages/common-modules/package.json +++ b/packages/common-modules/package.json @@ -1,5 +1,5 @@ { - "name": "@imploy/common-modules", + "name": "@chainsafe/common-modules", "version": "1.0.0", "description": "Common Modules", "author": "Michael Yankelev ", diff --git a/packages/files-ui/src/App.tsx b/packages/files-ui/src/App.tsx index 4fa975898e..f00d2e8a2c 100644 --- a/packages/files-ui/src/App.tsx +++ b/packages/files-ui/src/App.tsx @@ -18,7 +18,7 @@ import { ImployApiProvider, UserProvider, BillingProvider, -} from "@imploy/common-contexts" +} from "@chainsafe/common-contexts" import { DriveProvider } from "./Contexts/DriveContext" import FilesRoutes from "./Components/FilesRoutes" import AppWrapper from "./Components/Layouts/AppWrapper" diff --git a/packages/files-ui/src/Components/FilesRoutes.tsx b/packages/files-ui/src/Components/FilesRoutes.tsx index 6646d8d407..57fd4a8e86 100644 --- a/packages/files-ui/src/Components/FilesRoutes.tsx +++ b/packages/files-ui/src/Components/FilesRoutes.tsx @@ -2,7 +2,7 @@ import React from "react" import { Switch, ConditionalRoute } from "@chainsafe/common-components" import LoginPage from "./Pages/LoginPage" import SettingsPage from "./Pages/SettingsPage" -import { useImployApi } from "@imploy/common-contexts" +import { useImployApi } from "@chainsafe/common-contexts" import HomePage from "./Pages/HomePage" import OAuthCallbackPage from "./Pages/OAuthCallback" import PurchasePlanPage from "./Pages/PurchasePlanPage" diff --git a/packages/files-ui/src/Components/Layouts/AppHeader.tsx b/packages/files-ui/src/Components/Layouts/AppHeader.tsx index 61316b504b..29c85e9acd 100644 --- a/packages/files-ui/src/Components/Layouts/AppHeader.tsx +++ b/packages/files-ui/src/Components/Layouts/AppHeader.tsx @@ -1,4 +1,4 @@ -import { useImployApi, useUser } from "@imploy/common-contexts" +import { useImployApi, useUser } from "@chainsafe/common-contexts" import { createStyles, ITheme, diff --git a/packages/files-ui/src/Components/Layouts/AppNav.tsx b/packages/files-ui/src/Components/Layouts/AppNav.tsx index 0289d2e9de..b410d39f61 100644 --- a/packages/files-ui/src/Components/Layouts/AppNav.tsx +++ b/packages/files-ui/src/Components/Layouts/AppNav.tsx @@ -1,4 +1,4 @@ -import { useImployApi, useUser } from "@imploy/common-contexts" +import { useImployApi, useUser } from "@chainsafe/common-contexts" import { useDrive } from "../../Contexts/DriveContext" import { createStyles, diff --git a/packages/files-ui/src/Components/Layouts/AppWrapper.tsx b/packages/files-ui/src/Components/Layouts/AppWrapper.tsx index c75ecacca2..bfd6c4c1f8 100644 --- a/packages/files-ui/src/Components/Layouts/AppWrapper.tsx +++ b/packages/files-ui/src/Components/Layouts/AppWrapper.tsx @@ -1,4 +1,4 @@ -import { useImployApi } from "@imploy/common-contexts" +import { useImployApi } from "@chainsafe/common-contexts" import { createStyles, ITheme, diff --git a/packages/files-ui/src/Components/Modules/MasterKeySequence/SequenceSlides/EnterMasterKey.slide.tsx b/packages/files-ui/src/Components/Modules/MasterKeySequence/SequenceSlides/EnterMasterKey.slide.tsx index 7f2da1678d..1eb323d43d 100644 --- a/packages/files-ui/src/Components/Modules/MasterKeySequence/SequenceSlides/EnterMasterKey.slide.tsx +++ b/packages/files-ui/src/Components/Modules/MasterKeySequence/SequenceSlides/EnterMasterKey.slide.tsx @@ -9,7 +9,7 @@ import clsx from "clsx" import { Form, Formik } from "formik" import * as yup from "yup" import { useDrive } from "../../../../Contexts/DriveContext" -import { useImployApi, useUser } from "@imploy/common-contexts" +import { useImployApi, useUser } from "@chainsafe/common-contexts" const useStyles = makeStyles( ({ constants, breakpoints, palette, typography }: ITheme) => diff --git a/packages/files-ui/src/Components/Modules/Settings/Profile.tsx b/packages/files-ui/src/Components/Modules/Settings/Profile.tsx index 058789de32..b8ba14830a 100644 --- a/packages/files-ui/src/Components/Modules/Settings/Profile.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/Profile.tsx @@ -14,7 +14,7 @@ import { } from "@chainsafe/common-theme" import { LockIcon, CopyIcon } from "@chainsafe/common-components" import { Formik, Form } from "formik" -import { Profile } from "@imploy/common-contexts" +import { Profile } from "@chainsafe/common-contexts" import { Trans } from "@lingui/macro" import { centerEllipsis } from "../../../Utils/Helpers" diff --git a/packages/files-ui/src/Components/Modules/Settings/PurchasePlan/index.tsx b/packages/files-ui/src/Components/Modules/Settings/PurchasePlan/index.tsx index 627c69cfad..b5f6d33aa6 100644 --- a/packages/files-ui/src/Components/Modules/Settings/PurchasePlan/index.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/PurchasePlan/index.tsx @@ -18,7 +18,7 @@ import { } from "@chainsafe/common-components" import { ROUTE_LINKS } from "../../../FilesRoutes" import { Form, Formik } from "formik" -import { useBilling, useUser } from "@imploy/common-contexts" +import { useBilling, useUser } from "@chainsafe/common-contexts" import * as yup from "yup" import countryList from "./countryList" import CardInputs from "../../../Elements/CardInputs" diff --git a/packages/files-ui/src/Components/Modules/Settings/index.tsx b/packages/files-ui/src/Components/Modules/Settings/index.tsx index 3dec5518d2..96c7a4f25c 100644 --- a/packages/files-ui/src/Components/Modules/Settings/index.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/index.tsx @@ -12,7 +12,7 @@ import { useToaster, } from "@chainsafe/common-components" import { makeStyles, ITheme, createStyles } from "@chainsafe/common-theme" -import { useUser } from "@imploy/common-contexts" +import { useUser } from "@chainsafe/common-contexts" import { ROUTE_LINKS } from "../../FilesRoutes" import { Trans } from "@lingui/macro" diff --git a/packages/files-ui/src/Components/Pages/LoginPage.tsx b/packages/files-ui/src/Components/Pages/LoginPage.tsx index e6cb4500db..565d4256e9 100644 --- a/packages/files-ui/src/Components/Pages/LoginPage.tsx +++ b/packages/files-ui/src/Components/Pages/LoginPage.tsx @@ -9,7 +9,7 @@ import { ChainsafeFilesLogo, Divider, } from "@chainsafe/common-components" -import { useImployApi, OAuthProvider } from "@imploy/common-contexts" +import { useImployApi, OAuthProvider } from "@chainsafe/common-contexts" import { makeStyles, ITheme, diff --git a/packages/files-ui/src/Components/Pages/OAuthCallback.tsx b/packages/files-ui/src/Components/Pages/OAuthCallback.tsx index 8816b959a5..a8db93fb30 100644 --- a/packages/files-ui/src/Components/Pages/OAuthCallback.tsx +++ b/packages/files-ui/src/Components/Pages/OAuthCallback.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from "react" import { useLocation, useParams } from "@chainsafe/common-components" -import { useImployApi } from "@imploy/common-contexts" +import { useImployApi } from "@chainsafe/common-contexts" function useQueryParams() { return new URLSearchParams(useLocation().search) diff --git a/packages/files-ui/src/Contexts/DriveContext.tsx b/packages/files-ui/src/Contexts/DriveContext.tsx index 09923b0036..1ea44d0e05 100644 --- a/packages/files-ui/src/Contexts/DriveContext.tsx +++ b/packages/files-ui/src/Contexts/DriveContext.tsx @@ -3,10 +3,10 @@ import { FileContentResponse, FilesMvRequest, FilesPathRequest, -} from "@imploy/api-client" +} from "@chainsafe/files-api-client" import React, { useCallback, useEffect, useReducer } from "react" import { useState } from "react" -import { decryptFile, encryptFile, useImployApi } from "@imploy/common-contexts" +import { decryptFile, encryptFile, useImployApi } from "@chainsafe/common-contexts" import dayjs from "dayjs" import { v4 as uuidv4 } from "uuid" import { useToaster } from "@chainsafe/common-components" diff --git a/yarn.lock b/yarn.lock index b1e05aa40d..76d3633186 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1652,6 +1652,11 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@chainsafe/files-api-client@1.3.4": + version "1.3.4" + resolved "https://npm.pkg.github.com/download/@chainsafe/files-api-client/1.3.4/820dd2c85696afb748395ed838c956ebad76f0580e5ed7f1ca253ccdcdfb3baf#af7577ebb042897ec37c2d7e8b5ae7e69981b989" + integrity sha512-tJRIVadDFi9Hl525InVTe5L8Ge/RcDvia5CKEHSIwjQ6CqsVH+iJJ0LMt1xLCIFYa9hYBEOyvlgNhDfUSOYl4Q== + "@chainsafe/web3-context@1.1.4": version "1.1.4" resolved "https://registry.yarnpkg.com/@chainsafe/web3-context/-/web3-context-1.1.4.tgz#ce0f140af8ccf93af1a189fbdbd6f018b9bf5fb7" @@ -2217,11 +2222,6 @@ resolved "https://registry.yarnpkg.com/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8" integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw== -"@imploy/api-client@1.3.4": - version "1.3.4" - resolved "https://npm.pkg.github.com/download/@imploy/api-client/1.3.4/6cd514978c77e5ab87b2bd983e3cd8cc2ed848339a5b6759dbcac961783c8bac#fe435ddb50b46906e23ed0e45e11b8e9d3dcda46" - integrity sha512-KafqS6e+RmmyAX8KBj92+cXpSEWld90lxKahbFxuuuwDfBpuSE4zBqiSHwEaMXB8sZoI1HUxqK4H1Gbi4j1O6A== - "@jest/console@^24.7.1", "@jest/console@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0"