Skip to content

Commit

Permalink
Add project-file.md (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoontee committed Dec 5, 2023
1 parent 68b5d88 commit 02d4875
Show file tree
Hide file tree
Showing 16 changed files with 202 additions and 41 deletions.
10 changes: 5 additions & 5 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export default defineConfig({
collapsed: false,
items: [
{
text: 'Project File',
text: 'Project',
collapsed: false,
items: [
{ text: 'Project File Syntax', link: '/lync/project-format/project-file/project-file-syntax' },
{ text: 'Packages', link: '/lync/project-format/project-file/packages' },
{ text: 'Automated Downloads', link: '/lync/project-format/project-file/automated-downloads' },
{ text: 'Automated Jobs', link: '/lync/project-format/project-file/automated-jobs' }
{ text: 'Project File', link: '/lync/project-format/project/project-file' },
{ text: 'Packages', link: '/lync/project-format/project/packages' },
{ text: 'Automated Downloads', link: '/lync/project-format/project/automated-downloads' },
{ text: 'Automated Jobs', link: '/lync/project-format/project/automated-jobs' }
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/lync/getting-started/usage/lync-executable.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ This mode works without having Roblox Studio installed and without an internet c

The `FETCH` mode downloads the list of sources in the project file.

See [project-format/project-file/automated-downloads](/lync/project-format/project-file/automated-downloads).
See [project-format/project/automated-downloads](/lync/project-format/project/automated-downloads).
6 changes: 3 additions & 3 deletions docs/lync/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ See [project-format/files/supported-files](/lync/project-format/files/supported-

Lync offers additional built-in tools for power users to automate aspects of the project.

- [**Packages**](/lync/project-format/project-file/packages) - Download GitHub repositories and insert their contents into the project.
- [**Automated Downloads**](/lync/project-format/project-file/automated-downloads) - Download a list of sources into the project.
- [**Automated Jobs**](/lync/project-format/project-file/automated-jobs) - Run scripts based on file system event criteria.
- [**Packages**](/lync/project-format/project/packages) - Download GitHub repositories and insert their contents into the project.
- [**Automated Downloads**](/lync/project-format/project/automated-downloads) - Download a list of sources into the project.
- [**Automated Jobs**](/lync/project-format/project/automated-jobs) - Run scripts based on file system event criteria.

### Future Proofed

Expand Down
2 changes: 1 addition & 1 deletion docs/lync/introduction/community-tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This list is by no means complete.
::: tip
Lync can download packages and keep them up to date.

See [project-format/project-file/packages](/lync/project-format/project-file/packages).
See [project-format/project/packages](/lync/project-format/project/packages).
:::

::: info Language Servers and Linters
Expand Down
12 changes: 8 additions & 4 deletions docs/lync/project-format/files/excel-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ The resulting table can be formatted in multiple ways.
- `*.Excel.JSON`
:::
::: info Keys
- string `spreadsheet` - A relative path to the associated Excel Spreadsheet.
- string `ref` - The 2D range with which to pull data from. Formatted as `sheetName!rowColumn:rowColumn`, e.g. `Sheet1!A1:C3`. It can also be a [named range](https://support.microsoft.com/en-us/office/create-a-named-range-from-selected-cells-in-a-worksheet-fd8905ed-1130-4cca-9bb0-ad02b7e594fd), which allows the range to be modified from inside the Excel worksheet.
- boolean `hasHeader` - Whether or not the first row should be used as keys for nesting elements in the translated Excel Table.
- number `numColumnKeys` - Defines by how many columns each entry should be nested.
- string `spreadsheet`
- A relative path to the associated Excel Spreadsheet.
- string `ref`
- The 2D range with which to pull data from. Formatted as `sheetName!rowColumn:rowColumn`, e.g. `Sheet1!A1:C3`. It can also be a [named range](https://support.microsoft.com/en-us/office/create-a-named-range-from-selected-cells-in-a-worksheet-fd8905ed-1130-4cca-9bb0-ad02b7e594fd), which allows the range to be modified from inside the Excel worksheet.
- boolean `hasHeader`
- Whether or not the first row should be used as keys for nesting elements in the translated Excel Table.
- number `numColumnKeys`
- Defines by how many columns each entry should be nested.
:::

## Examples
Expand Down
15 changes: 9 additions & 6 deletions docs/lync/project-format/files/json-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ Unlike Model Files (`RBXM`/`RBXMX`\;) their data is limited to that which can be
- `*.Model.JSON`
:::
::: info Keys
- string `name` - Instance.Name.
- string `className` - Instance.ClassName.
- {[string]: any} `properties` - Functions as `instance[property] = value`.
- {[string]: any} `attributes` - Functions as `instance:SetAttribute(attribute, value)`.
- {string} `tags` - Functions as `CollectionService:AddTag(instance, tag)`
- {Instance} `children` - The list of children.
- string `name`
- string `className`
- {[string]: any} `properties`
- Functions as `instance[property] = value`.
- {[string]: any} `attributes`
- Functions as `instance:SetAttribute(attribute, value)`.
- {string} `tags`
- Functions as `CollectionService:AddTag(instance, tag)`
- {Instance} `children`
:::

## Example
Expand Down
12 changes: 8 additions & 4 deletions docs/lync/project-format/files/meta-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ They are used in scenarios where it would be desirable to change the properties
- `Init.Meta.JSON` - For directories.
:::
::: info Keys
- string `className` - Instance.ClassName. Usable only with directories.
- {[string]: any} `properties` - Functions as `instance[property] = value`.
- {[string]: any} `attributes` - Functions as `instance:SetAttribute(attribute, value)`.
- {string} `tags` - Functions as `CollectionService:AddTag(instance, tag)`
- string `className`
- Usable only with directories.
- {[string]: any} `properties`
- Functions as `instance[property] = value`.
- {[string]: any} `attributes`
- Functions as `instance:SetAttribute(attribute, value)`.
- {string} `tags`
- Functions as `CollectionService:AddTag(instance, tag)`
:::

## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/lync/project-format/files/supported-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All forms of Roblox content can be stored on the filesystem and synced.
| TOML Tables | `TOML` | [ModuleScript](https://create.roblox.com/docs/reference/engine/classes/ModuleScript) |
| Plain Text | `TXT` | [StringValue](https://create.roblox.com/docs/reference/engine/classes/StringValue) |
| Localization Table | `CSV` | [LocalizationTable](https://create.roblox.com/docs/reference/engine/classes/LocalizationTable) |
| [Child Projects](/lync/project-format/project-file/project-file-syntax) | `*.Project.JSON` | Varies |
| [Child Projects](/lync/project-format/project/project-file) | `*.Project.JSON` | Varies |
| [Meta Files](/lync/project-format/files/meta-files) | `*.Meta.JSON` | Varies |
| [JSON Models](/lync/project-format/files/json-models) | `*.Model.JSON` | Varies |
| [Excel Tables](/lync/project-format/files/excel-tables) | `*.Excel.JSON` | [ModuleScript](https://create.roblox.com/docs/reference/engine/classes/ModuleScript) |
Expand Down
4 changes: 0 additions & 4 deletions docs/lync/project-format/project-file/automated-downloads.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/lync/project-format/project-file/automated-jobs.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/lync/project-format/project-file/project-file-syntax.md

This file was deleted.

16 changes: 16 additions & 0 deletions docs/lync/project-format/project/automated-downloads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
::: danger UNFINISHED
This documentation is unfinished.
:::

# Automated Downloads

## Syntax

::: info Keys
- string `name`
- string `url`
- string `type`
- {[string]: string} `headers`
- string | Object `postData`
- string `path`
:::
13 changes: 13 additions & 0 deletions docs/lync/project-format/project/automated-jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
::: danger UNFINISHED
This documentation is unfinished.
:::

# Automated Jobs

## Syntax

::: info Keys
- string `globPath`
- {string} `on`
- string `commandName`
:::
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
::: danger UNFINISHED
This documentation is unfinished.
:::

# Packages

::: tip
Expand Down
131 changes: 131 additions & 0 deletions docs/lync/project-format/project/project-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
::: danger UNFINISHED
This documentation is unfinished.
:::

# Project File

## Syntax

::: info File Name
- `Default.Project.JSON`
- The default project to load when running Lync without the project file argument.
- `*.Project.JSON`
- For non-default projects.
:::
::: info Keys
- string `name`
- The name of the project for informational purposes.
- string `base` *(Optional)*
- The path to the file to build in when using `OPEN` and `BUILD` modes.
- When omitted, Lync builds in a new file.
- string `build`
- The path to save the finished build file when using `OPEN` and `BUILD` modes.
- number `port`
- The network port to serve the project on when using `SERVE` and `OPEN` modes.
- string `remoteAddress` *(Optional)*
- The IP address or hostname to connect to instead of the localhost.
- {number} `servePlaceIds` *(Optional)*
- {string} `globIgnorePaths` *(Optional)*
- An array of glob paths to ignore when mapping the project.
- {RBXM: boolean, RBXMX: boolean} `sourcemapEnabled` *(Optional)*
- Controls which types of Model Files (`RBXM`/`RBXMX`) are parsed during sourcemap generation.
- Object `sources` *(Optional)*
- See [project-format/project/automated-downloads](/lync/project-format/project/automated-downloads).
- Object `jobs` *(Optional)*
- See [project-format/project/automated-jobs](/lync/project-format/project/automated-jobs).
- Object `tree`
- The root Instance.
:::
::: danger UNAVAILABLE
`remoteAddress` is unimplemented.
:::

### Example

```json
{
"name": "Example Project",
"base": "Base.rbxl",
"build": "Build.rbxl",
"port": 34873,
"remoteAddress": "localhost",
"servePlaceIds": 1818,
"globIgnorePaths": [ "ignoredDirectory/**" ],
"sourcemapEnabled": {
"RBXM": true,
"RBXMX": true
},
"sources": { ... },
"jobs": { ... },

"tree": {
...
}
}
```

## Instance Definitions

::: info Keys
- string `$className` *(Optional)*
- Has no effect when `$path` is specified.
- (string | Object) `$path` *(Optional)*
- A path to a file or directory that overrides the Instance Definition.
- Use `"$path": { "optional": "..." }` when the file or directory could possibly be non-existant.
- Use `"$path": { "package": "...", "type": "..." }` for [Packages](/lync/project-format/project/packages).
- {[string]: any} `$properties` *(Optional)*
- Functions as `instance[property] = value`.
- {[string]: any} `$attributes` *(Optional)*
- Functions as `instance:SetAttribute(attribute, value)`.
- {string} `$tags` *(Optional)*
- Functions as `CollectionService:AddTag(instance, tag)`.
- boolean `$clearOnSync` *(Optional)*
- When `true`, the associated Instance and its descendants will be destroyed in Studio when performing sync operations.
- Useful for clearing unmapped content when modifications are made outside your active live sync session.
:::

### Values

Values not storable in JSON, like `Enum`, `Color3`, `Vector3` and so on, should be represented as a single Lua string wrapped inside an array (e.g., `[ "Value" ]`.)


### Example

```json
"Wood Brick": {
"$className": "Part",
"$properties": {
"Color": [ "Color3.fromRGB(132, 66, 4)" ],
"Material": [ "Enum.Material.Wood" ],
"Transparency": 0,
"Position": [ "Vector3.new(0, 10, 0)" ],
"Anchored": true
},
"$attributes": {
"ExampleAttribute": true
},
"$tags": [ "ExampleTag1", "ExampleTag2", "ExampleTag3" ]
}
```

## Terrain

::: info Keys
- {[1]: string, [2]: Lua, [3]: boolean} `Terrain.$terrainRegion` *(Optional)*
- Functions as `Terrain:PasteRegion(region, corner, pasteEmptyCells)`.
- {[string]: Lua} `Terrain.$terrainMaterialColors` *(Optional)*
- Functions as `Terrain:SetMaterialColor(material, value)`.
:::

### Example

```json
"Workspace": {
"Terrain": {
"$terrainRegion": [ "Assets/TerrainRegion.rbxm", [ "Vector3int16.new(-32000, -32000, -32000)" ], true ],
"$terrainMaterialColors": {
"Grass": [ "Color3.new(0, 0.5, 0)" ]
}
}
}
```
9 changes: 5 additions & 4 deletions docs/lync/project-format/sourcemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ This file cannot be deleted and should be ignored unless you're a tool developer
- `sourcemap.json`
:::
::: info Keys
- string `name` - Instance.Name.
- string `className` - Instance.ClassName.
- {string} `filePaths` - The list of files that have an effect on the Instance.
- {Instance} `children` - The list of children.
- string `name`
- string `className`
- {string} `filePaths`
- The list of files that have an effect on the Instance.
- {Instance} `children`
:::

## Example
Expand Down

0 comments on commit 02d4875

Please sign in to comment.