bud

High-performance build system that supports SWC, esbuild, and Babel

MIT License

Downloads
1.6M
Stars
336
Committers
26

Bot releases are hidden (Show)

bud - v5.8.6

Published by kellymears over 2 years ago

A couple minor fixes. Recommended for all users of 5.8.x.

  1. Users of @roots/sage who are using dynamic imports can now use bud.setPublicPath without causing issues with acorn. It's also fine to continue setting the publicPath in the entry call.

  2. Fixes an issue with bud.assets that resulted in the hash not being applied to copied filenames.

Changes

bud - v5.8.5

Published by kellymears over 2 years ago

These general bugfixes and improvements are recommended for all projects running 5.8.x.

Changes

Docs

This release coincides with updated documentation stemming from recurring discourse topics and github issues:

bud - v5.8.4

Published by kellymears over 2 years ago

This patch prevents a js chunk from being emitted for entrypoints that only contain css.

Changes

bud - v5.8.3

Published by kellymears over 2 years ago

This release fixes multi-instance compatibility in 5.8. It is recommended for users utilizing multiple instances of bud (using bud.make)

Changelog

bud - v5.8.2

Published by kellymears over 2 years ago

Fixes an error in 5.8 which can cause nested extensions to not be instantiated. Recommended for all users of 5.8.x.

Changes

Also includes version bumps for a large number of dependencies. Review what changed between v5.8.1 and v5.8.2 here.

bud - v5.8.1

Published by kellymears over 2 years ago

bud - v5.8.0

Published by kellymears over 2 years ago

Release notes also available on the bud.js.org website.

Heads up

@roots/bud-eslint

There is an upstream issue (with eslint-webpack-plugin) which causes the linter to show no errors after the initial compilation, regardless of any violations.

Until this is resolved, you should use memory caching. You can enable this with:

bud.persist('memory')

This issue is present in earlier versions of bud.js.

@roots/bud-typescript

The typings for the Bud object in bud.js have been consolidated under a single interface/namespace: Bud.
If you are using @roots/bud-typescript, please update your config file and any type declarations to use Bud instead of Framework.

Sorry for the inconvenience. Consider it a trade for much improved intellisense.

Flexible extensions

It is now possible, in extensions which support it, to utilize user-defined dependencies over built-in ones (if they are present in the project package.json).

This means that you can now use Vue 2 instead of Vue 3, if desired. This is done by installing the Vue 2 compatible packages directly. These versions are the ones we currently run integration tests for:

{
  "devDependencies": {
    "@roots/bud": "latest",
    "@roots/bud-vue": "latest"
  },
  "dependencies": {
    "vue": "^2.6.14",
    "vue-template-compiler": "^2.6.14",
    "vue-loader": "^15.9.4"
  }
}

Check out the vue legacy example for a working example of Vue 2 being used with bud.js.

