Fix .editorconfig and formatting

This commit is contained in:
Filip Tibell 2023-06-08 11:15:41 +02:00
parent c063230f4c
commit 422a097598
No known key found for this signature in database
12 changed files with 490 additions and 488 deletions

View file

@ -5,13 +5,11 @@ charset = utf-8
end_of_line = lf end_of_line = lf
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
indent_style = tab
indent_size = 4
[*.{json,jsonc,json5] [*.{json,jsonc,json5}]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
[*.{yml,yaml] [*.{yml,yaml}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

View file

@ -1,5 +1,5 @@
root: ./docs root: ./docs
structure: structure:
readme: ./README.md readme: ./README.md
summary: ./SUMMARY.md summary: ./SUMMARY.md

12
.luaurc
View file

@ -1,7 +1,9 @@
{ {
"languageMode": "strict", "languageMode": "strict",
"lint": { "*": true }, "lint": {
"lintErrors": false, "*": true
"typeErrors": true, },
"globals": [] "lintErrors": false,
"typeErrors": true,
"globals": []
} }

View file

@ -1,8 +1,8 @@
{ {
"recommendations": [ "recommendations": [
"rust-lang.rust-analyzer", "rust-lang.rust-analyzer",
"esbenp.prettier-vscode", "esbenp.prettier-vscode",
"JohnnyMorganz.stylua", "JohnnyMorganz.stylua",
"DavidAnson.vscode-markdownlint" "DavidAnson.vscode-markdownlint"
] ]
} }

70
.vscode/settings.json vendored
View file

@ -1,37 +1,37 @@
{ {
// Luau - disable Roblox features, enable Lune typedefs & requires // Luau - disable Roblox features, enable Lune typedefs & requires
"luau-lsp.sourcemap.enabled": false, "luau-lsp.sourcemap.enabled": false,
"luau-lsp.types.roblox": false, "luau-lsp.types.roblox": false,
"luau-lsp.require.mode": "relativeToFile", "luau-lsp.require.mode": "relativeToFile",
"luau-lsp.require.fileAliases": { "luau-lsp.require.fileAliases": {
"@lune/fs": "./docs/typedefs/FS.luau", "@lune/fs": "./docs/typedefs/FS.luau",
"@lune/net": "./docs/typedefs/Net.luau", "@lune/net": "./docs/typedefs/Net.luau",
"@lune/process": "./docs/typedefs/Process.luau", "@lune/process": "./docs/typedefs/Process.luau",
"@lune/roblox": "./docs/typedefs/Roblox.luau", "@lune/roblox": "./docs/typedefs/Roblox.luau",
"@lune/serde": "./docs/typedefs/Serde.luau", "@lune/serde": "./docs/typedefs/Serde.luau",
"@lune/stdio": "./docs/typedefs/Stdio.luau", "@lune/stdio": "./docs/typedefs/Stdio.luau",
"@lune/task": "./docs/typedefs/Task.luau" "@lune/task": "./docs/typedefs/Task.luau"
}, },
// Luau - ignore type defs file in docs dir and dev scripts we use // Luau - ignore type defs file in docs dir and dev scripts we use
"luau-lsp.ignoreGlobs": [ "luau-lsp.ignoreGlobs": [
"docs/*.d.luau", "docs/*.d.luau",
"packages/lib-roblox/scripts/*.luau", "packages/lib-roblox/scripts/*.luau",
"tests/roblox/rbx-test-files/**/*.lua", "tests/roblox/rbx-test-files/**/*.lua",
"tests/roblox/rbx-test-files/**/*.luau" "tests/roblox/rbx-test-files/**/*.luau"
], ],
// Rust // Rust
"rust-analyzer.check.command": "clippy", "rust-analyzer.check.command": "clippy",
// Formatting // Formatting
"editor.formatOnSave": true, "editor.formatOnSave": true,
"stylua.searchParentDirectories": true, "stylua.searchParentDirectories": true,
"prettier.tabWidth": 2, "prettier.tabWidth": 2,
"[luau][lua]": { "[luau][lua]": {
"editor.defaultFormatter": "JohnnyMorganz.stylua" "editor.defaultFormatter": "JohnnyMorganz.stylua"
}, },
"[json][jsonc][markdown][yaml]": { "[json][jsonc][markdown][yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[rust]": { "[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer" "editor.defaultFormatter": "rust-lang.rust-analyzer"
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -29,16 +29,16 @@ Lune provides fully asynchronous APIs wherever possible, and is built in Rust
## Features ## Features
- 🌙 A strictly minimal but powerful interface that is easy to read and remember, just like Luau itself - 🌙 A strictly minimal but powerful interface that is easy to read and remember, just like Luau itself
- 🧰 Fully featured APIs for the filesystem, networking, stdio, all included in the small (~3mb) executable - 🧰 Fully featured APIs for the filesystem, networking, stdio, all included in the small (~3mb) executable
- 📚 World-class documentation, on the web _or_ directly in your editor, no network connection necessary - 📚 World-class documentation, on the web _or_ directly in your editor, no network connection necessary
- 🏡 A familiar scripting environment for Roblox developers, with an included 1-to-1 task scheduler port - 🏡 A familiar scripting environment for Roblox developers, with an included 1-to-1 task scheduler port
- ✏️ Optional built-in library for manipulating Roblox place & model files, and their instances - ✏️ Optional built-in library for manipulating Roblox place & model files, and their instances
## Non-goals ## Non-goals
- Making scripts short and terse - proper autocomplete / intellisense make scripting using Lune just as quick, and readability is important - Making scripts short and terse - proper autocomplete / intellisense make scripting using Lune just as quick, and readability is important
- Running full Roblox game scripts outside of Roblox - there is some compatibility, but Lune is meant for different purposes - Running full Roblox game scripts outside of Roblox - there is some compatibility, but Lune is meant for different purposes
## Where do I start? ## Where do I start?

View file

@ -2,23 +2,23 @@
## Home ## Home
- [Installation](pages/home/Installation.md) - [Installation](pages/home/Installation.md)
- [Writing Scripts](pages/home/Writing-Scripts.md) - [Writing Scripts](pages/home/Writing-Scripts.md)
- [Running Scripts](pages/home/Running-Scripts.md) - [Running Scripts](pages/home/Running-Scripts.md)
- [Editor Setup](pages/home/Editor-Setup.md) - [Editor Setup](pages/home/Editor-Setup.md)
## Roblox ## Roblox
- [Introduction](pages/roblox/Introduction.md) - [Introduction](pages/roblox/Introduction.md)
- [Examples](pages/roblox/Examples.md) - [Examples](pages/roblox/Examples.md)
- [API Status](pages/roblox/Api-Status.md) - [API Status](pages/roblox/Api-Status.md)
## API Reference ## API Reference
- [fs](pages/api/fs.md) - [fs](pages/api/fs.md)
- [net](pages/api/net.md) - [net](pages/api/net.md)
- [process](pages/api/process.md) - [process](pages/api/process.md)
- [roblox](pages/api/roblox.md) - [roblox](pages/api/roblox.md)
- [serde](pages/api/serde.md) - [serde](pages/api/serde.md)
- [stdio](pages/api/stdio.md) - [stdio](pages/api/stdio.md)
- [task](pages/api/task.md) - [task](pages/api/task.md)

View file

@ -10,13 +10,13 @@ These steps assume you have already installed Lune and that it is available to r
2. Verify that type definition files have been generated 2. Verify that type definition files have been generated
3. Modify your VSCode settings, either by using the settings menu or in `settings.json`: 3. Modify your VSCode settings, either by using the settings menu or in `settings.json`:
```json ```json
"luau-lsp.require.mode": "relativeToFile", // Set the require mode to work with Lune "luau-lsp.require.mode": "relativeToFile", // Set the require mode to work with Lune
"luau-lsp.require.fileAliases": { // Add type definitions for Lune builtins "luau-lsp.require.fileAliases": { // Add type definitions for Lune builtins
"@lune/fs": ".../.lune/.typedefs/x.y.z/fs.luau", "@lune/fs": ".../.lune/.typedefs/x.y.z/fs.luau",
"@lune/net": ".../.lune/.typedefs/x.y.z/net.luau", "@lune/net": ".../.lune/.typedefs/x.y.z/net.luau",
"@lune/...": "..." "@lune/...": "..."
} }
``` ```
_**NOTE:** If you already had a `.vscode/settings.json` file in your current directory the type definition files may have been added automatically!_ _**NOTE:** If you already had a `.vscode/settings.json` file in your current directory the type definition files may have been added automatically!_

View file

@ -32,5 +32,5 @@ There are many tools that can install binaries directly from releases, and it is
Congratulations! You've installed Lune and are now ready to write your first script. Congratulations! You've installed Lune and are now ready to write your first script.
- If you want to write standalone scripts, head over to the [Writing Scripts](https://lune.gitbook.io/lune/home/writing-scripts) page. - If you want to write standalone scripts, head over to the [Writing Scripts](https://lune.gitbook.io/lune/home/writing-scripts) page.
- If you want to write Lune scripts specifically for Roblox, check out the [Roblox](https://lune.gitbook.io/lune/roblox/intro) section. - If you want to write Lune scripts specifically for Roblox, check out the [Roblox](https://lune.gitbook.io/lune/roblox/intro) section.

View file

@ -10,9 +10,11 @@ lune script-name
This will look for the file `script-name.luau`**_<sup>[1]</sup>_** in a few locations: This will look for the file `script-name.luau`**_<sup>[1]</sup>_** in a few locations:
- The current directory - The current directory
- The folder `lune` in the current directory, if it exists - The folder `lune` in the current directory, if it exists
- The folder `.lune` in the current directory, if it exists - The folder `.lune` in the current directory, if it exists
- The folder `lune` in the _home_ directory, if it exists
- The folder `.lune` in the _home_ directory, if it exists
## 🎛️ Passing Command-Line Arguments ## 🎛️ Passing Command-Line Arguments

View file

@ -14,63 +14,63 @@ However, if a recently added datatype is missing, and it can be used as an insta
Currently implemented APIs: Currently implemented APIs:
- [`new`](https://create.roblox.com/docs/reference/engine/datatypes/Instance#new) - note that this does not include the second `parent` argument - [`new`](https://create.roblox.com/docs/reference/engine/datatypes/Instance#new) - note that this does not include the second `parent` argument
- [`AddTag`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#AddTag) - [`AddTag`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#AddTag)
- [`Clone`](https://create.roblox.com/docs/reference/engine/classes/Instance#Clone) - [`Clone`](https://create.roblox.com/docs/reference/engine/classes/Instance#Clone)
- [`Destroy`](https://create.roblox.com/docs/reference/engine/classes/Instance#Destroy) - [`Destroy`](https://create.roblox.com/docs/reference/engine/classes/Instance#Destroy)
- [`ClearAllChildren`](https://create.roblox.com/docs/reference/engine/classes/Instance#ClearAllChildren) - [`ClearAllChildren`](https://create.roblox.com/docs/reference/engine/classes/Instance#ClearAllChildren)
- [`FindFirstAncestor`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstAncestor) - [`FindFirstAncestor`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstAncestor)
- [`FindFirstAncestorOfClass`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstAncestorOfClass) - [`FindFirstAncestorOfClass`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstAncestorOfClass)
- [`FindFirstAncestorWhichIsA`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstAncestorWhichIsA) - [`FindFirstAncestorWhichIsA`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstAncestorWhichIsA)
- [`FindFirstChild`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstChild) - [`FindFirstChild`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstChild)
- [`FindFirstChildOfClass`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstChildOfClass) - [`FindFirstChildOfClass`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstChildOfClass)
- [`FindFirstChildWhichIsA`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstChildWhichIsA) - [`FindFirstChildWhichIsA`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstChildWhichIsA)
- [`GetAttribute`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetAttribute) - [`GetAttribute`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetAttribute)
- [`GetAttributes`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetAttributes) - [`GetAttributes`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetAttributes)
- [`GetChildren`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetChildren) - [`GetChildren`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetChildren)
- [`GetDescendants`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetDescendants) - [`GetDescendants`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetDescendants)
- [`GetFullName`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetFullName) - [`GetFullName`](https://create.roblox.com/docs/reference/engine/classes/Instance#GetFullName)
- [`GetTags`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#GetTags) - [`GetTags`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#GetTags)
- [`HasTag`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#HasTag) - [`HasTag`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#HasTag)
- [`IsA`](https://create.roblox.com/docs/reference/engine/classes/Instance#IsA) - [`IsA`](https://create.roblox.com/docs/reference/engine/classes/Instance#IsA)
- [`IsAncestorOf`](https://create.roblox.com/docs/reference/engine/classes/Instance#IsAncestorOf) - [`IsAncestorOf`](https://create.roblox.com/docs/reference/engine/classes/Instance#IsAncestorOf)
- [`IsDescendantOf`](https://create.roblox.com/docs/reference/engine/classes/Instance#IsDescendantOf) - [`IsDescendantOf`](https://create.roblox.com/docs/reference/engine/classes/Instance#IsDescendantOf)
- [`RemoveTag`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#RemoveTag) - [`RemoveTag`](https://create.roblox.com/docs/reference/engine/classes/CollectionService#RemoveTag)
- [`SetAttribute`](https://create.roblox.com/docs/reference/engine/classes/Instance#SetAttribute) - [`SetAttribute`](https://create.roblox.com/docs/reference/engine/classes/Instance#SetAttribute)
### `DataModel` ### `DataModel`
Currently implemented APIs: Currently implemented APIs:
- [`GetService`](https://create.roblox.com/docs/reference/engine/classes/ServiceProvider#GetService) - [`GetService`](https://create.roblox.com/docs/reference/engine/classes/ServiceProvider#GetService)
- [`FindService`](https://create.roblox.com/docs/reference/engine/classes/ServiceProvider#FindService) - [`FindService`](https://create.roblox.com/docs/reference/engine/classes/ServiceProvider#FindService)
## Datatypes ## Datatypes
Currently implemented datatypes: Currently implemented datatypes:
- [`Axes`](https://create.roblox.com/docs/reference/engine/datatypes/Axes) - [`Axes`](https://create.roblox.com/docs/reference/engine/datatypes/Axes)
- [`BrickColor`](https://create.roblox.com/docs/reference/engine/datatypes/BrickColor) - [`BrickColor`](https://create.roblox.com/docs/reference/engine/datatypes/BrickColor)
- [`CFrame`](https://create.roblox.com/docs/reference/engine/datatypes/CFrame) - [`CFrame`](https://create.roblox.com/docs/reference/engine/datatypes/CFrame)
- [`Color3`](https://create.roblox.com/docs/reference/engine/datatypes/Color3) - [`Color3`](https://create.roblox.com/docs/reference/engine/datatypes/Color3)
- [`ColorSequence`](https://create.roblox.com/docs/reference/engine/datatypes/ColorSequence) - [`ColorSequence`](https://create.roblox.com/docs/reference/engine/datatypes/ColorSequence)
- [`ColorSequenceKeypoint`](https://create.roblox.com/docs/reference/engine/datatypes/ColorSequenceKeypoint) - [`ColorSequenceKeypoint`](https://create.roblox.com/docs/reference/engine/datatypes/ColorSequenceKeypoint)
- [`Enum`](https://create.roblox.com/docs/reference/engine/datatypes/Enum) - [`Enum`](https://create.roblox.com/docs/reference/engine/datatypes/Enum)
- [`Faces`](https://create.roblox.com/docs/reference/engine/datatypes/Faces) - [`Faces`](https://create.roblox.com/docs/reference/engine/datatypes/Faces)
- [`Font`](https://create.roblox.com/docs/reference/engine/datatypes/Font) - [`Font`](https://create.roblox.com/docs/reference/engine/datatypes/Font)
- [`NumberRange`](https://create.roblox.com/docs/reference/engine/datatypes/NumberRange) - [`NumberRange`](https://create.roblox.com/docs/reference/engine/datatypes/NumberRange)
- [`NumberSequence`](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequence) - [`NumberSequence`](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequence)
- [`NumberSequenceKeypoint`](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequenceKeypoint) - [`NumberSequenceKeypoint`](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequenceKeypoint)
- [`PhysicalProperties`](https://create.roblox.com/docs/reference/engine/datatypes/PhysicalProperties) - [`PhysicalProperties`](https://create.roblox.com/docs/reference/engine/datatypes/PhysicalProperties)
- [`Ray`](https://create.roblox.com/docs/reference/engine/datatypes/Ray) - [`Ray`](https://create.roblox.com/docs/reference/engine/datatypes/Ray)
- [`Rect`](https://create.roblox.com/docs/reference/engine/datatypes/Rect) - [`Rect`](https://create.roblox.com/docs/reference/engine/datatypes/Rect)
- [`Region3`](https://create.roblox.com/docs/reference/engine/datatypes/Region3) - [`Region3`](https://create.roblox.com/docs/reference/engine/datatypes/Region3)
- [`Region3int16`](https://create.roblox.com/docs/reference/engine/datatypes/Region3int16) - [`Region3int16`](https://create.roblox.com/docs/reference/engine/datatypes/Region3int16)
- [`UDim`](https://create.roblox.com/docs/reference/engine/datatypes/UDim) - [`UDim`](https://create.roblox.com/docs/reference/engine/datatypes/UDim)
- [`UDim2`](https://create.roblox.com/docs/reference/engine/datatypes/UDim2) - [`UDim2`](https://create.roblox.com/docs/reference/engine/datatypes/UDim2)
- [`Vector2`](https://create.roblox.com/docs/reference/engine/datatypes/Vector2) - [`Vector2`](https://create.roblox.com/docs/reference/engine/datatypes/Vector2)
- [`Vector2int16`](https://create.roblox.com/docs/reference/engine/datatypes/Vector2int16) - [`Vector2int16`](https://create.roblox.com/docs/reference/engine/datatypes/Vector2int16)
- [`Vector3`](https://create.roblox.com/docs/reference/engine/datatypes/Vector3) - [`Vector3`](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)
- [`Vector3int16`](https://create.roblox.com/docs/reference/engine/datatypes/Vector3int16) - [`Vector3int16`](https://create.roblox.com/docs/reference/engine/datatypes/Vector3int16)
Note that these datatypes are kept as up-to-date as possible, but recently added members & methods may be missing. Note that these datatypes are kept as up-to-date as possible, but recently added members & methods may be missing.