Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🩹 fix(patch): sage default paths (#2660) #2667

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading