diff --git a/Cargo.lock b/Cargo.lock index ad4c0a5a1be2..67b787c8d401 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1937,6 +1937,7 @@ dependencies = [ "enso-build", "enso-build-base", "enso-formatter", + "ensogl-pack", "futures", "futures-util", "glob", diff --git a/app/ide-desktop/lib/types/modules.d.ts b/app/ide-desktop/lib/types/modules.d.ts index 58762fe78f19..aaaefe4b9de1 100644 --- a/app/ide-desktop/lib/types/modules.d.ts +++ b/app/ide-desktop/lib/types/modules.d.ts @@ -2,6 +2,7 @@ * * This file MUST NOT `export {}` for the modules to be visible to other files. */ +// Required because this is a build artifact and so would not otherwise work on a clean repository. declare module '*/build.json' { interface BuildInfo { commit: string @@ -14,11 +15,6 @@ declare module '*/build.json' { export default BUILD_INFO } -declare module '*/ensogl-pack/linked-dist' { - // eslint-disable-next-line no-restricted-syntax - export * from '../../../../lib/rust/ensogl/pack/js/src/runner/index' -} - declare module '*/gui/config.yaml' { interface Config { windowAppScopeName: string diff --git a/build/cli/Cargo.toml b/build/cli/Cargo.toml index 8e0c4025ed34..27e4167e3062 100644 --- a/build/cli/Cargo.toml +++ b/build/cli/Cargo.toml @@ -13,6 +13,7 @@ derivative = { workspace = true } enso-build-base = { path = "../base" } enso-build = { path = "../build" } enso-formatter = { path = "../enso-formatter" } +ensogl-pack = { path = "../../lib/rust/ensogl/pack" } futures = { workspace = true } futures-util = "0.3.17" glob = "0.3.0" diff --git a/build/cli/src/lib.rs b/build/cli/src/lib.rs index c6fc4f497cc7..4e7e04b4bc07 100644 --- a/build/cli/src/lib.rs +++ b/build/cli/src/lib.rs @@ -836,6 +836,14 @@ pub async fn main_internal(config: Option) -> Result .run_ok() .await?; + // Copied from `build` in `lib/rust/ensogl/pack/src/lib.rs`. + let paths = ensogl_pack::Paths::new().await?; + ensogl_pack::compile_this_crate_ts_sources(&paths).await?; + ide_ci::fs::remove_symlink_dir_if_exists(&paths.target.ensogl_pack.linked_dist)?; + ide_ci::fs::symlink_auto( + &paths.target.ensogl_pack.dist, + &paths.target.ensogl_pack.linked_dist, + )?; prettier::check(&ctx.repo_root).await?; let js_modules_root = ctx.repo_root.join("app/ide-desktop"); Npm.cmd()?.current_dir(&js_modules_root).args(["install"]).run_ok().await?; diff --git a/lib/rust/ensogl/pack/src/lib.rs b/lib/rust/ensogl/pack/src/lib.rs index 5c11558b56af..d7fd1320e211 100644 --- a/lib/rust/ensogl/pack/src/lib.rs +++ b/lib/rust/ensogl/pack/src/lib.rs @@ -353,7 +353,7 @@ fn check_if_ts_needs_rebuild(paths: &Paths) -> Result { } /// Compile TypeScript sources of this crate in case they were not compiled yet. -async fn compile_this_crate_ts_sources(paths: &Paths) -> Result<()> { +pub async fn compile_this_crate_ts_sources(paths: &Paths) -> Result<()> { println!("compile_this_crate_ts_sources"); if check_if_ts_needs_rebuild(paths)? { info!("EnsoGL Pack TypeScript sources changed, recompiling.");