@veryfront/ext-observability-opentelemetry 0.1.1081 → 0.1.1083

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.
Files changed (227) hide show
  1. package/esm/{extensions/ext-observability-opentelemetry/src/index.d.ts → index.d.ts} +0 -16
  2. package/esm/index.d.ts.map +1 -0
  3. package/esm/{extensions/ext-observability-opentelemetry/src/index.js → index.js} +2 -3
  4. package/package.json +6 -6
  5. package/esm/_dnt.polyfills.d.ts +0 -7
  6. package/esm/_dnt.polyfills.d.ts.map +0 -1
  7. package/esm/_dnt.polyfills.js +0 -1
  8. package/esm/deno.d.ts +0 -443
  9. package/esm/deno.d.ts.map +0 -1
  10. package/esm/deno.js +0 -531
  11. package/esm/extensions/ext-observability-opentelemetry/src/index.d.ts.map +0 -1
  12. package/esm/src/config/defaults.d.ts +0 -39
  13. package/esm/src/config/defaults.d.ts.map +0 -1
  14. package/esm/src/config/defaults.js +0 -65
  15. package/esm/src/errors/error-registry/agent.d.ts +0 -18
  16. package/esm/src/errors/error-registry/agent.d.ts.map +0 -1
  17. package/esm/src/errors/error-registry/agent.js +0 -60
  18. package/esm/src/errors/error-registry/boundary.d.ts +0 -16
  19. package/esm/src/errors/error-registry/boundary.d.ts.map +0 -1
  20. package/esm/src/errors/error-registry/boundary.js +0 -52
  21. package/esm/src/errors/error-registry/build.d.ts +0 -20
  22. package/esm/src/errors/error-registry/build.d.ts.map +0 -1
  23. package/esm/src/errors/error-registry/build.js +0 -68
  24. package/esm/src/errors/error-registry/config.d.ts +0 -22
  25. package/esm/src/errors/error-registry/config.d.ts.map +0 -1
  26. package/esm/src/errors/error-registry/config.js +0 -70
  27. package/esm/src/errors/error-registry/deploy.d.ts +0 -12
  28. package/esm/src/errors/error-registry/deploy.d.ts.map +0 -1
  29. package/esm/src/errors/error-registry/deploy.js +0 -36
  30. package/esm/src/errors/error-registry/dev.d.ts +0 -14
  31. package/esm/src/errors/error-registry/dev.d.ts.map +0 -1
  32. package/esm/src/errors/error-registry/dev.js +0 -44
  33. package/esm/src/errors/error-registry/general.d.ts +0 -29
  34. package/esm/src/errors/error-registry/general.d.ts.map +0 -1
  35. package/esm/src/errors/error-registry/general.js +0 -92
  36. package/esm/src/errors/error-registry/module.d.ts +0 -16
  37. package/esm/src/errors/error-registry/module.d.ts.map +0 -1
  38. package/esm/src/errors/error-registry/module.js +0 -52
  39. package/esm/src/errors/error-registry/route.d.ts +0 -16
  40. package/esm/src/errors/error-registry/route.d.ts.map +0 -1
  41. package/esm/src/errors/error-registry/route.js +0 -52
  42. package/esm/src/errors/error-registry/runtime.d.ts +0 -18
  43. package/esm/src/errors/error-registry/runtime.d.ts.map +0 -1
  44. package/esm/src/errors/error-registry/runtime.js +0 -60
  45. package/esm/src/errors/error-registry/server.d.ts +0 -39
  46. package/esm/src/errors/error-registry/server.d.ts.map +0 -1
  47. package/esm/src/errors/error-registry/server.js +0 -129
  48. package/esm/src/errors/error-registry-helpers.d.ts +0 -6
  49. package/esm/src/errors/error-registry-helpers.d.ts.map +0 -1
  50. package/esm/src/errors/error-registry-helpers.js +0 -9
  51. package/esm/src/errors/error-registry.d.ts +0 -114
  52. package/esm/src/errors/error-registry.d.ts.map +0 -1
  53. package/esm/src/errors/error-registry.js +0 -60
  54. package/esm/src/errors/types.d.ts +0 -84
  55. package/esm/src/errors/types.d.ts.map +0 -1
  56. package/esm/src/errors/types.js +0 -69
  57. package/esm/src/errors/veryfront-error.d.ts +0 -149
  58. package/esm/src/errors/veryfront-error.d.ts.map +0 -1
  59. package/esm/src/errors/veryfront-error.js +0 -61
  60. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +0 -13
  61. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +0 -1
  62. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +0 -55
  63. package/esm/src/observability/tracing/api-shim.d.ts +0 -191
  64. package/esm/src/observability/tracing/api-shim.d.ts.map +0 -1
  65. package/esm/src/observability/tracing/api-shim.js +0 -281
  66. package/esm/src/observability/tracing/otlp-setup.d.ts +0 -63
  67. package/esm/src/observability/tracing/otlp-setup.d.ts.map +0 -1
  68. package/esm/src/observability/tracing/otlp-setup.js +0 -219
  69. package/esm/src/observability/tracing/telemetry-env.d.ts +0 -3
  70. package/esm/src/observability/tracing/telemetry-env.d.ts.map +0 -1
  71. package/esm/src/observability/tracing/telemetry-env.js +0 -10
  72. package/esm/src/platform/adapters/base.d.ts +0 -209
  73. package/esm/src/platform/adapters/base.d.ts.map +0 -1
  74. package/esm/src/platform/adapters/base.js +0 -15
  75. package/esm/src/platform/compat/constants.d.ts +0 -13
  76. package/esm/src/platform/compat/constants.d.ts.map +0 -1
  77. package/esm/src/platform/compat/constants.js +0 -12
  78. package/esm/src/platform/compat/dynamic-import.d.ts +0 -11
  79. package/esm/src/platform/compat/dynamic-import.d.ts.map +0 -1
  80. package/esm/src/platform/compat/dynamic-import.js +0 -10
  81. package/esm/src/platform/compat/fs.d.ts +0 -75
  82. package/esm/src/platform/compat/fs.d.ts.map +0 -1
  83. package/esm/src/platform/compat/fs.js +0 -315
  84. package/esm/src/platform/compat/path/resolution.d.ts +0 -6
  85. package/esm/src/platform/compat/path/resolution.d.ts.map +0 -1
  86. package/esm/src/platform/compat/path/resolution.js +0 -121
  87. package/esm/src/platform/compat/path/runtime.d.ts +0 -8
  88. package/esm/src/platform/compat/path/runtime.d.ts.map +0 -1
  89. package/esm/src/platform/compat/path/runtime.js +0 -20
  90. package/esm/src/platform/compat/path/types.d.ts +0 -22
  91. package/esm/src/platform/compat/path/types.d.ts.map +0 -1
  92. package/esm/src/platform/compat/path/types.js +0 -1
  93. package/esm/src/platform/compat/process/command.d.ts +0 -33
  94. package/esm/src/platform/compat/process/command.d.ts.map +0 -1
  95. package/esm/src/platform/compat/process/command.js +0 -206
  96. package/esm/src/platform/compat/process/env.d.ts +0 -35
  97. package/esm/src/platform/compat/process/env.d.ts.map +0 -1
  98. package/esm/src/platform/compat/process/env.js +0 -194
  99. package/esm/src/platform/compat/process/lifecycle.d.ts +0 -99
  100. package/esm/src/platform/compat/process/lifecycle.d.ts.map +0 -1
  101. package/esm/src/platform/compat/process/lifecycle.js +0 -327
  102. package/esm/src/platform/compat/process/runtime-process.d.ts +0 -10
  103. package/esm/src/platform/compat/process/runtime-process.d.ts.map +0 -1
  104. package/esm/src/platform/compat/process/runtime-process.js +0 -25
  105. package/esm/src/platform/compat/process.d.ts +0 -5
  106. package/esm/src/platform/compat/process.d.ts.map +0 -1
  107. package/esm/src/platform/compat/process.js +0 -4
  108. package/esm/src/platform/compat/runtime.d.ts +0 -51
  109. package/esm/src/platform/compat/runtime.d.ts.map +0 -1
  110. package/esm/src/platform/compat/runtime.js +0 -104
  111. package/esm/src/transforms/import-rewriter/url-builder.d.ts +0 -70
  112. package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +0 -1
  113. package/esm/src/transforms/import-rewriter/url-builder.js +0 -152
  114. package/esm/src/utils/base64url.d.ts +0 -6
  115. package/esm/src/utils/base64url.d.ts.map +0 -1
  116. package/esm/src/utils/base64url.js +0 -12
  117. package/esm/src/utils/bundle-manifest.d.ts +0 -63
  118. package/esm/src/utils/bundle-manifest.d.ts.map +0 -1
  119. package/esm/src/utils/bundle-manifest.js +0 -96
  120. package/esm/src/utils/constants/buffers.d.ts +0 -24
  121. package/esm/src/utils/constants/buffers.d.ts.map +0 -1
  122. package/esm/src/utils/constants/buffers.js +0 -23
  123. package/esm/src/utils/constants/build.d.ts +0 -8
  124. package/esm/src/utils/constants/build.d.ts.map +0 -1
  125. package/esm/src/utils/constants/build.js +0 -7
  126. package/esm/src/utils/constants/cache.d.ts +0 -74
  127. package/esm/src/utils/constants/cache.d.ts.map +0 -1
  128. package/esm/src/utils/constants/cache.js +0 -133
  129. package/esm/src/utils/constants/cdn.d.ts +0 -29
  130. package/esm/src/utils/constants/cdn.d.ts.map +0 -1
  131. package/esm/src/utils/constants/cdn.js +0 -58
  132. package/esm/src/utils/constants/crypto.d.ts +0 -10
  133. package/esm/src/utils/constants/crypto.d.ts.map +0 -1
  134. package/esm/src/utils/constants/crypto.js +0 -9
  135. package/esm/src/utils/constants/env.d.ts +0 -16
  136. package/esm/src/utils/constants/env.d.ts.map +0 -1
  137. package/esm/src/utils/constants/env.js +0 -20
  138. package/esm/src/utils/constants/hash.d.ts +0 -5
  139. package/esm/src/utils/constants/hash.d.ts.map +0 -1
  140. package/esm/src/utils/constants/hash.js +0 -4
  141. package/esm/src/utils/constants/hmr.d.ts +0 -24
  142. package/esm/src/utils/constants/hmr.d.ts.map +0 -1
  143. package/esm/src/utils/constants/hmr.js +0 -26
  144. package/esm/src/utils/constants/html.d.ts +0 -13
  145. package/esm/src/utils/constants/html.d.ts.map +0 -1
  146. package/esm/src/utils/constants/html.js +0 -12
  147. package/esm/src/utils/constants/http.d.ts +0 -77
  148. package/esm/src/utils/constants/http.d.ts.map +0 -1
  149. package/esm/src/utils/constants/http.js +0 -76
  150. package/esm/src/utils/constants/index.d.ts +0 -23
  151. package/esm/src/utils/constants/index.d.ts.map +0 -1
  152. package/esm/src/utils/constants/index.js +0 -22
  153. package/esm/src/utils/constants/limits.d.ts +0 -27
  154. package/esm/src/utils/constants/limits.d.ts.map +0 -1
  155. package/esm/src/utils/constants/limits.js +0 -26
  156. package/esm/src/utils/constants/metrics.d.ts +0 -10
  157. package/esm/src/utils/constants/metrics.d.ts.map +0 -1
  158. package/esm/src/utils/constants/metrics.js +0 -34
  159. package/esm/src/utils/constants/network.d.ts +0 -23
  160. package/esm/src/utils/constants/network.d.ts.map +0 -1
  161. package/esm/src/utils/constants/network.js +0 -27
  162. package/esm/src/utils/constants/priorities.d.ts +0 -31
  163. package/esm/src/utils/constants/priorities.d.ts.map +0 -1
  164. package/esm/src/utils/constants/priorities.js +0 -30
  165. package/esm/src/utils/constants/retry.d.ts +0 -14
  166. package/esm/src/utils/constants/retry.d.ts.map +0 -1
  167. package/esm/src/utils/constants/retry.js +0 -13
  168. package/esm/src/utils/constants/security.d.ts +0 -16
  169. package/esm/src/utils/constants/security.d.ts.map +0 -1
  170. package/esm/src/utils/constants/security.js +0 -15
  171. package/esm/src/utils/constants/server.d.ts +0 -107
  172. package/esm/src/utils/constants/server.d.ts.map +0 -1
  173. package/esm/src/utils/constants/server.js +0 -120
  174. package/esm/src/utils/feature-flags.d.ts +0 -7
  175. package/esm/src/utils/feature-flags.d.ts.map +0 -1
  176. package/esm/src/utils/feature-flags.js +0 -8
  177. package/esm/src/utils/hash-utils.d.ts +0 -19
  178. package/esm/src/utils/hash-utils.d.ts.map +0 -1
  179. package/esm/src/utils/hash-utils.js +0 -42
  180. package/esm/src/utils/import-lockfile.d.ts +0 -52
  181. package/esm/src/utils/import-lockfile.d.ts.map +0 -1
  182. package/esm/src/utils/import-lockfile.js +0 -187
  183. package/esm/src/utils/index.d.ts +0 -27
  184. package/esm/src/utils/index.d.ts.map +0 -1
  185. package/esm/src/utils/index.js +0 -25
  186. package/esm/src/utils/logger/components.d.ts +0 -73
  187. package/esm/src/utils/logger/components.d.ts.map +0 -1
  188. package/esm/src/utils/logger/components.js +0 -81
  189. package/esm/src/utils/logger/core.d.ts +0 -73
  190. package/esm/src/utils/logger/core.d.ts.map +0 -1
  191. package/esm/src/utils/logger/core.js +0 -143
  192. package/esm/src/utils/logger/index.d.ts +0 -10
  193. package/esm/src/utils/logger/index.d.ts.map +0 -1
  194. package/esm/src/utils/logger/index.js +0 -9
  195. package/esm/src/utils/logger/logger.d.ts +0 -179
  196. package/esm/src/utils/logger/logger.d.ts.map +0 -1
  197. package/esm/src/utils/logger/logger.js +0 -490
  198. package/esm/src/utils/logger/redact.d.ts +0 -74
  199. package/esm/src/utils/logger/redact.d.ts.map +0 -1
  200. package/esm/src/utils/logger/redact.js +0 -294
  201. package/esm/src/utils/logger/request-context.d.ts +0 -27
  202. package/esm/src/utils/logger/request-context.d.ts.map +0 -1
  203. package/esm/src/utils/logger/request-context.js +0 -28
  204. package/esm/src/utils/memoize.d.ts +0 -19
  205. package/esm/src/utils/memoize.d.ts.map +0 -1
  206. package/esm/src/utils/memoize.js +0 -72
  207. package/esm/src/utils/parallel.d.ts +0 -25
  208. package/esm/src/utils/parallel.d.ts.map +0 -1
  209. package/esm/src/utils/parallel.js +0 -91
  210. package/esm/src/utils/path-utils.d.ts +0 -34
  211. package/esm/src/utils/path-utils.d.ts.map +0 -1
  212. package/esm/src/utils/path-utils.js +0 -138
  213. package/esm/src/utils/perf-timer.d.ts +0 -11
  214. package/esm/src/utils/perf-timer.d.ts.map +0 -1
  215. package/esm/src/utils/perf-timer.js +0 -114
  216. package/esm/src/utils/platform.d.ts +0 -9
  217. package/esm/src/utils/platform.d.ts.map +0 -1
  218. package/esm/src/utils/platform.js +0 -11
  219. package/esm/src/utils/runtime-guards.d.ts +0 -29
  220. package/esm/src/utils/runtime-guards.d.ts.map +0 -1
  221. package/esm/src/utils/runtime-guards.js +0 -23
  222. package/esm/src/utils/version-constant.d.ts +0 -3
  223. package/esm/src/utils/version-constant.d.ts.map +0 -1
  224. package/esm/src/utils/version-constant.js +0 -4
  225. package/esm/src/utils/version.d.ts +0 -17
  226. package/esm/src/utils/version.d.ts.map +0 -1
  227. package/esm/src/utils/version.js +0 -36
@@ -1,315 +0,0 @@
1
- import * as dntShim from "../../../_dnt.shims.js";
2
- import { createError, toError } from "../../errors/veryfront-error.js";
3
- import { isBun, isDeno, isNode } from "./runtime.js";
4
- /**
5
- * Typed accessor for the Deno global.
6
- *
7
- * This is pure typing only — it reads no environment variables and performs no
8
- * side effects, so this module stays importable without `--allow-env`. It
9
- * exists to retire the `@ts-ignore` comments that were previously required to
10
- * access `Deno.*` APIs from runtime-agnostic compat code.
11
- */
12
- function denoGlobal() {
13
- return dntShim.dntGlobalThis.Deno;
14
- }
15
- class NodeFileSystem {
16
- fs;
17
- os;
18
- path;
19
- initialized = false;
20
- async ensureInitialized() {
21
- if (this.initialized)
22
- return;
23
- if (!isNode && !isBun) {
24
- throw toError(createError({
25
- type: "not_supported",
26
- message: "Node.js fs modules not available",
27
- feature: "Node.js",
28
- }));
29
- }
30
- const [fsModule, osModule, pathModule] = await Promise.all([
31
- import("node:fs/promises"),
32
- import("node:os"),
33
- import("node:path"),
34
- ]);
35
- this.fs = fsModule;
36
- this.os = osModule;
37
- this.path = pathModule;
38
- this.initialized = true;
39
- }
40
- getFs() {
41
- if (!this.fs)
42
- throw new Error("NodeFileSystem not initialized");
43
- return this.fs;
44
- }
45
- getOs() {
46
- if (!this.os)
47
- throw new Error("NodeFileSystem not initialized");
48
- return this.os;
49
- }
50
- getPath() {
51
- if (!this.path)
52
- throw new Error("NodeFileSystem not initialized");
53
- return this.path;
54
- }
55
- async readTextFile(path) {
56
- await this.ensureInitialized();
57
- return this.getFs().readFile(path, { encoding: "utf8" });
58
- }
59
- async readFile(path) {
60
- await this.ensureInitialized();
61
- return this.getFs().readFile(path);
62
- }
63
- async writeTextFile(path, data) {
64
- await this.ensureInitialized();
65
- await this.getFs().writeFile(path, data, { encoding: "utf8" });
66
- }
67
- async writeFile(path, data) {
68
- await this.ensureInitialized();
69
- await this.getFs().writeFile(path, data);
70
- }
71
- async exists(path) {
72
- await this.ensureInitialized();
73
- try {
74
- await this.getFs().access(path);
75
- return true;
76
- }
77
- catch (error) {
78
- if (error?.code === "ENOENT")
79
- return false;
80
- throw error;
81
- }
82
- }
83
- async stat(path) {
84
- await this.ensureInitialized();
85
- const stat = await this.getFs().stat(path);
86
- return {
87
- isFile: stat.isFile(),
88
- isDirectory: stat.isDirectory(),
89
- isSymlink: stat.isSymbolicLink(),
90
- size: stat.size,
91
- mtime: stat.mtime,
92
- };
93
- }
94
- async mkdir(path, options) {
95
- await this.ensureInitialized();
96
- await this.getFs().mkdir(path, { recursive: options?.recursive ?? false });
97
- }
98
- async *readDir(path) {
99
- await this.ensureInitialized();
100
- const entries = await this.getFs().readdir(path, { withFileTypes: true });
101
- for (const entry of entries) {
102
- yield {
103
- name: entry.name,
104
- isFile: entry.isFile(),
105
- isDirectory: entry.isDirectory(),
106
- isSymlink: entry.isSymbolicLink(),
107
- };
108
- }
109
- }
110
- async remove(path, options) {
111
- await this.ensureInitialized();
112
- const recursive = options?.recursive ?? false;
113
- await this.getFs().rm(path, { recursive, force: recursive });
114
- }
115
- async makeTempDir(options) {
116
- await this.ensureInitialized();
117
- const tempDir = this.getPath().join(this.getOs().tmpdir(), `${options?.prefix ?? "tmp-"}${dntShim.crypto.randomUUID().slice(0, 8)}`);
118
- await this.getFs().mkdir(tempDir, { recursive: true });
119
- return tempDir;
120
- }
121
- async chmod(path, mode) {
122
- await this.ensureInitialized();
123
- try {
124
- await this.getFs().chmod(path, mode);
125
- }
126
- catch {
127
- // Ignore errors on Windows where chmod is not fully supported.
128
- // Intentionally not logged: this low-level compat module must stay
129
- // importable without `--allow-env` (the logger reads env at import).
130
- }
131
- }
132
- }
133
- class DenoFileSystem {
134
- readTextFile(path) {
135
- return denoGlobal().readTextFile(path);
136
- }
137
- readFile(path) {
138
- return denoGlobal().readFile(path);
139
- }
140
- async writeTextFile(path, data) {
141
- await denoGlobal().writeTextFile(path, data);
142
- }
143
- async writeFile(path, data) {
144
- await denoGlobal().writeFile(path, data);
145
- }
146
- async exists(path) {
147
- try {
148
- await denoGlobal().stat(path);
149
- return true;
150
- }
151
- catch (error) {
152
- if (error instanceof denoGlobal().errors.NotFound)
153
- return false;
154
- throw error;
155
- }
156
- }
157
- async stat(path) {
158
- const stat = await denoGlobal().stat(path);
159
- return {
160
- isFile: stat.isFile,
161
- isDirectory: stat.isDirectory,
162
- isSymlink: stat.isSymlink,
163
- size: stat.size,
164
- mtime: stat.mtime,
165
- };
166
- }
167
- async mkdir(path, options) {
168
- await denoGlobal().mkdir(path, { recursive: options?.recursive ?? false });
169
- }
170
- async *readDir(path) {
171
- for await (const entry of denoGlobal().readDir(path)) {
172
- yield {
173
- name: entry.name,
174
- isFile: entry.isFile,
175
- isDirectory: entry.isDirectory,
176
- isSymlink: entry.isSymlink,
177
- };
178
- }
179
- }
180
- async remove(path, options) {
181
- await denoGlobal().remove(path, { recursive: options?.recursive ?? false });
182
- }
183
- makeTempDir(options) {
184
- return denoGlobal().makeTempDir({ prefix: options?.prefix });
185
- }
186
- async chmod(path, mode) {
187
- try {
188
- await denoGlobal().chmod(path, mode);
189
- }
190
- catch (_) {
191
- /* expected: chmod is not fully supported on Windows */
192
- }
193
- }
194
- }
195
- /** Create file system. */
196
- export function createFileSystem() {
197
- return isDeno ? new DenoFileSystem() : new NodeFileSystem();
198
- }
199
- let _fs = null;
200
- function getFs() {
201
- _fs ??= createFileSystem();
202
- return _fs;
203
- }
204
- /** Read a file as text. */
205
- export function readTextFile(path) {
206
- return getFs().readTextFile(path);
207
- }
208
- /** Read a file as bytes. */
209
- export function readFile(path) {
210
- return getFs().readFile(path);
211
- }
212
- /** Write text to a file. */
213
- export function writeTextFile(path, data) {
214
- return getFs().writeTextFile(path, data);
215
- }
216
- /** Write bytes to a file. */
217
- export function writeFile(path, data) {
218
- return getFs().writeFile(path, data);
219
- }
220
- /** Check whether a path exists. */
221
- export function exists(path) {
222
- return getFs().exists(path);
223
- }
224
- /** Read file metadata. */
225
- export function stat(path) {
226
- return getFs().stat(path);
227
- }
228
- /** Read file metadata without following a terminal symbolic link. */
229
- export async function lstat(path) {
230
- if (isDeno) {
231
- const info = await denoGlobal().lstat(path);
232
- return {
233
- isFile: info.isFile,
234
- isDirectory: info.isDirectory,
235
- isSymlink: info.isSymlink,
236
- size: info.size,
237
- mtime: info.mtime,
238
- };
239
- }
240
- const fs = await import("node:fs/promises");
241
- const info = await fs.lstat(path);
242
- return {
243
- isFile: info.isFile(),
244
- isDirectory: info.isDirectory(),
245
- isSymlink: info.isSymbolicLink(),
246
- size: info.size,
247
- mtime: info.mtime,
248
- };
249
- }
250
- /** Create a directory. */
251
- export function mkdir(path, options) {
252
- return getFs().mkdir(path, options);
253
- }
254
- /** Remove a file or directory. */
255
- export function remove(path, options) {
256
- return getFs().remove(path, options);
257
- }
258
- /** Read directory entries. */
259
- export function readDir(path) {
260
- return getFs().readDir(path);
261
- }
262
- /** Create temp dir. */
263
- export function makeTempDir(options) {
264
- return getFs().makeTempDir(options);
265
- }
266
- /** Change file permissions. */
267
- export function chmod(path, mode) {
268
- return getFs().chmod(path, mode);
269
- }
270
- export async function symlink(target, path) {
271
- if (isDeno) {
272
- await denoGlobal().symlink(target, path);
273
- return;
274
- }
275
- const fs = await import("node:fs/promises");
276
- await fs.symlink(target, path);
277
- }
278
- /**
279
- * Resolve a path to its canonical absolute form, following symlinks.
280
- * Throws if the path does not exist. Useful for containment checks where a
281
- * symlink could otherwise escape an intended directory.
282
- */
283
- export async function realPath(path) {
284
- if (isDeno) {
285
- return await denoGlobal().realPath(path);
286
- }
287
- const fs = await import("node:fs/promises");
288
- return await fs.realpath(path);
289
- }
290
- /** Error shape for is not found. */
291
- export function isNotFoundError(error, seen = new Set()) {
292
- if (seen.has(error))
293
- return false;
294
- seen.add(error);
295
- const NotFound = dntShim.dntGlobalThis.Deno?.errors?.NotFound;
296
- if (isDeno && NotFound && error instanceof NotFound)
297
- return true;
298
- if (error?.code === "ENOENT")
299
- return true;
300
- if (error instanceof Error && error.name === "VeryfrontError" &&
301
- error.slug === "file-not-found") {
302
- return true;
303
- }
304
- if (error instanceof Error && "cause" in error) {
305
- return isNotFoundError(error.cause, seen);
306
- }
307
- return false;
308
- }
309
- /** Error shape for is already exists. */
310
- export function isAlreadyExistsError(error) {
311
- const AlreadyExists = dntShim.dntGlobalThis.Deno?.errors?.AlreadyExists;
312
- if (isDeno && AlreadyExists && error instanceof AlreadyExists)
313
- return true;
314
- return error?.code === "EEXIST";
315
- }
@@ -1,6 +0,0 @@
1
- /** Resolve path segments to an absolute path. */
2
- export declare function resolve(...paths: string[]): string;
3
- export declare function isAbsolute(path: string): boolean;
4
- export declare function relative(from: string, to: string): string;
5
- export declare function normalize(path: string): string;
6
- //# sourceMappingURL=resolution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/resolution.ts"],"names":[],"mappings":"AAeA,iDAAiD;AACjD,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAqClD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMhD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CA8BzD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyC9C"}
@@ -1,121 +0,0 @@
1
- import * as dntShim from "../../../../_dnt.shims.js";
2
- import { isDeno, nodePath } from "./runtime.js";
3
- function hasWindowsLikePath(path) {
4
- return path.includes("\\") || /^[A-Za-z]:/.test(path) || path.startsWith("\\\\");
5
- }
6
- /** Normalize backslashes to forward slashes (for Deno on Windows). */
7
- function normSep(p) {
8
- return p.includes("\\") ? p.replace(/\\/g, "/") : p;
9
- }
10
- /** Match Windows drive letter prefix like "C:/" */
11
- const DRIVE_LETTER = /^[A-Za-z]:\//;
12
- /** Resolve path segments to an absolute path. */
13
- export function resolve(...paths) {
14
- if (!isDeno && nodePath && !paths.some(hasWindowsLikePath))
15
- return nodePath.resolve(...paths);
16
- let resolvedPath = normSep(dntShim.dntGlobalThis.Deno?.cwd?.() ?? "/");
17
- for (const rawPath of paths) {
18
- if (!rawPath)
19
- continue;
20
- const path = normSep(rawPath);
21
- if (path.startsWith("/") || DRIVE_LETTER.test(path)) {
22
- resolvedPath = path;
23
- }
24
- else {
25
- resolvedPath = `${resolvedPath}/${path}`;
26
- }
27
- }
28
- // Preserve drive letter prefix (e.g. "D:/") if present
29
- let prefix = "/";
30
- const driveMatch = resolvedPath.match(DRIVE_LETTER);
31
- if (driveMatch) {
32
- prefix = driveMatch[0]; // e.g. "D:/"
33
- resolvedPath = resolvedPath.slice(prefix.length);
34
- }
35
- else if (resolvedPath.startsWith("/")) {
36
- resolvedPath = resolvedPath.slice(1);
37
- }
38
- const parts = resolvedPath.split("/").filter(Boolean);
39
- const resolved = [];
40
- for (const part of parts) {
41
- if (part === "..") {
42
- resolved.pop();
43
- continue;
44
- }
45
- if (part !== ".")
46
- resolved.push(part);
47
- }
48
- return `${prefix}${resolved.join("/")}`;
49
- }
50
- export function isAbsolute(path) {
51
- if (!isDeno && nodePath && !hasWindowsLikePath(path) && nodePath.isAbsolute(path))
52
- return true;
53
- // Cross-platform fallback: Unix, Windows drive letters, and UNC paths
54
- if (path.startsWith("/"))
55
- return true;
56
- if (/^[A-Za-z]:[/\\]/.test(path))
57
- return true;
58
- return /^\\\\[^\\]+\\[^\\]+/.test(path);
59
- }
60
- export function relative(from, to) {
61
- if (!isDeno && nodePath && !hasWindowsLikePath(from) && !hasWindowsLikePath(to)) {
62
- const relativePath = nodePath.relative(from, to);
63
- return relativePath || ".";
64
- }
65
- const resolvedFrom = resolve(from);
66
- const resolvedTo = resolve(to);
67
- // Strip drive prefix for comparison (both will share the same drive after resolve)
68
- const fromDrive = resolvedFrom.match(DRIVE_LETTER);
69
- const fromBase = fromDrive ? resolvedFrom.slice(fromDrive[0].length) : resolvedFrom.slice(1);
70
- const toDrive = resolvedTo.match(DRIVE_LETTER);
71
- const toBase = toDrive ? resolvedTo.slice(toDrive[0].length) : resolvedTo.slice(1);
72
- const fromParts = fromBase.split("/").filter(Boolean);
73
- const toParts = toBase.split("/").filter(Boolean);
74
- let common = 0;
75
- const minLen = Math.min(fromParts.length, toParts.length);
76
- for (let i = 0; i < minLen; i++) {
77
- if (fromParts[i] !== toParts[i])
78
- break;
79
- common++;
80
- }
81
- const ups = fromParts.length - common;
82
- const result = [...new Array(ups).fill(".."), ...toParts.slice(common)];
83
- return result.join("/") || ".";
84
- }
85
- export function normalize(path) {
86
- if (!isDeno && nodePath && !hasWindowsLikePath(path))
87
- return nodePath.normalize(path);
88
- if (path === "")
89
- return ".";
90
- const p = normSep(path);
91
- const abs = isAbsolute(p);
92
- // Preserve drive letter prefix
93
- let prefix = "";
94
- const driveMatch = p.match(DRIVE_LETTER);
95
- if (driveMatch) {
96
- prefix = driveMatch[0];
97
- }
98
- else if (abs) {
99
- prefix = "/";
100
- }
101
- const pathWithoutPrefix = driveMatch ? p.slice(prefix.length) : abs ? p.slice(1) : p;
102
- const parts = pathWithoutPrefix.split("/").filter((s) => s && s !== ".");
103
- const normalized = [];
104
- for (const part of parts) {
105
- if (part !== "..") {
106
- normalized.push(part);
107
- continue;
108
- }
109
- const last = normalized[normalized.length - 1];
110
- if (normalized.length > 0 && last !== "..") {
111
- normalized.pop();
112
- continue;
113
- }
114
- if (!abs)
115
- normalized.push("..");
116
- }
117
- const result = normalized.join("/");
118
- if (abs)
119
- return result ? `${prefix}${result}` : prefix || "/";
120
- return result || ".";
121
- }
@@ -1,8 +0,0 @@
1
- import type { NodePathModule } from "./types.js";
2
- export declare const isDeno: boolean;
3
- declare let nodePath: NodePathModule | null;
4
- export { nodePath };
5
- export declare const sep: string;
6
- export declare const delimiter: string;
7
- export declare const hasNodePath: boolean;
8
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAKjD,eAAO,MAAM,MAAM,SAAsC,CAAC;AAE1D,QAAA,IAAI,QAAQ,EAAE,cAAc,GAAG,IAAW,CAAC;AAe3C,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAO,MAAM,GAAG,QAAuB,CAAC;AACxC,eAAO,MAAM,SAAS,QAA6B,CAAC;AACpD,eAAO,MAAM,WAAW,SAAoB,CAAC"}
@@ -1,20 +0,0 @@
1
- import * as dntShim from "../../../../_dnt.shims.js";
2
- const globalProcess = dntShim.dntGlobalThis.process;
3
- const hasNodeApis = !!globalProcess?.versions?.node || "Bun" in dntShim.dntGlobalThis;
4
- export const isDeno = typeof dntShim.Deno !== "undefined";
5
- let nodePath = null;
6
- if (hasNodeApis) {
7
- try {
8
- const nodeRequire = dntShim.dntGlobalThis.require;
9
- if (nodeRequire) {
10
- nodePath = nodeRequire("node:path");
11
- }
12
- }
13
- catch (_) {
14
- /* expected: node:path require may fail in non-Node runtimes */
15
- }
16
- }
17
- export { nodePath };
18
- export const sep = nodePath?.sep ?? "/";
19
- export const delimiter = nodePath?.delimiter ?? ":";
20
- export const hasNodePath = nodePath !== null;
@@ -1,22 +0,0 @@
1
- export interface PathObject {
2
- root?: string;
3
- dir?: string;
4
- base?: string;
5
- ext?: string;
6
- name?: string;
7
- }
8
- export interface NodePathModule {
9
- sep: string;
10
- delimiter: string;
11
- join(...paths: string[]): string;
12
- resolve(...paths: string[]): string;
13
- dirname(path: string): string;
14
- basename(path: string, ext?: string): string;
15
- extname(path: string): string;
16
- isAbsolute(path: string): boolean;
17
- relative(from: string, to: string): string;
18
- normalize(path: string): string;
19
- parse(path: string): PathObject;
20
- format(pathObject: PathObject): string;
21
- }
22
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACjC,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACpC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;CACxC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,33 +0,0 @@
1
- export interface CommandResult {
2
- success: boolean;
3
- code: number;
4
- stdout?: string;
5
- stderr?: string;
6
- }
7
- export interface CommandOptions {
8
- args?: string[];
9
- cwd?: string;
10
- env?: Record<string, string>;
11
- /** Start from an empty environment before applying `env`. */
12
- clearEnv?: boolean;
13
- /** Capture stdout/stderr to return in result */
14
- capture?: boolean;
15
- /** Inherit stdio from parent process (shows output in terminal) */
16
- inherit?: boolean;
17
- /** Use shell to run the command (needed for .cmd files on Windows) */
18
- shell?: boolean;
19
- /** Kill the command if it exceeds this duration (milliseconds) */
20
- timeoutMs?: number;
21
- }
22
- /**
23
- * Run a command and return the result.
24
- * Works across Deno, Node.js, and Bun.
25
- *
26
- * @param cmd - Command to run
27
- * @param options - Command options
28
- * @param options.capture - Capture stdout/stderr to return in result
29
- * @param options.inherit - Inherit stdio from parent (shows output in terminal)
30
- * @param options.shell - Use shell to run command (needed for .cmd on Windows)
31
- */
32
- export declare function runCommand(cmd: string, options?: CommandOptions): Promise<CommandResult>;
33
- //# sourceMappingURL=command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/command.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6ED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAoMxB"}