File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 strategy :
1818 fail-fast : false
1919 matrix :
20- node : [20, 22]
20+ node : [22]
2121 os : [ubuntu-latest, macos-latest, windows-latest]
2222 runs-on : ${{ matrix.os }}
2323 steps :
Original file line number Diff line number Diff line change 11import chokidar , { type FSWatcher } from 'chokidar' ;
2- import { type Project } from './project.js' ;
3-
4- export interface Watcher {
5- /** Exported for testing purposes */
6- project : Project ;
7- }
82
93/**
104 * Run css-modules-kit .d.ts generation in watch mode.
@@ -26,7 +20,7 @@ export async function runCMKInWatchMode(rootDir: string): Promise<void> {
2620 // Watch project files and report diagnostics on changes
2721 const readyPromises : Promise < void > [ ] = [ ] ;
2822 for ( const wildcardDirectory of [ { fileName : rootDir } ] ) {
29- const { promise, resolve } = promiseWithResolvers < void > ( ) ;
23+ const { promise, resolve } = Promise . withResolvers < void > ( ) ;
3024 readyPromises . push ( promise ) ;
3125 fsWatchers . push (
3226 chokidar
@@ -45,17 +39,3 @@ export async function runCMKInWatchMode(rootDir: string): Promise<void> {
4539 }
4640 await Promise . all ( readyPromises ) ;
4741}
48-
49- function promiseWithResolvers < T > ( ) {
50- let resolve ;
51- let reject ;
52- const promise = new Promise < T > ( ( res , rej ) => {
53- resolve = res ;
54- reject = rej ;
55- } ) ;
56- return {
57- promise,
58- resolve : resolve as unknown as ( value : T ) => void ,
59- reject : reject as unknown as ( reason ?: unknown ) => void ,
60- } ;
61- }
You can’t perform that action at this time.
0 commit comments