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

promote the js_library rule to the public API #149

Closed
javatlacati opened this issue Mar 10, 2018 · 29 comments · Fixed by #2187
Closed

promote the js_library rule to the public API #149

javatlacati opened this issue Mar 10, 2018 · 29 comments · Fixed by #2187

Comments

@javatlacati
Copy link

I looked through the definitions file and couldn't find any nodejs_library definition, does that means that I can only have exactly one global BUILD and have a monolithic building process?

@alexeagle
Copy link
Collaborator

what would you expect such a nodejs_library rule to do?

If you want to compile libraries in isolation, use a compile-to-JS rule like ts_library
If you want to publish a package to npm, use npm_package

@an-kumar
Copy link

I think the point would be to have multiple nodejs packages that reference one another in the same repository. e.g:

/path/to/first/package
/path/to/second/package (dependent on first package)
/path/to/some/binary (dependent on second package; transitively dependent on first package)

@alexeagle
Copy link
Collaborator

@an-kumar yes, this is supported already

For TypeScript, you have

/path/to/first/package
  BUILD.bazel
    ts_library(name = "first", module_name = "first", srcs =["first.ts"])
/path/to/second/package
  BUILD.bazel
    ts_library(name = "second" module_name = "second", srcs = ["second.ts"], deps = ["//path/to/first/package:first"])
  second.ts
    import * as f from 'first';
/path/to/some/binary
  BUILD.bazel
    ts_library(name = "program", deps = ["//path/to/second/package:second"], srcs = ["program.ts"])
    nodejs_binary(name = "bin", deps = [":program"], ...)
  program.ts
    import * as s from 'second';

