Skip to content

Commit 89c636f

Browse files
authored
feat: Add variant docs, plus a simple placeholder to cause another build (#82)
* feat: Add variant docs, plus a simple placeholder to cause another build - Giving this a name of feat: to trigger a build * fix: Update text based on a recommendation
1 parent 93f1879 commit 89c636f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ProjectStructure.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Project Structure
22

3-
Most logic source is located under the /app folder. This application compiles to a web app (`npm run web` and/or `gulp webbuild`) and as NodeJS-compatible libraries (`gulp jsncorebuild`). Also, there is a small suite of tests (`npm run test`).
3+
Most logic source is located under the /app folder. Run `npm run all` to do a synchronization of NPM and pre-build activities plus a full build (it should be a one-stop-shop for getting everything set up). This application compiles to a web app (`npm run web` and/or `gulp webbuild`) and as NodeJS-compatible libraries (`gulp jsncorebuild`). Also, there is a small suite of tests (`npm run test`).
44

55
## Core Types: Carto, Project, and ProjectItem
66

@@ -40,6 +40,18 @@ The project item represents a single logical "atom" object of the project - e.g.
4040

4141
A project item is typically associated with an IFile (in some limited cases, it points at a Folder, e.g., in the case of a World). IFiles have a .manager generic Object property. Typically, ProjectItem uses this dummy property to store a per-file manager - e.g., an EntityTypeDefinition object is stored on the IFile for an entity type definition (e.g., skeleton.json) which has the actual logic for managing an entity type definition.
4242

43+
Project Items have a concept of Variants. A variant is an equivalent of a logical file in the project folder hierarchy. For example, when a project has subpacks, it might have a JSON file at:
44+
45+
RP/particles/fireworks.json
46+
47+
and
48+
49+
RP/subpacks/fancy/particles/fireworks.json
50+
51+
These are two separate files that are variants of the same logic project item (RP/particles/fireworks.json). ProjectItem .defaultFile will refer to the first of these (RP/particles/fireworks.json) - though it is important to note that not every structure has a non-null default file. When working with ProjectItem, you'll typically want to get the .primaryFile, which, based on the organization scheme of the project, will return the "foremost" version of the file for the project item.
52+
53+
In *most* projects, one project item has one file (or folder), and one variant (""), which corresponds to the default file.
54+
4355
## File System Abstractions
4456

4557
![File System abstraction and implementation objects type diagram](./misc/code/istorage.png)

0 commit comments

Comments
 (0)