@lego-box/shell 1.0.7 → 1.0.9
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
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
# @lego-box/shell
|
|
2
|
-
|
|
3
|
-
Piral microfrontend shell providing authentication, PocketBase integration, RBAC, and shared UI components for the Lego Box ecosystem.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @lego-box/shell
|
|
9
|
-
# or
|
|
10
|
-
pnpm add @lego-box/shell
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
### Creating a Pilet
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pilet new @lego-box/shell --target my-pilet
|
|
19
|
-
cd my-pilet
|
|
20
|
-
pnpm install
|
|
21
|
-
pnpm start
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Pilet Development
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
import type { PiletApi } from '@lego-box/shell/pilet';
|
|
28
|
-
|
|
29
|
-
export function setup(app: PiletApi) {
|
|
30
|
-
// Access authentication
|
|
31
|
-
const user = app.auth.getUser();
|
|
32
|
-
|
|
33
|
-
// Access PocketBase
|
|
34
|
-
const records = await app.pocketbase.collection('items').getList();
|
|
35
|
-
|
|
36
|
-
// Register protected pages
|
|
37
|
-
app.registerProtectedPage('/my-route', MyPage, {
|
|
38
|
-
action: 'read',
|
|
39
|
-
subject: 'items'
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// Register sidebar menu
|
|
43
|
-
app.registerSidebarMenu({
|
|
44
|
-
id: 'my-menu',
|
|
45
|
-
label: 'My Feature',
|
|
46
|
-
href: '/my-route',
|
|
47
|
-
action: 'read',
|
|
48
|
-
subject: 'items'
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Shared Dependencies
|
|
54
|
-
|
|
55
|
-
The shell provides these dependencies to all pilets:
|
|
56
|
-
- `@lego-box/ui-kit` - Reusable UI components
|
|
57
|
-
- `pocketbase` - Backend SDK
|
|
58
|
-
- `piral-auth` - Authentication plugin
|
|
59
|
-
- `react` & `react-dom` - UI framework
|
|
60
|
-
|
|
61
|
-
## API Reference
|
|
62
|
-
|
|
63
|
-
See [full documentation](link-to-docs) for complete API reference.
|
|
64
|
-
|
|
65
|
-
## License
|
|
66
|
-
|
|
67
|
-
MIT
|
|
1
|
+
# @lego-box/shell
|
|
2
|
+
|
|
3
|
+
Piral microfrontend shell providing authentication, PocketBase integration, RBAC, and shared UI components for the Lego Box ecosystem.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lego-box/shell
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @lego-box/shell
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Creating a Pilet
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pilet new @lego-box/shell --target my-pilet
|
|
19
|
+
cd my-pilet
|
|
20
|
+
pnpm install
|
|
21
|
+
pnpm start
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Pilet Development
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import type { PiletApi } from '@lego-box/shell/pilet';
|
|
28
|
+
|
|
29
|
+
export function setup(app: PiletApi) {
|
|
30
|
+
// Access authentication
|
|
31
|
+
const user = app.auth.getUser();
|
|
32
|
+
|
|
33
|
+
// Access PocketBase
|
|
34
|
+
const records = await app.pocketbase.collection('items').getList();
|
|
35
|
+
|
|
36
|
+
// Register protected pages
|
|
37
|
+
app.registerProtectedPage('/my-route', MyPage, {
|
|
38
|
+
action: 'read',
|
|
39
|
+
subject: 'items'
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Register sidebar menu
|
|
43
|
+
app.registerSidebarMenu({
|
|
44
|
+
id: 'my-menu',
|
|
45
|
+
label: 'My Feature',
|
|
46
|
+
href: '/my-route',
|
|
47
|
+
action: 'read',
|
|
48
|
+
subject: 'items'
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Shared Dependencies
|
|
54
|
+
|
|
55
|
+
The shell provides these dependencies to all pilets:
|
|
56
|
+
- `@lego-box/ui-kit` - Reusable UI components
|
|
57
|
+
- `pocketbase` - Backend SDK
|
|
58
|
+
- `piral-auth` - Authentication plugin
|
|
59
|
+
- `react` & `react-dom` - UI framework
|
|
60
|
+
|
|
61
|
+
## API Reference
|
|
62
|
+
|
|
63
|
+
See [full documentation](link-to-docs) for complete API reference.
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lego-box/shell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Piral microfrontend shell for Lego Box - provides authentication, PocketBase integration, RBAC, and shared UI components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dist/emulator",
|
|
27
27
|
"pilet.ts",
|
|
28
28
|
"src",
|
|
29
|
+
"tsconfig.json",
|
|
29
30
|
"webpack.config.js",
|
|
30
31
|
"tailwind.config.js",
|
|
31
32
|
"postcss.config.js",
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"module": "CommonJS",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true
|
|
9
|
+
},
|
|
10
|
+
"ts-node": {
|
|
11
|
+
"esm": false,
|
|
12
|
+
"transpileOnly": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src", "piral"]
|
|
15
|
+
}
|
|
Binary file
|