-
Notifications
You must be signed in to change notification settings - Fork 11.9k
build: reproduce original package structure using bazel #22308
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
Conversation
@@ -40,3 +43,73 @@ def ts_library( | |||
# @external_end | |||
**kwargs | |||
) | |||
|
|||
def pkg_npm(name, use_prodmode_output = False, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this pkg_npm
override over from the angular repo.
tools/defaults.bzl
Outdated
substitutions = dict(common_substitutions, **{ | ||
# TODO: Current build script relies on 0.0.0 in package.json; uncomment after repalcing build script. | ||
#"0.0.0-PLACEHOLDER": "0.0.0", | ||
}) | ||
stamped_substitutions = dict(common_substitutions, **{ | ||
# TODO: Current build script relies on 0.0.0 in package.json; uncomment after repalcing build script. | ||
#"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}", | ||
"0.0.0": "{BUILD_SCM_VERSION}", | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented this out for now, but I thought it would be a good idea to use 0.0.0-PLACEHOLDER
rather than the current 0.0.0
versions in each package's package.json
file.` I can't change those package.json files yet as that would break the current build script that uses 0.0.0 for version substitution.
genrule( | ||
name = "license", | ||
srcs = ["//:LICENSE"], | ||
outs = ["LICENSE"], | ||
cmd = "cp $(execpath //:LICENSE) $@", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg_npm
requires that included files be in the same directory, so this just copies the LICENSE file from the root.
@@ -61,7 +56,7 @@ ts_library( | |||
exclude = [ | |||
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces | |||
"node_modules/**", | |||
"cli/lib/config/workspace-schema.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alan-agius4 This path was wrong so lib/config/workspace-schema.json
was not actually being excluded. this dates back to your March commit 4b0223b. Is it correct to exclude it from this ts_library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this file gets converted to schema.json
which is included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it should be excluded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@alan-agius4 everything look okay to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kormide LGTM thanks
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
@gregmagolan @josephperrott
This PR modifies the existing bazel rules to reproduce the packages that are currently being produced by the
build.ts
script. I also added version stamping which works for snapshot and release builds.There are still some differences between the
package.json
files that bazel produces compared tobuild.ts
, which I will work through in future pull requests. These differences include:Once bazel is producing identical pacakges, I will switch the
build.ts
script to call bazel instead of tsc. Until then, none of this should affect the currently used build process.