@wp-blocks/make-pot 1.6.4 → 1.6.6

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.
Files changed (55) hide show
  1. package/README.md +2 -2
  2. package/lib/assets/block-i18n.js +41 -1
  3. package/lib/assets/package-i18n.js +38 -1
  4. package/lib/assets/theme-i18n.js +110 -1
  5. package/lib/assets/wp-plugin-i18n.js +39 -1
  6. package/lib/assets/wp-theme-i18n.js +37 -1
  7. package/lib/cli/getArgs.js +156 -1
  8. package/lib/cli/getArgs.js.map +2 -2
  9. package/lib/cli/getJsonArgs.js +82 -1
  10. package/lib/cli/parseCli.js +179 -1
  11. package/lib/cli.js +43 -1
  12. package/lib/const.js +111 -1
  13. package/lib/const.js.map +1 -1
  14. package/lib/extractors/auditStrings.js +177 -6
  15. package/lib/extractors/auditStrings.js.map +2 -2
  16. package/lib/extractors/css.js +69 -1
  17. package/lib/extractors/headers.js +253 -15
  18. package/lib/extractors/headers.js.map +2 -2
  19. package/lib/extractors/json.js +70 -1
  20. package/lib/extractors/packageJson.js +55 -1
  21. package/lib/extractors/php.js +79 -2
  22. package/lib/extractors/php.js.map +2 -2
  23. package/lib/extractors/schema.js +217 -3
  24. package/lib/extractors/text.js +41 -1
  25. package/lib/fs/fs.js +114 -2
  26. package/lib/fs/glob.js +103 -1
  27. package/lib/fs/glob.js.map +2 -2
  28. package/lib/index.js +64 -1
  29. package/lib/jsonCommand.js +51 -1
  30. package/lib/makeJson.js +28 -1
  31. package/lib/makePot.js +27 -1
  32. package/lib/parser/exec.js +94 -3
  33. package/lib/parser/exec.js.map +2 -2
  34. package/lib/parser/makeJson.js +393 -1
  35. package/lib/parser/makePot.js +48 -1
  36. package/lib/parser/patterns.js +54 -1
  37. package/lib/parser/process.js +85 -1
  38. package/lib/parser/process.js.map +2 -2
  39. package/lib/parser/progress.js +57 -1
  40. package/lib/parser/progress.js.map +2 -2
  41. package/lib/parser/taskRunner.js +65 -2
  42. package/lib/parser/taskRunner.js.map +2 -2
  43. package/lib/parser/tree.js +228 -2
  44. package/lib/parser/tree.js.map +2 -2
  45. package/lib/potCommand.js +36 -1
  46. package/lib/potCommand.js.map +2 -2
  47. package/lib/types.js +17 -1
  48. package/lib/types.js.map +1 -1
  49. package/lib/utils/common.js +161 -8
  50. package/lib/utils/common.js.map +2 -2
  51. package/lib/utils/extractors.js +69 -1
  52. package/lib/utils/output.js +59 -1
  53. package/lib/utils/output.js.map +3 -3
  54. package/package.json +3 -3
  55. package/tests/parse-php.test.js +47 -0
package/README.md CHANGED
@@ -70,15 +70,15 @@ npx @wp-blocks/make-pot src languages --charset='utf-8' --include="src/**/*.{ts,
70
70
  - `--package-name <name>`: Specifies the package name.
71
71
  - `--location`: Includes location information in the `.pot` file.
72
72
  - `--ignore-domain`: Ignores text domain in the processing.
73
+ - `--translation-domains`: Restrict to specific translation domains.
73
74
  - `--mergePaths <paths>`: Merges with existing POT file(s).
74
75
  - `--subtractPaths <paths>`: Subtracts strings from existing POT file(s).
75
76
  - `--subtractAndMerge`: Subtracts and merges strings from existing POT file(s).
76
77
  - `--include <files>`: Includes specific files for processing.
77
78
  - `--exclude <files>`: Excludes specific files from processing.
78
- - `--silent`: Suppresses output to stdout.
79
+ - `--silent`: Suppresses verbose output to stdout.
79
80
  - `--json`: Outputs the JSON gettext data.
80
81
  - `--charset`: Defines the encoding charset of the pot file, you can choose "iso-8859-1" and "uft-8" (defaults to iso-8859-1)
81
- - `--translation-domains`: Restrict to specific translation domains.
82
82
  - `--output`: Outputs the gettext data.
83
83
 
84
84
  ### Example usage
