Skip to content

Commit

Permalink
Version 1.19.0 (#176)
Browse files Browse the repository at this point in the history
* Feature to share news/posts/articles (#162)

* feature to share news/posts/articles

* added title and source to share model

* added title, removed redundancy of props

* colorful icons & title prop added to button

* css updated

* css changes

* fixed block-action-btns

* Merge branch 'shareFeature' of github.com:idebenone/hackertab.dev

* fix yarn.lock

* persist fetched queries in localstorage

* improve the share modal UI

* track copy and share events

* tag hackertabdev twitter account

* add missing api url

---------

Co-authored-by: Vineeth <[email protected]>
  • Loading branch information
medyo and idebenone authored Dec 9, 2023
1 parent b158a40 commit 113f94c
Show file tree
Hide file tree
Showing 45 changed files with 1,782 additions and 9,335 deletions.
48 changes: 33 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
name: Deploy to production
name: Deploy Web Version to hackertab.dev

on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
deploy:
branches:
- feat/cp-build
env:
VITE_BUILD_TARGET: 'web'
VITE_AMPLITUDE_KEY: ${{ secrets.REACT_APP_AMPLITUDE_KEY }}
VITE_AMPLITUDE_URL: ${{ secrets.REACT_APP_AMPLITUDE_URL }}
VITE_API_URL: ${{ secrets.API_URL }}

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: SSH and deploy node app
uses: fifsky/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
user: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
command: |
cd ~/hackertab.dev
git pull origin master
yarn
yarn build-web
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Install dependencies
run: yarn

- name: Build project
run: yarn build:web

- name: Copy build to remote host
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_SSH_HOST }}
username: ${{ secrets.DEPLOY_SSH_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
source: 'dist/'
target: '~/hackertab.dev'
16 changes: 6 additions & 10 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ on:
default: false
type: boolean
env:
REACT_APP_BUILD_TARGET: 'extension'
REACT_APP_AMPLITUDE_KEY: ${{ secrets.REACT_APP_AMPLITUDE_KEY }}
REACT_APP_AMPLITUDE_URL: ${{ secrets.REACT_APP_AMPLITUDE_URL }}
VITE_BUILD_TARGET: 'extension'
VITE_AMPLITUDE_KEY: ${{ secrets.REACT_APP_AMPLITUDE_KEY }}
VITE_AMPLITUDE_URL: ${{ secrets.REACT_APP_AMPLITUDE_URL }}
VITE_API_URL: ${{ secrets.API_URL }}

jobs:
tag_version:
Expand Down Expand Up @@ -73,9 +74,7 @@ jobs:
run: yarn

- name: Build and zip the extension
env:
NODE_OPTIONS: --openssl-legacy-provider
run: yarn build-chrome
run: yarn build:chrome

- name: Install chrome dependencies
run: yarn global add chrome-webstore-upload-cli
Expand Down Expand Up @@ -105,10 +104,7 @@ jobs:
run: yarn

- name: Build and zip the extension
env:
NODE_OPTIONS: --openssl-legacy-provider
run: yarn build-firefox

run: yarn build:firefox
- name: Upload the package to Firefox web store
if: ${{ github.event.inputs.testMode == 'false' }}
uses: yayuyokitano/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# production
/build

/dist
# misc
.DS_Store
.env.local
Expand Down
62 changes: 0 additions & 62 deletions craco.config.js

This file was deleted.

16 changes: 9 additions & 7 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="preconnect" href="https://hackertab.dev" />
<script src="./startup.js"></script>
<script src="/startup.js"></script>

<% if (process.env.REACT_APP_BUILD_TARGET==='web' ) { %>
<% if (isWebBuild) { %>
<title>Hackertab</title>
<link rel="manifest" href="%PUBLIC_URL%/web_manifest.json" />
<% } else { %>
<link rel="manifest" href="/web_manifest.json" />
<% } else { %>
<title>New Tab</title>
<% } %>
<%}%>
</head>
<body class="preload">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>

</body>
</html>
47 changes: 23 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"private": false,
"dependencies": {
"@amplitude/analytics-browser": "^1.5.5",
"@craco/craco": "^6.4.5",
"@tanstack/query-async-storage-persister": "^5.8.3",
"@tanstack/react-query": "^4.13.0",
"@tanstack/react-query-persist-client": "^5.8.4",
"@types/dompurify": "^2.3.4",
"@types/jspath": "^0.4.0",
"axios": "^0.21.2",
Expand All @@ -27,8 +28,9 @@
"react-markdown": "^7.0.1",
"react-modal": "^3.12.1",
"react-pro-sidebar": "^0.6.0",
"react-scripts": "4.0.1",
"react-select": "^5.0.1",
"react-share": "^4.4.1",
"react-simple-toasts": "^5.10.0",
"react-spinners": "^0.10.4",
"react-spring-bottom-sheet": "^3.4.1",
"react-toggle": "^4.1.1",
Expand All @@ -37,53 +39,46 @@
"styled-components": "2",
"timeago.js": "^4.0.2",
"type-fest": "^1.2.0",
"vite-plugin-ejs": "^1.6.4",
"web-vitals": "^0.2.4",
"zustand": "^4.3.3"
},
"proxy": "https://api.hackertab.dev/",
"scripts": {
"start": "craco start",
"build-web": "./script/build-web.sh",
"build": "./script/build.sh",
"build-firefox": "./script/build-firefox.sh",
"build-chrome": "./script/build-chrome.sh",
"eject": "react-scripts eject"
"start": "vite",
"build:web": "VITE_BUILD_TARGET=web ./script/build.sh",
"build:ext": "VITE_BUILD_TARGET=extension ./script/build.sh",
"build:firefox": "./script/build-firefox.sh",
"build:chrome": "./script/build-chrome.sh"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
"resolutions": {
"react-error-overlay": "6.0.9"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/chrome": "^0.0.198",
"@types/chrome": "^0.0.241",
"@types/jest": "^29.1.2",
"@types/jsonpath": "^0.2.0",
"@types/node": "^18.11.0",
"@types/node": "^20.4.2",
"@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.45.0",
"@typescript-eslint/parser": "^5.40.1",
"@vitejs/plugin-react": "^4.0.3",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -96,6 +91,10 @@
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"prettier": "^2.7.1",
"typescript": "^4.8.4"
"terser": "^5.19.2",
"typescript": "^5.1.6",
"vite": "^4.4.5",
"vite-plugin-svgr": "^3.2.0",
"vite-tsconfig-paths": "^4.2.0"
}
}
7 changes: 1 addition & 6 deletions script/build-chrome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ rm -f chrome_extension.zip

# Install dependencies
echo 'Install dependencies'
yarn build

# Copy generated build to distrubution folder
echo 'Copy generated build to distrubution folder'
mkdir -p dist
cp -r build/* dist
yarn build:ext

# Zip the distribution folder
echo 'Zip the extension'
Expand Down
9 changes: 2 additions & 7 deletions script/build-firefox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@ jq -s '.[0] * .[1]' ./public/base.manifest.json ./public/firefox.manifest.json >

# Install dependencies
echo 'Install dependencies'
yarn build

# Copy generated build to distrubution folder
echo 'Copy generated build to distrubution folder'
mkdir -p dist
cp -r build/* dist
yarn build:ext

# Zip the distribution folder
echo 'Zip the extension'
cd dist/ && zip -r ../firefox_extension.zip * -x "*.DS_Store" && cd ..

#
echo 'Zip the source code'
zip -r source_code.zip 'public/' 'script/' 'src' 'LICENSE' 'package.json' 'yarn.lock' 'README.md' 'craco.config.js' '.env' 'tsconfig.json' -x "*.DS_Store"
zip -r source_code.zip 'public/' 'script/' 'src' 'LICENSE' 'package.json' 'yarn.lock' 'README.md' 'vite.config.js' '.env' 'tsconfig.json' -x "*.DS_Store"
13 changes: 3 additions & 10 deletions script/build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/bash

build() {
echo 'building react'

echo 'Building Hackertab...'
rm -rf dist

export INLINE_RUNTIME_CHUNK=false
export GENERATE_SOURCEMAP=false

react-scripts build

mkdir -p dist
cp -r build/* dist/
tsc
vite build
}

build
Loading

0 comments on commit 113f94c

Please sign in to comment.