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

Allow libraries to define their own locale files #379

Merged
merged 35 commits into from
Apr 16, 2018

Conversation

Blackbaud-SteveBrush
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush commented Mar 26, 2018

Addresses: blackbaud/skyux2#1546

NOTE: I had to fix some unit tests that were reaching a bit too far into other files.

@@ -22,132 +22,137 @@ function readConfig(file) {
return fs.readJsonSync(file, 'utf8');
}

module.exports = {
/**
Copy link
Member Author

Choose a reason for hiding this comment

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

There are zero functional changes to this file; I simply adjusted the format so we can use a few of its methods (namely spaPath) via destructuring. (See my changes to common.webpack.config.js for an example.)

Choose a reason for hiding this comment

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

Just want to say I appreciate you calling this out. It definitely helps when reviewing.

@codecov-io
Copy link

codecov-io commented Mar 27, 2018

Codecov Report

Merging #379 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
+ Coverage   99.26%   99.29%   +0.03%     
==========================================
  Files          72       73       +1     
  Lines        1766     1853      +87     
  Branches      287      292       +5     
==========================================
+ Hits         1753     1840      +87     
  Misses         13       13
Flag Coverage Δ
#builder 100% <100%> (ø) ⬆️
#runtime 95.01% <ø> (ø) ⬆️
#srcapp 100% <ø> (ø) ⬆️
Impacted Files Coverage Δ
lib/assets-processor.js 100% <100%> (ø) ⬆️
lib/sky-pages-assets-generator.js 100% <100%> (ø) ⬆️
cli/serve.js 100% <100%> (ø) ⬆️
cli/build.js 100% <100%> (ø) ⬆️
lib/locale-assets-processor.js 100% <100%> (ø)
cli/utils/prepare-library-package.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 3a2d952...c8a9c31. Read the comment docs.

@@ -1,24 +1,73 @@
/*jshint jasmine: true, node: true */
'use strict';

const codegen = require('../utils/codegen-utils');
const mock = require('mock-require');
Copy link
Member Author

Choose a reason for hiding this comment

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

This spec file was affecting the state of other unit tests, so I mocked out its dependencies and made sure those dependencies' unit tests were covered 100%.

@Blackbaud-SteveBrush Blackbaud-SteveBrush changed the title Allow libraries to define their own locale files [HOLD] Allow libraries to define their own locale files Mar 28, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush changed the title [HOLD] Allow libraries to define their own locale files Allow libraries to define their own locale files Mar 28, 2018
@Blackbaud-SteveBrush
Copy link
Member Author

@Blackbaud-BobbyEarl This is ready for another look.

@Blackbaud-BobbyEarl
Copy link

Great job on this @Blackbaud-SteveBrush!

Aside from the destructing we talked about offline the only other thing that stood out to me is the use of the try/catch. That masks whether there was an error because the file doesn't exist, or because of another error. I'd prefer to instead use the existsSync and let any other fatal error bubble up.

@Blackbaud-SteveBrush
Copy link
Member Author

@Blackbaud-BobbyEarl I've since removed the destructured method imports, and removed the try/catch blocks for the fs operations. Let me know if I missed anything!

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit 4d975d1 into master Apr 16, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the library-i18n-resources branch April 16, 2018 15:08
@Blackbaud-SteveBrush Blackbaud-SteveBrush restored the library-i18n-resources branch April 16, 2018 15:08
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.

3 participants