-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
937 additions
and
2,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,3 +627,20 @@ To actually publish a release to NPM, follow these steps: | |
[releases](https://github.com/dgp1130/rules_prerender/releases) to edit the | ||
automatically created release to add a changelog or other relevant | ||
information. | ||
## Updating `tsc_wrapped` patch | ||
`@bazel/typescript` is patched to load `//packages/tsc_plugin`. The patch itself | ||
lives at | ||
[`patches/@bazel+typescript+3.0.0.patch`](patches/@bazel+typescript+3.0.0.patch) | ||
and is automatically applied via a `postinstall` script. If you want to change | ||
the patch, the easiest way to do this is by making the edits you want in | ||
`node_modules/@bazel/typescript/` and then running: | ||
```shell | ||
npx [email protected] @bazel/typescript && bazel run //path/to/pkg:target | ||
``` | ||
This will update the `.patch` file to reflect your changes to `node_modules/`. | ||
`bazel` will pick up this change and rerun `npm install` followed by applying | ||
the patch and then building and running the desired target. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@npm//@bazel/typescript:index.bzl", "ts_library") | ||
|
||
ts_library( | ||
name = "tsc_plugin", | ||
srcs = ["index.ts"], | ||
module_name = "rules_prerender_tsc_plugin", | ||
visibility = ["//visibility:public"], | ||
deps = [":prerender_plugin"], | ||
) | ||
|
||
ts_library( | ||
name = "prerender_plugin", | ||
srcs = ["prerender_plugin.ts"], | ||
deps = [ | ||
"@npm//typescript", | ||
"@npm//@bazel/typescript" | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PrerenderPlugin } from './prerender_plugin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as ts from 'typescript'; | ||
import { DiagnosticPlugin } from '@bazel/typescript'; | ||
|
||
export class PrerenderPlugin implements DiagnosticPlugin { | ||
public readonly name = 'PrerenderPlugin'; | ||
|
||
private constructor() { } | ||
|
||
public static of(): PrerenderPlugin { | ||
return new PrerenderPlugin(); | ||
} | ||
|
||
public getDiagnostics(sourceFile: ts.SourceFile): | ||
readonly Readonly<ts.Diagnostic>[] { | ||
return [ | ||
{ | ||
messageText: 'Strict deps violation from rules_prerender!', | ||
category: ts.DiagnosticCategory.Error, | ||
code: 0, | ||
file: sourceFile, | ||
start: 0, | ||
length: 5, | ||
}, | ||
]; | ||
} | ||
} |
Oops, something went wrong.