Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c35732d
feature: upgrade Angular 9 -> 10 via ng update
devin-ai-integration[bot] Aug 5, 2026
5809c0c
feature: upgrade Angular 10 -> 11 via ng update
devin-ai-integration[bot] Aug 5, 2026
abbbb30
feature: upgrade Angular 11 -> 12, drop tslint/codelyzer/protractor t…
devin-ai-integration[bot] Aug 5, 2026
ff2581c
feature: upgrade Angular 12 -> 13 via ng update
devin-ai-integration[bot] Aug 5, 2026
5af59e4
feature: upgrade Angular 13 -> 14 via ng update
devin-ai-integration[bot] Aug 5, 2026
ab5b1c5
feature: upgrade Angular 14 -> 15 via ng update
devin-ai-integration[bot] Aug 5, 2026
2b7a9ac
feature: upgrade Angular 15 -> 16 via ng update
devin-ai-integration[bot] Aug 5, 2026
2c3e479
feature: upgrade Angular 16 -> 17 via ng update
devin-ai-integration[bot] Aug 5, 2026
4a4d9b0
feature: upgrade Angular 17 -> 18 via ng update
devin-ai-integration[bot] Aug 5, 2026
e192039
feature: upgrade Angular 18 -> 19 via ng update
devin-ai-integration[bot] Aug 5, 2026
8c404eb
feature: migrate build to the application (esbuild) builder
devin-ai-integration[bot] Aug 5, 2026
1ebaed2
feature: standalone components, functional routing, HttpClient API la…
devin-ai-integration[bot] Aug 5, 2026
bea3b12
feature: adopt built-in control flow in templates
devin-ai-integration[bot] Aug 5, 2026
301ac0b
feature: replace tslint with eslint and fix reported lint issues
devin-ai-integration[bot] Aug 5, 2026
eb1417f
feature: modernize karma setup, add unit tests, track package-lock
devin-ai-integration[bot] Aug 5, 2026
bc8f262
feature: replace travis with github actions ci and fix hosting output…
devin-ai-integration[bot] Aug 5, 2026
0629985
feature: resolve poll options via the official HN API and modernize b…
devin-ai-integration[bot] Aug 5, 2026
1a2dab1
feature: drop leftover fetch polyfills and refresh docs for the moder…
devin-ai-integration[bot] Aug 5, 2026
8eb3463
bug: resync package-lock.json so npm ci succeeds in CI
devin-ai-integration[bot] Aug 5, 2026
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
9 changes: 5 additions & 4 deletions browserslist → .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
last 2 Chrome versions
last 2 Firefox versions
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run test -- --watch=false
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/angular-hnpwa/browser
retention-days: 7

deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
env:
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- name: Write Firebase service account credentials
if: env.FIREBASE_SERVICE_ACCOUNT != ''
run: |
printf '%s' "$FIREBASE_SERVICE_ACCOUNT" > "$RUNNER_TEMP/firebase-service-account.json"
echo "GOOGLE_APPLICATION_CREDENTIALS=$RUNNER_TEMP/firebase-service-account.json" >> "$GITHUB_ENV"
- name: Deploy to Firebase
run: npx --yes firebase-tools@15.24.0 deploy --project default --non-interactive
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ speed-measure-plugin.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

