@@ -7,6 +7,7 @@ insert_final_newline = true
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
quote_type = single
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
88
bud.config.js
Normal file
88
bud.config.js
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
/**
|
||||||
|
* Build configuration
|
||||||
|
*
|
||||||
|
* @see {@link https://roots.io/docs/sage/ sage documentation}
|
||||||
|
* @see {@link https://bud.js.org/guides/configure/ bud.js configuration guide}
|
||||||
|
*
|
||||||
|
* @typedef {import('@roots/bud').Bud} Bud
|
||||||
|
* @param {Bud} app
|
||||||
|
*/
|
||||||
|
export default async (app) => {
|
||||||
|
/**
|
||||||
|
* Application entrypoints
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.entry/}
|
||||||
|
*/
|
||||||
|
app
|
||||||
|
.entry({
|
||||||
|
app: ['@scripts/app', '@styles/app'],
|
||||||
|
editor: ['@scripts/editor', '@styles/editor'],
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Directory contents to be included in the compilation
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.assets/}
|
||||||
|
*/
|
||||||
|
.assets(['images'])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Matched files trigger a page reload when modified
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.watch/}
|
||||||
|
*/
|
||||||
|
.watch(['resources/views', 'app'])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxy origin (`WP_HOME`)
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.proxy/}
|
||||||
|
*/
|
||||||
|
.proxy('http://example.test')
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Development origin
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.serve/}
|
||||||
|
*/
|
||||||
|
.serve('http://0.0.0.0:3000')
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URI of the `public` directory
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.setPublicPath/}
|
||||||
|
*/
|
||||||
|
.setPublicPath('/app/themes/sage/public/')
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate WordPress `theme.json`
|
||||||
|
*
|
||||||
|
* @note This overwrites `theme.json` on every build.
|
||||||
|
*
|
||||||
|
* @see {@link https://bud.js.org/extensions/sage/theme.json/}
|
||||||
|
* @see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/}
|
||||||
|
*/
|
||||||
|
.wpjson.settings({
|
||||||
|
color: {
|
||||||
|
custom: false,
|
||||||
|
customDuotone: false,
|
||||||
|
customGradient: false,
|
||||||
|
defaultDuotone: false,
|
||||||
|
defaultGradients: false,
|
||||||
|
defaultPalette: false,
|
||||||
|
duotone: [],
|
||||||
|
},
|
||||||
|
custom: {
|
||||||
|
spacing: {},
|
||||||
|
typography: {
|
||||||
|
'font-size': {},
|
||||||
|
'line-height': {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
spacing: {
|
||||||
|
padding: true,
|
||||||
|
units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
|
||||||
|
},
|
||||||
|
typography: {
|
||||||
|
customFontSize: false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.useTailwindColors()
|
||||||
|
.useTailwindFontFamily()
|
||||||
|
.useTailwindFontSize()
|
||||||
|
.enable();
|
||||||
|
};
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build configuration
|
|
||||||
*
|
|
||||||
* @see {@link https://bud.js.org/guides/configure}
|
|
||||||
* @param {import('@roots/bud').Bud} app
|
|
||||||
*/
|
|
||||||
export default async (app) => {
|
|
||||||
app
|
|
||||||
/**
|
|
||||||
* Application entrypoints
|
|
||||||
*/
|
|
||||||
.entry({
|
|
||||||
app: ["@scripts/app", "@styles/app"],
|
|
||||||
editor: ["@scripts/editor", "@styles/editor"],
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Directory contents to be included in the compilation
|
|
||||||
*/
|
|
||||||
.assets(["images"])
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Matched files trigger a page reload when modified
|
|
||||||
*/
|
|
||||||
.watch(["resources/views/**/*", "app/**/*"])
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Proxy origin (`WP_HOME`)
|
|
||||||
*/
|
|
||||||
.proxy("http://example.test")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Development origin
|
|
||||||
*/
|
|
||||||
.serve("http://0.0.0.0:3000")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URI of the `public` directory
|
|
||||||
*/
|
|
||||||
.setPublicPath("/app/themes/sage/public/")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate WordPress `theme.json`
|
|
||||||
*
|
|
||||||
* @note This overwrites `theme.json` on every build.
|
|
||||||
*/
|
|
||||||
.wpjson
|
|
||||||
.settings({
|
|
||||||
color: {
|
|
||||||
custom: false,
|
|
||||||
customDuotone: false,
|
|
||||||
customGradient: false,
|
|
||||||
defaultDuotone: false,
|
|
||||||
defaultGradients: false,
|
|
||||||
defaultPalette: false,
|
|
||||||
duotone: [],
|
|
||||||
},
|
|
||||||
custom: {
|
|
||||||
spacing: {},
|
|
||||||
typography: {
|
|
||||||
'font-size': {},
|
|
||||||
'line-height': {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
spacing: {
|
|
||||||
padding: true,
|
|
||||||
units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
|
|
||||||
},
|
|
||||||
typography: {
|
|
||||||
customFontSize: false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.useTailwindColors()
|
|
||||||
.useTailwindFontFamily()
|
|
||||||
.useTailwindFontSize()
|
|
||||||
.enable()
|
|
||||||
};
|
|
||||||
@@ -1,19 +1,15 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "@roots/sage/config/jsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"baseUrl": "resources",
|
"baseUrl": "resources",
|
||||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"jsx": "preserve",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@fonts/*": ["fonts/*"],
|
"@fonts/*": ["fonts/*"],
|
||||||
"@images/*": ["images/*"],
|
"@images/*": ["images/*"],
|
||||||
"@scripts/*": ["scripts/*"],
|
"@scripts/*": ["scripts/*"],
|
||||||
"@styles/*": ["styles/*"]
|
"@styles/*": ["styles/*"]
|
||||||
},
|
},
|
||||||
"target": "es5"
|
"types": ["@roots/bud", "@roots/sage", "@roots/bud-tailwindcss"]
|
||||||
},
|
},
|
||||||
"include": ["bud.config.mjs", "resources"],
|
"include": ["bud.config.js", "resources"],
|
||||||
"exclude": ["public"]
|
"exclude": ["node_modules", "public"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
"name": "sage",
|
"name": "sage",
|
||||||
"private": true,
|
"private": true,
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"extends @roots/browserslist-config/current"
|
"extends @roots/browserslist-config"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
},
|
},
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bud dev",
|
"dev": "bud dev",
|
||||||
"build": "bud build",
|
"build": "bud build",
|
||||||
@@ -18,8 +19,8 @@
|
|||||||
"translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
|
"translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@roots/bud": "6.6.2",
|
"@roots/bud": "6.6.9",
|
||||||
"@roots/bud-tailwindcss": "6.6.2",
|
"@roots/bud-tailwindcss": "6.6.9",
|
||||||
"@roots/sage": "6.6.2"
|
"@roots/sage": "6.6.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
import {domReady} from '@roots/sage/client';
|
import domReady from '@roots/sage/client/dom-ready';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* app.main
|
* Application entrypoint
|
||||||
*/
|
*/
|
||||||
const main = async (err) => {
|
domReady(async () => {
|
||||||
if (err) {
|
// ...
|
||||||
// handle hmr errors
|
});
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
// application code
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize
|
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
|
||||||
*
|
|
||||||
* @see https://webpack.js.org/api/hot-module-replacement
|
|
||||||
*/
|
*/
|
||||||
domReady(main);
|
import.meta.webpackHot?.accept(console.error);
|
||||||
import.meta.webpackHot?.accept(main);
|
|
||||||
|
|||||||
@@ -1,27 +1,19 @@
|
|||||||
import {domReady} from '@roots/sage/client';
|
import domReady from '@roots/sage/client/dom-ready';
|
||||||
import {registerBlockStyle, unregisterBlockStyle} from '@wordpress/blocks';
|
import { registerBlockStyle, unregisterBlockStyle } from '@wordpress/blocks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* editor.main
|
* Editor entrypoint
|
||||||
*/
|
*/
|
||||||
const main = (err) => {
|
domReady(() => {
|
||||||
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',
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize
|
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
|
||||||
*
|
|
||||||
* @see https://webpack.js.org/api/hot-module-replacement
|
|
||||||
*/
|
*/
|
||||||
domReady(main);
|
import.meta.webpackHot?.accept(console.error);
|
||||||
import.meta.webpackHot?.accept(main);
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// https://tailwindcss.com/docs/configuration
|
// https://tailwindcss.com/docs/configuration
|
||||||
module.exports = {
|
module.exports = {
|
||||||
content: ["./index.php", "./app/**/*.php", "./resources/**/*.{php,vue,js}"],
|
content: ['./index.php', './app/**/*.php', './resources/**/*.{php,vue,js}'],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
colors: {}, // Extend Tailwind's default colors
|
colors: {}, // Extend Tailwind's default colors
|
||||||
|
|||||||
11
theme.json
11
theme.json
@@ -5,9 +5,12 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"color": {
|
"color": {
|
||||||
"custom": false,
|
"custom": false,
|
||||||
|
"customDuotone": false,
|
||||||
"customGradient": false,
|
"customGradient": false,
|
||||||
"defaultPalette": false,
|
"defaultDuotone": false,
|
||||||
"defaultGradients": false,
|
"defaultGradients": false,
|
||||||
|
"defaultPalette": false,
|
||||||
|
"duotone": [],
|
||||||
"palette": [
|
"palette": [
|
||||||
{
|
{
|
||||||
"name": "Inherit",
|
"name": "Inherit",
|
||||||
@@ -1158,17 +1161,17 @@
|
|||||||
"customFontSize": false,
|
"customFontSize": false,
|
||||||
"fontFamilies": [
|
"fontFamilies": [
|
||||||
{
|
{
|
||||||
"name": "ui-sans-serif",
|
"name": "Ui-sans-serif",
|
||||||
"slug": "sans",
|
"slug": "sans",
|
||||||
"fontFamily": "ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\""
|
"fontFamily": "ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ui-serif",
|
"name": "Ui-serif",
|
||||||
"slug": "serif",
|
"slug": "serif",
|
||||||
"fontFamily": "ui-serif,Georgia,Cambria,\"Times New Roman\",Times,serif"
|
"fontFamily": "ui-serif,Georgia,Cambria,\"Times New Roman\",Times,serif"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ui-monospace",
|
"name": "Ui-monospace",
|
||||||
"slug": "mono",
|
"slug": "mono",
|
||||||
"fontFamily": "ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace"
|
"fontFamily": "ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user