Skip to content

Commit

Permalink
bud 5.4.0 (#2983)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Word <[email protected]>
  • Loading branch information
kellymears and retlehs committed Feb 23, 2022
1 parent fc93185 commit f297df0
Show file tree
Hide file tree
Showing 8 changed files with 512 additions and 548 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
module.exports = {
root: true,
extends: [require.resolve('@roots/sage/eslint-config')],
extends: ['@roots/eslint-config/sage'],
};
16 changes: 11 additions & 5 deletions bud.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 3,23 @@
*
* @param {bud} app
*/
module.exports = (app) =>
module.exports = async (app) => {
app
/**
* Application entrypoints
*
* Paths are relative to your resources directory
*/
.entry({
app: ['scripts/app.js', 'styles/app.css'],
editor: ['scripts/editor.js', 'styles/editor.css'],
app: ['@scripts/app', '@styles/app'],
editor: ['@scripts/editor', '@styles/editor'],
})

/**
* These files should be processed as part of the build
* even if they are not explicitly imported in application assets.
*/
.assets(['images'])
.assets('images')

/**
* These files will trigger a full page reload
Expand All @@ -36,4 36,10 @@ module.exports = (app) =>
*
* This is your local dev server.
*/
.proxy('http://example.test');
.proxy('http://example.test')

/**
* Development URL
*/
.serve('http://example.test:3000');
};
7 changes: 3 additions & 4 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 1,14 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "commonjs",
"moduleResolution": "node",
"paths": {
"@scripts/*": ["./resources/scripts/*"],
"@styles/*": ["./resources/styles/*"]
},
"target": "es5"
}
},
"exclude": ["./public"]
"exclude": ["./public", "./node_modules"]
}
20 changes: 7 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 1,6 @@
{
"name": "sage",
"private": true,
"bud": {
"location": {
"src": "resources",
"dist": "public"
}
},
"browserslist": [
"extends @wordpress/browserslist-config"
],
Expand All @@ -25,12 19,12 @@
"translate:js": "wp i18n make-json ./resources/lang --pretty-print"
},
"devDependencies": {
"@roots/bud": "5.3.2",
"@roots/bud-eslint": "5.3.2",
"@roots/bud-postcss": "5.3.2",
"@roots/bud-prettier": "5.3.2",
"@roots/bud-stylelint": "5.3.2",
"@roots/bud-tailwindcss": "5.3.2",
"@roots/sage": "5.3.2"
"@roots/bud": "5.4.0",
"@roots/bud-eslint": "5.4.0",
"@roots/bud-prettier": "5.4.0",
"@roots/bud-stylelint": "5.4.0",
"@roots/bud-tailwindcss": "5.4.0",
"@roots/eslint-config": "5.4.0",
"@roots/sage": "5.4.0"
}
}
18 changes: 12 additions & 6 deletions resources/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,15 1,21 @@
import {domReady} from '@roots/sage/client';

/**
* Run the application when the DOM is ready.
* app.main
*/
domReady(() => {
// Application code.
});
const main = async (err) => {
if (err) {
// handle hmr errors
console.error(err);
}

// application code
};

/**
* Accept module updates
* Initialize
*
* @see https://webpack.js.org/api/hot-module-replacement
*/
import.meta.webpackHot?.accept(console.error);
domReady(main);
import.meta.webpackHot?.accept(main);
19 changes: 12 additions & 7 deletions resources/scripts/editor.js
Original file line number Diff line number Diff line change
@@ -1,22 1,27 @@
import {registerBlockStyle, unregisterBlockStyle} from '@wordpress/blocks';

import {domReady} from '@roots/sage/client';
import {registerBlockStyle, unregisterBlockStyle} from '@wordpress/blocks';

/**
* Customize block styles
* editor.main
*/
domReady(() => {
const main = (err) => {
if (err) {
// handle hmr errors
console.error(err);
}

unregisterBlockStyle('core/button', 'outline');

registerBlockStyle('core/button', {
name: 'outline',
label: 'Outline',
});
});
};

/**
* Accept module updates
* Initialize
*
* @see https://webpack.js.org/api/hot-module-replacement
*/
import.meta.webpackHot?.accept(console.error);
domReady(main);
import.meta.webpackHot?.accept(main);
9 changes: 1 addition & 8 deletions theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 22,7 @@
},
"spacing": {
"padding": true,
"units": [
"px",
"%",
"em",
"rem",
"vw",
"vh"
]
"units": ["px", "%", "em", "rem", "vw", "vh"]
},
"typography": {
"customFontSize": false
Expand Down
Loading

0 comments on commit f297df0

Please sign in to comment.