@@ -1 +1,41 @@
1
- "use strict";var l=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var s=(o,i)=>{for(var e in i)l(o,e,{get:i[e],enumerable:!0})},b=(o,i,e,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of c(i))!k.call(o,t)&&t!==e&&l(o,t,{get:()=>i[t],enumerable:!(r=a(i,t))||r.enumerable});return o};var d=o=>b(l({},"__esModule",{value:!0}),o);var y={};s(y,{default:()=>n});module.exports=d(y);var n={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var block_i18n_exports = {};
20
+ __export(block_i18n_exports, {
21
+ default: () => block_i18n_default
22
+ });
23
+ module.exports = __toCommonJS(block_i18n_exports);
24
+ var block_i18n_default = {
25
+ title: "block title",
26
+ description: "block description",
27
+ keywords: ["block keyword"],
28
+ styles: [
29
+ {
30
+ label: "block style label"
31
+ }
32
+ ],
33
+ variations: [
34
+ {
35
+ title: "block variation title",
36
+ description: "block variation description",
37
+ keywords: ["block variation keyword"]
38
+ }
39
+ ]
40
+ };
41
+ //# sourceMappingURL=block-i18n.js.map
@@ -1 +1,38 @@
1
- "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(s,r)=>{for(var e in r)o(s,e,{get:r[e],enumerable:!0})},b=(s,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of t(r))!l.call(s,u)&&u!==e&&o(s,u,{get:()=>r[u],enumerable:!(i=a(r,u))||i.enumerable});return s};var g=s=>b(o({},"__esModule",{value:!0}),s);var m={};n(m,{default:()=>h});module.exports=g(m);var h={name:"name",url:"url",description:"description",author:"author",authors:"authors",authorEmail:"authorEmail",version:"version",bugs:"bugs","bugs.url":"bugsUrl","bugs.email":"bugsEmail",license:"license",repository:"repository"};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var package_i18n_exports = {};
20
+ __export(package_i18n_exports, {
21
+ default: () => package_i18n_default
22
+ });
23
+ module.exports = __toCommonJS(package_i18n_exports);
24
+ var package_i18n_default = {
25
+ name: "name",
26
+ url: "url",
27
+ description: "description",
28
+ author: "author",
29
+ authors: "authors",
30
+ authorEmail: "authorEmail",
31
+ version: "version",
32
+ bugs: "bugs",
33
+ "bugs.url": "bugsUrl",
34
+ "bugs.email": "bugsEmail",
35
+ license: "license",
36
+ repository: "repository"
37
+ };
38
+ //# sourceMappingURL=package-i18n.js.map
@@ -1 +1,110 @@
1
- "use strict";var m=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var p=(a,e)=>{for(var t in e)m(a,t,{get:e[t],enumerable:!0})},r=(a,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!l.call(a,n)&&n!==t&&m(a,n,{get:()=>e[n],enumerable:!(i=o(e,n))||i.enumerable});return a};var c=a=>r(m({},"__esModule",{value:!0}),a);var z={};p(z,{default:()=>g});module.exports=c(z);var g={title:"Style variation name",settings:{typography:{fontSizes:[{name:"Font size name"}],fontFamilies:[{name:"Font family name"}]},color:{palette:[{name:"Color name"}],gradients:[{name:"Gradient name"}],duotone:[{name:"Duotone name"}]},spacing:{spacingSizes:[{name:"Space size name"}]},blocks:{"*":{typography:{fontSizes:[{name:"Font size name"}],fontFamilies:[{name:"Font family name"}]},color:{palette:[{name:"Color name"}],gradients:[{name:"Gradient name"}]},spacing:{spacingSizes:[{name:"Space size name"}]}}}},customTemplates:[{title:"Custom template name"}],templateParts:[{title:"Template part name"}]};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var theme_i18n_exports = {};
20
+ __export(theme_i18n_exports, {
21
+ default: () => theme_i18n_default
22
+ });
23
+ module.exports = __toCommonJS(theme_i18n_exports);
24
+ var theme_i18n_default = {
25
+ title: "Style variation name",
26
+ settings: {
27
+ typography: {
28
+ fontSizes: [
29
+ {
30
+ name: "Font size name"
31
+ }
32
+ ],
33
+ fontFamilies: [
34
+ {
35
+ name: "Font family name"
36
+ }
37
+ ]
38
+ },
39
+ color: {
40
+ palette: [
41
+ {
42
+ name: "Color name"
43
+ }
44
+ ],
45
+ gradients: [
46
+ {
47
+ name: "Gradient name"
48
+ }
49
+ ],
50
+ duotone: [
51
+ {
52
+ name: "Duotone name"
53
+ }
54
+ ]
55
+ },
56
+ spacing: {
57
+ spacingSizes: [
58
+ {
59
+ name: "Space size name"
60
+ }
61
+ ]
62
+ },
63
+ blocks: {
64
+ "*": {
65
+ typography: {
66
+ fontSizes: [
67
+ {
68
+ name: "Font size name"
69
+ }
70
+ ],
71
+ fontFamilies: [
72
+ {
73
+ name: "Font family name"
74
+ }
75
+ ]
76
+ },
77
+ color: {
78
+ palette: [
79
+ {
80
+ name: "Color name"
81
+ }
82
+ ],
83
+ gradients: [
84
+ {
85
+ name: "Gradient name"
86
+ }
87
+ ]
88
+ },
89
+ spacing: {
90
+ spacingSizes: [
91
+ {
92
+ name: "Space size name"
93
+ }
94
+ ]
95
+ }
96
+ }
97
+ }
98
+ },
99
+ customTemplates: [
100
+ {
101
+ title: "Custom template name"
102
+ }
103
+ ],
104
+ templateParts: [
105
+ {
106
+ title: "Template part name"
107
+ }
108
+ ]
109
+ };
110
+ //# sourceMappingURL=theme-i18n.js.map
@@ -1 +1,39 @@
1
- "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var l=(i,e)=>{for(var t in e)a(i,t,{get:e[t],enumerable:!0})},U=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u(e))!s.call(i,n)&&n!==t&&a(i,n,{get:()=>e[n],enumerable:!(o=r(e,n))||o.enumerable});return i};var g=i=>U(a({},"__esModule",{value:!0}),i);var h={};l(h,{default:()=>c});module.exports=g(h);var c={name:"Plugin Name",slug:"Plugin Slug",url:"Plugin URI",description:"Description",version:"Version",author:"Author",authorUri:"Author URI",tags:"Tags",license:"License",licenseUri:"License URI",updateUri:"Update URI",domainPath:"Domain Path",textDomain:"Text Domain"};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var wp_plugin_i18n_exports = {};
20
+ __export(wp_plugin_i18n_exports, {
21
+ default: () => wp_plugin_i18n_default
22
+ });
23
+ module.exports = __toCommonJS(wp_plugin_i18n_exports);
24
+ var wp_plugin_i18n_default = {
25
+ name: "Plugin Name",
26
+ slug: "Plugin Slug",
27
+ url: "Plugin URI",
28
+ description: "Description",
29
+ version: "Version",
30
+ author: "Author",
31
+ authorUri: "Author URI",
32
+ tags: "Tags",
33
+ license: "License",
34
+ licenseUri: "License URI",
35
+ updateUri: "Update URI",
36
+ domainPath: "Domain Path",
37
+ textDomain: "Text Domain"
38
+ };
39
+ //# sourceMappingURL=wp-plugin-i18n.js.map
@@ -1 +1,37 @@
1
- "use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var m=(i,e)=>{for(var a in e)n(i,a,{get:e[a],enumerable:!0})},c=(i,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!h.call(i,t)&&t!==a&&n(i,t,{get:()=>e[t],enumerable:!(o=r(e,t))||o.enumerable});return i};var u=i=>c(n({},"__esModule",{value:!0}),i);var l={};m(l,{default:()=>U});module.exports=u(l);var U={name:"Theme Name",author:"Author",authorUri:"Author URI",description:"Description",url:"Theme URI",tags:"Tags",version:"Version",license:"License",licenseUri:"License URI",domainPath:"Domain Path",textDomain:"Text Domain"};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var wp_theme_i18n_exports = {};
20
+ __export(wp_theme_i18n_exports, {
21
+ default: () => wp_theme_i18n_default
22
+ });
23
+ module.exports = __toCommonJS(wp_theme_i18n_exports);
24
+ var wp_theme_i18n_default = {
25
+ name: "Theme Name",
26
+ author: "Author",
27
+ authorUri: "Author URI",
28
+ description: "Description",
29
+ url: "Theme URI",
30
+ tags: "Tags",
31
+ version: "Version",
32
+ license: "License",
33
+ licenseUri: "License URI",
34
+ domainPath: "Domain Path",
35
+ textDomain: "Text Domain"
36
+ };
37
+ //# sourceMappingURL=wp-theme-i18n.js.map
@@ -1 +1,156 @@
1
- "use strict";var d=Object.create;var o=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})},n=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of g(t))!m.call(e,s)&&s!==i&&o(e,s,{get:()=>t[s],enumerable:!(r=b(t,s))||r.enumerable});return e};var a=(e,t,i)=>(i=e!=null?d(u(e)):{},n(t||!e||!e.__esModule?o(i,"default",{value:e,enumerable:!0}):i,e)),y=e=>n(o({},"__esModule",{value:!0}),e);var S={};f(S,{getArgs:()=>k});module.exports=y(S);var c=a(require("node:process")),h=a(require("yargs")),l=require("yargs/helpers"),p=require("./parseCli.js");function k(e={}){const t=h.default((0,l.hideBin)(c.default.argv)).help("h").alias("help","help").usage("Usage: $0 <source> [destination] [options]").positional("sourceDirectory",{describe:"Source directory",type:"string"}).positional("destination",{describe:"Destination directory",type:"string"}).options({slug:{describe:"Plugin or theme slug",type:"string"},domain:{describe:"Text domain to look for in the source code. Valid domains are: plugin, theme, block, theme-block, generic.",choices:["plugin","theme","block","theme-block","generic"],type:"string"},"skip-js":{describe:"Skip JavaScript files",type:"boolean"},"skip-php":{describe:"Skip PHP files",type:"boolean"},"skip-blade":{describe:"Skip Blade files",type:"boolean"},"skip-block-json":{describe:"Skip block.json files",type:"boolean"},"skip-theme-json":{describe:"Skip theme.json files",type:"boolean"},"skip-audit":{describe:"Skip auditing of strings",type:"boolean",default:!1},headers:{describe:"Additional Headers",type:"array",default:[]},"file-comment":{describe:"File comment",type:"string"},"package-name":{describe:"Package name",type:"string"},location:{describe:"Include location information",type:"boolean"},"ignore-domain":{describe:"Ignore text domain",type:"boolean"},mergePaths:{describe:"Merge with existing POT file(s)",type:"string"},subtractPaths:{describe:"Subtract strings from existing POT file(s)",type:"string"},subtractAndMerge:{describe:"Subtract and merge strings from existing POT file(s)",type:"boolean"},include:{describe:"Include specific files",type:"string",default:"**"},exclude:{describe:"Exclude specific files",type:"string"},silent:{describe:"No output to stdout",type:"boolean",default:!1},json:{describe:"Output the json gettext data",type:"boolean"},output:{describe:"Output the gettext data",type:"boolean"},charset:{describe:"Charset",type:"string",default:"latin1"},"translation-domains":{describe:"Restrict to specific translation domains",type:"array"},debug:{describe:"Debug mode",type:"boolean",default:!1}}).parseSync();return(0,p.parseCliArgs)({...e,...t})}0&&(module.exports={getArgs});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var getArgs_exports = {};
30
+ __export(getArgs_exports, {
31
+ getArgs: () => getArgs
32
+ });
33
+ module.exports = __toCommonJS(getArgs_exports);
34
+ var import_node_process = __toESM(require("node:process"));
35
+ var yargs = __toESM(require("yargs"));
36
+ var import_helpers = require("yargs/helpers");
37
+ var import_parseCli = require("./parseCli.js");
38
+ function getArgs(userArgs = {}) {
39
+ const args = yargs.default((0, import_helpers.hideBin)(import_node_process.default.argv)).help("help").alias("h", "help").usage("Usage: $0 <source> [destination] [options]").positional("sourceDirectory", {
40
+ describe: "Source directory",
41
+ type: "string"
42
+ }).positional("destination", {
43
+ describe: "Destination directory",
44
+ type: "string"
45
+ }).options({
46
+ slug: {
47
+ describe: "Plugin or theme slug",
48
+ type: "string"
49
+ },
50
+ domain: {
51
+ describe: "Text domain to look for in the source code. Valid domains are: plugin, theme, block, theme-block, generic.",
52
+ choices: ["plugin", "theme", "block", "theme-block", "generic"],
53
+ type: "string"
54
+ },
55
+ "skip-js": {
56
+ describe: "Skip JavaScript files",
57
+ type: "boolean"
58
+ },
59
+ "skip-php": {
60
+ describe: "Skip PHP files",
61
+ type: "boolean"
62
+ },
63
+ "skip-blade": {
64
+ describe: "Skip Blade files",
65
+ type: "boolean"
66
+ },
67
+ "skip-block-json": {
68
+ describe: "Skip block.json files",
69
+ type: "boolean"
70
+ },
71
+ "skip-theme-json": {
72
+ describe: "Skip theme.json files",
73
+ type: "boolean"
74
+ },
75
+ "skip-audit": {
76
+ describe: "Skip auditing of strings",
77
+ type: "boolean",
78
+ default: false
79
+ },
80
+ headers: {
81
+ describe: "Additional Headers",
82
+ type: "array",
83
+ default: []
84
+ },
85
+ "file-comment": {
86
+ describe: "File comment",
87
+ type: "string"
88
+ },
89
+ "package-name": {
90
+ describe: "Package name",
91
+ type: "string"
92
+ },
93
+ location: {
94
+ describe: "Include location information",
95
+ type: "boolean"
96
+ },
97
+ "ignore-domain": {
98
+ describe: "Ignore text domain",
99
+ type: "boolean"
100
+ },
101
+ mergePaths: {
102
+ describe: "Merge with existing POT file(s)",
103
+ type: "string"
104
+ },
105
+ subtractPaths: {
106
+ describe: "Subtract strings from existing POT file(s)",
107
+ type: "string"
108
+ },
109
+ subtractAndMerge: {
110
+ describe: "Subtract and merge strings from existing POT file(s)",
111
+ type: "boolean"
112
+ },
113
+ include: {
114
+ describe: "Include specific files",
115
+ type: "string",
116
+ default: "**"
117
+ },
118
+ exclude: {
119
+ describe: "Exclude specific files",
120
+ type: "string"
121
+ },
122
+ silent: {
123
+ describe: "No output to stdout",
124
+ type: "boolean",
125
+ default: false
126
+ },
127
+ json: {
128
+ describe: "Output the json gettext data",
129
+ type: "boolean"
130
+ },
131
+ output: {
132
+ describe: "Output the gettext data",
133
+ type: "boolean"
134
+ },
135
+ charset: {
136
+ describe: "Charset",
137
+ type: "string",
138
+ default: "latin1"
139
+ },
140
+ "translation-domains": {
141
+ describe: "Restrict to specific translation domains",
142
+ type: "array"
143
+ },
144
+ debug: {
145
+ describe: "Debug mode",
146
+ type: "boolean",
147
+ default: false
148
+ }
149
+ }).parseSync();
150
+ return (0, import_parseCli.parseCliArgs)({ ...userArgs, ...args });
151
+ }
152
+ // Annotate the CommonJS export names for ESM import in node:
153
+ 0 && (module.exports = {
154
+ getArgs
155
+ });
156
+ //# sourceMappingURL=getArgs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/cli/getArgs.ts"],
4
- "sourcesContent": ["import process from \"node:process\";\r\nimport * as yargs from \"yargs\";\r\nimport { hideBin } from \"yargs/helpers\";\r\nimport type { Args, MakeJsonArgs } from \"../types.js\";\r\nimport { parseCliArgs } from \"./parseCli.js\";\r\n\r\n/**\r\n * Retrieves and returns the command line arguments and options.\r\n *\r\n * @return The parsed command line arguments and options.\r\n */\r\nexport function getArgs(userArgs = {}): Args | MakeJsonArgs {\r\n\tconst args = yargs\r\n\t\t.default(hideBin(process.argv))\r\n\t\t.help(\"h\")\r\n\t\t.alias(\"help\", \"help\")\r\n\t\t.usage(\"Usage: $0 <source> [destination] [options]\")\r\n\t\t.positional(\"sourceDirectory\", {\r\n\t\t\tdescribe: \"Source directory\",\r\n\t\t\ttype: \"string\",\r\n\t\t})\r\n\t\t.positional(\"destination\", {\r\n\t\t\tdescribe: \"Destination directory\",\r\n\t\t\ttype: \"string\",\r\n\t\t})\r\n\t\t.options({\r\n\t\t\tslug: {\r\n\t\t\t\tdescribe: \"Plugin or theme slug\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tdomain: {\r\n\t\t\t\tdescribe: \"Text domain to look for in the source code. Valid domains are: plugin, theme, block, theme-block, generic.\",\r\n\t\t\t\tchoices: [\"plugin\", \"theme\", \"block\", \"theme-block\", \"generic\"],\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\t\"skip-js\": {\r\n\t\t\t\tdescribe: \"Skip JavaScript files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-php\": {\r\n\t\t\t\tdescribe: \"Skip PHP files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-blade\": {\r\n\t\t\t\tdescribe: \"Skip Blade files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-block-json\": {\r\n\t\t\t\tdescribe: \"Skip block.json files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-theme-json\": {\r\n\t\t\t\tdescribe: \"Skip theme.json files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-audit\": {\r\n\t\t\t\tdescribe: \"Skip auditing of strings\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t},\r\n\t\t\theaders: {\r\n\t\t\t\tdescribe: \"Additional Headers\",\r\n\t\t\t\ttype: \"array\",\r\n\t\t\t\tdefault: [],\r\n\t\t\t},\r\n\t\t\t\"file-comment\": {\r\n\t\t\t\tdescribe: \"File comment\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\t\"package-name\": {\r\n\t\t\t\tdescribe: \"Package name\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tlocation: {\r\n\t\t\t\tdescribe: \"Include location information\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"ignore-domain\": {\r\n\t\t\t\tdescribe: \"Ignore text domain\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\tmergePaths: {\r\n\t\t\t\tdescribe: \"Merge with existing POT file(s)\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tsubtractPaths: {\r\n\t\t\t\tdescribe: \"Subtract strings from existing POT file(s)\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tsubtractAndMerge: {\r\n\t\t\t\tdescribe: \"Subtract and merge strings from existing POT file(s)\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\tinclude: {\r\n\t\t\t\tdescribe: \"Include specific files\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdefault: \"**\",\r\n\t\t\t},\r\n\t\t\texclude: {\r\n\t\t\t\tdescribe: \"Exclude specific files\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tsilent: {\r\n\t\t\t\tdescribe: \"No output to stdout\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t},\r\n\t\t\tjson: {\r\n\t\t\t\tdescribe: \"Output the json gettext data\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\toutput: {\r\n\t\t\t\tdescribe: \"Output the gettext data\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\tcharset: {\r\n\t\t\t\tdescribe: \"Charset\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdefault: \"latin1\",\r\n\t\t\t},\r\n\t\t\t\"translation-domains\": {\r\n\t\t\t\tdescribe: \"Restrict to specific translation domains\",\r\n\t\t\t\ttype: \"array\",\r\n\t\t\t},\r\n\t\t\tdebug: {\r\n\t\t\t\tdescribe: \"Debug mode\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t},\r\n\t\t})\r\n\t\t.parseSync();\r\n\treturn parseCliArgs({ ...userArgs, ...args });\r\n}\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoB;AACpB,YAAuB;AACvB,qBAAwB;AAExB,sBAA6B;AAOtB,SAAS,QAAQ,WAAW,CAAC,GAAwB;AAC3D,QAAM,OAAO,MACX,YAAQ,wBAAQ,oBAAAA,QAAQ,IAAI,CAAC,EAC7B,KAAK,GAAG,EACR,MAAM,QAAQ,MAAM,EACpB,MAAM,4CAA4C,EAClD,WAAW,mBAAmB;AAAA,IAC9B,UAAU;AAAA,IACV,MAAM;AAAA,EACP,CAAC,EACA,WAAW,eAAe;AAAA,IAC1B,UAAU;AAAA,IACV,MAAM;AAAA,EACP,CAAC,EACA,QAAQ;AAAA,IACR,MAAM;AAAA,MACL,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,UAAU;AAAA,MACV,SAAS,CAAC,UAAU,SAAS,SAAS,eAAe,SAAS;AAAA,MAC9D,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,MACV,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,cAAc;AAAA,MACb,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,mBAAmB;AAAA,MAClB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,mBAAmB;AAAA,MAClB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,cAAc;AAAA,MACb,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS,CAAC;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,gBAAgB;AAAA,MACf,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,iBAAiB;AAAA,MAChB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,eAAe;AAAA,MACd,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,kBAAkB;AAAA,MACjB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACL,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,uBAAuB;AAAA,MACtB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,OAAO;AAAA,MACN,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACD,CAAC,EACA,UAAU;AACZ,aAAO,8BAAa,EAAE,GAAG,UAAU,GAAG,KAAK,CAAC;AAC7C;",
4
+ "sourcesContent": ["import process from \"node:process\";\r\nimport * as yargs from \"yargs\";\r\nimport { hideBin } from \"yargs/helpers\";\r\nimport type { Args, MakeJsonArgs } from \"../types.js\";\r\nimport { parseCliArgs } from \"./parseCli.js\";\r\n\r\n/**\r\n * Retrieves and returns the command line arguments and options.\r\n *\r\n * @return The parsed command line arguments and options.\r\n */\r\nexport function getArgs(userArgs = {}): Args | MakeJsonArgs {\r\n\tconst args = yargs\r\n\t\t.default(hideBin(process.argv))\r\n\t\t.help(\"help\")\r\n\t\t.alias(\"h\", \"help\")\r\n\t\t.usage(\"Usage: $0 <source> [destination] [options]\")\r\n\t\t.positional(\"sourceDirectory\", {\r\n\t\t\tdescribe: \"Source directory\",\r\n\t\t\ttype: \"string\",\r\n\t\t})\r\n\t\t.positional(\"destination\", {\r\n\t\t\tdescribe: \"Destination directory\",\r\n\t\t\ttype: \"string\",\r\n\t\t})\r\n\t\t.options({\r\n\t\t\tslug: {\r\n\t\t\t\tdescribe: \"Plugin or theme slug\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tdomain: {\r\n\t\t\t\tdescribe: \"Text domain to look for in the source code. Valid domains are: plugin, theme, block, theme-block, generic.\",\r\n\t\t\t\tchoices: [\"plugin\", \"theme\", \"block\", \"theme-block\", \"generic\"],\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\t\"skip-js\": {\r\n\t\t\t\tdescribe: \"Skip JavaScript files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-php\": {\r\n\t\t\t\tdescribe: \"Skip PHP files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-blade\": {\r\n\t\t\t\tdescribe: \"Skip Blade files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-block-json\": {\r\n\t\t\t\tdescribe: \"Skip block.json files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-theme-json\": {\r\n\t\t\t\tdescribe: \"Skip theme.json files\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"skip-audit\": {\r\n\t\t\t\tdescribe: \"Skip auditing of strings\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t},\r\n\t\t\theaders: {\r\n\t\t\t\tdescribe: \"Additional Headers\",\r\n\t\t\t\ttype: \"array\",\r\n\t\t\t\tdefault: [],\r\n\t\t\t},\r\n\t\t\t\"file-comment\": {\r\n\t\t\t\tdescribe: \"File comment\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\t\"package-name\": {\r\n\t\t\t\tdescribe: \"Package name\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tlocation: {\r\n\t\t\t\tdescribe: \"Include location information\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\t\"ignore-domain\": {\r\n\t\t\t\tdescribe: \"Ignore text domain\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\tmergePaths: {\r\n\t\t\t\tdescribe: \"Merge with existing POT file(s)\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tsubtractPaths: {\r\n\t\t\t\tdescribe: \"Subtract strings from existing POT file(s)\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tsubtractAndMerge: {\r\n\t\t\t\tdescribe: \"Subtract and merge strings from existing POT file(s)\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\tinclude: {\r\n\t\t\t\tdescribe: \"Include specific files\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdefault: \"**\",\r\n\t\t\t},\r\n\t\t\texclude: {\r\n\t\t\t\tdescribe: \"Exclude specific files\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t},\r\n\t\t\tsilent: {\r\n\t\t\t\tdescribe: \"No output to stdout\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t},\r\n\t\t\tjson: {\r\n\t\t\t\tdescribe: \"Output the json gettext data\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\toutput: {\r\n\t\t\t\tdescribe: \"Output the gettext data\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t\tcharset: {\r\n\t\t\t\tdescribe: \"Charset\",\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdefault: \"latin1\",\r\n\t\t\t},\r\n\t\t\t\"translation-domains\": {\r\n\t\t\t\tdescribe: \"Restrict to specific translation domains\",\r\n\t\t\t\ttype: \"array\",\r\n\t\t\t},\r\n\t\t\tdebug: {\r\n\t\t\t\tdescribe: \"Debug mode\",\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t},\r\n\t\t})\r\n\t\t.parseSync();\r\n\treturn parseCliArgs({ ...userArgs, ...args });\r\n}\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoB;AACpB,YAAuB;AACvB,qBAAwB;AAExB,sBAA6B;AAOtB,SAAS,QAAQ,WAAW,CAAC,GAAwB;AAC3D,QAAM,OAAO,MACX,YAAQ,wBAAQ,oBAAAA,QAAQ,IAAI,CAAC,EAC7B,KAAK,MAAM,EACX,MAAM,KAAK,MAAM,EACjB,MAAM,4CAA4C,EAClD,WAAW,mBAAmB;AAAA,IAC9B,UAAU;AAAA,IACV,MAAM;AAAA,EACP,CAAC,EACA,WAAW,eAAe;AAAA,IAC1B,UAAU;AAAA,IACV,MAAM;AAAA,EACP,CAAC,EACA,QAAQ;AAAA,IACR,MAAM;AAAA,MACL,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,UAAU;AAAA,MACV,SAAS,CAAC,UAAU,SAAS,SAAS,eAAe,SAAS;AAAA,MAC9D,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,MACV,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,cAAc;AAAA,MACb,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,mBAAmB;AAAA,MAClB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,mBAAmB;AAAA,MAClB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,cAAc;AAAA,MACb,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS,CAAC;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,gBAAgB;AAAA,MACf,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,iBAAiB;AAAA,MAChB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,eAAe;AAAA,MACd,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,kBAAkB;AAAA,MACjB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACL,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,uBAAuB;AAAA,MACtB,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,OAAO;AAAA,MACN,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACD,CAAC,EACA,UAAU;AACZ,aAAO,8BAAa,EAAE,GAAG,UAAU,GAAG,KAAK,CAAC;AAC7C;",
6
6
  "names": ["process"]
7
7
  }
@@ -1 +1,82 @@
1
- "use strict";var u=Object.create;var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var s in t)o(e,s,{get:t[s],enumerable:!0})},a=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!g.call(e,r)&&r!==s&&o(e,r,{get:()=>t[r],enumerable:!(i=c(t,r))||i.enumerable});return e};var n=(e,t,s)=>(s=e!=null?u(y(e)):{},a(t||!e||!e.__esModule?o(s,"default",{value:e,enumerable:!0}):s,e)),m=e=>a(o({},"__esModule",{value:!0}),e);var S={};b(S,{getJsonArgs:()=>J});module.exports=m(S);var p=n(require("node:process")),h=n(require("yargs")),d=require("yargs/helpers"),l=require("./parseCli.js");function J(e={}){const t=h.default((0,d.hideBin)(p.default.argv)).help("h").alias("help","help").usage("Usage: $0 <source> [destination] [options]").positional("source",{describe:"Source directory",type:"string"}).positional("destination",{describe:"Destination directory",type:"string"}).options({scriptName:{describe:"The name of the script to be translated",type:"string"},allowedFormats:{describe:"which extensions to use for translation",type:"array",default:["js"]},purge:{describe:"Remove old JSON files",type:"boolean",default:!0},prettyPrint:{describe:"Pretty print JSON",type:"boolean",default:!1},debug:{describe:"Debug mode",type:"boolean",default:!1},stripUnused:{describe:"Strip unused translations in js files",type:"boolean",default:!0}}).parseSync();return(0,l.parseJsonArgs)({...e,...t})}0&&(module.exports={getJsonArgs});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var getJsonArgs_exports = {};
30
+ __export(getJsonArgs_exports, {
31
+ getJsonArgs: () => getJsonArgs
32
+ });
33
+ module.exports = __toCommonJS(getJsonArgs_exports);
34
+ var import_node_process = __toESM(require("node:process"));
35
+ var yargs = __toESM(require("yargs"));
36
+ var import_helpers = require("yargs/helpers");
37
+ var import_parseCli = require("./parseCli.js");
38
+ function getJsonArgs(additionalArgs = {}) {
39
+ const args = yargs.default((0, import_helpers.hideBin)(import_node_process.default.argv)).help("h").alias("help", "help").usage("Usage: $0 <source> [destination] [options]").positional("source", {
40
+ describe: "Source directory",
41
+ type: "string"
42
+ }).positional("destination", {
43
+ describe: "Destination directory",
44
+ type: "string"
45
+ }).options({
46
+ scriptName: {
47
+ describe: "The name of the script to be translated",
48
+ type: "string"
49
+ },
50
+ allowedFormats: {
51
+ describe: "which extensions to use for translation",
52
+ type: "array",
53
+ default: ["js"]
54
+ },
55
+ purge: {
56
+ describe: "Remove old JSON files",
57
+ type: "boolean",
58
+ default: true
59
+ },
60
+ prettyPrint: {
61
+ describe: "Pretty print JSON",
62
+ type: "boolean",
63
+ default: false
64
+ },
65
+ debug: {
66
+ describe: "Debug mode",
67
+ type: "boolean",
68
+ default: false
69
+ },
70
+ stripUnused: {
71
+ describe: "Strip unused translations in js files",
72
+ type: "boolean",
73
+ default: true
74
+ }
75
+ }).parseSync();
76
+ return (0, import_parseCli.parseJsonArgs)({ ...additionalArgs, ...args });
77
+ }
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ getJsonArgs
81
+ });
82
+ //# sourceMappingURL=getJsonArgs.js.map