Skip to content

Commit 8848be5

Browse files
authored
* chore: migrate to pnpm * chore: set minimumReleaseAge to 3 days * feat: apply vuejs/vitepress#5014 * fix: transclusions from #415
1 parent 96fff51 commit 8848be5

File tree

14 files changed

+2896
-4199
lines changed

14 files changed

+2896
-4199
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
crowdin.yaml @FabricMC/developers
66
netlify.toml @FabricMC/developers
77
package.json @FabricMC/developers
8-
package-lock.json @FabricMC/developers
8+
patches @FabricMC/developers
9+
pnpm-*.yaml @FabricMC/developers

.github/workflows/build.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ jobs:
2121
- uses: actions/setup-node@v4
2222
with:
2323
node-version-file: .nvmrc
24-
- run: npm ci
25-
- run: npm run build
24+
- uses: pnpm/action-setup@58e6119fe4f3092a76a7771efb55e04d25b6b26f
25+
with:
26+
run_install: true
27+
- run: pnpm build
2628
- if: github.event_name != 'pull_request'
2729
uses: actions/configure-pages@v4
2830
- if: github.event_name != 'pull_request'

.github/workflows/format.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
- uses: actions/setup-node@v4
2424
with:
2525
node-version-file: .nvmrc
26-
- run: npm ci
26+
- uses: pnpm/action-setup@58e6119fe4f3092a76a7771efb55e04d25b6b26f
27+
with:
28+
run_install: true
2729
- uses: FabricMCBot/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8
2830
with:
2931
config: .markdownlint-cli2.yaml
@@ -42,7 +44,9 @@ jobs:
4244
- uses: actions/setup-node@v4
4345
with:
4446
node-version-file: .nvmrc
45-
- run: npm ci
47+
- uses: pnpm/action-setup@58e6119fe4f3092a76a7771efb55e04d25b6b26f
48+
with:
49+
run_install: true
4650
- run: npx prettier --write .
4751
- run: |
4852
readarray -d '' files < <(git ls-files --modified --others --exclude-standard -z)

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
.DS_Store
1111

1212
# Alternative Package Locks
13-
pnpm-lock.yaml
14-
pnpm-workspace.yaml
13+
package-lock.json
1514
yarn.lock
1615

