Skip to content

Feature #138 (Phase 0): Add path safety and metadata stripping helpers - #152

Open
Prem759-0 wants to merge 6 commits into
secondlife:developfrom
Prem759-0:feature/issue-138-pull-object
Open

Prem759-0 wants to merge 6 commits into
secondlife:developfrom
Prem759-0:feature/issue-138-pull-object

Conversation

@Prem759-0

Copy link
Copy Markdown
Contributor

Resolves Phase 0 of #138

This PR introduces the shared helpers required to implement pulling in-world objects into the local workspace (Phase 0).

Changes:

  • Added a new path-safety module (src/shared/pathsafety.ts) with pure functions sanitiseSegment(name) and uniqueInDirectory(name, taken) to safely resolve paths across OS platforms without reserved characters, control characters, or namespace collisions.
  • Created SynchService.stripEmittedMeta(content, language) which automatically trims the ScriptSync metadata block using language-specific comment prefixes (findMasterFileByMetaComment behavior).
  • Exhaustive unit test coverage for pathsafety.ts testing collisions, truncations, and reserved filenames.
  • Unit test coverage for stripEmittedMeta confirming metadata trimming in .lsl and .luau variants.

@Rider-Linden

Copy link
Copy Markdown
Collaborator

A heads up, I had some code that I was working on for this feature, but I'm going to let you take this ball and run with it.
Couple of things to watch. I just merged a PR that refactors the way file links work (#154) This fix should save you quite a bit of grief when the plugin links to the pulled files.

Also, can you please combine all the PRs in this feature into a single one. (so #153 will get tacked on the end here.)

@Prem759-0
Prem759-0 force-pushed the feature/issue-138-pull-object branch from 0cac7e8 to 2a1248b Compare September 21, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants