File tree Expand file tree Collapse file tree 13 files changed +34
-1376
lines changed Expand file tree Collapse file tree 13 files changed +34
-1376
lines changed Original file line number Diff line number Diff line change 25
25
- uses : actions/checkout@v2
26
26
- run : npm install
27
27
- run : npm run ava
28
+
29
+ Demo :
30
+ runs-on : ubuntu-latest
31
+ steps :
32
+ - uses : actions/checkout@v2
33
+ - run : npm install
34
+ - run : npm run demo:build
35
+ - run : npm run demo:test
Original file line number Diff line number Diff line change 11
11
with :
12
12
persist-credentials : false
13
13
- run : npm install
14
- - run : npm run build
15
- - run : cd demo && npm install
16
- - run : cd demo && npm run build
17
- - run : ls -RF
14
+ - run : npm run demo:build
18
15
- uses : peaceiris/actions-gh-pages@v3
19
16
with :
20
17
github_token : ${{ secrets.GITHUB_TOKEN }}
21
- publish_dir : ./demo/public
18
+ publish_dir : ./dist
Original file line number Diff line number Diff line change 11
11
cjs
12
12
esm /*
13
13
! esm /package.json
14
+ dist
15
+ .cache
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- <script lang = " ts " >
1
+ <script >
2
2
const defaultUrl = ' https://github.com/fregante/github-url-detection' ;
3
3
export let url = ' ' ;
4
- import * as urlDetection from ' ../../esm' ;
4
+ import * as urlDetection from ' ../index' ;
5
+ import collector from ' ../collector' ;
5
6
6
- let isUrlValid: boolean ;
7
+ const allUrls = new Set ([... collector .values ()].flat ().sort ());
8
+ allUrls .delete (' combinedTestOnly' );
9
+
10
+ let isUrlValid;
7
11
$: {
8
12
try {
9
13
new URL (url || defaultUrl);
12
16
isUrlValid = false ;
13
17
}
14
18
}
15
- interface Detection {
16
- name: string ;
17
- detect? : (url : URL ) => boolean ;
18
- result? : boolean ;
19
- }
20
19
21
- let detections: Array < Detection | undefined > = [];
20
+ let detections = [];
22
21
$: {
23
22
if (isUrlValid) {
24
23
detections = Object .entries (urlDetection)
27
26
return ;
28
27
}
29
28
30
- if (! String ( detect ). startsWith ( ' () ' ) ) {
29
+ if (detect . length > 0 ) {
31
30
return {
32
31
name,
33
32
detect,
85
84
</label >
86
85
87
86
<datalist id =" url-examples" >
88
- <option value =" https://github.big-corp.com/gist/" />
89
- <option value =" https://github.com/marketplace/actions/urlchecker-action" />
90
- <option value =" https://github.com/sindresorhus/refined-github/pull/148" />
91
- <option value =" https://github.com/sindresorhus/refined-github/edit/master/readme.md" />
92
- <option value =" https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f" />
87
+ {#each [... allUrls ] as url }
88
+ <option value ={url } />
89
+ {/each }
93
90
</datalist >
94
91
95
92
{#if isUrlValid }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ label {
31
31
}
32
32
33
33
label span {
34
- margin-right : .5em ;
34
+ margin-right : 0 .5em ;
35
35
font-size : 1.7em ;
36
36
font-weight : bold;
37
37
}
Original file line number Diff line number Diff line change 11
11
< title > `github-url-detection` npm module testing ground</ title >
12
12
13
13
< link rel ="stylesheet " href ="global.css " />
14
- < link rel ="stylesheet " href ="build/bundle.css " />
15
-
16
- < script defer src ="build/bundle.js "> </ script >
14
+ < script defer src ="main.js "> </ script >
17
15
</ head >
18
16
19
17
< body >
File renamed without changes.
You can’t perform that action at this time.
0 commit comments