@gmb/bitmark-parser-generator 4.7.0 → 4.8.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/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/browser/cjs/index.cjs +26 -1
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +9 -0
- package/dist/browser/esm/index.d.ts +9 -0
- package/dist/browser/esm/index.js +26 -1
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/index.cjs +284 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +284 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1421,6 +1421,7 @@ declare const ConfigKey: Readonly<{
|
|
|
1421
1421
|
property_reference: "@reference";
|
|
1422
1422
|
property_refPublicationYear: "@refPublicationYear";
|
|
1423
1423
|
property_refPublisher: "@refPublisher";
|
|
1424
|
+
property_relatedBook: "@relatedBook";
|
|
1424
1425
|
property_releaseDate: "@releaseDate";
|
|
1425
1426
|
property_releaseKind: "@releaseKind";
|
|
1426
1427
|
property_releaseVersion: "@releaseVersion";
|
|
@@ -1713,6 +1714,7 @@ declare const ConfigKey: Readonly<{
|
|
|
1713
1714
|
property_reference: "@reference";
|
|
1714
1715
|
property_refPublicationYear: "@refPublicationYear";
|
|
1715
1716
|
property_refPublisher: "@refPublisher";
|
|
1717
|
+
property_relatedBook: "@relatedBook";
|
|
1716
1718
|
property_releaseDate: "@releaseDate";
|
|
1717
1719
|
property_releaseKind: "@releaseKind";
|
|
1718
1720
|
property_releaseVersion: "@releaseVersion";
|
|
@@ -2539,6 +2541,7 @@ interface BitJson {
|
|
|
2539
2541
|
publisher: string | string[];
|
|
2540
2542
|
publisherName: string;
|
|
2541
2543
|
publications: string | string[];
|
|
2544
|
+
relatedBook: string | string[];
|
|
2542
2545
|
author: string | string[];
|
|
2543
2546
|
subject: string | string[];
|
|
2544
2547
|
date: string;
|
|
@@ -3061,6 +3064,7 @@ interface Bit {
|
|
|
3061
3064
|
coverImage?: Property;
|
|
3062
3065
|
coverColor?: Property;
|
|
3063
3066
|
publications?: Property;
|
|
3067
|
+
relatedBook?: Property;
|
|
3064
3068
|
author?: Property;
|
|
3065
3069
|
subject?: Property;
|
|
3066
3070
|
date?: Property;
|
|
@@ -3663,6 +3667,8 @@ declare const NodeType: Readonly<{
|
|
|
3663
3667
|
referencePropertyValue: "referencePropertyValue";
|
|
3664
3668
|
refPublicationYear: "refPublicationYear";
|
|
3665
3669
|
refPublisher: "refPublisher";
|
|
3670
|
+
relatedBook: "relatedBook";
|
|
3671
|
+
relatedBookValue: "relatedBookValue";
|
|
3666
3672
|
releaseDate: "releaseDate";
|
|
3667
3673
|
releaseDateValue: "releaseDateValue";
|
|
3668
3674
|
releaseKind: "releaseKind";
|
|
@@ -4220,6 +4226,8 @@ declare const NodeType: Readonly<{
|
|
|
4220
4226
|
referencePropertyValue: "referencePropertyValue";
|
|
4221
4227
|
refPublicationYear: "refPublicationYear";
|
|
4222
4228
|
refPublisher: "refPublisher";
|
|
4229
|
+
relatedBook: "relatedBook";
|
|
4230
|
+
relatedBookValue: "relatedBookValue";
|
|
4223
4231
|
releaseDate: "releaseDate";
|
|
4224
4232
|
releaseDateValue: "releaseDateValue";
|
|
4225
4233
|
releaseKind: "releaseKind";
|
|
@@ -5288,6 +5296,7 @@ declare class Builder extends BaseBuilder {
|
|
|
5288
5296
|
coverImage?: string | string[];
|
|
5289
5297
|
coverColor?: string;
|
|
5290
5298
|
publications?: string | string[];
|
|
5299
|
+
relatedBook?: string | string[];
|
|
5291
5300
|
author?: string | string[];
|
|
5292
5301
|
subject?: string | string[];
|
|
5293
5302
|
date?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1421,6 +1421,7 @@ declare const ConfigKey: Readonly<{
|
|
|
1421
1421
|
property_reference: "@reference";
|
|
1422
1422
|
property_refPublicationYear: "@refPublicationYear";
|
|
1423
1423
|
property_refPublisher: "@refPublisher";
|
|
1424
|
+
property_relatedBook: "@relatedBook";
|
|
1424
1425
|
property_releaseDate: "@releaseDate";
|
|
1425
1426
|
property_releaseKind: "@releaseKind";
|
|
1426
1427
|
property_releaseVersion: "@releaseVersion";
|
|
@@ -1713,6 +1714,7 @@ declare const ConfigKey: Readonly<{
|
|
|
1713
1714
|
property_reference: "@reference";
|
|
1714
1715
|
property_refPublicationYear: "@refPublicationYear";
|
|
1715
1716
|
property_refPublisher: "@refPublisher";
|
|
1717
|
+
property_relatedBook: "@relatedBook";
|
|
1716
1718
|
property_releaseDate: "@releaseDate";
|
|
1717
1719
|
property_releaseKind: "@releaseKind";
|
|
1718
1720
|
property_releaseVersion: "@releaseVersion";
|
|
@@ -2539,6 +2541,7 @@ interface BitJson {
|
|
|
2539
2541
|
publisher: string | string[];
|
|
2540
2542
|
publisherName: string;
|
|
2541
2543
|
publications: string | string[];
|
|
2544
|
+
relatedBook: string | string[];
|
|
2542
2545
|
author: string | string[];
|
|
2543
2546
|
subject: string | string[];
|
|
2544
2547
|
date: string;
|
|
@@ -3061,6 +3064,7 @@ interface Bit {
|
|
|
3061
3064
|
coverImage?: Property;
|
|
3062
3065
|
coverColor?: Property;
|
|
3063
3066
|
publications?: Property;
|
|
3067
|
+
relatedBook?: Property;
|
|
3064
3068
|
author?: Property;
|
|
3065
3069
|
subject?: Property;
|
|
3066
3070
|
date?: Property;
|
|
@@ -3663,6 +3667,8 @@ declare const NodeType: Readonly<{
|
|
|
3663
3667
|
referencePropertyValue: "referencePropertyValue";
|
|
3664
3668
|
refPublicationYear: "refPublicationYear";
|
|
3665
3669
|
refPublisher: "refPublisher";
|
|
3670
|
+
relatedBook: "relatedBook";
|
|
3671
|
+
relatedBookValue: "relatedBookValue";
|
|
3666
3672
|
releaseDate: "releaseDate";
|
|
3667
3673
|
releaseDateValue: "releaseDateValue";
|
|
3668
3674
|
releaseKind: "releaseKind";
|
|
@@ -4220,6 +4226,8 @@ declare const NodeType: Readonly<{
|
|
|
4220
4226
|
referencePropertyValue: "referencePropertyValue";
|
|
4221
4227
|
refPublicationYear: "refPublicationYear";
|
|
4222
4228
|
refPublisher: "refPublisher";
|
|
4229
|
+
relatedBook: "relatedBook";
|
|
4230
|
+
relatedBookValue: "relatedBookValue";
|
|
4223
4231
|
releaseDate: "releaseDate";
|
|
4224
4232
|
releaseDateValue: "releaseDateValue";
|
|
4225
4233
|
releaseKind: "releaseKind";
|
|
@@ -5288,6 +5296,7 @@ declare class Builder extends BaseBuilder {
|
|
|
5288
5296
|
coverImage?: string | string[];
|
|
5289
5297
|
coverColor?: string;
|
|
5290
5298
|
publications?: string | string[];
|
|
5299
|
+
relatedBook?: string | string[];
|
|
5291
5300
|
author?: string | string[];
|
|
5292
5301
|
subject?: string | string[];
|
|
5293
5302
|
date?: string;
|
package/dist/index.js
CHANGED
|
@@ -1238,6 +1238,7 @@ var propertyKeys = {
|
|
|
1238
1238
|
property_reference: "@reference",
|
|
1239
1239
|
property_refPublicationYear: "@refPublicationYear",
|
|
1240
1240
|
property_refPublisher: "@refPublisher",
|
|
1241
|
+
property_relatedBook: "@relatedBook",
|
|
1241
1242
|
property_releaseDate: "@releaseDate",
|
|
1242
1243
|
property_releaseKind: "@releaseKind",
|
|
1243
1244
|
property_releaseVersion: "@releaseVersion",
|
|
@@ -1513,6 +1514,16 @@ var StringUtils = class {
|
|
|
1513
1514
|
if (!str) return str;
|
|
1514
1515
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
1515
1516
|
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Convert a camelCase string to kebab-case.
|
|
1519
|
+
*
|
|
1520
|
+
* @param str the string to convert
|
|
1521
|
+
* @returns the kebab-case version of the string
|
|
1522
|
+
*/
|
|
1523
|
+
camelToKebab(str) {
|
|
1524
|
+
if (!str) return str;
|
|
1525
|
+
return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
1526
|
+
}
|
|
1516
1527
|
};
|
|
1517
1528
|
var stringUtils = new StringUtils();
|
|
1518
1529
|
|
|
@@ -3187,6 +3198,12 @@ var GROUPS = {
|
|
|
3187
3198
|
format: TagFormat.plainText,
|
|
3188
3199
|
maxCount: Count.infinity
|
|
3189
3200
|
},
|
|
3201
|
+
{
|
|
3202
|
+
key: ConfigKey.property_relatedBook,
|
|
3203
|
+
description: "Books related to this book",
|
|
3204
|
+
format: TagFormat.plainText,
|
|
3205
|
+
maxCount: Count.infinity
|
|
3206
|
+
},
|
|
3190
3207
|
{
|
|
3191
3208
|
key: ConfigKey.property_duration,
|
|
3192
3209
|
description: "The duration of the book",
|
|
@@ -9071,7 +9088,7 @@ var instance2 = new Config();
|
|
|
9071
9088
|
// src/generated/package_info.ts
|
|
9072
9089
|
var PACKAGE_INFO = {
|
|
9073
9090
|
"name": "@gmb/bitmark-parser-generator",
|
|
9074
|
-
"version": "4.
|
|
9091
|
+
"version": "4.8.0",
|
|
9075
9092
|
"author": "Get More Brain Ltd",
|
|
9076
9093
|
"license": "ISC",
|
|
9077
9094
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -9815,6 +9832,8 @@ var NodeType = superenum20({
|
|
|
9815
9832
|
referencePropertyValue: "referencePropertyValue",
|
|
9816
9833
|
refPublicationYear: "refPublicationYear",
|
|
9817
9834
|
refPublisher: "refPublisher",
|
|
9835
|
+
relatedBook: "relatedBook",
|
|
9836
|
+
relatedBookValue: "relatedBookValue",
|
|
9818
9837
|
releaseDate: "releaseDate",
|
|
9819
9838
|
releaseDateValue: "releaseDateValue",
|
|
9820
9839
|
releaseKind: "releaseKind",
|
|
@@ -22343,6 +22362,12 @@ var Builder = class extends BaseBuilder {
|
|
|
22343
22362
|
data.publications,
|
|
22344
22363
|
options
|
|
22345
22364
|
),
|
|
22365
|
+
relatedBook: this.toAstProperty(
|
|
22366
|
+
bitType,
|
|
22367
|
+
ConfigKey.property_relatedBook,
|
|
22368
|
+
data.relatedBook,
|
|
22369
|
+
options
|
|
22370
|
+
),
|
|
22346
22371
|
author: this.toAstProperty(bitType, ConfigKey.property_author, data.author, options),
|
|
22347
22372
|
subject: this.toAstProperty(bitType, ConfigKey.property_subject, data.subject, options),
|
|
22348
22373
|
date: this.toAstProperty(bitType, ConfigKey.property_date, data.date, options),
|
|
@@ -35753,6 +35778,264 @@ var ConfigBuilder = class {
|
|
|
35753
35778
|
build(options) {
|
|
35754
35779
|
const opts = Object.assign({}, options);
|
|
35755
35780
|
this.buildFlat(opts);
|
|
35781
|
+
const bitConfigs = [];
|
|
35782
|
+
const groupConfigs = [];
|
|
35783
|
+
for (const bt of BitType.values()) {
|
|
35784
|
+
const bitType = instance2.getBitType(bt);
|
|
35785
|
+
const _bitConfig = BITS[bitType];
|
|
35786
|
+
if (_bitConfig) {
|
|
35787
|
+
_bitConfig.bitType = bitType;
|
|
35788
|
+
bitConfigs.push(_bitConfig);
|
|
35789
|
+
}
|
|
35790
|
+
}
|
|
35791
|
+
for (const [k, g] of Object.entries(GROUPS)) {
|
|
35792
|
+
const g2 = g;
|
|
35793
|
+
let k2 = k;
|
|
35794
|
+
if (k.startsWith("group_")) k2 = k2.substring(6);
|
|
35795
|
+
k2 = /*'_' +*/
|
|
35796
|
+
stringUtils.camelToKebab(k2);
|
|
35797
|
+
g2.key = k2;
|
|
35798
|
+
groupConfigs.push(g2);
|
|
35799
|
+
}
|
|
35800
|
+
const outputFolder = opts.outputDir ?? "assets/config";
|
|
35801
|
+
const outputFolderBits = path3.join(outputFolder, "bits");
|
|
35802
|
+
const outputFolderGroups = path3.join(outputFolder, "partials");
|
|
35803
|
+
fs3.ensureDirSync(outputFolderBits);
|
|
35804
|
+
fs3.ensureDirSync(outputFolderGroups);
|
|
35805
|
+
const fileWrites = [];
|
|
35806
|
+
for (const b of bitConfigs) {
|
|
35807
|
+
const inherits = [];
|
|
35808
|
+
const tags2 = [];
|
|
35809
|
+
const tagEntriesTypeOrder = [
|
|
35810
|
+
BitTagConfigKeyType.tag,
|
|
35811
|
+
BitTagConfigKeyType.property,
|
|
35812
|
+
BitTagConfigKeyType.resource,
|
|
35813
|
+
BitTagConfigKeyType.group,
|
|
35814
|
+
BitTagConfigKeyType.unknown
|
|
35815
|
+
];
|
|
35816
|
+
const tagEntries = Object.entries(b.tags ?? []).sort((a, b2) => {
|
|
35817
|
+
const tagA = a[1];
|
|
35818
|
+
const tagB = b2[1];
|
|
35819
|
+
const typeA = typeFromConfigKey(tagA.key);
|
|
35820
|
+
const typeB = typeFromConfigKey(tagB.key);
|
|
35821
|
+
const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
|
|
35822
|
+
return typeOrder;
|
|
35823
|
+
});
|
|
35824
|
+
if (b.baseBitType) inherits.push(b.baseBitType);
|
|
35825
|
+
for (const [_tagKey, tag] of tagEntries) {
|
|
35826
|
+
const tagName = tag.key;
|
|
35827
|
+
let format = "";
|
|
35828
|
+
let chain = void 0;
|
|
35829
|
+
const tagType = typeFromConfigKey(tag.key);
|
|
35830
|
+
if (tagType === BitTagConfigKeyType.tag) {
|
|
35831
|
+
if (tagName === "%") {
|
|
35832
|
+
chain = {
|
|
35833
|
+
key: "%",
|
|
35834
|
+
format,
|
|
35835
|
+
min: tag.minCount,
|
|
35836
|
+
max: tag.maxCount,
|
|
35837
|
+
description: "Lead",
|
|
35838
|
+
chain: {
|
|
35839
|
+
key: "%",
|
|
35840
|
+
format,
|
|
35841
|
+
min: tag.minCount,
|
|
35842
|
+
max: tag.maxCount,
|
|
35843
|
+
description: "Page number",
|
|
35844
|
+
chain: {
|
|
35845
|
+
key: "%",
|
|
35846
|
+
format,
|
|
35847
|
+
min: tag.minCount,
|
|
35848
|
+
max: tag.maxCount,
|
|
35849
|
+
description: "Margin number"
|
|
35850
|
+
}
|
|
35851
|
+
}
|
|
35852
|
+
};
|
|
35853
|
+
}
|
|
35854
|
+
format = "bitmark--";
|
|
35855
|
+
} else if (tagType === BitTagConfigKeyType.property) {
|
|
35856
|
+
if (tag.format === TagFormat.plainText) {
|
|
35857
|
+
format = "string";
|
|
35858
|
+
} else if (tag.format === TagFormat.boolean) {
|
|
35859
|
+
format = "bool";
|
|
35860
|
+
} else if (tag.format === TagFormat.bitmarkText) {
|
|
35861
|
+
format = "bitmark";
|
|
35862
|
+
} else if (tag.format === TagFormat.number) {
|
|
35863
|
+
format = "number";
|
|
35864
|
+
}
|
|
35865
|
+
} else if (tagType === BitTagConfigKeyType.resource) {
|
|
35866
|
+
} else if (tagType === BitTagConfigKeyType.group) {
|
|
35867
|
+
let k = tag.key;
|
|
35868
|
+
if (k.startsWith("group_")) k = k.substring(6);
|
|
35869
|
+
k = "_" + k;
|
|
35870
|
+
inherits.push(k);
|
|
35871
|
+
continue;
|
|
35872
|
+
}
|
|
35873
|
+
const t = {
|
|
35874
|
+
key: tagName,
|
|
35875
|
+
format,
|
|
35876
|
+
default: null,
|
|
35877
|
+
alwaysInclude: false,
|
|
35878
|
+
min: tag.minCount == null ? 0 : tag.minCount,
|
|
35879
|
+
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
35880
|
+
description: tag.description ?? "",
|
|
35881
|
+
chain
|
|
35882
|
+
// raw: {
|
|
35883
|
+
// ...tag,
|
|
35884
|
+
// },
|
|
35885
|
+
};
|
|
35886
|
+
tags2.push(t);
|
|
35887
|
+
}
|
|
35888
|
+
const bitJson = {
|
|
35889
|
+
name: b.bitType,
|
|
35890
|
+
description: b.description ?? "",
|
|
35891
|
+
since: b.since,
|
|
35892
|
+
deprecated: b.deprecated,
|
|
35893
|
+
history: [
|
|
35894
|
+
{
|
|
35895
|
+
version: b.since,
|
|
35896
|
+
changes: ["Initial version"]
|
|
35897
|
+
}
|
|
35898
|
+
],
|
|
35899
|
+
format: b.textFormatDefault ?? "bitmark--",
|
|
35900
|
+
bodyAllowed: b.bodyAllowed ?? true,
|
|
35901
|
+
bodyRequired: b.bodyRequired ?? false,
|
|
35902
|
+
footerAllowed: b.footerAllowed ?? true,
|
|
35903
|
+
footerRequired: b.footerRequired ?? false,
|
|
35904
|
+
resourceAttachmentAllowed: b.resourceAttachmentAllowed ?? true,
|
|
35905
|
+
inherits,
|
|
35906
|
+
tags: tags2
|
|
35907
|
+
};
|
|
35908
|
+
const output = path3.join(outputFolderBits, `${b.bitType}.jsonc`);
|
|
35909
|
+
const str = JSON.stringify(bitJson, null, 2);
|
|
35910
|
+
fileWrites.push(fs3.writeFile(output, str));
|
|
35911
|
+
}
|
|
35912
|
+
const writeGroupConfigs = (groupConfigs2) => {
|
|
35913
|
+
for (const g of groupConfigs2) {
|
|
35914
|
+
const inherits = [];
|
|
35915
|
+
const tags2 = [];
|
|
35916
|
+
const groupKey = stringUtils.camelToKebab(g.key);
|
|
35917
|
+
const tagEntriesTypeOrder = [
|
|
35918
|
+
BitTagConfigKeyType.tag,
|
|
35919
|
+
BitTagConfigKeyType.property,
|
|
35920
|
+
BitTagConfigKeyType.resource,
|
|
35921
|
+
BitTagConfigKeyType.group
|
|
35922
|
+
];
|
|
35923
|
+
const tagEntries = Object.entries(g.tags ?? []).sort((a, b) => {
|
|
35924
|
+
const tagA = a[1];
|
|
35925
|
+
const tagB = b[1];
|
|
35926
|
+
const typeOrder = tagEntriesTypeOrder.indexOf(tagA.type) - tagEntriesTypeOrder.indexOf(tagB.type);
|
|
35927
|
+
return typeOrder;
|
|
35928
|
+
});
|
|
35929
|
+
for (const [_tagKey, tag] of tagEntries) {
|
|
35930
|
+
let tagName = tag.key;
|
|
35931
|
+
const tagType = typeFromConfigKey(tag.key);
|
|
35932
|
+
let format = "";
|
|
35933
|
+
let chain = void 0;
|
|
35934
|
+
if (tagType === BitTagConfigKeyType.tag) {
|
|
35935
|
+
tagName = tag.name;
|
|
35936
|
+
if (tagName === "%") {
|
|
35937
|
+
chain = {
|
|
35938
|
+
key: "%",
|
|
35939
|
+
format,
|
|
35940
|
+
min: tag.minCount,
|
|
35941
|
+
max: tag.maxCount,
|
|
35942
|
+
description: "Lead",
|
|
35943
|
+
chain: {
|
|
35944
|
+
key: "%",
|
|
35945
|
+
format,
|
|
35946
|
+
min: tag.minCount,
|
|
35947
|
+
max: tag.maxCount,
|
|
35948
|
+
description: "Page number",
|
|
35949
|
+
chain: {
|
|
35950
|
+
key: "%",
|
|
35951
|
+
format,
|
|
35952
|
+
min: tag.minCount,
|
|
35953
|
+
max: tag.maxCount,
|
|
35954
|
+
description: "Margin number"
|
|
35955
|
+
}
|
|
35956
|
+
}
|
|
35957
|
+
};
|
|
35958
|
+
}
|
|
35959
|
+
format = "bitmark--";
|
|
35960
|
+
} else if (tagType === BitTagConfigKeyType.property) {
|
|
35961
|
+
tagName = tag.key;
|
|
35962
|
+
if (tag.format === TagFormat.plainText) {
|
|
35963
|
+
format = "string";
|
|
35964
|
+
} else if (tag.format === TagFormat.boolean) {
|
|
35965
|
+
format = "bool";
|
|
35966
|
+
} else if (tag.format === TagFormat.bitmarkText) {
|
|
35967
|
+
format = "bitmark";
|
|
35968
|
+
} else if (tag.format === TagFormat.number) {
|
|
35969
|
+
format = "number";
|
|
35970
|
+
}
|
|
35971
|
+
} else if (tagType === BitTagConfigKeyType.resource) {
|
|
35972
|
+
format = "string";
|
|
35973
|
+
} else if (tagType === BitTagConfigKeyType.group) {
|
|
35974
|
+
let k = tag.key;
|
|
35975
|
+
if (k.startsWith("group_")) k = k.substring(6);
|
|
35976
|
+
k = /*'_' +*/
|
|
35977
|
+
stringUtils.camelToKebab(k);
|
|
35978
|
+
inherits.push(k);
|
|
35979
|
+
continue;
|
|
35980
|
+
}
|
|
35981
|
+
const t = {
|
|
35982
|
+
key: tagName,
|
|
35983
|
+
format,
|
|
35984
|
+
default: null,
|
|
35985
|
+
alwaysInclude: false,
|
|
35986
|
+
min: tag.minCount == null ? 0 : tag.minCount,
|
|
35987
|
+
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
35988
|
+
description: tag.description ?? "",
|
|
35989
|
+
chain
|
|
35990
|
+
// raw: {
|
|
35991
|
+
// ...tag,
|
|
35992
|
+
// },
|
|
35993
|
+
};
|
|
35994
|
+
tags2.push(t);
|
|
35995
|
+
}
|
|
35996
|
+
const bitJson = {
|
|
35997
|
+
name: groupKey,
|
|
35998
|
+
description: g.description ?? "",
|
|
35999
|
+
since: "UNKNOWN",
|
|
36000
|
+
deprecated: g.deprecated,
|
|
36001
|
+
history: [
|
|
36002
|
+
{
|
|
36003
|
+
version: "UNKNOWN",
|
|
36004
|
+
changes: ["Initial version"]
|
|
36005
|
+
}
|
|
36006
|
+
],
|
|
36007
|
+
inherits,
|
|
36008
|
+
tags: tags2
|
|
36009
|
+
// cards: [
|
|
36010
|
+
// {
|
|
36011
|
+
// card: null,
|
|
36012
|
+
// side: 1,
|
|
36013
|
+
// variant: null,
|
|
36014
|
+
// description: '',
|
|
36015
|
+
// tags: [],
|
|
36016
|
+
// },
|
|
36017
|
+
// {
|
|
36018
|
+
// card: null,
|
|
36019
|
+
// side: 2,
|
|
36020
|
+
// variant: 1,
|
|
36021
|
+
// description: '',
|
|
36022
|
+
// tags: [],
|
|
36023
|
+
// },
|
|
36024
|
+
// {
|
|
36025
|
+
// card: null,
|
|
36026
|
+
// side: 2,
|
|
36027
|
+
// variant: null,
|
|
36028
|
+
// description: '',
|
|
36029
|
+
// tags: [],
|
|
36030
|
+
// },
|
|
36031
|
+
// ],
|
|
36032
|
+
};
|
|
36033
|
+
const output = path3.join(outputFolderGroups, `${groupKey}.jsonc`);
|
|
36034
|
+
const str = JSON.stringify(bitJson, null, 2);
|
|
36035
|
+
fs3.writeFileSync(output, str);
|
|
36036
|
+
}
|
|
36037
|
+
};
|
|
36038
|
+
writeGroupConfigs(groupConfigs);
|
|
35756
36039
|
}
|
|
35757
36040
|
buildFlat(options) {
|
|
35758
36041
|
const opts = Object.assign({}, options);
|