Skip to content

Commit b0e2dfd

Browse files
WIP
1 parent bd2dd31 commit b0e2dfd

File tree

19 files changed

+1085
-97
lines changed

19 files changed

+1085
-97
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
"generoi/wp-image-resizer": "^1.0",
8181
"spatie/laravel-csp": "^2.10",
8282
"10up/wpcli-vulnerability-scanner": "^1.2",
83-
"wpackagist-plugin/woo-ajax-add-to-cart": "^2.4"
83+
"wpackagist-plugin/woo-ajax-add-to-cart": "^2.4",
84+
"generoi/sage-cachetags": "^1.2"
8485
},
8586
"require-dev": {
8687
"brainmaestro/composer-git-hooks": "^3.0.0",

composer.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 26 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"private": true,
44
"type": "module",
55
"workspaces": [
6-
"web/app/themes/gds"
6+
"web/app/themes/gds",
7+
"web/app/plugins/genero-woocommerce"
78
],
89
"scripts": {
910
"build": "npm run build -ws",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {relative} from 'node:path';
2+
import BudBlock from '../../themes/gds/build/bud-block.js';
3+
4+
/**
5+
* @type {import('@roots/bud').Config}
6+
*/
7+
export default async (app) => {
8+
await app.extensions.add(BudBlock);
9+
app
10+
.entry('app', ['styles/woocommerce'])
11+
.setPath({'@styles': `../../themes/gds/resources/styles`});
12+
13+
await Promise.all(
14+
app.globSync('resources/blocks/*/*.json').map(async (file) => {
15+
return app.block(relative(app.path('@src'), file));
16+
}),
17+
);
18+
19+
app.when(app.isProduction, app.hash);
20+
app.build.items.precss.setLoader('minicss');
21+
app.hooks.on(
22+
`build.output.uniqueName`,
23+
() => '@roots/bud/genero-woocommerce',
24+
);
25+
app.extensions.get('@roots/bud-eslint').setUseEslintrc(true);
26+
app.hooks.action('build.before', (bud) => {
27+
bud.extensions
28+
.get('@roots/bud-extensions/mini-css-extract-plugin')
29+
.enable();
30+
});
31+
};

web/app/plugins/genero-woocommerce/genero-woocommerce.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
License: MIT License
1010
License URI: http://opensource.org/licenses/MIT
1111
*/
12+
1213
use GeneroWoo\Woocommerce\Plugin;
13-
if (! defined('ABSPATH')) {
14-
exit;
14+
15+
if (! is_blog_installed()) {
16+
return;
1517
}
18+
1619
Plugin::getInstance();
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "genero-woocommerce",
3+
"private": true,
4+
"browserslist": [
5+
"extends @roots/browserslist-config/wordpress"
6+
],
7+
"type": "module",
8+
"packageManager": "npm@10.8.2",
9+
"scripts": {
10+
"build": "bud build production --no-minimize",
11+
"build:production": "bud build production",
12+
"start": "bud build development",
13+
"test": "node --no-warnings --run lint",
14+
"lint": "node --no-warnings --run lint:prettier && node --no-warnings --run lint:js && node --no-warnings --run lint:css",
15+
"lint:js": "eslint resources",
16+
"lint:css": "stylelint \"resources/**/*.{css,scss,vue}\"",
17+
"lint:prettier": "prettier . --check",
18+
"lint:fix": "node --no-warnings --run lint:fix:prettier && node --no-warnings --run lint:fix:js && node --no-warnings --run lint:fix:css",
19+
"lint:fix:prettier": "prettier . --write --list-different",
20+
"lint:fix:js": "node --no-warnings --run lint:js -- --fix",
21+
"lint:fix:css": "node --no-warnings --run lint:css -- --fix",
22+
"ci:scripts": "eslint resources/scripts --format checkstyle",
23+
"ci:styles": "stylelint -f json \"resources/**/*.{vue,css,sass,scss,less}\" 2>&1 | npx stylelint-checkstyle-reporter",
24+
"translate": "node --no-warnings --run translate:pot && node --no-warnings --run translate:js",
25+
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include=\"app,resources\"",
26+
"translate:js": "wp i18n make-json ./resources/lang --pretty-print"
27+
},
28+
"devDependencies": {
29+
"@roots/bud": "^6.23.3",
30+
"@roots/bud-eslint": "^6.23.3",
31+
"@roots/bud-postcss": "^6.23.3",
32+
"@roots/bud-prettier": "^6.23.3",
33+
"@roots/bud-sass": "^6.23.3",
34+
"@roots/bud-stylelint": "^6.23.3",
35+
"@roots/eslint-config": "^6.23.3",
36+
"@roots/sage": "^6.23.3",
37+
"@shufo/prettier-plugin-blade": "^1.14.1",
38+
"postcss-inline-svg": "^6.0.0",
39+
"postcss-preset-env": "^10.0.2",
40+
"stylelint-checkstyle-reporter": "^1.0.0",
41+
"stylelint-config-standard-scss": "^13.1.0"
42+
},
43+
"dependencies": {
44+
"@types/wordpress__blocks": "^12.5.14"
45+
}
46+
}

0 commit comments

Comments
 (0)