Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Feature: Bazel Support #259

Merged
merged 3 commits into from
May 14, 2019
Merged

Feature: Bazel Support #259

merged 3 commits into from
May 14, 2019

Conversation

sgammon
Copy link
Contributor

@sgammon sgammon commented May 14, 2019

This changeset introduces support to the JS SDK build tools for Bazel-powered development. Each module has been hooked up to the rules_closure toolchain and made available for external builds to access (in addition to an optimized sdk.js and sdk-debug.js pair of output targets).

Changes so far:

  • Add BUILD config files for each module
  • Add central BUILD file with meta-targets
  • Working debug and release targets
  • Support for services

This changeset introduces support to the JS SDK build tools for
Bazel-powered development. Each module has been hooked up to the
`rules_closure` toolchain and made available for external builds
to access (in addition to an optimized `sdk.js` and `sdk-debug.js`
pair of output targets).

Changes so far:
- [x] Add `BUILD` config files for each module
- [x] Add central `BUILD` file with meta-targets
- [x] Working debug and release targets
- [x] Support for services
closure_js_library(
name = "sources",
exports = [
"//src/base:base",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sources target binds to all sources

name = "full",
exports = [
":sources",
"//entrypoint:sdk-full"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

full target additionally includes the entrypoint full.js


## Target: Debug
closure_js_binary(
name = "sdk-debug",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sdk-debug is a debug/logging-enabled compiled JS target


## Target: Optimized
closure_js_binary(
name = "sdk",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sdk is a production/optimized compiled JS target

convention = "GOOGLE",
deps = [],
exports = [],
suppress = []):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all build rules move through here, which is nice, because we can apply stuff tree-wide

@@ -217,6 +222,8 @@ goog.scope(function() {
* are items with the "FEATURED" flag present in their product flags, as
* indicated by staff or external systems via the Bloombox Dashboard.
*
* @export
* @override
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lots of adds of @override because it caught me not using them

goog.require('grpc.web.StatusCode');
goog.require('jspb.Message');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removal of unused dependencies.

@@ -144,6 +132,7 @@ bloombox.rpc.ScopedOptions = (class ScopedOptions {
* Partnership scope to use as an override for this RPC, if applicable.
* Defaults to null if left unset.
*
* @const
* @protected
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it noticed that lots of properties can be labeled @const, which i did not know.

"//src/shop/v1:shop-v1"])

closure_js_library(
name = "shop-api",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

otherwise it was a lot of b.s. files like this

@sgammon sgammon marked this pull request as ready for review May 14, 2019 01:23
@codecov
Copy link

codecov bot commented May 14, 2019

Codecov Report

Merging #259 into release/v2.1 will decrease coverage by 0.61%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff                @@
##           release/v2.1     #259      +/-   ##
================================================
- Coverage         86.87%   86.25%   -0.62%     
================================================
  Files                35       33       -2     
  Lines              1409     1339      -70     
  Branches            220      219       -1     
================================================
- Hits               1224     1155      -69     
+ Misses              185      184       -1
Impacted Files Coverage Δ
src/menu/v1beta1/observable.js 17.77% <ø> (-1.79%) ⬇️
src/shop/init.js 100% <ø> (ø) ⬆️
src/util/error-reporting.js 90% <ø> (-0.2%) ⬇️
src/util/exportable.js 100% <ø> (ø)
src/telemetry/v1beta4/events-v1beta4.js 94.91% <ø> (-0.17%) ⬇️
src/telemetry/context/collection.js 100% <ø> (ø) ⬆️
src/telemetry/base.js 100% <ø> (ø) ⬆️
src/shop/v1/shop-v1.js 96.2% <ø> (ø) ⬆️
src/menu/v1beta1/local-v1.js 66.66% <ø> (ø) ⬆️
src/menu/v1beta1/storage.js 98.41% <ø> (ø) ⬆️
... and 13 more

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 a65177d...002bd05. Read the comment docs.

@sgammon sgammon requested review from a team May 14, 2019 02:20
@sgammon sgammon merged commit e828f32 into release/v2.1 May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant