Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
fb48a3b
migrate manifest to v3
medyo Oct 21, 2022
9232a90
fix web build command
medyo Oct 21, 2022
5ca65f8
fix uppercase issue
medyo Oct 21, 2022
513522b
add missing manifest attributes on the fly
medyo Oct 21, 2022
c4e9c4e
migrate the ads component to typescript
medyo Oct 23, 2022
a98bf18
use single quote
medyo Oct 23, 2022
10ab7e6
optimize export on prod env only
medyo Oct 23, 2022
fc59bda
add the app using QueryClientProvider
medyo Oct 23, 2022
bc3a28d
add missing dependencies
medyo Oct 23, 2022
ac28ef2
typescript changelog feature
medyo Oct 27, 2022
f524e4d
add changelog analytics event
medyo Oct 27, 2022
a053536
change `new` instead of the bell when a new version is published
medyo Oct 27, 2022
9a1cdb9
remove debug line
medyo Oct 27, 2022
4b4ee46
fix wrong identification attribute
medyo Oct 27, 2022
97bc47c
migrate settings to typescript
medyo Oct 28, 2022
2f570b6
migrate placeholders to ts
medyo Oct 28, 2022
46052d3
return data object from axios
medyo Oct 28, 2022
ccf28ce
remove unused showWidget
medyo Oct 28, 2022
a20edbd
migrate remote config to TS
medyo Oct 28, 2022
b302c87
remove unused Page css
medyo Oct 28, 2022
d691ced
migrate configuration context to zustand
medyo Oct 28, 2022
1e45f00
set remote config cache duration
medyo Oct 28, 2022
70b1d5d
add Page css styles
medyo Oct 28, 2022
5590bca
migrrate configuration wrapper to TS
medyo Oct 28, 2022
7c08106
migrate marketing banner to ts
medyo Oct 28, 2022
2cc38ab
organise assets
medyo Oct 28, 2022
ce8b795
move footer to elements
medyo Oct 28, 2022
eb5ae0d
move wrappers to providers folder
medyo Oct 28, 2022
f213520
move constant values to config folder
medyo Oct 28, 2022
0b70cd1
add the new user preferences store
medyo Oct 28, 2022
2d6f10f
migrate the bookmarks to ts
medyo Oct 28, 2022
c5f81f3
init hn card
Chouikane Oct 28, 2022
a4fd3dc
fix fetch carbon
Chouikane Oct 28, 2022
e16d945
get listingMode from user pref.
Chouikane Oct 28, 2022
df287de
move card types
Chouikane Oct 28, 2022
814dd6e
remove ad
Chouikane Oct 28, 2022
aefdad9
lobsters card
Chouikane Oct 28, 2022
6c960bc
producthunt card
Chouikane Oct 28, 2022
eefd15b
Indiehackers card
Chouikane Oct 28, 2022
bac31f5
migrate to the new store
medyo Oct 30, 2022
ac02161
producthunt cards
Chouikane Nov 1, 2022
2c6a85b
Merge branch 'develop' into refactor/typescript-cards
Chouikane Nov 1, 2022
181b0fa
fix ph card
Chouikane Nov 1, 2022
4119a5e
add reddit card
Chouikane Nov 1, 2022
f9593b2
unuseed import
Chouikane Nov 1, 2022
b739530
use card tags
Chouikane Nov 1, 2022
e26d37b
user prefercenes serialization
Chouikane Nov 2, 2022
eb80a55
fix serializations
Chouikane Nov 2, 2022
5e93278
devto card
Chouikane Nov 2, 2022
c28108e
add hashnode card
Chouikane Nov 2, 2022
65543b9
add medium card
Chouikane Nov 2, 2022
f54fd4e
fix placeholders
Chouikane Nov 2, 2022
99cff02
add freecodecamp card
Chouikane Nov 2, 2022
3b75786
add github card
Chouikane Nov 2, 2022
a9c8906
fix overlay issue
medyo Nov 3, 2022
a585f45
migrate appboundary to ts
medyo Nov 3, 2022
6a42b07
add Conferences card
Chouikane Nov 4, 2022
48ef0b2
fix github title
Chouikane Nov 4, 2022
8821a96
remove legacy code
medyo Nov 5, 2022
0921fc1
move constants to config
medyo Nov 5, 2022
8f87265
remove unused imports
medyo Nov 5, 2022
8a388e7
handle unsupported github tag
medyo Nov 5, 2022
ce5ac81
move user tags to the appropriate folder
medyo Nov 5, 2022
ce75dff
fix footer warnings
medyo Nov 5, 2022
43beee0
remove unused import
medyo Nov 5, 2022
83257ad
fix showing the ad
medyo Nov 5, 2022
1aa51d4
fix other minor warnings
medyo Nov 5, 2022
73bb80a
migrate asyncError to ts
medyo Nov 5, 2022
17f02de
fix github issues
medyo Nov 5, 2022
ddb67f2
set useErrorBoundary to false
Chouikane Nov 5, 2022
a48211d
add repo type
Chouikane Nov 5, 2022
14ae043
refactor the card component
medyo Nov 5, 2022
47b371c
fix hardcoded values
medyo Nov 5, 2022
95f3321
remove type from name
medyo Nov 5, 2022
3acb910
Conference title
Chouikane Nov 5, 2022
c4af437
Merge branch 'refactor/typescript-cards' of github.com:medyo/hackerta…
Chouikane Nov 5, 2022
949fc25
migrate colored badges and bottom navigation to ts
medyo Nov 5, 2022
d19ca70
add missing margin
medyo Nov 5, 2022
f031a94
remove card component
medyo Nov 5, 2022
94c96a4
migrate header to ts
medyo Nov 5, 2022
02ded0a
Merge branch 'refactor/typescript-cards' of github.com:medyo/hackerta…
medyo Nov 5, 2022
330e164
remove analytics tag
medyo Nov 5, 2022
b3453cc
fix wrong values field
medyo Nov 6, 2022
52e30ca
fix wrong medium tags values
medyo Nov 6, 2022
6a3d2eb
add missing analytics events
medyo Nov 6, 2022
630e040
fix terminal warnings
medyo Nov 6, 2022
6d9b2ad
add limit to list items
Chouikane Nov 6, 2022
3109fb0
fix analytics props
Chouikane Nov 6, 2022
942047e
fix producthunt points attribute
medyo Nov 6, 2022
96f51ca
Merge branch 'refactor/typescript-cards' of github.com:medyo/hackerta…
medyo Nov 6, 2022
615b29a
improve the placeholders
medyo Nov 6, 2022
2c49d2f
rm debug cache breaker
Chouikane Nov 6, 2022
3121358
Merge branch 'refactor/typescript-cards' of github.com:medyo/hackerta…
Chouikane Nov 6, 2022
c528af4
use generic Item type
medyo Nov 6, 2022
0d88649
Merge branch 'refactor/typescript-cards' of github.com:medyo/hackerta…
medyo Nov 6, 2022
89b8b98
fix react query keys
medyo Nov 6, 2022
7401a85
migrate appContentLayout to ts
medyo Nov 6, 2022
bb3e0bf
flatten remote config store
medyo Nov 6, 2022
596509f
migrate cardlink and clickable item to ts
medyo Nov 7, 2022
89fa902
improve the cards feature folder structure
medyo Nov 7, 2022
2004581
Merge pull request #97 from medyo/refactor/typescript-cards
medyo Nov 7, 2022
04a6055
add sentry to track errors
medyo Nov 7, 2022
23999c9
move keys to env
medyo Nov 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const path = require('path')
const webpack = require('webpack')

