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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "wp-advads",
4
- "version": "1.0.13",
4
+ "version": "1.0.14",
5
5
  "description": "Create a Advanced Ads wordPress plugin eco system.",
6
6
  "author": {
7
7
  "name": "Shakeeb Ahmed",
@@ -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(".github");
29
- exclude.push(".husky");
30
- exclude.push(".wordpress-org");
31
- exclude.push("node_modules");
32
- exclude.push("packages");
33
- exclude.push("tools");
34
- exclude.push("vendor");
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
- sh.exec(
39
- `wp i18n make-pot ${rootPath} ${rootPath}${output}${file} --domain=${domain} --exclude=${exclude.join(
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
  }