@minecraft/api-docs-generator 1.0.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/CHANGELOG.json +20 -0
- package/CHANGELOG.md +13 -0
- package/README.md +92 -0
- package/lib/ChangelogStrategy.d.ts +39 -0
- package/lib/ChangelogStrategy.js +114 -0
- package/lib/ChangelogStrategy.js.map +1 -0
- package/lib/Config.d.ts +76 -0
- package/lib/Config.js +68 -0
- package/lib/Config.js.map +1 -0
- package/lib/Context.d.ts +28 -0
- package/lib/Context.js +323 -0
- package/lib/Context.js.map +1 -0
- package/lib/FileLoader.d.ts +13 -0
- package/lib/FileLoader.js +91 -0
- package/lib/FileLoader.js.map +1 -0
- package/lib/Logger.d.ts +65 -0
- package/lib/Logger.js +179 -0
- package/lib/Logger.js.map +1 -0
- package/lib/MinecraftRelease.d.ts +37 -0
- package/lib/MinecraftRelease.js +157 -0
- package/lib/MinecraftRelease.js.map +1 -0
- package/lib/PrettierConfiguration.d.ts +2 -0
- package/lib/PrettierConfiguration.js +17 -0
- package/lib/PrettierConfiguration.js.map +1 -0
- package/lib/changelog.d.ts +11 -0
- package/lib/changelog.js +459 -0
- package/lib/changelog.js.map +1 -0
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +172 -0
- package/lib/cli.js.map +1 -0
- package/lib/filters/CommandFilters.d.ts +2 -0
- package/lib/filters/CommandFilters.js +171 -0
- package/lib/filters/CommandFilters.js.map +1 -0
- package/lib/filters/CommonFilters.d.ts +2 -0
- package/lib/filters/CommonFilters.js +2518 -0
- package/lib/filters/CommonFilters.js.map +1 -0
- package/lib/filters/Filters.d.ts +17 -0
- package/lib/filters/Filters.js +5 -0
- package/lib/filters/Filters.js.map +1 -0
- package/lib/filters/MarkdownFilters.d.ts +2 -0
- package/lib/filters/MarkdownFilters.js +63 -0
- package/lib/filters/MarkdownFilters.js.map +1 -0
- package/lib/filters/TypeScriptFilters.d.ts +2 -0
- package/lib/filters/TypeScriptFilters.js +387 -0
- package/lib/filters/TypeScriptFilters.js.map +1 -0
- package/lib/filters/index.d.ts +4 -0
- package/lib/filters/index.js +23 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/generator.d.ts +8 -0
- package/lib/generator.js +511 -0
- package/lib/generator.js.map +1 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +50 -0
- package/lib/index.js.map +1 -0
- package/lib/modules/IMinecraftModule.d.ts +123 -0
- package/lib/modules/IMinecraftModule.js +71 -0
- package/lib/modules/IMinecraftModule.js.map +1 -0
- package/lib/modules/KeyToTypeMapping.d.ts +77 -0
- package/lib/modules/KeyToTypeMapping.js +5 -0
- package/lib/modules/KeyToTypeMapping.js.map +1 -0
- package/lib/modules/MinecraftAfterEventsOrderModule.d.ts +57 -0
- package/lib/modules/MinecraftAfterEventsOrderModule.js +28 -0
- package/lib/modules/MinecraftAfterEventsOrderModule.js.map +1 -0
- package/lib/modules/MinecraftBlockModule.d.ts +139 -0
- package/lib/modules/MinecraftBlockModule.js +37 -0
- package/lib/modules/MinecraftBlockModule.js.map +1 -0
- package/lib/modules/MinecraftChangelogTypes.d.ts +60 -0
- package/lib/modules/MinecraftChangelogTypes.js +17 -0
- package/lib/modules/MinecraftChangelogTypes.js.map +1 -0
- package/lib/modules/MinecraftCommandModule.d.ts +270 -0
- package/lib/modules/MinecraftCommandModule.js +87 -0
- package/lib/modules/MinecraftCommandModule.js.map +1 -0
- package/lib/modules/MinecraftDimensionsModule.d.ts +44 -0
- package/lib/modules/MinecraftDimensionsModule.js +11 -0
- package/lib/modules/MinecraftDimensionsModule.js.map +1 -0
- package/lib/modules/MinecraftDocsTypes.d.ts +475 -0
- package/lib/modules/MinecraftDocsTypes.js +77 -0
- package/lib/modules/MinecraftDocsTypes.js.map +1 -0
- package/lib/modules/MinecraftEffectsModule.d.ts +44 -0
- package/lib/modules/MinecraftEffectsModule.js +11 -0
- package/lib/modules/MinecraftEffectsModule.js.map +1 -0
- package/lib/modules/MinecraftEnchantmentsModule.d.ts +44 -0
- package/lib/modules/MinecraftEnchantmentsModule.js +11 -0
- package/lib/modules/MinecraftEnchantmentsModule.js.map +1 -0
- package/lib/modules/MinecraftEngineDataModules.d.ts +2 -0
- package/lib/modules/MinecraftEngineDataModules.js +5 -0
- package/lib/modules/MinecraftEngineDataModules.js.map +1 -0
- package/lib/modules/MinecraftEntitiesModule.d.ts +44 -0
- package/lib/modules/MinecraftEntitiesModule.js +11 -0
- package/lib/modules/MinecraftEntitiesModule.js.map +1 -0
- package/lib/modules/MinecraftItemsModule.d.ts +44 -0
- package/lib/modules/MinecraftItemsModule.js +11 -0
- package/lib/modules/MinecraftItemsModule.js.map +1 -0
- package/lib/modules/MinecraftSchemaObject.d.ts +16 -0
- package/lib/modules/MinecraftSchemaObject.js +5 -0
- package/lib/modules/MinecraftSchemaObject.js.map +1 -0
- package/lib/modules/MinecraftScriptModule.d.ts +3677 -0
- package/lib/modules/MinecraftScriptModule.js +374 -0
- package/lib/modules/MinecraftScriptModule.js.map +1 -0
- package/lib/modules/MinecraftVanillaDataModules.d.ts +4 -0
- package/lib/modules/MinecraftVanillaDataModules.js +9 -0
- package/lib/modules/MinecraftVanillaDataModules.js.map +1 -0
- package/lib/modules/index.d.ts +15 -0
- package/lib/modules/index.js +34 -0
- package/lib/modules/index.js.map +1 -0
- package/lib/plugins/MarkupGenerator.d.ts +28 -0
- package/lib/plugins/MarkupGenerator.js +5 -0
- package/lib/plugins/MarkupGenerator.js.map +1 -0
- package/lib/plugins/Plugin.d.ts +16 -0
- package/lib/plugins/Plugin.js +5 -0
- package/lib/plugins/Plugin.js.map +1 -0
- package/lib/plugins/index.d.ts +2 -0
- package/lib/plugins/index.js +21 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/test/commonFilterUnitTests.spec.d.ts +1 -0
- package/lib/test/commonFilterUnitTests.spec.js +85 -0
- package/lib/test/commonFilterUnitTests.spec.js.map +1 -0
- package/lib/test/diffingUnitTests.test.d.ts +1 -0
- package/lib/test/diffingUnitTests.test.js +238 -0
- package/lib/test/diffingUnitTests.test.js.map +1 -0
- package/lib/test/scanObjectUnitTests.test.d.ts +1 -0
- package/lib/test/scanObjectUnitTests.test.js +162 -0
- package/lib/test/scanObjectUnitTests.test.js.map +1 -0
- package/lib/test/versionParsing.test.d.ts +1 -0
- package/lib/test/versionParsing.test.js +147 -0
- package/lib/test/versionParsing.test.js.map +1 -0
- package/lib/utilities/AppendVersion.d.ts +8 -0
- package/lib/utilities/AppendVersion.js +46 -0
- package/lib/utilities/AppendVersion.js.map +1 -0
- package/lib/utilities/Complete.d.ts +7 -0
- package/lib/utilities/Complete.js +5 -0
- package/lib/utilities/Complete.js.map +1 -0
- package/lib/utilities/DeepCopyJson.d.ts +4 -0
- package/lib/utilities/DeepCopyJson.js +46 -0
- package/lib/utilities/DeepCopyJson.js.map +1 -0
- package/lib/utilities/GetFiles.d.ts +3 -0
- package/lib/utilities/GetFiles.js +44 -0
- package/lib/utilities/GetFiles.js.map +1 -0
- package/lib/utilities/LongestCommonSubsequence.d.ts +3 -0
- package/lib/utilities/LongestCommonSubsequence.js +123 -0
- package/lib/utilities/LongestCommonSubsequence.js.map +1 -0
- package/lib/utilities/MergeArrays.d.ts +1 -0
- package/lib/utilities/MergeArrays.js +15 -0
- package/lib/utilities/MergeArrays.js.map +1 -0
- package/lib/utilities/RemoveProperty.d.ts +1 -0
- package/lib/utilities/RemoveProperty.js +16 -0
- package/lib/utilities/RemoveProperty.js.map +1 -0
- package/lib/utilities/ScanObject.d.ts +13 -0
- package/lib/utilities/ScanObject.js +101 -0
- package/lib/utilities/ScanObject.js.map +1 -0
- package/lib/utilities/SortComparers.d.ts +3 -0
- package/lib/utilities/SortComparers.js +21 -0
- package/lib/utilities/SortComparers.js.map +1 -0
- package/lib/utilities/index.d.ts +9 -0
- package/lib/utilities/index.js +28 -0
- package/lib/utilities/index.js.map +1 -0
- package/package.json +72 -0
package/CHANGELOG.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@minecraft/api-docs-generator",
|
|
3
|
+
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Thu, 26 Jun 2025 22:33:07 GMT",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"tag": "@minecraft/api-docs-generator_v1.0.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"major": [
|
|
10
|
+
{
|
|
11
|
+
"author": "zachary.campbell@skyboxlabs.com",
|
|
12
|
+
"package": "@minecraft/api-docs-generator",
|
|
13
|
+
"commit": "6dbbce7231a4daceb4ddbba5681891de7fc481e7",
|
|
14
|
+
"comment": "Add api-docs-generator and markup-generators-plugin"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Change Log - @minecraft/api-docs-generator
|
|
2
|
+
|
|
3
|
+
<!-- This log was last generated on Thu, 26 Jun 2025 22:33:07 GMT and should not be manually modified. -->
|
|
4
|
+
|
|
5
|
+
<!-- Start content -->
|
|
6
|
+
|
|
7
|
+
## 1.0.0
|
|
8
|
+
|
|
9
|
+
Thu, 26 Jun 2025 22:33:07 GMT
|
|
10
|
+
|
|
11
|
+
### Major changes
|
|
12
|
+
|
|
13
|
+
- Add api-docs-generator and markup-generators-plugin (zachary.campbell@skyboxlabs.com)
|
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @minecraft/api-docs-generator
|
|
2
|
+
|
|
3
|
+
This package ingests [Minecraft API module metadata](https://github.com/Mojang/bedrock-samples/tree/main/metadata) and outputs various generated files such as documentation, TypeScript `.d.ts` files, and more. Requires usage of a markup generator plugin to provide output configurations, such as [@minecraft/markup-generators-plugin](../markup-generators-plugin/README.md) or a custom defined plugin.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
- Install [NPM/Node](https://www.npmjs.com/) version 22.x or above.
|
|
8
|
+
- Clone this repository.
|
|
9
|
+
- Install dependencies: `npm install`
|
|
10
|
+
- Build the repository: `npm run build`
|
|
11
|
+
|
|
12
|
+
## CLI Usage
|
|
13
|
+
|
|
14
|
+
Usage: `minecraft-api-docs-generator [options]`
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
-i, --input-directory Directory of the API metadata JSON input files.
|
|
20
|
+
-o, --output-directory Directory to output generated types and documentation to.
|
|
21
|
+
-d, --docs-directory Directory of the documentation info.JSON files that provide description strings for API modules.
|
|
22
|
+
-g, --run-generators IDs of markup generators to render output files with.
|
|
23
|
+
|
|
24
|
+
-m, --include-modules Mode which determines which input modules should be included in generation.
|
|
25
|
+
-b, --include-base If set, will include base modules in generation for metadata that would be merged to a parent module.
|
|
26
|
+
--changelog-strategy String ID of the changelog strategy to use when comparing modules.
|
|
27
|
+
|
|
28
|
+
-p, --plugin Plugin packages to import generators and templates from.
|
|
29
|
+
-c, --config Path to a config file with options.
|
|
30
|
+
--no-config If set, will not look for any config files.
|
|
31
|
+
|
|
32
|
+
-l, --log Logging options.
|
|
33
|
+
-s, --suppress Suppresses all output except for errors
|
|
34
|
+
|
|
35
|
+
--version Show version number
|
|
36
|
+
-h, --help Show help
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Example
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
minecraft-api-docs-generator -i ./input -o ./out -d ./docs -g msdocs ts
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Markup Generators
|
|
46
|
+
|
|
47
|
+
The `run-generators` argument requires the ID of a markup generator defined in a plugin package imported via the `plugin` argument or in the config file.
|
|
48
|
+
|
|
49
|
+
Multiple markup generators can be ran in the same instance by supplying multiple IDs, e.g.: `--run-generators msdocs ts`
|
|
50
|
+
|
|
51
|
+
By default, `@minecraft/api-docs-generator` will assume you have imported `@minecraft/markup-generators-plugin` if no other plugins are defined via CLI or config options. See the `markup-generators-plugin` [README](../markup-generators-plugin/README.md) for more info.
|
|
52
|
+
|
|
53
|
+
### Plugins
|
|
54
|
+
|
|
55
|
+
The `plugin` argument allows importing additional markup generators from external plugin packages. See [ARCHITECTURE](./ARCHITECTURE.md#plugins) for more info on creating and using external plugins for custom functionality.
|
|
56
|
+
|
|
57
|
+
## Generating API Types
|
|
58
|
+
|
|
59
|
+
To generate API types using the most recent type metadata:
|
|
60
|
+
|
|
61
|
+
1. Use NPM to globally install both api-docs-generator and the markup generators plugin: `npm install -g @minecraft/api-docs-generator @minecraft/markup-generators-plugin`
|
|
62
|
+
2. Clone the [bedrock-samples](https://github.com/Mojang/bedrock-samples/tree/main/metadata) repository.
|
|
63
|
+
3. Run the generator using `bedrock-samples\metadata` as the input directory. e.g.:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
minecraft-api-docs-generator -i C:\bedrock-samples\metadata -o .\out
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
`npm run build` compiles `@minecraft/api-doc-generator` TS definitions and JS files into `lib`.
|
|
72
|
+
|
|
73
|
+
`npm run lint` runs ESLint and Prettier on project TS source files. `npm run lint:fix` attempts to fix Prettier issues.
|
|
74
|
+
|
|
75
|
+
`npm run test` runs a suite of tests. `npm run test:update` updates the test snapshots. See [Testing](#testing) for more details.
|
|
76
|
+
|
|
77
|
+
`npm run clean` cleans all build output.
|
|
78
|
+
|
|
79
|
+
`npm run package` generates an NPM tarball which you can then `npm install` in other NPM packages for local tool usage.
|
|
80
|
+
|
|
81
|
+
### Debugging
|
|
82
|
+
|
|
83
|
+
We recommend using Visual Studio Code's [JavaScript Debug Terminal](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_javascript-debug-terminal) for debugging purposes.
|
|
84
|
+
|
|
85
|
+
## Testing
|
|
86
|
+
|
|
87
|
+
This package is validated with a series of vitest snapshot tests that validate generated markup for specific scenarios. When making changes to the generator, please add new scenarios or update the existing scenarios.
|
|
88
|
+
|
|
89
|
+
Snapshot tests will fail if the number of files generated or the contents of the files change. If snapshot changes are expected, you can update them by running: `npm run test:update`
|
|
90
|
+
|
|
91
|
+
It is possible to run specific tests using `npm run test -- -- --test <name>`, where `<name>` is a pattern matching `.test.ts`/`.spec.ts`file names. Running this in the JavaScript Debug Terminal allows for debugging specific tests (see above).
|
|
92
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MinecraftRelease } from './MinecraftRelease';
|
|
2
|
+
import { IMinecraftModule } from './modules/IMinecraftModule';
|
|
3
|
+
export type ChangelogVersionKey = 'version' | 'minecraft_version';
|
|
4
|
+
export interface ChangelogStrategy {
|
|
5
|
+
getVersionKey(): ChangelogVersionKey;
|
|
6
|
+
generateModuleGroupKey(module: IMinecraftModule): string;
|
|
7
|
+
generateModuleGroups(releases: MinecraftRelease[]): IMinecraftModule[][];
|
|
8
|
+
shouldGenerateChangelogs(releases: MinecraftRelease[]): boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Perform no diffing between modules, will not populate 'changelog' fields.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DisabledChangelogStrategy implements ChangelogStrategy {
|
|
14
|
+
getVersionKey(): 'version';
|
|
15
|
+
generateModuleGroupKey(): string;
|
|
16
|
+
generateModuleGroups(): IMinecraftModule[][];
|
|
17
|
+
shouldGenerateChangelogs(): boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Buckets modules per module version to compare same module across multiple versions of its self regardless of Minecraft version.
|
|
21
|
+
*
|
|
22
|
+
* Only applies to Script modules, other module types are only versioned based on Minecraft version.
|
|
23
|
+
*/
|
|
24
|
+
export declare class ModuleVersionChangelogStrategy implements ChangelogStrategy {
|
|
25
|
+
getVersionKey(): 'version';
|
|
26
|
+
generateModuleGroupKey(module: IMinecraftModule): string;
|
|
27
|
+
generateModuleGroups(releases: MinecraftRelease[]): IMinecraftModule[][];
|
|
28
|
+
shouldGenerateChangelogs(releases: MinecraftRelease[]): boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Buckets modules per Minecraft version to compare same module versions across multiple Minecraft releases.
|
|
32
|
+
*/
|
|
33
|
+
export declare class MinecraftVersionChangelogStrategy implements ChangelogStrategy {
|
|
34
|
+
getVersionKey(): 'minecraft_version';
|
|
35
|
+
generateModuleGroupKey(module: IMinecraftModule): string;
|
|
36
|
+
generateModuleGroups(releases: MinecraftRelease[]): IMinecraftModule[][];
|
|
37
|
+
shouldGenerateChangelogs(releases: MinecraftRelease[]): boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const CoreChangelogStrategies: [string, ChangelogStrategy][];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.CoreChangelogStrategies = exports.MinecraftVersionChangelogStrategy = exports.ModuleVersionChangelogStrategy = exports.DisabledChangelogStrategy = void 0;
|
|
6
|
+
const semver_1 = require("semver");
|
|
7
|
+
/**
|
|
8
|
+
* Perform no diffing between modules, will not populate 'changelog' fields.
|
|
9
|
+
*/
|
|
10
|
+
class DisabledChangelogStrategy {
|
|
11
|
+
getVersionKey() {
|
|
12
|
+
return 'version';
|
|
13
|
+
}
|
|
14
|
+
generateModuleGroupKey() {
|
|
15
|
+
return 'na';
|
|
16
|
+
}
|
|
17
|
+
generateModuleGroups() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
shouldGenerateChangelogs() {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.DisabledChangelogStrategy = DisabledChangelogStrategy;
|
|
25
|
+
/**
|
|
26
|
+
* Buckets modules per module version to compare same module across multiple versions of its self regardless of Minecraft version.
|
|
27
|
+
*
|
|
28
|
+
* Only applies to Script modules, other module types are only versioned based on Minecraft version.
|
|
29
|
+
*/
|
|
30
|
+
class ModuleVersionChangelogStrategy {
|
|
31
|
+
getVersionKey() {
|
|
32
|
+
return 'version';
|
|
33
|
+
}
|
|
34
|
+
generateModuleGroupKey(module) {
|
|
35
|
+
if (module.module_type !== 'script') {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
const scriptModule = module;
|
|
39
|
+
return `${scriptModule.uuid}`;
|
|
40
|
+
}
|
|
41
|
+
generateModuleGroups(releases) {
|
|
42
|
+
const allModulesByName = {};
|
|
43
|
+
for (const release of releases) {
|
|
44
|
+
for (const moduleJson of release.script_modules) {
|
|
45
|
+
const moduleName = moduleJson.name;
|
|
46
|
+
if (!allModulesByName[moduleName]) {
|
|
47
|
+
allModulesByName[moduleName] = [];
|
|
48
|
+
}
|
|
49
|
+
allModulesByName[moduleName].push(moduleJson);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return Object.values(allModulesByName);
|
|
53
|
+
}
|
|
54
|
+
shouldGenerateChangelogs(releases) {
|
|
55
|
+
for (const release of releases) {
|
|
56
|
+
const modulesByUUID = {};
|
|
57
|
+
for (const moduleJson of release.script_modules) {
|
|
58
|
+
const moduleKey = this.generateModuleGroupKey(moduleJson);
|
|
59
|
+
if (!modulesByUUID[moduleKey]) {
|
|
60
|
+
modulesByUUID[moduleKey] = true;
|
|
61
|
+
const prereleaseTag = (0, semver_1.prerelease)(moduleJson.version);
|
|
62
|
+
if (prereleaseTag) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.ModuleVersionChangelogStrategy = ModuleVersionChangelogStrategy;
|
|
75
|
+
/**
|
|
76
|
+
* Buckets modules per Minecraft version to compare same module versions across multiple Minecraft releases.
|
|
77
|
+
*/
|
|
78
|
+
class MinecraftVersionChangelogStrategy {
|
|
79
|
+
getVersionKey() {
|
|
80
|
+
return 'minecraft_version';
|
|
81
|
+
}
|
|
82
|
+
generateModuleGroupKey(module) {
|
|
83
|
+
if (module.module_type === 'script') {
|
|
84
|
+
const scriptModule = module;
|
|
85
|
+
return `${scriptModule.uuid}_${scriptModule.version}`;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return `${module.name}`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
generateModuleGroups(releases) {
|
|
92
|
+
const allModulesByUUIDAndVersion = {};
|
|
93
|
+
for (const release of releases) {
|
|
94
|
+
for (const moduleJson of release.getAllModules()) {
|
|
95
|
+
const moduleKey = this.generateModuleGroupKey(moduleJson);
|
|
96
|
+
if (!allModulesByUUIDAndVersion[moduleKey]) {
|
|
97
|
+
allModulesByUUIDAndVersion[moduleKey] = [];
|
|
98
|
+
}
|
|
99
|
+
allModulesByUUIDAndVersion[moduleKey].push(moduleJson);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return Object.values(allModulesByUUIDAndVersion);
|
|
103
|
+
}
|
|
104
|
+
shouldGenerateChangelogs(releases) {
|
|
105
|
+
return releases.length > 1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.MinecraftVersionChangelogStrategy = MinecraftVersionChangelogStrategy;
|
|
109
|
+
exports.CoreChangelogStrategies = [
|
|
110
|
+
['module_version', new ModuleVersionChangelogStrategy()],
|
|
111
|
+
['minecraft_version', new MinecraftVersionChangelogStrategy()],
|
|
112
|
+
['disabled', new DisabledChangelogStrategy()],
|
|
113
|
+
];
|
|
114
|
+
//# sourceMappingURL=ChangelogStrategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangelogStrategy.js","sourceRoot":"","sources":["../src/ChangelogStrategy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,mCAAoC;AAcpC;;GAEG;A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AAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;IACrD,CAAC;IAED,wBAAwB,CAAC,QAA4B;QACjD,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/B,CAAC;CACJ;AA/BD,8EA+BC;AAEY,QAAA,uBAAuB,GAAkC;IAClE,CAAC,gBAAgB,EAAE,IAAI,8BAA8B,EAAE,CAAC;IACxD,CAAC,mBAAmB,EAAE,IAAI,iCAAiC,EAAE,CAAC;IAC9D,CAAC,UAAU,EAAE,IAAI,yBAAyB,EAAE,CAAC;CAChD,CAAC"}
|
package/lib/Config.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { CosmiconfigResult } from 'cosmiconfig';
|
|
2
|
+
import * as rt from 'runtypes';
|
|
3
|
+
export declare const CONFIG_NAME = "api-docs-generator";
|
|
4
|
+
/**
|
|
5
|
+
* Helper for finding the config file using cosmiconfig.
|
|
6
|
+
*/
|
|
7
|
+
export declare function findConfig(): Promise<CosmiconfigResult>;
|
|
8
|
+
/**
|
|
9
|
+
* Helper for type validating config file.
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkConfig(config: Config): Config;
|
|
12
|
+
export declare const PreexistingModuleReleasesRecord: rt.Dictionary<rt.Array<rt.String, false>, string>;
|
|
13
|
+
export type PreexistingModuleReleases = rt.Static<typeof PreexistingModuleReleasesRecord>;
|
|
14
|
+
export declare const IncludeModulesModeUnion: rt.Union<[rt.Literal<"all">, rt.Literal<"latest">]>;
|
|
15
|
+
export type IncludeModulesMode = rt.Static<typeof IncludeModulesModeUnion>;
|
|
16
|
+
declare const PluginOptionsRecord: rt.Intersect<[rt.Record<{
|
|
17
|
+
path: rt.Optional<rt.String>;
|
|
18
|
+
}, false>, rt.Dictionary<rt.Unknown, string>]>;
|
|
19
|
+
export type PluginOptions = rt.Static<typeof PluginOptionsRecord>;
|
|
20
|
+
declare const PluginConfigRecord: rt.Union<[rt.String, rt.Tuple<[rt.String, rt.Intersect<[rt.Record<{
|
|
21
|
+
path: rt.Optional<rt.String>;
|
|
22
|
+
}, false>, rt.Dictionary<rt.Unknown, string>]>]>, rt.Constraint<rt.Array<rt.String, false>, string[], unknown>]>;
|
|
23
|
+
/**
|
|
24
|
+
* The plugin config is a tuple of plugin module names and objects containing plugin-specific options.
|
|
25
|
+
*
|
|
26
|
+
* Plugins will be imported from node_modules by name or from a path if specified.
|
|
27
|
+
*
|
|
28
|
+
* Example:
|
|
29
|
+
* ```
|
|
30
|
+
* [
|
|
31
|
+
* 'plugin-module',
|
|
32
|
+
* ['plugin-with-options', { path: './path/to/plugin.js' }]
|
|
33
|
+
* ]
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export type PluginConfig = rt.Static<typeof PluginConfigRecord>;
|
|
37
|
+
declare const ConfigOptionsRecord: rt.Record<{
|
|
38
|
+
inputDirectory: rt.Optional<rt.String>;
|
|
39
|
+
outputDirectory: rt.Optional<rt.String>;
|
|
40
|
+
documentationDirectory: rt.Optional<rt.String>;
|
|
41
|
+
generatorsToRun: rt.Optional<rt.Array<rt.String, false>>;
|
|
42
|
+
changelogStrategy: rt.Optional<rt.String>;
|
|
43
|
+
minecraftReleaseVersion: rt.Optional<rt.String>;
|
|
44
|
+
preexistingModuleReleases: rt.Optional<rt.Dictionary<rt.Array<rt.String, false>, string>>;
|
|
45
|
+
includeModulesMode: rt.Optional<rt.Union<[rt.Literal<"all">, rt.Literal<"latest">]>>;
|
|
46
|
+
includeBaseModules: rt.Optional<rt.Boolean>;
|
|
47
|
+
skipMerging: rt.Optional<rt.Boolean>;
|
|
48
|
+
plugins: rt.Optional<rt.Array<rt.Union<[rt.String, rt.Tuple<[rt.String, rt.Intersect<[rt.Record<{
|
|
49
|
+
path: rt.Optional<rt.String>;
|
|
50
|
+
}, false>, rt.Dictionary<rt.Unknown, string>]>]>, rt.Constraint<rt.Array<rt.String, false>, string[], unknown>]>, false>>;
|
|
51
|
+
generators: rt.Optional<rt.Dictionary<rt.Dictionary<rt.Unknown, string>, string>>;
|
|
52
|
+
log: rt.Optional<rt.Record<{
|
|
53
|
+
level: rt.Optional<rt.Union<[rt.Literal<"debug">, rt.Literal<"info">, rt.Literal<"warn">, rt.Literal<"error">]>>;
|
|
54
|
+
allMessages: rt.Optional<rt.Union<[rt.Boolean, rt.Union<[rt.Literal<"debug">, rt.Literal<"info">, rt.Literal<"warn">, rt.Literal<"error">]>]>>;
|
|
55
|
+
undocumentedApis: rt.Optional<rt.Union<[rt.Boolean, rt.Union<[rt.Literal<"debug">, rt.Literal<"info">, rt.Literal<"warn">, rt.Literal<"error">]>]>>;
|
|
56
|
+
unusedDocumentation: rt.Optional<rt.Union<[rt.Boolean, rt.Union<[rt.Literal<"debug">, rt.Literal<"info">, rt.Literal<"warn">, rt.Literal<"error">]>]>>;
|
|
57
|
+
unresolvedDependencies: rt.Optional<rt.Union<[rt.Boolean, rt.Union<[rt.Literal<"debug">, rt.Literal<"info">, rt.Literal<"warn">, rt.Literal<"error">]>]>>;
|
|
58
|
+
unresolvedTypes: rt.Optional<rt.Union<[rt.Boolean, rt.Union<[rt.Literal<"debug">, rt.Literal<"info">, rt.Literal<"warn">, rt.Literal<"error">]>]>>;
|
|
59
|
+
}, false>>;
|
|
60
|
+
}, false>;
|
|
61
|
+
/**
|
|
62
|
+
* Options used by generate() that can be invoked through CLI.
|
|
63
|
+
*/
|
|
64
|
+
export type GenerateOptions = rt.Static<typeof ConfigOptionsRecord> & {
|
|
65
|
+
configPath?: string;
|
|
66
|
+
ignoreConfig?: boolean;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* 'api-generator.config.mjs' config schema.
|
|
70
|
+
*/
|
|
71
|
+
export type Config = rt.Static<typeof ConfigOptionsRecord>;
|
|
72
|
+
/**
|
|
73
|
+
* Options from config files and generate() arguments.
|
|
74
|
+
*/
|
|
75
|
+
export type ConfigOptions = GenerateOptions & Config;
|
|
76
|
+
export {};
|
package/lib/Config.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.IncludeModulesModeUnion = exports.PreexistingModuleReleasesRecord = exports.CONFIG_NAME = void 0;
|
|
29
|
+
exports.findConfig = findConfig;
|
|
30
|
+
exports.checkConfig = checkConfig;
|
|
31
|
+
const cosmiconfig_1 = require("cosmiconfig");
|
|
32
|
+
const rt = __importStar(require("runtypes"));
|
|
33
|
+
const Logger_1 = require("./Logger");
|
|
34
|
+
exports.CONFIG_NAME = 'api-docs-generator';
|
|
35
|
+
/**
|
|
36
|
+
* Helper for finding the config file using cosmiconfig.
|
|
37
|
+
*/
|
|
38
|
+
async function findConfig() {
|
|
39
|
+
return await (0, cosmiconfig_1.cosmiconfig)(exports.CONFIG_NAME, { searchStrategy: 'project' }).search();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Helper for type validating config file.
|
|
43
|
+
*/
|
|
44
|
+
function checkConfig(config) {
|
|
45
|
+
return ConfigOptionsRecord.check(config);
|
|
46
|
+
}
|
|
47
|
+
exports.PreexistingModuleReleasesRecord = rt.Dictionary(rt.Array(rt.String), rt.String);
|
|
48
|
+
exports.IncludeModulesModeUnion = rt.Union(rt.Literal('all'), rt.Literal('latest'));
|
|
49
|
+
const PluginOptionsRecord = rt.Intersect(rt.Record({
|
|
50
|
+
path: rt.Optional(rt.String),
|
|
51
|
+
}), rt.Dictionary(rt.Unknown, rt.String));
|
|
52
|
+
const PluginConfigRecord = rt.Union(rt.String, rt.Tuple(rt.String, PluginOptionsRecord), rt.Array(rt.String).withConstraint(arr => arr.length === 1));
|
|
53
|
+
const ConfigOptionsRecord = rt.Record({
|
|
54
|
+
inputDirectory: rt.Optional(rt.String),
|
|
55
|
+
outputDirectory: rt.Optional(rt.String),
|
|
56
|
+
documentationDirectory: rt.Optional(rt.String),
|
|
57
|
+
generatorsToRun: rt.Optional(rt.Array(rt.String)),
|
|
58
|
+
changelogStrategy: rt.Optional(rt.String),
|
|
59
|
+
minecraftReleaseVersion: rt.Optional(rt.String),
|
|
60
|
+
preexistingModuleReleases: rt.Optional(exports.PreexistingModuleReleasesRecord),
|
|
61
|
+
includeModulesMode: rt.Optional(exports.IncludeModulesModeUnion),
|
|
62
|
+
includeBaseModules: rt.Optional(rt.Boolean),
|
|
63
|
+
skipMerging: rt.Optional(rt.Boolean),
|
|
64
|
+
plugins: rt.Optional(rt.Array(PluginConfigRecord)),
|
|
65
|
+
generators: rt.Optional(rt.Dictionary(rt.Dictionary(rt.Unknown, rt.String), rt.String)),
|
|
66
|
+
log: rt.Optional(Logger_1.LogOptionsRecord),
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=Config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;AAYlC,gCAEC;AAKD,kCAEC;AAnBD,6CAA6D;AAC7D,6CAA+B;AAE/B,qCAA4C;AAE/B,QAAA,WAAW,GAAG,oBAAoB,CAAC;AAEhD;;GAEG;AACI,KAAK,UAAU,UAAU;IAC5B,OAAO,MAAM,IAAA,yBAAW,EAAC,mBAAW,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAClF,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,MAAc;IACtC,OAAO,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAEY,QAAA,+BAA+B,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;AAGhF,QAAA,uBAAuB,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAGzF,MAAM,mBAAmB,GAAG,EAAE,CAAC,SAAS,CACpC,EAAE,CAAC,MAAM,CAAC;IACN,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC;CAC/B,CAAC,EACF,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,CACvC,CAAC;AAGF,MAAM,kBA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AAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IACvF,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,yBAAgB,CAAC;CACrC,CAAC,CAAC"}
|
package/lib/Context.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChangelogStrategy } from './ChangelogStrategy';
|
|
2
|
+
import { GenerateOptions, IncludeModulesMode } from './Config';
|
|
3
|
+
import { FileLoader } from './FileLoader';
|
|
4
|
+
import { MarkupGenerator, MarkupGeneratorOptions } from './plugins';
|
|
5
|
+
export declare class GeneratorContext {
|
|
6
|
+
private readonly config;
|
|
7
|
+
readonly changelogStrategy: ChangelogStrategy;
|
|
8
|
+
readonly inputDirectory: string;
|
|
9
|
+
readonly rootOutputDirectory: string;
|
|
10
|
+
readonly documentationFileLoader: FileLoader | undefined;
|
|
11
|
+
private readonly generators;
|
|
12
|
+
private readonly templates;
|
|
13
|
+
private constructor();
|
|
14
|
+
static Init(cliOptions: GenerateOptions): Promise<GeneratorContext>;
|
|
15
|
+
get minecraftReleaseVersion(): string | undefined;
|
|
16
|
+
get preexistingModuleReleases(): Record<string, string[]> | undefined;
|
|
17
|
+
get includeModules(): IncludeModulesMode;
|
|
18
|
+
get includeBaseModules(): boolean;
|
|
19
|
+
get skipMerging(): boolean;
|
|
20
|
+
getGenerator(generatorId: string): MarkupGenerator;
|
|
21
|
+
getGeneratorOptions(generatorId: string): MarkupGeneratorOptions;
|
|
22
|
+
getGenerators(): Iterable<MarkupGenerator>;
|
|
23
|
+
getGeneratorIds(): string[];
|
|
24
|
+
hasGenerators(...generatorIds: string[]): boolean;
|
|
25
|
+
getTemplates(...templateIds: string[]): Record<string, FileLoader>;
|
|
26
|
+
hasTemplates(...templateIds: string[]): boolean;
|
|
27
|
+
shutdown(): void;
|
|
28
|
+
}
|