Skip to content

Commit

Permalink
fix: support browser types to match component typing (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Jul 11, 2024
1 parent d967800 commit 15c1f96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
"jco": "src/jco.js"
},
"exports": {
"browser": "./src/browser.js",
"default": "./src/api.js"
".": {
"browser": "./src/browser.js",
"default": "./src/api.js"
},
"./component": {
"types": "./obj/js-component-bindgen-component.d.ts",
"default": "./src/browser.js"
}
},
"imports": {
"#ora": {
Expand Down
5 changes: 4 additions & 1 deletion src/browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { $init, generate, generateTypes as _generateTypes } from '../obj/js-component-bindgen-component.js';

export async function transpile () {
export async function generate () {
await $init;
return generate.apply(this, arguments);
}
Expand All @@ -9,3 +9,6 @@ export async function generateTypes () {
await $init;
return _generateTypes.apply(this, arguments);
}

// for backwards compat
export { generate as transpile }

0 comments on commit 15c1f96

Please sign in to comment.