Skip to content

Commit 6dbbce7

Browse files
Publish @minecraft/api-docs-generator and @minecraft/markup-generators-plugin (#74)
1 parent 8b54f8e commit 6dbbce7

File tree

402 files changed

+51328
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+51328
-233
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
with:
1717
node-version: 22
1818
- run: npm ci
19-
- run: npm run test
19+
- run: npm run test:ci

.github/workflows/release-changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
node-version: 22
2222
- run: npm ci
23-
- run: npm run test # Fully build the repo so we have artifacts available to create releases, include tests so we don't ship in a broken state
23+
- run: npm run test:ci # Fully build the repo so we have artifacts available to create releases, include tests so we don't ship in a broken state
2424

2525
- name: Set git credentials
2626
run: |

.gitignore

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
1+
# dependencies
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
6+
# misc
7+
.DS_Store
8+
*.pem
9+
10+
# debug
11+
npm-debug.log*
12+
.pnpm-debug.log*
13+
14+
# local env files
15+
.env
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
# turbo
122
.turbo
23+
24+
# git
25+
*.orig
26+
27+
# build output
28+
build
29+
dist
230
lib
331
lib-cjs
4-
dist
532
temp
6-
node_modules
33+
34+
# test outputs
35+
**/*output/
36+
*.log
37+
38+
# api-docs-generator output
39+
out/
40+
tsconfig*/
41+
42+
# packages
743
*.tgz
8-
*.zip
44+
*.zip

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
build
3+
dist
4+
lib
5+
lib-cjs
6+
out

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"attilabuti.mustache-syntax-vscode",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode",
6+
"shd101wyy.markdown-preview-enhanced",
7+
"spadin.memento-inputs"
8+
]
9+
}

.vscode/launch.json

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "API Docs Generator - Launch",
11+
"console": "integratedTerminal",
12+
"preLaunchTask": "build: api-docs-generator",
13+
"outputCapture": "std",
14+
"skipFiles": [
15+
"<node_internals>/**"
16+
],
17+
"program": "${workspaceFolder}/core/api-docs-generator/lib/src/cli.js",
18+
"args": [
19+
"-i",
20+
"${input:metadataInputDirectory}",
21+
"-o",
22+
"${workspaceFolder}/out"
23+
]
24+
},
25+
{
26+
"type": "node",
27+
"request": "launch",
28+
"name": "API Docs Generator - Launch Specific Generators",
29+
"console": "integratedTerminal",
30+
"preLaunchTask": "build: api-docs-generator",
31+
"outputCapture": "std",
32+
"skipFiles": [
33+
"<node_internals>/**"
34+
],
35+
"program": "${workspaceFolder}/core/api-docs-generator/lib/src/cli.js",
36+
"args": [
37+
"-i",
38+
"${input:metadataInputDirectory}",
39+
"-o",
40+
"${workspaceFolder}/out",
41+
"-g",
42+
"${input:generators}"
43+
]
44+
},
45+
{
46+
"type": "node",
47+
"request": "launch",
48+
"name": "API Docs Generator - Run All Tests",
49+
"console": "integratedTerminal",
50+
"preLaunchTask": "build: api-docs-generator-test-snapshots",
51+
"outputCapture": "std",
52+
"skipFiles": [
53+
"<node_internals>/**",
54+
],
55+
"runtimeExecutable": "npm",
56+
"runtimeArgs": [
57+
"run",
58+
"test",
59+
"--",
60+
"--only",
61+
"--filter=api-docs-generator-test-snapshots..."
62+
],
63+
},
64+
{
65+
"type": "node",
66+
"request": "launch",
67+
"name": "API Docs Generator - Run Specific Tests",
68+
"console": "integratedTerminal",
69+
"preLaunchTask": "build: api-docs-generator-test-snapshots",
70+
"outputCapture": "std",
71+
"skipFiles": [
72+
"<node_internals>/**",
73+
],
74+
"runtimeExecutable": "npm",
75+
"runtimeArgs": [
76+
"run",
77+
"test",
78+
"--",
79+
"--only",
80+
"--filter=api-docs-generator-test-snapshots...",
81+
"--",
82+
"--test",
83+
"${input:test}"
84+
],
85+
},
86+
],
87+
"inputs": [
88+
{
89+
"id": "metadataInputDirectory",
90+
"type": "command",
91+
"command": "memento.promptString",
92+
"args": {
93+
"id": "metadataInputDirectory",
94+
"description": "Path to input metadata files",
95+
"default": "${workspaceFolder}/../bedrock-samples/metadata"
96+
}
97+
},
98+
{
99+
"id": "generators",
100+
"type": "command",
101+
"command": "memento.promptString",
102+
"args": {
103+
"id": "generators",
104+
"description": "List of generators to run",
105+
"default": "ts msdocs"
106+
}
107+
},
108+
{
109+
"id": "test",
110+
"type": "command",
111+
"command": "memento.promptString",
112+
"args": {
113+
"id": "test",
114+
"description": "Pattern for test files to run",
115+
"default": "general"
116+
}
117+
}
118+
]
119+
}

