wp-advads 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@ import { getSemVer } from './semver.js'
|
|
|
16
16
|
import { githubPreTasks, githubFinalTasks } from './github.js'
|
|
17
17
|
import { updateComposer } from './composer.js'
|
|
18
18
|
import { updateVersionNumber } from './change-version.js'
|
|
19
|
+
import { buildAssets } from './webpack.js'
|
|
19
20
|
|
|
20
21
|
export const pluginData = {
|
|
21
22
|
commitMessages: [],
|
|
@@ -46,7 +47,8 @@ export default function(args) {
|
|
|
46
47
|
getSemVer,
|
|
47
48
|
githubPreTasks,
|
|
48
49
|
updateComposer,
|
|
49
|
-
wpPot,
|
|
50
|
+
// wpPot,
|
|
51
|
+
buildAssets,
|
|
50
52
|
updateTranslations,
|
|
51
53
|
updateVersionNumber,
|
|
52
54
|
updateChangelog,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External Dependencies
|
|
3
|
+
*/
|
|
4
|
+
import logSymbols from 'log-symbols'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal Dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { pluginData } from './index.js'
|
|
10
|
+
import { heading, execCommand } from "../../utilities/index.js"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Execute routine to run webpack
|
|
14
|
+
*/
|
|
15
|
+
export function buildAssets( next ) {
|
|
16
|
+
heading('Building assets')
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
execCommand(
|
|
20
|
+
'npm run build',
|
|
21
|
+
() => {
|
|
22
|
+
pluginData.commitMessages.push('update CSS, JS and POT files')
|
|
23
|
+
console.log( logSymbols.success + ' Assets successfully generated!' )
|
|
24
|
+
next()
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
} catch {
|
|
28
|
+
throw new Error( logSymbols.error + ' Error' )
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -23,23 +23,31 @@ class WordPressPot {
|
|
|
23
23
|
domain,
|
|
24
24
|
skipJS = false,
|
|
25
25
|
exclude = [],
|
|
26
|
+
headers = {
|
|
27
|
+
'Last-Translator': 'Thomas Maier <post@webzunft.de>',
|
|
28
|
+
'Language-Team': 'webgilde <support@wpadvancedads.com>',
|
|
29
|
+
},
|
|
26
30
|
} = this.config;
|
|
27
31
|
|
|
28
|
-
exclude.push(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exclude.push(
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
exclude.push('.github');
|
|
33
|
+
exclude.push('.husky');
|
|
34
|
+
exclude.push('.wordpress-org');
|
|
35
|
+
exclude.push('node_modules');
|
|
36
|
+
exclude.push('packages');
|
|
37
|
+
exclude.push('tools');
|
|
38
|
+
exclude.push('vendor');
|
|
35
39
|
|
|
36
40
|
const rootPath = process.cwd();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const command = [
|
|
42
|
+
'wp i18n make-pot',
|
|
43
|
+
rootPath,
|
|
44
|
+
rootPath + output + file,
|
|
45
|
+
`--domain=${domain}`,
|
|
46
|
+
`--exclude=${exclude.join(',')}`,
|
|
47
|
+
`--headers='${JSON.stringify(headers)}'`,
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
sh.exec(command.join(' '));
|
|
43
51
|
if (false !== skipJS) {
|
|
44
52
|
sh.exec(`wp i18n make-json ${rootPath}${output}`, { silent: true });
|
|
45
53
|
}
|