mirror of
https://github.com/vercel/turborepo.git
synced 2025-12-23 09:19:46 +00:00
chore(packages/ui turbo gen config.ts): Preventing the format of pack… (#8033)
…age.json from being corrupted
### Description
Prevent the format of `package.json` from getting corrupted when
creating a component with `turbo gen`.
Here's what the exports section looks like before and after the fix:
before
```
"exports": {
"./foo": "./src/foo.tsx",
"./button": "./src/button.tsx",
"./card": "./src/card.tsx",
"./code": "./src/code.tsx"
},
```
after
```
"exports": {
"./foo": "./src/foo.tsx",
"./button": "./src/button.tsx",
"./card": "./src/card.tsx",
"./code": "./src/code.tsx"
},
```
### Testing Instructions
1. Create a component with `turbo gen`.
2. Check package.json.
Co-authored-by: Anthony Shew <anthony.shew@vercel.com>
This commit is contained in:
parent
131cb0813b
commit
4eecd25f23
1 changed files with 1 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
|
|||
type: "append",
|
||||
path: "package.json",
|
||||
pattern: /"exports": {(?<insertion>)/g,
|
||||
template: '"./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
|
||||
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue