Skip to content

Commit dfd7c0a

Browse files
authored
Merge pull request #96 from medyo/develop
Version 1.14.2
2 parents 43ea112 + 23999c9 commit dfd7c0a

178 files changed

Lines changed: 3951 additions & 3059 deletions

File tree

Some content is hidden

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

craco.config.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
const path = require('path')
2+
const webpack = require('webpack')
3+
4+
function isDevelopmentEnv() {
5+
return process.env.NODE_ENV === 'development'
6+
}
27

38
module.exports = {
49
webpack: {
10+
plugins: {
11+
add: [
12+
new webpack.DefinePlugin({
13+
process: { env: {} },
14+
}),
15+
],
16+
},
517
alias: {
618
'@': path.resolve(__dirname, 'src'),
719
},
@@ -10,10 +22,10 @@ module.exports = {
1022
filename: 'static/js/[name].js',
1123
},
1224
optimization: {
13-
runtimeChunk: false,
25+
runtimeChunk: isDevelopmentEnv(),
1426
splitChunks: {
1527
chunks(chunk) {
16-
return false
28+
return isDevelopmentEnv()
1729
},
1830
},
1931
},
@@ -23,6 +35,10 @@ module.exports = {
2335
{
2436
plugin: {
2537
overrideWebpackConfig: ({ webpackConfig }) => {
38+
if (isDevelopmentEnv()) {
39+
return webpackConfig
40+
}
41+
2642
let mcep
2743
webpackConfig.plugins.some((p) => {
2844
if (p.constructor.name === 'MiniCssExtractPlugin') {

package.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
"dependencies": {
66
"@amplitude/analytics-browser": "^1.5.5",
77
"@craco/craco": "^6.4.5",
8+
"@sentry/react": "^7.17.4",
9+
"@sentry/tracing": "^7.17.4",
10+
"@tanstack/react-query": "^4.13.0",
811
"@testing-library/jest-dom": "^5.11.4",
912
"@testing-library/react": "^11.1.0",
1013
"@testing-library/user-event": "^12.1.10",
14+
"@types/dompurify": "^2.3.4",
1115
"axios": "^0.21.2",
1216
"axios-cache-adapter": "^2.7.3",
1317
"country-emoji": "^1.5.4",
@@ -25,22 +29,30 @@
2529
"react-modal": "^3.12.1",
2630
"react-pro-sidebar": "^0.6.0",
2731
"react-scripts": "4.0.1",
28-
"react-select": "^4.0.2",
32+
"react-select": "^5.0.1",
2933
"react-spinners": "^0.10.4",
3034
"react-toggle": "^4.1.1",
3135
"react-tooltip": "^4.2.21",
3236
"styled-components": "2",
3337
"timeago.js": "^4.0.2",
34-
"web-vitals": "^0.2.4"
38+
"type-fest": "^1.2.0",
39+
"web-vitals": "^0.2.4",
40+
"zustand": "^4.1.3"
3541
},
3642
"proxy": "https://api.hackertab.dev/",
3743
"scripts": {
3844
"start": "craco start",
39-
"web-build": "REACT_APP_WEB_BUILD=1 CI= react-scripts --max_old_space_size=3072 build",
45+
"web-build": "craco --max_old_space_size=4096 build",
4046
"build": "./script/build.sh",
4147
"stores-build": "./script/stores_build.sh",
4248
"eject": "react-scripts eject"
4349
},
50+
"eslintConfig": {
51+
"extends": [
52+
"react-app",
53+
"react-app/jest"
54+
]
55+
},
4456
"browserslist": {
4557
"production": [
4658
">0.2%",
@@ -53,12 +65,30 @@
5365
"last 1 safari version"
5466
]
5567
},
68+
"resolutions": {
69+
"react-error-overlay": "6.0.9"
70+
},
5671
"devDependencies": {
5772
"@types/chrome": "^0.0.198",
5873
"@types/jest": "^29.1.2",
5974
"@types/node": "^18.11.0",
6075
"@types/react": "^18.0.21",
6176
"@types/react-dom": "^18.0.6",
77+
"@types/react-modal": "^3.13.1",
78+
"@types/react-toggle": "^4.0.3",
79+
"@typescript-eslint/eslint-plugin": "^5.40.1",
80+
"@typescript-eslint/parser": "^5.40.1",
81+
"eslint-config-airbnb": "19.0.4",
82+
"eslint-config-airbnb-typescript": "^17.0.0",
83+
"eslint-config-prettier": "^8.5.0",
84+
"eslint-config-react-app": "^7.0.1",
85+
"eslint-plugin-import": "^2.25.3",
86+
"eslint-plugin-jest": "^27.1.3",
87+
"eslint-plugin-jsx-a11y": "^6.5.1",
88+
"eslint-plugin-prettier": "^4.2.1",
89+
"eslint-plugin-react": "^7.28.0",
90+
"eslint-plugin-react-hooks": "^4.3.0",
91+
"prettier": "^2.7.1",
6292
"typescript": "^4.8.4"
6393
}
6494
}

public/manifest.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
{
22
"name": "Hackertab.dev - developer news",
33
"description": "All developer news in one tab",
4-
"version": "1.14.1",
5-
"manifest_version": 2,
4+
"version": "1.14.2",
5+
"manifest_version": 3,
66
"chrome_url_overrides": {
77
"newtab": "index.html"
88
},
99
"background": {
10-
"scripts": [
11-
"background.js"
12-
]
10+
"service_worker": "background.js"
1311
},
14-
"permissions": [
12+
"host_permissions": [
1513
"https://*.hackertab.dev/*"
1614
],
1715
"icons": {
1816
"16": "/logos/logo16.png",
1917
"32": "/logos/logo32.png",
2018
"48": "/logos/logo48.png",
2119
"128": "/logos/logo128.png"
22-
},
23-
"content_security_policy": "script-src 'self' object-src 'self'",
24-
"applications": {
25-
"gecko": {
26-
"id": "{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"
27-
}
2820
}
2921
}

script/stores_build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ firefox_build() {
2727
export INLINE_RUNTIME_CHUNK=false
2828
export GENERATE_SOURCEMAP=false
2929

30+
echo 'add missing geeko id'
31+
yarn global add json
32+
json -I -f public/manifest.json -e 'this.applications={}'
33+
json -I -f public/manifest.json -e 'this.applications.gecko={}'
34+
json -I -f public/manifest.json -e 'this.applications.gecko.id="{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"'
35+
3036
yarn build
3137

3238
mkdir -p dist
@@ -35,7 +41,10 @@ firefox_build() {
3541
cd dist/ && zip -r ../firefox_extension.zip * -x "*.DS_Store" && cd ..
3642

3743
echo 'zipping the source code for Firefox'
38-
zip -r source_code.zip 'public/' 'script/' 'src' 'LICENSE' 'package.json' 'yarn.lock' 'README.md' 'craco.config.js' '.env' -x "*.DS_Store"
44+
zip -r source_code.zip 'public/' 'script/' 'src' 'LICENSE' 'package.json' 'yarn.lock' 'README.md' 'craco.config.js' '.env' 'tsconfig.json' -x "*.DS_Store"
45+
46+
echo "revert manifest changes"
47+
git restore public/manifest.json
3948
}
4049
chrome_build
4150
firefox_build

src/App.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
import React, { useState, useEffect, useContext } from 'react'
2-
import './App.css'
3-
import ConfigurationContext from './configuration/ConfigurationContext'
4-
import Footer from './components/Footer'
5-
import Header from './components/Header'
6-
import BookmarksSidebar from './bookmark/BookmarksSidebar'
7-
import MarketingBanner from './components/MarketingBanner'
1+
import React, { useState, useEffect } from 'react'
2+
import 'src/assets/App.css'
3+
import { Footer, Header } from 'src/components/Layout'
4+
import { BookmarksSidebar } from 'src/features/bookmarks'
5+
import { MarketingBanner } from 'src/components/Elements'
86
import ScrollCardsNavigator from './components/ScrollCardsNavigator'
9-
import AppContentLayout from './components/AppContentLayout'
7+
import { AppContentLayout } from './components/Layout'
108
import 'react-contexify/dist/ReactContexify.css'
11-
import PreferencesContext from './preferences/PreferencesContext'
129
import { setupAnalytics, trackPageView, setupIdentification } from 'src/lib/analytics'
10+
import { useRemoteConfigStore } from 'src/features/remoteConfig'
1311

1412
function App() {
15-
const { marketingBannerConfig = {}, feedbackWidget } = useContext(ConfigurationContext)
1613
const [showSideBar, setShowSideBar] = useState(false)
1714
const [showSettings, setShowSettings] = useState(false)
18-
const { dispatcher, ...state } = useContext(PreferencesContext)
15+
16+
const { marketingBannerConfig } = useRemoteConfigStore()
1917

2018
useEffect(() => {
2119
setupAnalytics()
22-
setupIdentification(state)
20+
setupIdentification()
2321
trackPageView('home')
2422
}, [])
2523

2624
return (
2725
<div className="App">
2826
<Header
2927
setShowSideBar={setShowSideBar}
30-
state={state}
31-
dispatcher={dispatcher}
3228
showSideBar={showSideBar}
3329
showSettings={showSettings}
3430
setShowSettings={setShowSettings}
@@ -38,7 +34,7 @@ function App() {
3834
<AppContentLayout setShowSettings={setShowSettings} />
3935
<BookmarksSidebar showSidebar={showSideBar} onClose={() => setShowSideBar(false)} />
4036

41-
<Footer feedbackWidget={feedbackWidget} />
37+
<Footer />
4238
</div>
4339
)
4440
}

src/App.css renamed to src/assets/App.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,10 @@ Producthunt item
717717
color: white;
718718
}
719719
.changelogButton.active {
720+
width: auto;
721+
font-size: 12px;
722+
padding:0 4px;
723+
text-transform: lowercase;
720724
background-color: var(--tooltip-accent-color);
721725
}
722726

@@ -1006,4 +1010,28 @@ Producthunt item
10061010
.block {
10071011
width: calc((1800px - 12px * 4)/4);
10081012
}
1013+
}
1014+
1015+
/***** PAGE ****/
1016+
.Page {
1017+
max-width: 1024px;
1018+
margin: 0 auto;
1019+
color: var(--primary-text-color);
1020+
}
1021+
.Page .title {
1022+
color: var(--primary-text-color)
1023+
}
1024+
.Page button {
1025+
background: var(--card-background-color);
1026+
border:none;
1027+
border-radius: 20px;
1028+
border: 1px solid var(--card-border-color);
1029+
padding: 8px 16px;
1030+
color: var(--primary-text-color);
1031+
cursor: pointer;
1032+
}
1033+
1034+
.Page .buttonIcon {
1035+
position: relative;
1036+
vertical-align: middle;
10091037
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)