Skip to content

Commit

Permalink
✨ improve(patch): improve @roots/bud-solid exports map (#2457)
Browse files Browse the repository at this point in the history
## Type of change

**PATCH: backwards compatible change**
  • Loading branch information
kellymears authored Sep 22, 2023
1 parent 2558245 commit 106d786
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
12 changes: 1 addition & 11 deletions sources/@roots/bud-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,12 @@
],
"type": "module",
"exports": {
".": {
"import": "./lib/index.js",
"default": "./lib/index.js"
},
"./types": {
"import": "./lib/types.js",
"default": "./lib/types.js"
}
".": "./lib/index.js"
},
"typesVersions": {
"*": {
".": [
"./lib/index.d.ts"
],
"types": [
"./lib/types.d.ts"
]
}
},
Expand Down
7 changes: 5 additions & 2 deletions sources/@roots/bud-solid/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ export default class BudSolid extends Extension {
*/
@bind
public override async boot(bud: Bud) {
bud.babel.setPreset(
const babelPresetSolid = await this.resolve(
`babel-preset-solid`,
await this.resolve(`babel-preset-solid`, import.meta.url),
import.meta.url,
)
if (!babelPresetSolid) return

bud.babel.setPreset(`babel-preset-solid`, babelPresetSolid)
}
}
11 changes: 9 additions & 2 deletions sources/@roots/bud-solid/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
* @see https://bud.js.org
* @see https://github.com/roots/bud
*/
import './types.js'

export {default} from './extension.js'
import BudSolid from './extension.js'

declare module '@roots/bud-framework' {
interface Modules {
'@roots/bud-solid': BudSolid
}
}

export {BudSolid as default}
5 changes: 0 additions & 5 deletions sources/@roots/bud-solid/src/types.ts

This file was deleted.

3 changes: 1 addition & 2 deletions sources/@roots/bud-solid/test/extension.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Extension from '@roots/bud-solid'
import {describe, expect, it} from 'vitest'

import Extension from '../src/index.js'

describe(`@roots/bud-solid`, () => {
it(`should be constructable`, () => {
expect(Extension).toBeInstanceOf(Function)
Expand Down

0 comments on commit 106d786

Please sign in to comment.