@logtape/sentry 1.1.0-dev.321 → 1.1.0-dev.324

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/deno.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@logtape/sentry",
3
- "version": "1.1.0-dev.321+fda84317",
3
+ "version": "1.1.0-dev.324+017000e7",
4
4
  "license": "MIT",
5
5
  "exports": {
6
- ".": "./mod.ts"
6
+ ".": "./src/mod.ts"
7
7
  },
8
8
  "imports": {
9
9
  "@sentry/core": "npm:@sentry/core@^9.28.1"
package/dist/mod.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
2
  const __sentry_core = require_rolldown_runtime.__toESM(require("@sentry/core"));
3
3
 
4
- //#region mod.ts
4
+ //#region src/mod.ts
5
5
  function getParameterizedString(record) {
6
6
  let result = "";
7
7
  let tplString = "";
package/dist/mod.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Sink } from "@logtape/logtape";
2
2
  import { Client } from "@sentry/core";
3
3
 
4
- //#region mod.d.ts
4
+ //#region src/mod.d.ts
5
5
 
6
6
  /**
7
7
  * Gets a LogTape sink that sends logs to Sentry.
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.cts","names":[],"sources":["../mod.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuDA;;;;AAAoD,iBAApC,aAAA,CAAoC,MAAA,CAAA,EAAb,MAAa,CAAA,EAAJ,IAAI"}
1
+ {"version":3,"file":"mod.d.cts","names":[],"sources":["../src/mod.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuDA;;;;AAAoD,iBAApC,aAAA,CAAoC,MAAA,CAAA,EAAb,MAAa,CAAA,EAAJ,IAAI"}
package/dist/mod.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Client } from "@sentry/core";
2
2
  import { Sink } from "@logtape/logtape";
3
3
 
4
- //#region mod.d.ts
4
+ //#region src/mod.d.ts
5
5
 
6
6
  /**
7
7
  * Gets a LogTape sink that sends logs to Sentry.
package/dist/mod.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","names":[],"sources":["../mod.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuDA;;;;AAAoD,iBAApC,aAAA,CAAoC,MAAA,CAAA,EAAb,MAAa,CAAA,EAAJ,IAAI"}
1
+ {"version":3,"file":"mod.d.ts","names":[],"sources":["../src/mod.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuDA;;;;AAAoD,iBAApC,aAAA,CAAoC,MAAA,CAAA,EAAb,MAAa,CAAA,EAAJ,IAAI"}
package/dist/mod.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getClient } from "@sentry/core";
2
2
 
3
- //#region mod.ts
3
+ //#region src/mod.ts
4
4
  function getParameterizedString(record) {
5
5
  let result = "";
6
6
  let tplString = "";
package/dist/mod.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","names":["record: LogRecord","tplValues: string[]","inspect: (value: unknown) => string","client?: Client"],"sources":["../mod.ts"],"sourcesContent":["import type { LogRecord, Sink } from \"@logtape/logtape\";\nimport { type Client, getClient, type ParameterizedString } from \"@sentry/core\";\n// deno-lint-ignore no-unused-vars\nimport type util from \"node:util\";\n\nfunction getParameterizedString(record: LogRecord): ParameterizedString {\n let result = \"\";\n let tplString = \"\";\n const tplValues: string[] = [];\n for (let i = 0; i < record.message.length; i++) {\n if (i % 2 === 0) {\n result += record.message[i];\n tplString += String(record.message[i]).replaceAll(\"%\", \"%%\");\n } else {\n const value = inspect(record.message[i]);\n result += value;\n tplString += `%s`;\n tplValues.push(value);\n }\n }\n const paramStr = new String(result) as ParameterizedString;\n paramStr.__sentry_template_string__ = tplString;\n paramStr.__sentry_template_values__ = tplValues;\n return result;\n}\n\n/**\n * A platform-specific inspect function. In Deno, this is {@link Deno.inspect},\n * and in Node.js/Bun it is {@link util.inspect}. If neither is available, it\n * falls back to {@link JSON.stringify}.\n *\n * @param value The value to inspect.\n * @returns The string representation of the value.\n */\nconst inspect: (value: unknown) => string =\n // @ts-ignore: Deno global\n \"Deno\" in globalThis && \"inspect\" in globalThis.Deno &&\n // @ts-ignore: Deno global\n typeof globalThis.Deno.inspect === \"function\"\n // @ts-ignore: Deno global\n ? globalThis.Deno.inspect\n // @ts-ignore: Node.js global\n : \"util\" in globalThis && \"inspect\" in globalThis.util &&\n // @ts-ignore: Node.js global\n globalThis.util.inspect === \"function\"\n // @ts-ignore: Node.js global\n ? globalThis.util.inspect\n : JSON.stringify;\n\n/**\n * Gets a LogTape sink that sends logs to Sentry.\n * @param client The Sentry client. If omitted, the global default client is\n * used.\n * @returns A LogTape sink that sends logs to Sentry.\n */\nexport function getSentrySink(client?: Client): Sink {\n return (record: LogRecord) => {\n const message = getParameterizedString(record);\n if (client == null) client = getClient();\n if (record.level === \"error\" && record.properties.error instanceof Error) {\n const { error, ...rest } = record.properties;\n client?.captureException(error, {\n data: {\n message,\n ...rest,\n },\n });\n } else {\n client?.captureMessage(\n message,\n record.level === \"trace\" ? \"debug\" : record.level,\n {\n data: record.properties,\n },\n );\n }\n };\n}\n"],"mappings":";;;AAKA,SAAS,uBAAuBA,QAAwC;CACtE,IAAI,SAAS;CACb,IAAI,YAAY;CAChB,MAAMC,YAAsB,CAAE;AAC9B,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,QAAQ,IACzC,KAAI,IAAI,MAAM,GAAG;AACf,YAAU,OAAO,QAAQ;AACzB,eAAa,OAAO,OAAO,QAAQ,GAAG,CAAC,WAAW,KAAK,KAAK;CAC7D,OAAM;EACL,MAAM,QAAQ,QAAQ,OAAO,QAAQ,GAAG;AACxC,YAAU;AACV,gBAAc;AACd,YAAU,KAAK,MAAM;CACtB;CAEH,MAAM,WAAW,IAAI,OAAO;AAC5B,UAAS,6BAA6B;AACtC,UAAS,6BAA6B;AACtC,QAAO;AACR;;;;;;;;;AAUD,MAAMC,UAEJ,UAAU,cAAc,aAAa,WAAW,eAEvC,WAAW,KAAK,YAAY,aAEjC,WAAW,KAAK,UAEhB,UAAU,cAAc,aAAa,WAAW,QAE9C,WAAW,KAAK,YAAY,aAE9B,WAAW,KAAK,UAChB,KAAK;;;;;;;AAQX,SAAgB,cAAcC,QAAuB;AACnD,QAAO,CAACH,WAAsB;EAC5B,MAAM,UAAU,uBAAuB,OAAO;AAC9C,MAAI,UAAU,KAAM,UAAS,WAAW;AACxC,MAAI,OAAO,UAAU,WAAW,OAAO,WAAW,iBAAiB,OAAO;GACxE,MAAM,EAAE,MAAO,GAAG,MAAM,GAAG,OAAO;AAClC,WAAQ,iBAAiB,OAAO,EAC9B,MAAM;IACJ;IACA,GAAG;GACJ,EACF,EAAC;EACH,MACC,SAAQ,eACN,SACA,OAAO,UAAU,UAAU,UAAU,OAAO,OAC5C,EACE,MAAM,OAAO,WACd,EACF;CAEJ;AACF"}
1
+ {"version":3,"file":"mod.js","names":["record: LogRecord","tplValues: string[]","inspect: (value: unknown) => string","client?: Client"],"sources":["../src/mod.ts"],"sourcesContent":["import type { LogRecord, Sink } from \"@logtape/logtape\";\nimport { type Client, getClient, type ParameterizedString } from \"@sentry/core\";\n// deno-lint-ignore no-unused-vars\nimport type util from \"node:util\";\n\nfunction getParameterizedString(record: LogRecord): ParameterizedString {\n let result = \"\";\n let tplString = \"\";\n const tplValues: string[] = [];\n for (let i = 0; i < record.message.length; i++) {\n if (i % 2 === 0) {\n result += record.message[i];\n tplString += String(record.message[i]).replaceAll(\"%\", \"%%\");\n } else {\n const value = inspect(record.message[i]);\n result += value;\n tplString += `%s`;\n tplValues.push(value);\n }\n }\n const paramStr = new String(result) as ParameterizedString;\n paramStr.__sentry_template_string__ = tplString;\n paramStr.__sentry_template_values__ = tplValues;\n return result;\n}\n\n/**\n * A platform-specific inspect function. In Deno, this is {@link Deno.inspect},\n * and in Node.js/Bun it is {@link util.inspect}. If neither is available, it\n * falls back to {@link JSON.stringify}.\n *\n * @param value The value to inspect.\n * @returns The string representation of the value.\n */\nconst inspect: (value: unknown) => string =\n // @ts-ignore: Deno global\n \"Deno\" in globalThis && \"inspect\" in globalThis.Deno &&\n // @ts-ignore: Deno global\n typeof globalThis.Deno.inspect === \"function\"\n // @ts-ignore: Deno global\n ? globalThis.Deno.inspect\n // @ts-ignore: Node.js global\n : \"util\" in globalThis && \"inspect\" in globalThis.util &&\n // @ts-ignore: Node.js global\n globalThis.util.inspect === \"function\"\n // @ts-ignore: Node.js global\n ? globalThis.util.inspect\n : JSON.stringify;\n\n/**\n * Gets a LogTape sink that sends logs to Sentry.\n * @param client The Sentry client. If omitted, the global default client is\n * used.\n * @returns A LogTape sink that sends logs to Sentry.\n */\nexport function getSentrySink(client?: Client): Sink {\n return (record: LogRecord) => {\n const message = getParameterizedString(record);\n if (client == null) client = getClient();\n if (record.level === \"error\" && record.properties.error instanceof Error) {\n const { error, ...rest } = record.properties;\n client?.captureException(error, {\n data: {\n message,\n ...rest,\n },\n });\n } else {\n client?.captureMessage(\n message,\n record.level === \"trace\" ? \"debug\" : record.level,\n {\n data: record.properties,\n },\n );\n }\n };\n}\n"],"mappings":";;;AAKA,SAAS,uBAAuBA,QAAwC;CACtE,IAAI,SAAS;CACb,IAAI,YAAY;CAChB,MAAMC,YAAsB,CAAE;AAC9B,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,QAAQ,IACzC,KAAI,IAAI,MAAM,GAAG;AACf,YAAU,OAAO,QAAQ;AACzB,eAAa,OAAO,OAAO,QAAQ,GAAG,CAAC,WAAW,KAAK,KAAK;CAC7D,OAAM;EACL,MAAM,QAAQ,QAAQ,OAAO,QAAQ,GAAG;AACxC,YAAU;AACV,gBAAc;AACd,YAAU,KAAK,MAAM;CACtB;CAEH,MAAM,WAAW,IAAI,OAAO;AAC5B,UAAS,6BAA6B;AACtC,UAAS,6BAA6B;AACtC,QAAO;AACR;;;;;;;;;AAUD,MAAMC,UAEJ,UAAU,cAAc,aAAa,WAAW,eAEvC,WAAW,KAAK,YAAY,aAEjC,WAAW,KAAK,UAEhB,UAAU,cAAc,aAAa,WAAW,QAE9C,WAAW,KAAK,YAAY,aAE9B,WAAW,KAAK,UAChB,KAAK;;;;;;;AAQX,SAAgB,cAAcC,QAAuB;AACnD,QAAO,CAACH,WAAsB;EAC5B,MAAM,UAAU,uBAAuB,OAAO;AAC9C,MAAI,UAAU,KAAM,UAAS,WAAW;AACxC,MAAI,OAAO,UAAU,WAAW,OAAO,WAAW,iBAAiB,OAAO;GACxE,MAAM,EAAE,MAAO,GAAG,MAAM,GAAG,OAAO;AAClC,WAAQ,iBAAiB,OAAO,EAC9B,MAAM;IACJ;IACA,GAAG;GACJ,EACF,EAAC;EACH,MACC,SAAQ,eACN,SACA,OAAO,UAAU,UAAU,UAAU,OAAO,OAC5C,EACE,MAAM,OAAO,WACd,EACF;CAEJ;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logtape/sentry",
3
- "version": "1.1.0-dev.321+fda84317",
3
+ "version": "1.1.0-dev.324+017000e7",
4
4
  "description": "LogTape Sentry sink",
5
5
  "keywords": [
6
6
  "LogTape",
@@ -16,7 +16,7 @@
16
16
  "repository": {
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/dahlia/logtape.git",
19
- "directory": "sentry/"
19
+ "directory": "packages/sentry/"
20
20
  },
21
21
  "bugs": {
22
22
  "url": "https://github.com/dahlia/logtape/issues"
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "sideEffects": false,
43
43
  "peerDependencies": {
44
- "@logtape/logtape": "1.1.0-dev.321+fda84317"
44
+ "@logtape/logtape": "1.1.0-dev.324+017000e7"
45
45
  },
46
46
  "dependencies": {
47
47
  "@sentry/core": "^9.28.1"
package/tsdown.config.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineConfig } from "tsdown";
2
2
 
3
3
  export default defineConfig({
4
- entry: "mod.ts",
4
+ entry: "src/mod.ts",
5
5
  dts: {
6
6
  sourcemap: true,
7
7
  },
File without changes