This is a fairly important test verifying whether the action of moving a
folder into a watched folder is correctly detected and processed. It was
disabled in
b43b45be8f.
The fact that it failed indicates a possible bug in change processing,
so in this PR, I'll re-enable the test, investigate why it fails, and
fix it.
Right now, serve tests will fail when Rojo is built with the FSEvent
backend. The cause is essentially due to the fact that `/var` (where
temporary directories for serve tests are located) on macOS is actually
a symlink to `/private/var`. Paths coming from FSEvent always have
symlinks expanded, but Rojo never expands symlinks. So, Rojo's paths
during these tests look like `/var/*` while the FSEvent paths look like
`/private/var/*`. When Rojo's change processor receives these events, it
considers them outside the project and does not apply any changes,
causing serve tests to time out.
To work around this, we can call `Path::canonicalize` before passing the
project path to `rojo serve` during serve tests. Rojo does need to
better support symlinks (which would also solve the problem), but I
think that can be left for another day because it's larger in scope and
I mostly just want working tests before addressing #609.
Resolves#667
This PR:
- Introduces a new field in the project file: `scriptType` which has the
default value of `Class` (in parity with previous versions), but can
also be `RunContext`.
- This is then passed to `InstanceContext` from the `Project` struct.
- This then changes the RunContext in the lua `snapshot_middleware`
---------
Co-authored-by: Micah <dekkonot@rocketmail.com>
* Add PathNode with optional fields to project. This allows a path to be defined either as `"$path": "src"` or `"$path": { "optional": "src" }`
* Make $path truly optional
* Prevent rojo from erroring if no project node is resolved
* Use match instead of if-statement
* Add end-to-end tests (credit to MobiusCraftFlip for initial scenario)
* Pass option with ref inside instead of reference to option
* Empty commit to restart GitHub Actions
* Simplify build test
* Minimize serve test: it fails
* Simplify serve test even more
* Ignore failing serve test
Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
* Ignore empty/whitespace-only model.json files
* Ignore no return value from model.json files during snapshot
* Use str::from_utf8 instead of String::from_utf8
* Revert "Ignore no return value from model.json files during snapshot"
This reverts commit 0aef16e30a.
* Add test for empty .model.json files
* Change empty .model.json check method
Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
* Format code with cargo fmt
* Use raw string instead
Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
* Mostly mechanical port bits
* Almost there
* It builds again!
* Turn on all the code again
* Tests compiling but not passing
* Stub work for value resolution
* Implement resolution minus enums and derived properties
* Implement property descriptor resolution
* Update referent snapshots
* Update unions test project
Using a place file instead of a model yields better
error messages in Roblox Studio.
* Add easy shortcut to testing with local rbx-dom
* Update rbx-dom
* Add enum resolution
* Update init.meta.json to use UnresolvedValue
* Expand value resolution support, add test
* Filter SharedString values from web API
* Add 'property' builder method to InstanceSnapshot
* Change InstanceSnapshot/InstanceBuilder boundary
* Fix remove_file crash
* rustfmt
* Update to latest rbx_dom_lua
* Update dependencies, including rbx_dom_weak
* Update to latest rbx-dom
* Update dependencies
* Update rbx-dom, fixing more bugs
* Remove experimental warning on binary place builds
* Remove unused imports
Starts work on #55.
This is similar to the previous work in #125. It's gated behind a new Cargo
feature, `user-plugins`. This time, the config gate is much smaller. The
`plugins` member of projects is still accessible when plugins aren't enabled,
but is always empty. Additionally, user plugins are only enabled if there's a
Lua state present in the snapshot context when the `SnapshotUserPlugins`
snapshot middleware runs. This not ever the case currently.
This code has very little possibility of rotting while we focus on other work,
since it'll be guaranteed to still compile and can be tested in isolation
without the feature being turned on.