@bugspotter/sdk 0.3.0 → 1.0.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.
Files changed (41) hide show
  1. package/.husky/pre-commit +1 -0
  2. package/.prettierrc +11 -0
  3. package/CHANGELOG.md +91 -144
  4. package/CONTRIBUTING.md +200 -0
  5. package/README.md +18 -16
  6. package/SECURITY.md +65 -0
  7. package/dist/bugspotter.min.js +2 -1
  8. package/dist/bugspotter.min.js.map +1 -0
  9. package/dist/capture/console.js +14 -3
  10. package/dist/capture/screenshot.js +3 -2
  11. package/dist/core/buffer.js +2 -1
  12. package/dist/core/bug-reporter.js +16 -5
  13. package/dist/core/circular-buffer.js +4 -1
  14. package/dist/core/compress.js +2 -1
  15. package/dist/core/file-upload-handler.js +5 -2
  16. package/dist/core/offline-queue.d.ts +13 -0
  17. package/dist/core/offline-queue.js +54 -6
  18. package/dist/core/transport.js +24 -10
  19. package/dist/core/upload-helpers.js +3 -1
  20. package/dist/index.d.ts +6 -5
  21. package/dist/index.esm.js +17379 -149
  22. package/dist/index.esm.js.map +1 -0
  23. package/dist/index.js +5 -1
  24. package/dist/utils/config-validator.js +6 -0
  25. package/dist/utils/sanitize-patterns.js +15 -3
  26. package/dist/utils/url-helpers.d.ts +15 -0
  27. package/dist/utils/url-helpers.js +37 -1
  28. package/dist/version.d.ts +1 -1
  29. package/dist/version.js +1 -1
  30. package/dist/widget/button.d.ts +10 -0
  31. package/dist/widget/button.js +200 -3
  32. package/dist/widget/components/form-validator.js +2 -1
  33. package/dist/widget/components/style-manager.js +2 -1
  34. package/dist/widget/components/template-manager.js +2 -1
  35. package/dist/widget/modal.js +11 -4
  36. package/docs/CDN.md +5 -5
  37. package/eslint.config.js +99 -0
  38. package/package.json +39 -15
  39. package/release_notes.md +19 -0
  40. package/rollup.config.js +25 -0
  41. package/tsconfig.cjs.json +1 -1
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@bugspotter/sdk",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "description": "Professional bug reporting SDK with screenshots, session replay, and automatic error capture for web applications",
5
+ "packageManager": "pnpm@9.15.0",
5
6
  "main": "dist/index.js",
6
7
  "module": "dist/index.esm.js",
7
8
  "browser": "dist/bugspotter.min.js",
@@ -17,20 +18,22 @@
17
18
  "scripts": {
18
19
  "dev": "webpack --watch --mode development",
19
20
  "generate-version": "node scripts/generate-version.js",
20
- "prebuild": "npm run generate-version",
21
- "build": "npm run build:webpack && npm run build:esm && npm run build:cjs",
21
+ "prebuild": "pnpm generate-version",
22
+ "build": "pnpm build:webpack && pnpm build:esm && pnpm build:cjs",
22
23
  "build:webpack": "webpack --mode production",
23
- "build:esm": "tsc --project tsconfig.build.json --module ES2020 --outDir dist/esm && shx mv dist/esm/index.js dist/index.esm.js && shx rm -rf dist/esm",
24
+ "build:esm": "rollup -c rollup.config.js",
24
25
  "build:cjs": "tsc --project tsconfig.cjs.json",
25
- "prepublishOnly": "npm run build && npm test",
26
- "lint": "eslint \"src/**/*.{ts,js}\"",
27
- "lint:fix": "eslint \"src/**/*.{ts,js}\" --fix",
28
- "pretest": "npm run generate-version",
29
26
  "test": "vitest run",
30
27
  "test:watch": "vitest",
31
- "test:ui": "vitest --ui",
32
28
  "test:coverage": "vitest run --coverage",
33
- "test:e2e": "vitest run --config vitest.e2e.config.ts",
29
+ "test:e2e": "playwright test",
30
+ "prepublishOnly": "pnpm build && pnpm test",
31
+ "lint": "eslint \"src/**/*.{ts,js}\"",
32
+ "lint:fix": "eslint \"src/**/*.{ts,js}\" --fix",
33
+ "format": "prettier --write \"src/**/*.{ts,js,json,md}\"",
34
+ "format:check": "prettier --check \"src/**/*.{ts,js,json,md}\"",
35
+ "pretest": "pnpm generate-version",
36
+ "test:ui": "vitest --ui",
34
37
  "test:e2e:watch": "vitest --config vitest.e2e.config.ts",
35
38
  "test:playwright": "playwright test",
36
39
  "test:playwright:ui": "playwright test --ui"
@@ -53,13 +56,12 @@
53
56
  "license": "MIT",
54
57
  "repository": {
55
58
  "type": "git",
56
- "url": "https://github.com/apexbridge-tech/bugspotter.git",
57
- "directory": "packages/sdk"
59
+ "url": "https://github.com/apexbridge-tech/bugspotter-sdk.git"
58
60
  },
59
61
  "bugs": {
60
- "url": "https://github.com/apexbridge-tech/bugspotter/issues"
62
+ "url": "https://github.com/apexbridge-tech/bugspotter-sdk/issues"
61
63
  },
62
- "homepage": "https://github.com/apexbridge-tech/bugspotter#readme",
64
+ "homepage": "https://github.com/apexbridge-tech/bugspotter-sdk#readme",
63
65
  "engines": {
64
66
  "node": ">=16.0.0"
65
67
  },
@@ -67,6 +69,15 @@
67
69
  "access": "public",
68
70
  "registry": "https://registry.npmjs.org/"
69
71
  },
