Skip to content

Commit

Permalink
Moves //packages/annotation_extractor/... to `//tools/binaries/anno…
Browse files Browse the repository at this point in the history
…tation_extractor/...`.

Refs #67.

This move is because it is an executed tool, not a package installed by the user.
  • Loading branch information
dgp1130 committed Feb 19, 2023
1 parent 8a427ec commit 3bd25e2
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions tools/binaries/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Binaries

This directory contains all the binary tools owned by `@rules_prerender` which are
invoked by Starlark during a build.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { promises as fs } from 'fs';
import * as yargs from 'yargs';
import * as path from 'path';
import { main } from '../../common/binary';
import { mdSpacing } from '../../common/formatters';
import { main } from '../../../common/binary';
import { mdSpacing } from '../../../common/formatters';
import { extract } from './extractor';
import { assembleMetadata } from './metadata';
import { PrerenderAnnotation, annotationsEqual } from '../../common/models/prerender_annotation';
import { unique } from '../../common/collections';
import { PrerenderAnnotation, annotationsEqual } from '../../../common/models/prerender_annotation';
import { unique } from '../../../common/collections';

main(async () => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { promises as fs } from 'fs';
import { mockPrerenderMetadata, mockScriptMetadata } from '../../common/models/prerender_metadata_mock';
import { PrerenderMetadata } from '../../common/models/prerender_metadata';
import { execBinary, ProcessResult } from '../../common/testing/binary';
import { useTempDir } from '../../common/testing/temp_dir';
import { createAnnotation } from '../../common/models/prerender_annotation';
import { mockPrerenderMetadata, mockScriptMetadata } from '../../../common/models/prerender_metadata_mock';
import { PrerenderMetadata } from '../../../common/models/prerender_metadata';
import { execBinary, ProcessResult } from '../../../common/testing/binary';
import { useTempDir } from '../../../common/testing/temp_dir';
import { createAnnotation } from '../../../common/models/prerender_annotation';

const extractor = 'packages/annotation_extractor/annotation_extractor.sh';
const extractor = 'tools/binaries/annotation_extractor/annotation_extractor.sh';

async function run({ inputDir, outputHtmlDir, outputMetadata }: {
inputDir: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse, HTMLElement } from 'node-html-parser';
import { PrerenderAnnotation } from '../../common/models/prerender_annotation';
import { walkAllAnnotations } from '../../common/prerender_annotation_walker';
import { PrerenderAnnotation } from '../../../common/models/prerender_annotation';
import { walkAllAnnotations } from '../../../common/prerender_annotation_walker';

/**
* Parses the given string as HTML and return a tuple of the input HTML with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extract } from './extractor';
import { createAnnotation } from '../../common/models/prerender_annotation';
import { createAnnotation } from '../../../common/models/prerender_annotation';

describe('extractor', () => {
describe('extract()', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrerenderAnnotation } from '../../common/models/prerender_annotation';
import { PrerenderMetadata, ScriptMetadata } from '../../common/models/prerender_metadata';
import { PrerenderAnnotation } from '../../../common/models/prerender_annotation';
import { PrerenderMetadata, ScriptMetadata } from '../../../common/models/prerender_metadata';

/**
* Converts the provided {@link Set} of {@link PrerenderAnnotation} into a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mockScriptAnnotation, mockStyleAnnotation } from '../../common/models/prerender_annotation_mock';
import { mockPrerenderMetadata, mockScriptMetadata } from '../../common/models/prerender_metadata_mock';
import { mockScriptAnnotation, mockStyleAnnotation } from '../../../common/models/prerender_annotation_mock';
import { mockPrerenderMetadata, mockScriptMetadata } from '../../../common/models/prerender_metadata_mock';
import { assembleMetadata } from './metadata';

describe('metadata', () => {
Expand Down
2 changes: 1 addition & 1 deletion tools/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package(default_visibility = ["//visibility:public"])

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

alias(
Expand Down

0 comments on commit 3bd25e2

Please sign in to comment.