@interfere/next 0.0.15-alpha.8 → 0.1.0-alpha.11

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 (146) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -8
  3. package/dist/_virtual/_rolldown/runtime.mjs +7 -0
  4. package/dist/build/env-config.d.mts +3 -1
  5. package/dist/build/env-config.d.mts.map +1 -1
  6. package/dist/build/env-config.mjs +9 -1
  7. package/dist/build/env-config.mjs.map +1 -1
  8. package/dist/build/exchange-surface.d.mts +9 -0
  9. package/dist/build/exchange-surface.d.mts.map +1 -0
  10. package/dist/build/exchange-surface.mjs +36 -0
  11. package/dist/build/exchange-surface.mjs.map +1 -0
  12. package/dist/build/loaders/value-injection-loader.d.mts +22 -0
  13. package/dist/build/loaders/value-injection-loader.d.mts.map +1 -0
  14. package/dist/build/loaders/value-injection-loader.mjs +35 -0
  15. package/dist/build/loaders/value-injection-loader.mjs.map +1 -0
  16. package/dist/build/logger.d.mts +2 -2
  17. package/dist/build/logger.d.mts.map +1 -1
  18. package/dist/build/logger.mjs +10 -12
  19. package/dist/build/logger.mjs.map +1 -1
  20. package/dist/build/nextjs-version.d.mts +40 -0
  21. package/dist/build/nextjs-version.d.mts.map +1 -0
  22. package/dist/build/nextjs-version.mjs +66 -0
  23. package/dist/build/nextjs-version.mjs.map +1 -0
  24. package/dist/build/release-program.d.mts +5 -3
  25. package/dist/build/release-program.d.mts.map +1 -1
  26. package/dist/build/release-program.mjs +11 -12
  27. package/dist/build/release-program.mjs.map +1 -1
  28. package/dist/build/services/config.service.d.mts.map +1 -1
  29. package/dist/build/services/config.service.mjs.map +1 -1
  30. package/dist/build/services/instrumentation-detection.service.d.mts +19 -0
  31. package/dist/build/services/instrumentation-detection.service.d.mts.map +1 -0
  32. package/dist/build/services/instrumentation-detection.service.mjs +77 -0
  33. package/dist/build/services/instrumentation-detection.service.mjs.map +1 -0
  34. package/dist/build/services/preflight.service.d.mts +2 -3
  35. package/dist/build/services/preflight.service.d.mts.map +1 -1
  36. package/dist/build/services/preflight.service.mjs +28 -37
  37. package/dist/build/services/preflight.service.mjs.map +1 -1
  38. package/dist/build/services/release-api.service.d.mts +11 -0
  39. package/dist/build/services/release-api.service.d.mts.map +1 -0
  40. package/dist/build/services/release-api.service.mjs +9 -0
  41. package/dist/build/services/release-api.service.mjs.map +1 -0
  42. package/dist/build/services/release-identity.service.d.mts +4 -3
  43. package/dist/build/services/release-identity.service.d.mts.map +1 -1
  44. package/dist/build/services/release-identity.service.mjs +28 -15
  45. package/dist/build/services/release-identity.service.mjs.map +1 -1
  46. package/dist/build/services/source-map-failure-cleanup.service.d.mts +11 -0
  47. package/dist/build/services/source-map-failure-cleanup.service.d.mts.map +1 -0
  48. package/dist/build/services/source-map-failure-cleanup.service.mjs +9 -0
  49. package/dist/build/services/source-map-failure-cleanup.service.mjs.map +1 -0
  50. package/dist/build/services/source-map.service.d.mts +4 -8
  51. package/dist/build/services/source-map.service.d.mts.map +1 -1
  52. package/dist/build/services/source-map.service.mjs +2 -4
  53. package/dist/build/services/source-map.service.mjs.map +1 -1
  54. package/dist/build/source-maps/api.d.mts +25 -16
  55. package/dist/build/source-maps/api.d.mts.map +1 -1
  56. package/dist/build/source-maps/api.mjs +11 -8
  57. package/dist/build/source-maps/api.mjs.map +1 -1
  58. package/dist/build/source-maps/client.d.mts +11 -2
  59. package/dist/build/source-maps/client.d.mts.map +1 -1
  60. package/dist/build/source-maps/client.mjs +25 -14
  61. package/dist/build/source-maps/client.mjs.map +1 -1
  62. package/dist/build/source-maps/errors.d.mts +118 -106
  63. package/dist/build/source-maps/errors.d.mts.map +1 -1
  64. package/dist/build/source-maps/errors.mjs +42 -18
  65. package/dist/build/source-maps/errors.mjs.map +1 -1
  66. package/dist/build/source-maps/files.d.mts +1 -1
  67. package/dist/build/source-maps/files.d.mts.map +1 -1
  68. package/dist/build/source-maps/files.mjs +13 -15
  69. package/dist/build/source-maps/files.mjs.map +1 -1
  70. package/dist/build/source-maps/providers/deployment/detector.d.mts +8 -17
  71. package/dist/build/source-maps/providers/deployment/detector.d.mts.map +1 -1
  72. package/dist/build/source-maps/providers/deployment/detector.mjs +11 -13
  73. package/dist/build/source-maps/providers/deployment/detector.mjs.map +1 -1
  74. package/dist/build/source-maps/providers/deployment/types.d.mts +2 -2
  75. package/dist/build/source-maps/providers/deployment/types.d.mts.map +1 -1
  76. package/dist/build/source-maps/providers/deployment/vercel.d.mts.map +1 -1
  77. package/dist/build/source-maps/providers/deployment/vercel.mjs +8 -19
  78. package/dist/build/source-maps/providers/deployment/vercel.mjs.map +1 -1
  79. package/dist/build/source-maps/providers/source-control/detector.d.mts +6 -5
  80. package/dist/build/source-maps/providers/source-control/detector.d.mts.map +1 -1
  81. package/dist/build/source-maps/providers/source-control/detector.mjs +11 -13
  82. package/dist/build/source-maps/providers/source-control/detector.mjs.map +1 -1
  83. package/dist/build/source-maps/providers/source-control/git.d.mts.map +1 -1
  84. package/dist/build/source-maps/providers/source-control/git.mjs +5 -8
  85. package/dist/build/source-maps/providers/source-control/git.mjs.map +1 -1
  86. package/dist/build/source-maps/providers/source-control/types.d.mts +5 -3
  87. package/dist/build/source-maps/providers/source-control/types.d.mts.map +1 -1
  88. package/dist/build/with-interfere.d.mts +25 -3
  89. package/dist/build/with-interfere.d.mts.map +1 -1
  90. package/dist/build/with-interfere.mjs +131 -24
  91. package/dist/build/with-interfere.mjs.map +1 -1
  92. package/dist/client/auto-init.d.mts +91 -0
  93. package/dist/client/auto-init.d.mts.map +1 -0
  94. package/dist/client/auto-init.mjs +121 -0
  95. package/dist/client/auto-init.mjs.map +1 -0
  96. package/dist/client/provider.d.mts +3 -3
  97. package/dist/client/provider.d.mts.map +1 -1
  98. package/dist/client/provider.mjs +21 -8
  99. package/dist/client/provider.mjs.map +1 -1
  100. package/dist/lib/env.d.mts.map +1 -1
  101. package/dist/lib/types.d.mts +6 -6
  102. package/dist/lib/types.d.mts.map +1 -1
  103. package/dist/lib/types.mjs.map +1 -1
  104. package/dist/server/auto-init.d.mts +88 -0
  105. package/dist/server/auto-init.d.mts.map +1 -0
  106. package/dist/server/auto-init.mjs +101 -0
  107. package/dist/server/auto-init.mjs.map +1 -0
  108. package/dist/server/middleware.d.mts.map +1 -1
  109. package/dist/server/middleware.mjs +20 -13
  110. package/dist/server/middleware.mjs.map +1 -1
  111. package/dist/server/on-request-error.d.mts +27 -0
  112. package/dist/server/on-request-error.d.mts.map +1 -0
  113. package/dist/server/on-request-error.mjs +74 -0
  114. package/dist/server/on-request-error.mjs.map +1 -0
  115. package/dist/server/proxy.d.mts.map +1 -1
  116. package/dist/server/proxy.mjs +4 -5
  117. package/dist/server/proxy.mjs.map +1 -1
  118. package/dist/server/route-handler.d.mts +31 -1
  119. package/dist/server/route-handler.d.mts.map +1 -1
  120. package/dist/server/route-handler.mjs +78 -79
  121. package/dist/server/route-handler.mjs.map +1 -1
  122. package/dist/server/sdk.d.mts +96 -0
  123. package/dist/server/sdk.d.mts.map +1 -0
  124. package/dist/server/sdk.mjs +152 -0
  125. package/dist/server/sdk.mjs.map +1 -0
  126. package/dist/server/services/config.service.d.mts +33 -6
  127. package/dist/server/services/config.service.d.mts.map +1 -1
  128. package/dist/server/services/config.service.mjs +54 -30
  129. package/dist/server/services/config.service.mjs.map +1 -1
  130. package/dist/server/services/error-tracking.service.d.mts +3 -3
  131. package/dist/server/services/error-tracking.service.d.mts.map +1 -1
  132. package/dist/server/services/error-tracking.service.mjs +5 -3
  133. package/dist/server/services/error-tracking.service.mjs.map +1 -1
  134. package/dist/server/session-context.d.mts +60 -0
  135. package/dist/server/session-context.d.mts.map +1 -0
  136. package/dist/server/session-context.mjs +62 -0
  137. package/dist/server/session-context.mjs.map +1 -0
  138. package/package.json +58 -34
  139. package/dist/build/secret-key.d.mts +0 -10
  140. package/dist/build/secret-key.d.mts.map +0 -1
  141. package/dist/build/secret-key.mjs +0 -16
  142. package/dist/build/secret-key.mjs.map +0 -1
  143. package/dist/lib/test-utils/make-next-request.d.mts +0 -6
  144. package/dist/lib/test-utils/make-next-request.d.mts.map +0 -1
  145. package/dist/lib/test-utils/make-next-request.mjs +0 -12
  146. package/dist/lib/test-utils/make-next-request.mjs.map +0 -1
