From 523df46c80eb164d0dc615775449853bbf3bcbb7 Mon Sep 17 00:00:00 2001 From: Szymon Tondowski Date: Tue, 2 Dec 2025 21:56:33 +0100 Subject: [PATCH 1/3] Typos fixed --- .eslintignore | 2 +- README.md | 4 ++-- docs/CONTRIBUTION.md | 10 ++++++---- processes/dev-script.ts | 2 +- processes/utils.ts | 3 --- .../{dev.user-srcipt.js => dev.user-script.js} | 0 6 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 processes/utils.ts rename src/user-script/{dev.user-srcipt.js => dev.user-script.js} (100%) diff --git a/.eslintignore b/.eslintignore index 17bbbeb..88940b3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ node_modules/ -github-usernames.user-srcipt.js \ No newline at end of file +github-usernames.user-script.js \ No newline at end of file diff --git a/README.md b/README.md index 47942c7..7b6a41a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ https://github.com/orgs/community/discussions/61959 The script available here swaps usernames with preferred names from profiles ex. Jim Helper, Jim H. (if available). It allows you to set custom names for picked users and limit these options only to users with specific patterns in their usernames. For instance limit to `dundermifflin` would swap names only for this organization. -## Instalation +## Installation 1. Install https://www.tampermonkey.net/ - It is a very popular browser extension that allows you to add custom scripts to selected domains. @@ -21,7 +21,7 @@ The script available here swaps usernames with preferred names from profiles ex. 2. Go to https://deykun.github.io/github-usernames/github-usernames.user.js -![Instalation demo](docs/demo-install.gif) +![Installation demo](docs/demo-install.gif) ### Saving users names diff --git a/docs/CONTRIBUTION.md b/docs/CONTRIBUTION.md index 2a73336..8e323c5 100644 --- a/docs/CONTRIBUTION.md +++ b/docs/CONTRIBUTION.md @@ -1,12 +1,14 @@ # Contribution -# One-time setup -1. Install `src/user-script/dev.user-srcipt.js`. +## One-time setup + +1. Install `src/user-script/dev.user-script.js`. 2. In the "Settings" tab of Tampermonkey, check the box for waiting on update. 3. Provide the address `http://localhost:1234/server.user-script.js`. -4. Install dependecies `npm ci` +4. Install dependencies `npm ci` + +## Using the script -# Using the script 1. Run `npm run dev-us` in one terminal - It builds the script from base files and watches changes 2. Run `npm run dev-us-server` in another terminal - serves the dev script as a dependency 3. [make changes to scripts] diff --git a/processes/dev-script.ts b/processes/dev-script.ts index 8ec0052..db9fbd4 100644 --- a/processes/dev-script.ts +++ b/processes/dev-script.ts @@ -14,7 +14,7 @@ console.log('(An updated version of the script will be downloaded when you check console.log(''); userScriptApp.get('/server.user-script.js', (req, res) => { - const devScript = fs.readFileSync('src/user-script/dev.user-srcipt.js', 'utf-8'); + const devScript = fs.readFileSync('src/user-script/dev.user-script.js', 'utf-8'); const version = `2.${Math.floor((new Date()).getTime() / 1000)}`; diff --git a/processes/utils.ts b/processes/utils.ts deleted file mode 100644 index 8744c88..0000000 --- a/processes/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const replaceTagWithFile =({ tag, path, name }) => { - -} \ No newline at end of file diff --git a/src/user-script/dev.user-srcipt.js b/src/user-script/dev.user-script.js similarity index 100% rename from src/user-script/dev.user-srcipt.js rename to src/user-script/dev.user-script.js From 8b3b6b2d0bf247ddb9fb5ef9f1b6886e1215c11e Mon Sep 17 00:00:00 2001 From: Szymon Tondowski Date: Tue, 2 Dec 2025 22:01:01 +0100 Subject: [PATCH 2/3] Typos fixed --- src/user-script/parts/constants.js | 2 +- src/user-script/parts/helpers.test.js | 2 +- src/user-script/template.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/user-script/parts/constants.js b/src/user-script/parts/constants.js index 7547e92..79b9d84 100644 --- a/src/user-script/parts/constants.js +++ b/src/user-script/parts/constants.js @@ -21,7 +21,7 @@ window.U2N = { cache: { HTML: {}, CSS: {}, - inited: false, + wasInited: false, status: null, location: location.href, }, diff --git a/src/user-script/parts/helpers.test.js b/src/user-script/parts/helpers.test.js index 43d1b43..b9cd714 100644 --- a/src/user-script/parts/helpers.test.js +++ b/src/user-script/parts/helpers.test.js @@ -3,6 +3,6 @@ import { upperCaseFirstLetter } from './helpers'; describe('upperCaseFirstLetter', () => { it('upperCaseFirstLetter() - should capitalize', () => { - expect(upperCaseFirstLetter('jonh')).toBe('Jonh'); + expect(upperCaseFirstLetter('john')).toBe('John'); }); }); diff --git a/src/user-script/template.js b/src/user-script/template.js index 2ddf461..202b72c 100644 --- a/src/user-script/template.js +++ b/src/user-script/template.js @@ -43,11 +43,11 @@ const domReady = (fn) => { }; const initU2N = async () => { - if (window.U2N.cache.inited) { + if (window.U2N.cache.wasInited) { return; } - window.U2N.cache.inited = true; + window.U2N.cache.wasInited = true; try { /* import @/db.js */ From 1c6660ec4cdf114a78e4fb7afc456d01e32e7338 Mon Sep 17 00:00:00 2001 From: Szymon Tondowski Date: Tue, 2 Dec 2025 22:02:29 +0100 Subject: [PATCH 3/3] Typos fixed --- package.json | 2 +- public/github-usernames.user.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 50046a8..bee4a55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "github-usernames", "private": true, - "version": "1.1.2", + "version": "1.1.3", "type": "module", "author": "Szymon Tondowski", "license": "MIT", diff --git a/public/github-usernames.user.js b/public/github-usernames.user.js index cf5a4d2..be36ee4 100644 --- a/public/github-usernames.user.js +++ b/public/github-usernames.user.js @@ -3,7 +3,7 @@ // @description Replace ambiguous usernames with actual names from user profiles. // @namespace deykun // @author deykun -// @version 1.1.2 +// @version 1.1.3 // @include https://github.com* // @grant none // @run-at document-start @@ -31,12 +31,12 @@ const getUsersByUsernamesFromLS = () => getFromLocalStorage('u2n-users'); const getCustomNamesByUsernamesFromLS = () => getFromLocalStorage('u2n-users-names'); window.U2N = { - version: '1.1.2', + version: '1.1.3', isDevMode: false, cache: { HTML: {}, CSS: {}, - inited: false, + wasInited: false, status: null, location: location.href, }, @@ -84,11 +84,11 @@ const domReady = (fn) => { }; const initU2N = async () => { - if (window.U2N.cache.inited) { + if (window.U2N.cache.wasInited) { return; } - window.U2N.cache.inited = true; + window.U2N.cache.wasInited = true; try { const updateStatus = ({ type = '', text = '', durationInSeconds = 4 }) => {