1716
# LanguageTool Dictionaries and False Positives

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vitepress/sidebars/versioned
2+
pnpm-lock.yaml
23
reference/*.*
34
reference/latest/src/main/generated
45
translated

contributing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ git clone https://github.com/your-username/fabric-docs.git
6161

6262
#### Installing Dependencies {#install-dependencies}
6363

64-
If you want to preview your changes locally, you will need to install [Node.js 18+](https://nodejs.org/en/).
64+
If you want to preview your changes locally, you will need to install [Node.js 18+](https://nodejs.org/en/) and [pnpm](https://pnpm.io/).
6565

6666
After that, make sure to install all dependencies with:
6767

6868
```sh
69-
npm install
69+
pnpm install
7070
```
7171

7272
#### Running the Development Server {#run-the-development-server}
7373

7474
This will allow you to preview your changes locally at `localhost:5173` and will automatically reload the page when you make changes.
7575

7676
```sh
77-
npm run dev
77+
pnpm dev
7878
```
7979

8080
Now you can open and browse the website from the browser by visiting `http://localhost:5173`.
@@ -84,15 +84,15 @@ Now you can open and browse the website from the browser by visiting `http://loc
8484
This will compile all Markdown files into static HTML files and place them in `.vitepress/dist`:
8585

8686
```sh
87-
npm run build
87+
pnpm build
8888
```
8989

9090
#### Previewing the Built Website {#previewing-the-built-website}
9191

9292
This will start a local server on port `4173` serving the content found in `.vitepress/dist`:
9393

9494
```sh
95-
npm run preview
95+
pnpm preview
9696
```
9797

9898
#### Opening a Pull Request {#opening-a-pull-request}

develop/blocks/block-containers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ In this tutorial we'll create a block that uses its container to duplicate any i
1313

1414
This should be familiar to the reader if they've followed the [Creating Your First Block](../blocks/first-block) and [Block Entities](../blocks/block-entities) guides. We'll create a `DuplicatorBlock` that extends `BaseEntityBlock` and implements `EntityBlock`.
1515

16-
@[code transcludeWith=:::block](@/reference/latest/src/main/java/com/example/docs/block/custom/DuplicatorBlock.java)
16+
<<< @/reference/latest/src/main/java/com/example/docs/block/custom/DuplicatorBlock.java#block
1717

1818
Then, we need to create a `DuplicatorBlockEntity`, which needs to implement the `Container` interface. As most containers are generally expected to work the same way, you can copy and paste a helper called `ImplementedContainer` that does most of the work, leaving us with just a few methods to implement.
1919

2020
::: details Show `ImplementedContainer`
2121

22-
@[code](@/reference/latest/src/main/java/com/example/docs/container/ImplementedContainer.java)
22+
<<< @/reference/latest/src/main/java/com/example/docs/container/ImplementedContainer.java
2323

2424
:::
2525

26-
@[code transcludeWith=:::be](@/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java)
26+
<<< @/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java#be
2727

2828
The `items` list is where the container's contents are stored. For this block we have it set to a size of 1 slot for the input.
2929

@@ -33,15 +33,15 @@ Don't forget to register the block and block entity in their respective classes!
3333

3434
If we want the contents to persist between game reloads like a vanilla `BlockEntity`, we need to save it as NBT. Thankfully, Mojang provides a helper class called `ContainerHelper` with all the necessary logic.
3535

36-
@[code transcludeWith=:::save](@/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java)
36+
<<< @/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java#save
3737

3838
## Interacting with the Container {#interacting-with-the-container}
3939

4040
Technically, the container is already functional. However, to insert items, we currently need to use hoppers. Let's make it so that we can insert items by right-clicking the block.
4141

4242
To do that, we need to override the `useItemOn` method in the `DuplicatorBlock`:
4343

44-
@[code transcludeWith=:::useon](@/reference/latest/src/main/java/com/example/docs/block/custom/DuplicatorBlock.java)
44+
<<< @/reference/latest/src/main/java/com/example/docs/block/custom/DuplicatorBlock.java#useon
4545

4646
Here, if the player is holding an item and there is an empty slot, we move the item from the player's hand to the block's container and return `InteractionResult.SUCCESS`.
4747

@@ -55,7 +55,7 @@ Let's now make it so that the block duplicates the stack you threw in it, but on
5555

5656
To do this, we'll add a `tick` function to the `DuplicatorBlockEntity`, and a field to store how much we've been waiting:
5757

58-
@[code transcludeWith=:::tick](@/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java)
58+
<<< @/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java#tick
5959

6060
The `DuplicatorBlock` should now have a `getTicker` method that returns a reference to `DuplicatorBlockEntity::tick`.
6161

@@ -73,13 +73,13 @@ To create this behavior, we need to implement the `WorldlyContainer` interface i
7373

7474
Let's modify the `DuplicatorBlockEntity` to only accept items from the top:
7575

76-
@[code transcludeWith=:::accept](@/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java)
76+
<<< @/reference/latest/src/main/java/com/example/docs/block/entity/custom/DuplicatorBlockEntity.java#accept
7777

7878
The `getSlotsForFace` returns an array of the slot _indices_ that can be interacted with from the given side. In this case, we only have a single slot (`0`), so we return an array with just that index.
7979

8080
Also, we should modify the `useItemOn` method of the `DuplicatorBlock` to actually respect the new behavior:
8181

82-
@[code transcludeWith=:::place](@/reference/latest/src/main/java/com/example/docs/block/custom/DuplicatorBlock.java)
82+
<<< @/reference/latest/src/main/java/com/example/docs/block/custom/DuplicatorBlock.java#place
8383

8484
Now, if we try to insert items from the side instead of the top, it won't work!
8585

0 commit comments

Comments
 (0)