If you don't use TypeScript, this is still supported, but not yet documented because we aren't sure we understand the use case (why use Bazel if you're not running any compilers?)

https://github.com/bazelbuild/rules_nodejs/blob/befbd8961c18de98e254bea94db08ede78889f86/internal/js_library/js_library.bzl
lets you assign the module_name just like above TS example

@Globegitter
Copy link
Contributor

Globegitter commented Mar 25, 2018

@alexeagle Our use case would be to have shared code between different rollup bundles. Both would then just define that common js_library as a dep. Or would you there just directly depend on the files?

Edit: To be more precise, that particular use-case I am describing is in a monorepository structure, so it would be something like:

/WORKSPACE
/common # shared es6 modules
/app1 # rollup_bundle depending on some libraries in common
/app2 # rollup_bundle depending on some libraries in common
...

Edit 2:
Also something like a babel_library could be interesting to allow incremental babel transpilation.

@alexeagle
Copy link
Collaborator

you can just use a plain filegroup rule if you want to be able to reference the same group of .js inputs in several different bundling rules.

babel_library sounds like a great addition, want to try a PR for that?

@nimerritt
Copy link
Contributor

@Globegitter we would also benefit from a babel rule as we are migrating a large service to TypeScript and it's nice to use Bazel to mix between the two as we move forward, especially given that the TypeScript rules don't take .js files.

@an-kumar
Copy link

@alexeagle well, similar to how in second.ts you can import from 'first', it would be nice if in a second.js you could require('first'). In this sense, the compilation is happening in the nodejs_binary rule, where the modules are being used -- creating a runnable nodejs binary with it's declared dependencies and transitive dependencies correctly in the node_modules path with the correct names.

this doesn't seem doable with plain filegroups.

@an-kumar
Copy link

@alexeagle it also doesnt seem like nodejs_binary has a deps attribute, am i missing something about your ts example?

@Globegitter
Copy link
Contributor

Yeah also the one thing about no nodejs_library because it does not compile - isn't it the same as python_library? Not sure if that is doing much either. But yeah happy to try filegroup for now and can hopefully get around to PRing a babel_library.

@alexeagle
Copy link
Collaborator

@an-kumar nodejs_binary has no compile-time deps, only runtime deps. Bazel typically uses data[] for the latter, so that's where your .js files should end up to be require-able at runtime.

Is there any change needed for this issue, or can I close it?

@prestonvanloon
Copy link

prestonvanloon commented May 11, 2018

You can't use a filegroup as a dep of ts_library because it doesn't have a "JS" attribute.

+1 to implement js_library.

Also see bazelbuild/rules_typescript#201

@alexeagle
Copy link
Collaborator

There actually is js_library already. It's undocumented because I'm not sure about all the use cases.
https://github.com/bazelbuild/rules_typescript/blob/63bb1a33f5231c72d7d503454e986e10139ed2ff/BUILD.bazel#L64 is an example where we use it - not because it produces outputs that a filegroup wouldn't, but because we want a place to mark some extra info (in this case the AMD module name mapping, but it can also be useful for ESModule name mapping)

For this issue, I still suspect the .js files can be a filegroup in the data of a ts_library - you wouldn't type-check your usage of the JS code from TypeScript, just need it to be present to require it at runtime.

I'm still looking for a concrete use case that requires some change here...

@alexeagle alexeagle changed the title no nodejs_library definition promote the js_library rule to the public API May 12, 2018
@Globegitter
Copy link
Contributor

Now that I have had some time to evaluate things more and after the insights gainedin #200, I think what I would expect from bazel for our use-case is to provide a js_library which can create the AMD output as expected by ts_devserver (better even js_devserver in the future) then other rules could be easily written on top of that, such as babel_library or json_to_js_library producing the same amd output for dev and es6 module output for prod/rollup. Does that make sense?

@alexeagle
Copy link
Collaborator

Yes, if you are writing JS with EcmaScript modules (import,export) then you could use some downleveler (TypeScript is one option) that knows how to produce named AMD output.

@mprobst is working on Bazel rules that do this for our Google-internal use case. Martin, do you have any plans for open-sourcing that work, or is it hopelessly coupled with internal-only stuff in the JS provider or something?

@excavador
Copy link

We need js_library for simple reason: internal code-generators/DSL

We write own code-generators, and we need some way to expose generated files to bazel.
For golang and python we use go_library and python_library.

Actual rules does not provide way to expose auto-generated files (only it to every nodejs_binary, bad way, to be honest)

As result we are implementing own version of rules_nodejs

@jwahlin
Copy link

jwahlin commented May 22, 2018

I have a similar use case as @excavador. We generate .js files with improbable-eng/ts-protoc-gen using a custom rule. It's a pain to then import those files into the source js files. If I don't do any customization, I can only import them from bazel-out/darwin-fastbuild/bin... which is quite ugly and OS-specific. A js_library could potentially help resolve dependencies like this one so the imports in the source js files aren't ugly.

@mprobst
Copy link
Contributor

mprobst commented May 23, 2018

@alexeagle we're using tsickle to drive this, as it is our general entry point to the compiler. The adjustments to tsickle to allow running on JS are open source, but that's the smallest bit of the work. The major effort was dealing with the structure of the internal js_library rules. I don't think that's worth open sourcing, it's mostly dealing with a ton of oldish cruft.

@DeveloperFromUkraine
Copy link

DeveloperFromUkraine commented Jan 29, 2019

what would you expect such a nodejs_library rule to do?

If you want to compile libraries in isolation, use a compile-to-JS rule like ts_library
If you want to publish a package to npm, use npm_package

Sorry, after reading doc, I don't understand one point. If I got two projects one is playground and second is a library, what the best solutions for make all library component (modules) dependency for playground?

Thank you for your answer.

@Globegitter
Copy link
Contributor

Just for reference I have written a simple js_library to get transitive dep loading with nodejs_binary as well as basic support for ts_devserver: https://github.com/ecosia/bazel_rules_nodejs_contrib#js_library

@bryanjlee bryanjlee modified the milestones: Beta, 1.0 Aug 23, 2019
@pauldraper
Copy link

pauldraper commented Sep 2, 2019

what would you expect such a nodejs_library rule to do?

@alexeagle, not very much.

Something similar to what I expect py_library or sh_library to do.

This is the familiar Bazel paradigm -- library (composable unit), binary (executable), test (executable test) -- applied to JS.

you can just use a plain filegroup rule if you want to be able to reference the same group of .js inputs in several different bundling rules.

Except file_group doesn't have deps or data.


Optionally, nodejs_library could do more, like enable static dependency checking.

@gregmagolan
Copy link
Collaborator

gregmagolan commented Sep 19, 2019

Ideally, we'd replace js_library with something that understands module_name, module_root & package.json

@gregmagolan
Copy link
Collaborator

note: amd_names attribute in by ts_proto_library labs rule: https://github.com/bazelbuild/rules_nodejs/pull/1159/files#r326720152

@alexeagle
Copy link
Collaborator

current proposal:

  • js_library is just filegroup plus it outputs the JS*ModuleInfo providers
  • npm_package with a package.json#name and package.json#main is the way to get a module_name/module_root

@pward123
Copy link

Does npm_package currently pull name and main for module_name/module_root or is that proposed? I have an issue reproduction where the lack of module_name seems to be the cause.

https://github.com/pward123/bazel-monorepo-test/tree/comparison

@alexeagle
Copy link
Collaborator

FYI seems likely this will slip for 1.0, needs a fair amount of design thinking

@alexeagle alexeagle removed this from the 1.0 milestone Nov 21, 2019
@gregmagolan
Copy link
Collaborator

gregmagolan commented Dec 3, 2019

For 1.0, we could add the legacy typescript provider and the DeclarationInfo provider to js_library so that users could use it in the deps of a ts_library?

Otherwise, ts_library will complain:

//foo:bar is neither a TypeScript nor a JS producing rule. Dependencies must be ts_library

The AmdNamesInfo provider in js_library can be dropped now that it is not used anywhere.

Ideally we could promote node_module_library to the public API instead and remove js_library all together (https://github.com/bazelbuild/rules_nodejs/blob/master/internal/npm_install/node_module_library.bzl) but node_module_library provides NpmPackageInfo so consuming rules will complain if not all NpmPackageInfo are from the same workspace. Seems that requirement could be dropped now with the advent of the linker but there would be some work involved there.

@alexeagle
Copy link
Collaborator

We now have a rough design to solve this by making pkg_npm work as a first-party dependency within a monorepo rather than just for publishing externally to npm. https://hackmd.io/@alexeagle/SkNE_w2QU

@pward123
Copy link

This looks great!

Would it be possible to support rollup_bundle so that @rollup/plugin-node-resolve automatically bundles monorepo dependencies?

@alexeagle alexeagle added this to the 2.0 milestone Jun 9, 2020
@alexeagle
Copy link
Collaborator

we ran into the issue that pkg_npm produces a TreeArtifact (output directory) which means it can't also supply individual file outputs to satisfy providers like DeclarationInfo. So it needs to have a non-directory output mode.

This would be a non-breaking change so we'll put it off until 2.x after 2.0

@alexeagle alexeagle removed this from the 2.0 milestone Jun 15, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2020
alexeagle pushed a commit that referenced this issue Sep 10, 2020
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Oct 17, 2020
This allows source level profiling of the JavaScript code, in addition to the more coarsely grained application level profile.
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this issue Oct 18, 2020
This allows source level profiling of the JavaScript code, in addition to the more coarsely grained application level profile.
lherman-cs pushed a commit to lherman-cs/rules_nodejs that referenced this issue Jan 15, 2021
fix: remove duplicate Importing

chore: upgrade rollup to ^2.3.0

fix: coverage (bazel-contrib#2100)

* test: add coverage e2e test

* fix(builtin): fix coverage lcov merger script jumping out of sandbox and not being able to find c8

* test: don't test coverage on Windows

docs: use @npm//@bazel for example load sites

fix(cypress): allow for async cypress plugins

cypress_repository now fails if cypress verify fails
set the HOME env variable since cypress writes files to it
remove unused includeScreenshots / includeVideos variables
browserify files are no longer included in test output files
screenshots/videos are stored directory in TEST_UNDECLARED_OUTPUTS_DIR

docs: update docs for release

chore(release): 2.0.2

chore: update lock files for release

feat(example): add targets in angular_bazel_architect for production serve and build

fix(examples): use ./ prefix on babel config file

Otherwise if it's in a subfolder, babel will think it's an npm package

chore: update dependency com_google_protobuf to v3.13.0 (bazel-contrib#2103)

refactor(rollup): use rollup loadConfigFile API

chore: update dependency bazel_toolchains to v3.4.1

build(deps): bump elliptic in /e2e/fine_grained_symlinks

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.1 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.4.1...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

fix(typescript): only expect .js outs for .tsx? srcs (bazel-contrib#2118)

Fixes bazel-contrib#2115

feat(builtin): new js_library rule (bazel-contrib#2109)

Removes `node_module_library` private API and renames it to `js_library`

the latter will be promoted to a public API in a followup change

fix(typescript): produce .d.ts as default output rather than empty (bazel-contrib#2117)

This lets you type-check a ts_project(emit_declaration_only=True) just by building it (its default outputs)

Fixes bazel-contrib#2116

added script to generate NodeJS versions for node_repositories and added most up-to-date versions (bazel-contrib#2126)

Co-authored-by: Matt Insler <matt.insler@airbnb.com>

refactor: move node version list into its own file (bazel-contrib#2128)

Add a package.json script for updating it

docs: update docs for release

chore(release): 2.0.3

chore: update lock files for release

fix(typescript): add the tsBuildInfoFile option to ts_project (bazel-contrib#2138)

Like other options that affect tsc outputs, Bazel needs to know the value from the tsconfig if its set.
Add it to our validator so there's a buildozer command to sync the option value into the BUILD file.

Fixes bazel-contrib#2137

refactor(typescript): remove private _TsConfigInfo in ts_project (bazel-contrib#2139)

Instead use the same TsConfigInfo that ts_library uses.

Fixes bazel-contrib#1931

docs: refresh docsite

docs: minor cleanup of builtins page

don't include the defaults which are giant dictionaries as they render poorly

docs: fix spacing and link colours on rhs sidenav

Fix circleci status badges to pin to stable branch

CircleCI docs claim that they should use the default branch by default, but this icon is green while stable is red, so I think it's still reporting on master.

ci: all angular examples timeout=long

chore: update dependency bazel_toolchains to v3.4.2

chore: update circleci image to latest to pick up newer chrome

docs: add search to docsite using gcse

feat(typescript): generate tsconfig.json for ts_project (bazel-contrib#2130)

This is an experimental, opt-in feature where ts_project will generate a tsconfig.json file in place of
the user specifying one in the source directory.

I expect a long tail of compatibility bugs since any path appearing in this generated file needs to point from
bazel-out back to the source directory.

Fixes bazel-contrib#2058

docs: replace references to //packages/ with the @npm//@bazel/ equivalent (bazel-contrib#2154)

feat(builtin): accept any stamp vars in pkg_npm

NOTE: instead of replacing the replace_with_version with 0.0.0 in unstamped builds,
we now omit the replacement.

See bazel-contrib#1694

docs(rollup): add stamping and debug to rollup doc

Also move most of the content above the list of rules. It shows up better in the TOC since rollup_bundle
can be its own entry later in the page, and avoids the API doc table of attributes just appearing with no header.

docs: document the node_context_data attribute

It can be useful if you need to turn on/off stamping per-target.
`java_binary` gives a dedicated stamp attribute for this purpose

Fixes bazel-contrib#1693

chore: hide generated .html files in code review

feat(builtin): support for substitutions

fix: use golden_file_test instead

refactor: cleanup pkg_web stamping feature

chore: update dependency bazel_toolchains to v3.5.0 (bazel-contrib#2168)

Updated nodejs versions (14.9.0) (bazel-contrib#2169)

docs: update docs for release

chore(release): 2.1.0

chore: update lock files for release

chore: try github actions version of stale bot

The probot one never triggered despite being setup correctly AFAICT.
This bot seems better supported and I sow it working on bazel-watcher repo.

build(deps): bump http-proxy from 1.18.0 to 1.18.1

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](http-party/node-http-proxy@1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

build(deps): bump yargs-parser in /e2e/ts_devserver

Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2.
- [Release notes](https://github.com/yargs/yargs-parser/releases)
- [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md)
- [Commits](https://github.com/yargs/yargs-parser/commits)

Signed-off-by: dependabot[bot] <support@github.com>

ci: stamp our releases with a stable key

fix(builtin): don't set --preserve-symlinks-main by default (bazel-contrib#2176)

feat: add link_workspace_root to nodejs_binary, npm_package_bin, rollup_bundle, terser_minified, ts_project

Link the workspace root to the bin_dir to support absolute requires like 'my_wksp/path/to/file'.
If source files need to be required then they can be copied to the bin_dir with copy_to_bin.

fix(builtin): fix bazel coverage masking test failures

test(builtin): test failing test with bazel coverage

build(deps): bump http-proxy in /examples/protocol_buffers

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](http-party/node-http-proxy@1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

build(deps): bump http-proxy in /examples/web_testing

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](http-party/node-http-proxy@1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

test(rollup): fix test failing due to missing dep

fix(rollup): allow config files to override default onwarn method

Fixes bazel-contrib#2084

feat: link_workspace_root not needed in terser_minified

docs: add spica to adopter organization list (bazel-contrib#2184)

* Add spica to adopter organization list (bazel-contrib#2183)
* docs: update the 'send a PR' link to point to the stable branch

Co-authored-by: Sahin Yort <thesayyn@gmail.com>

feat: promote js_library to public API

Fixes bazel-contrib#149
Fixes bazel-contrib#1771

docs: update docs for release

chore(release): 2.2.0

chore: update lock files for release

Update readme (bazel-contrib#2190)

Fix missing `}` and indentation

feat: add strict_visibility to npm_install / yarn_install rules (bazel-contrib#2193)

With strict_visibility enabled (currently defaults false), only dependencies within the given `package.json` file are given public visibility.

All transitive dependencies are given limited visibility, enforcing that all direct dependencies are listed in the `package.json` file.

closes bazel-contrib#2110

fix: don't glob yarn or node files when using vendored_node or vendored_yarn

- Fixes a visibility issue with rollup-worker

fix(examples): prevent ibazel EOF

Fixes bazel-contrib#2143

docs(karma): document how to use non-headless Chrome (bazel-contrib#2202)

Fixes bazel-contrib#1881

docs(labs): produce stardoc API for labs

Fixes bazel-contrib#2195

fix(karma): allow custom browsers to specify args (fixes bazel-contrib#595)

Today, the args as specified in the various manifests of the rules_webtesting
browsers never make it into the generated karma.conf.js. This results in these
arguments never being used when launching Chrome, preventing customization of
browsers such as window size, enabling remote debugging, or other flag-based
options. This PR fixes this by reading those arguments from the manifest, and
adding them to the browsers list in the generated karma.conf.js.

Also, this PR includes a change to generated_file_test to allow a golden file
to represent a substring of the generated output.

Also Also: This PR includes a golden file test that verified that the generated
karma.conf.js does read in the specified value.

Furthermore, the effect of this can be verified manually via:
```
VERBOSE_LOGS=1 bazel run packages/karma/test/karma:testing_custom_chrome
```
Note the appearance of the additional flags in the new debug output.

fix(builtin): js_library: correctly propagate DeclarationInfos

Transitive typings are added to typings_depsets, but we were checking
the typings array instead.

Signed-off-by: Duarte Nunes <duarte@hey.com>

feat: update nodejs versions (bazel-contrib#2207)

include 10.22.1, 12.18.4, 14.10.0, 14.10.1, 14.11.0 and 14.12.0 in node_versions

Added s390x support

docs: update docs for release

chore(release): 2.2.1

chore: update lock files for release

ci: tell Angular CLI not to update webdriver

It can get ahead of the Chrome version on our CI machine

ci: replace --webdriver-update=false with --no-webdriverUpdate

Architect CLI uses minimist under the hood to parse arguments. Minimist will not convert boolean like values unless they are known options or the `{boolean: true}` option is configured (Which is not in Architect CLI).

feat(karma): use Trusted Types policy when loading scripts for Karma

When the Karma plugin is used in a testing environment that enforces
Trusted Types, its loadFile functionality currently fails due to a
Trusted Types violation when assigning to script.textContent. This makes
it impossible to use the plugin with integration tests that ensure an
application is compatible with Trusted Types.

This is fixed by creating a Trusted Types policy specifically for the
Karma plugin, and use it to promote any loaded scripts to a TrustedScript
before assigning to script.textContent. This is done in a way that is
backwards compatible:
- The policy is `null` in browsers that don't yet support Trusted Types,
  in which case the original script string is used as before.
- When Trusted Types are supported in the browser but not enforced by
  the application, the browser treats the TrustedScript as if it were a
  string when it is assigned to script.textContent.

chore: update dependency bazel_toolchains to v3.6.0

docs: remove HTML tables so docs can be authored in markdown without need for html escaping

docs(rollup): improve clarity

feat(example): add full pwa support

feat(example): service worker update handling

fix(exmaple): add docstring to ngsw_config rule

fix(example): remove server side compression

fix(example): remove index.html from prodapp srcs

fix(example): remove compression dependencies

fix(builtin): js_library supports --output_groups=types

If providing DeclarationInfo we should also give this way for filegroup/bazel CLI to select them

chore: docgen

docs: update docs for release

chore(release): 2.2.2

chore: update lock files for release

fix(builtin): give a longer timeout for _create_build_files

A user reports that their build file generation takes longer than 600 seconds.
It's probably a bug that we are so slow, but let's address that separately (maybe in our work for npm v7)

Also note we could have made this timeout user-configurable, but I think the extra API surface isn't worth the benefit.

Fixes bazel-contrib#2231

fix(typescript): don't include _valid_options marker file in outs

Tested by building //packages/angular:npm_package and don't get an extra .d.ts file in the package.
Also tested the negative case by making an invalid option and check that it's still reported.

Fixes bazel-contrib#2078

chore: allow node versions <= 14.14.0

chore: update rules_docker to 0.14.4

docs: minor update for readability and formatting (bazel-contrib#2243)

* docs: minor update for readibility and formating

Fix small typo in changelog

chore(docs): move ts_library docs into ts_library

Also recommend ts_project for new uses

chore(karma): remove dependency on tmp

feat(typescript): add allow_js support to ts_project

fix(exmaples/nestjs): add module_name field in ts_library

docs: fix a typo of angular-architect example (bazel-contrib#2272)

chore: bump days before closing stale issues to 90

Fix select with conditons on darwin.

Bazel is changing how @bazel_tools/conditions:darwin is implemented.
With old implementation based on flags, it was ok to have darwin and
darwin_x86_64 in a select. This was based on flag --cpu=darwin and
--cpu=dawin_x86_64.

New implementation is based on constraints, where "darwin" means OS (and
any CPU), while "darwin_x86_64" mean only specific CPU. As such they
cannot be used in the same select, because the selection would be
ambiguous.

build: add 'fix-windows' tag due to windows flaky tests

Will revisit the linker and test, but this is blocking PRs from being merged

feat(typescript): worker mode for ts_project (bazel-contrib#2136)

* feat(typescript): worker mode for ts_project

* chore: cleanup and declare protobufjs dependency

* fix: do not pass --watch for non-worker mode

* fix: do not test worker on windows

* fix: log on standalone failures

* chore: docs improvements

Co-authored-by: Alex Eagle <alex.eagle@robinhood.com>
Co-authored-by: Dan Muller <mrmeku@stairwell.com>

feat(node_repositories): Added auth option for downloading nodejs and yarn

fix: npm_package.pack should work in windows os

feat(examples): adds example for running jest with typescript (bazel-contrib#2245)

fix(typescript): specify rootDir as absolute path

Also allow non-ts files across src/bin dir, since they are not emitted we don't need the rootdir
calculation to take them into account. This lets the Angular compiler accept .ts sources from
source dir even if the css inputs are generated.

refactor: ts_project cleanup

feat(cypress): remove browiserify preprocessor

docs: update docs for release

chore(release): 2.3.0

chore: update lock files for release

fix: npm_package.pack on Windows should not generate undefined.tgz

chore: update nodejs versions (bazel-contrib#2284)

perf(cypress): pack cypress runfiles into a single tar

chore: add GitHub Workflow to update NodeJS versions every night

chore: fix a link

Current link returns 404, it seems that the url was somehow changed to .html from .md.

chore: fix the link again

haha

fix(builtin): make linker deterministic when resolving from manifest & fix link_workspace_root with no runfiles

chore: re-lock jest dependencies

It was using a non-standard repository, which had downtime this morning

chore(release): 2.3.1

chore: update lock files for release

chore: update dependency com_google_protobuf to v3.14.0

chore: update dependency bazel_toolchains to v3.7.0

fix launcher script terminating before child terminates on SIGTERM

chore: update dependency bazel_toolchains to v3.7.1

fix(examples): fix jest example on windows

Fixes bazel-contrib#1454

fix(builtin): give better error when linker runs on Node <10

Example how this looks now:

```
[20 / 21] Bundling JavaScript bundle.js [parcel]; 4s remote-cache, darwin-sandbox
ERROR: /private/var/folders/r7/2kp53v7n091gcz93xlt7wtd80000gn/T/tmp-48948DHy4HrXTwhRy/BUILD.bazel:4:1: Bundling JavaScript bundle.js [parcel] failed (Exit 1) parcel.sh failed: error executing command bazel-out/host/bin/external/npm/parcel-bundler/bin/parcel.sh build foo.js --out-dir bazel-out/darwin-fastbuild/bin --out-file bundle.js ... (remaining 2 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
ERROR: rules_nodejs linker requires Node v10 or greater, but is running on 8.11.2
Note that earlier Node versions are no longer in long-term-support, see
https://nodejs.org/en/about/releases/
INFO: Elapsed time: 40.360s, Critical Path: 12.97s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
//:test                                                               NO STATUS
```

Fixes bazel-contrib#2304

docs(typescript): link some user-contributed doc (bazel-contrib#2322)

Fixes bazel-contrib#2298

chore: allow node versions >=12 <=14 (bazel-contrib#2332)

chore: allow node versions >=12 <=14

feat: add esbuild package

chore: add module_mapping support via the aspect instead of manual implementing it

chore: sqash

feat: update to latest esbuild, add additional flags when not minifying

fix: consume both JSEcmaScriptModuleInfo and JSModuleInfo to support js_library

fix: add missing bzl libraries and publish helpers

test: use runfiles helper in test

fix: use exe for Windows
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 a pull request may close this issue.