Skip to content

Commit d7f2355

Browse files
committed
feat: v2
Replace Gatsby with Vite and Emotion with Tailwind CSS. BREAKING CHANGE: Password Lense no longer supports IE 11. You must use a modern browser instead.
1 parent f490f38 commit d7f2355

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2999
-11247
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ workflows:
2929
executor: my-cypress-executor
3030
yarn: true
3131
start: yarn serve
32-
wait-on: '--timeout 120000 http://localhost:8000'
32+
wait-on: '--timeout 120000 http://localhost:3000'
3333
- validate:
3434
requires:
3535
- cypress/run

.env.example

-1
This file was deleted.

.eslintignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
.cache/
2-
/public
1+
/dist
2+
/dist-ssr
3+
index.html

.eslintrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ module.exports = {
55
'plugin:wkovacs64/typescript',
66
'prettier',
77
],
8+
rules: {
9+
'react/react-in-jsx-scope': 'off',
10+
'@typescript-eslint/ban-ts-comment': 'off',
11+
'@typescript-eslint/explicit-module-boundary-types': 'off',
12+
},
813
};

.gitignore

+5-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typings/
7373
.yarn-integrity
7474

7575
# dotenv environment variables file
76-
.env
76+
.env.local
7777

7878
# parcel-bundler cache (https://parceljs.org/)
7979
.cache
@@ -153,8 +153,9 @@ $RECYCLE.BIN/
153153

154154
# End of https://www.gitignore.io/api/osx,node,linux,windows,visualstudiocode
155155

156-
# Build directory
157-
/public
156+
# Build output
157+
/dist
158+
/dist-ssr
158159

159160
# npm
160161
package-lock.json
@@ -164,3 +165,4 @@ package-lock.json
164165

165166
# Cypress
166167
cypress/screenshots
168+
cypress/videos

.prettierignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.cache/
2-
/public
1+
/dist
2+
/dist-ssr
33
package.json

README.md

+3-16
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,9 @@ way to get a more informative view of your password.
2525

2626
[![Deploy to Netlify][deploy-image]][deploy-link]
2727

28-
## FAQ
29-
30-
<details>
31-
<summary>Why?</summary>
32-
<p>Because a co-worker asked for it.</p>
33-
</details>
34-
35-
<details>
36-
<summary>Isn't Gatsby overkill for this?</summary>
37-
<p>
38-
<a href="https://twitter.com/jlengstorf/status/1043237435675557888">No</a>,
39-
it's <a href="https://twitter.com/kylemathews/status/1043226318978998272">awesome</a>
40-
for <a href="https://www.gatsbyjs.org/blog/2018-11-07-gatsby-for-apps/">building
41-
apps</a>.
42-
</p>
43-
</details>
28+
## Why?
29+
30+
Because a co-worker asked for it.
4431

4532
[demo-image]: ./demo.gif
4633
[deploy-image]: https://www.netlify.com/img/deploy/button.svg

config/build-info.js

-5
This file was deleted.

config/site.js

-15
This file was deleted.

cypress.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"baseUrl": "http://localhost:8000",
2+
"baseUrl": "http://localhost:3000",
33
"chromeWebSecurity": false,
44
"integrationFolder": "cypress/e2e",
55
"video": false,

gatsby-browser.js

-8
This file was deleted.

gatsby-config.js

-51
This file was deleted.

gatsby-node.js

-7
This file was deleted.

gatsby-ssr.js

-14
This file was deleted.

index.html

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
8+
/>
9+
<title>Password Lense</title>
10+
<meta name="application-name" content="Password Lense" />
11+
<meta name="apple-mobile-web-app-title" content="Password Lense" />
12+
<meta name="description" content="Reveal character types in a password" />
13+
<meta property="og:type" content="website" />
14+
<meta property="og:title" content="Password Lense" />
15+
<meta
16+
property="og:description"
17+
content="Reveal character types in a password"
18+
/>
19+
<meta
20+
property="og:image"
21+
content="https://res.cloudinary.com/dfcj3xczu/image/upload/v1538582926/pwl-social-banner.png"
22+
/>
23+
<meta property="og:image:alt" content="Password Lense" />
24+
<meta name="twitter:card" content="summary_large_image" />
25+
<meta name="twitter:title" content="Password Lense" />
26+
<meta
27+
name="twitter:description"
28+
content="Reveal character types in a password"
29+
/>
30+
<meta
31+
name="twitter:image"
32+
content="https://res.cloudinary.com/dfcj3xczu/image/upload/v1538582926/pwl-social-banner.png"
33+
/>
34+
<meta name="twitter:image:alt" content="Password Lense" />
35+
<link rel="icon" sizes="any" href="/favicon.ico" />
36+
<link rel="icon" type="image/png" sizes="32x32" href="/icon-32x32.png" />
37+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
38+
<meta name="msapplication-TileColor" content="#1c304a" />
39+
<meta name="theme-color" content="#1c304a" />
40+
</head>
41+
<body
42+
class="font-body text-gray-900 dark:text-gray-100 bg-white dark:bg-dark"
43+
>
44+
<script type="text/javascript">
45+
function prefersDark() {
46+
const storedPreference = window.localStorage.getItem('darkMode');
47+
const hasStoredPreference = typeof storedPreference === 'string';
48+
if (hasStoredPreference) return storedPreference === 'true';
49+
50+
const mediaQuery = '(prefers-color-scheme: dark)';
51+
const mql = window.matchMedia(mediaQuery);
52+
const hasSystemPreference = typeof mql.matches === 'boolean';
53+
if (hasSystemPreference) return mql.matches ? true : false;
54+
55+
return false;
56+
}
57+
58+
if (prefersDark()) {
59+
document.documentElement.classList.add('dark');
60+
}
61+
</script>
62+
<noscript>
63+
<p class="p-4">This application requires JavaScript.</p>
64+
</noscript>
65+
<div id="root"></div>
66+
<script type="module" src="/src/main.tsx"></script>
67+
</body>
68+
</html>

netlify.toml

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
[build]
22
command = "npm run build"
3-
publish = "public"
3+
publish = "dist"
4+
5+
[[headers]]
6+
for = "/*"
7+
[headers.values]
8+
X-Content-Type-Options = "nosniff"
9+
X-Frame-Options = "DENY"
10+
X-XSS-Protection = "1; mode=block"
11+
Content-Security-Policy = "default-src 'self'; connect-src 'self' https://api.pwnedpasswords.com; img-src data: https:; script-src 'self' 'unsafe-inline'; style-src 'self'; worker-src 'self'; object-src 'none'"
12+
Permissions-Policy = "geolocation=(), camera=(), microphone=(), payment=(), usb=()"
13+
Referrer-Policy = "no-referrer-when-downgrade"
14+
Expect-CT = "enforce, max-age=3600"
15+
16+
[[headers]]
17+
for = "/manifest.webmanifest"
18+
[headers.values]
19+
Content-Type = "application/manifest+json"

0 commit comments

Comments
 (0)