@travetto/runtime 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/runtime",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Runtime for travetto applications.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"directory": "module/runtime"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/manifest": "^7.0.
|
|
29
|
+
"@travetto/manifest": "^7.0.1",
|
|
30
30
|
"@types/debug": "^4.1.12",
|
|
31
31
|
"debug": "^4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/transformer": "^7.0.
|
|
34
|
+
"@travetto/transformer": "^7.0.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/transformer": {
|
|
@@ -2,20 +2,21 @@ import ts from 'typescript';
|
|
|
2
2
|
|
|
3
3
|
import { TransformerState, OnFile } from '@travetto/transformer';
|
|
4
4
|
|
|
5
|
-
const PATH_REGEX = /^['"](node:)?path['"]$/;
|
|
6
5
|
const PATH_IMPORT = '@travetto/manifest/src/path.ts';
|
|
7
6
|
|
|
8
7
|
const isImport = (node: ts.Node): node is ts.ImportDeclaration =>
|
|
9
|
-
ts.isImportDeclaration(node)
|
|
8
|
+
ts.isImportDeclaration(node)
|
|
9
|
+
&& ts.isStringLiteral(node.moduleSpecifier)
|
|
10
|
+
&& (
|
|
11
|
+
node.moduleSpecifier.text === 'node:path'
|
|
12
|
+
|| node.moduleSpecifier.text === 'path'
|
|
13
|
+
);
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Rewriting path imports to use manifest's path
|
|
13
17
|
*/
|
|
14
18
|
export class PathImportTransformer {
|
|
15
19
|
|
|
16
|
-
/**
|
|
17
|
-
* Hash each class
|
|
18
|
-
*/
|
|
19
20
|
@OnFile()
|
|
20
21
|
static rewritePathImport(state: TransformerState, node: ts.SourceFile): ts.SourceFile {
|
|
21
22
|
const statement = node.statements.find(isImport);
|