Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"react-dom": "^17.0.2",
"react-helmet-async": "^2.0.5",
"react-router-dom": "^6.28.0",
"react-tiny-popover": "5",
"react-tiny-popover": "^8.0.0",
"react-use": "^17.6.0",
"react-visibility-sensor": "^5.0.2",
"webpack-pwa-manifest": "^4.3.0",
Expand Down Expand Up @@ -156,7 +156,12 @@
"webpack-dev-server": "^5.2.3",
"webpack-merge": "^6.0.1",
"workbox-webpack-plugin": "^7.4.0",
"yarn-deduplicate": "^6.0.2"
"yarn-deduplicate": "^6.0.2",
"workbox-core": "^7.4.0",
"workbox-routing": "^7.4.0",
"workbox-strategies": "^7.4.0",
"workbox-cacheable-response": "^7.4.0",
"workbox-expiration": "^7.4.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you add them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were added while resolving the Workbox import issues locally. After reworking the sw.js imports, they’re not strictly necessary as direct dependencies anymore since workbox-webpack-plugin already brings them in.

I can remove them to avoid unnecessary dependency additions and keep the change focused on the hastscript fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed them successfully.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont know but seems ai generated

},
"engines": {
"node": ">= 20.9.0"
Expand Down
3 changes: 0 additions & 3 deletions src/sw.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies */
import { CacheableResponsePlugin } from "workbox-cacheable-response";
import { cacheNames } from "workbox-core";
import { ExpirationPlugin } from "workbox-expiration";
Expand All @@ -12,10 +11,8 @@ import {
NetworkOnly,
StaleWhileRevalidate,
} from "workbox-strategies";
/* eslint-enable import/no-extraneous-dependencies */

const cacheName = cacheNames.runtime;

const manifest = self.__WB_MANIFEST;
const otherManifest = [
{
Expand Down
15 changes: 14 additions & 1 deletion webpack.common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createRequire } from "node:module";
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-extraneous-dependencies
import hastscript from "hastscript";
import hastscriptImport from "hastscript";
import MiniCssExtractPlugin from "mini-css-extract-plugin";
import autolink from "remark-autolink-headings";
import remarkEmoji from "remark-emoji";
Expand All @@ -16,6 +16,19 @@ import remarkRemoveHeadingId from "./src/remark-plugins/remark-remove-heading-id
import remarkResponsiveTable from "./src/remark-plugins/remark-responsive-table/remark-responsive-table.mjs";
import slug from "./src/remark-plugins/remark-slug/index.mjs";

// hastscript can be resolved as ESM or CommonJS depending on environment/tooling.
// Support default-function exports and { h } named exports.
const hastscript =
(typeof hastscriptImport === "function" && hastscriptImport) ||
(typeof hastscriptImport?.h === "function" && hastscriptImport.h) ||
(typeof hastscriptImport?.default === "function" &&
hastscriptImport.default) ||
(typeof hastscriptImport?.default?.h === "function" &&
hastscriptImport.default.h);

if (!hastscript) {
throw new Error("Unable to resolve hastscript function export");
}
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

Expand Down
93 changes: 12 additions & 81 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3113,15 +3113,6 @@
"@typescript-eslint/visitor-keys" "8.54.0"
debug "^4.4.3"

"@typescript-eslint/project-service@8.53.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.53.0.tgz#327c67c61c16a1c8b12a440b0779b41eb77cc7df"
integrity sha512-Bl6Gdr7NqkqIP5yP9z1JU///Nmes4Eose6L1HwpuVHwScgDPPuEWbUVhvlZmb8hy0vX9syLk5EGNL700WcBlbg==
dependencies:
"@typescript-eslint/tsconfig-utils" "^8.53.0"
"@typescript-eslint/types" "^8.53.0"
debug "^4.4.3"

"@typescript-eslint/project-service@8.54.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.54.0.tgz#f582aceb3d752544c8e1b11fea8d95d00cf9adc6"
Expand All @@ -3131,14 +3122,6 @@
"@typescript-eslint/types" "^8.54.0"
debug "^4.4.3"

"@typescript-eslint/scope-manager@8.53.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.53.0.tgz#f922fcbf0d42e72f065297af31779ccf19de9a97"
integrity sha512-kWNj3l01eOGSdVBnfAF2K1BTh06WS0Yet6JUgb9Cmkqaz3Jlu0fdVUjj9UI8gPidBWSMqDIglmEXifSgDT/D0g==
dependencies:
"@typescript-eslint/types" "8.53.0"
"@typescript-eslint/visitor-keys" "8.53.0"

"@typescript-eslint/scope-manager@8.54.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz#307dc8cbd80157e2772c2d36216857415a71ab33"
Expand All @@ -3147,11 +3130,6 @@
"@typescript-eslint/types" "8.54.0"
"@typescript-eslint/visitor-keys" "8.54.0"

"@typescript-eslint/tsconfig-utils@8.53.0", "@typescript-eslint/tsconfig-utils@^8.53.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.0.tgz#105279d7969a7abdc8345cc9c57cff83cf910f8f"
integrity sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==

"@typescript-eslint/tsconfig-utils@8.54.0", "@typescript-eslint/tsconfig-utils@^8.54.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.54.0.tgz#71dd7ba1674bd48b172fc4c85b2f734b0eae3dbc"
Expand All @@ -3168,31 +3146,11 @@
debug "^4.4.3"
ts-api-utils "^2.4.0"

"@typescript-eslint/types@8.53.0", "@typescript-eslint/types@^8.52.0", "@typescript-eslint/types@^8.53.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.53.0.tgz#1adcad3fa32bc2c4cbf3785ba07a5e3151819efb"
integrity sha512-Bmh9KX31Vlxa13+PqPvt4RzKRN1XORYSLlAE+sO1i28NkisGbTtSLFVB3l7PWdHtR3E0mVMuC7JilWJ99m2HxQ==

"@typescript-eslint/types@8.54.0", "@typescript-eslint/types@^8.53.1", "@typescript-eslint/types@^8.54.0":
"@typescript-eslint/types@8.54.0", "@typescript-eslint/types@^8.52.0", "@typescript-eslint/types@^8.53.1", "@typescript-eslint/types@^8.54.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.54.0.tgz#c12d41f67a2e15a8a96fbc5f2d07b17331130889"
integrity sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==

"@typescript-eslint/typescript-estree@8.53.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.0.tgz#7805b46b7a8ce97e91b7bb56fc8b1ba26ca8ef52"
integrity sha512-pw0c0Gdo7Z4xOG987u3nJ8akL9093yEEKv8QTJ+Bhkghj1xyj8cgPaavlr9rq8h7+s6plUJ4QJYw2gCZodqmGw==
dependencies:
"@typescript-eslint/project-service" "8.53.0"
"@typescript-eslint/tsconfig-utils" "8.53.0"
"@typescript-eslint/types" "8.53.0"
"@typescript-eslint/visitor-keys" "8.53.0"
debug "^4.4.3"
minimatch "^9.0.5"
semver "^7.7.3"
tinyglobby "^0.2.15"
ts-api-utils "^2.4.0"

"@typescript-eslint/typescript-estree@8.54.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz#3c7716905b2b811fadbd2114804047d1bfc86527"
Expand All @@ -3208,7 +3166,7 @@
tinyglobby "^0.2.15"
ts-api-utils "^2.4.0"

"@typescript-eslint/utils@8.54.0":
"@typescript-eslint/utils@8.54.0", "@typescript-eslint/utils@^8.0.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.54.0.tgz#c79a4bcbeebb4f571278c0183ed1cb601d84c6c8"
integrity sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==
Expand All @@ -3218,24 +3176,6 @@
"@typescript-eslint/types" "8.54.0"
"@typescript-eslint/typescript-estree" "8.54.0"

"@typescript-eslint/utils@^8.0.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.53.0.tgz#bf0a4e2edaf1afc9abce209fc02f8cab0b74af13"
integrity sha512-XDY4mXTez3Z1iRDI5mbRhH4DFSt46oaIFsLg+Zn97+sYrXACziXSQcSelMybnVZ5pa1P6xYkPr5cMJyunM1ZDA==
dependencies:
"@eslint-community/eslint-utils" "^4.9.1"
"@typescript-eslint/scope-manager" "8.53.0"
"@typescript-eslint/types" "8.53.0"
"@typescript-eslint/typescript-estree" "8.53.0"

"@typescript-eslint/visitor-keys@8.53.0":
version "8.53.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.0.tgz#9a785664ddae7e3f7e570ad8166e48dbc9c6cf02"
integrity sha512-LZ2NqIHFhvFwxG0qZeLL9DvdNAHPGCY5dIRwBhyYeU+LfLhcStE1ImjsuTG/WaVh3XysGaeLW8Rqq7cGkPCFvw==
dependencies:
"@typescript-eslint/types" "8.53.0"
eslint-visitor-keys "^4.2.1"

"@typescript-eslint/visitor-keys@8.54.0":
version "8.54.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz#0e4b50124b210b8600b245dd66cbad52deb15590"
Expand Down Expand Up @@ -6323,16 +6263,7 @@ espree@^10.0.1, espree@^10.4.0, "espree@^9.6.1 || ^10.4.0":
acorn-jsx "^5.3.2"
eslint-visitor-keys "^4.2.1"

espree@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-11.0.0.tgz#2fa56e7b9d3091a618526307f8cab8f5624debbf"
integrity sha512-+gMeWRrIh/NsG+3NaLeWHuyeyk70p2tbvZIWBYcqQ4/7Xvars6GYTZNhF1sIeLcc6Wb11He5ffz3hsHyXFrw5A==
dependencies:
acorn "^8.15.0"
acorn-jsx "^5.3.2"
eslint-visitor-keys "^5.0.0"

espree@^11.1.0:
espree@^11.0.0, espree@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-11.1.0.tgz#7d0c82a69f8df670728dba256264b383fbf73e8f"
integrity sha512-WFWYhO1fV4iYkqOOvq8FbqIhr2pYfoDY0kCotMkDeNtGpiGGkZ1iov2u8ydjtgM8yF8rzK7oaTbw2NAzbAbehw==
Expand Down Expand Up @@ -11836,10 +11767,10 @@ react-router@6.28.0:
dependencies:
"@remix-run/router" "1.21.0"

react-tiny-popover@5:
version "5.1.0"
resolved "https://registry.yarnpkg.com/react-tiny-popover/-/react-tiny-popover-5.1.0.tgz#a205b39844352f32b4b0658fd96a9738d8626d9c"
integrity sha512-VjBp6Q1f4cJ2xiuyU1rhFnrs+fdnWCYFSrKRN4DTGD2ovchOAGR1jbJ9vgV34TtvMPON+SqBBZFnahVsAGmrUQ==
react-tiny-popover@^8.0.0:
version "8.1.6"
resolved "https://registry.yarnpkg.com/react-tiny-popover/-/react-tiny-popover-8.1.6.tgz#82fad10eb8f0d8197ce0944031fd03a524b78c29"
integrity sha512-jeZnGqHxb5TX7pCzpqLoVJned7DTVnLrLoCQQGFTyvlxXB/QUaet7O0krG22t5FReMBH035SLnzThKvk8tIfsg==

react-universal-interface@^0.6.2:
version "0.6.2"
Expand Down Expand Up @@ -14901,7 +14832,7 @@ workbox-build@^4.3.1:
workbox-sw "^4.3.1"
workbox-window "^4.3.1"

workbox-cacheable-response@7.4.0:
workbox-cacheable-response@7.4.0, workbox-cacheable-response@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-7.4.0.tgz#f684380c07dfce4ed1aa555c8a29a2a1f8421d46"
integrity sha512-0Fb8795zg/x23ISFkAc7lbWes6vbw34DGFIMw31cwuHPgDEC/5EYm6m/ZkylLX0EnEbbOyOCLjKgFS/Z5g0HeQ==
Expand All @@ -14915,7 +14846,7 @@ workbox-cacheable-response@^4.3.1:
dependencies:
workbox-core "^4.3.1"

workbox-core@7.4.0:
workbox-core@7.4.0, workbox-core@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-7.4.0.tgz#5cb59ae7655f2727423268fb1ba698f37809189d"
integrity sha512-6BMfd8tYEnN4baG4emG9U0hdXM4gGuDU3ectXuVHnj71vwxTFI7WOpQJC4siTOlVtGqCUtj0ZQNsrvi6kZZTAQ==
Expand All @@ -14925,7 +14856,7 @@ workbox-core@^4.3.1:
resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-4.3.1.tgz#005d2c6a06a171437afd6ca2904a5727ecd73be6"
integrity sha512-I3C9jlLmMKPxAC1t0ExCq+QoAMd0vAAHULEgRZ7kieCdUd919n53WC0AfvokHNwqRhGn+tIIj7vcb5duCjs2Kg==

workbox-expiration@7.4.0:
workbox-expiration@7.4.0, workbox-expiration@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/workbox-expiration/-/workbox-expiration-7.4.0.tgz#f7162a45ad8b28de84acea478df421b4d0065e61"
integrity sha512-V50p4BxYhtA80eOvulu8xVfPBgZbkxJ1Jr8UUn0rvqjGhLDqKNtfrDfjJKnLz2U8fO2xGQJTx/SKXNTzHOjnHw==
Expand Down Expand Up @@ -15016,7 +14947,7 @@ workbox-recipes@7.4.0:
workbox-routing "7.4.0"
workbox-strategies "7.4.0"

workbox-routing@7.4.0:
workbox-routing@7.4.0, workbox-routing@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-7.4.0.tgz#4b5bc90256515dc5cf49b356b101721fd135d013"
integrity sha512-C/ooj5uBWYAhAqwmU8HYQJdOjjDKBp9MzTQ+otpMmd+q0eF59K+NuXUek34wbL0RFrIXe/KKT+tUWcZcBqxbHQ==
Expand All @@ -15030,7 +14961,7 @@ workbox-routing@^4.3.1:
dependencies:
workbox-core "^4.3.1"

workbox-strategies@7.4.0:
workbox-strategies@7.4.0, workbox-strategies@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-7.4.0.tgz#59130734400722d39ce4a0a1a22a363e99913946"
integrity sha512-T4hVqIi5A4mHi92+5EppMX3cLaVywDp8nsyUgJhOZxcfSV/eQofcOA6/EMo5rnTNmNTpw0rUgjAI6LaVullPpg==
Expand Down
Loading