Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
remorses committed Apr 5, 2024
1 parent 8351cd7 commit cabe596
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
6 changes: 6 additions & 0 deletions unframer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# unframer

## 1.2.2

### Patch Changes

- extract component types only after i have written the files on disk

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion unframer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unframer",
"version": "1.2.1",
"version": "1.2.2",
"description": "",
"type": "module",
"repository": "https://github.com/remorses/unframer",
Expand Down
32 changes: 18 additions & 14 deletions unframer/src/exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,26 @@ export async function bundle({
}
logger.log(`writing`, path.relative(out, file.path))
fs.writeFileSync(resultPathAbs, codeNew, 'utf-8')
}
for (let file of result.outputFiles!) {
const name = path.basename(file.path).replace(/\.js$/, '')
if (components[name]) {
logger.log(`extracting types for ${name}`)
const propControls = await extractPropControlsUnsafe(
resultPathAbs,
name,
)
if (!propControls) {
logger.log(`no property controls found for ${name}`)
}
const types = propControlsToType(propControls)
// name = 'framer-' + name
// logger.log('name', name)

fs.writeFileSync(path.resolve(out, `${name}.d.ts`), types)
const resultPathAbs = path.resolve(out, file.path)
if (!components[name]) {
continue
}
logger.log(`extracting types for ${name}`)
const propControls = await extractPropControlsUnsafe(
resultPathAbs,
name,
)
if (!propControls) {
logger.log(`no property controls found for ${name}`)
}
const types = propControlsToType(propControls)
// name = 'framer-' + name
// logger.log('name', name)

fs.writeFileSync(path.resolve(out, `${name}.d.ts`), types)
}

const outFiles = result.outputFiles
Expand Down

0 comments on commit cabe596

Please sign in to comment.