Skip to content

Commit

Permalink
fix(types): create index for type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
haltcase committed Jan 2, 2020
1 parent 3e707c8 commit 58ee0cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,6 +13,7 @@ src/index.js

# ignore built type definitions
/*.d.ts
src/index.d.ts

# re-include these *.js files
!.eslintrc.js
Expand Down
2 changes: 2 additions & 0 deletions script/create-index.js
Expand Up @@ -5,6 +5,7 @@ const { readdirSync, writeFileSync } = require('fs')

const src = resolve(__dirname, '..', 'src')
const idx = resolve(src, 'index.js')
const def = resolve(src, 'index.d.ts')

const separators = /[-|.](\w)/g

Expand Down Expand Up @@ -40,6 +41,7 @@ const createIndex = () => {
defaults.slice(0, -2) + '\n}\n'

writeFileSync(idx, code)
writeFileSync(def, code)

return files.length
}
Expand Down

0 comments on commit 58ee0cd

Please sign in to comment.