@@ -1,109 +1,121 @@
1
- import * as effect_Types0 from "effect/Types";
2
- import * as effect_Cause0 from "effect/Cause";
1
+ import { Schema } from "effect";
3
2
 
4
3
  //#region src/build/source-maps/errors.d.ts
5
- declare const InvalidApiUrlError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
6
- readonly _tag: "InvalidApiUrlError";
7
- } & Readonly<A>;
8
- declare class InvalidApiUrlError extends InvalidApiUrlError_base<{
9
- readonly message: string;
10
- }> {}
11
- declare const InvalidSecretKeyError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
12
- readonly _tag: "InvalidSecretKeyError";
13
- } & Readonly<A>;
14
- declare class InvalidSecretKeyError extends InvalidSecretKeyError_base<{
15
- readonly message: string;
16
- }> {}
17
- declare const UploadError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
18
- readonly _tag: "UploadError";
19
- } & Readonly<A>;
20
- declare class UploadError extends UploadError_base<{
21
- readonly file?: string;
22
- readonly message: string;
23
- readonly cause?: unknown;
24
- }> {}
25
- declare const TokenRequestError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
26
- readonly _tag: "TokenRequestError";
27
- } & Readonly<A>;
28
- declare class TokenRequestError extends TokenRequestError_base<{
29
- readonly message: string;
30
- }> {}
31
- declare const NotificationError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
32
- readonly _tag: "NotificationError";
33
- } & Readonly<A>;
34
- declare class NotificationError extends NotificationError_base<{
35
- readonly status?: number;
36
- readonly message: string;
37
- }> {}
38
- declare const PayloadTooLargeError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
39
- readonly _tag: "PayloadTooLargeError";
40
- } & Readonly<A>;
41
- declare class PayloadTooLargeError extends PayloadTooLargeError_base<{
42
- readonly message: string;
43
- }> {}
44
- declare const NoDeploymentError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
45
- readonly _tag: "NoDeploymentError";
46
- } & Readonly<A>;
47
- declare class NoDeploymentError extends NoDeploymentError_base<{
48
- readonly message: string;
49
- }> {}
50
- declare const NoBuildIdError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
51
- readonly _tag: "NoBuildIdError";
52
- } & Readonly<A>;
53
- declare class NoBuildIdError extends NoBuildIdError_base<{
54
- readonly message: string;
55
- }> {}
56
- declare const WithInterfereUsageError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
57
- readonly _tag: "WithInterfereUsageError";
58
- } & Readonly<A>;
59
- declare class WithInterfereUsageError extends WithInterfereUsageError_base<{
60
- readonly message: string;
61
- }> {}
62
- declare const MissingBuildIdError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
63
- readonly _tag: "MissingBuildIdError";
64
- } & Readonly<A>;
65
- declare class MissingBuildIdError extends MissingBuildIdError_base<{
66
- readonly message: string;
67
- }> {}
68
- declare const MissingReleaseIdError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
69
- readonly _tag: "MissingReleaseIdError";
70
- } & Readonly<A>;
71
- declare class MissingReleaseIdError extends MissingReleaseIdError_base<{
72
- readonly message: string;
73
- }> {}
74
- declare const FileReadError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
75
- readonly _tag: "FileReadError";
76
- } & Readonly<A>;
77
- declare class FileReadError extends FileReadError_base<{
78
- readonly message: string;
79
- readonly path: string;
80
- }> {}
81
- declare const FileGlobError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
82
- readonly _tag: "FileGlobError";
83
- } & Readonly<A>;
84
- declare class FileGlobError extends FileGlobError_base<{
85
- readonly message: string;
86
- readonly pattern: string;
87
- }> {}
88
- declare const FileDeleteError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
89
- readonly _tag: "FileDeleteError";
90
- } & Readonly<A>;
91
- declare class FileDeleteError extends FileDeleteError_base<{
92
- readonly message: string;
93
- readonly path: string;
94
- }> {}
95
- declare const FileHashError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
96
- readonly _tag: "FileHashError";
97
- } & Readonly<A>;
98
- declare class FileHashError extends FileHashError_base<{
99
- readonly message: string;
100
- readonly path: string;
101
- }> {}
102
- declare const SourceControlDetectionError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
103
- readonly _tag: "SourceControlDetectionError";
104
- } & Readonly<A>;
105
- declare class SourceControlDetectionError extends SourceControlDetectionError_base<{
106
- readonly message: string;
107
- }> {}
4
+ declare const InvalidApiUrlError_base: Schema.TaggedErrorClass<InvalidApiUrlError, "InvalidApiUrlError", {
5
+ readonly _tag: Schema.tag<"InvalidApiUrlError">;
6
+ } & {
7
+ message: typeof Schema.String;
8
+ }>;
9
+ declare class InvalidApiUrlError extends InvalidApiUrlError_base {}
10
+ declare const MissingApiKeyError_base: Schema.TaggedErrorClass<MissingApiKeyError, "MissingApiKeyError", {
11
+ readonly _tag: Schema.tag<"MissingApiKeyError">;
12
+ } & {
13
+ message: typeof Schema.String;
14
+ }>;
15
+ declare class MissingApiKeyError extends MissingApiKeyError_base {}
16
+ declare const MissingSurfaceSlugError_base: Schema.TaggedErrorClass<MissingSurfaceSlugError, "MissingSurfaceSlugError", {
17
+ readonly _tag: Schema.tag<"MissingSurfaceSlugError">;
18
+ } & {
19
+ message: typeof Schema.String;
20
+ }>;
21
+ declare class MissingSurfaceSlugError extends MissingSurfaceSlugError_base {}
22
+ declare const UploadError_base: Schema.TaggedErrorClass<UploadError, "UploadError", {
23
+ readonly _tag: Schema.tag<"UploadError">;
24
+ } & {
25
+ message: typeof Schema.String;
26
+ file: Schema.optional<typeof Schema.String>;
27
+ cause: Schema.optional<typeof Schema.Defect>;
28
+ }>;
29
+ declare class UploadError extends UploadError_base {}
30
+ declare const TokenRequestError_base: Schema.TaggedErrorClass<TokenRequestError, "TokenRequestError", {
31
+ readonly _tag: Schema.tag<"TokenRequestError">;
32
+ } & {
33
+ message: typeof Schema.String;
34
+ }>;
35
+ declare class TokenRequestError extends TokenRequestError_base {}
36
+ declare const NotificationError_base: Schema.TaggedErrorClass<NotificationError, "NotificationError", {
37
+ readonly _tag: Schema.tag<"NotificationError">;
38
+ } & {
39
+ message: typeof Schema.String;
40
+ status: Schema.optional<typeof Schema.Number>;
41
+ }>;
42
+ declare class NotificationError extends NotificationError_base {}
43
+ declare const PayloadTooLargeError_base: Schema.TaggedErrorClass<PayloadTooLargeError, "PayloadTooLargeError", {
44
+ readonly _tag: Schema.tag<"PayloadTooLargeError">;
45
+ } & {
46
+ message: typeof Schema.String;
47
+ }>;
48
+ declare class PayloadTooLargeError extends PayloadTooLargeError_base {}
49
+ declare const NoDeploymentError_base: Schema.TaggedErrorClass<NoDeploymentError, "NoDeploymentError", {
50
+ readonly _tag: Schema.tag<"NoDeploymentError">;
51
+ } & {
52
+ message: typeof Schema.String;
53
+ }>;
54
+ declare class NoDeploymentError extends NoDeploymentError_base {}
55
+ declare const NoBuildIdError_base: Schema.TaggedErrorClass<NoBuildIdError, "NoBuildIdError", {
56
+ readonly _tag: Schema.tag<"NoBuildIdError">;
57
+ } & {
58
+ message: typeof Schema.String;
59
+ }>;
60
+ declare class NoBuildIdError extends NoBuildIdError_base {}
61
+ declare const WithInterfereUsageError_base: Schema.TaggedErrorClass<WithInterfereUsageError, "WithInterfereUsageError", {
62
+ readonly _tag: Schema.tag<"WithInterfereUsageError">;
63
+ } & {
64
+ message: typeof Schema.String;
65
+ }>;
66
+ declare class WithInterfereUsageError extends WithInterfereUsageError_base {}
67
+ declare const ExchangeFailedError_base: Schema.TaggedErrorClass<ExchangeFailedError, "ExchangeFailedError", {
68
+ readonly _tag: Schema.tag<"ExchangeFailedError">;
69
+ } & {
70
+ message: typeof Schema.String;
71
+ cause: Schema.optional<typeof Schema.Unknown>;
72
+ }>;
73
+ declare class ExchangeFailedError extends ExchangeFailedError_base {}
74
+ declare const MissingBuildIdError_base: Schema.TaggedErrorClass<MissingBuildIdError, "MissingBuildIdError", {
75
+ readonly _tag: Schema.tag<"MissingBuildIdError">;
76
+ } & {
77
+ message: typeof Schema.String;
78
+ }>;
79
+ declare class MissingBuildIdError extends MissingBuildIdError_base {}
80
+ declare const MissingReleaseIdError_base: Schema.TaggedErrorClass<MissingReleaseIdError, "MissingReleaseIdError", {
81
+ readonly _tag: Schema.tag<"MissingReleaseIdError">;
82
+ } & {
83
+ message: typeof Schema.String;
84
+ }>;
85
+ declare class MissingReleaseIdError extends MissingReleaseIdError_base {}
86
+ declare const FileReadError_base: Schema.TaggedErrorClass<FileReadError, "FileReadError", {
87
+ readonly _tag: Schema.tag<"FileReadError">;
88
+ } & {
89
+ message: typeof Schema.String;
90
+ path: typeof Schema.String;
91
+ }>;
92
+ declare class FileReadError extends FileReadError_base {}
93
+ declare const FileGlobError_base: Schema.TaggedErrorClass<FileGlobError, "FileGlobError", {
94
+ readonly _tag: Schema.tag<"FileGlobError">;
95
+ } & {
96
+ message: typeof Schema.String;
97
+ pattern: typeof Schema.String;
98
+ }>;
99
+ declare class FileGlobError extends FileGlobError_base {}
100
+ declare const FileDeleteError_base: Schema.TaggedErrorClass<FileDeleteError, "FileDeleteError", {
101
+ readonly _tag: Schema.tag<"FileDeleteError">;
102
+ } & {
103
+ message: typeof Schema.String;
104
+ path: typeof Schema.String;
105
+ }>;
106
+ declare class FileDeleteError extends FileDeleteError_base {}
107
+ declare const FileHashError_base: Schema.TaggedErrorClass<FileHashError, "FileHashError", {
108
+ readonly _tag: Schema.tag<"FileHashError">;
109
+ } & {
110
+ message: typeof Schema.String;
111
+ path: typeof Schema.String;
112
+ }>;
113
+ declare class FileHashError extends FileHashError_base {}
114
+ declare const SourceControlDetectionError_base: Schema.TaggedErrorClass<SourceControlDetectionError, "SourceControlDetectionError", {
115
+ readonly _tag: Schema.tag<"SourceControlDetectionError">;
116
+ } & {
117
+ message: typeof Schema.String;
118
+ }>;
119
+ declare class SourceControlDetectionError extends SourceControlDetectionError_base {}
108
120
  //#endregion
109
- export { FileDeleteError, FileGlobError, FileHashError, FileReadError, InvalidApiUrlError, InvalidSecretKeyError, MissingBuildIdError, MissingReleaseIdError, NoBuildIdError, NoDeploymentError, NotificationError, PayloadTooLargeError, SourceControlDetectionError, TokenRequestError, UploadError, WithInterfereUsageError };
121
+ export { ExchangeFailedError, FileDeleteError, FileGlobError, FileHashError, FileReadError, InvalidApiUrlError, MissingApiKeyError, MissingBuildIdError, MissingReleaseIdError, MissingSurfaceSlugError, NoBuildIdError, NoDeploymentError, NotificationError, PayloadTooLargeError, SourceControlDetectionError, TokenRequestError, UploadError, WithInterfereUsageError };
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../../../src/build/source-maps/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;cAGa,kBAAA,SAA2B;;;cAEnC;;;cAEQ,qBAAA,SAA8B;;;cAEtC;;;AANQ,cAQA,WAAA,SAAoB,gBARO,CAAA;EAEnC,SAAA,IAAA,CAAA,EAAA,MAAA;;;;cAUA;;;cAEQ,iBAAA,SAA0B;;;cAGtC;EAbY,SAAA,IAAA,EAAA,mBAAsB;AAE9B,CAAA,WAAA,EAAA,CAAA;cAaQ,iBAAA,SAA0B;;;;cAItC;;;cAEY,oBAAA,SAA6B;;;AAjB1C,cAmBK,sBAnB4B,EAAA,IAAA,CAAA,gBAAA,CAAA,MAAA,EAAA,GAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,IAAA,sBAAA,EAAA,EAAA,CAAA,CAAA,CAAA,SAAA,IAAA,GAAA,IAAA,GAAA,iBAAA,OAAA,KAAA,SAAA,MAAA,GAAA,KAAA,IAAA,IAAA,EAAA,CAAA,EAAA,EAAA,kCAAA;EAI5B,SAAA,IAAA,EAAA,mBAAA;;cAkBQ,iBAAA,SAA0B;;;cAElC;;;cAEQ,cAAA,SAAuB;;;AApBpC,cAsBK,4BAtBkC,EAAA,IAAA,CAAA,gBAAA,CAAA,MA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mappings":";;;cAAgC,uBAAA;;;;;cAEnB,kBAAA,SAA2B,uBAAA;AAAA,cAKpC,uBAAA;;;;;cAES,kBAAA,SAA2B,uBAAA;AAAA,cAKpC,4BAAA;;;;;cAES,uBAAA,SAAgC,4BAAA;AAAA,cAKzC,gBAAA;;;;;;;cAES,WAAA,SAAoB,gBAAA;AAAA,cAO7B,sBAAA;;;;;cAES,iBAAA,SAA0B,sBAAA;AAAA,cAKnC,sBAAA;;;;;;cAES,iBAAA,SAA0B,sBAAA;AAAA,cAMnC,yBAAA;;;;;cAES,oBAAA,SAA6B,yBAAA;AAAA,cAKtC,sBAAA;;;;;cAES,iBAAA,SAA0B,sBAAA;AAAA,cAKnC,mBAAA;;;;;cAES,cAAA,SAAuB,mBAAA;AAAA,cAKhC,4BAAA;;;;;cAES,uBAAA,SAAgC,4BAAA;AAAA,cAKzC,wBAAA;;;;;;cAES,mBAAA,SAA4B,wBAAA;AAAA,cAMrC,wBAAA;;;;;cAES,mBAAA,SAA4B,wBAAA;AAAA,cAKrC,0BAAA;;;;;cAES,qBAAA,SAA8B,0BAAA;AAAA,cAKvC,kBAAA;;;;;;cAES,aAAA,SAAsB,kBAAA;AAAA,cAM/B,kBAAA;;;;;;cAES,aAAA,SAAsB,kBAAA;AAAA,cAM/B,oBAAA;;;;;;cAES,eAAA,SAAwB,oBAAA;AAAA,cAMjC,kBAAA;;;;;;cAES,aAAA,SAAsB,kBAAA;AAAA,cAM/B,gCAAA;;;;;cAES,2BAAA,SAAoC,gCAAA"}
@@ -1,22 +1,46 @@
1
- import { Data } from "effect";
1
+ import { Schema } from "effect";
2
2
 
3
3
  //#region src/build/source-maps/errors.ts
4
- var InvalidApiUrlError = class extends Data.TaggedError("InvalidApiUrlError") {};
5
- var InvalidSecretKeyError = class extends Data.TaggedError("InvalidSecretKeyError") {};
6
- var UploadError = class extends Data.TaggedError("UploadError") {};
7
- var TokenRequestError = class extends Data.TaggedError("TokenRequestError") {};
8
- var NotificationError = class extends Data.TaggedError("NotificationError") {};
9
- var PayloadTooLargeError = class extends Data.TaggedError("PayloadTooLargeError") {};
10
- var NoDeploymentError = class extends Data.TaggedError("NoDeploymentError") {};
11
- var NoBuildIdError = class extends Data.TaggedError("NoBuildIdError") {};
12
- var WithInterfereUsageError = class extends Data.TaggedError("WithInterfereUsageError") {};
13
- var MissingBuildIdError = class extends Data.TaggedError("MissingBuildIdError") {};
14
- var MissingReleaseIdError = class extends Data.TaggedError("MissingReleaseIdError") {};
15
- var FileReadError = class extends Data.TaggedError("FileReadError") {};
16
- var FileGlobError = class extends Data.TaggedError("FileGlobError") {};
17
- var FileDeleteError = class extends Data.TaggedError("FileDeleteError") {};
18
- var FileHashError = class extends Data.TaggedError("FileHashError") {};
19
- var SourceControlDetectionError = class extends Data.TaggedError("SourceControlDetectionError") {};
4
+ var InvalidApiUrlError = class extends Schema.TaggedError()("InvalidApiUrlError", { message: Schema.String }) {};
5
+ var MissingApiKeyError = class extends Schema.TaggedError()("MissingApiKeyError", { message: Schema.String }) {};
6
+ var MissingSurfaceSlugError = class extends Schema.TaggedError()("MissingSurfaceSlugError", { message: Schema.String }) {};
7
+ var UploadError = class extends Schema.TaggedError()("UploadError", {
8
+ message: Schema.String,
9
+ file: Schema.optional(Schema.String),
10
+ cause: Schema.optional(Schema.Defect)
11
+ }) {};
12
+ var TokenRequestError = class extends Schema.TaggedError()("TokenRequestError", { message: Schema.String }) {};
13
+ var NotificationError = class extends Schema.TaggedError()("NotificationError", {
14
+ message: Schema.String,
15
+ status: Schema.optional(Schema.Number)
16
+ }) {};
17
+ var PayloadTooLargeError = class extends Schema.TaggedError()("PayloadTooLargeError", { message: Schema.String }) {};
18
+ var NoDeploymentError = class extends Schema.TaggedError()("NoDeploymentError", { message: Schema.String }) {};
19
+ var NoBuildIdError = class extends Schema.TaggedError()("NoBuildIdError", { message: Schema.String }) {};
20
+ var WithInterfereUsageError = class extends Schema.TaggedError()("WithInterfereUsageError", { message: Schema.String }) {};
21
+ var ExchangeFailedError = class extends Schema.TaggedError()("ExchangeFailedError", {
22
+ message: Schema.String,
23
+ cause: Schema.optional(Schema.Unknown)
24
+ }) {};
25
+ var MissingBuildIdError = class extends Schema.TaggedError()("MissingBuildIdError", { message: Schema.String }) {};
26
+ var MissingReleaseIdError = class extends Schema.TaggedError()("MissingReleaseIdError", { message: Schema.String }) {};
27
+ var FileReadError = class extends Schema.TaggedError()("FileReadError", {
28
+ message: Schema.String,
29
+ path: Schema.String
30
+ }) {};
31
+ var FileGlobError = class extends Schema.TaggedError()("FileGlobError", {
32
+ message: Schema.String,
33
+ pattern: Schema.String
34
+ }) {};
35
+ var FileDeleteError = class extends Schema.TaggedError()("FileDeleteError", {
36
+ message: Schema.String,
37
+ path: Schema.String
38
+ }) {};
39
+ var FileHashError = class extends Schema.TaggedError()("FileHashError", {
40
+ message: Schema.String,
41
+ path: Schema.String
42
+ }) {};
43
+ var SourceControlDetectionError = class extends Schema.TaggedError()("SourceControlDetectionError", { message: Schema.String }) {};
20
44
 
21
45
  //#endregion
22
- export { FileDeleteError, FileGlobError, FileHashError, FileReadError, InvalidApiUrlError, InvalidSecretKeyError, MissingBuildIdError, MissingReleaseIdError, NoBuildIdError, NoDeploymentError, NotificationError, PayloadTooLargeError, SourceControlDetectionError, TokenRequestError, UploadError, WithInterfereUsageError };
46
+ export { ExchangeFailedError, FileDeleteError, FileGlobError, FileHashError, FileReadError, InvalidApiUrlError, MissingApiKeyError, MissingBuildIdError, MissingReleaseIdError, MissingSurfaceSlugError, NoBuildIdError, NoDeploymentError, NotificationError, PayloadTooLargeError, SourceControlDetectionError, TokenRequestError, UploadError, WithInterfereUsageError };
@@ -1 +1 @@
1
- {"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/build/source-maps/errors.ts"],"sourcesContent":["import { Data } from \"effect\";\n\n// API-related errors\nexport class InvalidApiUrlError extends Data.TaggedError(\"InvalidApiUrlError\")<{\n readonly message: string;\n}> {}\n\nexport class InvalidSecretKeyError extends Data.TaggedError(\"InvalidSecretKeyError\")<{\n readonly message: string;\n}> {}\n\nexport class UploadError extends Data.TaggedError(\"UploadError\")<{\n readonly file?: string;\n readonly message: string;\n readonly cause?: unknown;\n}> {}\n\nexport class TokenRequestError extends Data.TaggedError(\"TokenRequestError\")<{\n readonly message: string;\n}> {\n}\n\nexport class NotificationError extends Data.TaggedError(\"NotificationError\")<{\n readonly status?: number;\n readonly message: string;\n}> {\n}\n\nexport class PayloadTooLargeError extends Data.TaggedError(\"PayloadTooLargeError\")<{\n readonly message: string;\n}> {}\n\n// Deployment and build errors\nexport class NoDeploymentError extends Data.TaggedError(\"NoDeploymentError\")<{\n readonly message: string;\n}> {}\n\nexport class NoBuildIdError extends Data.TaggedError(\"NoBuildIdError\")<{\n readonly message: string;\n}> {}\n\n// Configuration errors\nexport class WithInterfereUsageError extends Data.TaggedError(\"WithInterfereUsageError\")<{\n readonly message: string;\n}> {}\n\nexport class MissingBuildIdError extends Data.TaggedError(\"MissingBuildIdError\")<{\n readonly message: string;\n}> {}\n\nexport class MissingReleaseIdError extends Data.TaggedError(\"MissingReleaseIdError\")<{\n readonly message: string;\n}> {}\n\n// File system operation errors\nexport class FileReadError extends Data.TaggedError(\"FileReadError\")<{\n readonly message: string;\n readonly path: string;\n}> {}\n\nexport class FileGlobError extends Data.TaggedError(\"FileGlobError\")<{\n readonly message: string;\n readonly pattern: string;\n}> {}\n\nexport class FileDeleteError extends Data.TaggedError(\"FileDeleteError\")<{\n readonly message: string;\n readonly path: string;\n}> {}\n\nexport class FileHashError extends Data.TaggedError(\"FileHashError\")<{\n readonly message: string;\n readonly path: string;\n}> {}\n\nexport class SourceControlDetectionError extends Data.TaggedError(\"SourceControlDetectionError\")<{\n readonly message: string;\n}> {}\n"],"mappings":";;;AAGA,IAAa,qBAAb,cAAwC,KAAK,YAAY,qBAAqB,CAE3E;AAEH,IAAa,wBAAb,cAA2C,KAAK,YAAY,wBAAwB,CAEjF;AAEH,IAAa,cAAb,cAAiC,KAAK,YAAY,cAAc,CAI7D;AAEH,IAAa,oBAAb,cAAuC,KAAK,YAAY,oBAAoB,CAEzE;AAGH,IAAa,oBAAb,cAAuC,KAAK,YAAY,oBAAoB,CAGzE;AAGH,IAAa,uBAAb,cAA0C,KAAK,YAAY,uBAAuB,CAE/E;AAGH,IAAa,oBAAb,cAAuC,KAAK,YAAY,oBAAoB,CAEzE;AAEH,IAAa,iBAAb,cAAoC,KAAK,YAAY,iBAAiB,CAEnE;AAGH,IAAa,0BAAb,cAA6C,KAAK,YAAY,0BAA0B,CAErF;AAEH,IAAa,sBAAb,cAAyC,KAAK,YAAY,sBAAsB,CAE7E;AAEH,IAAa,wBAAb,cAA2C,KAAK,YAAY,wBAAwB,CAEjF;AAGH,IAAa,gBAAb,cAAmC,KAAK,YAAY,gBAAgB,CAGjE;AAEH,IAAa,gBAAb,cAAmC,KAAK,YAAY,gBAAgB,CAGjE;AAEH,IAAa,kBAAb,cAAqC,KAAK,YAAY,kBAAkB,CAGrE;AAEH,IAAa,gBAAb,cAAmC,KAAK,YAAY,gBAAgB,CAGjE;AAEH,IAAa,8BAAb,cAAiD,KAAK,YAAY,8BAA8B,CAE7F"}
1
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/build/source-maps/errors.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nexport class InvalidApiUrlError extends Schema.TaggedError<InvalidApiUrlError>()(\n \"InvalidApiUrlError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class MissingApiKeyError extends Schema.TaggedError<MissingApiKeyError>()(\n \"MissingApiKeyError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class MissingSurfaceSlugError extends Schema.TaggedError<MissingSurfaceSlugError>()(\n \"MissingSurfaceSlugError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class UploadError extends Schema.TaggedError<UploadError>()(\n \"UploadError\",\n {\n message: Schema.String,\n file: Schema.optional(Schema.String),\n cause: Schema.optional(Schema.Defect),\n }\n) {}\n\nexport class TokenRequestError extends Schema.TaggedError<TokenRequestError>()(\n \"TokenRequestError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class NotificationError extends Schema.TaggedError<NotificationError>()(\n \"NotificationError\",\n {\n message: Schema.String,\n status: Schema.optional(Schema.Number),\n }\n) {}\n\nexport class PayloadTooLargeError extends Schema.TaggedError<PayloadTooLargeError>()(\n \"PayloadTooLargeError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class NoDeploymentError extends Schema.TaggedError<NoDeploymentError>()(\n \"NoDeploymentError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class NoBuildIdError extends Schema.TaggedError<NoBuildIdError>()(\n \"NoBuildIdError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class WithInterfereUsageError extends Schema.TaggedError<WithInterfereUsageError>()(\n \"WithInterfereUsageError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class ExchangeFailedError extends Schema.TaggedError<ExchangeFailedError>()(\n \"ExchangeFailedError\",\n {\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n }\n) {}\n\nexport class MissingBuildIdError extends Schema.TaggedError<MissingBuildIdError>()(\n \"MissingBuildIdError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class MissingReleaseIdError extends Schema.TaggedError<MissingReleaseIdError>()(\n \"MissingReleaseIdError\",\n {\n message: Schema.String,\n }\n) {}\n\nexport class FileReadError extends Schema.TaggedError<FileReadError>()(\n \"FileReadError\",\n {\n message: Schema.String,\n path: Schema.String,\n }\n) {}\n\nexport class FileGlobError extends Schema.TaggedError<FileGlobError>()(\n \"FileGlobError\",\n {\n message: Schema.String,\n pattern: Schema.String,\n }\n) {}\n\nexport class FileDeleteError extends Schema.TaggedError<FileDeleteError>()(\n \"FileDeleteError\",\n {\n message: Schema.String,\n path: Schema.String,\n }\n) {}\n\nexport class FileHashError extends Schema.TaggedError<FileHashError>()(\n \"FileHashError\",\n {\n message: Schema.String,\n path: Schema.String,\n }\n) {}\n\nexport class SourceControlDetectionError extends Schema.TaggedError<SourceControlDetectionError>()(\n \"SourceControlDetectionError\",\n {\n message: Schema.String,\n }\n) {}\n"],"mappings":";;;AAEA,IAAa,qBAAb,cAAwC,OAAO,aAAiC,CAC9E,sBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,qBAAb,cAAwC,OAAO,aAAiC,CAC9E,sBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,0BAAb,cAA6C,OAAO,aAAsC,CACxF,2BACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,cAAb,cAAiC,OAAO,aAA0B,CAChE,eACA;CACE,SAAS,OAAO;CAChB,MAAM,OAAO,SAAS,OAAO,OAAO;CACpC,OAAO,OAAO,SAAS,OAAO,OAAO;CACtC,CACF,CAAC;AAEF,IAAa,oBAAb,cAAuC,OAAO,aAAgC,CAC5E,qBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,oBAAb,cAAuC,OAAO,aAAgC,CAC5E,qBACA;CACE,SAAS,OAAO;CAChB,QAAQ,OAAO,SAAS,OAAO,OAAO;CACvC,CACF,CAAC;AAEF,IAAa,uBAAb,cAA0C,OAAO,aAAmC,CAClF,wBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,oBAAb,cAAuC,OAAO,aAAgC,CAC5E,qBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,iBAAb,cAAoC,OAAO,aAA6B,CACtE,kBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,0BAAb,cAA6C,OAAO,aAAsC,CACxF,2BACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,sBAAb,cAAyC,OAAO,aAAkC,CAChF,uBACA;CACE,SAAS,OAAO;CAChB,OAAO,OAAO,SAAS,OAAO,QAAQ;CACvC,CACF,CAAC;AAEF,IAAa,sBAAb,cAAyC,OAAO,aAAkC,CAChF,uBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,wBAAb,cAA2C,OAAO,aAAoC,CACpF,yBACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC;AAEF,IAAa,gBAAb,cAAmC,OAAO,aAA4B,CACpE,iBACA;CACE,SAAS,OAAO;CAChB,MAAM,OAAO;CACd,CACF,CAAC;AAEF,IAAa,gBAAb,cAAmC,OAAO,aAA4B,CACpE,iBACA;CACE,SAAS,OAAO;CAChB,SAAS,OAAO;CACjB,CACF,CAAC;AAEF,IAAa,kBAAb,cAAqC,OAAO,aAA8B,CACxE,mBACA;CACE,SAAS,OAAO;CAChB,MAAM,OAAO;CACd,CACF,CAAC;AAEF,IAAa,gBAAb,cAAmC,OAAO,aAA4B,CACpE,iBACA;CACE,SAAS,OAAO;CAChB,MAAM,OAAO;CACd,CACF,CAAC;AAEF,IAAa,8BAAb,cAAiD,OAAO,aAA0C,CAChG,+BACA,EACE,SAAS,OAAO,QACjB,CACF,CAAC"}
@@ -9,7 +9,7 @@ declare function readSourceMapsFromFiles(paths: string[]): Effect.Effect<{
9
9
  hash: string;
10
10
  }[], FileReadError | FileHashError, never>;
11
11
  declare function cleanupSourceMaps(paths: string[], debug: boolean): Effect.Effect<void, never, never> | Effect.Effect<undefined, FileDeleteError, never>;
12
- declare function maybeCleanupAfterFailure(debug: boolean): Effect.Effect<void, FileGlobError | FileDeleteError, never>;
12
+ declare const maybeCleanupAfterFailure: (debug: boolean) => Effect.Effect<void, FileGlobError | FileDeleteError, never>;
13
13
  /**
14
14
  * Find all generated JavaScript files (excluding source maps)
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.mts","names":[],"sources":["../../../src/build/source-maps/files.ts"],"sourcesContent":[],"mappings":";;;;iBAqBgB,kBAAA,CAAA,GAAkB,MAAA,CAAA,iBAAA;iBAclB,uBAAA,mBAAuC,MAAA,CAAA;EAdvC,YAAA,EAAA,MAAA;EAcA,OAAA,EAAA,MAAA;;;AAAuC,iBAoCvC,iBAAA,CApCuC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AAA,MAAA,WAAA,aAAA;;;;;;;;iBA2HpB,gCAAA,CAAiC,KAAA,aAAe,MAAA,CAAA,MAAA,CAAA,MAAA,kBAAA,aAAA;;;;;iBA8ChD,oBAAA,CAAqB,KAAA,aAAe,MAAA,CAAA,MAAA"}
@@ -1,6 +1,6 @@
1
1
  import { appendBuildLogLine } from "../logger.mjs";
2
2
  import { FileDeleteError, FileGlobError, FileHashError, FileReadError } from "./errors.mjs";
3
- import { Effect } from "effect";
3
+ import { Effect, Schema } from "effect";
4
4
  import { readFile, unlink } from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import { glob } from "glob";
@@ -24,7 +24,7 @@ function findSourceMapFiles() {
24
24
  });
25
25
  }
26
26
  function readSourceMapsFromFiles(paths) {
27
- return Effect.forEach(paths, (filePath) => Effect.gen(function* () {
27
+ return Effect.forEach(paths, Effect.fn("readSourceMapFile")(function* (filePath) {
28
28
  const content = yield* Effect.tryPromise({
29
29
  try: () => readFile(filePath, "utf8"),
30
30
  catch: (error) => new FileReadError({
@@ -59,10 +59,10 @@ function cleanupSourceMaps(paths, debug) {
59
59
  file: filePath,
60
60
  success: true
61
61
  })), Effect.catchAll((error) => debug ? Effect.gen(function* () {
62
- yield* appendBuildLogLine(`Failed to delete source map file ${JSON.stringify({
62
+ yield* appendBuildLogLine(`Failed to delete source map file ${yield* Schema.encode(Schema.parseJson())({
63
63
  file: filePath,
64
64
  error: error.message
65
- })}`);
65
+ }).pipe(Effect.orDie)}`);
66
66
  return {
67
67
  file: filePath,
68
68
  success: false
@@ -74,19 +74,17 @@ function cleanupSourceMaps(paths, debug) {
74
74
  const successful = results.filter((result) => result.success).length;
75
75
  const failed = results.length - successful;
76
76
  if (successful > 0) yield* appendBuildLogLine(`Cleaned ${successful}/${paths.length} source map files`);
77
- if (failed > 0 && debug) return yield* Effect.fail(new FileDeleteError({
77
+ if (failed > 0 && debug) return yield* new FileDeleteError({
78
78
  message: `Failed to clean up ${failed} source map files - Failing the build to avoid leaking source maps to the public`,
79
79
  path: "multiple files"
80
- }));
81
- });
82
- }
83
- function maybeCleanupAfterFailure(debug) {
84
- return Effect.gen(function* () {
85
- const files = yield* findSourceMapFiles();
86
- if (files.length === 0) return;
87
- yield* cleanupSourceMaps(files, debug);
80
+ });
88
81
  });
89
82
  }
83
+ const maybeCleanupAfterFailure = Effect.fn("maybeCleanupAfterFailure")(function* (debug) {
84
+ const files = yield* findSourceMapFiles();
85
+ if (files.length === 0) return;
86
+ yield* cleanupSourceMaps(files, debug);
87
+ });
90
88
  /**
91
89
  * Find all generated JavaScript files (excluding source maps)
92
90
  */
@@ -169,7 +167,7 @@ function toPublicUrlPath(buildPath) {
169
167
  * what appears in error stack traces, making the backend framework-agnostic.
170
168
  */
171
169
  function buildSourceMapToGeneratedMapping(paths) {
172
- return Effect.forEach(paths, (filePath) => Effect.gen(function* () {
170
+ return Effect.forEach(paths, Effect.fn("buildSourceMapMapping")(function* (filePath) {
173
171
  const content = yield* Effect.tryPromise({
174
172
  try: () => readFile(filePath, "utf8"),
175
173
  catch: (error) => new FileReadError({
@@ -195,7 +193,7 @@ function buildSourceMapToGeneratedMapping(paths) {
195
193
  * @deprecated Use buildSourceMapToGeneratedMapping instead - we no longer upload JS files
196
194
  */
197
195
  function readGeneratedJsFiles(paths) {
198
- return Effect.forEach(paths, (filePath) => Effect.gen(function* () {
196
+ return Effect.forEach(paths, Effect.fn("readGeneratedJsFile")(function* (filePath) {
199
197
  const content = yield* Effect.tryPromise({
200
198
  try: () => readFile(filePath, "utf8"),
201
199
  catch: (error) => new FileReadError({
@@ -1 +1 @@
1
- {"version":3,"file":"files.mjs","names":["mapping: Record<string, string>"],"sources":["../../../src/build/source-maps/files.ts"],"sourcesContent":["import { readFile, unlink } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Effect } from \"effect\";\nimport { glob } from \"glob\";\nimport { appendBuildLogLine } from \"../logger.js\";\nimport {\n FileDeleteError,\n FileGlobError,\n FileHashError,\n FileReadError,\n} from \"./errors.js\";\n\nconst SOURCE_MAP_GLOB = \".next/**/*.js.map\";\nconst JS_GLOB = \".next/**/*.js\";\n\nasync function hashString(content: string) {\n const crypto = await import(\"crypto\");\n\n return crypto.createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nexport function findSourceMapFiles() {\n return Effect.tryPromise({\n try: () =>\n glob(SOURCE_MAP_GLOB, {\n cwd: process.cwd(),\n absolute: true,\n }),\n catch: (error) => new FileGlobError({\n message: `Failed to find source map files: ${String(error)}`,\n pattern: SOURCE_MAP_GLOB,\n }),\n });\n}\n\nexport function readSourceMapsFromFiles(paths: string[]) {\n return Effect.forEach(\n paths,\n (filePath) =>\n Effect.gen(function* () {\n const content = yield* Effect.tryPromise({\n try: () => readFile(filePath, \"utf8\"),\n catch: (error) => new FileReadError({\n message: `Failed to read file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const hash = yield* Effect.tryPromise({\n try: () => hashString(content),\n catch: (error) => new FileHashError({\n message: `Failed to hash file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const relativePath = path.relative(process.cwd(), filePath).replace(\n /\\\\/g,\n \"/\"\n );\n\n return {\n relativePath: toPublicUrlPath(relativePath),\n content,\n hash,\n };\n }),\n { concurrency: \"unbounded\" }\n );\n}\n\nexport function cleanupSourceMaps(paths: string[], debug: boolean) {\n if (paths.length === 0) {\n return Effect.void;\n }\n\n return Effect.gen(function* () {\n const results = yield* Effect.forEach(\n paths,\n (filePath) =>\n Effect.tryPromise({\n try: () => unlink(filePath),\n catch: (error) => new FileDeleteError({\n message: `Failed to delete file: ${String(error)}`,\n path: filePath,\n }),\n }).pipe(\n Effect.map(() => ({ file: filePath, success: true })),\n Effect.catchAll((error) =>\n debug\n ? Effect.gen(function* () {\n yield* appendBuildLogLine(\n `Failed to delete source map file ${JSON.stringify({\n file: filePath,\n error: error.message,\n })}`\n );\n\n return { file: filePath, success: false };\n })\n : Effect.succeed({ file: filePath, success: false })\n )\n ),\n { concurrency: \"unbounded\" }\n );\n\n const successful = results.filter((result) => result.success).length;\n const failed = results.length - successful;\n\n if (successful > 0) {\n yield* appendBuildLogLine(\n `Cleaned ${successful}/${paths.length} source map files`\n );\n }\n\n if (failed > 0 && debug) {\n return yield* Effect.fail(new FileDeleteError({\n message: `Failed to clean up ${failed} source map files - Failing the build to avoid leaking source maps to the public`,\n path: \"multiple files\",\n }));\n }\n });\n}\n\nexport function maybeCleanupAfterFailure(debug: boolean) {\n return Effect.gen(function* () {\n const files = yield* findSourceMapFiles();\n\n if (files.length === 0) {\n return;\n }\n\n yield* cleanupSourceMaps(files, debug);\n });\n}\n\n/**\n * Find all generated JavaScript files (excluding source maps)\n */\nexport function findGeneratedJsFiles() {\n return Effect.tryPromise({\n try: () =>\n glob(JS_GLOB, {\n cwd: process.cwd(),\n absolute: true,\n ignore: [\"**/*.map\"], // Exclude source map files\n }),\n catch: (error) => new FileGlobError({\n message: `Failed to find generated JS files: ${String(error)}`,\n pattern: JS_GLOB,\n }),\n });\n}\n\n/**\n * Regex to extract sourceMappingURL from JS files\n * Matches: //# sourceMappingURL = filename.js.map or //@ sourceMappingURL = filename.js.map\n */\nconst SOURCE_MAPPING_URL_REGEX = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n\nconst HTTP_PREFIX_REGEX = /^https?:\\/\\//i;\n\nfunction removeQueryString(value: string): string {\n const queryIndex = value.indexOf(\"?\");\n return queryIndex === -1 ? value : value.slice(0, queryIndex);\n}\n\nfunction normalizeReferenceSlashes(value: string): string {\n return value.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Normalize an absolute reference to the public URL path format.\n * Next.js serves .next/ directory as _next/ in URLs, so we store paths\n * in the _next/ format to match what appears in error stack traces.\n */\nfunction normalizeAbsoluteReference(value: string): string {\n const normalized = normalizeReferenceSlashes(value);\n const trimmed = normalized.replace(/^\\/+/, \"\");\n\n // If it already has _next/, extract from there (handles CDN prefixes like /prod/_next/)\n const publicIndex = trimmed.indexOf(\"_next/\");\n if (publicIndex !== -1) {\n return trimmed.slice(publicIndex);\n }\n\n // Convert .next/ build path to _next/ public URL path\n const buildIndex = trimmed.indexOf(\".next/\");\n if (buildIndex !== -1) {\n return `_next/${trimmed.slice(buildIndex + \".next/\".length)}`;\n }\n\n return trimmed;\n}\n\n/**\n * Extract sourceMappingURL reference from JS file content\n */\nfunction extractSourceMappingReference(content: string): string | null {\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n const match = SOURCE_MAPPING_URL_REGEX.exec(content);\n if (match && match[1]) {\n return match[1].trim();\n }\n return null;\n}\n\nfunction resolveSourceMapRelativePath(\n jsRelativePath: string,\n reference: string\n): string | null {\n if (!reference) {\n return null;\n }\n\n const withoutQuery = removeQueryString(reference);\n if (!withoutQuery) {\n return null;\n }\n\n const normalizedReference = normalizeReferenceSlashes(withoutQuery);\n\n if (HTTP_PREFIX_REGEX.test(normalizedReference)) {\n try {\n const url = new URL(normalizedReference);\n return normalizeAbsoluteReference(url.pathname);\n } catch {\n return normalizeAbsoluteReference(normalizedReference);\n }\n }\n\n if (normalizedReference.startsWith(\"/\")) {\n return normalizeAbsoluteReference(normalizedReference);\n }\n\n const jsDirectory = path.posix.dirname(jsRelativePath);\n const resolved = path.posix.normalize(\n path.posix.join(jsDirectory, normalizedReference)\n );\n\n return toPublicUrlPath(normalizeReferenceSlashes(resolved));\n}\n\n// Regex to convert .next/ build paths to _next/ public URL paths\nconst NEXT_BUILD_TO_PUBLIC_REGEX = /^\\.next\\//;\n\n/**\n * Convert a build path to a public URL path.\n * Next.js serves .next/ directory as _next/ in URLs.\n * So on our backend we store it as the public URL path since that's what appears in error stack traces.\n */\nfunction toPublicUrlPath(buildPath: string): string {\n return buildPath.replace(NEXT_BUILD_TO_PUBLIC_REGEX, \"_next/\");\n}\n\n/**\n * Read generated JS files and extract sourceMappingURL to build a mapping.\n * Returns a map: sourceMapFilename -> generatedJsFilePath\n * \n * Both keys and values are in public URL format (_next/...) to match\n * what appears in error stack traces, making the backend framework-agnostic.\n */\nexport function buildSourceMapToGeneratedMapping(paths: string[]) {\n return Effect.forEach(\n paths,\n (filePath) =>\n Effect.gen(function* () {\n const content = yield* Effect.tryPromise({\n try: () => readFile(filePath, \"utf8\"),\n catch: (error) => new FileReadError({\n message: `Failed to read file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const relativePath = path\n .relative(process.cwd(), filePath)\n .replace(/\\\\/g, \"/\");\n\n const sourceMapReference = extractSourceMappingReference(content);\n const sourceMapRelativePath = sourceMapReference\n ? resolveSourceMapRelativePath(relativePath, sourceMapReference)\n : null;\n\n return {\n // Convert .next/ to _next/ for public URL format\n generatedFilePath: toPublicUrlPath(relativePath),\n sourceMapRelativePath,\n };\n }),\n { concurrency: \"unbounded\" }\n ).pipe(\n Effect.map((results) => {\n // Build reverse mapping: sourceMapRelativePath -> generatedFilePath\n const mapping: Record<string, string> = {};\n for (const result of results) {\n if (result.sourceMapRelativePath) {\n mapping[result.sourceMapRelativePath] = result.generatedFilePath;\n }\n }\n return mapping;\n })\n );\n}\n\n/**\n * Read generated JS files from disk\n * @deprecated Use buildSourceMapToGeneratedMapping instead - we no longer upload JS files\n */\nexport function readGeneratedJsFiles(paths: string[]) {\n return Effect.forEach(\n paths,\n (filePath) =>\n Effect.gen(function* () {\n const content = yield* Effect.tryPromise({\n try: () => readFile(filePath, \"utf8\"),\n catch: (error) => new FileReadError({\n message: `Failed to read file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const hash = yield* Effect.tryPromise({\n try: () => hashString(content),\n catch: (error) => new FileHashError({\n message: `Failed to hash file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const relativePath = path\n .relative(process.cwd(), filePath)\n .replace(/\\\\/g, \"/\");\n\n return {\n relativePath,\n content,\n hash,\n };\n }),\n { concurrency: \"unbounded\" }\n );\n}\n\n\n\n\n"],"mappings":";;;;;;;;AAYA,MAAM,kBAAkB;AACxB,MAAM,UAAU;AAEhB,eAAe,WAAW,SAAiB;AAGzC,SAFe,MAAM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AAM;IACP,CAAC;GACH,CAAC;EAEF,MAAM,eAAe,KAClB,SAAS,QAAQ,KAAK,EAAE,SAAS,CACjC,QAAQ,OAAO,IAAI;EAEtB,MAAM,qBAAqB,8BAA8B,QAAQ;EACjE,MAAM,wBAAwB,qBAC1B,6BAA6B,cAAc,mBAAmB,GAC9D;AAEJ,SAAO;GAEL,mBAAmB,gBAAgB,aAAa;GAChD;GACD;GACD,EACJ,EAAE,aAAa,aAAa,CAC7B,CAAC,KACA,OAAO,KAAK,YAAY;EAEtB,MAAMA,UAAkC,EAAE;AAC1C,OAAK,MAAM,UAAU,QACnB,KAAI,OAAO,sBACT,SAAQ,OAAO,yBAAyB,OAAO;AAGnD,SAAO;GACP,CACH;;;;;;AAOH,SAAgB,qBAAqB,OAAiB;AACpD,QAAO,OAAO,QACZ,QACC,aACC,OAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAO,OAAO,WAAW;GACvC,WAAW,SAAS,UAAU,OAAO;GACrC,QAAQ,UAAU,IAAI,cAAc;IAClC,SAAS,wBAAwB,OAAO,MAAM;IAC9C,MAAM;IACP,CAAC;GACH,CAAC;EAEF,MAAM,OAAO,OAAO,OAAO,WAAW;GACpC,WAAW,WAAW,QAAQ;GAC9B,QAAQ,UAAU,IAAI,cAAc;IAClC,SAAS,wBAAwB,OAAO,MAAM;IAC9C,MAAM;IACP,CAAC;GACH,CAAC;AAMF,SAAO;GACL,cALmB,KAClB,SAAS,QAAQ,KAAK,EAAE,SAAS,CACjC,QAAQ,OAAO,IAAI;GAIpB;GACA;GACD;GACD,EACJ,EAAE,aAAa,aAAa,CAC7B"}
1
+ {"version":3,"file":"files.mjs","names":[],"sources":["../../../src/build/source-maps/files.ts"],"sourcesContent":["import { readFile, unlink } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Effect, Schema } from \"effect\";\nimport { glob } from \"glob\";\nimport { appendBuildLogLine } from \"../logger.js\";\nimport {\n FileDeleteError,\n FileGlobError,\n FileHashError,\n FileReadError,\n} from \"./errors.js\";\n\nconst SOURCE_MAP_GLOB = \".next/**/*.js.map\";\nconst JS_GLOB = \".next/**/*.js\";\n\nasync function hashString(content: string) {\n const crypto = await import(\"crypto\");\n\n return crypto.createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nexport function findSourceMapFiles() {\n return Effect.tryPromise({\n try: () =>\n glob(SOURCE_MAP_GLOB, {\n cwd: process.cwd(),\n absolute: true,\n }),\n catch: (error) => new FileGlobError({\n message: `Failed to find source map files: ${String(error)}`,\n pattern: SOURCE_MAP_GLOB,\n }),\n });\n}\n\nexport function readSourceMapsFromFiles(paths: string[]) {\n return Effect.forEach(\n paths,\n Effect.fn(\"readSourceMapFile\")(function* (filePath: string) {\n const content = yield* Effect.tryPromise({\n try: () => readFile(filePath, \"utf8\"),\n catch: (error) => new FileReadError({\n message: `Failed to read file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const hash = yield* Effect.tryPromise({\n try: () => hashString(content),\n catch: (error) => new FileHashError({\n message: `Failed to hash file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const relativePath = path.relative(process.cwd(), filePath).replace(\n /\\\\/g,\n \"/\"\n );\n\n return {\n relativePath: toPublicUrlPath(relativePath),\n content,\n hash,\n };\n }),\n { concurrency: \"unbounded\" }\n );\n}\n\nexport function cleanupSourceMaps(paths: string[], debug: boolean) {\n if (paths.length === 0) {\n return Effect.void;\n }\n\n return Effect.gen(function* () {\n const results = yield* Effect.forEach(\n paths,\n (filePath) =>\n Effect.tryPromise({\n try: () => unlink(filePath),\n catch: (error) => new FileDeleteError({\n message: `Failed to delete file: ${String(error)}`,\n path: filePath,\n }),\n }).pipe(\n Effect.map(() => ({ file: filePath, success: true })),\n Effect.catchAll((error) =>\n debug\n ? Effect.gen(function* () {\n const jsonMsg = yield* Schema.encode(Schema.parseJson())({\n file: filePath,\n error: error.message,\n }).pipe(Effect.orDie);\n\n yield* appendBuildLogLine(\n `Failed to delete source map file ${jsonMsg}`\n );\n\n return { file: filePath, success: false };\n })\n : Effect.succeed({ file: filePath, success: false })\n )\n ),\n { concurrency: \"unbounded\" }\n );\n\n const successful = results.filter((result) => result.success).length;\n const failed = results.length - successful;\n\n if (successful > 0) {\n yield* appendBuildLogLine(\n `Cleaned ${successful}/${paths.length} source map files`\n );\n }\n\n if (failed > 0 && debug) {\n return yield* new FileDeleteError({\n message: `Failed to clean up ${failed} source map files - Failing the build to avoid leaking source maps to the public`,\n path: \"multiple files\",\n });\n }\n });\n}\n\nexport const maybeCleanupAfterFailure = Effect.fn(\"maybeCleanupAfterFailure\")(function* (debug: boolean) {\n const files = yield* findSourceMapFiles();\n\n if (files.length === 0) {\n return;\n }\n\n yield* cleanupSourceMaps(files, debug);\n });\n\n/**\n * Find all generated JavaScript files (excluding source maps)\n */\nexport function findGeneratedJsFiles() {\n return Effect.tryPromise({\n try: () =>\n glob(JS_GLOB, {\n cwd: process.cwd(),\n absolute: true,\n ignore: [\"**/*.map\"], // Exclude source map files\n }),\n catch: (error) => new FileGlobError({\n message: `Failed to find generated JS files: ${String(error)}`,\n pattern: JS_GLOB,\n }),\n });\n}\n\n/**\n * Regex to extract sourceMappingURL from JS files\n * Matches: //# sourceMappingURL = filename.js.map or //@ sourceMappingURL = filename.js.map\n */\nconst SOURCE_MAPPING_URL_REGEX = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n\nconst HTTP_PREFIX_REGEX = /^https?:\\/\\//i;\n\nfunction removeQueryString(value: string): string {\n const queryIndex = value.indexOf(\"?\");\n return queryIndex === -1 ? value : value.slice(0, queryIndex);\n}\n\nfunction normalizeReferenceSlashes(value: string): string {\n return value.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Normalize an absolute reference to the public URL path format.\n * Next.js serves .next/ directory as _next/ in URLs, so we store paths\n * in the _next/ format to match what appears in error stack traces.\n */\nfunction normalizeAbsoluteReference(value: string): string {\n const normalized = normalizeReferenceSlashes(value);\n const trimmed = normalized.replace(/^\\/+/, \"\");\n\n // If it already has _next/, extract from there (handles CDN prefixes like /prod/_next/)\n const publicIndex = trimmed.indexOf(\"_next/\");\n if (publicIndex !== -1) {\n return trimmed.slice(publicIndex);\n }\n\n // Convert .next/ build path to _next/ public URL path\n const buildIndex = trimmed.indexOf(\".next/\");\n if (buildIndex !== -1) {\n return `_next/${trimmed.slice(buildIndex + \".next/\".length)}`;\n }\n\n return trimmed;\n}\n\n/**\n * Extract sourceMappingURL reference from JS file content\n */\nfunction extractSourceMappingReference(content: string): string | null {\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n const match = SOURCE_MAPPING_URL_REGEX.exec(content);\n if (match && match[1]) {\n return match[1].trim();\n }\n return null;\n}\n\nfunction resolveSourceMapRelativePath(\n jsRelativePath: string,\n reference: string\n): string | null {\n if (!reference) {\n return null;\n }\n\n const withoutQuery = removeQueryString(reference);\n if (!withoutQuery) {\n return null;\n }\n\n const normalizedReference = normalizeReferenceSlashes(withoutQuery);\n\n if (HTTP_PREFIX_REGEX.test(normalizedReference)) {\n try {\n const url = new URL(normalizedReference);\n return normalizeAbsoluteReference(url.pathname);\n } catch {\n return normalizeAbsoluteReference(normalizedReference);\n }\n }\n\n if (normalizedReference.startsWith(\"/\")) {\n return normalizeAbsoluteReference(normalizedReference);\n }\n\n const jsDirectory = path.posix.dirname(jsRelativePath);\n const resolved = path.posix.normalize(\n path.posix.join(jsDirectory, normalizedReference)\n );\n\n return toPublicUrlPath(normalizeReferenceSlashes(resolved));\n}\n\n// Regex to convert .next/ build paths to _next/ public URL paths\nconst NEXT_BUILD_TO_PUBLIC_REGEX = /^\\.next\\//;\n\n/**\n * Convert a build path to a public URL path.\n * Next.js serves .next/ directory as _next/ in URLs.\n * So on our backend we store it as the public URL path since that's what appears in error stack traces.\n */\nfunction toPublicUrlPath(buildPath: string): string {\n return buildPath.replace(NEXT_BUILD_TO_PUBLIC_REGEX, \"_next/\");\n}\n\n/**\n * Read generated JS files and extract sourceMappingURL to build a mapping.\n * Returns a map: sourceMapFilename -> generatedJsFilePath\n * \n * Both keys and values are in public URL format (_next/...) to match\n * what appears in error stack traces, making the backend framework-agnostic.\n */\nexport function buildSourceMapToGeneratedMapping(paths: string[]) {\n return Effect.forEach(\n paths,\n Effect.fn(\"buildSourceMapMapping\")(function* (filePath: string) {\n const content = yield* Effect.tryPromise({\n try: () => readFile(filePath, \"utf8\"),\n catch: (error) => new FileReadError({\n message: `Failed to read file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const relativePath = path\n .relative(process.cwd(), filePath)\n .replace(/\\\\/g, \"/\");\n\n const sourceMapReference = extractSourceMappingReference(content);\n const sourceMapRelativePath = sourceMapReference\n ? resolveSourceMapRelativePath(relativePath, sourceMapReference)\n : null;\n\n return {\n // Convert .next/ to _next/ for public URL format\n generatedFilePath: toPublicUrlPath(relativePath),\n sourceMapRelativePath,\n };\n }),\n { concurrency: \"unbounded\" }\n ).pipe(\n Effect.map((results) => {\n // Build reverse mapping: sourceMapRelativePath -> generatedFilePath\n const mapping: Record<string, string> = {};\n for (const result of results) {\n if (result.sourceMapRelativePath) {\n mapping[result.sourceMapRelativePath] = result.generatedFilePath;\n }\n }\n return mapping;\n })\n );\n}\n\n/**\n * Read generated JS files from disk\n * @deprecated Use buildSourceMapToGeneratedMapping instead - we no longer upload JS files\n */\nexport function readGeneratedJsFiles(paths: string[]) {\n return Effect.forEach(\n paths,\n Effect.fn(\"readGeneratedJsFile\")(function* (filePath: string) {\n const content = yield* Effect.tryPromise({\n try: () => readFile(filePath, \"utf8\"),\n catch: (error) => new FileReadError({\n message: `Failed to read file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const hash = yield* Effect.tryPromise({\n try: () => hashString(content),\n catch: (error) => new FileHashError({\n message: `Failed to hash file: ${String(error)}`,\n path: filePath,\n }),\n });\n\n const relativePath = path\n .relative(process.cwd(), filePath)\n .replace(/\\\\/g, \"/\");\n\n return {\n relativePath,\n content,\n hash,\n };\n }),\n { concurrency: \"unbounded\" }\n );\n}\n\n\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../../errors.mjs";
2
2
  import { Effect } from "effect";
3
3
 
4
4
  //#region src/build/source-maps/providers/deployment/detector.d.ts
5
- declare function detectDeployment(): Effect.Effect<{
6
- type: "vercel";
5
+ declare const detectDeployment: () => Effect.Effect<{
6
+ name: "vercel";
7
7
  metadata: {
8
- type: "vercel";
9
- deployment: {
10
- id: string | null;
11
- url: string | null;
12
- };
13
- env: {
14
- name: string | null;
15
- target: string | null;
16
- };
17
- project: {
18
- id: string | null;
19
- productionUrl: string | null;
20
- };
21
- region: string | null;
22
- skewProtectionEnabled: boolean | null;
8
+ environment: string | null;
9
+ deploymentId: string | null;
10
+ deploymentUrl: string | null;
11
+ environmentName: string | null;
12
+ environmentTarget: string | null;
13
+ provider: "vercel";
23
14
  };
24
15
  }, NoDeploymentError, never>;
25
16
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"detector.d.mts","names":[],"sources":["../../../../../src/build/source-maps/providers/deployment/detector.ts"],"sourcesContent":[],"mappings":";;;;iBAQgB,gBAAA,CAAA,GAAgB,MAAA,CAAA;;EAAhB,QAAA,EAAA;;;;;;;;;;;;;;;;;GAAgB"}
1
+ {"version":3,"file":"detector.d.mts","names":[],"sources":["../../../../../src/build/source-maps/providers/deployment/detector.ts"],"mappings":";;;;cAQa,gBAAA,QAAgB,MAAA,CAAA,MAAA;;;;;;;;;;GAmB3B,iBAAA"}
@@ -4,19 +4,17 @@ import { Effect } from "effect";
4
4
 
5
5
  //#region src/build/source-maps/providers/deployment/detector.ts
6
6
  const providers = [vercelProvider];
7
- function detectDeployment() {
8
- return Effect.gen(function* () {
9
- for (const provider of providers) {
10
- if (!(yield* provider.detect)) continue;
11
- const metadata = yield* provider.getMetadata;
12
- return {
13
- type: provider.type,
14
- metadata
15
- };
16
- }
17
- return yield* Effect.fail(new NoDeploymentError({ message: `No source map deployment provider detected, supported providers: ${providers.map((p) => p.type).join(", ")}` }));
18
- });
19
- }
7
+ const detectDeployment = Effect.fn("detectDeployment")(function* () {
8
+ for (const provider of providers) {
9
+ if (!(yield* provider.detect)) continue;
10
+ const metadata = yield* provider.getMetadata;
11
+ return {
12
+ name: provider.name,
13
+ metadata
14
+ };
15
+ }
16
+ return yield* new NoDeploymentError({ message: `No source map deployment provider detected, supported providers: ${providers.map((p) => p.name).join(", ")}` });
17
+ });
20
18
 
21
19
  //#endregion
22
20
  export { detectDeployment };
@@ -1 +1 @@
1
- {"version":3,"file":"detector.mjs","names":["providers: DeploymentProvider[]"],"sources":["../../../../../src/build/source-maps/providers/deployment/detector.ts"],"sourcesContent":["import { Effect } from \"effect\";\n\nimport { NoDeploymentError } from \"../../errors.js\";\nimport type { DeploymentProvider } from \"./types.js\";\nimport { vercelProvider } from \"./vercel.js\";\n\nconst providers: DeploymentProvider[] = [vercelProvider];\n\nexport function detectDeployment() {\n return Effect.gen(function* () {\n for (const provider of providers) {\n const supported = yield* provider.detect;\n\n if (!supported) {\n continue;\n }\n\n const metadata = yield* provider.getMetadata;\n\n return {\n type: provider.type,\n metadata: metadata,\n };\n }\n\n return yield* Effect.fail(\n new NoDeploymentError({ message: `No source map deployment provider detected, supported providers: ${providers.map((p) => p.type).join(\", \")}` })\n );\n });\n}\n\n\n"],"mappings":";;;;;AAMA,MAAMA,YAAkC,CAAC,eAAe;AAExD,SAAgB,mBAAmB;AACjC,QAAO,OAAO,IAAI,aAAa;AAC7B,OAAK,MAAM,YAAY,WAAW;AAGhC,OAAI,EAFc,OAAO,SAAS,QAGhC;GAGF,MAAM,WAAW,OAAO,SAAS;AAEjC,UAAO;IACL,MAAM,SAAS;IACL;IACX;;AAGH,SAAO,OAAO,OAAO,KACnB,IAAI,kBAAkB,EAAE,SAAS,oEAAoE,UAAU,KAAK,MAAM,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAClJ;GACD"}
1
+ {"version":3,"file":"detector.mjs","names":[],"sources":["../../../../../src/build/source-maps/providers/deployment/detector.ts"],"sourcesContent":["import { Effect } from \"effect\";\n\nimport { NoDeploymentError } from \"../../errors.js\";\nimport type { DeploymentProvider } from \"./types.js\";\nimport { vercelProvider } from \"./vercel.js\";\n\nconst providers: DeploymentProvider[] = [vercelProvider];\n\nexport const detectDeployment = Effect.fn(\"detectDeployment\")(function* () {\n for (const provider of providers) {\n const supported = yield* provider.detect;\n\n if (!supported) {\n continue;\n }\n\n const metadata = yield* provider.getMetadata;\n\n return {\n name: provider.name,\n metadata,\n };\n }\n\n return yield* new NoDeploymentError({\n message: `No source map deployment provider detected, supported providers: ${providers.map((p) => p.name).join(\", \")}`,\n });\n});\n"],"mappings":";;;;;AAMA,MAAM,YAAkC,CAAC,eAAe;AAExD,MAAa,mBAAmB,OAAO,GAAG,mBAAmB,CAAC,aAAa;AACzE,MAAK,MAAM,YAAY,WAAW;AAGhC,MAAI,EAFc,OAAO,SAAS,QAGhC;EAGF,MAAM,WAAW,OAAO,SAAS;AAE/B,SAAO;GACL,MAAM,SAAS;GACf;GACD;;AAGH,QAAO,OAAO,IAAI,kBAAkB,EAClC,SAAS,oEAAoE,UAAU,KAAK,MAAM,EAAE,KAAK,CAAC,KAAK,KAAK,IACvH,CAAC;EACF"}