@travetto/runtime 8.0.0-alpha.1 → 8.0.0-alpha.3
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 +4 -4
- package/src/context.ts +1 -1
- package/src/env.ts +2 -2
- package/src/file-loader.ts +1 -1
- package/src/global.d.ts +7 -0
- package/src/trv.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/runtime",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Runtime for travetto applications.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"directory": "module/runtime"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/manifest": "^8.0.0-alpha.
|
|
29
|
+
"@travetto/manifest": "^8.0.0-alpha.3",
|
|
30
30
|
"@types/debug": "^4.1.12",
|
|
31
31
|
"debug": "^4.4.3",
|
|
32
|
-
"temporal-polyfill-lite": "^0.
|
|
32
|
+
"temporal-polyfill-lite": "^0.3.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@travetto/transformer": "^8.0.0-alpha.
|
|
35
|
+
"@travetto/transformer": "^8.0.0-alpha.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@travetto/transformer": {
|
package/src/context.ts
CHANGED
|
@@ -111,7 +111,7 @@ class $Runtime {
|
|
|
111
111
|
/** Import from a given path */
|
|
112
112
|
async importFrom<T = unknown>(location?: string): Promise<T> {
|
|
113
113
|
const file = path.resolve(this.#idx.mainModule.sourcePath, location!);
|
|
114
|
-
if (await fs.stat(file
|
|
114
|
+
if (await fs.stat(file, { throwIfNoEntry: false })) {
|
|
115
115
|
location = this.#idx.getFromSource(file)?.import;
|
|
116
116
|
}
|
|
117
117
|
|
package/src/env.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class EnvProp<T> {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
type
|
|
93
|
+
type EnvDataCombinedType = {
|
|
94
94
|
[K in keyof EnvData]: Pick<EnvProp<EnvData[K]>, 'key' | 'export' | 'value' | 'set' | 'clear' | 'isSet' |
|
|
95
95
|
(EnvData[K] extends unknown[] ? 'list' | 'add' : never) |
|
|
96
96
|
(Extract<EnvData[K], object> extends never ? never : 'object') |
|
|
@@ -99,7 +99,7 @@ type AllType = {
|
|
|
99
99
|
>
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
function delegate<T extends object>(base: T):
|
|
102
|
+
function delegate<T extends object>(base: T): EnvDataCombinedType & T {
|
|
103
103
|
return new Proxy(castTo(base), {
|
|
104
104
|
get(target, property): unknown {
|
|
105
105
|
return typeof property !== 'string' ? undefined :
|
package/src/file-loader.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class FileLoader {
|
|
|
30
30
|
async resolve(relativePath: string): Promise<string> {
|
|
31
31
|
for (const sub of this.searchPaths) {
|
|
32
32
|
const resolved = path.join(sub, relativePath);
|
|
33
|
-
if (await fs.stat(resolved
|
|
33
|
+
if (await fs.stat(resolved, { throwIfNoEntry: false })) {
|
|
34
34
|
return resolved;
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/global.d.ts
CHANGED
|
@@ -64,4 +64,11 @@ declare module 'stream/web' {
|
|
|
64
64
|
* @concrete node:stream/web#ReadableStream
|
|
65
65
|
*/
|
|
66
66
|
interface ReadableStream { }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Remove once node 26 types are released
|
|
70
|
+
declare module 'node:fs' {
|
|
71
|
+
interface StatOptions {
|
|
72
|
+
throwIfNoEntry?: boolean;
|
|
73
|
+
}
|
|
67
74
|
}
|
package/src/trv.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type ManifestModuleRole } from '@travetto/manifest';
|
|
|
2
2
|
import { type TimeSpan } from './time.ts';
|
|
3
3
|
type Role = Exclude<ManifestModuleRole, 'compile'>;
|
|
4
4
|
|
|
5
|
-
declare module
|
|
5
|
+
declare module '@travetto/runtime' {
|
|
6
6
|
interface EnvData {
|
|
7
7
|
/**
|
|
8
8
|
* The node environment we are running in
|