Skip to content

chore: Convert newIDE to npm workspaces monorepo#8272

Open
malec-palec wants to merge 10 commits into4ian:masterfrom
malec-palec:chore/newide-monorepo
Open

chore: Convert newIDE to npm workspaces monorepo#8272
malec-palec wants to merge 10 commits into4ian:masterfrom
malec-palec:chore/newide-monorepo

Conversation

@malec-palec
Copy link
Contributor

Restructure newIDE into a pure npm workspaces monorepo with three packages:

  • @gdevelop/app
  • @gdevelop/electron-app
  • @gdevelop/web-app

Changes

  • Add root newIDE/package.json with workspaces config and shared scripts
  • Hoist common dependencies to the root to deduplicate node_modules
  • Upgrade axios to 1.13.5 in all packages
  • Move husky and lint-staged to the monorepo root and update pre-commit hook
  • Move postinstall to the root (use npm run import-resources -w app)
  • Add unified start script using concurrently + wait-on
    (Electron waits for http://localhost:3000)
  • Fix hoisted dependency paths in build and translation scripts
  • Enforce npm via "engines": { "yarn": "please-use-npm" }
  • Remove per-package lockfiles (single root package-lock.json)
  • Update README with npm-based commands

…t scripts, make single script to start electron app
…repo

# Conflicts:
#	newIDE/app/package-lock.json
#	newIDE/app/package.json
@malec-palec malec-palec marked this pull request as ready for review February 17, 2026 11:13
@malec-palec malec-palec requested a review from 4ian as a code owner February 17, 2026 11:13
Copy link
Owner

@4ian 4ian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments/questions.

In addition, could you also regenerate then commit the package-lock.json? As we will want to have them in.

We might need a bit of trial and error then to make sure the CIs are passing.

@@ -117,12 +111,11 @@
}
},
"scripts": {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to look at .semaphore/semaphore.yml as well as .circleci/config.yml and .travis.yml and adapt the npm install(s)?
I will need to push then your commit to a special branch name to trigger experimental builds so all the CIs are run, but having at least the updates according to what you think is needed in these files would help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated all CI configs to use cd newIDE && npm install instead of cd newIDE/app && npm install:

  • .semaphore/semaphore.yml - updated cache keys (v2 → v3), cache paths (newIDE/app/node_modulesnewIDE/node_modules), install commands, and removed redundant npm run postinstall calls (it runs automatically now).
  • .circleci/config.yml - updated all 3 build jobs (macOS, Linux, Windows): cache keys, paths, and install commands. Removed the per-package Remove-Item package-lock.json workaround in the Windows build.
  • .travis.yml - updated install step to cd newIDE && npm install.

if (!shell.test('-f', './node_modules/.bin/electron-builder')) {
shell.echo('⚠️ Please run npm install in electron-app folder');
const electronBuilderBin = path.join(
__dirname,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised about why we run electron-builder from '../..' (i.e: newIDE), despite "electron-builder" being in the package.json of newIDE/electron-app (as it should be - it's of no use for the web-app).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed electron-builder resolution in build.js and app-build.js - replaced hardcoded ../../node_modules/.bin/electron-builder path with npx electron-builder, which resolves correctly regardless of hoisting.

@malec-palec
Copy link
Contributor Author

In addition, could you also regenerate then commit the package-lock.json? As we will want to have them in.

Sure, I’ve committed the updated newIDE/package-lock.json - now running npm i inside the newIDE folder will not create any diff.
Other package-lock.json files are not needed, since all dependencies are consolidated in the monorepo root.

@4ian
Copy link
Owner

4ian commented Feb 18, 2026

Feel free to ignore this specific failure - I'm not sure why it happens on some PRs but it works on master:
image

I'm testing this locally now.

@4ian
Copy link
Owner

4ian commented Feb 18, 2026

I'm getting these issues @malec-palec when I do npm install then npm start in newIDE:
image

Same if I start from "newIDE/app" only:
image

(create-react-app is a bit of a pain, and we could probably migrate one day to Vite to have faster development builds, but that's for another day :))

I've removed node_modules in electron-app and app to be sure I started from a good state, but it seems not to help. Any idea, did I miss something?

@malec-palec
Copy link
Contributor Author

Well, I expected this to be painful 🙂
I've got exactly a case when "it works on my machine": Windows 11, node v24.13.1
with clean install:

git clean -dfx
cd newIDE
npm i && npm start

I'll find a way to check on macOS, meanwhile - did you do anything specific with the translations?

@4ian
Copy link
Owner

4ian commented Feb 18, 2026

Well, I expected this to be painful 🙂

It was going too smoothly to be true :)

I'll find a way to check on macOS, meanwhile - did you do anything specific with the translations?

Not launched anything related to them. I got the error also on other files like OptionalRequire and others, so I think it's fairly generic and not translation related.
I see it mentions react-refresh, i.e: the development only module that hot reload the React components, which is maybe why this is not appearing in CI.

I will launch experimental builds to get the CI to build a full version using this branch.

@4ian
Copy link
Owner

4ian commented Feb 18, 2026

Done, I just pushed the latest commit of this branch to branch experimental-build/chore/newide-monorepo, which triggers the CI doing a full desktop build:

https://app.circleci.com/pipelines/github/4ian/GDevelop/20211/workflows/f7d84ef0-3adf-4b09-8171-03173b4f293c?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary

@malec-palec
Copy link
Contributor Author

@4ian, please, recheck - all issues should be solved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments