Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/local-actions/branch-manager/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .github/local-actions/labels-sync/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .github/local-actions/lock-closed/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/bazel/configure-remote/configure-remote.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/branch-manager/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/browserstack/set-browserstack-env.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/feature-request/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/google-internal-tests/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/org-file-sync/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/post-approval-changes/main.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/pull-request-labeling/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/saucelabs/set-saucelabs-env.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion github-actions/unified-status-check/main.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions ng-dev/misc/generated-files/update-generated-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function updateGeneratedFileTargets(): Promise<void> {
getBazelBin(),
[
'query',
`"kind(nodejs_binary, //...) intersect attr(name, '.update$', //...)"`,
`"kind(esbuild, //...) intersect attr(name, '_generated$', //...)"`,
'--output',
'label',
],
Expand All @@ -31,7 +31,10 @@ export async function updateGeneratedFileTargets(): Promise<void> {
throw new Error(`Unexpected error: ${result.stderr}`);
}

const targets = result.stdout.trim().split(/\r?\n/);
const targets = result.stdout
.trim()
.split(/\r?\n/)
.map((x) => x.replace(/_generated$/, ''));

Log.debug.group('Discovered Targets');
targets.forEach((target) => Log.debug(target));
Expand Down
23 changes: 22 additions & 1 deletion tools/defaults2.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,30 @@ def jasmine_test(name, **kwargs):
**kwargs
)

def esbuild_checked_in(name, **kwargs):
def esbuild_checked_in(name, platform = None, config = {}, **kwargs):
"""
Runs esbuild with a default Node.js banner configuration if needed.
The user's provided 'config' settings will always take precedence.
"""

# Define a default configuration for the Node.js platform.
# This adds a 'require' shim needed by esbuild for ES Modules.
node_defaults = {
"banner": {
"js": "import { createRequire } from 'node:module';globalThis['require'] ??= createRequire(import.meta.url);",
},
}

# If the platform is "node", merge the user's config on top of the defaults.
# Otherwise, just use the user's config.
effective_config = (
{k: v for k, v in node_defaults.items() + config.items()} if platform == "node" else config
)

_esbuild(
name = "%s_generated" % name,
platform = platform,
config = effective_config,
sourcemap = "inline",
**kwargs
)
Expand Down