Skip to content

Commit

Permalink
fatal err fixes, updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Dennis committed Mar 15, 2023
1 parent 8d8e262 commit ad5bcbf
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 21 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,13 @@ Usage: npx ladlescoop [options] <file>
Options:
-o, --overwrite overwrite existing file
--dryrun Don't write to file(s)
--stdout Print all output to stdout rather than files
--stdout Print all output to stdout rather than filesysytem
--propsformat <value> Custom props naming format (default: "{Component}Props")
--wrap <value> Custom DOM wrapping: 'div(className="foo"|id="bar"),MockProvider(mocks=[])'
-h, --help display help for command
```

Currently works on a single file, with the following assumptions:
- TypeScript files (*.ts, *.tsx)
- Components defined with `function`, rather than `const MyComponent = () => ...`
- Props type is defined in the same file as component

Story files are written based on component name, not input file. An input file of `Foo.tsx` containing `function Bar` and `function Baz` will write `Bar.stories.tsx` and `Baz.stories.tsx`.
Takes a single TypeScript file (*.ts, *.tsx). Story files are written based on component name, not input file; so a `Foo.tsx` containing `function Bar` and `function Baz` will write `Bar.stories.tsx` and `Baz.stories.tsx`.

To run:
```
Expand All @@ -34,11 +29,10 @@ npm test -- -u # update snapshots
```

##### TODO:
- stdin support
- satisfies operator on args/argTypes
- Custom types imports
- Props destructuring within render function
- Parsing plain JS in addition to TypeScript
- Multiple files and directories on CLI
- Recursive type imports and composable types
- Look for props destructuring within render function
- More unit test coverage

##### TODONT:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/parseComponent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ad5bcbf

Please sign in to comment.