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

build: Add BUILD files for Schematics #954

Closed
wants to merge 1 commit into from

Conversation

MikeRyanDev
Copy link
Member

This does not get the tests running with Bazel. I believe we need bazelbuild/rules_nodejs#84 to be fixed first. cc @alexeagle

@alexeagle
Copy link
Contributor

That issue is just about the load paths being inconsistent at runtime - it shouldn't be blocking you?

BUILD.bazel Outdated
@@ -7,16 +7,17 @@ exports_files([
])

filegroup(
Copy link
Contributor

Choose a reason for hiding this comment

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

note, you might want to convert this to a node_modules_filegroup see https://github.com/bazelbuild/rules_nodejs/blob/master/defs.bzl#L41

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed. Thanks for the tip. 👍

)

npm_package(
name = "npm_package",
Copy link
Contributor

Choose a reason for hiding this comment

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

is this published to npm separately from other modules?
just FYI if you need it - there is a packages attribute on ng_package and npm_package that allows you to nest them if needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it is published separately.

@MikeRyanDev
Copy link
Member Author

@alexeagle Each schematic needs to be able to load its own schema.json and any template files at run time. I can get the package artifact to put these JSON and template files in the correct locations: https://github.com/MikeRyanDev/schematics-bazel-builds/tree/master/src/action

What I can't seem to get working is getting these runtime config files to be in the same place at test time. It seemed like that issue was related but I may have been misconfiguring the jasmine_node_test rule.

@MikeRyanDev MikeRyanDev force-pushed the build/add-build-files-for-schematics branch from 168027a to 75a3c39 Compare April 3, 2018 11:56
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 91.241% when pulling 75a3c39 on build/add-build-files-for-schematics into 4d74bd2 on master.

@MikeRyanDev
Copy link
Member Author

Looks like this is also captured in bazelbuild/rules_typescript#154

@brandonroberts Since the tests are being run with the old runner I don't think this blocks the PR.

@brandonroberts
Copy link
Member

@MikeRyanDev ok, will you run buildifier so linting passes?

@alexeagle
Copy link
Contributor

@MikeRyanDev I found an easy workaround with @robwormald - tell Bazel to copy the json file into bazel-bin folder so it appears in the place the require tries to load from.

genrule(
  name = "copy_json",
  srcs = ["my_input_copy.json"],
  outs = ["my_input.json"],
  cmd = "cp $< $@",
  output_to_bindir = True,
)

Note that Bazel frowns on having inputs at the same filesystem path as outputs, so the .json file has a different name in the source tree than it has in the bazel-bin dir.

@MikeRyanDev MikeRyanDev closed this May 7, 2018
@MikeRyanDev MikeRyanDev deleted the build/add-build-files-for-schematics branch May 7, 2018 21:15
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.

None yet

4 participants