Skip to content

Separate out docs, fidelity tests and shared assets#962

Merged
cdata merged 11 commits intomasterfrom
split-docs-fidelity-assets
Jan 17, 2020
Merged

Separate out docs, fidelity tests and shared assets#962
cdata merged 11 commits intomasterfrom
split-docs-fidelity-assets

Conversation

@cdata
Copy link
Contributor

@cdata cdata commented Jan 15, 2020

This change splits out the source tree into four distinct packages:

  • The <model-viewer> web component
  • Our documentation site modelviewer.dev
  • Render fidelity tests / tools
  • Bulk shared assets like models and environment images

As part of this change, we are moving to lerna.js in order to manage our repo as a collection of distinct packages. The new top-level README contains instructions for getting set up with this new arrangement:

git clone git@github.com:GoogleWebComponents/model-viewer.git
cd model-viewer
npm install
npm run bootstrap

These npm commands wrap lerna calls, so hopefully direct interaction with lerna will not be needed for typical dev work.

lerna gives us the ability to fan-out calls to npm run * commands, so from the root of the project you can invoke commands like npm run build and npm run test to run the corresponding commands in all sub-packages that implement them.

Most of the npm run * commands still work as they used to when run from the packages/model-viewer folder. In addition, there is a new npm run serve command that you can use from the root of the project to get a project-wide server.

Important note about npm install

TL;DR prefer npm run bootstrap at the project root over npm install in individual sub-projects.

In order to "cross-link" packages with each other during local dev, lerna creates symlink within the node_modules folder of each package wherever there happens to be a dependency on another local package. This means that when you make a change in one package, you don't need to do anything to keep other packages up to date. However, it also means that if you run npm install (and a few other npm commands) directly inside of a given sub-package (as opposed to the root of the project), npm will delete the symlinks and try to replace them with real packages downloaded from the NPM registry. This is typically just annoying, but in the case of at least one of our packages it will outright fail because it is a "private" package and never published to the NPM registry.

The solution to this problem is to always prefer npm run bootstrap at the root of the project repository in order to install dependencies from NPM, and let lerna do its thing.

Notable differences

In no particular order:

  • npm run check-fidelity is now npm run test for the rendering-fidelity-tools project
  • The main README.md has been cleaned up and moved to the model-viewer project; all other READMEs include links to that one
  • Published fidelity test results will be at https://modelviewer.dev/fidelity/results-viewer.html
  • All build steps are expected to run under the latest stable Node.js release (contemporaneously v12.x.x)

@cdata cdata force-pushed the split-docs-fidelity-assets branch from 520a075 to e85a99d Compare January 16, 2020 17:55
@cdata cdata changed the title Split docs fidelity assets Separate out docs, fidelity tests and shared assets Jan 16, 2020
@cdata
Copy link
Contributor Author

cdata commented Jan 16, 2020

I think the reason for the megadiff is that we went from 1 to 4 package-lock.json files...

@cdata cdata requested a review from elalish January 16, 2020 22:20
@cdata cdata marked this pull request as ready for review January 16, 2020 22:21
@cdata cdata force-pushed the split-docs-fidelity-assets branch from c34ab6d to 0d318fd Compare January 17, 2020 16:20
@cdata
Copy link
Contributor Author

cdata commented Jan 17, 2020

Rebased on master

Copy link
Contributor

@elalish elalish left a comment

Choose a reason for hiding this comment

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

Awesome!

@cdata cdata merged commit 75eda52 into master Jan 17, 2020
@cdata cdata deleted the split-docs-fidelity-assets branch January 17, 2020 19:42
elalish pushed a commit to elalish/model-viewer that referenced this pull request Feb 4, 2020
 
Separate out docs, fidelity tests and shared assets (google#962)

* Move docs to its own package

* WIP Move docs and fidelity tests to sub-packages

* Update READMEs and cherry-pick travis fix

* Fix puppeteer version, simplify travis.yaml, fix renderer viewers

* Clean up fidelity testing code

* Deploy fidelity results w/ docs

* Global clean command

* Add basic web server

* Document support node versions

* Fix spot1Lux.hdr file location

* Fix blank screenshot renders
@cdata cdata added this to the v0.9.0 milestone Feb 11, 2020
@cdata cdata self-assigned this Feb 11, 2020
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.

2 participants