Skip to content

Conversation

@maribethb
Copy link
Contributor

@maribethb maribethb commented Jan 16, 2026

Important how-to

This PR changes the directory structure of the repository by moving most of the previous contents into a packages/blockly subdirectory. To continue developing on blockly, just cd packages/blockly then run all your commands from there like normal (e.g. npm start, npm run format, etc.)

The basics

(as best I could)

The details

Resolves

Fixes #7759
Fixes #7757

Addresses #7768

Proposed Changes

  • Sets up the infrastructure to make this repository a monorepo
  • Moves most top-level files under packages/blockly
  • Splits up the gitignore as made sense
  • Adds new root level scripts for built, test, lint that run those scripts in all workspaces (which right now is just blockly, obviously, but those are the scripts that will make sense to run at the root level eventually)
  • Updates the github workflows to cd into packages/blockly if needed (not needed if new top-level scripts have been added)
  • Deletes the tag_module_cleanup action since it's no longer needed.

Reason for Changes

Making blockly + blockly plugins into a monorepo has a lot of benefits that are already documented elsewhere.

The reason I'm doing this right now is that I'm trying to launch the new documentation site. The way the new docs were set up by cybage effectively had a standalone npm project nested inside the blockly project, which just isn't maintainable going forward. Having a monorepo is the correct way to have multiple projects in the same repository.

In another PR coming soon, I'll have the docs added under packages/docs and then we'll be able to manage both packages through the monorepo tooling provided by npm workspaces.

Test Coverage

  • Manually ran all the commands that only affected local files (i.e. not deploy, publish, etc.)
  • Ran the top-level commands which are referenced in the github workflows
  • Really hoping the github workflow changes will be tested in this PR once it's opened

Documentation

The contributing docs will need to be updated to explain how to use the monorepo. For now, you can just cd packages/blockly and just keep doing what you were doing. Nothing has changed except your working directory.

Additional Information

Review this PR commit-wise. One of the commit renames all of the files. The other two commits do the more interesting stuff.

Future work

Ideally linting and formatting would be done at the root level instead of their configs being inside the packages/blockly directories. However, since there are no other packages right now, that is not a pressing need and doing it this way keeps as much the same as possible. Those files should be moved back to the root level as part of #7760 and #7761

@maribethb maribethb requested a review from a team as a code owner January 16, 2026 22:42
@maribethb maribethb requested a review from gonfunko January 16, 2026 22:42
@github-actions github-actions bot added the PR: chore General chores (dependencies, typos, etc) label Jan 16, 2026
@maribethb
Copy link
Contributor Author

This is not the build error I would have expected.

[22:43:37] gulp-google-closure-compiler: Error: LinkageError occurred while loading main class com.google.javascript.jscomp.CommandLineRunner
  	java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
  Error writing to stdin of the compiler. write EPIPE
  [22:43:37] 'buildCompiled' errored after 730 ms

@maribethb
Copy link
Contributor Author

maribethb commented Jan 19, 2026

OK, I resolved the build issues by doing 2 things:

  • Removed the option for closure-compiler to fall back to java and javascript version. java doesn't work unless you set up the github action to run a specific version of java (which is likely to be slow, and unnecessary if the native versions work), and it will only work locally if you just happen to have the correct version of java installed. i would rather know sooner that the native versions aren't working. also i'm pretty sure the javascript version was a web based service that has been turned down
  • Updated google-closure-compiler to the latest version.... not sure why this only broke in the monorepo setup, but it seems like it is working now and i'm not aware of any reason we couldn't update, the advanced compilation test passes and everything so this seems fine.

so not really sure what happened but all seems well now

@gonfunko
Copy link
Contributor

This feels terrifying to approve, but...everything seems reasonable and if it works it works. Also sorry for eagerly merging all my PRs this morning and then realizing I've just made a mess of things :(

@maribethb maribethb merged commit 6bdfac5 into RaspberryPiFoundation:main Jan 20, 2026
7 checks passed
@github-actions github-actions bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: chore General chores (dependencies, typos, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure npm workspaces so that core (and later, plugins) are each in a workspace Move core directory into a subdirectory

2 participants