Skip to content

Commit

Permalink
Moves //packages/renderer/... to //tools/binaries/renderer/....
Browse files Browse the repository at this point in the history
Refs #67.

This is because the renderer is invoked as a tool, not installed as a package by the user. This is a slight misnomer as `//tools/binaries/renderer/...` does not export a `js_binary()`, however it does export a library which gets wrapped into a `js_binary()` under the hood, and treated as _effectively_ a tool, even if technically it isn't.
  • Loading branch information
dgp1130 committed Feb 19, 2023
1 parent a29176e commit ded80dc
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/rules_prerender/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ bzl_library(
deps = [
":web_resources",
"//common:paths",
"//packages/renderer:build_vars",
"//packages/rules_prerender/css:css_providers",
"//tools/binaries/renderer:build_vars",
],
)

Expand Down
4 changes: 2 additions & 2 deletions packages/rules_prerender/prerender_resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("//common:label.bzl", "absolute", "file_path_of", "rel_path")
load("//common:paths.bzl", "is_js_file")
load("//packages/renderer:build_vars.bzl", "RENDERER_RUNTIME_DEPS")
load("//packages/rules_prerender/css:css_providers.bzl", "CssImportMapInfo")
load("//tools/binaries/renderer:build_vars.bzl", "RENDERER_RUNTIME_DEPS")
load(":web_resources.bzl", "WebResourceInfo")

def prerender_resources(
Expand Down Expand Up @@ -106,7 +106,7 @@ const render = createRenderer(rulesPrerender, mod, '{entry_point}');
main(render);
""".format(
binary_helper = rel_path(file_path_of(Label("//common:binary"))),
renderer = rel_path(file_path_of(Label("//packages/renderer"))),
renderer = rel_path(file_path_of(Label("//tools/binaries/renderer"))),
entry_point = entry_point,
).strip()],
testonly = testonly,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrerenderResource } from '../../common/models/prerender_resource';
import { Probably } from '../../common/probably';
import { PrerenderResource } from '../../../common/models/prerender_resource';
import { Probably } from '../../../common/probably';

/**
* Invokes the default function export of the given CommonJS module, and validates the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrerenderResource } from '../../common/models/prerender_resource';
import { Probably } from '../../common/probably';
import { PrerenderResource } from '../../../common/models/prerender_resource';
import { Probably } from '../../../common/probably';
import { invoke } from './entry_point';

function definitelyIterable<T>(probably: Iterable<Probably<T>> | AsyncIterable<Probably<T>>): Iterable<T> | AsyncIterable<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { promises as fs } from 'fs';
import * as path from 'path';
import * as yargs from 'yargs';
import type { MainFn } from '../../common/binary';
import { mdSpacing } from '../../common/formatters';
import type { MainFn } from '../../../common/binary';
import { mdSpacing } from '../../../common/formatters';
import { invoke } from './entry_point';

// Cannot include a value reference of `rules_prerender` because the user will
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { promises as fs } from 'fs';
import * as rulesPrerender from 'rules_prerender';
import { ProcessResult } from '../../common/testing/binary';
import { useTempDir } from '../../common/testing/temp_dir';
import { createAnnotation } from '../../common/models/prerender_annotation';
import { ProcessResult } from '../../../common/testing/binary';
import { useTempDir } from '../../../common/testing/temp_dir';
import { createAnnotation } from '../../../common/models/prerender_annotation';
import { createRenderer } from './renderer';

/**
Expand Down
2 changes: 1 addition & 1 deletion tools/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ alias(

alias(
name = "renderer",
actual = "//packages/renderer",
actual = "//tools/binaries/renderer",
)

alias(
Expand Down

0 comments on commit ded80dc

Please sign in to comment.