72
+ "lint-staged": {
73
+ "*.{ts,js}": [
74
+ "eslint --fix",
75
+ "prettier --write"
76
+ ],
77
+ "*.{json,md}": [
78
+ "prettier --write"
79
+ ]
80
+ },
70
81
  "dependencies": {
71
82
  "@rrweb/types": "2.0.0-alpha.18",
72
83
  "html-to-image": "^1.11.13",
@@ -76,14 +87,27 @@
76
87
  },
77
88
  "devDependencies": {
78
89
  "@playwright/test": "^1.48.0",
90
+ "@rollup/plugin-commonjs": "^29.0.0",
91
+ "@rollup/plugin-node-resolve": "^16.0.3",
92
+ "@rollup/plugin-typescript": "^12.3.0",
79
93
  "@types/node": "^20.11.0",
80
94
  "@types/pako": "^2.0.4",
95
+ "@typescript-eslint/eslint-plugin": "^8.18.2",
96
+ "@typescript-eslint/parser": "^8.18.2",
81
97
  "@vitest/coverage-v8": "^3.2.4",
82
98
  "@vitest/ui": "^3.2.4",
83
- "happy-dom": "^19.0.2",
99
+ "eslint": "^9.17.0",
100
+ "eslint-config-prettier": "^10.1.8",
101
+ "eslint-plugin-prettier": "^5.2.1",
102
+ "happy-dom": "^20.0.2",
84
103
  "jsdom": "^24.1.0",
104
+ "lint-staged": "^15.2.11",
105
+ "prettier": "^3.4.2",
106
+ "rollup": "^4.55.1",
107
+ "rollup-plugin-dts": "^6.3.0",
85
108
  "shx": "^0.4.0",
86
109
  "ts-loader": "^9.5.1",
110
+ "tslib": "^2.8.1",
87
111
  "typescript": "^5.3.3",
88
112
  "vitest": "^3.2.4",
89
113
  "webpack": "^5.90.0",
@@ -0,0 +1,19 @@
1
+ ## Release 1.0.0
2
+
3
+ ### Changes
4
+
5
+ ## [1.0.0] - 2026-01-17
6
+
7
+ ### Changed
8
+
9
+ - **Stable Release**: First production-ready 1.0.0 release
10
+ - Improved code quality and readability across core modules
11
+ - Enhanced test infrastructure with better Node.js and browser compatibility
12
+ - Optimized transport layer and URL validation logic
13
+
14
+ ### Fixed
15
+
16
+ - E2E test compatibility issues in Playwright test suite
17
+ - Integration test Node.js Buffer API compatibility
18
+ - ESLint configuration for test environment globals
19
+
@@ -0,0 +1,25 @@
1
+ import resolve from '@rollup/plugin-node-resolve';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import typescript from '@rollup/plugin-typescript';
4
+
5
+ export default {
6
+ input: 'src/index.ts',
7
+ output: {
8
+ file: 'dist/index.esm.js',
9
+ format: 'es',
10
+ sourcemap: true,
11
+ },
12
+ plugins: [
13
+ resolve({
14
+ browser: true,
15
+ preferBuiltins: false,
16
+ }),
17
+ commonjs(),
18
+ typescript({
19
+ tsconfig: 'tsconfig.build.json',
20
+ declaration: false, // We'll generate declarations separately
21
+ declarationMap: false,
22
+ }),
23
+ ],
24
+ external: [], // Bundle everything for now
25
+ };
package/tsconfig.cjs.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "../../tsconfig.json",
3
+ "extends": "./tsconfig.json",
4
4
  "compilerOptions": {
5
5
  "target": "ES2017",
6
6
  "module": "CommonJS",