google / blockly-samples

Plugins, codelabs, and examples related to the Blockly library.
http://github.com/google/blockly
Apache License 2.0
836 stars 618 forks source link

Lerna 6 issues #1566

Open maribethb opened 1 year ago

maribethb commented 1 year ago

We use a different version of lerna in examples than we do in the root directory, which is probably its own issue.

The version in examples was recently updated to v6 of lerna in #1542 . That version updated the mechanism of lerna run to use nx. It doesn't work for us though.

cd examples
npm ci
npx lerna run build
lerna notice cli v6.4.1
lerna info versioning independent
 >  Lerna (powered by Nx)   Successfully ran target build for 0 projects (6ms)

maribethb-macbookpro1:examples maribethb$ npx lerna run predeploy
lerna notice cli v6.4.1
lerna info versioning independent

 >  Lerna (powered by Nx)   Cannot find project 'blockly-react-sample' 

Both of these are wrong, some packages do have build targets (including blockly-react) and I have no idea why it can't find that particular package.

Things still work if you set useNx: false in lerna.json but opening this issue to document the reason why and possibly to investigate if we need to fix something to be able to use nx.

maribethb commented 1 year ago

Have verified this is issue in lerna https://github.com/lerna/lerna/issues/3548

maribethb commented 1 year ago

Note that in root, using nx does not experience the bug linked above. But we do get this error

> @blockly/field-date@6.0.6 build
> gulp build -- --skip-lint

[01:25:36] Using gulpfile ~/work/blockly-samples/blockly-samples/plugins/field-date/gulpfile.js
[01:25:36] Task never defined: --skip-lint
[01:25:36] To list available tasks, try running: gulp --tasks

this makes me question if field-date has been building correctly in CI since #674 or not.

edit, checked an older CI run and see:

lerna info run Ran npm script 'build' in '@blockly/field-date' in 10.2s:

> @blockly/field-date@6.0.6 build
> gulp build --skip-lint

[16:09:04] Using gulpfile ~/work/blockly-samples/blockly-samples/plugins/field-date/gulpfile.js
[16:09:04] Starting 'build'...
[16:09:13] Finished 'build' after 8.71 s

so it looks like we'd have an extra layer of -- if we enable nx. I will look at doing that separately, for now, #1567 just sets it to not use nx at root either so that we can unblock samples publishing tomorrow

JamesHenry commented 1 year ago

I spent a significant amount of time getting to know your repo and provided comprehensive recommendations here: https://github.com/google/blockly-samples/pull/1597

Best of luck!