Skip to content

Commit beed7a4

Browse files
authored
Moved service worker into index.js (#77)
1 parent e1f85d9 commit beed7a4

File tree

14 files changed

+1193
-1162
lines changed

14 files changed

+1193
-1162
lines changed

.codeclimate.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.deepsource.toml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Code Quality Assurance
4+
name: Code Quality Assurance - JavaScript
55
permissions:
66
contents: read
77

@@ -26,9 +26,9 @@ jobs:
2626

2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@v6
3030
- name: Use Node.js ${{ matrix.node-version }}
31-
uses: actions/setup-node@v4
31+
uses: actions/setup-node@v6
3232
with:
3333
node-version: ${{ matrix.node-version }}
3434
- name: Cache Node.js modules
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Markdown Lint
1+
name: Code Quality Assurance - Markdown
22
permissions:
33
contents: read
44

@@ -9,24 +9,24 @@ on:
99
- "**/*.md"
1010
- ".markdownlint.json"
1111
- ".markdownlintignore"
12-
- ".github/workflows/markdown-lint.yaml"
12+
- ".github/workflows/code-qa-md.yaml"
1313
pull_request:
1414
branches: [master]
1515
paths:
1616
- "**/*.md"
1717
- ".markdownlint.json"
1818
- ".markdownlintignore"
19-
- ".github/workflows/markdown-lint.yaml"
19+
- ".github/workflows/code-qa-md.yaml"
2020

2121
jobs:
2222
lint-markdown:
2323
runs-on: ubuntu-latest
2424

2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2828
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v6
3030
with:
3131
node-version: ${{ matrix.node-version }}
3232
- name: Cache Node.js modules

.github/workflows/codeql-analysis.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545

4646
steps:
4747
- name: Checkout repository
48-
uses: actions/checkout@v5
48+
uses: actions/checkout@v6
4949

5050
# Initializes the CodeQL tools for scanning.
5151
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@v3
52+
uses: github/codeql-action/init@v4
5353
with:
5454
languages: ${{ matrix.language }}
5555
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -66,7 +66,7 @@ jobs:
6666
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
6767
# If this step fails, then you should remove it and run the build manually (see below)
6868
- name: Autobuild
69-
uses: github/codeql-action/autobuild@v3
69+
uses: github/codeql-action/autobuild@v4
7070

7171
# ℹ️ Command-line programs to run using the OS shell.
7272
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -79,6 +79,6 @@ jobs:
7979
# ./location_of_script_within_repo/buildscript.sh
8080

8181
- name: Perform CodeQL Analysis
82-
uses: github/codeql-action/analyze@v3
82+
uses: github/codeql-action/analyze@v4
8383
with:
8484
category: "/language:${{matrix.language}}"

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
Small Dev Talk is an independent news source that covers all things from the indie world of entertainment, from games to movies to books to technology and more. Our focus of Small Dev Talk is simply to give the chance of having upcoming developers show off their projects in forms of interviews which include images and video and present it to our audience.
44

5-
[![Maintainability](https://api.codeclimate.com/v1/badges/ed11eb461733c807d580/maintainability)](https://codeclimate.com/github/AlexJSully/Small-Dev-Talk/maintainability)
6-
[![CodeFactor](https://www.codefactor.io/repository/github/AlexJSully/small-dev-talk/badge)](https://www.codefactor.io/repository/github/AlexJSully/small-dev-talk)
7-
[![DeepSource](https://deepsource.io/gh/AlexJSully/Small-Dev-Talk.svg/?label=active+issues&show_trend=true&token=XwOjH3ktxwG4kKUkE0GZK0_p)](https://deepsource.io/gh/AlexJSully/Small-Dev-Talk/?ref=repository-badge)
85
[![Follow on Twitter](https://img.shields.io/twitter/follow/smalldevtalk?style=social)](https://twitter.com/smalldevtalk)
96
[![GitHub repo size](https://img.shields.io/github/repo-size/AlexJSully/Small-Dev-Talk)](https://github.com/AlexJSully/Small-Dev-Talk)
107
[![GitHub](https://img.shields.io/github/license/AlexJSully/Small-Dev-Talk)](https://github.com/AlexJSully/Small-Dev-Talk)
@@ -22,7 +19,7 @@ To visit specific articles, just change the directory to end with '?' + article
2219

2320
| Chrome | Firefox | Edge | Safari | Opera | Mobile |
2421
| ------ | ------- | ---- | ------ | ----- | ------ |
25-
|||| ? |||
22+
| | | | ? | | |
2623

2724
## Known issues
2825

@@ -43,7 +40,6 @@ If you want to support my work, you can through the following methods:
4340

4441
- [BTC](3Lp4pwF5nXqwFA62BYx4DSvDswyYpskBog) - 3Lp4pwF5nXqwFA62BYx4DSvDswyYpskBog
4542
- [ETH](0xc6EB17BD7cbe5976Bfc4f845669cD66Ff340a1A2) - 0xc6EB17BD7cbe5976Bfc4f845669cD66Ff340a1A2
46-
- [PayPal](https://paypal.me/alexjsully) - paypal.me/alexjsully
4743

4844
## Contributing
4945

cypress/e2e/landing.cy.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,18 @@ describe("Landing Page", () => {
3030

3131
it("should show error when article is missing", () => {
3232
// Simulate navigating to a missing article
33-
cy.visit("http://localhost:3000/index.html?NonExistentArticle");
33+
cy.visit("http://localhost:3000/index.html?NonExistentArticle", {
34+
onBeforeLoad(win) {
35+
// Simulate service worker registration throwing a disallowed redirect error
36+
Object.defineProperty(win.navigator, "serviceWorker", {
37+
value: {
38+
register: () => Promise.reject(new Error("disallowed redirect")),
39+
},
40+
writable: true,
41+
});
42+
},
43+
});
44+
3445
cy.get("#articleBody").should("contain", "Error retrieving article");
3546
cy.get("#articleBody").should("be.visible");
3647
});

index.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,6 @@
115115
<link rel="stylesheet preload" href="./src/scripts/libraries/bootstrap/css/bootstrap.min.css" as="style" />
116116
<script rel="preload" as="script" src="./src/scripts/libraries/bootstrap/js/bootstrap.bundle.min.js"></script>
117117
<script rel="preload" as="script" src="./src/scripts/libraries/showdown/showdown.min.js"></script>
118-
<script>
119-
// Add service workers
120-
if (typeof navigator !== "undefined" && "serviceWorker" in navigator) {
121-
window.addEventListener("load", () => {
122-
navigator.serviceWorker.register("./src/serviceWorker/sw.js");
123-
});
124-
}
125-
</script>
126118
<script rel="preload" as="script" src="./src/scripts/index.min.js"></script>
127119
<!-- Sentry -->
128120
<script

0 commit comments

Comments
 (0)