@wp-blocks/make-pot 0.2.2 → 1.0.1
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/.github/workflows/node.js.yml +33 -0
- package/.github/workflows/tsDoc.yml +52 -0
- package/README.md +53 -34
- package/lib/assets/package-i18n.json +13 -0
- package/lib/assets/wp-plugin-i18n.json +14 -0
- package/lib/assets/wp-theme-i18n.json +13 -0
- package/lib/cli/index.d.ts +1 -0
- package/lib/cli/index.js +114 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/parseCli.d.ts +3 -0
- package/lib/cli/parseCli.js +111 -0
- package/lib/cli/parseCli.js.map +1 -0
- package/lib/cliArgs.js +36 -4
- package/lib/cliArgs.js.map +1 -1
- package/lib/const.d.ts +114 -0
- package/lib/const.js +40 -3
- package/lib/const.js.map +1 -1
- package/lib/extractors/css.js +13 -2
- package/lib/extractors/css.js.map +1 -1
- package/lib/extractors/headers.d.ts +3 -5
- package/lib/extractors/headers.js +19 -13
- package/lib/extractors/headers.js.map +1 -1
- package/lib/extractors/index.d.ts +1 -2
- package/lib/extractors/index.js +9 -44
- package/lib/extractors/index.js.map +1 -1
- package/lib/extractors/json.d.ts +5 -3
- package/lib/extractors/json.js +48 -4
- package/lib/extractors/json.js.map +1 -1
- package/lib/extractors/php.js +8 -15
- package/lib/extractors/php.js.map +1 -1
- package/lib/extractors/schema.js +5 -1
- package/lib/extractors/schema.js.map +1 -1
- package/lib/extractors/text.js +2 -6
- package/lib/extractors/text.js.map +1 -1
- package/lib/extractors/utils.d.ts +3 -3
- package/lib/extractors/utils.js +34 -25
- package/lib/extractors/utils.js.map +1 -1
- package/lib/fs/glob.d.ts +13 -0
- package/lib/fs/glob.js +95 -0
- package/lib/fs/glob.js.map +1 -0
- package/lib/fs/index.d.ts +2 -0
- package/lib/fs/index.js +69 -0
- package/lib/fs/index.js.map +1 -0
- package/lib/fs.d.ts +2 -1
- package/lib/fs.js +15 -8
- package/lib/fs.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/makePot.d.ts +1 -1
- package/lib/makePot.js +20 -13
- package/lib/makePot.js.map +1 -1
- package/lib/maps.d.ts +1 -3
- package/lib/maps.js +12 -3
- package/lib/maps.js.map +1 -1
- package/lib/parser/consolidate.d.ts +2 -0
- package/lib/parser/consolidate.js +37 -0
- package/lib/parser/consolidate.js.map +1 -0
- package/lib/parser/exec.d.ts +3 -0
- package/lib/parser/exec.js +71 -0
- package/lib/parser/exec.js.map +1 -0
- package/lib/parser/index.d.ts +2 -0
- package/lib/parser/index.js +24 -0
- package/lib/parser/index.js.map +1 -0
- package/lib/parser/makePot.d.ts +2 -0
- package/lib/parser/makePot.js +33 -0
- package/lib/parser/makePot.js.map +1 -0
- package/lib/parser/patterns.d.ts +2 -0
- package/lib/parser/patterns.js +34 -0
- package/lib/parser/patterns.js.map +1 -0
- package/lib/parser/process.d.ts +5 -0
- package/lib/parser/process.js +70 -0
- package/lib/parser/process.js.map +1 -0
- package/lib/parser/tree.d.ts +2 -0
- package/lib/parser/tree.js +87 -0
- package/lib/parser/tree.js.map +1 -0
- package/lib/parser.d.ts +2 -2
- package/lib/parser.js +58 -57
- package/lib/parser.js.map +1 -1
- package/lib/types.d.ts +4 -3
- package/lib/utils/index.d.ts +8 -0
- package/lib/utils/index.js +78 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/tests/consolidate.test.ts +1 -1
- package/tests/extract-2.test.ts +1 -1
- package/tests/{extract.old.ts → extract.test.ts} +20 -18
- package/tests/getFiles.old.ts +1 -1
- package/tests/getStrings.old.ts +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
|
3
|
+
|
|
4
|
+
name: Node.js CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ "master" ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ "master" ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [lts/*, latest]
|
|
20
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
21
|
+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v3
|
|
25
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
26
|
+
uses: actions/setup-node@v3
|
|
27
|
+
with:
|
|
28
|
+
node-version: ${{ matrix.node-version }}
|
|
29
|
+
cache: 'npm'
|
|
30
|
+
- run: npm install
|
|
31
|
+
- run: npm run build --if-present
|
|
32
|
+
- run: npm test
|
|
33
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
|
2
|
+
name: TypeDoc generation
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
release:
|
|
6
|
+
branches: [ "master" ]
|
|
7
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
pages: write
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# Single deploy job since we're just deploying
|
|
18
|
+
deploy:
|
|
19
|
+
name: Deploy Documentation
|
|
20
|
+
|
|
21
|
+
# Deploy to the github-pages environment
|
|
22
|
+
environment:
|
|
23
|
+
name: github-pages
|
|
24
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
25
|
+
|
|
26
|
+
# Specify runner + deployment step
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout code
|
|
30
|
+
uses: actions/checkout@v3
|
|
31
|
+
|
|
32
|
+
- name: TypeDoc Action
|
|
33
|
+
uses: erikyo/tsdoc-action@v1
|
|
34
|
+
with:
|
|
35
|
+
source_dir: ./src/**/*
|
|
36
|
+
output_dir: ./docs
|
|
37
|
+
skipErrorChecking: true
|
|
38
|
+
darkHighlightTheme: dark-plus
|
|
39
|
+
basePath: ./src/
|
|
40
|
+
|
|
41
|
+
- name: Setup Pages
|
|
42
|
+
uses: actions/configure-pages@v3
|
|
43
|
+
|
|
44
|
+
- name: Upload artifact
|
|
45
|
+
uses: actions/upload-pages-artifact@v2
|
|
46
|
+
with:
|
|
47
|
+
# Upload entire repository
|
|
48
|
+
path: './docs'
|
|
49
|
+
|
|
50
|
+
- name: Deploy to GitHub Pages
|
|
51
|
+
id: deployment
|
|
52
|
+
uses: actions/deploy-pages@v2
|
package/README.md
CHANGED
|
@@ -1,39 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
## make-pot
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`make-pot` is a Node.js module designed to generate the `.pot` file for your WordPress plugin or theme. This file serves as the basis for internationalization, allowing translators to localize your plugin or theme into different languages.
|
|
4
|
+
|
|
5
|
+
Extract strings from your WordPress plugin or theme and generate a `.pot` file. Works with `js`, `jx`, `ts`, `tsx`, `cjs`, `mjs`, `php`, `blade`, `txt`, `json` with a custom schema for theme and block.json files.
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
You can install `make-pot` globally via npm:
|
|
4
10
|
|
|
5
11
|
```
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Options:
|
|
14
|
-
--version Show version number [boolean]
|
|
15
|
-
-h Show help [boolean]
|
|
16
|
-
--slug Plugin or theme slug [string]
|
|
17
|
-
--domain Text domain to look for in the source code [string]
|
|
18
|
-
--skip-js Skip JavaScript files [boolean]
|
|
19
|
-
--skip-php Skip PHP files [boolean]
|
|
20
|
-
--skip-blade Skip Blade files [boolean]
|
|
21
|
-
--skip-block-json Skip block.json files [boolean]
|
|
22
|
-
--skip-theme-json Skip theme.json files [boolean]
|
|
23
|
-
--skip-audit Skip auditing of strings [boolean]
|
|
24
|
-
--headers Headers [string]
|
|
25
|
-
--file-comment File comment [string]
|
|
26
|
-
--package-name Package name [string]
|
|
27
|
-
--location Include location information [boolean]
|
|
28
|
-
--ignore-domain Ignore text domain [boolean]
|
|
29
|
-
--mergePaths Merge with existing POT file(s) [string]
|
|
30
|
-
--subtractPaths Subtract strings from existing POT file(s) [string]
|
|
31
|
-
--subtractAndMerge Subtract and merge strings from existing POT file(s)
|
|
32
|
-
[boolean]
|
|
33
|
-
--include Include specific files [string]
|
|
34
|
-
--exclude Exclude specific files [string]
|
|
35
|
-
--silent No output to stdout [boolean]
|
|
36
|
-
--json Output the json gettext data [boolean]
|
|
37
|
-
--output Output the gettext data [boolean]
|
|
12
|
+
npm install -g @wp-blocks/make-pot
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @wp-blocks/make-pot <sourceDirectory> [destination] [options]
|
|
38
19
|
```
|
|
39
20
|
|
|
21
|
+
#### Positional Arguments:
|
|
22
|
+
|
|
23
|
+
- `sourceDirectory`: Specifies the source directory of your plugin or theme.
|
|
24
|
+
- `destination` (optional): Specifies the destination directory where the `.pot` file will be generated. If not provided, the `.pot` file will be created in the source directory.
|
|
25
|
+
|
|
26
|
+
#### Options:
|
|
27
|
+
|
|
28
|
+
- `--version`: Displays the version number of `make-pot`.
|
|
29
|
+
- `-h`, `--help`: Displays help information.
|
|
30
|
+
- `--slug <slug>`: Specifies the plugin or theme slug.
|
|
31
|
+
- `--domain <domain>`: Specifies the text domain to look for in the source code.
|
|
32
|
+
- `--skip-js`: Skips JavaScript files during processing.
|
|
33
|
+
- `--skip-php`: Skips PHP files during processing.
|
|
34
|
+
- `--skip-blade`: Skips Blade files during processing.
|
|
35
|
+
- `--skip-block-json`: Skips block.json files during processing.
|
|
36
|
+
- `--skip-theme-json`: Skips theme.json files during processing.
|
|
37
|
+
- `--skip-audit`: Skips auditing of strings.
|
|
38
|
+
- `--headers <headers>`: Specifies additional headers for the `.pot` file.
|
|
39
|
+
- `--file-comment <comment>`: Specifies the file comment for the `.pot` file.
|
|
40
|
+
- `--package-name <name>`: Specifies the package name.
|
|
41
|
+
- `--location`: Includes location information in the `.pot` file.
|
|
42
|
+
- `--ignore-domain`: Ignores text domain in the processing.
|
|
43
|
+
- `--mergePaths <paths>`: Merges with existing POT file(s).
|
|
44
|
+
- `--subtractPaths <paths>`: Subtracts strings from existing POT file(s).
|
|
45
|
+
- `--subtractAndMerge`: Subtracts and merges strings from existing POT file(s).
|
|
46
|
+
- `--include <files>`: Includes specific files for processing.
|
|
47
|
+
- `--exclude <files>`: Excludes specific files from processing.
|
|
48
|
+
- `--silent`: Suppresses output to stdout.
|
|
49
|
+
- `--json`: Outputs the JSON gettext data.
|
|
50
|
+
- `--output`: Outputs the gettext data.
|
|
51
|
+
|
|
52
|
+
### Credits
|
|
53
|
+
|
|
54
|
+
This module is heavily inspired by the original `makepot` command from [WP-CLI](https://github.com/wp-cli/i18n-command).
|
|
55
|
+
Special thanks to the maintainers in particular [Swissspidy](https://github.com/swissspidy) which
|
|
56
|
+
has been very helpful with suggestions and tips on how to rebuild `make-pot`.
|
|
57
|
+
|
|
58
|
+
Feel free to contribute or report issues on [GitHub](https://github.com/example/example).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "name",
|
|
3
|
+
"url": "url",
|
|
4
|
+
"description": "description",
|
|
5
|
+
"author": "author",
|
|
6
|
+
"authorEmail": "authorEmail",
|
|
7
|
+
"version": "version",
|
|
8
|
+
"bugs": "bugs",
|
|
9
|
+
"bugs.url": "bugsUrl",
|
|
10
|
+
"bugs.email": "bugsEmail",
|
|
11
|
+
"license": "license",
|
|
12
|
+
"repository": "repository"
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Plugin Name",
|
|
3
|
+
"url": "Plugin URI",
|
|
4
|
+
"description": "Description",
|
|
5
|
+
"version": "Version",
|
|
6
|
+
"author": "Author",
|
|
7
|
+
"authorUri": "Author URI",
|
|
8
|
+
"tags": "Tags",
|
|
9
|
+
"license": "License",
|
|
10
|
+
"licenseUri": "License URI",
|
|
11
|
+
"updateUri": "Update URI",
|
|
12
|
+
"domainPath": "Domain Path",
|
|
13
|
+
"textDomain": "Text Domain"
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Theme Name",
|
|
3
|
+
"author": "Author",
|
|
4
|
+
"authorUri": "Author URI",
|
|
5
|
+
"description": "Description",
|
|
6
|
+
"url": "Theme URI",
|
|
7
|
+
"tags": "Tags",
|
|
8
|
+
"version": "Version",
|
|
9
|
+
"license": "License",
|
|
10
|
+
"licenseUri": "License URI",
|
|
11
|
+
"domainPath": "Domain Path",
|
|
12
|
+
"textDomain": "Text Domain"
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getArgs(): import("../types").Args;
|
package/lib/cli/index.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getArgs = void 0;
|
|
7
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
8
|
+
const helpers_1 = require("yargs/helpers");
|
|
9
|
+
const process_1 = __importDefault(require("process"));
|
|
10
|
+
const parseCli_1 = require("./parseCli");
|
|
11
|
+
function getArgs() {
|
|
12
|
+
const args = (0, yargs_1.default)((0, helpers_1.hideBin)(process_1.default.argv))
|
|
13
|
+
.help('h')
|
|
14
|
+
.alias('help', 'help')
|
|
15
|
+
.usage('Usage: $0 <source> [destination] [options]')
|
|
16
|
+
.positional('sourceDirectory', {
|
|
17
|
+
describe: 'Source directory',
|
|
18
|
+
type: 'string',
|
|
19
|
+
})
|
|
20
|
+
.positional('destination', {
|
|
21
|
+
describe: 'Destination directory',
|
|
22
|
+
type: 'string',
|
|
23
|
+
})
|
|
24
|
+
.options({
|
|
25
|
+
slug: {
|
|
26
|
+
describe: 'Plugin or theme slug',
|
|
27
|
+
type: 'string',
|
|
28
|
+
},
|
|
29
|
+
domain: {
|
|
30
|
+
describe: 'Text domain to look for in the source code',
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
'skip-js': {
|
|
34
|
+
describe: 'Skip JavaScript files',
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
},
|
|
37
|
+
'skip-php': {
|
|
38
|
+
describe: 'Skip PHP files',
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
},
|
|
41
|
+
'skip-blade': {
|
|
42
|
+
describe: 'Skip Blade files',
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
},
|
|
45
|
+
'skip-block-json': {
|
|
46
|
+
describe: 'Skip block.json files',
|
|
47
|
+
type: 'boolean',
|
|
48
|
+
},
|
|
49
|
+
'skip-theme-json': {
|
|
50
|
+
describe: 'Skip theme.json files',
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
},
|
|
53
|
+
'skip-audit': {
|
|
54
|
+
describe: 'Skip auditing of strings',
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
},
|
|
57
|
+
headers: {
|
|
58
|
+
describe: 'Headers',
|
|
59
|
+
type: 'string',
|
|
60
|
+
},
|
|
61
|
+
'file-comment': {
|
|
62
|
+
describe: 'File comment',
|
|
63
|
+
type: 'string',
|
|
64
|
+
},
|
|
65
|
+
'package-name': {
|
|
66
|
+
describe: 'Package name',
|
|
67
|
+
type: 'string',
|
|
68
|
+
},
|
|
69
|
+
location: {
|
|
70
|
+
describe: 'Include location information',
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
},
|
|
73
|
+
'ignore-domain': {
|
|
74
|
+
describe: 'Ignore text domain',
|
|
75
|
+
type: 'boolean',
|
|
76
|
+
},
|
|
77
|
+
mergePaths: {
|
|
78
|
+
describe: 'Merge with existing POT file(s)',
|
|
79
|
+
type: 'string',
|
|
80
|
+
},
|
|
81
|
+
subtractPaths: {
|
|
82
|
+
describe: 'Subtract strings from existing POT file(s)',
|
|
83
|
+
type: 'string',
|
|
84
|
+
},
|
|
85
|
+
subtractAndMerge: {
|
|
86
|
+
describe: 'Subtract and merge strings from existing POT file(s)',
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
},
|
|
89
|
+
include: {
|
|
90
|
+
describe: 'Include specific files',
|
|
91
|
+
type: 'string',
|
|
92
|
+
},
|
|
93
|
+
exclude: {
|
|
94
|
+
describe: 'Exclude specific files',
|
|
95
|
+
type: 'string',
|
|
96
|
+
},
|
|
97
|
+
silent: {
|
|
98
|
+
describe: 'No output to stdout',
|
|
99
|
+
type: 'boolean',
|
|
100
|
+
},
|
|
101
|
+
json: {
|
|
102
|
+
describe: 'Output the json gettext data',
|
|
103
|
+
type: 'boolean',
|
|
104
|
+
},
|
|
105
|
+
output: {
|
|
106
|
+
describe: 'Output the gettext data',
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
.parseSync();
|
|
111
|
+
return (0, parseCli_1.parseCliArgs)(args);
|
|
112
|
+
}
|
|
113
|
+
exports.getArgs = getArgs;
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","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AAc;YACxB,IAAI,EAAE,QAAQ;SACd;QACD,cAAc,EAAE;YACf,QAAQ,EAAE,cAAc;YACxB,IAAI,EAAE,QAAQ;SACd;QACD,QAAQ,EAAE;YACT,QAAQ,EAAE,8BAA8B;YACxC,IAAI,EAAE,SAAS;SACf;QACD,eAAe,EAAE;YAChB,QAAQ,EAAE,oBAAoB;YAC9B,IAAI,EAAE,SAAS;SACf;QACD,UAAU,EAAE;YACX,QAAQ,EAAE,iCAAiC;YAC3C,IAAI,EAAE,QAAQ;SACd;QACD,aAAa,EAAE;YACd,QAAQ,EAAE,4CAA4C;YACtD,IAAI,EAAE,QAAQ;SACd;QACD,gBAAgB,EAAE;YACjB,QAAQ,EACP,sDAAsD;YACvD,IAAI,EAAE,SAAS;SACf;QACD,OAAO,EAAE;YACR,QAAQ,EAAE,wBAAwB;YAClC,IAAI,EAAE,QAAQ;SACd;QACD,OAAO,EAAE;YACR,QAAQ,EAAE,wBAAwB;YAClC,IAAI,EAAE,QAAQ;SACd;QACD,MAAM,EAAE;YACP,QAAQ,EAAE,qBAAqB;YAC/B,IAAI,EAAE,SAAS;SACf;QACD,IAAI,EAAE;YACL,QAAQ,EAAE,8BAA8B;YACxC,IAAI,EAAE,SAAS;SACf;QACD,MAAM,EAAE;YACP,QAAQ,EAAE,yBAAyB;YACnC,IAAI,EAAE,SAAS;SACf;KACD,CAAC;SACD,SAAS,EAAE,CAAA;IACb,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,CAAA;AAC1B,CAAC;AAtGD,0BAsGC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.parseCliArgs = void 0;
|
|
27
|
+
const utils_1 = require("../utils");
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const process = __importStar(require("process"));
|
|
30
|
+
const const_1 = require("../const");
|
|
31
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
32
|
+
function isThemeOrPlugin(currentPath = '/', slug) {
|
|
33
|
+
const currentWorkingDirectory = currentPath;
|
|
34
|
+
try {
|
|
35
|
+
(0, node_fs_1.accessSync)(path.join(currentWorkingDirectory, slug + '.php'), node_fs_1.default.constants.R_OK);
|
|
36
|
+
return 'plugin';
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
console.log('the current working directory ' +
|
|
40
|
+
currentWorkingDirectory +
|
|
41
|
+
' does not contain a ' +
|
|
42
|
+
slug +
|
|
43
|
+
'.php file');
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
(0, node_fs_1.accessSync)(path.join(currentWorkingDirectory, 'style.css'), node_fs_1.default.constants.R_OK);
|
|
47
|
+
return 'theme';
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
console.log('the current working directory ' +
|
|
51
|
+
currentWorkingDirectory +
|
|
52
|
+
' does not contain a style.css file');
|
|
53
|
+
}
|
|
54
|
+
if (currentWorkingDirectory.includes('themes')) {
|
|
55
|
+
return 'theme';
|
|
56
|
+
}
|
|
57
|
+
else if (currentWorkingDirectory.includes('plugins')) {
|
|
58
|
+
return 'plugin';
|
|
59
|
+
}
|
|
60
|
+
return 'generic';
|
|
61
|
+
}
|
|
62
|
+
function parseCliArgs(args) {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
|
+
const inputPath = typeof args._[0] === 'string' ? args._[0] : '.';
|
|
65
|
+
const outputPath = typeof args._[1] === 'string' ? args._[1] : '.';
|
|
66
|
+
const currentWorkingDirectory = process.cwd();
|
|
67
|
+
const slug = args.slug && typeof args.slug === 'string'
|
|
68
|
+
? args.slug
|
|
69
|
+
: path.basename(path.resolve(currentWorkingDirectory, inputPath));
|
|
70
|
+
const cwd = path.relative(currentWorkingDirectory, inputPath);
|
|
71
|
+
const out = path.relative(currentWorkingDirectory, outputPath);
|
|
72
|
+
const domain = (_a = args === null || args === void 0 ? void 0 : args.domain) !== null && _a !== void 0 ? _a : isThemeOrPlugin(path.resolve(cwd), slug);
|
|
73
|
+
const parsedArgs = {
|
|
74
|
+
slug: slug,
|
|
75
|
+
domain: domain,
|
|
76
|
+
paths: { cwd: cwd, out: out },
|
|
77
|
+
options: {
|
|
78
|
+
ignoreDomain: !!(args === null || args === void 0 ? void 0 : args.ignoreDomain),
|
|
79
|
+
packageName: String(args.packageName),
|
|
80
|
+
silent: !!args.silent,
|
|
81
|
+
json: !!args.json,
|
|
82
|
+
location: !!(args === null || args === void 0 ? void 0 : args.location),
|
|
83
|
+
output: !!(args === null || args === void 0 ? void 0 : args.output),
|
|
84
|
+
fileComment: args.fileComment
|
|
85
|
+
? String(args.fileComment)
|
|
86
|
+
: undefined,
|
|
87
|
+
skip: {
|
|
88
|
+
js: !!args.skipJs,
|
|
89
|
+
php: !!args.skipPhp,
|
|
90
|
+
blade: !!args.skipBlade,
|
|
91
|
+
blockJson: !!args.skipBlockJson,
|
|
92
|
+
themeJson: !!args.skipThemeJson,
|
|
93
|
+
audit: !!args.skipAudit,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
headers: {
|
|
97
|
+
fileComment: (_b = args.fileComment) !== null && _b !== void 0 ? _b : '',
|
|
98
|
+
},
|
|
99
|
+
patterns: {
|
|
100
|
+
mergePaths: (_c = (0, utils_1.stringstring)(args.mergePaths)) !== null && _c !== void 0 ? _c : [],
|
|
101
|
+
subtractPaths: (_d = (0, utils_1.stringstring)(args.subtractPaths)) !== null && _d !== void 0 ? _d : [],
|
|
102
|
+
subtractAndMerge: !!args.subtractAndMerge,
|
|
103
|
+
include: (_e = (0, utils_1.stringstring)(args.include)) !== null && _e !== void 0 ? _e : ['**'],
|
|
104
|
+
exclude: (_f = (0, utils_1.stringstring)(args.exclude)) !== null && _f !== void 0 ? _f : const_1.DEFAULT_EXCLUDED_PATH,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
parsedArgs.paths.root = args.root ? String(args.root) : undefined;
|
|
108
|
+
return parsedArgs;
|
|
109
|
+
}
|
|
110
|
+
exports.parseCliArgs = parseCliArgs;
|
|
111
|
+
//# sourceMappingURL=parseCli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCli.js","sourceRoot":"","sources":["../../src/cli/parseCli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oCAAuC;AACvC,2CAA4B;AAC5B,iDAAkC;AAClC,oCAAgD;AAEhD,mDAAwC;AAGxC,SAAS,eAAe,CAAC,cAAsB,GAAG,EAAE,IAAY;IAC/D,MAAM,uBAAuB,GAAG,WAAW,CAAA;IAE3C,IAAI,CAAC;QACJ,IAAA,oBAAU,EAC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;gBAC1B,CAAC,CAAC,SAAS;YACZ,IAAI,EAAE;gBACL,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM;gBACjB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO;gBACnB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;gBACvB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa;gBAC/B,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa;gBAC/B,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;aACvB;SACD;QAED,OAAO,EAAE;YACR,WAAW,EAAE,MAAC,IAAI,CAAC,WAAsB,mCAAI,EAAE;SAC/C;QAED,QAAQ,EAAE;YACT,UAAU,EAAE,MAAA,IAAA,oBAAY,EAAC,IAAI,CAAC,UAAoB,CAAC,mCAAI,EAAE;YACzD,aAAa,EAAE,MAAA,IAAA,oBAAY,EAAC,IAAI,CAAC,aAAuB,CAAC,mCAAI,EAAE;YAC/D,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB;YACzC,OAAO,EAAE,MAAA,IAAA,oBAAY,EAAC,IAAI,CAAC,OAAiB,CAAC,mCAAI,CAAC,IAAI,CAAC;YACvD,OAAO,EACN,MAAA,IAAA,oBAAY,EAAC,IAAI,CAAC,OAAiB,CAAC,mCAAI,6BAAqB;SAC9D;KACD,CAAA;IAED,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAEjE,OAAO,UAAU,CAAA;AAClB,CAAC;AA3DD,oCA2DC"}
|
package/lib/cliArgs.js
CHANGED
|
@@ -33,6 +33,37 @@ const utils_1 = require("./utils");
|
|
|
33
33
|
const path = __importStar(require("path"));
|
|
34
34
|
const process = __importStar(require("process"));
|
|
35
35
|
const const_1 = require("./const");
|
|
36
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
37
|
+
function isThemeOrPlugin(currentPath = '/', slug) {
|
|
38
|
+
const currentWorkingDirectory = currentPath;
|
|
39
|
+
try {
|
|
40
|
+
(0, node_fs_1.accessSync)(path.join(currentWorkingDirectory, slug + '.php'), node_fs_1.default.constants.R_OK);
|
|
41
|
+
return 'plugin';
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
console.log('the current working directory ' +
|
|
45
|
+
currentWorkingDirectory +
|
|
46
|
+
' does not contain a ' +
|
|
47
|
+
slug +
|
|
48
|
+
'.php file');
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
(0, node_fs_1.accessSync)(path.join(currentWorkingDirectory, 'style.css'), node_fs_1.default.constants.R_OK);
|
|
52
|
+
return 'theme';
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
console.log('the current working directory ' +
|
|
56
|
+
currentWorkingDirectory +
|
|
57
|
+
' does not contain a style.css file');
|
|
58
|
+
}
|
|
59
|
+
if (currentWorkingDirectory.includes('themes')) {
|
|
60
|
+
return 'theme';
|
|
61
|
+
}
|
|
62
|
+
else if (currentWorkingDirectory.includes('plugins')) {
|
|
63
|
+
return 'plugin';
|
|
64
|
+
}
|
|
65
|
+
return 'generic';
|
|
66
|
+
}
|
|
36
67
|
function getArgs() {
|
|
37
68
|
const args = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
38
69
|
.help('h')
|
|
@@ -141,13 +172,14 @@ function parseCliArgs(args) {
|
|
|
141
172
|
const inputPath = typeof args._[0] === 'string' ? args._[0] : '.';
|
|
142
173
|
const outputPath = typeof args._[1] === 'string' ? args._[1] : '.';
|
|
143
174
|
const currentWorkingDirectory = process.cwd();
|
|
175
|
+
const slug = args.slug && typeof args.slug === 'string'
|
|
176
|
+
? args.slug
|
|
177
|
+
: path.basename(path.resolve(currentWorkingDirectory, inputPath));
|
|
144
178
|
const cwd = path.relative(currentWorkingDirectory, inputPath);
|
|
145
179
|
const out = path.relative(currentWorkingDirectory, outputPath);
|
|
146
|
-
const domain = (_a = args === null || args === void 0 ? void 0 : args.domain) !== null && _a !== void 0 ? _a :
|
|
180
|
+
const domain = (_a = args === null || args === void 0 ? void 0 : args.domain) !== null && _a !== void 0 ? _a : isThemeOrPlugin(path.resolve(cwd), slug);
|
|
147
181
|
const parsedArgs = {
|
|
148
|
-
slug:
|
|
149
|
-
? args.slug
|
|
150
|
-
: path.basename(path.resolve(currentWorkingDirectory, inputPath)),
|
|
182
|
+
slug: slug,
|
|
151
183
|
domain: domain,
|
|
152
184
|
paths: { cwd: cwd, out: out },
|
|
153
185
|
options: {
|
package/lib/cliArgs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliArgs.js","sourceRoot":"","sources":["../src/cliArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,2CAAuC;AACvC,mCAAsC;AACtC,2CAA4B;AAC5B,iDAAkC;AAClC,mCAA+C;
|
|
1
|
+
{"version":3,"file":"cliArgs.js","sourceRoot":"","sources":["../src/cliArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,2CAAuC;AACvC,mCAAsC;AACtC,2CAA4B;AAC5B,iDAAkC;AAClC,mCAA+C;AAE/C,mDAAwC;AAExC,SAAS,eAAe,CAAC,cAAsB,GAAG,EAAE,IAAY;IAC/D,MAAM,uBAAuB,GAAG,WAAW,CAAA;IAE3C,IAAI,CAAC;QACJ,IAAA,oBAAU,EACT,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,GAAG,MAAM,CAAC,EACjD,iBAAE,CAAC,SAAS,CAAC,IAAI,CACjB,CAAA;QACD,OAAO,QAAQ,CAAA;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QAEd,OAAO,CAAC,GAAG,CACV,gCAAgC;YAC/B,uBAAuB;Y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AAC,mCAAI,CAAC,IAAI,CAAC;YACvD,OAAO,EACN,MAAA,IAAA,oBAAY,EAAC,IAAI,CAAC,OAAiB,CAAC,mCAAI,6BAAqB;SAC9D;KACD,CAAA;IAED,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAEjE,OAAO,UAAU,CAAA;AAClB,CAAC;AAzDD,oCAyDC"}
|
package/lib/const.d.ts
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
+
export declare const pkgJson: Record<string, unknown>;
|
|
2
|
+
export declare const themeJson: {
|
|
3
|
+
title: string;
|
|
4
|
+
settings: {
|
|
5
|
+
typography: {
|
|
6
|
+
fontSizes: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
fontFamilies: {
|
|
10
|
+
name: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
color: {
|
|
14
|
+
palette: {
|
|
15
|
+
name: string;
|
|
16
|
+
}[];
|
|
17
|
+
gradients: {
|
|
18
|
+
name: string;
|
|
19
|
+
}[];
|
|
20
|
+
duotone: {
|
|
21
|
+
name: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
spacing: {
|
|
25
|
+
spacingSizes: {
|
|
26
|
+
name: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
blocks: {
|
|
30
|
+
"*": {
|
|
31
|
+
typography: {
|
|
32
|
+
fontSizes: {
|
|
33
|
+
name: string;
|
|
34
|
+
}[];
|
|
35
|
+
fontFamilies: {
|
|
36
|
+
name: string;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
color: {
|
|
40
|
+
palette: {
|
|
41
|
+
name: string;
|
|
42
|
+
}[];
|
|
43
|
+
gradients: {
|
|
44
|
+
name: string;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
spacing: {
|
|
48
|
+
spacingSizes: {
|
|
49
|
+
name: string;
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
customTemplates: {
|
|
56
|
+
title: string;
|
|
57
|
+
}[];
|
|
58
|
+
templateParts: {
|
|
59
|
+
title: string;
|
|
60
|
+
}[];
|
|
61
|
+
};
|
|
62
|
+
export declare const blockJson: {
|
|
63
|
+
title: string;
|
|
64
|
+
description: string;
|
|
65
|
+
keywords: string[];
|
|
66
|
+
styles: {
|
|
67
|
+
label: string;
|
|
68
|
+
}[];
|
|
69
|
+
variations: {
|
|
70
|
+
title: string;
|
|
71
|
+
description: string;
|
|
72
|
+
keywords: string[];
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
export declare const pkgJsonHeaders: {
|
|
76
|
+
name: string;
|
|
77
|
+
url: string;
|
|
78
|
+
description: string;
|
|
79
|
+
author: string;
|
|
80
|
+
authorEmail: string;
|
|
81
|
+
version: string;
|
|
82
|
+
bugs: string;
|
|
83
|
+
"bugs.url": string;
|
|
84
|
+
"bugs.email": string;
|
|
85
|
+
license: string;
|
|
86
|
+
repository: string;
|
|
87
|
+
};
|
|
88
|
+
export declare const pluginHeaders: {
|
|
89
|
+
name: string;
|
|
90
|
+
url: string;
|
|
91
|
+
description: string;
|
|
92
|
+
version: string;
|
|
93
|
+
author: string;
|
|
94
|
+
authorUri: string;
|
|
95
|
+
tags: string;
|
|
96
|
+
license: string;
|
|
97
|
+
licenseUri: string;
|
|
98
|
+
updateUri: string;
|
|
99
|
+
domainPath: string;
|
|
100
|
+
textDomain: string;
|
|
101
|
+
};
|
|
102
|
+
export declare const themeHeaders: {
|
|
103
|
+
name: string;
|
|
104
|
+
author: string;
|
|
105
|
+
authorUri: string;
|
|
106
|
+
description: string;
|
|
107
|
+
url: string;
|
|
108
|
+
tags: string;
|
|
109
|
+
version: string;
|
|
110
|
+
license: string;
|
|
111
|
+
licenseUri: string;
|
|
112
|
+
domainPath: string;
|
|
113
|
+
textDomain: string;
|
|
114
|
+
};
|
|
1
115
|
export declare const DEFAULT_EXCLUDED_PATH: string[];
|
|
2
116
|
export declare const allowedFiles: string[];
|
|
3
117
|
export declare const i18nFunctions: {
|