Co-authored-by: Ben Word <ben@benword.com>
This commit is contained in:
Kelly Mears
2022-02-23 06:45:08 -08:00
committed by GitHub
parent fc93185a7a
commit f297df0942
8 changed files with 510 additions and 546 deletions

View File

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

View File

@@ -3,7 +3,7 @@
* *
* @param {bud} app * @param {bud} app
*/ */
module.exports = (app) => module.exports = async (app) => {
app app
/** /**
* Application entrypoints * Application entrypoints
@@ -11,15 +11,15 @@ module.exports = (app) =>
* Paths are relative to your resources directory * Paths are relative to your resources directory
*/ */
.entry({ .entry({
app: ['scripts/app.js', 'styles/app.css'], app: ['@scripts/app', '@styles/app'],
editor: ['scripts/editor.js', 'styles/editor.css'], editor: ['@scripts/editor', '@styles/editor'],
}) })
/** /**
* These files should be processed as part of the build * These files should be processed as part of the build
* even if they are not explicitly imported in application assets. * even if they are not explicitly imported in application assets.
*/ */
.assets(['images']) .assets('images')
/** /**
* These files will trigger a full page reload * These files will trigger a full page reload
@@ -36,4 +36,10 @@ module.exports = (app) =>
* *
* This is your local dev server. * This is your local dev server.
*/ */
.proxy('http://example.test'); .proxy('http://example.test')
/**
* Development URL
*/
.serve('http://example.test:3000');
};

View File

@@ -1,15 +1,14 @@
{ {
"compilerOptions": { "compilerOptions": {
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"baseUrl": ".", "jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"module": "commonjs", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"paths": { "paths": {
"@scripts/*": ["./resources/scripts/*"], "@scripts/*": ["./resources/scripts/*"],
"@styles/*": ["./resources/styles/*"] "@styles/*": ["./resources/styles/*"]
}, }
"target": "es5"
}, },
"exclude": ["./public"] "exclude": ["./public", "./node_modules"]
} }

View File

@@ -1,12 +1,6 @@
{ {
"name": "sage", "name": "sage",
"private": true, "private": true,
"bud": {
"location": {
"src": "resources",
"dist": "public"
}
},
"browserslist": [ "browserslist": [
"extends @wordpress/browserslist-config" "extends @wordpress/browserslist-config"
], ],
@@ -25,12 +19,12 @@
"translate:js": "wp i18n make-json ./resources/lang --pretty-print" "translate:js": "wp i18n make-json ./resources/lang --pretty-print"
}, },
"devDependencies": { "devDependencies": {
"@roots/bud": "5.3.2", "@roots/bud": "5.4.0",
"@roots/bud-eslint": "5.3.2", "@roots/bud-eslint": "5.4.0",
"@roots/bud-postcss": "5.3.2", "@roots/bud-prettier": "5.4.0",
"@roots/bud-prettier": "5.3.2", "@roots/bud-stylelint": "5.4.0",
"@roots/bud-stylelint": "5.3.2", "@roots/bud-tailwindcss": "5.4.0",
"@roots/bud-tailwindcss": "5.3.2", "@roots/eslint-config": "5.4.0",
"@roots/sage": "5.3.2" "@roots/sage": "5.4.0"
} }
} }

View File

@@ -1,15 +1,21 @@
import {domReady} from '@roots/sage/client'; import {domReady} from '@roots/sage/client';
/** /**
* Run the application when the DOM is ready. * app.main
*/ */
domReady(() => { const main = async (err) => {
// Application code. if (err) {
}); // handle hmr errors
console.error(err);
}
// application code
};
/** /**
* Accept module updates * Initialize
* *
* @see https://webpack.js.org/api/hot-module-replacement * @see https://webpack.js.org/api/hot-module-replacement
*/ */
import.meta.webpackHot?.accept(console.error); domReady(main);
import.meta.webpackHot?.accept(main);

View File

@@ -1,22 +1,27 @@
import {domReady} from '@roots/sage/client';
import {registerBlockStyle, unregisterBlockStyle} from '@wordpress/blocks'; import {registerBlockStyle, unregisterBlockStyle} from '@wordpress/blocks';
import {domReady} from '@roots/sage/client';
/** /**
* Customize block styles * editor.main
*/ */
domReady(() => { const main = (err) => {
if (err) {
// handle hmr errors
console.error(err);
}
unregisterBlockStyle('core/button', 'outline'); unregisterBlockStyle('core/button', 'outline');
registerBlockStyle('core/button', { registerBlockStyle('core/button', {
name: 'outline', name: 'outline',
label: 'Outline', label: 'Outline',
}); });
}); };
/** /**
* Accept module updates * Initialize
* *
* @see https://webpack.js.org/api/hot-module-replacement * @see https://webpack.js.org/api/hot-module-replacement
*/ */
import.meta.webpackHot?.accept(console.error); domReady(main);
import.meta.webpackHot?.accept(main);

View File

@@ -22,14 +22,7 @@
}, },
"spacing": { "spacing": {
"padding": true, "padding": true,
"units": [ "units": ["px", "%", "em", "rem", "vw", "vh"]
"px",
"%",
"em",
"rem",
"vw",
"vh"
]
}, },
"typography": { "typography": {
"customFontSize": false "customFontSize": false

965
yarn.lock

File diff suppressed because it is too large Load Diff