Skip to content

Commit

Permalink
🩹 fix(patch): sage default paths (#2660) (#2667)
Browse files Browse the repository at this point in the history
Fixes problem with @roots/sage paths. See #2660.

## Type of change

**PATCH: backwards compatible change**
  • Loading branch information
kellymears authored Dec 9, 2024
1 parent 271d22a commit aeba9d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion sources/@roots/sage/src/sage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ class Sage extends Extension {
bud
.setPath({
'@dist': `public`,
'@src': `resources`,
})
.setPath({
'@fonts': `@src/fonts`,
'@images': `@src/images`,
'@scripts': `@src/scripts`,
'@src': `resources`,
'@styles': `@src/styles`,
'@views': `@src/views`,
})
Expand Down
15 changes: 10 additions & 5 deletions sources/@roots/sage/test/sage/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ describe(`@roots/sage`, async () => {
await bud.extensions.add(`@roots/sage`)

expect(bud.extensions.has(`@roots/sage/blade-loader`)).toBeTruthy()
expect(bud.extensions.get(`@roots/sage/blade-loader`).enabled).toBeTruthy()
expect(
bud.extensions.get(`@roots/sage/blade-loader`).enabled,
).toBeTruthy()
})


it(`sage.blade.enable`, async () => {
expect(bud.extensions.has(`@roots/sage/blade-loader`)).toBeFalsy()

await bud.extensions.add(`@roots/sage`)

bud.sage.blade.enable(false).done()

expect(bud.extensions.get(`@roots/sage/blade-loader`).enabled).toBeFalsy()
expect(
bud.extensions.get(`@roots/sage/blade-loader`).enabled,
).toBeFalsy()
})

it(`should register errything`, async () => {
Expand All @@ -82,10 +85,12 @@ describe(`@roots/sage`, async () => {

expect(setPathSpy).toHaveBeenCalledWith({
'@dist': `public`,
'@src': `resources`,
})
expect(setPathSpy).toHaveBeenCalledWith({
'@fonts': `@src/fonts`,
'@images': `@src/images`,
'@scripts': `@src/scripts`,
'@src': `resources`,
'@styles': `@src/styles`,
'@views': `@src/views`,
})
Expand All @@ -98,7 +103,7 @@ describe(`@roots/sage`, async () => {

expect(bud.hooks.filter(`build.output.uniqueName`)).toEqual(
// @ts-ignore
bud.sage.getUniqueName()
bud.sage.getUniqueName(),
)
})

Expand Down

0 comments on commit aeba9d1

Please sign in to comment.