.vscode/settings.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
{
2-
"eslint.experimental.useFlatConfig": true,
3-
"eslint.workingDirectories": [
4-
{
5-
"pattern": "./libraries/*/"
6-
},
7-
{
8-
"pattern": "./tools/*/"
9-
}
10-
]
11-
}
2+
"eslint.useFlatConfig": true,
3+
"eslint.workingDirectories": [{"mode": "auto"}],
4+
"debug.javascript.terminalOptions": {
5+
"skipFiles": ["<node_internals>/**"]
6+
},
7+
"[javascript]": {
8+
"editor.formatOnSave": true,
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[typescript]": {
12+
"editor.formatOnSave": true,
13+
"editor.defaultFormatter": "esbenp.prettier-vscode"
14+
},
15+
"files.exclude": {
16+
".turbo": true,
17+
"dist": true,
18+
"lib": true,
19+
"lib-cjs": true,
20+
"node_modules": true
21+
},
22+
}

.vscode/tasks.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "build: all",
8+
"type": "npm",
9+
"script": "build",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
}
14+
},
15+
{
16+
"label": "build: api-docs-generator",
17+
"type": "npm",
18+
"script": "build -- -- --filter=@minecraft/api-docs-generator... --filter=@minecraft/markup-generators-plugin...",
19+
"group": {
20+
"kind": "build"
21+
}
22+
},
23+
{
24+
"label": "build: api-docs-generator-test-snapshots",
25+
"type": "npm",
26+
"script": "build -- -- --filter=api-docs-generator-test-snapshots...",
27+
"group": {
28+
"kind": "build"
29+
}
30+
},
31+
{
32+
"label": "test: all",
33+
"type": "npm",
34+
"script": "test",
35+
"group": {
36+
"kind": "test",
37+
"isDefault": true
38+
}
39+
},
40+
{
41+
"label": "test: api-docs-generator",
42+
"type": "npm",
43+
"script": "test -- -- --filter=api-docs-generator-test-snapshots...",
44+
"group": {
45+
"kind": "test"
46+
}
47+
}
48+
]
49+
}

CONTRIBUTING.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,19 @@ or contact [[email protected]](mailto:[email protected]) with any addi
1515

1616
## Specific Guidelines
1717

18-
Contributions to these libraries are welcome! These libraries are maintained by Mojang but we are open to contributions and bug fixes. In general, we consider the backwards compatibility and versioning to be the absolute top priority when making changes to the libraries. Because of this, we strictly adhere to semver for changes, and libraries depend on minecraft modules at specific major versions as well. Any PR submitted to any library **must** contain a change file using the beachball tool to indicate the severity of the change. When a change is submitted, it will automatically update versions and publish to NPM via our pipelines.
18+
Contributions to these libraries are welcome! These libraries are maintained by Mojang but we are open to contributions and bug fixes. In general, we consider the backwards compatibility and versioning to be the absolute top priority when making changes to the libraries. Because of this, we strictly adhere to SemVer for changes, and libraries depend on Minecraft modules at specific major versions as well.
1919

