You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/build.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: Build
3
-
sidebar_position: 3
2
+
title: Contributing
3
+
sidebar_position: 5
4
4
---
5
5
6
6
# Build Nevermore locally
7
7
This document is intended to help people submit bug patches, new features, and more to Nevermore. If you would simply like to consume Nevermore and not contribute to it, then this is not the correct article. Please see the [installation](/docs/install) docs for more.
8
8
9
-
To provide a bit of background, Nevermore is a mono-repo. This means that it has a few hundred packages in one repository. In general, you should feel free to deploy Nevermore compatible packages to your own repository. This is part of what using npm empowers us to do.
9
+
To provide a bit of background, Nevermore is a mono-repo. This means that it has a few hundred packages in one repository. In general, you should feel free to deploy Nevermore compatible packages to your own repository. This is part of what using npm empowers us to do.
10
10
11
11
## What you need to be comfortable with
12
12
Contributing to Nevermore is a little bit more difficult than consuming it. That being said, it shouldn't be too bad.
## Why does building need a custom version of Rojo?
72
72
Nevermore does not need a custom version of Rojo to be consumed, but it does need one to be built. This custom version of Rojo understands symlinks and turn them into ObjectValues. These symlinks link the packages together and means that a change to a transient dependency, or direct dependency will immediately be shown in the upstream package.
73
73
74
-
As an added bonus, this custom version of Rojo also supports live-syncing mesh parts.
74
+
As an added bonus, this custom version of Rojo also supports live-syncing mesh parts.
Copy file name to clipboardexpand all lines: docs/install.md
+52-25
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,17 @@ Nevermore should be installable within 2-3 minutes if you follow this guide.
15
15
toc={toc.filter((node) => node.level <= 3)}
16
16
/>
17
17
18
-
19
-
## Fast track: Installing via NPM and the Nevermore CLI
20
-
If you want to just try out Nevermore, making a new templated game can be the easiest way to do this. For this reason, there is now a Nevermore CLI that can be used. A CLI stands for command line interface.
18
+
## Fast track: Installing via NPM and the Nevermore CLI (recommended)
19
+
If you want to just try out Nevermore, making a new templated game can be the easiest way to do this. For this reason, there is now a Nevermore CLI that can be used. A CLI stands for command line interface.
21
20
22
21
* Install [Node.js](https://nodejs.org/en/download/) v14+ on your computer.
23
22
* Install [rojo](https://rojo.space/docs/v7/getting-started/installation/) v7+ on your computer.
24
23
25
-
We can then use the npm command line to generate a working directory.
24
+
We can then use the npm command line to generate a working directory.
26
25
27
-
1. Open a terminal, like Command Prompt, Powershell, or [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701) (recommended).
26
+
1. Open a terminal, like Command Prompt, PowerShell, or [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701) (recommended).
28
27
2. Change directory to the location you would like to initialize and create files. You can do this by typing `mkdir MyGame` and then `cd MyGame`. You can use `dir` or `ls` to list out the current directory.
29
-
2. Run the command `npx nevermore init` to generate a new game.
28
+
2. Run the command `npx nevermore init` to generate a new game.
30
29
3. Run the command `npm install @quenty/maid` or whatever package you want.
31
30
32
31
:::tip
@@ -42,7 +41,7 @@ This will install the current version of Maid and all dependencies into the `nod
42
41
[npm](https://www.npmjs.com/) is a package manager. Nevermore uses npm to manage package versions and install transient dependencies. A transient dependency is a dependency of a dependency (for example, [Blend](/api/Blend) depends upon [Maid](/api/Maid).
43
42
44
43
### How do I install additional packages?
45
-
The default installation comes with very few packages. This is normal. You can see which packages are installed by looking at the `package.json` file in a text editor. To install additional packages, simply run the following command in a terminal
44
+
The default installation comes with very few packages. This is normal. You can see which packages are installed by looking at the `package.json` file in a text editor. To install additional packages, simply run the following command in a terminal:
46
45
47
46
```bash
48
47
npm install @quenty/servicebag
@@ -57,7 +56,7 @@ When you run `npm install` you end up with a `package-lock.json`. You should com
57
56
58
57
Nevermore is designed to work with games with existing architecture. If you're using Knit, a multi-script architecture, a custom framework or a single-script architecture, Nevermore provides a lot of utility modules that are useful in any of these scenarios. Nevermore's latest version also supports multiple copies of Nevermore running at once as long as bootstrapping is carefully managed. This can allow you to develop your game in an isolated way, or introduce Nevermore dependencies slowly as you need them.
59
58
60
-
If you want to install this into an existing game follow these instructions.
59
+
If you want to install this into an existing game follow these instructions:
61
60
62
61
Ensure that you have [Node.js](https://nodejs.org/en/download/) v14+ installed on your computer.
63
62
@@ -67,48 +66,70 @@ Ensure that you have [rojo](https://rojo.space/docs/v7/getting-started/installat
67
66
1. Install `npm install @quenty/loader`
68
67
2. Sync in the `node_modules` folder using Rojo. A common file format is something like this:
69
68
70
-
This is a rojo`project.json` file:
69
+
This is an example of a Rojo`project.json` file that is generated by the Nevermore CLI:
71
70
```json
72
71
{
73
-
"name": "GameName",
72
+
"name": "MyGame",
74
73
"globIgnorePaths": [ "**/.package-lock.json" ],
75
74
"tree": {
76
75
"$className": "DataModel",
77
76
"ServerScriptService": {
78
-
"integration": {
79
-
"$path": "node_modules"
77
+
"MyGame": {
78
+
"$className": "Folder",
79
+
"game": {
80
+
"$path": "src/modules"
81
+
},
82
+
"node_modules": {
83
+
"$path": "node_modules"
84
+
}
85
+
},
86
+
"GameNameScripts": {
87
+
"$path": "src/scripts/Server"
88
+
}
89
+
},
90
+
"StarterPlayer": {
91
+
"StarterPlayerScripts": {
92
+
"GameNameScripts": {
93
+
"$path": "src/scripts/Client"
94
+
}
80
95
}
81
96
}
82
97
}
83
98
}
84
99
```
85
100
86
-
You can put the `node_modules` folder whereever you want, but the recommended location is `ServerScriptService`.
101
+
You can put the `MyGame` folder wherever you want, but the recommended location is `ServerScriptService`.
87
102
88
-
In your main script you will need to "bootstrap" the components such that `script.Parent.loader` is defined. To do this the following snippet will work.
103
+
In your main script you will need to "bootstrap" the components such that `script.Parent.loader` is defined. To do this the following snippet will work, and is generated by the Nevermore CLI as `ServerMain.server.lua`:
This will create the following components which you can rename if you want.
112
+
This will create the following folders in ReplicatedStorage when the game loads:
113
+
1. MyGame
114
+
* game
115
+
* Client
116
+
* Shared
117
+
* Server
118
+
* node_modules
98
119
99
-
1. ReplicatedStorage.Packages
100
-
2.ReplicatedStorage.SharedPackages
101
-
3. ServerScriptService.Packages
120
+
:::caution
121
+
You might notice that the Server folder is also cloned to the `game` folder in ReplicatedStorage. This is an intentional optimization that only happens in Studio.
122
+
:::
102
123
103
-
From here, every exported package will exist in the packages folder root, with only modules needed to be replicated.
124
+
From here, every exported package will exist in the `node_modules` folder, populated only by modules that need to be replicated to that context.
104
125
105
-
To access the exported packages on the client, you perform the same bootstrap operation on the new replicated location.
126
+
To access the exported packages on the client, you perform the same bootstrap operation on the new replicated location (also generated, as `ClientMain.client.lua`):
Assuming you've changed nothing, the path to the replicated modules should be the same as the one used on the server, just indexed under ReplicatedStorage instead.
@@ -123,7 +144,7 @@ Ensure that you have [rojo](https://rojo.space/docs/v7/getting-started/installat
123
144
1. Run `npm init`
124
145
2. Run `npm install @quenty/loader` and whatever packages you want.
125
146
126
-
In your bootstrapping code you can write something like this for your server code.
147
+
In your bootstrapping code you can write something like this for your server code.
127
148
128
149
Notice we manually transform and parent our returned loader components. this allows us to bootstrap the
129
150
components. We then parent the client component into ReplicatedFirst with dependencies.
@@ -177,6 +198,12 @@ serviceBag:Start()
177
198
```
178
199
179
200
## Manually installing with NPM for Plugins
201
+
You can use the Nevermore CLI to generate a project structure for a new plugin.
202
+
180
203
Ensure that you have [Node.js](https://nodejs.org/en/download/) v14+ installed on your computer.
181
204
182
205
Ensure that you have [rojo](https://rojo.space/docs/v7/getting-started/installation/) v7+ installed on your computer.
0 commit comments