generated from bitwarden/template
-
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.
update typescript configs, resolve typing errors, and configure packa…
…ge.json
- Loading branch information
Showing
14 changed files
with
109 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,11 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"outDir": "./build", | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "commonjs", | ||
"outDir": "./build", | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"skipLibCheck": true | ||
"target": "es2016" | ||
} | ||
} |
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,44 +1,37 @@ | ||
import BrowserOnly from "@docusaurus/BrowserOnly"; | ||
import CodeBlock from "@theme/CodeBlock"; | ||
import useIsBrowser from "@docusaurus/useIsBrowser"; | ||
|
||
function formatStringifiedValue(stringifiedJSON) { | ||
function formatStringifiedValue(stringifiedJSON: string) { | ||
const decodedString = decodeURIComponent(stringifiedJSON); | ||
|
||
// parse and re-stringify to use stringify's built-in formatting | ||
return JSON.stringify(JSON.parse(decodedString), null, 2); | ||
} | ||
|
||
export function StoredRequestValue() { | ||
const isBrowser = useIsBrowser(); | ||
let requestBodyValue; | ||
|
||
if (isBrowser) { | ||
const cookieKey = "referrerRequestBody"; | ||
const cookieValue = document.cookie | ||
.split("; ") | ||
.find((row) => row.startsWith(`${cookieKey}=`)) | ||
?.split("=")[1]; | ||
|
||
if (!cookieValue) { | ||
return null; | ||
} | ||
|
||
requestBodyValue = formatStringifiedValue(cookieValue); | ||
|
||
// clear cookie value | ||
document.cookie = `${cookieKey}=; SameSite=Strict; Max-Age=0`; | ||
} | ||
|
||
return ( | ||
<BrowserOnly> | ||
{() => { | ||
const cookieKey = "referrerRequestBody"; | ||
const cookieValue = document.cookie | ||
.split("; ") | ||
.find((row) => row.startsWith(`${cookieKey}=`)) | ||
?.split("=")[1]; | ||
|
||
if (!cookieValue) { | ||
return null; | ||
} | ||
|
||
const requestBodyValue = formatStringifiedValue(cookieValue); | ||
|
||
// clear cookie value | ||
document.cookie = `${cookieKey}=; Max-Age=0`; | ||
|
||
return ( | ||
<> | ||
<CodeBlock | ||
language="json" | ||
title="Request body:" | ||
className="margin-top--md" | ||
> | ||
{requestBodyValue} | ||
</CodeBlock> | ||
</> | ||
); | ||
}} | ||
</BrowserOnly> | ||
<CodeBlock language="json" title="Request body:" className="margin-top--md"> | ||
{requestBodyValue} | ||
</CodeBlock> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Bitwarden | ||
dotfile | ||
jsmith | ||
keyserver | ||
sandboxed | ||
TOTP |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 +1,31 @@ | ||
{ | ||
"name": "test-the-web", | ||
"name": "@bitwarden/test-the-web", | ||
"version": "0.0.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/bitwarden/test-the-web.git" | ||
}, | ||
"author": "Bitwarden Inc. <[email protected]> (https://bitwarden.com)", | ||
"license": "SEE LICENSE IN LICENSE.txt", | ||
"bugs": { | ||
"url": "https://github.com/bitwarden/test-the-web/issues" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"prepare": "husky install", | ||
"postinstall": "(npm run ci:api) && (npm run ci:client)", | ||
"build:api": "cd api && npm run build", | ||
"build:client": "cd client && npm run build", | ||
"build:watch": "(cd client && npm run build:watch) & (cd api && npm run start:watch)", | ||
"build": "(npm run build:api) && (npm run build:client)", | ||
"ci:api": "cd api && npm ci", | ||
"ci:client": "cd client && npm ci", | ||
"build": "(npm run build:api) && (npm run build:client)", | ||
"build:watch": "(cd client && npm run build:watch) & (cd api && npm run start:watch)", | ||
"build:api": "cd api && npm run build", | ||
"build:client": "cd client && npm run build" | ||
"lint": "prettier --check .", | ||
"postinstall": "(npm run ci:api) && (npm run ci:client)", | ||
"prepare": "husky install", | ||
"prettier": "prettier --write .", | ||
"spellcheck": "cspell lint \"**/*.md{x,}\"", | ||
"typecheck:api": "cd api && npm run typecheck", | ||
"typecheck:client": "cd client && npm run typecheck", | ||
"typecheck": "(npm run typecheck:api) && (npm run typecheck:client)" | ||
}, | ||
"devDependencies": { | ||
"cspell": "8.0.0", | ||
|
@@ -22,7 +37,23 @@ | |
"typescript": "5.2.2" | ||
}, | ||
"lint-staged": { | ||
"*": "prettier --cache --write --ignore-unknown" | ||
"*": "prettier --cache --write --ignore-unknown", | ||
"*.md{x,}": "cspell lint" | ||
}, | ||
"cspell": { | ||
"version": "0.2", | ||
"useGitignore": true, | ||
"dictionaries": [ | ||
"custom-words" | ||
], | ||
"dictionaryDefinitions": [ | ||
{ | ||
"name": "custom-words", | ||
"path": "./custom-words.txt", | ||
"addWords": true | ||
} | ||
], | ||
"languageId": "typescript,javascript,html,css,markdown,mdx" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
|