mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Update vscode-rojo submodule reference and complete migration plan for path encoding
- Updated the vscode-rojo submodule to the latest commit. - Marked all phases of the path encoding migration plan as completed, transitioning to a slugify and deduplication approach. - Updated documentation to reflect changes in filename handling and metadata management.
This commit is contained in:
parent
0955e38b45
commit
126c8e66a4
77 changed files with 3512 additions and 799 deletions
|
|
@ -210,10 +210,12 @@ snapshot.with_new_path(path, new_ref, old_ref)
|
|||
```
|
||||
|
||||
**Filename generation** (`file_names.rs`):
|
||||
- Uses instance name
|
||||
- Slugifies instance name (`slugify_name()`: forbidden chars → `_`)
|
||||
- Deduplicates against taken names (`deduplicate_name()`: appends `~1`, `~2`, etc.)
|
||||
- Adds appropriate extension based on middleware
|
||||
- Encodes Windows-invalid chars if enabled
|
||||
- Stores real name in `.meta.json5` `name` field when slug differs
|
||||
- Example: `Script` named "My Script" → `My Script.server.luau`
|
||||
- Example: `Script` named "Hey/Bro" → `Hey_Bro.server.luau` + meta with `name: "Hey/Bro"`
|
||||
|
||||
### Property Filtering
|
||||
|
||||
|
|
@ -378,7 +380,7 @@ Filesystem:
|
|||
- Solution: Use clean mode
|
||||
|
||||
2. **Invalid filename** - Instance name contains invalid chars
|
||||
- Solution: Enable `decodeWindowsInvalidChars` or rename in Studio
|
||||
- Solution: Handled automatically by `slugify_name()` + metadata `name` field
|
||||
|
||||
3. **Ref to pruned instance** - Property points to instance not in project
|
||||
- Logged as warning, property not synced
|
||||
|
|
|
|||
|
|
@ -185,10 +185,11 @@ fn do_something() -> Result<()> {
|
|||
pub struct InstanceContext {
|
||||
pub path_ignore_rules: Arc<Vec<PathIgnoreRule>>,
|
||||
pub sync_rules: Vec<SyncRule>,
|
||||
pub decode_windows_invalid_chars: bool,
|
||||
}
|
||||
```
|
||||
|
||||
**Filename handling:** Instance names with forbidden filesystem chars are slugified (forbidden chars → `_`), deduplicated (`~1`, `~2`, etc. on collision), and the real name is stored in `.meta.json5`/`.model.json5` `name` fields. See `src/syncback/file_names.rs`.
|
||||
|
||||
**VFS passed separately to snapshot functions:**
|
||||
```rust
|
||||
snapshot_from_vfs(&context, &vfs, &path)?
|
||||
|
|
|
|||
|
|
@ -68,10 +68,16 @@ Transforms files → `InstanceSnapshot`. Main entry: `snapshot_from_vfs()`
|
|||
pub struct InstanceContext {
|
||||
pub path_ignore_rules: Arc<Vec<PathIgnoreRule>>,
|
||||
pub sync_rules: Vec<SyncRule>,
|
||||
pub decode_windows_invalid_chars: bool, // Default: true
|
||||
}
|
||||
```
|
||||
|
||||
**Filename handling (syncback/two-way sync):**
|
||||
|
||||
Instance names with forbidden filesystem chars (`<>:"/\|?*`) are handled by:
|
||||
1. `slugify_name()` -- replaces forbidden chars with `_` (pure, stateless)
|
||||
2. `deduplicate_name()` -- appends `~1`, `~2`, etc. on collision (stateful)
|
||||
3. Metadata `name` field -- stores the real instance name in `.meta.json5`/`.model.json5` when the slug differs
|
||||
|
||||
### 3. Commands (`src/cli/`)
|
||||
|
||||
- `serve.rs` - Live sync with WebSocket
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue