Skip to content

Commit

Permalink
fix(cli): fix default dimensions, prettier & svgo
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Aug 15, 2023
1 parent 8b97248 commit 571d5c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/cli/src/__snapshots__/index.test.ts.snap
Expand Up @@ -7,14 +7,9 @@ export { default as File } from './File'
`;

exports[`cli should not override config with cli defaults 1`] = `
"import * as React from 'react'
const SvgFile = () => (
<svg xmlns="http://www.w3.org/2000/svg" width={48} height={1}>
<path fill="#063855" fillRule="evenodd" d="M0 0h48v1H0z" />
</svg>
)
export default SvgFile
"import * as React from "react";
const SvgFile = () => <svg viewBox="0 0 48 1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink"><title>{"Rectangle 5"}</title><desc>{"Created with Sketch."}</desc><defs /><g id="Page-1" stroke="none" strokeWidth={1} fill="none" fillRule="evenodd"><g id="19-Separator" transform="translate(-129.000000, -156.000000)" fill="#063855"><g id="Controls/Settings" transform="translate(80.000000, 0.000000)"><g id="Content" transform="translate(0.000000, 64.000000)"><g id="Group" transform="translate(24.000000, 56.000000)"><g id="Group-2"><rect id="Rectangle-5" x={25} y={36} width={48} height={1} /></g></g></g></g></g></g></svg>;
export default SvgFile;
"
`;

Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/index.ts
Expand Up @@ -199,6 +199,9 @@ async function run() {
}

const programOpts = noUndefinedKeys(program.opts<Options>())
if (programOpts.dimensions) delete programOpts.dimensions
if (programOpts.svgo) delete programOpts.svgo
if (programOpts.prettier) delete programOpts.prettier
const opts = (await loadConfig(programOpts, {
filePath: process.cwd(),
})) as Options
Expand Down

1 comment on commit 571d5c8

@vercel
Copy link

@vercel vercel bot commented on 571d5c8 Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

svgr – ./

svgr-git-main-gregberge.vercel.app
svgr-gregberge.vercel.app
api.react-svgr.com

Please sign in to comment.