@wp-blocks/make-pot 1.3.2 → 1.5.0
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/README.md +168 -4
- package/lib/assets/package-i18n.js +1 -1
- package/lib/cli/getArgs.js +1 -1
- package/lib/cli/getJsonArgs.js +1 -0
- package/lib/cli/parseCli.js +1 -1
- package/lib/cli.js +2 -0
- package/lib/const.js +1 -1
- package/lib/extractors/css.js +1 -1
- package/lib/extractors/headers.js +6 -1
- package/lib/extractors/json.js +1 -1
- package/lib/extractors/php.js +2 -2
- package/lib/extractors/schema.js +4 -1
- package/lib/extractors/utils.js +1 -1
- package/lib/fs/fs.js +1 -1
- package/lib/fs/glob.js +1 -3
- package/lib/index.js +1 -2
- package/lib/jsonCommand.js +1 -0
- package/lib/makeJson.js +2 -1
- package/lib/makePot.js +2 -0
- package/lib/parser/exec.js +7 -3
- package/lib/parser/makeJson.js +1 -0
- package/lib/parser/makePot.js +1 -1
- package/lib/parser/patterns.js +1 -1
- package/lib/parser/process.js +1 -1
- package/lib/parser/taskRunner.js +1 -1
- package/lib/parser/tree.js +1 -1
- package/lib/potCommand.js +1 -0
- package/lib/types.js +1 -1
- package/lib/utils/common.js +3 -2
- package/package.json +19 -15
- package/tests/extract.test.js +381 -381
- package/tests/getFiles.test.no.js +85 -85
- package/tests/tree.test.js +158 -158
- package/tests/wpcliCompare.no.js +32 -32
- package/tsconfig.json +3 -1
- package/lib/run.js +0 -1
package/lib/utils/common.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
"use strict";var l=Object.create;var s=Object.defineProperty;var
|
|
2
|
-
# This file is distributed under the ${t} license.`}function
|
|
1
|
+
"use strict";var l=Object.create;var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var k=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!x.call(e,r)&&r!==n&&s(e,r,{get:()=>t[r],enumerable:!(o=m(t,r))||o.enumerable});return e};var a=(e,t,n)=>(n=e!=null?l(d(e)):{},u(t||!e||!e.__esModule?s(n,"default",{value:e,enumerable:!0}):n,e)),h=e=>u(s({},"__esModule",{value:!0}),e);var b={};k(b,{detectPatternType:()=>F,getCommentBlock:()=>y,getCopyright:()=>M,getPkgJsonData:()=>p,printMakePotModuleInfo:()=>$,printStats:()=>T,printTimeElapsed:()=>D,removeCommentMarkup:()=>P,reverseSlashes:()=>S,stringstring:()=>C,stripTranslationMarkup:()=>v});module.exports=h(b);var g=a(require("node:fs")),i=require("node:os"),c=a(require("node:path"));function y(e){const t=e.match(/\/\*\*?[\s\S]*?\*\//);return t!==null?t[0]:e}function P(e){return e.match(/[a-zA-Z].*/gm)}function v(e){const t=/\/\*\*?\s*(?:translators:)\s*([\s\S]*?)\s*\*\/|\/\/\s*(?:translators:)\s*(.*)$/i,n=e.match(t);return n?n[1]:e}function C(e){return typeof e=="string"?e.includes(",")?e.split(","):[e]:[]}function F(e){const t=e.includes("."),n=e.includes(c.default.sep);return e.includes("*")?"glob":!t&&!n?"directory":t&&!n?"file":"glob"}function M(e,t="GPL v2 or later"){return`# Copyright (C) ${new Date().getFullYear()} ${e}
|
|
2
|
+
# This file is distributed under the ${t} license.`}function S(e){return e.replace(/\\/g,"/")}function p(...e){const t={},n=c.default.join(__dirname,"..","..","package.json"),o=g.default.existsSync(n)?require(n):{name:"makepot",version:""};for(const r of e)o[r]&&(t[r]=o[r]);return t}function $(){const{version:e,name:t}=p("name","version");console.log(`${t} version: ${e}`)}function D(e,t=new Date){console.log(`\u{1F680} Make-Pot: Job completed! Pot file created in ${t.getTime()-e.getTime()}ms`)}function T(){console.log("Memory usage:",(process.memoryUsage().heapUsed/1024/1024).toFixed(2),"MB (Free:",((0,i.totalmem)()/1024/1024/1024).toFixed(2),`GB)
|
|
3
|
+
Cpu User:`,(process.cpuUsage().user/1e6).toFixed(2),"ms Cpu System:",(process.cpuUsage().system/1e6).toFixed(2),"ms of",(0,i.cpus)().length,"cores")}0&&(module.exports={detectPatternType,getCommentBlock,getCopyright,getPkgJsonData,printMakePotModuleInfo,printStats,printTimeElapsed,removeCommentMarkup,reverseSlashes,stringstring,stripTranslationMarkup});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-blocks/make-pot",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"homepage": "https://wp-blocks.github.io/make-pot/",
|
|
6
6
|
"description": "A Node.js script for generating a POT file from source code",
|
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
"John Hooks <bitmachina@outlook.com> (https://johnhooks.io/)"
|
|
10
10
|
],
|
|
11
11
|
"type": "commonjs",
|
|
12
|
-
"main": "lib/
|
|
12
|
+
"main": "lib/cli.js",
|
|
13
13
|
"bin": {
|
|
14
|
-
"
|
|
14
|
+
"default": "lib/cli.js",
|
|
15
|
+
"make-pot": "lib/makePot.js",
|
|
16
|
+
"makepot": "lib/makePot.js",
|
|
17
|
+
"make-json": "lib/makeJson.js",
|
|
18
|
+
"makejson": "lib/makeJson.js"
|
|
15
19
|
},
|
|
16
20
|
"engines": {
|
|
17
21
|
"node": ">=16.0.0"
|
|
@@ -44,34 +48,34 @@
|
|
|
44
48
|
"scripts": {
|
|
45
49
|
"postinstall": "npm rebuild tree-sitter tree-sitter-typescript tree-sitter-php tree-sitter-javascript --force",
|
|
46
50
|
"build": "npx esbuild ./src/**/* --format=cjs --minify --outdir=lib --platform=node",
|
|
51
|
+
"build:ci": "npx esbuild ./src/index.ts --format=cjs --outdir=lib --bundle --external:tree-sitter --external:tree-sitter-typescript --external:tree-sitter-php --external:tree-sitter-javascript --platform=node",
|
|
47
52
|
"watch": "tsc --watch",
|
|
48
53
|
"lint": "npx @biomejs/biome check --apply src",
|
|
54
|
+
"rm": "rmdir /s /q lib",
|
|
49
55
|
"test": "node --test",
|
|
50
|
-
"ci
|
|
51
|
-
"test:ci": "npm run ci:bundle && node --test",
|
|
56
|
+
"test:ci": "npm run build:ci && npm run test",
|
|
52
57
|
"test:watch": "node --test --watch",
|
|
53
|
-
"test:coverage": "node --test --experimental-test-coverage"
|
|
54
|
-
"run": "node ./lib/index.js tests/fixtures/vinyl/"
|
|
58
|
+
"test:coverage": "node --test --experimental-test-coverage"
|
|
55
59
|
},
|
|
56
60
|
"dependencies": {
|
|
57
|
-
"axios": "^1.7.2",
|
|
58
61
|
"cli-progress": "^3.12.0",
|
|
59
62
|
"gettext-merger": "^1.2.1",
|
|
60
63
|
"gettext-parser": "^4.0.4",
|
|
61
|
-
"glob": "^
|
|
64
|
+
"glob": "^11.0.2",
|
|
62
65
|
"tree-sitter": "^0.20.6",
|
|
63
66
|
"tree-sitter-javascript": "^0.20.4",
|
|
64
67
|
"tree-sitter-php": "^0.20.0",
|
|
65
68
|
"tree-sitter-typescript": "^0.20.5",
|
|
69
|
+
"tannin": "^1.2.0",
|
|
66
70
|
"yargs": "^17.7.1"
|
|
67
71
|
},
|
|
68
72
|
"devDependencies": {
|
|
69
|
-
"@biomejs/biome": "1.
|
|
70
|
-
"@types/cli-progress": "^3.11.
|
|
73
|
+
"@biomejs/biome": "1.9.4",
|
|
74
|
+
"@types/cli-progress": "^3.11.6",
|
|
71
75
|
"@types/gettext-parser": "^4.0.4",
|
|
72
|
-
"@types/node": "^
|
|
73
|
-
"@types/yargs": "^17.0.
|
|
74
|
-
"esbuild": "0.
|
|
75
|
-
"typescript": "^5.
|
|
76
|
+
"@types/node": "^22.15.17",
|
|
77
|
+
"@types/yargs": "^17.0.33",
|
|
78
|
+
"esbuild": "0.25.4",
|
|
79
|
+
"typescript": "^5.8.3"
|
|
76
80
|
}
|
|
77
81
|
}
|