react-ability-kit 0.1.6 → 0.1.8
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 +7 -7
- package/package.json +42 -42
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# React Ability
|
|
1
|
+
# React Ability Kit
|
|
2
2
|
|
|
3
3
|
**A small, strongly-typed permission layer for React**
|
|
4
4
|
Keep authorization logic **out of your components** and **in one place**.
|
|
@@ -96,19 +96,19 @@ User ──► Policy ──► Ability ──► UI / Components
|
|
|
96
96
|
## Installation
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
npm install react-ability
|
|
99
|
+
npm install react-ability-kit
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
or
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
pnpm add react-ability
|
|
105
|
+
pnpm add react-ability-kit
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
or
|
|
109
109
|
|
|
110
110
|
```bash
|
|
111
|
-
yarn add react-ability
|
|
111
|
+
yarn add react-ability-kit
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
---
|
|
@@ -121,7 +121,7 @@ Create a single policy file.
|
|
|
121
121
|
|
|
122
122
|
```ts
|
|
123
123
|
// ability.ts
|
|
124
|
-
import { defineAbility } from "react-ability";
|
|
124
|
+
import { defineAbility } from "react-ability-kit";
|
|
125
125
|
|
|
126
126
|
export const ability = defineAbility((allow, deny, user) => {
|
|
127
127
|
allow("read", "Invoice");
|
|
@@ -143,7 +143,7 @@ This file is your **single source of truth**.
|
|
|
143
143
|
### 2️⃣ Provide the ability to your app
|
|
144
144
|
|
|
145
145
|
```tsx
|
|
146
|
-
import { AbilityProvider } from "react-ability";
|
|
146
|
+
import { AbilityProvider } from "react-ability-kit";
|
|
147
147
|
import { ability } from "./ability";
|
|
148
148
|
|
|
149
149
|
export function App() {
|
|
@@ -335,7 +335,7 @@ It answers one question only:
|
|
|
335
335
|
|
|
336
336
|
## Final summary
|
|
337
337
|
|
|
338
|
-
**React Ability solves one problem:**
|
|
338
|
+
**React Ability Kit solves one problem:**
|
|
339
339
|
|
|
340
340
|
> How do I express and use permissions in React without scattering fragile conditional logic everywhere?
|
|
341
341
|
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-ability-kit",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"private": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist"
|
|
18
|
-
],
|
|
19
|
-
"peerDependencies": {
|
|
20
|
-
"react": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"tsup": "^8.0.0",
|
|
24
|
-
"typescript": "^5.0.0",
|
|
25
|
-
"@types/react": "^18.0.0"
|
|
26
|
-
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsup",
|
|
29
|
-
"dev": "tsup --watch",
|
|
30
|
-
"lint": "eslint .",
|
|
31
|
-
"prepublishOnly": "npm run build"
|
|
32
|
-
},
|
|
33
|
-
"license": "MIT",
|
|
34
|
-
"repository": {
|
|
35
|
-
"type": "git",
|
|
36
|
-
"url": "https://github.com/dalisraieb/react-ability-kit"
|
|
37
|
-
},
|
|
38
|
-
"bugs": {
|
|
39
|
-
"url": "https://github.com/dalisraieb/react-ability-kit/issues"
|
|
40
|
-
},
|
|
41
|
-
"homepage": "https://github.
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-ability-kit",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"tsup": "^8.0.0",
|
|
24
|
+
"typescript": "^5.0.0",
|
|
25
|
+
"@types/react": "^18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"dev": "tsup --watch",
|
|
30
|
+
"lint": "eslint .",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/dalisraieb/react-ability-kit"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/dalisraieb/react-ability-kit/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://dalisraieb.github.io/react-ability-kit/"
|
|
42
|
+
}
|