function isDevelopmentEnv() {
return process.env.NODE_ENV === 'development'
}

module.exports = {
webpack: {
plugins: {
add: [
new webpack.DefinePlugin({
process: { env: {} },
}),
],
},
alias: {
'@': path.resolve(__dirname, 'src'),
},
Expand All @@ -10,10 +22,10 @@ module.exports = {
filename: 'static/js/[name].js',
},
optimization: {
runtimeChunk: false,
runtimeChunk: isDevelopmentEnv(),
splitChunks: {
chunks(chunk) {
return false
return isDevelopmentEnv()
},
},
},
Expand All @@ -23,6 +35,10 @@ module.exports = {
{
plugin: {
overrideWebpackConfig: ({ webpackConfig }) => {
if (isDevelopmentEnv()) {
return webpackConfig
}

let mcep
webpackConfig.plugins.some((p) => {
if (p.constructor.name === 'MiniCssExtractPlugin') {
Expand Down
36 changes: 33 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
"dependencies": {
"@amplitude/analytics-browser": "^1.5.5",
"@craco/craco": "^6.4.5",
"@sentry/react": "^7.17.4",
"@sentry/tracing": "^7.17.4",
"@tanstack/react-query": "^4.13.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/dompurify": "^2.3.4",
"axios": "^0.21.2",
"axios-cache-adapter": "^2.7.3",
"country-emoji": "^1.5.4",
Expand All @@ -25,22 +29,30 @@
"react-modal": "^3.12.1",
"react-pro-sidebar": "^0.6.0",
"react-scripts": "4.0.1",
"react-select": "^4.0.2",
"react-select": "^5.0.1",
"react-spinners": "^0.10.4",
"react-toggle": "^4.1.1",
"react-tooltip": "^4.2.21",
"styled-components": "2",
"timeago.js": "^4.0.2",
"web-vitals": "^0.2.4"
"type-fest": "^1.2.0",
"web-vitals": "^0.2.4",
"zustand": "^4.1.3"
},
"proxy": "https://api.hackertab.dev/",
"scripts": {
"start": "craco start",
"web-build": "REACT_APP_WEB_BUILD=1 CI= react-scripts --max_old_space_size=3072 build",
"web-build": "craco --max_old_space_size=4096 build",
"build": "./script/build.sh",
"stores-build": "./script/stores_build.sh",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -53,12 +65,30 @@
"last 1 safari version"
]
},
"resolutions": {
"react-error-overlay": "6.0.9"
},
"devDependencies": {
"@types/chrome": "^0.0.198",
"@types/jest": "^29.1.2",
"@types/node": "^18.11.0",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@types/react-modal": "^3.13.1",
"@types/react-toggle": "^4.0.3",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^27.1.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"prettier": "^2.7.1",
"typescript": "^4.8.4"
}
}
16 changes: 4 additions & 12 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
{
"name": "Hackertab.dev - developer news",
"description": "All developer news in one tab",
"version": "1.14.1",
"manifest_version": 2,
"version": "1.14.2",
"manifest_version": 3,
"chrome_url_overrides": {
"newtab": "index.html"
},
"background": {
"scripts": [
"background.js"
]
"service_worker": "background.js"
},
"permissions": [
"host_permissions": [
"https://*.hackertab.dev/*"
],
"icons": {
"16": "/logos/logo16.png",
"32": "/logos/logo32.png",
"48": "/logos/logo48.png",
"128": "/logos/logo128.png"
},
"content_security_policy": "script-src 'self' object-src 'self'",
"applications": {
"gecko": {
"id": "{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"
}
}
}
11 changes: 10 additions & 1 deletion script/stores_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ firefox_build() {
export INLINE_RUNTIME_CHUNK=false
export GENERATE_SOURCEMAP=false

echo 'add missing geeko id'
yarn global add json
json -I -f public/manifest.json -e 'this.applications={}'
json -I -f public/manifest.json -e 'this.applications.gecko={}'
json -I -f public/manifest.json -e 'this.applications.gecko.id="{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"'

yarn build

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

echo 'zipping the source code for Firefox'
zip -r source_code.zip 'public/' 'script/' 'src' 'LICENSE' 'package.json' 'yarn.lock' 'README.md' 'craco.config.js' '.env' -x "*.DS_Store"
zip -r source_code.zip 'public/' 'script/' 'src' 'LICENSE' 'package.json' 'yarn.lock' 'README.md' 'craco.config.js' '.env' 'tsconfig.json' -x "*.DS_Store"

echo "revert manifest changes"
git restore public/manifest.json
}
chrome_build
firefox_build
26 changes: 11 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
import React, { useState, useEffect, useContext } from 'react'
import './App.css'
import ConfigurationContext from './configuration/ConfigurationContext'
import Footer from './components/Footer'
import Header from './components/Header'
import BookmarksSidebar from './bookmark/BookmarksSidebar'
import MarketingBanner from './components/MarketingBanner'
import React, { useState, useEffect } from 'react'
import 'src/assets/App.css'
import { Footer, Header } from 'src/components/Layout'
import { BookmarksSidebar } from 'src/features/bookmarks'
import { MarketingBanner } from 'src/components/Elements'
import ScrollCardsNavigator from './components/ScrollCardsNavigator'
import AppContentLayout from './components/AppContentLayout'
import { AppContentLayout } from './components/Layout'
import 'react-contexify/dist/ReactContexify.css'
import PreferencesContext from './preferences/PreferencesContext'
import { setupAnalytics, trackPageView, setupIdentification } from 'src/lib/analytics'
import { useRemoteConfigStore } from 'src/features/remoteConfig'

function App() {
const { marketingBannerConfig = {}, feedbackWidget } = useContext(ConfigurationContext)
const [showSideBar, setShowSideBar] = useState(false)
const [showSettings, setShowSettings] = useState(false)
const { dispatcher, ...state } = useContext(PreferencesContext)

const { marketingBannerConfig } = useRemoteConfigStore()

useEffect(() => {
setupAnalytics()
setupIdentification(state)
setupIdentification()
trackPageView('home')
}, [])

return (
<div className="App">
<Header
setShowSideBar={setShowSideBar}
state={state}
dispatcher={dispatcher}
showSideBar={showSideBar}
showSettings={showSettings}
setShowSettings={setShowSettings}
Expand All @@ -38,7 +34,7 @@ function App() {
<AppContentLayout setShowSettings={setShowSettings} />
<BookmarksSidebar showSidebar={showSideBar} onClose={() => setShowSideBar(false)} />

<Footer feedbackWidget={feedbackWidget} />
<Footer />
</div>
)
}
Expand Down
28 changes: 28 additions & 0 deletions src/App.css → src/assets/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,10 @@ Producthunt item
color: white;
}
.changelogButton.active {
width: auto;
font-size: 12px;
padding:0 4px;
text-transform: lowercase;
background-color: var(--tooltip-accent-color);
}

Expand Down Expand Up @@ -1006,4 +1010,28 @@ Producthunt item
.block {
width: calc((1800px - 12px * 4)/4);
}
}

/***** PAGE ****/
.Page {
max-width: 1024px;
margin: 0 auto;
color: var(--primary-text-color);
}
.Page .title {
color: var(--primary-text-color)
}
.Page button {
background: var(--card-background-color);
border:none;
border-radius: 20px;
border: 1px solid var(--card-border-color);
padding: 8px 16px;
color: var(--primary-text-color);
cursor: pointer;
}

.Page .buttonIcon {
position: relative;
vertical-align: middle;
}
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
4 changes: 2 additions & 2 deletions src/variables.css → src/assets/variables.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@font-face {
font-family: 'Nunito';
src: url("static/fonts/nunito/nunito-regular.woff2") format('woff2');
src: url("fonts/nunito/nunito-regular.woff2") format('woff2');
}

@font-face {
font-family: 'Nunito';
font-weight: 600;
font-style: normal;
src: url("static/fonts/nunito/nunito-semibold.woff2") format('woff2');
src: url("fonts/nunito/nunito-semibold.woff2") format('woff2');
}

html.dark {
Expand Down
Loading