Skip to content

Commit

Permalink
fix: workaround ts bug & generate valid typedefs (#169)
Browse files Browse the repository at this point in the history
This works arounds typescript bug
microsoft/TypeScript#51548 which in turn
caused storacha/ucanto#133 by exporting
imported modules so that generated typedefs will have those references
  • Loading branch information
Gozala authored Nov 16, 2022
1 parent 2830104 commit 0b02d14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 161 deletions.
3 changes: 2 additions & 1 deletion packages/access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
}
},
"rules": {
"unicorn/prefer-number-properties": "off"
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-export-from": "off"
},
"env": {
"mocha": true
Expand Down
5 changes: 4 additions & 1 deletion packages/access/src/capabilities/store.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable jsdoc/require-param */
import { capability, Failure, Link, URI, Schema } from '@ucanto/validator'
import { equalLink, equalWith } from './utils.js'
import { any } from './any.js'
Expand Down Expand Up @@ -148,3 +147,7 @@ export const list = base.derive({
})

export const all = add.or(remove).or(list)

// ⚠️ We export imports here so they are not omited in generated typedes
// @see https://github.com/microsoft/TypeScript/issues/51548
export { Schema, Link }
159 changes: 0 additions & 159 deletions pnpm-lock.yaml

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

0 comments on commit 0b02d14

Please sign in to comment.