File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
apps/svelte.dev/scripts/sync-packages Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ let logsAtTheEnd: {
18
18
| 'new_json_file'
19
19
| 'deleted_unused_json_file'
20
20
| 'outdated'
21
- | 'deprecated' ;
21
+ | 'deprecated'
22
+ | 'npm_error' ;
22
23
pkg : string ;
23
24
extra : string ;
24
25
} [ ] = [ ] ;
@@ -58,7 +59,8 @@ if (jsonNotNeeded.length > 0) {
58
59
logsAtTheEnd . push ( { type : 'deleted_unused_json_file' , pkg, extra : `deleted -> ${ jsonPath } ` } ) ;
59
60
}
60
61
61
- theEnd ( 1 ) ;
62
+ // Let's continue
63
+ // theEnd(1);
62
64
}
63
65
64
66
// PART 3: refresh data
@@ -94,7 +96,8 @@ function theEnd(val: number) {
94
96
new_json_file : 'NEW JSON' ,
95
97
deleted_unused_json_file : 'DEL JSON' ,
96
98
outdated : 'Outdated' ,
97
- deprecated : 'Deprecated'
99
+ deprecated : 'Deprecated' ,
100
+ npm_error : 'NPM Error'
98
101
} ;
99
102
console . log (
100
103
` - ${ logsAtTheEnd . map ( ( l ) => `${ typePrints [ l . type ] . padEnd ( 15 ) } | ${ l . pkg . padEnd ( 35 ) } | ${ l . extra } ` ) . join ( '\n - ' ) } `
@@ -108,6 +111,12 @@ async function getNpmAndGitHubData(pkg: string): Promise<PackageKey & PackageNpm
108
111
fetchJson ( `https://registry.npmjs.org/${ pkg } ` ) ,
109
112
fetchJson ( `https://api.npmjs.org/downloads/point/last-week/${ pkg } ` )
110
113
] ) ;
114
+
115
+ if ( npmInfo . error ) {
116
+ logsAtTheEnd . push ( { type : 'npm_error' , pkg, extra : npmInfo . error } ) ;
117
+ theEnd ( 1 ) ;
118
+ }
119
+
111
120
// delete npmInfo.readme;
112
121
// delete npmInfo.versions;
113
122
// console.log(`npmInfo`, npmInfo);
You can’t perform that action at this time.
0 commit comments