In the future, additional extensions will follow suit. Some may already have support (it's simply not being advertised since this is a new feature).

Note that by utilizing custom versions of packages you are opting in to increased responsibility for your project. We only support what ships with bud.js by default.

bud.proxy url replacements

You can now substitute in or amend the existing string replacements for proxy responses. See the updated documentation for more details: bud.proxy.

bud.glob

You can glob for files with bud.glob. There is a sync version available as well: bud.globSync.

--editor flag

Pass the --editor flag to the build command to open errors in your preferred editor. It's required for you to have set your preferred editor with either the EDITOR or VISUAL environment variables.

If VISUAL is set, it will preferred over EDITOR.

--browser flag

Pass the --browser flag to the build command to open the built site in your browser.

@roots/sage

bud.useTailwindColors now supports nested color groups. So, you can do stuff like this:

{
  blue: {
    shade: {
      hue: {
        '50': '#add8e6',
      },
    },
    group: {
      sky: '#87ceeb',
    },
  },
  tomato: '#ff4500',
}

@roots/bud-esbuild

This extension got a big overhaul in v5.8.0. Including unit tests! Check out the updated docs.

core

This release is mainly focused on the [@roots/bud-extensions] API. Extensions can now be registered using ES6 classes. But, they can also be passed around as plain objects, as before.

Documentation is still a work-in-progress but has been largely updated to reflect the new API.

More information

Big shoutout to everyone who contributed to this release. We're so happy to have you here!

For more information:

bud - v5.7.0

Published by kellymears over 2 years ago

Read the release post on bud.js.org for additional details

🛞 Improvements

  • improve: client dev scripts (#1293)
  • improve: bud.config (#1287)

ðŸĐđ Fixes

  • fix: remove rules section from bud-tailwindcss base stylelint config (#1239) props @alexdanylyschyn
  • fix: add scss stylelint rules for tailwindcss (#1288) props @joshuafredrickson
  • fix: indicator/hmr errors (#1248)
  • fix: bud.terser (#1285)
  • fix: babel root (#1284)
  • fix: bud.alias (#1283)
  • fix: error logging (#1290)

Upgrade guide

If you were using bud.serve to set SSL options, you'll need to update that call as the function's API has changed slightly:

bud.serve({
  url: 'https://my-site.com',
  key: '/path/to/site.key',
  cert: '/path/to/site.crt',
})

becomes:

bud.serve('https://my-site.com', {
  key: '/path/to/site.key',
  cert: '/path/to/site.crt',
})

You may pass any other node server options you want or need to using the second parameter.

👀 More information

bud - v5.6.2

Published by kellymears over 2 years ago

This small update is recommended for all users of 5.6.x.

bud - v5.6.1

Published by kellymears over 2 years ago

This small update is recommended for all users of 5.6.x.

bud - v5.6.0

Published by kellymears over 2 years ago

Performance

bud is now about 30% faster 🎉.

There is a new CLI flag --flush which will force a full recompilation if you feel like something is goofy. It's also recommended to run bud clean after installing an update.

Notifier

MacOS notification center notices are fixed. If you don't want them run the cli command with the --no-notify flag.

bud.path and bud.setPath

TLDR: Way less clunky to work with.

  • bud.path() can be called with no parameters will now resolve to the project root.

  • bud.path('relative/path') now returns an absolute path from a project relative one.

  • bud.path('/absolute/path') is recognized as an absolute path and will not be interpolated.

  • There are several reserved strings referencing key directories: @src, @dist, @storage, @modules. The @ prefix is now being used to make it clearer that this is not a normal path.

  • You can use bud.setPath to define additional directory aliases:

bud.setPath({'@config': 'app/config/directory'})

bud.path('@config/config-file.json')
// => [root]/app/config/directory/config-file.json
  • This only applies to the first segment and only when the @ symbol is prefixed. app/@alias/example will not work.

  • This does not automatically make webpack aliases from a path. To use the same convention in your client scripts you still need to use bud.alias.

⚠ïļ Upgrade guide

  • Any calls which referenced 'project' as the first parameter should have that parameter removed. Examples:

    • bud.path('project') becomes bud.path().
    • bud.path('project', 'directory') becomes bud.path('directory').
  • Any calls which used src, dist, storage or modules as the first parameter should be updated to use the @ prefix. Examples:

    • bud.path('src', 'some-file.js') becomes bud.path('@src', 'some-file.js').
    • Or, just bud.path('@src/some-file.js').
  • Any calls to bud.setPath which referenced those magic strings also needs to be updated. Example:

    • bud.setPath('src', 'js') becomes bud.setPath('@src', 'js')

Defining modules is a lot easier

Want to add support to bud for some arcane syntax? Great news, the API for loaders, items and rules just got a nice upgrade.

Here's typescript.

app.build
  .setLoader('ts', 'ts-loader')
  .setItem('ts', {loader: 'ts', options: {}})
  .setRule('ts', {test: /\.tsx?/, use: [`babel`, `ts`]})

If you just want to modify an existing rule, there is lots for you in this update:

app.bulid.rule.ts.setUse([`babel`, `ts`])
app.build.loaders.ts.setSrc(`alternate-ts-loader`)
app.build.items.ts.setOptions({...options})

Extension authors should take advantage of how all properties for loader, item, and rule definitions can be expressed with a callback. This means if someone changes their source path later your rule will still be pointed in the right direction.

More information

Changelog

Full Changelog: https://github.com/roots/bud/compare/v5.5.0...v5.6.0

bud - v5.5.0

Published by kellymears over 2 years ago

For more information read the 5.5.0 release post.

Features

Fixes

Full Changelog: https://github.com/roots/bud/compare/v5.4.0...v5.5.0

bud - v5.4.0

Published by kellymears over 2 years ago

Heads up

  • ⚠ïļ Eslint configs have been centralized in the new @roots/eslint-config package. If you are using a @roots eslint config please use the appropriate export from @roots/eslint-config instead. These exports will be removed in 5.5.0.
  • ⚠ïļ Verbose logging is now disabled by default. To enable logging use the --log flag.
  • ⚠ïļ @roots/sage users no longer need to specify paths in package.json. You can remove the bud key entirely.

New and noteworthy

👀

Fixes

Improvements

Full Changelog: https://github.com/roots/bud/compare/v5.3.2...v5.4.0

bud - v5.3.2

Published by kellymears over 2 years ago

bud - v5.3.1

Published by QWp6t over 2 years ago

Fixes

  • fix(bud): ensure parallism is at least 1cpu by @qwp6t (#1130) (Thanks @Pederytter)

Full Changelog: https://github.com/roots/bud/compare/v5.3.0...v5.3.1

bud - v5.3.0

Published by kellymears over 2 years ago

New and noteworthy

@roots/bud-typescript

  • There is a typescript eslint config available to import from @roots/bud-typescript/eslint-config.
  • There is a base tsconfig available to import from @roots/bud-typescript/tsconfig/tsconfig.json. For the most part this config is identical to the Microsoft recommended tsconfig except that it allows jsx/tsx to be passed through to @roots/bud-babel.

@roots/bud-sage

  • The domReady function is available for import from @roots/sage/client.

@bud.assets

In 5.2.0 it was required to use absolute paths with this function. That was a temporary solution; you can now pass copy items in a variety of ways — including as a standard copy-webpack-plugin options object.

Fixes

Improvements

Full Changelog: https://github.com/roots/bud/compare/v5.2.0...v5.3.0

bud - Bud v5.2.0

Published by kellymears over 2 years ago

A big change for dependency management with a couple very important bug fixes.

Deprecations

setPublicPath (when using @roots/sage)

bud.setPublicPath is deprecated when using the @roots/sage preset.

Setting the public path in roots/sage will break builds now that it is no longer needed (it'll end up doubling up URLs in Acorn). We know that's annoying so @roots/sage (the extension) overrides setPublicPath with a function that intentionally lets the passed value fall through.

The function is flagged as @deprecated and will be marked as such in most modern IDEs. You should remove it from your config before roots/sage leaves beta.

See improve(server) proxy middleware (#1008)

Directly installing dependencies is optional

In Bud v5.0.0 and v5.1.0 it became very clear that the framework's way of handling dependency management was not working anywhere near as well as we had hoped it would. I'd estimate over half of the problems brought up had to do with mismatched dependencies.

The bud install command was meant to make it easy. I wouldn't say it made it harder, but it definitely didn't make it easy.

For v5.2.0 we're doing something really different and much more in keeping with other tools that work similarly to bud (nextjs, create-react-app, etc). We're going to include the batteries.

This means users do not need to specify anything in package.json outside of the extension they want to use. So, if you want to try @roots/bud-sass you just install the extension. No need to run bud install or manually add sass. It should already be at the top level of node_modules, a proper peer to your project, ready to be resolved.

Compare the roots/sage manifest from 5.1.0:

"devDependencies": {
    "@babel/eslint-parser": "^7.16.5",
    "@roots/bud": "^5.1.0",
    "@roots/bud-eslint": "^5.1.0",
    "@roots/bud-postcss": "^5.1.0",
    "@roots/bud-prettier": "^5.1.0",
    "@roots/bud-stylelint": "^5.1.0",
    "@roots/bud-tailwindcss": "^5.1.0",
    "@roots/sage": "^5.1.0",
    "@wordpress/browserslist-config": "4.1.0",
    "eslint": "8.6.0",
    "postcss": "8.4.5",
    "postcss-import": "14.0.2",
    "postcss-nested": "5.0.6",
    "postcss-preset-env": "7.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "tailwindcss": "3.0.8",
    "prettier": "2.5.1"
}

to the one for 5.2.0:

"devDependencies": {
  "@roots/bud": "5.2.0",
  "@roots/bud-eslint": "5.2.0",
  "@roots/bud-postcss": "5.2.0",
  "@roots/bud-prettier": "5.2.0",
  "@roots/bud-stylelint": "5.2.0",
  "@roots/bud-tailwindcss": "52.0",
  "@roots/sage": "5.2.0"
}

It seems like it's going to be a lot more manageable. For bud users and maintainers.

Users can still override the installed version of any dependency by installing it themselves. Bud has also relaxed its verison requirements to be much more tolerant of discrepencies.

See improve(bud) dependency strategy (#1005)

Easier stylelint configs

When relevant, all extensions now come with a stylelint export for you to use as a starting point.

Here's a config that works well with tailwindcss:

{
  "extends": [
    "@roots/bud-stylelint/config",
    "@roots/bud-tailwindcss/stylelint-config"
  ]
}

And if a user wants to try tailwindcss in a sass stylesheet, they no longer need to figure out how to do that themselves.

{
  "extends": [
    "@roots/sage/stylelint-config",
    "@roots/bud-tailwindcss/stylelint-config",
    "@roots/bud-sass/stylelint-config"
  ]
}

This release should be able to close the door on issues like [#731] CSS lint errors for SCSS stylesheet files (e.g. Unknown word; ...)

Here's the list of modules:

extension export
@roots/bud-stylelint '@roots/bud-stylelint/config'
@roots/bud-tailwindcss '@roots/bud-tailwindcss/stylelint-config'
@roots/bud-sass '@roots/bud-sass/stylelint-config'
@roots/sage '@roots/sage/stylelint-config'

Easier eslint configs

There are a number of configs available to use in your eslint config as a base:

module.exports = {
  root: true,
  extends: [
    require.resolve('@roots/sage/eslint-config'),
    require.resolve('@roots/bud-prettier/eslint-config'),
  ],
}

Here's the list of modules:

extension export
@roots/bud-eslint '@roots/bud-eslint/eslint-config'
@roots/bud-babel '@roots/bud-babel/eslint-config'
@roots/bud-preset-wordpress '@roots/bud-preset-wordpress/eslint-config'
@roots/bud-preset-recommend '@roots/bud-preset-recommend/eslint-config'
@roots/bud-prettier '@roots/bud-prettier/eslint-config'
@roots/bud-react '@roots/bud-react/eslint-config'
@roots/sage '@roots/sage/eslint-config'

Fixes and improvements

  • Setting a publicPath no longer needed for proxy 🎉
  • Fixes INVALID_URL error message emitted by HPM logger
  • bud.use was not configured behind a facade. It is now a synchronous interface over an asynchronous function (like the rest of the async fns in @roots/bud-api). This was obviously causing issues (see https://github.com/roots/bud/issues/1003#issuecomment-1017950712). A unit test has been added to make sure it returns Framework and not Promise<Framework>
  • bud.splitChunks now breaks all of the "dev boilerplate" (think: hot reload scripts, core-js polyfills, webpack client code, ansi parsers, bud's client scripts, etc.) into a separate chunkGroup: vendor/bud.js. This cleanly separates vendor code (being used by the app), "bud" code, and the application code. This doesn't effect production at all since none of the packages in the bud chunk group are used outside of dev.
  • Fixes bud.watch.

Changelog

Compare: https://github.com/roots/bud/compare/v5.1.0...main

Contributors

Thanks to everyone who contributed to this release!

  • @kellymears
  • @retlehs
  • @swalkinshaw
bud - Bud v5.1.0

Published by kellymears almost 3 years ago

Bud v5.1.0 is a minor release. It includes a couple anticipated features and bug fixes.

There are many fixes and core improvements based on feedback from the v5.0.0 release. Thanks to everyone who filed issues. There are a couple minor breaking changes.

Adds support for webp 🎉

We now have an automated release process and will be publishing updates much faster. Thanks for your patience! It took a lot of work to get to this place and we think it's going to prove to be worth it for our project and yours.

Known issues

If you use npm to install bud, you may need to remove dependencies that are shared with bud extensions in order to install the update.

After installation, run npx bud install followed by npm install to resolve everything.

In the near future bud will relax semver requirements to address this annoyance.

Breaking

There are relatively minor breaking changes for users of @roots/bud-imagemin and @roots/sage and one breaking change in core.

bud.assets requires absolute paths

If you wanted, consider the bud.path helper to easily get an absolute path.

Resolve relative to the the src directory:

bud.assets([bud.path('src', 'images/**/*.{jpg,png}')])

Resolve from the root of your project:

bud.assets([bud.path('project', 'src/images/**/*.{jpg,png}')])

In the future, hopefully this will not be a requirement. But for now it is.

@roots/bud-imagemin

We have switched to @squoosh/lib and there is a new configuration API. It should be an easy change. See @roots/bud-imagemin docs.

@roots/sage

Users need to opt-in to specific features by installing:

  • @roots/bud-stylelint
  • @roots/bud-eslint
  • @roots/bud-tailwindcss
  • @roots/bud-prettier

Changelog

Contributors

Thanks to everyone who contributed to this release!

  • @kellymears
  • @QWp6t
  • @retlehs
  • @swalkinshaw
  • @austinpray
bud - Bud v5.0.0

Published by QWp6t almost 3 years ago

The most important change

You no longer need to explicitly require an extension in your configuration file or call bud.use to load it. Bud will automatically load the extensions you have installed.

Breaking

  • @roots/bud-cli has been deprecated. CLI functionality is packaged with @roots/bud.
  • bud.use method is now asynchronous.
  • bud.build.make method is now asynchronous.
  • Hook key build now refers to an asynchronous filter.
  • Hook key build.plugins now refers to an asynchronous filter.
  • bud.extensions.enqueue can be used to enqueue a plugin and returns Bud instance for chaining.
  • @roots/bud no longer exports Framework. Use Bud or import Framework from @roots/bud-framework instead.

Added

  • Yaml, json5 and TypeScript config file support.

  • Multi-compiler support:

    • bud.make will create a new Bud instance for you to configure.
    • bud.get will retrieve a previously made child instance for further configuration.
    • bud.set allows setting a Bud instance as a bud.children entry.
    • bud.root always returns the parent compiler. If called from the parent it will return itself.
    • bud.isRoot will be true in the parent context.
    • bud.hasChildren will be true in the parent context if there are child Bud instances.
  • Several new hooks:

    • event.build.make.before is called just before the webpack config is created (async).
    • event.build.make.after is called just after the webpack config is created (async).
    • event.compiler.before is called just before the final config is passed to webpack.
    • event.compiler.after is called just after the final config is passed to webpack.
  • New CLI commands:

    • bud clean - removes dist and cache files
    • bud doctor - check for missing peer dependencies and configuration errors
    • bud install - automatically install/update required dependencies
    • bud serve - start the development server and initiate hot module reloading
  • New bud build flags:

    • --target Target a specific Bud instance to be built in isolation. Can be passed multiple times to target more than one compiler.
    • --[no]-cache Toggle filesystem caching. [default: true]
    • --cache.type Set the cache type. Can be filesystem or memory. [default: filesystem]
    • --location.[src|dist|project|storage] Set a project disk location
    • --[no]-log - Toggle logging [default: true]
    • --[no]-log.level - Set logging level (v, vv, vvv, vvvv) [default: vvv]
    • --[no]-log.papertrail - Allow logger lines to overwrite the previous line from the same scope [default: --no-log.papertrail]
    • --log-secret - Suppress a string from logger output (can use multiple times) [default: --log-secret {cwd}]
    • --[no]-dashboard - Toggle the bud dashboard [default: --dashboard]
    • ...many more! add --help after any command to see what options are available.
  • example project demonstrating how to use off-the-shelf webpack plugins with bud.use

Improved

  • Greatly improved performance. The entire Bud lifecycle is asynchronous.
  • Installed extensions are now automatically registered and booted.
  • Peer dependency requirements are now checked. Missing dependencies will not throw an error but will be logged.
  • bud.use now supports using Webpack plugins directly.
  • Informative logging.
  • The CLI and dashboard have a fresh coat of paint.
  • New notification center integration (MacOS only)
  • Dashboard warnings and errors are now better displayed in the console.

Fixed

  • bud.proxy - fixed proxy interceptor
  • bud.serve - fixed development server public path
  • bud.serve - disables module hashing in development mode. this is enforced

Internal

  • @roots/bud-typings has been deprecated.
  • Added @roots/yarn-plugin-kjo to provide utilities in the yarn @bud namespace.

Extension specific notes

The following notes only apply to specific extensions:

Contributors

Package Rankings
Top 2.09% on Npmjs.org
Related Projects