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

fix(): products ng build/serve --prod build issue #1104

Merged
merged 2 commits into from
Jan 26, 2018
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 25, 2018

Description

The most recent version of covalent at the time of this writing v1.0.0-rc.3 converted Covalent distribution to Angular package format. Products that used this new dist was failing when running --prod flag on ng serve and ng build commands.

What's included?

  • Fixed --prod flag usage on products consuming Covalent (issue was invalid covalent-core.metadata.json generating from ngc usage inside ngpackagr which is used for aot when using the --prod flag).

Test Steps (Covalent build)

  • Verify you are using node v8.9.x
  • npm run reinstall
  • To make the next steps a little easier go to scripts/build-release and add this code to the bottom of the file to npm pack instead of doing it manually:
cd deploy/platform/core
npm pack
cd ../dynamic-forms
npm pack
cd ../highlight
npm pack
cd ../http
npm pack
cd ../markdown
npm pack
  • run npm run build:release

Test Steps (Product build)

  • Clone Ecosystem Services UI repo into the directory above this one.
  • yarn install
  • yarn remove @covalent/core
  • yarn add <file-path-to-*.tgz> (EX: yarn add ../covalent/deploy/platform/core/covalent-core-1.0.0-rc.3.tgz)
  • npm rebuild node-sass
  • yarn upgrade @angular/material
  • Verify you are using node v8.9.x.
  • Verify ./node_modules/@angular/cli/bin/ng build --aot --prod --sourcemap=false --build-optimizer successfully runs
  • Verify ./node_modules/@angular/cli/bin/ng serve --aot --prod --sourcemap=false --build-optimizer --proxy-config proxy.conf.json successfully runs and you can access the local site http://localhost:4200/
  • Modify the import paths (primary/secondary entry point usage) in app.module and trying the prod build again it should run successfully.
  • Try these similar instruction on the AppCenter repo and verify the --prod flag works in that product too

General Tests for Every PR

  • npm run serve:prod still works.
  • npm run tslint passes.
  • npm run stylelint passes.
  • npm test passes and code coverage is not lower.
  • npm run build:release still works.

closes #1099

@jotatoledo
Copy link
Contributor

jotatoledo commented Jan 25, 2018

Considering that this was kind of a critical failure of the build process, to avoid situations like this you guys could consider to build the docs site from the rolled out platform. Basically some stepping like:

  • Build platform
  • Point demo app (if there is one) and docs site @covalent/* dependencies to the platform dist. folder
  • Build the previously mentioned apps
  • Check if everything is fine

@emoralesb05 emoralesb05 merged commit fe3153d into develop Jan 26, 2018
@emoralesb05 emoralesb05 deleted the fix-prod-build branch January 26, 2018 00:53
@emoralesb05 emoralesb05 added this to the Next Release milestone Jan 26, 2018
kriswinbush pushed a commit to kriswinbush/covalent that referenced this pull request Feb 20, 2020
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.

ng build --prod error with rc3
3 participants