-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpdk.config.js
More file actions
51 lines (46 loc) · 1.32 KB
/
pdk.config.js
File metadata and controls
51 lines (46 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { defineConfig } from '@myparcel-dev/pdk-app-builder';
import { downloadCarrierLogos } from './private/downloadCarrierLogos.js';
import { spawnSync } from 'node:child_process';
export default defineConfig({
name: 'myparcel-prestashop',
buildFolderName: 'myparcelnl', // for backwards compatibility
source: [
'!**/node_modules/**',
// Php files will be copied after scoping
'mails/**/*',
'private/carrier-logos/**/*',
'views/PrestaShop/**/*',
'views/js/**/dist/**/*',
'views/templates/**/*',
'CONTRIBUTING.md',
'LICENSE.txt',
'README.md',
'logo.png',
],
versionSource: [{ path: 'package.json' }, { path: 'composer.json' }],
translations: {
// eslint-disable-next-line no-magic-numbers
additionalSheet: 279275153,
},
hooks: {
/**
* Download carrier logos and build the frontend.
*/
async beforeCopy({ context }) {
await downloadCarrierLogos(context);
const buffer = spawnSync('yarn', ['nx', 'run-many', '--target=build', '--output-style=stream'], {
stdio: 'inherit',
});
if (buffer.status !== 0) {
throw new Error('Build failed.');
}
},
},
additionalCommands: [
{
name: 'download-carrier-logos',
description: 'Download carrier logos',
action: downloadCarrierLogos,
},
],
});