Compare commits

..
Author SHA1 Message Date
shaneandshinyobjectz 313ac8ab83 A project's file that imports react finds the React raea ships (#278) (#290)
* A project's file that imports react finds the React raea ships, as raea's own files do (#278)

0.1.15 let raea's own files (sdk/app) find react in the release's one node_modules. A project's file still could not:
brief.ts, or a scene it registers, imports its hooks from "react", a project has no package.json, and the render's
own checks load brief.ts. So a render was applied, then failed with "brief.ts doesn't run: Cannot find package
'react'" and "fix every ERROR above, then render again", on every release through 0.1.16-rc1.

Any file with no node_modules of its own above it now gets the package raea ships (the bundler gives a scene the same
React); a project's own copy still wins, and a package raea doesn't ship is still not found. The release's check of
the built archive renders beside such a brief.ts on every platform.

* The archive's check of a brief.ts that imports react runs on every build, not only on real machines

* node.rs back under the size limit

---------

Co-authored-by: shinyobjectz <[email protected]>
2026-12-01 08:41:09 -08:00
shaneandshinyobjectz cdfb043026 clef's second opinion on a cut is a list of pointed picture and sound checks, the faults it found first (#289)
Asked "do the graphics look designed", clef graded Dutch's plain boxes "strong". Asked pointed yes/no checks of the
same cut it found three of them: three or more text boxes at once (0.93), captions, cards and badges all the same
plain box (0.57), the app shown only as a box of text (0.80). Shane, 12-01: "you just have to have them be more
specific or pointed like giving it some list of design checks to answer ... a few catch all checks on visual and
audio design"; "the agent itself is really responsible for design".

Co-authored-by: shinyobjectz <[email protected]>
2026-12-01 06:16:58 -08:00
3 changed files with 25 additions and 6 deletions

No files matched your search

+3 -3
View File
@@ -53,9 +53,9 @@ pub fn resolve_file(spec: &str, dir: &Path, esm: bool) -> Result<PathBuf, String
return Ok(f);
}
}
// raea's own file (sdk/app, under `raea goal check`) importing a package raea ships: a release has those in the React runtime's node_modules alone (#278)
let (home, own) = (raea_io_home::home(), raea_io_home::home().join("sdk/react/js/node_modules").join(&name));
if dir.starts_with(&home) && own.is_dir() {
// a package raea ships, imported by a file with no node_modules of its own: raea's (sdk/app), or a project's brief.ts or scene (#278)
let own = raea_io_home::home().join("sdk/react/js/node_modules").join(&name);
if own.is_dir() {
return package_entry(&own, &sub, esm).ok_or_else(|| format!("Cannot find module '{spec}': {} has no {sub}", own.display()));
}
Err(format!("Cannot find package '{name}' imported from {}", dir.display()))
+14 -3
View File
@@ -1,4 +1,4 @@
//! A file of raea's own importing a package raea ships finds it in the React runtime's node_modules (#278): a release has
//! A file importing a package raea ships (raea's own, or a project's with no node_modules) finds it in the React runtime's node_modules (#278): a release has
//! no node_modules above sdk/app, so `raea goal check` ended every render "Cannot find package 'react'". Its own test
//! binary: raea's home is read once a process.
#![cfg(feature = "modules")]
@@ -16,7 +16,18 @@ fn raeas_own_file_finds_the_react_raea_ships() {
// SAFETY: the one test here, before anything reads the environment
unsafe { std::env::set_var("RAEA_HOME", &home) };
assert_eq!(raea_native::node::resolve_file("react", &own, true).unwrap(), pkg.join("index.js"));
// a project's own file never reaches into raea's packages
assert!(raea_native::node::resolve_file("react", &theirs, true).unwrap_err().contains("Cannot find package 'react'"));
// a project's file with no node_modules of its own gets the same React (brief.ts, a scene it registers): a release's
// render was applied and then failed its checks on "Cannot find package 'react'"
fs::create_dir_all(&theirs).unwrap();
assert_eq!(raea_native::node::resolve_file("react", &theirs, true).unwrap(), pkg.join("index.js"));
// its own copy, when it has one, wins
let mine = theirs.join("node_modules/react");
fs::create_dir_all(&mine).unwrap();
fs::write(mine.join("package.json"), r#"{"name":"react","main":"index.js"}"#).unwrap();
fs::write(mine.join("index.js"), "module.exports = {}").unwrap();
assert_eq!(raea_native::node::resolve_file("react", &theirs, true).unwrap(), mine.join("index.js"));
// and a package raea doesn't ship is still not found
assert!(raea_native::node::resolve_file("left-pad", &own, true).unwrap_err().contains("Cannot find package 'left-pad'"));
fs::remove_dir_all(&theirs).ok();
fs::remove_dir_all(&home).ok();
}
+8
View File
@@ -195,6 +195,14 @@ if [ -f "$check/raea/bin/raea.exe" ]; then
done
"$check/raea/bin/uv.exe" --version 2>&1 | grep -q '^uv ' || fail "bin/uv.exe doesn't run"
fi
# a project whose brief.ts imports React, as its scenes do, and has no node_modules: a render's own checks load brief.ts,
# and a render that was applied ended "Cannot find package 'react'" and "render again" (#278). The checks' verdict on
# an empty project isn't the point here: that brief.ts ran is
mkdir -p "$check/brief" && cp "$check/p/hello.tsx" "$check/brief/hello.tsx"
printf '%s\n' 'import { useMemo } from "react"' 'import { goal } from "raea/goal"' 'export const hook = useMemo' 'export default goal({ title: "Check", make: "one short video" })' > "$check/brief/brief.ts"
(cd "$check/brief" && RAEA_NO_TREE=1 "$raea" goal check > check.log 2>&1) || true
[ -s "$check/brief/check.log" ] || fail "raea goal check said nothing beside a brief.ts that imports react"
! grep -q "Cannot find package\|doesn't run" "$check/brief/check.log" || { tail -20 "$check/brief/check.log" >&2; fail "a brief.ts that imports react doesn't run: a package raea ships wasn't found"; }
# RAEA_CHECK_HARD=1 (tools/release-machines.sh, on real machines: a PC's own GPU, the Linux box): what reports from
# other systems needed and a runner's one pass doesn't show.
if [ "${RAEA_CHECK_HARD:-}" = 1 ]; then