Skip to content

Commit c1f964a

Browse files
committed
fix: render the import name
1 parent 94ee8b2 commit c1f964a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/README.tpl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ npm install --save @json-types/$name
99
## Usage
1010

1111
```ts
12-
import { Compose } from "@json-types/$name";
12+
import { $importName } from "@json-types/$name";
1313
```
1414

1515
## Details

scripts/actions/gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ export async function gen() {
3333

3434
if (type.patches?.removeYamlAnchor) dropYamlAnchor(newSchema);
3535

36+
const importName = capitalize(camelize(type.name));
3637
const oldIndexDef = await readFileIfExists(join(path, "index.d.ts"));
3738
const newIndexDef = await compile(
3839
{
3940
...newSchema,
40-
title: capitalize(camelize(type.name)),
41+
title: importName,
4142
},
4243
"schema.json",
4344
{
@@ -105,6 +106,7 @@ export async function gen() {
105106
],
106107
},
107108
"README.md": await renderTpl("./scripts/README.tpl.md", {
109+
$importName: importName,
108110
$name: type.name,
109111
$url: type.url,
110112
$lastChangeDate: lastChangeDate,

0 commit comments

Comments
 (0)