From e3b918cab45bff0c8c6ffbf97869c155306be14a Mon Sep 17 00:00:00 2001 From: Federico Date: Sat, 1 Jun 2024 12:38:49 +0800 Subject: [PATCH 1/9] Don't bundle github-reserved-names --- package-lock.json | 9 +++++---- package.json | 6 ++++-- vite.config.ts | 5 ++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6da21b9..04e9c8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,12 @@ "name": "github-url-detection", "version": "8.1.1", "license": "MIT", + "dependencies": { + "github-reserved-names": "^2.0.5" + }, "devDependencies": { "@sindresorhus/tsconfig": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^3.1.1", - "github-reserved-names": "^2.0.5", "npm-run-all": "^4.1.5", "strip-indent": "^4.0.0", "svelte": "^4.2.17", @@ -22,7 +24,7 @@ "xo": "^0.58.0" }, "engines": { - "node": ">=18" + "node": ">=20.10" }, "funding": { "url": "https://github.com/sponsors/fregante" @@ -4272,8 +4274,7 @@ "node_modules/github-reserved-names": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/github-reserved-names/-/github-reserved-names-2.0.5.tgz", - "integrity": "sha512-9MAoXwjdafN1P2Ve6Y54+buAYRDZLKJcJo12KxMbPe1flaC7S314dS+TleNbNFeh+36s3L00Fgfir7OD4NJ56Q==", - "dev": true + "integrity": "sha512-9MAoXwjdafN1P2Ve6Y54+buAYRDZLKJcJo12KxMbPe1flaC7S314dS+TleNbNFeh+36s3L00Fgfir7OD4NJ56Q==" }, "node_modules/glob": { "version": "7.2.3", diff --git a/package.json b/package.json index d260fe6..f80c84a 100644 --- a/package.json +++ b/package.json @@ -54,10 +54,12 @@ } ] }, + "dependencies": { + "github-reserved-names": "^2.0.5" + }, "devDependencies": { "@sindresorhus/tsconfig": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^3.1.1", - "github-reserved-names": "^2.0.5", "npm-run-all": "^4.1.5", "strip-indent": "^4.0.0", "svelte": "^4.2.17", @@ -68,6 +70,6 @@ "xo": "^0.58.0" }, "engines": { - "node": ">=18" + "node": ">=20.10" } } diff --git a/vite.config.ts b/vite.config.ts index a4e08d7..8c0e2b3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,8 +10,11 @@ export default defineConfig({ entry: 'index.ts', fileName: 'index', }, - target: 'es2021', + target: 'node20.10', // https://github.com/evanw/esbuild/issues/3778 outDir: 'distribution', minify: false, + rollupOptions: { + external: ['github-reserved-names/reserved-names.json'], + }, }, }); From 319f16ba552b1852fbdbdf1c42aa58becc6ac076 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 12:33:47 +0800 Subject: [PATCH 2/9] Use esbuild --- collector.ts | 4 +- global.d.ts | 10 - index.ts | 180 ++++++------- package-lock.json | 645 +++++++++++++++++++++++++++++++++++++++------- package.json | 5 +- vite.config.ts | 2 - 6 files changed, 645 insertions(+), 201 deletions(-) diff --git a/collector.ts b/collector.ts index 4721180..8bf17e2 100644 --- a/collector.ts +++ b/collector.ts @@ -3,9 +3,7 @@ export const testableUrls = new Map(); export function addTests(test: string, urls: string[]): void { - if (import.meta.env.VITE_KEEP_URLS === '1') { - testableUrls.set(test, urls); - } + TEST: testableUrls.set(test, urls); } export function getTests(detectName: string): string[] { diff --git a/global.d.ts b/global.d.ts index 64b043c..85206ef 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,15 +1,5 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions -- Module augmentation */ -/// - -interface ImportMetaEnv { - readonly VITE_KEEP_URLS: string; -} - -interface ImportMeta { - readonly env: ImportMetaEnv; -} - // Broaden types because testing against `"undefined"` is fine for our regexes interface RegExp { test(s: string | undefined): boolean; diff --git a/index.ts b/index.ts index 120216a..b69a946 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,7 @@ const exists = (selector: string) => Boolean($(selector)); const combinedTestOnly = ['combinedTestOnly']; // To be used only to skip tests of combined functions, i.e. isPageA() || isPageB() -addTests('__urls_that_dont_match__', [ +TEST: addTests('__urls_that_dont_match__', [ 'https://github.com/sindresorhus/refined-github/issues/new', 'https://github.com/sindresorhus/refined-github/issues/new/choose', 'https://github.com/sindresorhus/refined-github/issues/templates/edit', @@ -22,22 +22,22 @@ export const isPasswordConfirmation = (): boolean => document.title === 'Confirm export const isLoggedIn = (): boolean => exists('body.logged-in'); export const isBlame = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('blame/')); -addTests('isBlame', [ +TEST: addTests('isBlame', [ 'https://github.com/sindresorhus/refined-github/blame/master/package.json', ]); export const isCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => isSingleCommit(url) || isPRCommit(url); -addTests('isCommit', [ +TEST: addTests('isCommit', [ 'https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f', 'https://github.com/sindresorhus/refined-github/commit/5b614', 'isPRCommit', ]); export const isCommitList = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepoCommitList(url) || isPRCommitList(url); -addTests('isCommitList', combinedTestOnly); +TEST: addTests('isCommitList', combinedTestOnly); export const isRepoCommitList = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('commits')); -addTests('isRepoCommitList', [ +TEST: addTests('isRepoCommitList', [ 'https://github.com/sindresorhus/refined-github/commits/master?page=2', 'https://github.com/sindresorhus/refined-github/commits/test-branch', 'https://github.com/sindresorhus/refined-github/commits/0.13.0', @@ -48,7 +48,7 @@ addTests('isRepoCommitList', [ ]); export const isCompare = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('compare')); -addTests('isCompare', [ +TEST: addTests('isCompare', [ 'https://github.com/sindresorhus/refined-github/compare', 'https://github.com/sindresorhus/refined-github/compare/', 'https://github.com/sindresorhus/refined-github/compare/master...branch-name', @@ -58,13 +58,13 @@ addTests('isCompare', [ ]); export const isCompareWikiPage = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepoWiki(url) && getCleanPathname(url).split('/').slice(3, 5).includes('_compare'); -addTests('isCompareWikiPage', [ +TEST: addTests('isCompareWikiPage', [ 'https://github.com/brookhong/Surfingkeys/wiki/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', 'https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', ]); export const isDashboard = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^(orgs\/[^/]+\/)?dashboard(-feed)?(\/|$)/.test(getCleanPathname(url)); -addTests('isDashboard', [ +TEST: addTests('isDashboard', [ 'https://github.com///', 'https://github.com//', 'https://github.com/', @@ -87,7 +87,7 @@ addTests('isDashboard', [ ]); export const isEnterprise = (url: URL | HTMLAnchorElement | Location = location): boolean => url.hostname !== 'github.com' && url.hostname !== 'gist.github.com'; -addTests('isEnterprise', [ +TEST: addTests('isEnterprise', [ 'https://github.big-corp.com/', 'https://not-github.com/', 'https://my-little-hub.com/', @@ -97,7 +97,7 @@ addTests('isEnterprise', [ ]); export const isGist = (url: URL | HTMLAnchorElement | Location = location): boolean => typeof getCleanGistPathname(url) === 'string'; -addTests('isGist', [ +TEST: addTests('isGist', [ 'https://gist.github.com', 'http://gist.github.com', 'https://gist.github.com/fregante/2205329b71218fa2c1d3', @@ -113,7 +113,7 @@ addTests('isGist', [ ]); export const isGlobalIssueOrPRList = (url: URL | HTMLAnchorElement | Location = location): boolean => ['issues', 'pulls'].includes(url.pathname.split('/', 2)[1]!); -addTests('isGlobalIssueOrPRList', [ +TEST: addTests('isGlobalIssueOrPRList', [ 'https://github.com/issues', 'https://github.com/issues?q=is%3Apr+is%3Aopen', 'https://github.com/issues/assigned', @@ -126,12 +126,12 @@ addTests('isGlobalIssueOrPRList', [ ]); export const isGlobalSearchResults = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/search' && new URLSearchParams(url.search).get('q') !== null; -addTests('isGlobalSearchResults', [ +TEST: addTests('isGlobalSearchResults', [ 'https://github.com/search?q=refined-github&ref=opensearch', ]); export const isIssue = (url: URL | HTMLAnchorElement | Location = location): boolean => /^issues\/\d+/.test(getRepo(url)?.path) && document.title !== 'GitHub · Where software is built'; // The title check excludes deleted issues -addTests('isIssue', [ +TEST: addTests('isIssue', [ 'https://github.com/sindresorhus/refined-github/issues/146', ]); @@ -139,49 +139,49 @@ export const isIssueOrPRList = (url: URL | HTMLAnchorElement | Location = locati isGlobalIssueOrPRList(url) || isRepoIssueOrPRList(url) || isMilestone(url); -addTests('isIssueOrPRList', combinedTestOnly); +TEST: addTests('isIssueOrPRList', combinedTestOnly); export const isConversation = (url: URL | HTMLAnchorElement | Location = location): boolean => isIssue(url) || isPRConversation(url); -addTests('isConversation', combinedTestOnly); +TEST: addTests('isConversation', combinedTestOnly); export const isLabelList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'labels'; -addTests('isLabelList', [ +TEST: addTests('isLabelList', [ 'https://github.com/sindresorhus/refined-github/labels', 'https://github.com/sindresorhus/refined-github/labels/', ]); export const isMilestone = (url: URL | HTMLAnchorElement | Location = location): boolean => /^milestone\/\d+/.test(getRepo(url)?.path); -addTests('isMilestone', [ +TEST: addTests('isMilestone', [ 'https://github.com/kubernetes/kubernetes/milestone/56', ]); export const isMilestoneList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'milestones'; -addTests('isMilestoneList', [ +TEST: addTests('isMilestoneList', [ 'https://github.com/sindresorhus/refined-github/milestones', ]); export const isNewFile = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('new')); -addTests('isNewFile', [ +TEST: addTests('isNewFile', [ 'https://github.com/sindresorhus/refined-github/new/main', ]); export const isNewIssue = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'issues/new'; -addTests('isNewIssue', [ +TEST: addTests('isNewIssue', [ 'https://github.com/sindresorhus/refined-github/issues/new', ]); export const isNewRelease = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'releases/new'; -addTests('isNewRelease', [ +TEST: addTests('isNewRelease', [ 'https://github.com/sindresorhus/refined-github/releases/new', ]); export const isNewWikiPage = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepoWiki(url) && getCleanPathname(url).endsWith('/_new'); -addTests('isNewWikiPage', [ +TEST: addTests('isNewWikiPage', [ 'https://github.com/tooomm/wikitest/wiki/_new', ]); export const isNotifications = (url: URL | HTMLAnchorElement | Location = location): boolean => getCleanPathname(url) === 'notifications'; -addTests('isNotifications', [ +TEST: addTests('isNotifications', [ 'https://github.com/notifications', ]); @@ -190,7 +190,7 @@ export const isOrganizationProfile = (): boolean => exists('meta[name="hovercard export const isOrganizationRepo = (): boolean => exists('.AppHeader-context-full [data-hovercard-type="organization"]'); export const isTeamDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getOrg(url)?.path.startsWith('teams')); -addTests('isTeamDiscussion', [ +TEST: addTests('isTeamDiscussion', [ 'https://github.com/orgs/refined-github/teams/core-team/discussions?pinned=1', 'https://github.com/orgs/refined-github/teams/core-team/discussions/1', 'https://github.com/orgs/refined-github/teams/core-team', @@ -202,48 +202,48 @@ export const isOwnUserProfile = (): boolean => getCleanPathname() === getUsernam export const isOwnOrganizationProfile = (): boolean => isOrganizationProfile() && !exists('[href*="contact/report-abuse?report="]'); export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path); -addTests('isProject', [ +TEST: addTests('isProject', [ 'https://github.com/sindresorhus/refined-github/projects/3', ]); export const isProjects = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'projects'; -addTests('isProjects', [ +TEST: addTests('isProjects', [ 'https://github.com/sindresorhus/refined-github/projects', ]); export const isDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^discussions\/\d+/.test(getRepo(url)?.path ?? getOrg(url)?.path); -addTests('isDiscussion', [ +TEST: addTests('isDiscussion', [ 'https://github.com/tophf/mpiv/discussions/50', 'https://github.com/orgs/community/discussions/11202', ]); export const isNewDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'discussions/new' || getOrg(url)?.path === 'discussions/new'; -addTests('isNewDiscussion', [ +TEST: addTests('isNewDiscussion', [ 'https://github.com/withastro/roadmap/discussions/new?category=proposal', 'https://github.com/orgs/community/discussions/new?category=pull-requests', ]); export const isDiscussionList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'discussions' || getOrg(url)?.path === 'discussions'; -addTests('isDiscussionList', [ +TEST: addTests('isDiscussionList', [ 'https://github.com/tophf/mpiv/discussions', 'https://github.com/orgs/community/discussions', ]); export const isPR = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+/.test(getRepo(url)?.path) && !isPRConflicts(url); -addTests('isPR', [ +TEST: addTests('isPR', [ 'isPRFiles', 'isPRCommitList', 'https://github.com/sindresorhus/refined-github/pull/148', ]); export const isPRConflicts = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/conflicts/.test(getRepo(url)?.path); -addTests('isPRConflicts', [ +TEST: addTests('isPRConflicts', [ 'https://github.com/sindresorhus/refined-github/pull/148/conflicts', ]); /** Any `isIssueOrPRList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown */ export const isPRList = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/pulls' || getRepo(url)?.path === 'pulls'; -addTests('isPRList', [ +TEST: addTests('isPRList', [ 'https://github.com/pulls', 'https://github.com/pulls?q=issues', 'https://github.com/sindresorhus/refined-github/pulls', @@ -253,7 +253,7 @@ addTests('isPRList', [ ]); export const isPRCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/commits\/[\da-f]{5,40}$/.test(getRepo(url)?.path); -addTests('isPRCommit', [ +TEST: addTests('isPRCommit', [ 'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85', 'https://github.com/sindresorhus/refined-github/pull/148/commits/00196', ]); @@ -262,17 +262,17 @@ export const isPRCommit404 = (): boolean => isPRCommit() && document.title.start export const isPRFile404 = (): boolean => isPRFiles() && document.title.startsWith('Commit range not found · Pull Request'); export const isPRConversation = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+$/.test(getRepo(url)?.path); -addTests('isPRConversation', [ +TEST: addTests('isPRConversation', [ 'https://github.com/sindresorhus/refined-github/pull/148', ]); export const isPRCommitList = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/commits$/.test(getRepo(url)?.path); -addTests('isPRCommitList', [ +TEST: addTests('isPRCommitList', [ 'https://github.com/sindresorhus/refined-github/pull/148/commits', ]); export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/files/.test(getRepo(url)?.path) || isPRCommit(url); -addTests('isPRFiles', [ +TEST: addTests('isPRFiles', [ 'isPRCommit', // File contents but lacks "Viewed" checkbox, has commit information 'https://github.com/sindresorhus/refined-github/pull/148/files', 'https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f', // This means "every commit until e1aba6f" @@ -280,7 +280,7 @@ addTests('isPRFiles', [ ]); export const isQuickPR = (url: URL | HTMLAnchorElement | Location = location): boolean => isCompare(url) && /[?&]quick_pull=1(&|$)/.test(url.search); -addTests('isQuickPR', [ +TEST: addTests('isQuickPR', [ 'https://github.com/sindresorhus/refined-github/compare/master...branch-name?quick_pull=1', 'https://github.com/sindresorhus/refined-github/compare/branch-1...branch-2?quick_pull=1', 'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1', @@ -293,66 +293,66 @@ export const isClosedPR = (): boolean => exists('#partial-discussion-header :is( export const isClosedIssue = (): boolean => exists('#partial-discussion-header :is(.octicon-issue-closed, .octicon-skip)'); export const isReleases = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'releases'; -addTests('isReleases', [ +TEST: addTests('isReleases', [ 'https://github.com/sindresorhus/refined-github/releases', 'https://github.com/sindresorhus/refined-github/releases?page=2', ]); export const isTags = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'tags'; -addTests('isTags', [ +TEST: addTests('isTags', [ 'https://github.com/sindresorhus/refined-github/tags', 'https://github.com/sindresorhus/refined-github/tags?after=21.8.1', ]); export const isSingleReleaseOrTag = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path!.startsWith('releases/tag')); -addTests('isSingleReleaseOrTag', [ +TEST: addTests('isSingleReleaseOrTag', [ 'https://github.com/refined-github/refined-github/releases/tag/1.20.1', // Tag 'https://github.com/refined-github/refined-github/releases/tag/23.7.25', // Release ]); export const isReleasesOrTags = (url: URL | HTMLAnchorElement | Location = location): boolean => isReleases(url) || isTags(url); -addTests('isReleasesOrTags', [ +TEST: addTests('isReleasesOrTags', [ 'isReleases', 'isTags', ]); export const isDeletingFile = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('delete')); -addTests('isDeletingFile', [ +TEST: addTests('isDeletingFile', [ 'https://github.com/sindresorhus/refined-github/delete/master/readme.md', 'https://github.com/sindresorhus/refined-github/delete/ghe-injection/source/background.ts', ]); export const isEditingFile = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('edit')); -addTests('isEditingFile', [ +TEST: addTests('isEditingFile', [ 'https://github.com/sindresorhus/refined-github/edit/master/readme.md', 'https://github.com/sindresorhus/refined-github/edit/ghe-injection/source/background.ts', ]); export const hasFileEditor = (url: URL | HTMLAnchorElement | Location = location): boolean => isEditingFile(url) || isNewFile(url) || isDeletingFile(url); -addTests('hasFileEditor', combinedTestOnly); +TEST: addTests('hasFileEditor', combinedTestOnly); export const isEditingRelease = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('releases/edit')); -addTests('isEditingRelease', [ +TEST: addTests('isEditingRelease', [ 'https://github.com/sindresorhus/refined-github/releases/edit/v1.2.3', ]); export const hasReleaseEditor = (url: URL | HTMLAnchorElement | Location = location): boolean => isEditingRelease(url) || isNewRelease(url); -addTests('hasReleaseEditor', combinedTestOnly); +TEST: addTests('hasReleaseEditor', combinedTestOnly); export const isEditingWikiPage = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepoWiki(url) && getCleanPathname(url).endsWith('/_edit'); -addTests('isEditingWikiPage', [ +TEST: addTests('isEditingWikiPage', [ 'https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit', ]); export const hasWikiPageEditor = (url: URL | HTMLAnchorElement | Location = location): boolean => isEditingWikiPage(url) || isNewWikiPage(url); -addTests('hasWikiPageEditor', combinedTestOnly); +TEST: addTests('hasWikiPageEditor', combinedTestOnly); export const isRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => /^[^/]+\/[^/]+/.test(getCleanPathname(url)) && !reservedNames.includes(url.pathname.split('/', 2)[1]!) && !isDashboard(url) && !isGist(url) && !isNewRepoTemplate(url); -addTests('isRepo', [ +TEST: addTests('isRepo', [ // Some of these are here simply as "gotchas" to other detections 'https://github.com/sindresorhus/refined-github/blame/master/package.json', 'https://github.com/sindresorhus/refined-github/issues/146', @@ -365,7 +365,7 @@ addTests('isRepo', [ ]); export const hasRepoHeader = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepo(url) && !isRepoSearch(url); -addTests('hasRepoHeader', combinedTestOnly); +TEST: addTests('hasRepoHeader', combinedTestOnly); // On empty repos, there's only isRepoHome; this element is found in `` export const isEmptyRepoRoot = (): boolean => isRepoHome() && !exists('link[rel="canonical"]'); @@ -379,7 +379,7 @@ export const isArchivedRepo = (): boolean => Boolean(isRepo() && $('main > .flas export const isBlank = (): boolean => exists('main .blankslate:not([hidden] .blankslate)'); export const isRepoTaxonomyIssueOrPRList = (url: URL | HTMLAnchorElement | Location = location): boolean => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepo(url)?.path); -addTests('isRepoTaxonomyIssueOrPRList', [ +TEST: addTests('isRepoTaxonomyIssueOrPRList', [ 'https://github.com/sindresorhus/refined-github/labels/bug', 'https://github.com/sindresorhus/refined-github/labels/implemented%20by%20github', 'https://github.com/sindresorhus/refined-github/labels/%3Adollar%3A%20Funded%20on%20Issuehunt', @@ -390,10 +390,10 @@ export const isRepoIssueOrPRList = (url: URL | HTMLAnchorElement | Location = lo isRepoPRList(url) || isRepoIssueList(url) || isRepoTaxonomyIssueOrPRList(url); -addTests('isRepoIssueOrPRList', combinedTestOnly); +TEST: addTests('isRepoIssueOrPRList', combinedTestOnly); export const isRepoPRList = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('pulls')); -addTests('isRepoPRList', [ +TEST: addTests('isRepoPRList', [ 'https://github.com/sindresorhus/refined-github/pulls', 'https://github.com/sindresorhus/refined-github/pulls/', 'https://github.com/sindresorhus/refined-github/pulls?q=is%3Aopen+is%3Apr', @@ -403,7 +403,7 @@ addTests('isRepoPRList', [ export const isRepoIssueList = (url: URL | HTMLAnchorElement | Location = location): boolean => // `issues/fregante` is a list but `issues/1`, `issues/new`, `issues/new/choose`, `issues/templates/edit` aren’t /^labels\/|^issues(?!\/(\d+|new|templates)($|\/))/.test(getRepo(url)?.path); -addTests('isRepoIssueList', [ +TEST: addTests('isRepoIssueList', [ 'http://github.com/sindresorhus/ava/issues', 'https://github.com/sindresorhus/refined-github/issues', 'https://github.com/sindresorhus/refined-github/issues/fregante', @@ -419,7 +419,7 @@ const hasSearchParameter = (url: URL | HTMLAnchorElement | Location): boolean => export const isRepoHome = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === '' && !hasSearchParameter(url); -addTests('isRepoHome', [ +TEST: addTests('isRepoHome', [ // Some tests are here only as "gotchas" for other tests that may misidentify their pages 'https://github.com/sindresorhus/refined-github', 'https://github.com/sindresorhus/refined-github/', @@ -455,7 +455,7 @@ const _isRepoRoot = (url?: URL | HTMLAnchorElement | Location): boolean => { // `_isRepoRoot` logic depends on whether a URL was passed, so don't use a `url` default parameter export const isRepoRoot = (url?: URL | HTMLAnchorElement | Location): boolean => !hasSearchParameter(url ?? location) && _isRepoRoot(url); -addTests('isRepoRoot', [ +TEST: addTests('isRepoRoot', [ 'isRepoHome', 'https://github.com/sindresorhus/refined-github/tree/native-copy-buttons', 'https://github.com/sindresorhus/refined-github/tree/native-copy-buttons/', @@ -466,37 +466,37 @@ addTests('isRepoRoot', [ ]); export const isRepoSearch = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'search'; -addTests('isRepoSearch', [ +TEST: addTests('isRepoSearch', [ 'https://github.com/sindresorhus/refined-github/search?q=diff', 'https://github.com/sindresorhus/refined-github/search?q=diff&unscoped_q=diff&type=Issues', 'https://github.com/sindresorhus/refined-github/search', ]); export const isRepoSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('settings')); -addTests('isRepoSettings', [ +TEST: addTests('isRepoSettings', [ 'https://github.com/sindresorhus/refined-github/settings', 'https://github.com/sindresorhus/refined-github/settings/branches', ]); export const isRepoMainSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'settings'; -addTests('isRepoMainSettings', [ +TEST: addTests('isRepoMainSettings', [ 'https://github.com/sindresorhus/refined-github/settings', ]); export const isRepliesSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname.startsWith('/settings/replies'); -addTests('isRepliesSettings', [ +TEST: addTests('isRepliesSettings', [ 'https://github.com/settings/replies', 'https://github.com/settings/replies/88491/edit', ]); export const isUserSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname.startsWith('/settings/'); -addTests('isUserSettings', [ +TEST: addTests('isUserSettings', [ 'https://github.com/settings/profile', 'isRepliesSettings', ]); export const isRepoTree = (url: URL | HTMLAnchorElement | Location = location): boolean => _isRepoRoot(url) || Boolean(getRepo(url)?.path.startsWith('tree/')); -addTests('isRepoTree', [ +TEST: addTests('isRepoTree', [ 'isRepoRoot', 'https://github.com/sindresorhus/refined-github/tree/main/source', 'https://github.com/sindresorhus/refined-github/tree/0.13.0/extension', @@ -505,7 +505,7 @@ addTests('isRepoTree', [ ]); export const isRepoWiki = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('wiki')); -addTests('isRepoWiki', [ +TEST: addTests('isRepoWiki', [ 'https://github.com/lukesampson/scoop/wiki', 'https://github.com/tooomm/wikitest/wiki/_new', 'https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit', @@ -514,20 +514,20 @@ addTests('isRepoWiki', [ ]); export const isSingleCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^commit\/[\da-f]{5,40}$/.test(getRepo(url)?.path); -addTests('isSingleCommit', [ +TEST: addTests('isSingleCommit', [ 'https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f', 'https://github.com/sindresorhus/refined-github/commit/5b614', ]); export const isSingleFile = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('blob/')); -addTests('isSingleFile', [ +TEST: addTests('isSingleFile', [ 'https://github.com/sindresorhus/refined-github/blob/master/.gitattributes', 'https://github.com/sindresorhus/refined-github/blob/fix-narrow-diff/distribution/content.css', 'https://github.com/sindresorhus/refined-github/blob/master/edit.txt', ]); export const isFileFinder = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('find/')); -addTests('isFileFinder', [ +TEST: addTests('isFileFinder', [ 'https://github.com/sindresorhus/refined-github/find/master', ]); @@ -538,38 +538,38 @@ addTests('isFileFinder', [ export const isRepoFile404 = (url: URL | HTMLAnchorElement | Location = location): boolean => (isSingleFile(url) || isRepoTree(url)) && document.title.startsWith('File not found'); export const isRepoForksList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'network/members'; -addTests('isRepoForksList', [ +TEST: addTests('isRepoForksList', [ 'https://github.com/sindresorhus/refined-github/network/members', ]); export const isRepoNetworkGraph = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'network'; -addTests('isRepoNetworkGraph', [ +TEST: addTests('isRepoNetworkGraph', [ 'https://github.com/sindresorhus/refined-github/network', ]); export const isForkedRepo = (): boolean => exists('meta[name="octolytics-dimension-repository_is_fork"][content="true"]'); export const isSingleGist = (url: URL | HTMLAnchorElement | Location = location): boolean => /^[^/]+\/[\da-f]{20,32}(\/[\da-f]{40})?$/.test(getCleanGistPathname(url)); -addTests('isSingleGist', [ +TEST: addTests('isSingleGist', [ 'https://gist.github.com/fregante/2205329b71218fa2c1d3', 'https://gist.github.com/fregante/2205329b71218fa2c1d3/d1ebf7d9cfaba4d4596d2ea9174e202479a5f9ad', 'https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064', ]); export const isGistRevision = (url: URL | HTMLAnchorElement | Location = location): boolean => /^[^/]+\/[\da-f]{20,32}\/revisions$/.test(getCleanGistPathname(url)); -addTests('isGistRevision', [ +TEST: addTests('isGistRevision', [ 'https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions', ]); export const isTrending = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/trending' || url.pathname.startsWith('/trending/'); -addTests('isTrending', [ +TEST: addTests('isTrending', [ 'https://github.com/trending', 'https://github.com/trending/developers', 'https://github.com/trending/unknown', ]); export const isBranches = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('branches')); -addTests('isBranches', [ +TEST: addTests('isBranches', [ 'https://github.com/sindresorhus/refined-github/branches', ]); @@ -585,7 +585,7 @@ export const isProfile = (url: URL | HTMLAnchorElement | Location = location): b !isGist(url) && doesLookLikeAProfile(getCleanPathname(url)); -addTests('isProfile', [ +TEST: addTests('isProfile', [ 'https://github.com/fregante', 'https://github.com/github', 'https://github.com/babel', @@ -602,7 +602,7 @@ addTests('isProfile', [ export const isGistProfile = (url: URL | HTMLAnchorElement | Location = location): boolean => doesLookLikeAProfile(getCleanGistPathname(url)); -addTests('isGistProfile', [ +TEST: addTests('isGistProfile', [ 'https://gist.github.com/fregante', 'https://gist.github.com/github', 'https://gist.github.com/babel', @@ -622,7 +622,7 @@ export const isUserProfileMainTab = (): boolean => export const isUserProfileRepoTab = (url: URL | HTMLAnchorElement | Location = location): boolean => isProfile(url) && new URLSearchParams(url.search).get('tab') === 'repositories'; -addTests('isUserProfileRepoTab', [ +TEST: addTests('isUserProfileRepoTab', [ 'https://github.com/fregante?tab=repositories', 'https://github.com/fregante?tab=repositories&type=source', 'https://github.com/fregante?tab=repositories&q=&type=source&language=css&sort=', @@ -631,7 +631,7 @@ addTests('isUserProfileRepoTab', [ export const isUserProfileStarsTab = (url: URL | HTMLAnchorElement | Location = location): boolean => isProfile(url) && new URLSearchParams(url.search).get('tab') === 'stars'; -addTests('isUserProfileStarsTab', [ +TEST: addTests('isUserProfileStarsTab', [ 'https://github.com/fregante?tab=stars', 'https://github.com/fregante?direction=desc&sort=updated&tab=stars', ]); @@ -639,7 +639,7 @@ addTests('isUserProfileStarsTab', [ export const isUserProfileFollowersTab = (url: URL | HTMLAnchorElement | Location = location): boolean => isProfile(url) && new URLSearchParams(url.search).get('tab') === 'followers'; -addTests('isUserProfileFollowersTab', [ +TEST: addTests('isUserProfileFollowersTab', [ 'https://github.com/fregante?tab=followers', 'https://github.com/sindresorhus?tab=followers', ]); @@ -647,14 +647,14 @@ addTests('isUserProfileFollowersTab', [ export const isUserProfileFollowingTab = (url: URL | HTMLAnchorElement | Location = location): boolean => isProfile(url) && new URLSearchParams(url.search).get('tab') === 'following'; -addTests('isUserProfileFollowingTab', [ +TEST: addTests('isUserProfileFollowingTab', [ 'https://github.com/fregante?tab=following', 'https://github.com/sindresorhus?tab=following', ]); export const isProfileRepoList = (url: URL | HTMLAnchorElement | Location = location): boolean => isUserProfileRepoTab(url) || getOrg(url)?.path === 'repositories'; -addTests('isProfileRepoList', [ +TEST: addTests('isProfileRepoList', [ 'https://github.com/fregante?tab=repositories', 'https://github.com/fregante?tab=repositories&type=source', 'https://github.com/fregante?tab=repositories&q=&type=source&language=css&sort=', @@ -662,7 +662,7 @@ addTests('isProfileRepoList', [ 'https://github.com/orgs/refined-github/repositories?q=&type=private&language=&sort=', ]); -addTests('hasComments', combinedTestOnly); +TEST: addTests('hasComments', combinedTestOnly); export const hasComments = (url: URL | HTMLAnchorElement | Location = location): boolean => isPR(url) || isIssue(url) @@ -670,7 +670,7 @@ export const hasComments = (url: URL | HTMLAnchorElement | Location = location): || isTeamDiscussion(url) || isSingleGist(url); -addTests('hasRichTextEditor', combinedTestOnly); +TEST: addTests('hasRichTextEditor', combinedTestOnly); export const hasRichTextEditor = (url: URL | HTMLAnchorElement | Location = location): boolean => hasComments(url) || isNewIssue(url) @@ -680,7 +680,7 @@ export const hasRichTextEditor = (url: URL | HTMLAnchorElement | Location = loca || isDiscussion(url) || isNewDiscussion(url); -addTests('hasCode', combinedTestOnly); +TEST: addTests('hasCode', combinedTestOnly); /** Static code, not the code editor */ export const hasCode = (url: URL | HTMLAnchorElement | Location = location): boolean => hasComments(url) @@ -693,7 +693,7 @@ export const hasCode = (url: URL | HTMLAnchorElement | Location = location): boo || isCompareWikiPage(url) || isBlame(url); -addTests('hasFiles', combinedTestOnly); +TEST: addTests('hasFiles', combinedTestOnly); /** Has a list of files */ export const hasFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => isCommit(url) @@ -701,32 +701,32 @@ export const hasFiles = (url: URL | HTMLAnchorElement | Location = location): bo || isPRFiles(url); export const isMarketplaceAction = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname.startsWith('/marketplace/actions/'); -addTests('isMarketplaceAction', [ +TEST: addTests('isMarketplaceAction', [ 'https://github.com/marketplace/actions/urlchecker-action', 'https://github.com/marketplace/actions/github-action-for-assignee-to-reviewer', 'https://github.com/marketplace/actions/hugo-actions', ]); export const isActionJobRun = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('runs/')); -addTests('isActionJobRun', [ +TEST: addTests('isActionJobRun', [ 'https://github.com/sindresorhus/refined-github/runs/639481849', 'https://github.com/refined-github/github-url-detection/runs/1224552520?check_suite_focus=true', ]); export const isActionRun = (url: URL | HTMLAnchorElement | Location = location): boolean => /^(actions\/)?runs/.test(getRepo(url)?.path); -addTests('isActionRun', [ +TEST: addTests('isActionRun', [ 'https://github.com/sindresorhus/refined-github/runs/639481849', 'https://github.com/refined-github/github-url-detection/runs/1224552520?check_suite_focus=true', 'https://github.com/refined-github/github-url-detection/actions/runs/294962314', ]); export const isNewAction = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'actions/new'; -addTests('isNewAction', [ +TEST: addTests('isNewAction', [ 'https://github.com/sindresorhus/refined-github/actions/new', ]); export const isRepositoryActions = (url: URL | HTMLAnchorElement | Location = location): boolean => /^actions(\/workflows\/.+\.ya?ml)?$/.test(getRepo(url)?.path); -addTests('isRepositoryActions', [ +TEST: addTests('isRepositoryActions', [ 'https://github.com/refined-github/github-url-detection/actions', 'https://github.com/refined-github/github-url-detection/actions/workflows/demo.yml', 'https://github.com/refined-github/github-url-detection/actions/workflows/esm-lint.yml', @@ -737,14 +737,14 @@ export const isUserTheOrganizationOwner = (): boolean => isOrganizationProfile() export const canUserEditRepo = (): boolean => isRepo() && exists('.reponav-item[href$="/settings"], [data-tab-item$="settings-tab"]'); export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url)); -addTests('isNewRepo', [ +TEST: addTests('isNewRepo', [ 'https://github.com/new', 'https://github.com/organizations/npmhub/repositories/new', ]); // This can't use `getRepo().path` to avoid infinite recursion: export const isNewRepoTemplate = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(url.pathname.split('/')[3] === 'generate'); -addTests('isNewRepoTemplate', [ +TEST: addTests('isNewRepoTemplate', [ 'https://github.com/fregante/browser-extension-template/generate', ]); diff --git a/package-lock.json b/package-lock.json index 04e9c8c..5850e61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "devDependencies": { "@sindresorhus/tsconfig": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^3.1.1", + "esbuild": "^0.21.5", "npm-run-all": "^4.1.5", "strip-indent": "^4.0.0", "svelte": "^4.2.17", @@ -81,13 +82,14 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -97,13 +99,14 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -113,13 +116,14 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -129,13 +133,14 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -145,13 +150,14 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -161,13 +167,14 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -177,13 +184,14 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -193,13 +201,14 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -209,13 +218,14 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -225,13 +235,14 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -241,13 +252,14 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -257,13 +269,14 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -273,13 +286,14 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -289,13 +303,14 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -305,13 +320,14 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -321,13 +337,14 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -337,13 +354,14 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -353,13 +371,14 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -369,13 +388,14 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -385,13 +405,14 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -401,13 +422,14 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -417,13 +439,14 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -433,13 +456,14 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2675,11 +2699,12 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -2687,29 +2712,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/escalade": { @@ -7666,6 +7691,436 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, "node_modules/vitefu": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", diff --git a/package.json b/package.json index f80c84a..1f29c94 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,9 @@ ], "rules": { "@typescript-eslint/triple-slash-reference": "off", - "@typescript-eslint/naming-convention": "off" + "@typescript-eslint/naming-convention": "off", + "no-unused-labels": "off", + "no-labels": "off" } } ] @@ -60,6 +62,7 @@ "devDependencies": { "@sindresorhus/tsconfig": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^3.1.1", + "esbuild": "^0.21.5", "npm-run-all": "^4.1.5", "strip-indent": "^4.0.0", "svelte": "^4.2.17", diff --git a/vite.config.ts b/vite.config.ts index 8c0e2b3..58d0830 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,8 +1,6 @@ import process from 'node:process'; import {defineConfig} from 'vite'; -process.env.VITE_KEEP_URLS ??= '0'; - export default defineConfig({ build: { lib: { From 34b4879c79e5ebfb68253406081416ceeddd56d1 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 12:54:22 +0800 Subject: [PATCH 3/9] Update build --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 1515b6b..8ab68eb 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,7 @@ ], "scripts": { "build": "run-p build:*", - "build:vite": "vite build", - "build:typescript": "tsc --declaration --emitDeclarationOnly", + "build:esbuild": "esbuild index.ts --bundle --platform=node --outdir=distribution --format=esm --external:github-reserved-names --watch --drop-labels=DEV", "build:typescript": "tsc --declaration --emitDeclarationOnly", "build:demo": "vite build demo", "prepack": "npm run build", "test": "run-p build test:* xo", From afdcc0c133fcde488039002c3b10fea6c26471e8 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 13:06:03 +0800 Subject: [PATCH 4/9] Fix scripts --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ab68eb..7c0c6c4 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ ], "scripts": { "build": "run-p build:*", - "build:esbuild": "esbuild index.ts --bundle --platform=node --outdir=distribution --format=esm --external:github-reserved-names --watch --drop-labels=DEV", "build:typescript": "tsc --declaration --emitDeclarationOnly", + "build:esbuild": "esbuild index.ts --bundle --platform=node --outdir=distribution --format=esm --external:github-reserved-names --drop-labels=TEST", + "build:typescript": "tsc --declaration --emitDeclarationOnly", "build:demo": "vite build demo", "prepack": "npm run build", "test": "run-p build test:* xo", From cf506845cb5b68774048323ab5bc1320c685bb7f Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 13:08:06 +0800 Subject: [PATCH 5/9] Rollup --- .github/workflows/esm-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/esm-lint.yml b/.github/workflows/esm-lint.yml index 5c40273..d499345 100644 --- a/.github/workflows/esm-lint.yml +++ b/.github/workflows/esm-lint.yml @@ -58,7 +58,7 @@ jobs: needs: Pack steps: - uses: actions/download-artifact@v4 - - run: npm install --omit=dev ./artifact rollup@2 @rollup/plugin-node-resolve + - run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-node-resolve - run: echo "$IMPORT_STATEMENT" > index.js - run: npx rollup -p node-resolve index.js Vite: From af4f62a7042695901293329bdbfa278e36494163 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 13:10:04 +0800 Subject: [PATCH 6/9] Bye Vite --- demo/vite.config.ts | 4 ---- vite.config.ts | 21 --------------------- 2 files changed, 25 deletions(-) delete mode 100644 vite.config.ts diff --git a/demo/vite.config.ts b/demo/vite.config.ts index a771c26..f5192f4 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -16,8 +16,4 @@ export default defineConfig({ }, }, }, - define: { - // eslint-disable-next-line @typescript-eslint/naming-convention -- no. - 'import.meta.vitest': '"no vitest here, but I need the URLs"', - }, }); diff --git a/vite.config.ts b/vite.config.ts deleted file mode 100644 index 22d15c2..0000000 --- a/vite.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import process from 'node:process'; -import {defineConfig} from 'vite'; - -export default defineConfig({ - build: { - lib: { - formats: ['es'], - entry: 'index.ts', - fileName: 'index', - }, - target: 'node20.10', // https://github.com/evanw/esbuild/issues/3778 - outDir: 'distribution', - minify: false, - rollupOptions: { - external: ['github-reserved-names/reserved-names.json'], - }, - }, - define: { - 'import.meta.vitest': 'undefined', - }, -}); From 08712493b65c8cf2bcf15b5f8bee93465c3c3031 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 13:11:03 +0800 Subject: [PATCH 7/9] Typescript --- .github/workflows/esm-lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/esm-lint.yml b/.github/workflows/esm-lint.yml index d499345..a7735ee 100644 --- a/.github/workflows/esm-lint.yml +++ b/.github/workflows/esm-lint.yml @@ -1,5 +1,5 @@ env: - IMPORT_STATEMENT: import * as pageDetect from "github-url-detection" + IMPORT_STATEMENT: export * as pageDetect from "github-url-detection" # FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint # SOURCE: https://github.com/fregante/ghatemplates @@ -84,6 +84,7 @@ jobs: needs: Pack steps: - uses: actions/download-artifact@v4 + - run: echo '{"type":"module"}' > package.json - run: npm install --omit=dev ./artifact @sindresorhus/tsconfig - run: echo "$IMPORT_STATEMENT" > index.ts - run: > From d6437b0f783396419ce5dc22df75176d1c58f1f3 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 13:20:53 +0800 Subject: [PATCH 8/9] Clean build script --- .github/workflows/esm-lint.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/esm-lint.yml b/.github/workflows/esm-lint.yml index a7735ee..72deb73 100644 --- a/.github/workflows/esm-lint.yml +++ b/.github/workflows/esm-lint.yml @@ -58,7 +58,7 @@ jobs: needs: Pack steps: - uses: actions/download-artifact@v4 - - run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-node-resolve + - run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-json @rollup/plugin-node-resolve - run: echo "$IMPORT_STATEMENT" > index.js - run: npx rollup -p node-resolve index.js Vite: diff --git a/package.json b/package.json index 7c0c6c4..5d82e0e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ ], "scripts": { "build": "run-p build:*", - "build:esbuild": "esbuild index.ts --bundle --platform=node --outdir=distribution --format=esm --external:github-reserved-names --drop-labels=TEST", + "build:esbuild": "esbuild index.ts --bundle --external:github-reserved-names --outdir=distribution --format=esm --drop-labels=TEST", "build:typescript": "tsc --declaration --emitDeclarationOnly", "build:demo": "vite build demo", "prepack": "npm run build", From e365f2fedd969d01a6562faae612cd7e97dc56a3 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 28 Jun 2024 13:24:11 +0800 Subject: [PATCH 9/9] /2 --- .github/workflows/esm-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/esm-lint.yml b/.github/workflows/esm-lint.yml index 72deb73..f104f12 100644 --- a/.github/workflows/esm-lint.yml +++ b/.github/workflows/esm-lint.yml @@ -60,7 +60,7 @@ jobs: - uses: actions/download-artifact@v4 - run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-json @rollup/plugin-node-resolve - run: echo "$IMPORT_STATEMENT" > index.js - - run: npx rollup -p node-resolve index.js + - run: npx rollup -p node-resolve -p @rollup/plugin-json index.js Vite: runs-on: ubuntu-latest needs: Pack