diff --git a/.vscode/settings.json b/.vscode/settings.json index 33974886b5..7f970f53fb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,7 +33,7 @@ "verdaccio": true, "**/pnp.*": true, "**/node_modules": true, - "**/.budfiles/**/*": true + "**/.storage": true }, "prettier.configPath": "config/prettier.config.js", "prettier.ignorePath": "config/.prettierignore", diff --git a/sources/@roots/bud-framework/src/notifier.ts b/sources/@roots/bud-framework/src/notifier.ts index 465ae35c50..60720ce4d8 100644 --- a/sources/@roots/bud-framework/src/notifier.ts +++ b/sources/@roots/bud-framework/src/notifier.ts @@ -11,6 +11,7 @@ import {fileURLToPath} from 'node:url' import isEmpty from '@roots/bud-support/lodash/isEmpty' import isString from '@roots/bud-support/lodash/isString' import isUndefined from '@roots/bud-support/lodash/isUndefined' +import logger from '@roots/bud-support/logger' import {open, openEditor} from '@roots/bud-support/open' /** @@ -139,7 +140,20 @@ export class Notifier { * True if notifications are enabled */ public get notificationsEnabled(): boolean { - return this.app?.context.notify === true + if (this.app?.context.notify === true) { + logger.scope(`notifier`).log(`Notifications enabled`) + return true + } + + if ( + this.app?.context.notify === undefined && + platform() === `darwin` + ) { + logger.scope(`notifier`).log(`Notifications enabled (macos default)`) + return true + } + + return false } /** diff --git a/sources/@roots/bud/test/cli-flag-minimize/flag-minimize.test.ts b/sources/@roots/bud/test/cli-flag-minimize/flag-minimize.test.ts new file mode 100644 index 0000000000..e0444d46ed --- /dev/null +++ b/sources/@roots/bud/test/cli-flag-minimize/flag-minimize.test.ts @@ -0,0 +1,48 @@ +import {path} from '@repo/constants' +import {execa} from 'execa' +import fs from 'fs-jetpack' +import {expect, test} from 'vitest' + +test(`--minimize`, async () => { + await fs.removeAsync( + path(`sources/@roots/bud/test/cli-flag-minimize/project/dist`), + ) + + await execa(`yarn`, [ + `workspace`, + `@tests/minimize-flag`, + `run`, + `bud`, + `build`, + `--no-minimize`, + ]) + + expect( + await fs.readAsync( + path( + `sources/@roots/bud/test/cli-flag-minimize/project/dist/js/main.js`, + ), + ), + ).toMatch(/\n/) + + await fs.removeAsync( + path(`sources/@roots/bud/test/cli-flag-minimize/project/dist`), + ) + + await execa(`yarn`, [ + `workspace`, + `@tests/minimize-flag`, + `run`, + `bud`, + `build`, + `--minimize`, + ]) + + expect( + await fs.readAsync( + path( + `sources/@roots/bud/test/cli-flag-minimize/project/dist/js/main.js`, + ), + ), + ).not.toMatch(/\n/) +}) diff --git a/sources/@roots/bud/test/cli-flag-minimize/project/package.json b/sources/@roots/bud/test/cli-flag-minimize/project/package.json new file mode 100644 index 0000000000..af2f527c29 --- /dev/null +++ b/sources/@roots/bud/test/cli-flag-minimize/project/package.json @@ -0,0 +1,8 @@ +{ + "name": "@tests/minimize-flag", + "private": true, + "type": "module", + "devDependencies": { + "@roots/bud": "workspace:*" + } +} diff --git a/sources/@roots/bud/test/cli-flag-minimize/project/src/index.js b/sources/@roots/bud/test/cli-flag-minimize/project/src/index.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/yarn.lock b/yarn.lock index 97487e6cad..c8d639a536 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11515,6 +11515,14 @@ __metadata: languageName: unknown linkType: soft +"@tests/minimize-flag@workspace:sources/@roots/bud/test/cli-flag-minimize/project": + version: 0.0.0-use.local + resolution: "@tests/minimize-flag@workspace:sources/@roots/bud/test/cli-flag-minimize/project" + dependencies: + "@roots/bud": "workspace:*" + languageName: unknown + linkType: soft + "@tests/project@workspace:tests/util/project": version: 0.0.0-use.local resolution: "@tests/project@workspace:tests/util/project"