25 changes: 10 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@ Even if you have little to no experience with Angular, I'll be more than happy t
1. Fork the repo
2. Clone your fork
3. Make a branch for your feature or bug fix
4. If you don't have Angular CLI installed: `npm install -g angular-cli@latest`
5. `ng init`
6. Type `n` for each file to not overwrite any file changes
7. Run `npm start` and open `localhost:4200` in a browser
8. Work your magic
9. Run `npm run build` or `npm run static-serve` to kick off a production build and make sure nothing is broken
10. To test service worker changes:
* `npm run build` to kick off a fresh build and update the `dist/` directory
* `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)
11. Add yourself to the [contributor's list](https://github.com/hdjirdeh/angular2-hn#contributors) in the README!
12. Commit your changes and reference the issue you're addressing (for example: `git commit -am 'Commit message. Closes #5'`)
13. Push your branch to your fork
14. Create a pull request from your branch on your fork to `master` on this repo
15. Have your branch get merged in! :star2:
4. Install the dependencies with `npm install` (Node 20 or later)
5. Run `npm start` and open `localhost:4200` in a browser
6. Work your magic
7. Run `npm run lint`, `npm test -- --watch=false` and `npm run build` to make sure nothing is broken
8. To test service worker changes, run `npm run build` and serve `dist/angular-hnpwa/browser` over HTTP (the service worker is only enabled in production builds)
9. Add yourself to the [contributor's list](https://github.com/hdjirdeh/angular2-hn#contributors) in the README!
10. Commit your changes and reference the issue you're addressing (for example: `git commit -am 'Commit message. Closes #5'`)
11. Push your branch to your fork
12. Create a pull request from your branch on your fork to `master` on this repo
13. Have your branch get merged in! :star2:

If you experience a problem at any point, please don't hesitate to file an issue or send me a message!
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<p align="center">
<a href="/CONTRIBUTING.md"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
<a href="https://travis-ci.org/housseindjirdeh/angular2-hn"><img alt="Build Status" src="https://travis-ci.org/housseindjirdeh/angular2-hn.svg?branch=master"></a>
<a href="../../actions/workflows/ci.yml"><img alt="Build Status" src="../../actions/workflows/ci.yml/badge.svg"></a>
</p>

---
Expand Down Expand Up @@ -43,7 +43,7 @@

## Offline Support

This app uses [Workbox](https://workboxjs.org/) to generate a service worker as part of the build step to load quickly and work offline.
This app uses the [Angular service worker](https://angular.dev/ecosystem/service-workers) to generate a service worker as part of the production build so it loads quickly and works offline.

## Manifest

Expand Down Expand Up @@ -73,16 +73,16 @@ Feel free to send me feedback on [twitter](https://twitter.com/hdjirdeh) or [fil

## Build process

Note: This project has been ejected (with AOT + production settings) in order to customize Webpack configurations.
The app is built with Angular 19 (standalone components, `provideRouter`/`provideHttpClient`) and the Angular CLI application builder. Node 20 or later is required.

- Clone or download the repo
- `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 start` to run the dev server, or `npm run build` for a production build in `dist/angular-hnpwa/browser`
- `npm run lint` and `npm test -- --watch=false` to lint and run the unit tests

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)
Stories come from the [HNPWA API](https://api.hnpwa.com), configured per environment in `src/environments/`.

Note: the service worker is only enabled in production builds. To test it, run `npm run build` and serve `dist/angular-hnpwa/browser` over HTTP (for example with `npx http-server dist/angular-hnpwa/browser`).

## Contributors

Expand Down
96 changes: 44 additions & 52 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"aot": true,
"outputPath": "dist/angular-hnpwa",
"outputPath": {
"base": "dist/angular-hnpwa"
},
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json",
"src/manifest.webmanifest"
"src/manifest.json"
],
"styles": [
"src/styles.scss"
Expand All @@ -42,59 +44,61 @@
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": true,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
"maximumWarning": "1mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
"maximumWarning": "6kb",
"maximumError": "10kb"
}
],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
"outputHashing": "all",
"serviceWorker": "ngsw-config.json"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular-hnpwa:build"
},
"configurations": {
"production": {
"browserTarget": "angular-hnpwa:build:production"
"buildTarget": "angular-hnpwa:build:production"
},
"development": {
"buildTarget": "angular-hnpwa:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular-hnpwa:build"
"buildTarget": "angular-hnpwa:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.webmanifest"
"src/manifest.json"
],
"styles": [
"src/styles.scss"
Expand All @@ -103,32 +107,20 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "angular-hnpwa:serve"
},
"configurations": {
"production": {
"devServerTarget": "angular-hnpwa:serve:production"
}
}
}
}
}
},
"defaultProject": "angular-hnpwa"
"cli": {
"schematicCollections": [
"angular-eslint"
]
}
}
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.

Loading
Loading