Skip to content

Commit

Permalink
node yarn fixes
Browse files Browse the repository at this point in the history
Signed-off-by: AlexMikhalev <[email protected]>
  • Loading branch information
AlexMikhalev committed May 30, 2024
1 parent 918d0cf commit 3bc5f72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 4 additions & 3 deletions desktop/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ VERSION --cache-persist-option --global-cache 0.7
PROJECT applied-knowledge-systems/terraphim-project
FROM ghcr.io/terraphim/terraphim_builder_native:latest

WORKDIR frontend
WORKDIR /code/desktop

deps:
# COPY package.json tsconfig.json yarn.lock vite.config.ts tsconfig.node.json index.html ./
COPY --keep-ts . .
# COPY --dir src src
# COPY --dir public public
RUN oro apply -q || true
RUN pkgx +yarnpkg.com yarn
RUN /code/desktop/scripts/yarn_and_build.sh

build:
FROM +deps
RUN pkgx +yarnpkg.com yarn run build
# RUN pkgx +yarnpkg.com yarn run build

SAVE ARTIFACT dist /dist AS LOCAL dist
7 changes: 7 additions & 0 deletions scripts/yarn_and_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!/usr/bin/env bash
# this is to install and build front end inside bionic
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
bash -c "source $HOME/.nvm/nvm.sh && nvm install 16.15.1"
bash -c "source $HOME/.nvm/nvm.sh && npm install -g yarn"
bash -c "source $HOME/.nvm/nvm.sh && cd /code/desktop && yarn && yarn build"
cp -Rv /code/desktop/dist /code/terraphim_server/
2 changes: 1 addition & 1 deletion terraphim_server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn should_build(dirs: &Dirs) -> bool {

/// Runs JS package manager to install packages and build the JS bundle
fn build_js(dirs: &Dirs) {
let pkg_manager = "yarn";
let pkg_manager = "./scripts/yarn_and_build.sh";

p!("install js packages...");

Expand Down

0 comments on commit 3bc5f72

Please sign in to comment.