@sandstone-mc/mcdoc-ts-generator 0.1.3 → 0.1.5
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/dist/cli.js +7 -2
- package/dist/index.js +7 -2
- package/dist/typegen/export.d.ts +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2543,10 +2543,13 @@ function dispatcher_symbol(id, name, members, dispatcher_properties, module_map,
|
|
|
2543
2543
|
var DispatcherSymbol = dispatcher_symbol;
|
|
2544
2544
|
|
|
2545
2545
|
// src/typegen/export.ts
|
|
2546
|
+
import { TaggableResourceLocationCategories } from "@spyglassmc/core";
|
|
2546
2547
|
import ts25 from "typescript";
|
|
2547
2548
|
var { factory: factory24 } = ts25;
|
|
2548
2549
|
function export_registry(resolved_registries) {
|
|
2549
2550
|
let imports;
|
|
2551
|
+
imports = add_import(imports, "sandstone::Set");
|
|
2552
|
+
imports = add_import(imports, "sandstone::SetType");
|
|
2550
2553
|
const properties = [];
|
|
2551
2554
|
for (const [registry_name, { import_path, registry }] of resolved_registries) {
|
|
2552
2555
|
imports = add_import(imports, import_path);
|
|
@@ -2554,8 +2557,10 @@ function export_registry(resolved_registries) {
|
|
|
2554
2557
|
properties.push(factory24.createPropertySignature(undefined, factory24.createStringLiteral(registry_id), undefined, factory24.createTypeReferenceNode(registry)));
|
|
2555
2558
|
}
|
|
2556
2559
|
const registry_type = factory24.createTypeAliasDeclaration([factory24.createToken(ts25.SyntaxKind.ExportKeyword)], "Registry", undefined, factory24.createTypeLiteralNode(properties));
|
|
2560
|
+
const registries_set = factory24.createVariableStatement([factory24.createToken(ts25.SyntaxKind.ExportKeyword)], factory24.createVariableDeclarationList([factory24.createVariableDeclaration("REGISTRIES_SET", undefined, undefined, factory24.createNewExpression(factory24.createIdentifier("Set"), undefined, [factory24.createAsExpression(factory24.createArrayLiteralExpression(TaggableResourceLocationCategories.map((category) => factory24.createStringLiteral(category, true)), true), factory24.createTypeReferenceNode("const"))]))], ts25.NodeFlags.Const));
|
|
2561
|
+
const registries_type = factory24.createTypeAliasDeclaration([factory24.createToken(ts25.SyntaxKind.ExportKeyword)], "REGISTRIES", undefined, factory24.createTypeReferenceNode("SetType", [factory24.createTypeQueryNode(factory24.createIdentifier("REGISTRIES_SET"))]));
|
|
2557
2562
|
return {
|
|
2558
|
-
exports: [registry_type],
|
|
2563
|
+
exports: [registry_type, registries_set, registries_type],
|
|
2559
2564
|
paths: new Set,
|
|
2560
2565
|
...add({ imports })
|
|
2561
2566
|
};
|
|
@@ -2798,7 +2803,7 @@ var eslint = new ESLint({
|
|
|
2798
2803
|
overrideConfig: [
|
|
2799
2804
|
wrap.config({
|
|
2800
2805
|
maxLen: 120,
|
|
2801
|
-
tabWidth:
|
|
2806
|
+
tabWidth: 2,
|
|
2802
2807
|
autoFix: true,
|
|
2803
2808
|
severity: "warn"
|
|
2804
2809
|
}),
|
package/dist/index.js
CHANGED
|
@@ -2541,10 +2541,13 @@ function dispatcher_symbol(id, name, members, dispatcher_properties, module_map,
|
|
|
2541
2541
|
var DispatcherSymbol = dispatcher_symbol;
|
|
2542
2542
|
|
|
2543
2543
|
// src/typegen/export.ts
|
|
2544
|
+
import { TaggableResourceLocationCategories } from "@spyglassmc/core";
|
|
2544
2545
|
import ts25 from "typescript";
|
|
2545
2546
|
var { factory: factory24 } = ts25;
|
|
2546
2547
|
function export_registry(resolved_registries) {
|
|
2547
2548
|
let imports;
|
|
2549
|
+
imports = add_import(imports, "sandstone::Set");
|
|
2550
|
+
imports = add_import(imports, "sandstone::SetType");
|
|
2548
2551
|
const properties = [];
|
|
2549
2552
|
for (const [registry_name, { import_path, registry }] of resolved_registries) {
|
|
2550
2553
|
imports = add_import(imports, import_path);
|
|
@@ -2552,8 +2555,10 @@ function export_registry(resolved_registries) {
|
|
|
2552
2555
|
properties.push(factory24.createPropertySignature(undefined, factory24.createStringLiteral(registry_id), undefined, factory24.createTypeReferenceNode(registry)));
|
|
2553
2556
|
}
|
|
2554
2557
|
const registry_type = factory24.createTypeAliasDeclaration([factory24.createToken(ts25.SyntaxKind.ExportKeyword)], "Registry", undefined, factory24.createTypeLiteralNode(properties));
|
|
2558
|
+
const registries_set = factory24.createVariableStatement([factory24.createToken(ts25.SyntaxKind.ExportKeyword)], factory24.createVariableDeclarationList([factory24.createVariableDeclaration("REGISTRIES_SET", undefined, undefined, factory24.createNewExpression(factory24.createIdentifier("Set"), undefined, [factory24.createAsExpression(factory24.createArrayLiteralExpression(TaggableResourceLocationCategories.map((category) => factory24.createStringLiteral(category, true)), true), factory24.createTypeReferenceNode("const"))]))], ts25.NodeFlags.Const));
|
|
2559
|
+
const registries_type = factory24.createTypeAliasDeclaration([factory24.createToken(ts25.SyntaxKind.ExportKeyword)], "REGISTRIES", undefined, factory24.createTypeReferenceNode("SetType", [factory24.createTypeQueryNode(factory24.createIdentifier("REGISTRIES_SET"))]));
|
|
2555
2560
|
return {
|
|
2556
|
-
exports: [registry_type],
|
|
2561
|
+
exports: [registry_type, registries_set, registries_type],
|
|
2557
2562
|
paths: new Set,
|
|
2558
2563
|
...add({ imports })
|
|
2559
2564
|
};
|
|
@@ -2796,7 +2801,7 @@ var eslint = new ESLint({
|
|
|
2796
2801
|
overrideConfig: [
|
|
2797
2802
|
wrap.config({
|
|
2798
2803
|
maxLen: 120,
|
|
2799
|
-
tabWidth:
|
|
2804
|
+
tabWidth: 2,
|
|
2800
2805
|
autoFix: true,
|
|
2801
2806
|
severity: "warn"
|
|
2802
2807
|
}),
|
package/dist/typegen/export.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import ts from 'typescript';
|
|
|
2
2
|
import { type NonEmptyList } from './mcdoc/utils';
|
|
3
3
|
import type { ResolvedDispatcher, ResolvedRegistry } from '.';
|
|
4
4
|
export declare function export_registry(resolved_registries: Map<string, ResolvedRegistry>): {
|
|
5
|
-
readonly exports: ts.TypeAliasDeclaration[];
|
|
5
|
+
readonly exports: (ts.TypeAliasDeclaration | ts.VariableStatement)[];
|
|
6
6
|
readonly paths: Set<string>;
|
|
7
7
|
} | {
|
|
8
8
|
readonly imports: {
|
|
9
9
|
readonly ordered: NonEmptyList<string>;
|
|
10
10
|
readonly check: Map<string, number>;
|
|
11
11
|
};
|
|
12
|
-
readonly exports: ts.TypeAliasDeclaration[];
|
|
12
|
+
readonly exports: (ts.TypeAliasDeclaration | ts.VariableStatement)[];
|
|
13
13
|
readonly paths: Set<string>;
|
|
14
14
|
};
|
|
15
15
|
/**
|