Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
language: node_js
node_js:
- "6.9"
- "20"

branches:
only:
- master

cache:
directories:
- react-app/node_modules

before_script:
- npm install -g firebase-tools
- npm install -g @angular/cli

install:
- cd react-app && npm install && cd ..

script:
- npm run build
- cd react-app && npm run build && npm test && cd ..

after_success:
- firebase use default
Expand Down
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
A progressive Hacker News client built with Angular
A progressive Hacker News client built with React, TypeScript and Vite (originally built with Angular)
</p>

<p align="center">
Expand Down Expand Up @@ -71,18 +71,34 @@ More to come!

Feel free to send me feedback on [twitter](https://twitter.com/hdjirdeh) or [file an issue](https://github.com/hdjirdeh/angular2-hn/issues/new)! Feature requests are always welcome.

## Build process
## Tech stack

This app was migrated from Angular 9 to a modern React stack:

- [React 19](https://react.dev/) with [TypeScript](https://www.typescriptlang.org/)
- [Vite](https://vite.dev/) for development and bundling
- [React Router](https://reactrouter.com/) for routing
- [Sass](https://sass-lang.com/) for theming
- [vite-plugin-pwa](https://vite-pwa-org.netlify.app/) (Workbox) for the service worker and manifest
- [Vitest](https://vitest.dev/) + [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) for tests

Note: This project has been ejected (with AOT + production settings) in order to customize Webpack configurations.
The React application lives in the [`react-app/`](./react-app) directory.

## Build process

- Clone or download the repo
- `cd react-app`
- `npm install`
- `npm start` to run the application with webpack-dev-server or `npm build` to kick off a fresh build and update the output directory (`dist/`)
- `npm run dev` to start the Vite dev server
- `npm run build` to produce a production build in `react-app/dist/`
- `npm test` to run the test suite
- `npm run lint` to lint the project

The root `package.json` also exposes convenience scripts that delegate to the
React app (e.g. `npm run dev`, `npm run build`, `npm test`, `npm run lint`).

Note: Any Service Worker changes will not be reflected when you run the application locally in development. To test service worker changes:
- `npm build`
- `npm run precache` to generate the service worker file
- `npm run static-serve` to load the application along with the service worker asset using [live-server](https://github.com/tapio/live-server)
Note: The service worker is only generated in production builds. To test it
locally run `npm run build` followed by `npm run preview` from `react-app/`.

## Contributors

Expand Down
134 changes: 0 additions & 134 deletions angular.json

This file was deleted.

12 changes: 0 additions & 12 deletions browserslist

This file was deleted.

32 changes: 0 additions & 32 deletions e2e/protractor.conf.js

This file was deleted.

23 changes: 0 additions & 23 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"rules": "database.rules.json"
},
"hosting": {
"public": "dist",
"public": "react-app/dist",
"rewrites": [
{
"source": "**",
Expand Down
32 changes: 0 additions & 32 deletions karma.conf.js

This file was deleted.

29 changes: 0 additions & 29 deletions ngsw-config.json

This file was deleted.

Loading