Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure linked-dist is built for lint CI #6592

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions app/ide-desktop/lib/types/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions build/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions build/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,14 @@ pub async fn main_internal(config: Option<enso_build::config::Config>) -> 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?;
Expand Down
2 changes: 1 addition & 1 deletion lib/rust/ensogl/pack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ fn check_if_ts_needs_rebuild(paths: &Paths) -> Result<bool> {
}

/// 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.");
Expand Down