File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 5555 "dependencies" : {
5656 "bson" : " ^6.10.4" ,
5757 "debug" : " ^4.3.4" ,
58+ "electron" : " ^37.6.1" ,
5859 "react" : " ^17.0.2"
5960 },
6061 "devDependencies" : {
7071 "@types/react-dom" : " ^17.0.10" ,
7172 "@types/sinon-chai" : " ^3.2.5" ,
7273 "chai" : " ^4.3.6" ,
73- "electron" : " ^37.6.1" ,
7474 "depcheck" : " ^1.4.1" ,
7575 "gen-esm-wrapper" : " ^1.1.0" ,
7676 "mocha" : " ^10.2.0" ,
Original file line number Diff line number Diff line change 1- // Type-only import in a separate entry point, so this is fine
2- // compass-peer-deps-ignore
3- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
1+ // NB: We add `electron` as a production dependency because
2+ // of this type import. That's fine because we expect this
3+ // package to only be used in Compass, where we know elecron
4+ // is a dependency anyway.
45import type { MenuItemConstructorOptions } from 'electron' ;
56
67export type { MenuItemConstructorOptions } ;
Original file line number Diff line number Diff line change @@ -77,27 +77,19 @@ async function collectAllAbsoluteImports(entryPoints = []) {
7777 ] ,
7878 ] ,
7979 } ) ;
80- const shouldSkip = ( path ) =>
81- path . node . leadingComments ?. some ( ( comment ) =>
82- comment . value ?. includes ( 'compass-peer-deps-ignore' )
83- ) ;
8480 traverse ( program , {
8581 ImportDeclaration ( path ) {
86- if ( shouldSkip ( path ) ) return ;
8782 queueImport ( path . node . source . value ) ;
8883 } ,
8984 ExportNamedDeclaration ( path ) {
90- if ( shouldSkip ( path ) ) return ;
9185 if ( path . node . source ) {
9286 queueImport ( path . node . source . value ) ;
9387 }
9488 } ,
9589 ExportAllDeclaration ( path ) {
96- if ( shouldSkip ( path ) ) return ;
9790 queueImport ( path . node . source . value ) ;
9891 } ,
9992 CallExpression ( path ) {
100- if ( shouldSkip ( path ) ) return ;
10193 if (
10294 path . node . callee . type === 'Identifier' &&
10395 ( path . node . callee . name === 'require' ||
You can’t perform that action at this time.
0 commit comments