ridof 1.3.4 → 1.3.5

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.
@@ -0,0 +1,33 @@
1
+ name: Run tests and upload coverage
2
+
3
+ on:
4
+ push
5
+
6
+ jobs:
7
+ test:
8
+ name: Run tests and collect coverage
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v4
13
+ with:
14
+ fetch-depth: 2
15
+
16
+ - name: Set up Node
17
+ uses: actions/setup-node@v4
18
+
19
+ - name: Install dependencies
20
+ run: npm install
21
+
22
+ - name: Build
23
+ run: npm run build
24
+
25
+ - name: Run tests
26
+ run: npm run cover
27
+
28
+ - name: Upload results to Codecov
29
+ uses: codecov/codecov-action@v5
30
+ with:
31
+ token: ${{ secrets.CODECOV_TOKEN }}
32
+ files: ./tests/coverage/lcov.info
33
+ fail_ci_if_error: true
package/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  ### Changelog
2
2
 
3
- **1.2.7**: update vulnerable deps.
4
- **1.3.4**: fix major problem due to previous dependencies update.
3
+ **1.3.5**: small migrations
4
+ - coveralls -> codecov
5
+ - mocha -> jest
6
+ **1.3.4**: fix major problem due to previous dependencies update.
7
+ **1.2.7**: update vulnerable deps.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2025 <Federico Ghedina <fedeghe@gmail.com>>
3
+ Copyright (c) 2026 <Federico Ghedina <fedeghe@gmail.com>>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this
6
6
  software and associated documentation files (the "Software"), to deal in the Software
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Coverage Status](https://coveralls.io/repos/github/fedeghe/ridof/badge.svg?branch=master)](https://coveralls.io/github/fedeghe/ridof?branch=master)
1
+ [![codecov](https://codecov.io/gh/fedeghe/ridof/graph/badge.svg?token=WNRdYZb9Kn)](https://codecov.io/gh/fedeghe/ridof)
2
2
 
3
3
  # Ridof
4
4
 
@@ -170,10 +170,15 @@ Restrict state transitions
170
170
  From version 1.3.0 is possible to restrict the state transitions passing to `getStore` a third config parameter as a function:
171
171
 
172
172
  ``` js
173
- Ridof.getStore(reducer, initState, (currentTag, nextTag, state, action) => {
174
- // here tags are corresponds to action types
175
- // let's say we want only one plugin to be added
176
- if (currentTag === 'ADDPLUGIN' && nextTag === 'ADDPLUGIN') return false
177
- return true
178
- });
173
+ Ridof.getStore(
174
+ reducer,
175
+ initState,
176
+ (previousAction, currentAction, state, action) => {
177
+ // here tags are corresponds to action types
178
+ // let's say we want forbid a plugins to be added
179
+ // right after a mod was added
180
+ if (previousAction === 'ADDMOD' && currentAction === 'ADDPLUGIN') return false
181
+ return true
182
+ }
183
+ );
179
184
  ```
package/dist/index.js CHANGED
@@ -8,9 +8,9 @@
8
8
  d88 d88 88b ,88b 88b d88 d88
9
9
  d88' d88' `?88P'`88b`?8888P'd88'
10
10
 
11
- v. 1.3.4
11
+ v. 1.3.5
12
12
 
13
- Size: ~3KB
13
+ Size: ~3.21KB
14
14
  */
15
15
  var Ridof=function(){"use strict";function t(t,e){if("function"!=typeof t)throw new Error(e)}function e(t,e){if(void 0===t)throw new Error(e)}function s(t,e){this.activeCheck=!!e,this.config=e,
16
16
  this.tags=[t],this.index=0}function r(e,r,i){t(e,n.REDUCERS_FUNCTION),this.reducer=e,this.state=void 0!==r?r:this.reducer(),this.states=[this.state],this.config=i,
package/package.json CHANGED
@@ -1,16 +1,28 @@
1
1
  {
2
2
  "name": "ridof",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Simple isomorphic state manager",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
+ "dev": "malta source/buildev.json",
7
8
  "build": "malta source/build.json",
8
- "buildev": "malta source/buildev.json",
9
9
  "clean": "malta source/clean.json",
10
10
  "lint": "eslint --ignore-path .eslintignore .",
11
- "test": "mocha",
12
- "cover": "nyc yarn test && nyc report --reporter=html",
13
- "coveralls": "nyc yarn test && nyc report --reporter=text-lcov | coveralls"
11
+ "test": "jest",
12
+ "cover": "jest --coverage"
13
+ },
14
+ "jest": {
15
+ "testMatch": [
16
+ "<rootDir>/source/tests/**/*.js"
17
+ ],
18
+ "testPathIgnorePatterns": [
19
+ "/node_modules/",
20
+ "<rootDir>/source/tests/index.js",
21
+ "<rootDir>/source/tests/jest.setup.js"
22
+ ],
23
+ "setupFilesAfterEnv": [
24
+ "<rootDir>/source/tests/jest.setup.js"
25
+ ]
14
26
  },
15
27
  "repository": {
16
28
  "type": "git",
@@ -24,19 +36,11 @@
24
36
  },
25
37
  "homepage": "https://github.com/fedeghe/ridof#readme",
26
38
  "devDependencies": {
27
- "coveralls": "^3.0.9",
28
39
  "eslint": "^7.8.1",
29
- "eslint-config-standard": "^14.1.1",
30
- "eslint-plugin-import": "^2.20.1",
31
- "eslint-plugin-node": "^11.0.0",
32
- "eslint-plugin-promise": "^4.2.1",
33
- "eslint-plugin-standard": "^4.0.1",
34
- "malta": "4.1.17",
40
+ "jest": "^30.2.0",
41
+ "malta": "^4.1.17",
35
42
  "malta-header-comment": "^1.0.5",
36
- "malta-js-uglify": "^1.0.3",
37
- "malta-mocha": "^1.0.17",
38
- "mocha": "^8.1.3",
39
- "mocha-lcov-reporter": "^1.3.0",
40
- "nyc": "^15.0.0"
43
+ "malta-jest": "^0.0.2",
44
+ "malta-js-uglify": "^1.0.3"
41
45
  }
42
46
  }