-
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.
Refs #33. This updates `@rules_prerender` to use ESM modules everywhere. This makes a few changes throughout the workspace: 1. Renames `*.{ts,js}` -> `*.{mts,mjs}`. 2. Updates imports to include `.mjs` in the file path. 3. Updates any hard-coded CommonJS `require()` or `module.exports` to use ESM syntax. 4. Updates `tsconfig.json` files to use `module: "ES2020"` and `moduleResolution: "node"`. 5. Updates `package.json` files to use `type: "module"`. Most of the changes are fairly mechanical syntax modifications, though there are a couple random edits thrown in as necessary to switch over to ESM. Most of this was generated by running: ``` $ echo {common,examples,packages,tools}/**/*.ts | tr " " "\n" | xargs -I {} bash -c "git mv {} \$(echo {} | sed 's,\\.ts$,.mts,g')" $ sed -i -E "s,^import (.*?) from '(\..*?)';,import \1 from '\2.mjs';,g" {common,examples,packages,tools}/**/*.mts $ sed -i -E "s,^export (.*?) from '(\..*?)';,export \1 from '\2.mjs';,g" {common,examples,packages,tools}/**/*.mts $ sed -i "s,\\.ts\",.mts\",g" {.,common,examples,packages,tools}/**/BUILD.bazel $ sed -i "s,\\.js\",.mjs\",g" {.,common,examples,packages,tools}/**/BUILD.bazel ```
- Loading branch information
Showing
240 changed files
with
455 additions
and
447 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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
common/models/prerender_annotation_test.ts → common/models/prerender_annotation_test.mts
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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
common/models/prerender_metadata_test.ts → common/models/prerender_metadata_test.mts
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
2 changes: 1 addition & 1 deletion
2
common/models/prerender_resource.ts → common/models/prerender_resource.mts
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
2 changes: 1 addition & 1 deletion
2
common/models/prerender_resource_test.ts → common/models/prerender_resource_test.mts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
common/models/url_path_test.ts → common/models/url_path_test.mts
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
4 changes: 2 additions & 2 deletions
4
common/prerender_annotation_walker_test.ts → common/prerender_annotation_walker_test.mts
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
File renamed without changes.
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
Oops, something went wrong.