fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #3469 from hey-api/copilot/fix-logs-file-setting

fix: `logs.file: false` in config file ignored when using CLI

authored by

Lubos and committed by
GitHub
a6c2e780 75d98339

+9 -24
+5
.changeset/five-terms-sparkle.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **cli**: fix: do not set `logs.file` to `true` by default
+2 -22
packages/openapi-ts/src/__tests__/cli.test.ts
··· 27 27 } finally { 28 28 process.argv = originalArgv; 29 29 } 30 - expect(spy).toHaveBeenCalledWith({ 31 - logs: { 32 - file: true, 33 - }, 34 - }); 30 + expect(spy).toHaveBeenCalledWith({}); 35 31 }); 36 32 37 33 it('with minimal options', async () => { ··· 51 47 } 52 48 expect(spy).toHaveBeenCalledWith({ 53 49 input: ['foo.json'], 54 - logs: { 55 - file: true, 56 - }, 57 50 output: ['bar'], 58 51 }); 59 52 }); ··· 66 59 } finally { 67 60 process.argv = originalArgv; 68 61 } 69 - expect(spy).toHaveBeenCalledWith({ 70 - logs: { 71 - file: true, 72 - }, 73 - }); 62 + expect(spy).toHaveBeenCalledWith({}); 74 63 }); 75 64 76 65 it('with plugins', async () => { ··· 82 71 process.argv = originalArgv; 83 72 } 84 73 expect(spy).toHaveBeenCalledWith({ 85 - logs: { 86 - file: true, 87 - }, 88 74 plugins: ['foo'], 89 75 }); 90 76 }); ··· 98 84 process.argv = originalArgv; 99 85 } 100 86 expect(spy).toHaveBeenCalledWith({ 101 - logs: { 102 - file: true, 103 - }, 104 87 plugins: ['foo'], 105 88 }); 106 89 }); ··· 116 99 } 117 100 expect(spy).toHaveBeenCalledWith({ 118 101 logs: { 119 - file: true, 120 102 level: 'debug', 121 103 }, 122 104 }); ··· 132 114 } 133 115 expect(spy).toHaveBeenCalledWith({ 134 116 logs: { 135 - file: true, 136 117 level: 'silent', 137 118 }, 138 119 }); ··· 184 165 dryRun: true, 185 166 input: ['baz'], 186 167 logs: { 187 - file: true, 188 168 path: 'qux', 189 169 }, 190 170 output: ['quux'],
+2 -2
packages/openapi-ts/src/cli/adapter.ts
··· 18 18 if (cli.client) plugins.push(cli.client); 19 19 if (plugins.length > 0) config.plugins = plugins; 20 20 21 - if (cli.debug || cli.silent || cli.logs || cli.logFile !== undefined) { 21 + if (cli.debug || cli.silent || cli.logs || cli.logFile === false) { 22 22 config.logs = { 23 23 ...(cli.logs && { path: cli.logs }), 24 24 ...(cli.debug && { level: 'debug' as const }), 25 25 ...(cli.silent && { level: 'silent' as const }), 26 - ...(cli.logFile !== undefined && { file: cli.logFile }), 26 + ...(cli.logFile === false && { file: false }), 27 27 }; 28 28 } 29 29