File tree Expand file tree Collapse file tree 6 files changed +18
-20
lines changed
Expand file tree Collapse file tree 6 files changed +18
-20
lines changed Original file line number Diff line number Diff line change 33
44import { pathToFileURL } from 'node:url'
55
6+ import { render } from 'ink'
7+ import React from 'react'
8+
69/**
710 * Run the Ink AnalyticsApp with data from stdin.
811 */
@@ -15,9 +18,7 @@ async function main() {
1518 const input = Buffer . concat ( chunks ) . toString ( 'utf8' )
1619 const data = JSON . parse ( input )
1720
18- // Dynamically import ESM modules.
19- const React = await import ( 'react' )
20- const { render } = await import ( 'ink' )
21+ // Dynamic import is needed here because AnalyticsApp.tsx gets compiled to .js at build time.
2122 const { AnalyticsApp } = await import (
2223 pathToFileURL ( new URL ( './AnalyticsApp.js' , import . meta. url ) . pathname ) . href
2324 )
Original file line number Diff line number Diff line change 33
44import { pathToFileURL } from 'node:url'
55
6+ import { render } from 'ink'
7+ import React from 'react'
8+
69/**
710 * Run the Ink AuditLogApp with data from stdin.
811 */
@@ -15,9 +18,7 @@ async function main() {
1518 const input = Buffer . concat ( chunks ) . toString ( 'utf8' )
1619 const data = JSON . parse ( input )
1720
18- // Dynamically import ESM modules.
19- const React = await import ( 'react' )
20- const { render } = await import ( 'ink' )
21+ // Dynamic import is needed here because AuditLogApp.tsx gets compiled to .js at build time.
2122 const { AuditLogApp } = await import (
2223 pathToFileURL ( new URL ( './AuditLogApp.js' , import . meta. url ) . pathname ) . href
2324 )
Original file line number Diff line number Diff line change 33
44import { pathToFileURL } from 'node:url'
55
6+ import { render } from 'ink'
7+ import React from 'react'
8+
69/**
710 * Run the Ink ThreatFeedApp with data from stdin.
811 */
@@ -15,9 +18,7 @@ async function main() {
1518 const input = Buffer . concat ( chunks ) . toString ( 'utf8' )
1619 const data = JSON . parse ( input )
1720
18- // Dynamically import ESM modules.
19- const React = await import ( 'react' )
20- const { render } = await import ( 'ink' )
21+ // Dynamic import is needed here because ThreatFeedApp.tsx gets compiled to .js at build time.
2122 const { ThreatFeedApp } = await import (
2223 pathToFileURL ( new URL ( './ThreatFeedApp.js' , import . meta. url ) . pathname ) . href
2324 )
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import {
3434} from '../config.mts'
3535import { isDebug } from '../debug.mts'
3636import { tildify } from '../fs/home-path.mts'
37+ import { showCategoryHelp , showInteractiveHelp } from './interactive-help.mts'
3738import { getFlagListOutput , getHelpListOutput } from '../output/formatting.mts'
3839import { spawnSocketPython } from '../python/standalone.mts'
3940import { getVisibleTokenPrefix } from '../socket/sdk.mjs'
@@ -881,14 +882,12 @@ export async function meowWithSubcommands(
881882 process . env [ 'CI' ] !== 'true'
882883
883884 if ( shouldShowInteractive ) {
884- // Show interactive help for root --help command
885- const { showInteractiveHelp } = await import ( './interactive-help.mts' )
885+ // Show interactive help for root --help command.
886886 await showInteractiveHelp ( )
887887 // eslint-disable-next-line n/no-process-exit
888888 process . exit ( 0 )
889889 } else if ( helpCategory ) {
890- // Show specific category help
891- const { showCategoryHelp } = await import ( './interactive-help.mts' )
890+ // Show specific category help.
892891 const found = showCategoryHelp ( helpCategory )
893892 if ( ! found ) {
894893 logger . error ( `Unknown help category: ${ helpCategory } ` )
Original file line number Diff line number Diff line change 11import { spawnSync } from '@socketsecurity/lib/spawn'
22
3+ import { GitHubProvider } from './github-provider.mts'
4+ import { GitLabProvider } from './gitlab-provider.mts'
35import type { PrProvider } from './provider.mts'
46
57/**
@@ -17,15 +19,10 @@ export function createPrProvider(): PrProvider {
1719 process . env [ 'GITLAB_HOST' ] ||
1820 remoteUrl . includes ( 'gitlab' )
1921 ) {
20- // Lazy load to avoid importing GitLab dependency if not needed.
21-
22- const { GitLabProvider } = require ( './gitlab-provider.mts' )
2322 return new GitLabProvider ( )
2423 }
2524
2625 // Default to GitHub (backward compatibility).
27-
28- const { GitHubProvider } = require ( './github-provider.mts' )
2926 return new GitHubProvider ( )
3027}
3128
Original file line number Diff line number Diff line change 77 * This runs asynchronously and never blocks the main CLI execution.
88 */
99
10- import { existsSync } from 'node:fs'
10+ import { existsSync , promises as fs } from 'node:fs'
1111import path from 'node:path'
1212
1313import { spawn } from '@socketsecurity/lib/spawn'
@@ -41,7 +41,6 @@ async function markPackageCached(packageName: string): Promise<void> {
4141 const cacheMarker = path . join ( cacheDir , packageName . replace ( / [ / @ ] / g, '-' ) )
4242
4343 try {
44- const { promises : fs } = await import ( 'node:fs' )
4544 await fs . mkdir ( cacheDir , { recursive : true } )
4645 await fs . writeFile ( cacheMarker , new Date ( ) . toISOString ( ) )
4746 } catch {
You can’t perform that action at this time.
0 commit comments