20-
### Naming
20+
### Use Beachball Versioning
2121

22-
We generally follow the naming conventiosn specified by the [google style guide](https://google.github.io/styleguide/jsguide.html#naming). There is other general good practice within the style guide as well, though generally the vast majority of our style is enforced via a combination of ESLint and prettier enforcement at PR time.
22+
All PRs submitted for any package **must** contain a change file using the Beachball tool to indicate the severity of the change. When a change is submitted, it will automatically update versions and publish to NPM via our pipelines. Use `npm run change` to generate changefiles with Beachball.
23+
24+
### Use a Consistent Coding Style
25+
26+
- Use ESLint to lint (`npm run lint`)
27+
- Use Prettier to style
28+
- VS Code is set up to format on save
29+
- The lint command also runs Prettier and can fix issues: `npm run lint:fix`
30+
31+
#### Naming
32+
33+
We generally follow the naming conventions specified by the [Google Style Guide](https://google.github.io/styleguide/jsguide.html#naming). There are other general good practices within the style guide as well, though generally the vast majority of our style is enforced via a combination of ESLint and Prettier enforcement at PR time.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# minecraft-scripting-libraries
22

3-
This repository contains a set of scripting libraries for use with the minecraft scripting modules in creating content for the game. The repository is structured as a javascript "monorepo" that contains multiple packages. These packages are fully javascript and are typically intended to server as helper libraries that can be commonly used when creating content. The libraries are provided both through NPM, but also in pre-bundled forms in cases where user workflows do not leverage techniques such as bundling for their own content creation.
3+
This repository contains a set of scripting libraries for use with the Minecraft Scripting modules in creating content for the game. The repository is structured as a javascript "monorepo" that contains multiple packages. These packages are fully javascript and are typically intended to server as helper libraries that can be commonly used when creating content. The libraries are provided both through NPM, but also in pre-bundled forms in cases where user workflows do not leverage techniques such as bundling for their own content creation.
44

55
More details on each individual library are in the README files for individual packages. The packages are located generally within the libraries subfolder.
66

77
# Working in the repository
88

99
## Prerequisites
1010

11-
1. Install the latest LTS of [Node](https://nodejs.org/en/download) (20 or higher) and confirm after installation that you have NPM 10 or higher also installed.
11+
1. Install the latest LTS of [Node](https://nodejs.org/en/download) (22.x or higher) and confirm after installation that you have NPM 10 or higher also installed.
1212
1. It is recommended to use [nvm](https://github.com/nvm-sh/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows) for ease of management of node version installation.
1313
1. Globally install the [turbo tool](https://turbo.build/repo/docs/installing) using the command `npm install --global turbo`. The turbo tool is used under the covers for all of the build scripts, and having it accessible globally is convenient for running builds from subdirectories as well.
1414

@@ -34,7 +34,7 @@ This will build all packages in this repository in the right order using `turbo`
3434

3535
## Linting
3636

37-
All packages are validated via ESLint with a consistent set of rules as well as enforces styling through prettier. To explicitly run linting, use `npm run lint`, and some changes can be fixed automatically with `npm run lint -- --fix`
37+
All packages are validated via ESLint with a consistent set of rules as well as enforces styling through prettier. To explicitly run linting, use `npm run lint`, and some changes can be fixed automatically with `npm run lint:fix`
3838

3939
## Testing
4040

@@ -46,4 +46,4 @@ See [Contributing.md](./CONTRIBUTING.md) for details on contributions
4646

4747
## Trademark Notice
4848

49-
Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
49+
Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

0 commit comments

Comments
 (0)