-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move top level register and nx-transformer to src/
- Loading branch information
Showing
6 changed files
with
32 additions
and
22 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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
"use strict"; | ||
module.exports = require("./").nxTransformerPlugin; | ||
// Keeping register here in the root for backwards compatibiliy, TODO remove in the next major version | ||
console.warn( | ||
"typescript-transform-paths: Calling the top level nx-transformer file is deprecated and will be removed in the future. Use a tool that supports package.json exports", | ||
); | ||
|
||
module.exports = require("./dist/plugins/nx-transfomer-plugin").default; |
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 |
---|---|---|
@@ -1,11 +1,5 @@ | ||
let tsNode; | ||
try { | ||
tsNode = require("ts-node"); | ||
} catch { | ||
throw new Error( | ||
`Cannot resolve ts-node. Make sure ts-node is installed before using typescript-transform-paths/register`, | ||
); | ||
} | ||
|
||
tsNode.register(); | ||
require("./").register(); | ||
// Keeping register here in the root for backwards compatibiliy, TODO remove in the next major version | ||
console.warn( | ||
"typescript-transform-paths: Calling the top level register file is deprecated and will be removed in the future. Use a tool that supports package.json exports", | ||
); | ||
require("./dist/register-entry"); |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./nx-transformer-plugin"; | ||
export * as nxTransformerPlugin from "./nx-transformer-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
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,13 @@ | ||
let tsNode; | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-require-imports | ||
tsNode = require("ts-node"); | ||
} catch { | ||
throw new Error( | ||
`Cannot resolve ts-node. Make sure ts-node is installed before using typescript-transform-paths/register`, | ||
); | ||
} | ||
|
||
tsNode.register(); | ||
// eslint-disable-next-line @typescript-eslint/no-require-imports | ||
require("./").register(); |