Skip to content

Commit c3fb565

Browse files
committed
update build workflow
1 parent 7943223 commit c3fb565

File tree

10 files changed

+753
-2115
lines changed

10 files changed

+753
-2115
lines changed

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 0 additions & 546 deletions
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

.yarn/releases/yarn-3.2.1.cjs

Lines changed: 0 additions & 786 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
]
1010
},
1111
"scripts": {
12+
"clean": "node scripts/clean-node-modules",
1213
"wp-env": "wp-env",
1314
"lint:php": "composer run lint-report | cs2pr",
1415
"test": "pnpm run test:unit:php",

packages/analytics/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@wcpos/analytics",
33
"scripts": {
4-
"build": "NODE_ENV=production ../../node_modules/.bin/webpack",
5-
"start": "../../node_modules/.bin/webpack --watch"
4+
"build": "NODE_ENV=production node_modules/.bin/webpack",
5+
"start": "node_modules/.bin/webpack --watch"
66
},
77
"dependencies": {
88
"@tanstack/react-query": "^5.45.0",

packages/settings/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@wcpos/settings",
33
"scripts": {
4-
"build": "NODE_ENV=production ../../node_modules/.bin/webpack",
5-
"start": "../../node_modules/.bin/webpack --watch"
4+
"build": "NODE_ENV=production node_modules/.bin/webpack",
5+
"start": "node_modules/.bin/webpack --watch"
66
},
77
"dependencies": {
88
"@headlessui/react": "^2.0.4",

pnpm-lock.yaml

Lines changed: 689 additions & 731 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/clean-node-modules.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
const fs = require('fs');
2+
const { exec } = require('child_process');
3+
// const { rm } = require('./utils/file-actions');
4+
5+
const cwd = process.cwd();
6+
7+
const rm = (path) => {
8+
if (fs.existsSync(path)) {
9+
exec(`rm -r ${path}`, (err) => {
10+
if (err) {
11+
console.log(err);
12+
}
13+
});
14+
}
15+
};
16+
17+
const clean = (dir) => {
18+
rm(`${dir}/node_modules`);
19+
rm(`${dir}/build`);
20+
rm(`${dir}/dist`);
21+
rm(`${dir}/vendor`);
22+
rm(`${dir}/pnpm-lock.yaml`);
23+
};
24+
25+
const cleanRoot = () => clean(cwd);
26+
27+
const cleanWorkSpaces = () => {
28+
const workspaces = ['./packages'];
29+
30+
workspaces.forEach((workspace) => {
31+
fs.readdir(workspace, (err, folders) => {
32+
folders.forEach((folder) => {
33+
clean(`${cwd}/${workspace}/${folder}`);
34+
});
35+
36+
if (err) {
37+
throw err;
38+
}
39+
});
40+
});
41+
};
42+
43+
cleanRoot();
44+
cleanWorkSpaces();

templates/receipt.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,27 @@
284284
?></td>
285285
</tr>
286286
<?php } ?>
287-
<?php
288-
// Only show tax rows if we're showing prices excluding tax
289-
if ( 'excl' === $tax_display && wc_tax_enabled() ) {
290-
if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) {
291-
foreach ( $order->get_tax_totals() as $code => $tax ) { ?>
287+
<?php if ( wc_tax_enabled() ) : ?>
288+
<?php
289+
$tax_display = get_option( 'woocommerce_tax_display_cart' );
290+
$tax_suffix = ( 'incl' === $tax_display )
291+
? ' ' . esc_html__('(incl. tax)', 'woocommerce')
292+
: ' ' . esc_html__('(excl. tax)', 'woocommerce');
293+
?>
294+
<?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) { ?>
295+
<?php foreach ( $order->get_tax_totals() as $code => $tax ) { ?>
292296
<tr>
293-
<th colspan="3"><?php echo esc_html( $tax->label ); ?></th>
297+
<th colspan="3"><?php echo esc_html( $tax->label ) . $tax_suffix; ?></th>
294298
<td><?php echo wp_kses_post( wc_price( $tax->amount ) ); ?></td>
295299
</tr>
296-
<?php }
297-
} else { ?>
300+
<?php } ?>
301+
<?php } else { ?>
298302
<tr>
299-
<th colspan="3"><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
303+
<th colspan="3"><?php echo esc_html( WC()->countries->tax_or_vat() ) . $tax_suffix; ?></th>
300304
<td><?php echo wp_kses_post( wc_price( $order->get_total_tax() ) ); ?></td>
301305
</tr>
302-
<?php }
303-
} ?>
306+
<?php } ?>
307+
<?php endif; ?>
304308
<tr>
305309
<th colspan="3"><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
306310
<td><?php echo wp_kses_post( wc_price( $order->get_total() ) ); ?></td>

0 commit comments

Comments
 (0)