Commit 7e03d46 1 parent f7e4251 commit 7e03d46 Copy full SHA for 7e03d46
File tree 5 files changed +25
-13
lines changed
5 files changed +25
-13
lines changed Original file line number Diff line number Diff line change 25
25
"import/order" : " off" ,
26
26
"max-nested-callbacks" : " off"
27
27
}
28
+ },
29
+ {
30
+ "files" : " bin/bin.cjs" ,
31
+ "rules" : {
32
+ "unicorn/prefer-top-level-await" : " off"
33
+ }
28
34
}
29
35
]
30
36
}
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ ( async function ( ) {
3
+ await import ( '../dist/cli/index.js' ) ;
4
+ } ) ( ) ;
Original file line number Diff line number Diff line change 22
22
"type" : " module" ,
23
23
"exports" : {
24
24
"." : {
25
+ "types" : " ./dist/index.d.js" ,
25
26
"import" : " ./dist/index.js"
26
27
},
27
- "./cli/*" : " ./dist/cli/*.js" ,
28
- "./lib/*" : " ./dist/*.js" ,
29
- "./lib/util/*" : " ./dist/util/*.js" ,
30
- "./package.json" : " ./package.json" ,
31
- "./cli" : " ./dist/cli/index.js"
28
+ "./package.json" : " ./package.json"
32
29
},
33
30
"main" : " ./dist/index.js" ,
31
+ "types" : " ./dist/index.d.js" ,
34
32
"bin" : {
35
- "yoe" : " dist/cli/index.js "
33
+ "yoe" : " bin/bin.cjs "
36
34
},
37
35
"files" : [
36
+ " bin" ,
38
37
" dist"
39
38
],
40
39
"scripts" : {
Original file line number Diff line number Diff line change 1
- #!/usr/bin/env node
1
+ import { readFileSync } from ' node:fs' ;
2
2
import process from 'node:process' ;
3
+ import { dirname , resolve } from 'node:path' ;
4
+ import { fileURLToPath } from 'node:url' ;
3
5
import YeomanCommand , { addEnvironmentOptions } from '../util/command.js' ;
4
- import packageJson from '../package.json' ;
5
6
import { createEnv } from '../index.js' ;
6
7
import { printGroupedGenerator , environmentAction } from './utils.js' ;
7
8
8
9
const program = new YeomanCommand ( ) ;
9
10
11
+ const packageJson = JSON . parse ( readFileSync ( resolve ( dirname ( fileURLToPath ( import . meta. url ) ) , '../../package.json' ) ) . toString ( ) ) ;
12
+
10
13
program . version ( packageJson . version ) . allowExcessArguments ( false ) . enablePositionalOptions ( ) ;
11
14
12
15
addEnvironmentOptions (
@@ -27,7 +30,7 @@ program
27
30
. action ( async ( ) => {
28
31
const env = createEnv ( ) ;
29
32
const generators = await env . lookup ( ) ;
30
- printGroupedGenerator ( generators , env ) ;
33
+ printGroupedGenerator ( generators ) ;
31
34
} ) ;
32
35
33
36
program
@@ -36,12 +39,13 @@ program
36
39
. action ( async ( ) => {
37
40
const env = createEnv ( ) ;
38
41
await env . lookup ( ) ;
39
- printGroupedGenerator ( Object . values ( env . getGeneratorsMeta ( ) ) , env ) ;
42
+ printGroupedGenerator ( Object . values ( env . getGeneratorsMeta ( ) ) ) ;
40
43
} ) ;
41
44
42
45
try {
43
46
await program . parseAsync ( process . argv ) ;
44
47
} catch ( error ) {
45
48
console . log ( error ) ;
49
+ // eslint-disable-next-line unicorn/no-process-exit
46
50
process . exit ( 1 ) ;
47
51
}
Original file line number Diff line number Diff line change 12
12
13
13
/* Emit */
14
14
"outDir" : "./dist" /* Specify an output folder for all emitted files. */ ,
15
- "declaration" : false ,
16
- "sourceMap" : true ,
17
- "allowJs" : true ,
15
+ "declaration" : true ,
16
+ "sourceMap" : false ,
18
17
19
18
/* Interop Constraints */
20
19
"forceConsistentCasingInFileNames" : true /* Ensure that casing is correct in imports. */ ,
You can’t perform that action at this time.
0 commit comments