@capture.dev/redux 0.0.4 → 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.
package/README.md CHANGED
@@ -25,15 +25,15 @@ export const store = configureStore({
25
25
  });
26
26
  ```
27
27
 
28
- That's it. The middleware will automatically log actions that are performed on your Redux store and include them in any bug reports submitted during that session.
28
+ Once added, the middleware will automatically start recording actions that are performed on your Redux store.
29
29
 
30
30
  ## How It Works
31
31
 
32
32
  The middleware keeps a log of each action and its payload as it is dispatched, along with a snapshot of the state after the action has been performed.
33
33
 
34
- When a user submits a bug report, Capture automatically includes these logs, allowing you to recreate the state of your store during their session.
34
+ When a user submits a bug report, Capture automatically includes these logs, allowing you to recreate the state of your store at any point during a session.
35
35
 
36
- During a normal session, No data is sent to Capture.dev unless a bug report is created.
36
+ All logs are managed locally and no data is sent to Capture.dev unless a bug report is created.
37
37
 
38
38
  ## What is Capture.dev?
39
39
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s(t))!a.call(e,o)&&o!==n&&u(e,o,{get:()=>t[o],enumerable:!(r=i(t,o))||r.enumerable});return e};var x=e=>l(u({},"__esModule",{value:!0}),e);var S={};f(S,{captureReduxMiddleware:()=>d});module.exports=x(S);var p=require("@capture.dev/event-logger");function y(e){if(typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string")return e.type}var d=e=>{let t=(0,p.registerStateLogger)({identifier:"redux",name:"Redux",contextLabel:"Action",stateLabel:"Redux state"});return n=>r=>{if(!t)return n(r);let o=n(r),g=y(r);return t.logState(e.getState(),g,r),o}};0&&(module.exports={captureReduxMiddleware});
1
+ let e=require(`@capture.dev/core`);function t(e){if(typeof e==`object`&&e&&`type`in e&&typeof e.type==`string`)return e.type}const n=n=>{let r=(0,e.registerStateLogger)({identifier:`redux`,name:`Redux`,contextLabel:`Action`,stateLabel:`Redux state`,version:2});return e=>i=>{if(!r)return e(i);let a=e(i),o=t(i);return r.logState(n.getState(),{label:o,extra:i}),a}};exports.captureReduxMiddleware=n;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
1
+ //#region src/redux-middleware.d.ts
1
2
  type StoreShape = {
2
- getState: () => unknown;
3
+ getState: () => unknown;
3
4
  };
4
5
  type NextFn = (action: unknown) => unknown;
5
6
  declare const captureReduxMiddleware: (store: StoreShape) => (next: NextFn) => (action: unknown) => unknown;
6
-
7
- export { captureReduxMiddleware };
7
+ //#endregion
8
+ export { captureReduxMiddleware };
@@ -1,7 +1,8 @@
1
+ //#region src/redux-middleware.d.ts
1
2
  type StoreShape = {
2
- getState: () => unknown;
3
+ getState: () => unknown;
3
4
  };
4
5
  type NextFn = (action: unknown) => unknown;
5
6
  declare const captureReduxMiddleware: (store: StoreShape) => (next: NextFn) => (action: unknown) => unknown;
6
-
7
- export { captureReduxMiddleware };
7
+ //#endregion
8
+ export { captureReduxMiddleware };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{registerStateLogger as e}from"@capture.dev/core";function t(e){if(typeof e==`object`&&e&&`type`in e&&typeof e.type==`string`)return e.type}const n=n=>{let r=e({identifier:`redux`,name:`Redux`,contextLabel:`Action`,stateLabel:`Redux state`,version:2});return e=>i=>{if(!r)return e(i);let a=e(i),o=t(i);return r.logState(n.getState(),{label:o,extra:i}),a}};export{n as captureReduxMiddleware};
package/package.json CHANGED
@@ -1,20 +1,6 @@
1
1
  {
2
2
  "name": "@capture.dev/redux",
3
- "version": "0.0.4",
4
- "type": "module",
5
- "main": "./dist/index.cjs",
6
- "sideEffects": false,
7
- "license": "MIT",
8
- "homepage": "https://capture.dev",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
13
- }
14
- },
15
- "files": [
16
- "dist/**"
17
- ],
3
+ "version": "1.0.0",
18
4
  "keywords": [
19
5
  "capture",
20
6
  "capture.dev",
@@ -23,34 +9,59 @@
23
9
  "redux",
24
10
  "middleware"
25
11
  ],
12
+ "homepage": "https://capture.dev",
13
+ "license": "MIT",
14
+ "sideEffects": false,
15
+ "type": "module",
16
+ "exports": {
17
+ ".": {
18
+ "development": "./src/index.ts",
19
+ "require": "./dist/index.cjs",
20
+ "import": "./dist/index.mjs"
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
24
+ "main": "./dist/index.cjs",
25
+ "module": "./dist/index.mjs",
26
+ "types": "./dist/index.d.cts",
27
+ "files": [
28
+ "dist/**"
29
+ ],
26
30
  "scripts": {
27
- "lint": "eslint src/",
28
- "lint:fix": "npm run lint -- --fix",
29
- "generate-version": "genversion src/version.ts --esm --semi",
31
+ "build": "tsdown",
30
32
  "clean": "rimraf dist",
31
- "build": "tsup"
33
+ "lint": "eslint",
34
+ "lint:fix": "npm run lint -- --fix"
35
+ },
36
+ "lint-staged": {
37
+ "**/*.{ts,tsx,js,json}": [
38
+ "eslint --fix",
39
+ "prettier --write"
40
+ ],
41
+ "**/*.{md,css,html}": "prettier --write"
42
+ },
43
+ "dependencies": {
44
+ "@capture.dev/core": "0.0.4"
32
45
  },
33
46
  "devDependencies": {
34
47
  "@capture/eslint-config": "*",
48
+ "@capture/tsdown-config": "*",
35
49
  "@capture/vitest-config": "*",
36
50
  "eslint": "^9.29.0",
37
- "genversion": "^3.2.0",
38
- "tsup": "^8.5.1",
51
+ "tsdown": "^0.20.1",
39
52
  "typescript": "^5.9.3",
40
- "vitest": "^3.0.9"
53
+ "vitest": "^4.0.18"
41
54
  },
42
55
  "volta": {
43
56
  "extends": "../../package.json"
44
57
  },
45
- "dependencies": {
46
- "@capture.dev/event-logger": "0.0.3"
47
- },
48
- "lint-staged": {
49
- "**/*.{ts,tsx,js}": [
50
- "eslint --fix",
51
- "prettier --write"
52
- ],
53
- "**/*.{json,md,css,html}": "prettier --write"
54
- },
55
- "tscLib": "true"
58
+ "publishConfig": {
59
+ "exports": {
60
+ ".": {
61
+ "require": "./dist/index.cjs",
62
+ "import": "./dist/index.mjs"
63
+ },
64
+ "./package.json": "./package.json"
65
+ }
66
+ }
56
67
  }
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- import{registerStateLogger as p}from"@capture.dev/event-logger";function d(e){if(typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string")return e.type}var g=e=>{let n=p({identifier:"redux",name:"Redux",contextLabel:"Action",stateLabel:"Redux state"});return r=>t=>{if(!n)return r(t);let o=r(t),u=d(t);return n.logState(e.getState(),u,t),o}};export{g as captureReduxMiddleware};