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

Material Design Icons: Move svgstore-cli devDep to root-level package.json #32383

Merged
merged 1 commit into from Apr 18, 2019

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Apr 18, 2019

There's currently an issue when trying to run npx lerna run build (which builds apps in the apps/ directory):

> @automattic/material-design-icons@1.0.0 build ~/src/wp-calypso/packages/material-design-icons
> svgstore -o svg-sprite/material-icons.svg -p 'icon-' src/**/*.svg


lerna ERR! npm run build stderr:
sh: 1: svgstore: not found

We've been bitten by this issue in the past. The only fix we could find was to move monorepo packages' devDependencies to the top-level package.json.

Changes proposed in this Pull Request

Material Design Icons: Move svgstore-cli devDep to root-level package.json

Testing instructions

Try

npm run distclean && npm ci
npx lerna run build

both on master and on this branch. It will fail there but will work here.

Follow-up

I plan to add a CircleCI test task to guard against this.

@ockham ockham added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Build Packages labels Apr 18, 2019
@ockham ockham requested review from griffbrad and a team April 18, 2019 08:59
@matticbot
Copy link
Contributor

package.json Outdated Show resolved Hide resolved
@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Webpack Runtime
webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded.

name      parsed_size    gzip_size
manifest         +0 B         -1 B  (-0.0%)

Sections
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

name              parsed_size    gzip_size
gutenberg-editor         +0 B         +0 B

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@ockham ockham merged commit 43aaa4d into master Apr 18, 2019
@ockham ockham deleted the fix/lerna-apps-build branch April 18, 2019 09:36
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 18, 2019
@blowery
Copy link
Contributor

blowery commented Apr 18, 2019

cc @griffbrad as we both missed this

@griffbrad
Copy link
Contributor

Thanks @ockham and @simison!

@simison
Copy link
Member

simison commented Apr 18, 2019

#32390 "Add an eslint rule to forbid adding devDependencies in packages" — Any takers? 😁

ockham added a commit that referenced this pull request Apr 19, 2019
This should allow us to guard against issues such as wrong monorepo `devDependencies` (see e.g. #32383).

We're already building the other subdir in `apps/`, `wpcom-block-editor`. Their built files should go to different artifacts directories, which is why I'm adding a new task, rather than just unifying them into one task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants