@claudeye/linux-arm64 1.0.4-beta.9 → 1.0.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dist/action-registry.d.ts +2 -2
- package/assets/dist/action-registry.js +1 -1
- package/assets/dist/action-runner.d.ts +2 -2
- package/assets/dist/action-runner.js +1 -1
- package/assets/dist/action-types.d.ts +19 -0
- package/assets/dist/app.d.ts +2 -1
- package/assets/dist/app.js +1 -1
- package/assets/dist/index.d.ts +1 -1
- package/assets/standalone/.next/BUILD_ID +1 -1
- package/assets/standalone/.next/build-manifest.json +2 -2
- package/assets/standalone/.next/prerender-manifest.json +3 -3
- package/assets/standalone/.next/required-server-files.json +0 -3
- package/assets/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/_global-error.html +2 -2
- package/assets/standalone/.next/server/app/_global-error.rsc +7 -7
- package/assets/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/assets/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/assets/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/assets/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/assets/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/assets/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/assets/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/_not-found.html +2 -2
- package/assets/standalone/.next/server/app/_not-found.rsc +14 -14
- package/assets/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/assets/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/assets/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
- package/assets/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/assets/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/assets/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/assets/standalone/.next/server/app/api/completed-history/route.js +1 -1
- package/assets/standalone/.next/server/app/api/queue-item/route.js +2 -2
- package/assets/standalone/.next/server/app/api/queue-status/route.js +1 -1
- package/assets/standalone/.next/server/app/dashboard/[viewName]/page/server-reference-manifest.json +4 -4
- package/assets/standalone/.next/server/app/dashboard/[viewName]/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/dashboard/page/server-reference-manifest.json +4 -4
- package/assets/standalone/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/login/page/server-reference-manifest.json +2 -2
- package/assets/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/login.html +2 -2
- package/assets/standalone/.next/server/app/login.rsc +15 -15
- package/assets/standalone/.next/server/app/login.segments/_full.segment.rsc +15 -15
- package/assets/standalone/.next/server/app/login.segments/_head.segment.rsc +4 -4
- package/assets/standalone/.next/server/app/login.segments/_index.segment.rsc +9 -9
- package/assets/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/assets/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/assets/standalone/.next/server/app/login.segments/login.segment.rsc +3 -3
- package/assets/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/assets/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/assets/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +8 -8
- package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +2 -2
- package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/app/queue/page/server-reference-manifest.json +3 -3
- package/assets/standalone/.next/server/app/queue/page.js +2 -2
- package/assets/standalone/.next/server/app/queue/page_client-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/chunks/{[externals]_next_dist_db0236a7._.js → [externals]__06cd15c5._.js} +2 -2
- package/assets/standalone/.next/server/chunks/[externals]__10373a08._.js +3 -0
- package/assets/standalone/.next/server/chunks/[externals]__d78bcb54._.js +3 -0
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__067f11b8._.js +3 -0
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__22ffcb4e._.js +3 -0
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__3232b9b5._.js → [root-of-the-server]__292809cf._.js} +1 -1
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__bf0c3d33._.js → [root-of-the-server]__3c3ad1da._.js} +4 -4
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__6d076258._.js → [root-of-the-server]__43c4e0bc._.js} +1 -1
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__6fc9da2e._.js → [root-of-the-server]__7c44135a._.js} +1 -1
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__ffb39c82._.js → [root-of-the-server]__939bf5b3._.js} +2 -2
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__fe48bb1c._.js → [root-of-the-server]__bd194a73._.js} +2 -2
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__b2f1c82c._.js → [root-of-the-server]__ca12b24d._.js} +2 -2
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__d7355d04._.js +1 -1
- package/assets/standalone/.next/server/chunks/{[root-of-the-server]__255e6fbc._.js → [root-of-the-server]__dcb3f873._.js} +1 -1
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__e3e9ab09._.js +4 -0
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__f26a70d1._.js +3 -0
- package/assets/standalone/.next/server/chunks/_3f3c09bf._.js +2 -2
- package/assets/standalone/.next/server/chunks/_5336fde9._.js +3 -0
- package/assets/standalone/.next/server/chunks/_7e07bbd9._.js +1 -1
- package/assets/standalone/.next/server/chunks/_8f856fad._.js +1 -1
- package/assets/standalone/.next/server/chunks/{_717db053._.js → _b7316450._.js} +1 -1
- package/assets/standalone/.next/server/chunks/_b8adaa37._.js +1 -1
- package/assets/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7a66d362.js +1 -1
- package/assets/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_05ab10df._.js +3 -0
- package/assets/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_20debb74._.js +3 -0
- package/assets/standalone/.next/server/chunks/package_json_4b1b4d6f._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/[externals]__10373a08._.js +3 -0
- package/assets/standalone/.next/server/chunks/ssr/{[root-of-the-server]__16a44ef3._.js → [root-of-the-server]__acea31a9._.js} +3 -3
- package/assets/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10ac3567._.js → [root-of-the-server]__c3591792._.js} +3 -3
- package/assets/standalone/.next/server/chunks/ssr/_14858238._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/_19a3e694._.js +2 -2
- package/assets/standalone/.next/server/chunks/ssr/_1d335924._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/_3dacef09._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/_617143fc._.js +2 -2
- package/assets/standalone/.next/server/chunks/ssr/_76ab933f._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/_7ae321cd._.js +2 -2
- package/assets/standalone/.next/server/chunks/ssr/_87e025a1._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/_986c0cdb._.js +2 -2
- package/assets/standalone/.next/server/chunks/ssr/_c9400c33._.js +2 -2
- package/assets/standalone/.next/server/chunks/ssr/_d7159840._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/_fa9c2bed._.js +2 -2
- package/assets/standalone/.next/server/chunks/ssr/app_actions_compute-dashboard_ts_fc151dbb._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/app_login_page_tsx_ccc0019b._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/app_queue_queue-client_tsx_45f040f7._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/node_modules_next_dist_274ac3eb._.js +1 -1
- package/assets/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_8222e100._.js +3 -0
- package/assets/standalone/.next/server/instrumentation.js +1 -1
- package/assets/standalone/.next/server/middleware.js +2 -2
- package/assets/standalone/.next/server/pages/404.html +2 -2
- package/assets/standalone/.next/server/pages/500.html +2 -2
- package/assets/standalone/.next/server/server-reference-manifest.js +1 -1
- package/assets/standalone/.next/server/server-reference-manifest.json +15 -15
- package/assets/standalone/.next/static/chunks/0855754ca80d2f07.css +1 -0
- package/assets/standalone/.next/static/chunks/{d2be314c3ece3fbe.js → 2b423cf30d3964a3.js} +1 -1
- package/assets/standalone/.next/static/chunks/{fd8c1fc19ac30592.js → 3826bccba113385b.js} +1 -1
- package/assets/standalone/.next/static/chunks/39fdd579be4356e0.js +4 -0
- package/assets/standalone/.next/static/chunks/{723f2367261046f4.js → 4e23cf768a2aa008.js} +1 -1
- package/assets/standalone/.next/static/chunks/{97c295191089a1c2.js → 5920eabcfc97a878.js} +1 -1
- package/assets/standalone/.next/static/chunks/{dbec35204e8940b4.js → 7bf119d77ec82f51.js} +1 -1
- package/assets/standalone/.next/static/chunks/80f2a062dcfc0537.js +1 -0
- package/assets/standalone/.next/static/chunks/{27fc246b001f7ba2.js → e4450da5dcaeb91e.js} +1 -1
- package/assets/standalone/README.md +39 -1
- package/assets/standalone/instrumentation.node.ts +54 -0
- package/assets/standalone/package.json +3 -2
- package/assets/standalone/server.js +1 -1
- package/bin/claudeye +0 -0
- package/package.json +1 -1
- package/assets/standalone/.next/server/chunks/[externals]_posthog-node_4a68be38._.js +0 -3
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__19c9c5af._.js +0 -4
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__365c750b._.js +0 -3
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__4ea757c2._.js +0 -3
- package/assets/standalone/.next/server/chunks/[root-of-the-server]__c84cf1dc._.js +0 -3
- package/assets/standalone/.next/server/chunks/ssr/[externals]_posthog-node_4a68be38._.js +0 -3
- package/assets/standalone/.next/static/chunks/13ab76b2fb94bd45.js +0 -1
- package/assets/standalone/.next/static/chunks/3346a6085951648c.js +0 -4
- package/assets/standalone/.next/static/chunks/98ef6309c816722d.css +0 -1
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs +0 -34
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs +0 -31
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs +0 -27
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs +0 -18
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs +0 -17
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs +0 -8
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs +0 -51
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs +0 -15
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs +0 -25
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs +0 -29
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs +0 -18
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs +0 -112
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/index.mjs +0 -4
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs +0 -14
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs +0 -27
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs +0 -24
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs +0 -47
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs +0 -65
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs +0 -12
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs +0 -13
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs +0 -7
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/types.mjs +0 -9
- package/assets/standalone/node_modules/@posthog/core/dist/error-tracking/utils.mjs +0 -23
- package/assets/standalone/node_modules/@posthog/core/dist/eventemitter.mjs +0 -18
- package/assets/standalone/node_modules/@posthog/core/dist/featureFlagUtils.mjs +0 -113
- package/assets/standalone/node_modules/@posthog/core/dist/gzip.mjs +0 -18
- package/assets/standalone/node_modules/@posthog/core/dist/index.mjs +0 -9
- package/assets/standalone/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +0 -676
- package/assets/standalone/node_modules/@posthog/core/dist/posthog-core.mjs +0 -761
- package/assets/standalone/node_modules/@posthog/core/dist/surveys/validation.mjs +0 -33
- package/assets/standalone/node_modules/@posthog/core/dist/types.mjs +0 -137
- package/assets/standalone/node_modules/@posthog/core/dist/utils/bot-detection.mjs +0 -88
- package/assets/standalone/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs +0 -41
- package/assets/standalone/node_modules/@posthog/core/dist/utils/index.mjs +0 -59
- package/assets/standalone/node_modules/@posthog/core/dist/utils/logger.mjs +0 -38
- package/assets/standalone/node_modules/@posthog/core/dist/utils/number-utils.mjs +0 -41
- package/assets/standalone/node_modules/@posthog/core/dist/utils/promise-queue.mjs +0 -27
- package/assets/standalone/node_modules/@posthog/core/dist/utils/string-utils.mjs +0 -31
- package/assets/standalone/node_modules/@posthog/core/dist/utils/type-utils.mjs +0 -82
- package/assets/standalone/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs +0 -338
- package/assets/standalone/node_modules/@posthog/core/dist/vendor/uuidv7.mjs +0 -170
- package/assets/standalone/node_modules/@posthog/core/package.json +0 -69
- package/assets/standalone/node_modules/posthog-node/dist/client.mjs +0 -718
- package/assets/standalone/node_modules/posthog-node/dist/entrypoints/index.node.mjs +0 -26
- package/assets/standalone/node_modules/posthog-node/dist/exports.mjs +0 -5
- package/assets/standalone/node_modules/posthog-node/dist/extensions/context/context.mjs +0 -28
- package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs +0 -31
- package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs +0 -69
- package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.js +0 -227
- package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs +0 -187
- package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.js +0 -64
- package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs +0 -30
- package/assets/standalone/node_modules/posthog-node/dist/extensions/express.mjs +0 -32
- package/assets/standalone/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs +0 -8
- package/assets/standalone/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs +0 -772
- package/assets/standalone/node_modules/posthog-node/dist/extensions/sentry-integration.mjs +0 -72
- package/assets/standalone/node_modules/posthog-node/dist/storage-memory.mjs +0 -12
- package/assets/standalone/node_modules/posthog-node/dist/types.mjs +0 -7
- package/assets/standalone/node_modules/posthog-node/dist/version.mjs +0 -2
- package/assets/standalone/node_modules/posthog-node/package.json +0 -105
- /package/assets/standalone/.next/static/{J4fam3sTS7cM1hFzhpIJy → UALK5GtGBmAYPFKKF1DCr}/_buildManifest.js +0 -0
- /package/assets/standalone/.next/static/{J4fam3sTS7cM1hFzhpIJy → UALK5GtGBmAYPFKKF1DCr}/_clientMiddlewareManifest.json +0 -0
- /package/assets/standalone/.next/static/{J4fam3sTS7cM1hFzhpIJy → UALK5GtGBmAYPFKKF1DCr}/_ssgManifest.js +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createModulerModifier } from "../extensions/error-tracking/modifiers/module.node.mjs";
|
|
2
|
-
import { addSourceContext } from "../extensions/error-tracking/modifiers/context-lines.node.mjs";
|
|
3
|
-
import error_tracking from "../extensions/error-tracking/index.mjs";
|
|
4
|
-
import { PostHogBackendClient } from "../client.mjs";
|
|
5
|
-
import { ErrorTracking } from "@posthog/core";
|
|
6
|
-
import { PostHogContext } from "../extensions/context/context.mjs";
|
|
7
|
-
export * from "../exports.mjs";
|
|
8
|
-
error_tracking.errorPropertiesBuilder = new ErrorTracking.ErrorPropertiesBuilder([
|
|
9
|
-
new ErrorTracking.EventCoercer(),
|
|
10
|
-
new ErrorTracking.ErrorCoercer(),
|
|
11
|
-
new ErrorTracking.ObjectCoercer(),
|
|
12
|
-
new ErrorTracking.StringCoercer(),
|
|
13
|
-
new ErrorTracking.PrimitiveCoercer()
|
|
14
|
-
], ErrorTracking.createStackParser("node:javascript", ErrorTracking.nodeStackLineParser), [
|
|
15
|
-
createModulerModifier(),
|
|
16
|
-
addSourceContext
|
|
17
|
-
]);
|
|
18
|
-
class PostHog extends PostHogBackendClient {
|
|
19
|
-
getLibraryId() {
|
|
20
|
-
return 'posthog-node';
|
|
21
|
-
}
|
|
22
|
-
initializeContext() {
|
|
23
|
-
return new PostHogContext();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export { PostHog };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
class PostHogContext {
|
|
3
|
-
constructor(){
|
|
4
|
-
this.storage = new AsyncLocalStorage();
|
|
5
|
-
}
|
|
6
|
-
get() {
|
|
7
|
-
return this.storage.getStore();
|
|
8
|
-
}
|
|
9
|
-
run(context, fn, options) {
|
|
10
|
-
return this.storage.run(this.resolve(context, options), fn);
|
|
11
|
-
}
|
|
12
|
-
enter(context, options) {
|
|
13
|
-
this.storage.enterWith(this.resolve(context, options));
|
|
14
|
-
}
|
|
15
|
-
resolve(context, options) {
|
|
16
|
-
if (options?.fresh === true) return context;
|
|
17
|
-
const current = this.get() || {};
|
|
18
|
-
return {
|
|
19
|
-
distinctId: context.distinctId ?? current.distinctId,
|
|
20
|
-
sessionId: context.sessionId ?? current.sessionId,
|
|
21
|
-
properties: {
|
|
22
|
-
...current.properties || {},
|
|
23
|
-
...context.properties || {}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export { PostHogContext };
|
package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2
|
-
let calledFatalError = false;
|
|
3
|
-
return Object.assign((error)=>{
|
|
4
|
-
const userProvidedListenersCount = global.process.listeners('uncaughtException').filter((listener)=>'domainUncaughtExceptionClear' !== listener.name && true !== listener._posthogErrorHandler).length;
|
|
5
|
-
const processWouldExit = 0 === userProvidedListenersCount;
|
|
6
|
-
captureFn(error, {
|
|
7
|
-
mechanism: {
|
|
8
|
-
type: 'onuncaughtexception',
|
|
9
|
-
handled: false
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
if (!calledFatalError && processWouldExit) {
|
|
13
|
-
calledFatalError = true;
|
|
14
|
-
onFatalFn(error);
|
|
15
|
-
}
|
|
16
|
-
}, {
|
|
17
|
-
_posthogErrorHandler: true
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function addUncaughtExceptionListener(captureFn, onFatalFn) {
|
|
21
|
-
globalThis.process?.on('uncaughtException', makeUncaughtExceptionHandler(captureFn, onFatalFn));
|
|
22
|
-
}
|
|
23
|
-
function addUnhandledRejectionListener(captureFn) {
|
|
24
|
-
globalThis.process?.on('unhandledRejection', (reason)=>captureFn(reason, {
|
|
25
|
-
mechanism: {
|
|
26
|
-
type: 'onunhandledrejection',
|
|
27
|
-
handled: false
|
|
28
|
-
}
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
export { addUncaughtExceptionListener, addUnhandledRejectionListener };
|
package/assets/standalone/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { addUncaughtExceptionListener, addUnhandledRejectionListener } from "./autocapture.mjs";
|
|
2
|
-
import { BucketedRateLimiter, isObject, uuidv7 } from "@posthog/core";
|
|
3
|
-
const SHUTDOWN_TIMEOUT = 2000;
|
|
4
|
-
class ErrorTracking {
|
|
5
|
-
constructor(client, options, _logger){
|
|
6
|
-
this.client = client;
|
|
7
|
-
this._exceptionAutocaptureEnabled = options.enableExceptionAutocapture || false;
|
|
8
|
-
this._logger = _logger;
|
|
9
|
-
this._rateLimiter = new BucketedRateLimiter({
|
|
10
|
-
refillRate: 1,
|
|
11
|
-
bucketSize: 10,
|
|
12
|
-
refillInterval: 10000,
|
|
13
|
-
_logger: this._logger
|
|
14
|
-
});
|
|
15
|
-
this.startAutocaptureIfEnabled();
|
|
16
|
-
}
|
|
17
|
-
static isPreviouslyCapturedError(x) {
|
|
18
|
-
return isObject(x) && '__posthog_previously_captured_error' in x && true === x.__posthog_previously_captured_error;
|
|
19
|
-
}
|
|
20
|
-
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
21
|
-
const properties = {
|
|
22
|
-
...additionalProperties
|
|
23
|
-
};
|
|
24
|
-
if (!distinctId) properties.$process_person_profile = false;
|
|
25
|
-
const exceptionProperties = this.errorPropertiesBuilder.buildFromUnknown(error, hint);
|
|
26
|
-
exceptionProperties.$exception_list = await this.errorPropertiesBuilder.modifyFrames(exceptionProperties.$exception_list);
|
|
27
|
-
return {
|
|
28
|
-
event: '$exception',
|
|
29
|
-
distinctId: distinctId || uuidv7(),
|
|
30
|
-
properties: {
|
|
31
|
-
...exceptionProperties,
|
|
32
|
-
...properties
|
|
33
|
-
},
|
|
34
|
-
_originatedFromCaptureException: true
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
startAutocaptureIfEnabled() {
|
|
38
|
-
if (this.isEnabled()) {
|
|
39
|
-
addUncaughtExceptionListener(this.onException.bind(this), this.onFatalError.bind(this));
|
|
40
|
-
addUnhandledRejectionListener(this.onException.bind(this));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
onException(exception, hint) {
|
|
44
|
-
this.client.addPendingPromise((async ()=>{
|
|
45
|
-
if (!ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
46
|
-
const eventMessage = await ErrorTracking.buildEventMessage(exception, hint);
|
|
47
|
-
const exceptionProperties = eventMessage.properties;
|
|
48
|
-
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? 'Exception';
|
|
49
|
-
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
50
|
-
if (isRateLimited) return void this._logger.info('Skipping exception capture because of client rate limiting.', {
|
|
51
|
-
exception: exceptionType
|
|
52
|
-
});
|
|
53
|
-
return this.client.capture(eventMessage);
|
|
54
|
-
}
|
|
55
|
-
})());
|
|
56
|
-
}
|
|
57
|
-
async onFatalError(exception) {
|
|
58
|
-
console.error(exception);
|
|
59
|
-
await this.client.shutdown(SHUTDOWN_TIMEOUT);
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
isEnabled() {
|
|
63
|
-
return !this.client.isDisabled && this._exceptionAutocaptureEnabled;
|
|
64
|
-
}
|
|
65
|
-
shutdown() {
|
|
66
|
-
this._rateLimiter.stop();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export { ErrorTracking as default };
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
MAX_CONTEXTLINES_LINENO: ()=>MAX_CONTEXTLINES_LINENO,
|
|
28
|
-
MAX_CONTEXTLINES_COLNO: ()=>MAX_CONTEXTLINES_COLNO,
|
|
29
|
-
addSourceContext: ()=>addSourceContext
|
|
30
|
-
});
|
|
31
|
-
const core_namespaceObject = require("@posthog/core");
|
|
32
|
-
const external_node_fs_namespaceObject = require("node:fs");
|
|
33
|
-
const external_node_readline_namespaceObject = require("node:readline");
|
|
34
|
-
const LRU_FILE_CONTENTS_CACHE = new core_namespaceObject.ErrorTracking.ReduceableCache(25);
|
|
35
|
-
const LRU_FILE_CONTENTS_FS_READ_FAILED = new core_namespaceObject.ErrorTracking.ReduceableCache(20);
|
|
36
|
-
const DEFAULT_LINES_OF_CONTEXT = 7;
|
|
37
|
-
const MAX_CONTEXTLINES_COLNO = 1000;
|
|
38
|
-
const MAX_CONTEXTLINES_LINENO = 10000;
|
|
39
|
-
async function addSourceContext(frames) {
|
|
40
|
-
const filesToLines = {};
|
|
41
|
-
for(let i = frames.length - 1; i >= 0; i--){
|
|
42
|
-
const frame = frames[i];
|
|
43
|
-
const filename = frame?.filename;
|
|
44
|
-
if (!frame || 'string' != typeof filename || 'number' != typeof frame.lineno || shouldSkipContextLinesForFile(filename) || shouldSkipContextLinesForFrame(frame)) continue;
|
|
45
|
-
const filesToLinesOutput = filesToLines[filename];
|
|
46
|
-
if (!filesToLinesOutput) filesToLines[filename] = [];
|
|
47
|
-
filesToLines[filename].push(frame.lineno);
|
|
48
|
-
}
|
|
49
|
-
const files = Object.keys(filesToLines);
|
|
50
|
-
if (0 == files.length) return frames;
|
|
51
|
-
const readlinePromises = [];
|
|
52
|
-
for (const file of files){
|
|
53
|
-
if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) continue;
|
|
54
|
-
const filesToLineRanges = filesToLines[file];
|
|
55
|
-
if (!filesToLineRanges) continue;
|
|
56
|
-
filesToLineRanges.sort((a, b)=>a - b);
|
|
57
|
-
const ranges = makeLineReaderRanges(filesToLineRanges);
|
|
58
|
-
if (ranges.every((r)=>rangeExistsInContentCache(file, r))) continue;
|
|
59
|
-
const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});
|
|
60
|
-
readlinePromises.push(getContextLinesFromFile(file, ranges, cache));
|
|
61
|
-
}
|
|
62
|
-
await Promise.all(readlinePromises).catch(()=>{});
|
|
63
|
-
if (frames && frames.length > 0) addSourceContextToFrames(frames, LRU_FILE_CONTENTS_CACHE);
|
|
64
|
-
LRU_FILE_CONTENTS_CACHE.reduce();
|
|
65
|
-
return frames;
|
|
66
|
-
}
|
|
67
|
-
function getContextLinesFromFile(path, ranges, output) {
|
|
68
|
-
return new Promise((resolve)=>{
|
|
69
|
-
const stream = (0, external_node_fs_namespaceObject.createReadStream)(path);
|
|
70
|
-
const lineReaded = (0, external_node_readline_namespaceObject.createInterface)({
|
|
71
|
-
input: stream
|
|
72
|
-
});
|
|
73
|
-
function destroyStreamAndResolve() {
|
|
74
|
-
stream.destroy();
|
|
75
|
-
resolve();
|
|
76
|
-
}
|
|
77
|
-
let lineNumber = 0;
|
|
78
|
-
let currentRangeIndex = 0;
|
|
79
|
-
const range = ranges[currentRangeIndex];
|
|
80
|
-
if (void 0 === range) return void destroyStreamAndResolve();
|
|
81
|
-
let rangeStart = range[0];
|
|
82
|
-
let rangeEnd = range[1];
|
|
83
|
-
function onStreamError() {
|
|
84
|
-
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
|
|
85
|
-
lineReaded.close();
|
|
86
|
-
lineReaded.removeAllListeners();
|
|
87
|
-
destroyStreamAndResolve();
|
|
88
|
-
}
|
|
89
|
-
stream.on('error', onStreamError);
|
|
90
|
-
lineReaded.on('error', onStreamError);
|
|
91
|
-
lineReaded.on('close', destroyStreamAndResolve);
|
|
92
|
-
lineReaded.on('line', (line)=>{
|
|
93
|
-
lineNumber++;
|
|
94
|
-
if (lineNumber < rangeStart) return;
|
|
95
|
-
output[lineNumber] = snipLine(line, 0);
|
|
96
|
-
if (lineNumber >= rangeEnd) {
|
|
97
|
-
if (currentRangeIndex === ranges.length - 1) {
|
|
98
|
-
lineReaded.close();
|
|
99
|
-
lineReaded.removeAllListeners();
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
currentRangeIndex++;
|
|
103
|
-
const range = ranges[currentRangeIndex];
|
|
104
|
-
if (void 0 === range) {
|
|
105
|
-
lineReaded.close();
|
|
106
|
-
lineReaded.removeAllListeners();
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
rangeStart = range[0];
|
|
110
|
-
rangeEnd = range[1];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function addSourceContextToFrames(frames, cache) {
|
|
116
|
-
for (const frame of frames)if (frame.filename && void 0 === frame.context_line && 'number' == typeof frame.lineno) {
|
|
117
|
-
const contents = cache.get(frame.filename);
|
|
118
|
-
if (void 0 === contents) continue;
|
|
119
|
-
addContextToFrame(frame.lineno, frame, contents);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function addContextToFrame(lineno, frame, contents) {
|
|
123
|
-
if (void 0 === frame.lineno || void 0 === contents) return;
|
|
124
|
-
frame.pre_context = [];
|
|
125
|
-
for(let i = makeRangeStart(lineno); i < lineno; i++){
|
|
126
|
-
const line = contents[i];
|
|
127
|
-
if (void 0 === line) return void clearLineContext(frame);
|
|
128
|
-
frame.pre_context.push(line);
|
|
129
|
-
}
|
|
130
|
-
if (void 0 === contents[lineno]) return void clearLineContext(frame);
|
|
131
|
-
frame.context_line = contents[lineno];
|
|
132
|
-
const end = makeRangeEnd(lineno);
|
|
133
|
-
frame.post_context = [];
|
|
134
|
-
for(let i = lineno + 1; i <= end; i++){
|
|
135
|
-
const line = contents[i];
|
|
136
|
-
if (void 0 === line) break;
|
|
137
|
-
frame.post_context.push(line);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function clearLineContext(frame) {
|
|
141
|
-
delete frame.pre_context;
|
|
142
|
-
delete frame.context_line;
|
|
143
|
-
delete frame.post_context;
|
|
144
|
-
}
|
|
145
|
-
function shouldSkipContextLinesForFile(path) {
|
|
146
|
-
return path.startsWith('node:') || path.endsWith('.min.js') || path.endsWith('.min.cjs') || path.endsWith('.min.mjs') || path.startsWith('data:');
|
|
147
|
-
}
|
|
148
|
-
function shouldSkipContextLinesForFrame(frame) {
|
|
149
|
-
if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
|
|
150
|
-
if (void 0 !== frame.colno && frame.colno > MAX_CONTEXTLINES_COLNO) return true;
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
function rangeExistsInContentCache(file, range) {
|
|
154
|
-
const contents = LRU_FILE_CONTENTS_CACHE.get(file);
|
|
155
|
-
if (void 0 === contents) return false;
|
|
156
|
-
for(let i = range[0]; i <= range[1]; i++)if (void 0 === contents[i]) return false;
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
function makeLineReaderRanges(lines) {
|
|
160
|
-
if (!lines.length) return [];
|
|
161
|
-
let i = 0;
|
|
162
|
-
const line = lines[0];
|
|
163
|
-
if ('number' != typeof line) return [];
|
|
164
|
-
let current = makeContextRange(line);
|
|
165
|
-
const out = [];
|
|
166
|
-
while(true){
|
|
167
|
-
if (i === lines.length - 1) {
|
|
168
|
-
out.push(current);
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
const next = lines[i + 1];
|
|
172
|
-
if ('number' != typeof next) break;
|
|
173
|
-
if (next <= current[1]) current[1] = next + DEFAULT_LINES_OF_CONTEXT;
|
|
174
|
-
else {
|
|
175
|
-
out.push(current);
|
|
176
|
-
current = makeContextRange(next);
|
|
177
|
-
}
|
|
178
|
-
i++;
|
|
179
|
-
}
|
|
180
|
-
return out;
|
|
181
|
-
}
|
|
182
|
-
function makeContextRange(line) {
|
|
183
|
-
return [
|
|
184
|
-
makeRangeStart(line),
|
|
185
|
-
makeRangeEnd(line)
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
function makeRangeStart(line) {
|
|
189
|
-
return Math.max(1, line - DEFAULT_LINES_OF_CONTEXT);
|
|
190
|
-
}
|
|
191
|
-
function makeRangeEnd(line) {
|
|
192
|
-
return line + DEFAULT_LINES_OF_CONTEXT;
|
|
193
|
-
}
|
|
194
|
-
function emplace(map, key, contents) {
|
|
195
|
-
const value = map.get(key);
|
|
196
|
-
if (void 0 === value) {
|
|
197
|
-
map.set(key, contents);
|
|
198
|
-
return contents;
|
|
199
|
-
}
|
|
200
|
-
return value;
|
|
201
|
-
}
|
|
202
|
-
function snipLine(line, colno) {
|
|
203
|
-
let newLine = line;
|
|
204
|
-
const lineLength = newLine.length;
|
|
205
|
-
if (lineLength <= 150) return newLine;
|
|
206
|
-
if (colno > lineLength) colno = lineLength;
|
|
207
|
-
let start = Math.max(colno - 60, 0);
|
|
208
|
-
if (start < 5) start = 0;
|
|
209
|
-
let end = Math.min(start + 140, lineLength);
|
|
210
|
-
if (end > lineLength - 5) end = lineLength;
|
|
211
|
-
if (end === lineLength) start = Math.max(end - 140, 0);
|
|
212
|
-
newLine = newLine.slice(start, end);
|
|
213
|
-
if (start > 0) newLine = `...${newLine}`;
|
|
214
|
-
if (end < lineLength) newLine += '...';
|
|
215
|
-
return newLine;
|
|
216
|
-
}
|
|
217
|
-
exports.MAX_CONTEXTLINES_COLNO = __webpack_exports__.MAX_CONTEXTLINES_COLNO;
|
|
218
|
-
exports.MAX_CONTEXTLINES_LINENO = __webpack_exports__.MAX_CONTEXTLINES_LINENO;
|
|
219
|
-
exports.addSourceContext = __webpack_exports__.addSourceContext;
|
|
220
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
221
|
-
"MAX_CONTEXTLINES_COLNO",
|
|
222
|
-
"MAX_CONTEXTLINES_LINENO",
|
|
223
|
-
"addSourceContext"
|
|
224
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
225
|
-
Object.defineProperty(exports, '__esModule', {
|
|
226
|
-
value: true
|
|
227
|
-
});
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { ErrorTracking } from "@posthog/core";
|
|
2
|
-
import { createReadStream } from "node:fs";
|
|
3
|
-
import { createInterface } from "node:readline";
|
|
4
|
-
const LRU_FILE_CONTENTS_CACHE = new ErrorTracking.ReduceableCache(25);
|
|
5
|
-
const LRU_FILE_CONTENTS_FS_READ_FAILED = new ErrorTracking.ReduceableCache(20);
|
|
6
|
-
const DEFAULT_LINES_OF_CONTEXT = 7;
|
|
7
|
-
const MAX_CONTEXTLINES_COLNO = 1000;
|
|
8
|
-
const MAX_CONTEXTLINES_LINENO = 10000;
|
|
9
|
-
async function addSourceContext(frames) {
|
|
10
|
-
const filesToLines = {};
|
|
11
|
-
for(let i = frames.length - 1; i >= 0; i--){
|
|
12
|
-
const frame = frames[i];
|
|
13
|
-
const filename = frame?.filename;
|
|
14
|
-
if (!frame || 'string' != typeof filename || 'number' != typeof frame.lineno || shouldSkipContextLinesForFile(filename) || shouldSkipContextLinesForFrame(frame)) continue;
|
|
15
|
-
const filesToLinesOutput = filesToLines[filename];
|
|
16
|
-
if (!filesToLinesOutput) filesToLines[filename] = [];
|
|
17
|
-
filesToLines[filename].push(frame.lineno);
|
|
18
|
-
}
|
|
19
|
-
const files = Object.keys(filesToLines);
|
|
20
|
-
if (0 == files.length) return frames;
|
|
21
|
-
const readlinePromises = [];
|
|
22
|
-
for (const file of files){
|
|
23
|
-
if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) continue;
|
|
24
|
-
const filesToLineRanges = filesToLines[file];
|
|
25
|
-
if (!filesToLineRanges) continue;
|
|
26
|
-
filesToLineRanges.sort((a, b)=>a - b);
|
|
27
|
-
const ranges = makeLineReaderRanges(filesToLineRanges);
|
|
28
|
-
if (ranges.every((r)=>rangeExistsInContentCache(file, r))) continue;
|
|
29
|
-
const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});
|
|
30
|
-
readlinePromises.push(getContextLinesFromFile(file, ranges, cache));
|
|
31
|
-
}
|
|
32
|
-
await Promise.all(readlinePromises).catch(()=>{});
|
|
33
|
-
if (frames && frames.length > 0) addSourceContextToFrames(frames, LRU_FILE_CONTENTS_CACHE);
|
|
34
|
-
LRU_FILE_CONTENTS_CACHE.reduce();
|
|
35
|
-
return frames;
|
|
36
|
-
}
|
|
37
|
-
function getContextLinesFromFile(path, ranges, output) {
|
|
38
|
-
return new Promise((resolve)=>{
|
|
39
|
-
const stream = createReadStream(path);
|
|
40
|
-
const lineReaded = createInterface({
|
|
41
|
-
input: stream
|
|
42
|
-
});
|
|
43
|
-
function destroyStreamAndResolve() {
|
|
44
|
-
stream.destroy();
|
|
45
|
-
resolve();
|
|
46
|
-
}
|
|
47
|
-
let lineNumber = 0;
|
|
48
|
-
let currentRangeIndex = 0;
|
|
49
|
-
const range = ranges[currentRangeIndex];
|
|
50
|
-
if (void 0 === range) return void destroyStreamAndResolve();
|
|
51
|
-
let rangeStart = range[0];
|
|
52
|
-
let rangeEnd = range[1];
|
|
53
|
-
function onStreamError() {
|
|
54
|
-
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
|
|
55
|
-
lineReaded.close();
|
|
56
|
-
lineReaded.removeAllListeners();
|
|
57
|
-
destroyStreamAndResolve();
|
|
58
|
-
}
|
|
59
|
-
stream.on('error', onStreamError);
|
|
60
|
-
lineReaded.on('error', onStreamError);
|
|
61
|
-
lineReaded.on('close', destroyStreamAndResolve);
|
|
62
|
-
lineReaded.on('line', (line)=>{
|
|
63
|
-
lineNumber++;
|
|
64
|
-
if (lineNumber < rangeStart) return;
|
|
65
|
-
output[lineNumber] = snipLine(line, 0);
|
|
66
|
-
if (lineNumber >= rangeEnd) {
|
|
67
|
-
if (currentRangeIndex === ranges.length - 1) {
|
|
68
|
-
lineReaded.close();
|
|
69
|
-
lineReaded.removeAllListeners();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
currentRangeIndex++;
|
|
73
|
-
const range = ranges[currentRangeIndex];
|
|
74
|
-
if (void 0 === range) {
|
|
75
|
-
lineReaded.close();
|
|
76
|
-
lineReaded.removeAllListeners();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
rangeStart = range[0];
|
|
80
|
-
rangeEnd = range[1];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function addSourceContextToFrames(frames, cache) {
|
|
86
|
-
for (const frame of frames)if (frame.filename && void 0 === frame.context_line && 'number' == typeof frame.lineno) {
|
|
87
|
-
const contents = cache.get(frame.filename);
|
|
88
|
-
if (void 0 === contents) continue;
|
|
89
|
-
addContextToFrame(frame.lineno, frame, contents);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function addContextToFrame(lineno, frame, contents) {
|
|
93
|
-
if (void 0 === frame.lineno || void 0 === contents) return;
|
|
94
|
-
frame.pre_context = [];
|
|
95
|
-
for(let i = makeRangeStart(lineno); i < lineno; i++){
|
|
96
|
-
const line = contents[i];
|
|
97
|
-
if (void 0 === line) return void clearLineContext(frame);
|
|
98
|
-
frame.pre_context.push(line);
|
|
99
|
-
}
|
|
100
|
-
if (void 0 === contents[lineno]) return void clearLineContext(frame);
|
|
101
|
-
frame.context_line = contents[lineno];
|
|
102
|
-
const end = makeRangeEnd(lineno);
|
|
103
|
-
frame.post_context = [];
|
|
104
|
-
for(let i = lineno + 1; i <= end; i++){
|
|
105
|
-
const line = contents[i];
|
|
106
|
-
if (void 0 === line) break;
|
|
107
|
-
frame.post_context.push(line);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function clearLineContext(frame) {
|
|
111
|
-
delete frame.pre_context;
|
|
112
|
-
delete frame.context_line;
|
|
113
|
-
delete frame.post_context;
|
|
114
|
-
}
|
|
115
|
-
function shouldSkipContextLinesForFile(path) {
|
|
116
|
-
return path.startsWith('node:') || path.endsWith('.min.js') || path.endsWith('.min.cjs') || path.endsWith('.min.mjs') || path.startsWith('data:');
|
|
117
|
-
}
|
|
118
|
-
function shouldSkipContextLinesForFrame(frame) {
|
|
119
|
-
if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
|
|
120
|
-
if (void 0 !== frame.colno && frame.colno > MAX_CONTEXTLINES_COLNO) return true;
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
function rangeExistsInContentCache(file, range) {
|
|
124
|
-
const contents = LRU_FILE_CONTENTS_CACHE.get(file);
|
|
125
|
-
if (void 0 === contents) return false;
|
|
126
|
-
for(let i = range[0]; i <= range[1]; i++)if (void 0 === contents[i]) return false;
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
function makeLineReaderRanges(lines) {
|
|
130
|
-
if (!lines.length) return [];
|
|
131
|
-
let i = 0;
|
|
132
|
-
const line = lines[0];
|
|
133
|
-
if ('number' != typeof line) return [];
|
|
134
|
-
let current = makeContextRange(line);
|
|
135
|
-
const out = [];
|
|
136
|
-
while(true){
|
|
137
|
-
if (i === lines.length - 1) {
|
|
138
|
-
out.push(current);
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
const next = lines[i + 1];
|
|
142
|
-
if ('number' != typeof next) break;
|
|
143
|
-
if (next <= current[1]) current[1] = next + DEFAULT_LINES_OF_CONTEXT;
|
|
144
|
-
else {
|
|
145
|
-
out.push(current);
|
|
146
|
-
current = makeContextRange(next);
|
|
147
|
-
}
|
|
148
|
-
i++;
|
|
149
|
-
}
|
|
150
|
-
return out;
|
|
151
|
-
}
|
|
152
|
-
function makeContextRange(line) {
|
|
153
|
-
return [
|
|
154
|
-
makeRangeStart(line),
|
|
155
|
-
makeRangeEnd(line)
|
|
156
|
-
];
|
|
157
|
-
}
|
|
158
|
-
function makeRangeStart(line) {
|
|
159
|
-
return Math.max(1, line - DEFAULT_LINES_OF_CONTEXT);
|
|
160
|
-
}
|
|
161
|
-
function makeRangeEnd(line) {
|
|
162
|
-
return line + DEFAULT_LINES_OF_CONTEXT;
|
|
163
|
-
}
|
|
164
|
-
function emplace(map, key, contents) {
|
|
165
|
-
const value = map.get(key);
|
|
166
|
-
if (void 0 === value) {
|
|
167
|
-
map.set(key, contents);
|
|
168
|
-
return contents;
|
|
169
|
-
}
|
|
170
|
-
return value;
|
|
171
|
-
}
|
|
172
|
-
function snipLine(line, colno) {
|
|
173
|
-
let newLine = line;
|
|
174
|
-
const lineLength = newLine.length;
|
|
175
|
-
if (lineLength <= 150) return newLine;
|
|
176
|
-
if (colno > lineLength) colno = lineLength;
|
|
177
|
-
let start = Math.max(colno - 60, 0);
|
|
178
|
-
if (start < 5) start = 0;
|
|
179
|
-
let end = Math.min(start + 140, lineLength);
|
|
180
|
-
if (end > lineLength - 5) end = lineLength;
|
|
181
|
-
if (end === lineLength) start = Math.max(end - 140, 0);
|
|
182
|
-
newLine = newLine.slice(start, end);
|
|
183
|
-
if (start > 0) newLine = `...${newLine}`;
|
|
184
|
-
if (end < lineLength) newLine += '...';
|
|
185
|
-
return newLine;
|
|
186
|
-
}
|
|
187
|
-
export { MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO, addSourceContext };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
createModulerModifier: ()=>createModulerModifier
|
|
28
|
-
});
|
|
29
|
-
const external_path_namespaceObject = require("path");
|
|
30
|
-
function createModulerModifier() {
|
|
31
|
-
const getModuleFromFileName = createGetModuleFromFilename();
|
|
32
|
-
return async (frames)=>{
|
|
33
|
-
for (const frame of frames)frame.module = getModuleFromFileName(frame.filename);
|
|
34
|
-
return frames;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ? (0, external_path_namespaceObject.dirname)(process.argv[1]) : process.cwd(), isWindows = '\\' === external_path_namespaceObject.sep) {
|
|
38
|
-
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
39
|
-
return (filename)=>{
|
|
40
|
-
if (!filename) return;
|
|
41
|
-
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
42
|
-
let { dir, base: file, ext } = external_path_namespaceObject.posix.parse(normalizedFilename);
|
|
43
|
-
if ('.js' === ext || '.mjs' === ext || '.cjs' === ext) file = file.slice(0, -1 * ext.length);
|
|
44
|
-
const decodedFile = decodeURIComponent(file);
|
|
45
|
-
if (!dir) dir = '.';
|
|
46
|
-
const n = dir.lastIndexOf('/node_modules');
|
|
47
|
-
if (n > -1) return `${dir.slice(n + 14).replace(/\//g, '.')}:${decodedFile}`;
|
|
48
|
-
if (dir.startsWith(normalizedBase)) {
|
|
49
|
-
const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.');
|
|
50
|
-
return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;
|
|
51
|
-
}
|
|
52
|
-
return decodedFile;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function normalizeWindowsPath(path) {
|
|
56
|
-
return path.replace(/^[A-Z]:/, '').replace(/\\/g, '/');
|
|
57
|
-
}
|
|
58
|
-
exports.createModulerModifier = __webpack_exports__.createModulerModifier;
|
|
59
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
60
|
-
"createModulerModifier"
|
|
61
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
62
|
-
Object.defineProperty(exports, '__esModule', {
|
|
63
|
-
value: true
|
|
64
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { dirname, posix, sep } from "path";
|
|
2
|
-
function createModulerModifier() {
|
|
3
|
-
const getModuleFromFileName = createGetModuleFromFilename();
|
|
4
|
-
return async (frames)=>{
|
|
5
|
-
for (const frame of frames)frame.module = getModuleFromFileName(frame.filename);
|
|
6
|
-
return frames;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname(process.argv[1]) : process.cwd(), isWindows = '\\' === sep) {
|
|
10
|
-
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
11
|
-
return (filename)=>{
|
|
12
|
-
if (!filename) return;
|
|
13
|
-
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
14
|
-
let { dir, base: file, ext } = posix.parse(normalizedFilename);
|
|
15
|
-
if ('.js' === ext || '.mjs' === ext || '.cjs' === ext) file = file.slice(0, -1 * ext.length);
|
|
16
|
-
const decodedFile = decodeURIComponent(file);
|
|
17
|
-
if (!dir) dir = '.';
|
|
18
|
-
const n = dir.lastIndexOf('/node_modules');
|
|
19
|
-
if (n > -1) return `${dir.slice(n + 14).replace(/\//g, '.')}:${decodedFile}`;
|
|
20
|
-
if (dir.startsWith(normalizedBase)) {
|
|
21
|
-
const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.');
|
|
22
|
-
return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;
|
|
23
|
-
}
|
|
24
|
-
return decodedFile;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function normalizeWindowsPath(path) {
|
|
28
|
-
return path.replace(/^[A-Z]:/, '').replace(/\\/g, '/');
|
|
29
|
-
}
|
|
30
|
-
export { createModulerModifier };
|