@treeseed/sdk 0.7.0 → 0.8.1

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.
@@ -1,10 +1,17 @@
1
1
  export const DEFAULT_BUILD_WARNING_RULES = [
2
2
  {
3
3
  label: 'vite-browser-external-libsodium-url',
4
- pattern: /Module "url" has been externalized for browser compatibility, imported by ".*libsodium-sumo.*"/u,
4
+ pattern:
5
+ /(?:Module "url" has been externalized for browser compatibility, imported by|Automatically externalized node built-in module "url" imported from) ".*libsodium-sumo.*"/u,
5
6
  },
6
7
  ];
7
8
 
9
+ const ANSI_CONTROL_SEQUENCE_PATTERN = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/gu;
10
+
11
+ export function normalizeBuildWarningLine(line) {
12
+ return String(line ?? '').replace(ANSI_CONTROL_SEQUENCE_PATTERN, '');
13
+ }
14
+
8
15
  export function createBuildWarningRules(options = {}) {
9
16
  const useDefaultPolicy = options.useDefaultPolicy !== false;
10
17
  const customAllow = Array.isArray(options.allow) ? options.allow : [];
@@ -18,7 +25,7 @@ export function createBuildWarningRules(options = {}) {
18
25
  }
19
26
 
20
27
  export function classifyBuildWarningLine(line, options = {}) {
21
- const value = String(line ?? '');
28
+ const value = normalizeBuildWarningLine(line);
22
29
  if (!value.includes('[WARN]')) {
23
30
  return { kind: 'not-warning' };
24
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {