Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ [Scripts] Mark some static props as readonly #67

Merged
merged 3 commits into from
Aug 23, 2024
Merged
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.4
22.6
1,991 changes: 1,149 additions & 842 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"type": "module",
"engines": {
"node": ">=22.4.0",
"node": ">=22.6.0",
"npm": ">=10.8.0"
},
"scripts": {
Expand All @@ -38,21 +38,21 @@
"test": "echo 'There is no testing suite set up for this app.'"
},
"dependencies": {
"@astrojs/check": "^0.8.3",
"@fontsource-variable/outfit": "^5.0.13",
"astro": "^4.12.2",
"astro-icon": "^1.1.0",
"beeftools": "^0.1.6",
"@astrojs/check": "^0.9.3",
"@fontsource-variable/outfit": "^5.0.14",
"astro": "^4.14.5",
"astro-icon": "^1.1.1",
"beeftools": "^0.1.7",
"typescript": "^5.5.4"
},
"devDependencies": {
"@typescript-eslint/parser": "^7.17.0",
"@typescript-eslint/parser": "^8.2.0",
"@vite-pwa/astro": "^0.4.0",
"@vite-pwa/assets-generator": "^0.2.4",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-jsx-a11y": "^6.9.0",
"lightningcss": "^1.25.1",
"lightningcss": "^1.26.0",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1"
}
Expand Down
2 changes: 1 addition & 1 deletion src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/// <reference types="astro/client" />
/// <reference path="../.astro/types.d.ts" />
/// <reference types="vite-plugin-pwa/vanillajs" />
/// <reference types="vite-plugin-pwa/info" />
2 changes: 1 addition & 1 deletion src/scripts/PageLoad.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type HtmlReady = 'loading' | 'done' | 'error';

export class PageLoad {
static MOTION_DELAY = 1200;
static readonly MOTION_DELAY = 1200;

static documentState() {
return document.readyState;
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/Portfolio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Portfolio {
// re-appear everytime the url is updated (ex: via replaceState). I am
// simply disabling this behaviour for now... but I may need to do a
// user-agent sniff in order to work around it.
static SUPPORT_URL_UPDATES = false;
static readonly SUPPORT_URL_UPDATES = false;

constructor(selectors?: Selectors, onScroll?: CustomScrollFn) {
this.#selector = {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/PwaServiceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type PwaReloadFn = ((reloadPage?: boolean) => Promise<void>) | undefined;
export class PwaServiceWorker {
// TODO: We probably want to initialize a global singleton
// that gets imported and shared in various places.
static #tracker = new ToastTracker();
static readonly #tracker = new ToastTracker();
static #refreshWorker: PwaReloadFn;

static install() {
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/SecretEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const DEFAULT_CLASSNAMES = {
};

export class SecretEmail {
static defaultSecretClass = DEFAULT_CLASSNAMES.secret;
static defaultReplaceClass = DEFAULT_CLASSNAMES.replace;
static readonly defaultSecretClass = DEFAULT_CLASSNAMES.secret;
static readonly defaultReplaceClass = DEFAULT_CLASSNAMES.replace;

readonly email: string;
readonly secretClass: string;
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/ToastTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ type AddArgs = ConstructorParameters<typeof ToastNotification>;

// TODO: Add event for `count` change using `emitten`.
export class ToastTracker {
static MAX_SIZE = 10;
static DISMISS_AFTER_MS = 9999;
static readonly MAX_SIZE = 10;
static readonly DISMISS_AFTER_MS = 9999;

#portal: HTMLElement;
#queue: Map<string, ToastNotification>;
Expand Down