@spyglassmc/mcdoc-cli 0.1.20 → 0.1.22
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/lib/commands/export.d.ts +1 -0
- package/lib/commands/export.js +4 -0
- package/lib/commands/locale.js +5 -5
- package/lib/index.js +1 -0
- package/package.json +3 -3
package/lib/commands/export.d.ts
CHANGED
package/lib/commands/export.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as mcdoc from '@spyglassmc/mcdoc';
|
|
2
|
+
import * as cp from 'child_process';
|
|
2
3
|
import { resolve } from 'path';
|
|
3
4
|
import { pathToFileURL } from 'url';
|
|
5
|
+
import { promisify } from 'util';
|
|
4
6
|
import { createLogger, createProject as createProject, sortMaps, writeJson } from '../common.js';
|
|
7
|
+
const execFile = promisify(cp.execFile);
|
|
5
8
|
export async function exportCommand(args) {
|
|
6
9
|
const logger = createLogger(args.verbose);
|
|
7
10
|
const project = await createProject(logger, args.source);
|
|
@@ -26,6 +29,7 @@ export async function exportCommand(args) {
|
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
const output = {
|
|
32
|
+
...args.ref ? { ref: (await execFile('git', ['rev-parse', 'HEAD'])).stdout.trim() } : {},
|
|
29
33
|
mcdoc: sortMaps(data.mcdoc),
|
|
30
34
|
'mcdoc/dispatcher': sortMaps(data['mcdoc/dispatcher']),
|
|
31
35
|
};
|
package/lib/commands/locale.js
CHANGED
|
@@ -36,11 +36,11 @@ export async function localeCommand(args) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
else if (type.kind === 'enum') {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
for (const field of type.values) {
|
|
40
|
+
if (field.desc) {
|
|
41
|
+
add(`${name}.${field.identifier}`, field.desc);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
44
|
}
|
|
45
45
|
else if (type.kind === 'list') {
|
|
46
46
|
collect(name, type.item);
|
package/lib/index.js
CHANGED
|
@@ -14,6 +14,7 @@ await CLI.scriptName('mcdoc')
|
|
|
14
14
|
})
|
|
15
15
|
.option('source', { describe: 'directory containing mcdoc sources', default: '.' })
|
|
16
16
|
.option('gzip', { type: 'boolean', default: false })
|
|
17
|
+
.option('ref', { type: 'boolean', default: false })
|
|
17
18
|
.option('verbose', { alias: 'v', type: 'boolean', default: false });
|
|
18
19
|
}, exportCommand)
|
|
19
20
|
.command('locale <output>', 'Generate and upgrade locales.', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spyglassmc/mcdoc-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"line-column": "^1.0.2",
|
|
34
34
|
"ofetch": "^1.3.4",
|
|
35
35
|
"yargs": "17.6.2",
|
|
36
|
-
"@spyglassmc/core": "0.4.
|
|
37
|
-
"@spyglassmc/mcdoc": "0.3.
|
|
36
|
+
"@spyglassmc/core": "0.4.17",
|
|
37
|
+
"@spyglassmc/mcdoc": "0.3.21"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/fs-extra": "^11.0.2",
|