Skip to content

Commit e58ce98

Browse files
authored
Convert package to pure ESM + cleanup (#74)
1 parent cb1521a commit e58ce98

11 files changed

+2908
-2104
lines changed

.github/workflows/demo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
if: github.ref == 'refs/heads/master'
1717
with:
1818
github_token: ${{ secrets.GITHUB_TOKEN }}
19-
publish_dir: ./dist
19+
publish_dir: ./demo/dist

.github/workflows/npm-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
env:
3434
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3535
- run: git push --follow-tags
36-
- uses: notlmn/release-with-changelog@v3
36+
- uses: fregante/release-with-changelog@v3
3737
with:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939
exclude: true

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Thumbs.db
88
*.log
99
logs
1010
*.map
11-
cjs
12-
esm/*
13-
!esm/package.json
11+
distribution
1412
dist
1513
.cache

esm/package.json

-3
This file was deleted.

index.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ collect.set('isNotifications', [
156156

157157
export const isOrganizationProfile = (): boolean => exists('meta[name="hovercard-subject-tag"][content^="organization"]');
158158

159-
export const isOrganizationRepo = (): boolean => Boolean(document.querySelector<HTMLElement>('[data-owner-scoped-search-url]')?.dataset.ownerScopedSearchUrl!.startsWith('/org'));
159+
export const isOrganizationRepo = (): boolean => Boolean(document.querySelector<HTMLElement>('[data-owner-scoped-search-url]')?.dataset['ownerScopedSearchUrl']!.startsWith('/org'));
160160

161161
export const isOrganizationDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^orgs\/[^/]+\/teams\/[^/]+($|\/discussions)/.test(getCleanPathname(url));
162162
collect.set('isOrganizationDiscussion', [
@@ -388,19 +388,18 @@ collect.set('isRepoMainSettings', [
388388
'https://github.com/sindresorhus/refined-github/settings',
389389
]);
390390

391-
export const isUserSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname.startsWith('/settings/');
392-
collect.set('isUserSettings', [
393-
'https://github.com/settings/profile',
394-
'https://github.com/settings/replies',
395-
'https://github.com/settings/replies/88491/edit',
396-
]);
397-
398391
export const isRepliesSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname.startsWith('/settings/replies');
399392
collect.set('isRepliesSettings', [
400393
'https://github.com/settings/replies',
401394
'https://github.com/settings/replies/88491/edit',
402395
]);
403396

397+
export const isUserSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname.startsWith('/settings/');
398+
collect.set('isUserSettings', [
399+
'https://github.com/settings/profile',
400+
...collect.get('isRepliesSettings') as string[],
401+
]);
402+
404403
export const isRepoTree = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepoRoot(url) || Boolean(getRepo(url)?.path.startsWith('tree/'));
405404
collect.set('isRepoTree', [
406405
...collect.get('isRepoRoot') as string[],

0 commit comments

Comments
 (0)