Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Libraries > Separated transpile and bundle actions #439

Merged
merged 5 commits into from
Jul 23, 2018

Conversation

Blackbaud-SteveBrush
Copy link
Member

Resolves: blackbaud/skyux2#1851

@Blackbaud-BobbyEarl I know we talked about avoiding child_spawn, but in this case I couldn't find a way around it. Library builds are failing because we're attempting to transpile and bundle in the same step, which causes some problems during AoT. To fix it, I'm transpiling after the bundle has been created so that they don't interfere with one another.

To transpile the files, I need to use Angular's ngc (for the metadata), but they don't provide an NPM utility that can be used programmatically, from what I gathered. Also, nearly every tutorial I found recommended that we run ngc through the command-line. Another critical thing to note: Angular 6 provides a first-class way to generate libraries, so the changes in this pull request should be temporary until we can upgrade Builder/UX to the latest Angular/TypeScript.

Example tutorial: https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464

'files': [
skyPagesConfigUtil.spaPathTemp('index.ts')
'exclude': [
skyPagesConfigUtil.spaPathTemp('runtime')
Copy link
Member Author

Choose a reason for hiding this comment

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

Do not transpile (or include) files from Builder's runtime directory.

@codecov-io
Copy link

codecov-io commented Jul 23, 2018

Codecov Report

Merging #439 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #439      +/-   ##
==========================================
+ Coverage   99.31%   99.32%   +<.01%     
==========================================
  Files          73       73              
  Lines        1909     1919      +10     
  Branches      300      303       +3     
==========================================
+ Hits         1896     1906      +10     
  Misses         13       13
Flag Coverage Δ
#builder 100% <100%> (ø) ⬆️
#runtime 95.6% <ø> (ø) ⬆️
#srcapp 100% <ø> (ø) ⬆️
Impacted Files Coverage Δ
cli/build-public-library.js 100% <100%> (ø) ⬆️
...fig/webpack/build-public-library.webpack.config.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab04dd5...c87a2ee. Read the comment docs.

@Blackbaud-SteveBrush
Copy link
Member Author

Related: #417

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit 8411843 into master Jul 23, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the fix-library-bundler branch July 23, 2018 18:31
Blackbaud-MikitaYankouski pushed a commit to Blackbaud-MikitaYankouski/skyux-builder that referenced this pull request May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Libraries that consume SKY UX fail to bundle
3 participants