@aglyn/plugins-data 1.0.0-beta.143 → 1.0.0-beta.144
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 +62 -6
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,7 +1,63 @@
|
|
|
1
|
-
# @aglyn/plugins-
|
|
1
|
+
# @aglyn/plugins-data
|
|
2
2
|
|
|
3
|
-
The Data
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
The Data plugin for Aglyn: datasets, their records, and CSV or JSON import and export, managed in the Aglyn console. Install it if you are running or building on the Aglyn platform and want datasets.
|
|
4
|
+
|
|
5
|
+
> Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
npm install @aglyn/plugins-data@beta
|
|
10
|
+
|
|
11
|
+
Peer dependencies:
|
|
12
|
+
|
|
13
|
+
- `@mui/material`
|
|
14
|
+
- `firebase`
|
|
15
|
+
- `react`
|
|
16
|
+
|
|
17
|
+
None is optional.
|
|
18
|
+
|
|
19
|
+
## What's in it
|
|
20
|
+
|
|
21
|
+
This package is a first-party Aglyn plugin. It is loaded through Aglyn's plugin manager: the apps read its entry in the monorepo's `plugins.config.json`, import the module each surface names, and call the registrar declared for that surface. It is not a standalone library; installing it on its own loads nothing.
|
|
22
|
+
|
|
23
|
+
The plugin is console-only and declares one registrar, `registerDataConsole` (the `console` surface). Datasets are organization-shared collections that repeatable components read at render time through bindings; they are not a canvas component, so there is no `site` registrar and no server entry point in this package.
|
|
24
|
+
|
|
25
|
+
`registerDataConsole()` registers:
|
|
26
|
+
|
|
27
|
+
- A **Data** nav item and page at `/data`, behind the `dataStore` feature flag. The page is code-split.
|
|
28
|
+
- The organization datasets card, `HostDatasetsCard`, as a widget in the `orgData` slot.
|
|
29
|
+
- Datasets as a repeat source (`DATASET_REPEAT_SOURCE`), which is what offers "Repeat over dataset" on an element in Besigner and draws a repeat's copies from real rows on the canvas.
|
|
30
|
+
|
|
31
|
+
### Entry points
|
|
32
|
+
|
|
33
|
+
| import | contents |
|
|
34
|
+
| -- | -- |
|
|
35
|
+
| `@aglyn/plugins-data` | `BUNDLE_ID`, `registerDataConsole`, `HostDatasetsCard`, and the import/export model: `parseImportRows`, `mapImportColumns`, plus the CSV helpers re-exported from the core (`parseCsv`, `datasetRecordsToCsv`, `datasetCsvHeader`, `datasetCsvRow`, `datasetRecordToJson`, `serializeDatasetValue`, `countCsvDataRows`, `exportShortfall`) |
|
|
36
|
+
| `@aglyn/plugins-data/*` | any module under `src/lib/`, for example `@aglyn/plugins-data/model/dataset-record-view` (`datasetRecordFields`, `describeDatasetValue`) |
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
The registrar is normally called by Aglyn's generated console loader. Called directly:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { registerDataConsole } from '@aglyn/plugins-data'
|
|
44
|
+
registerDataConsole()
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The import helpers are pure functions:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { parseImportRows } from '@aglyn/plugins-data'
|
|
51
|
+
|
|
52
|
+
// A JSON array of objects, or CSV with a header row.
|
|
53
|
+
// Returns string maps keyed by source column name, or null.
|
|
54
|
+
const rows = parseImportRows('name,city\nAda,London')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## How it fits
|
|
58
|
+
|
|
59
|
+
A plugin may import the tenant runtime, the renderer, the Besigner logic, the core and the shared packages. It never imports another plugin, and the core never imports a plugin. Data depends on `@aglyn/aglyn` (which owns the dataset model and the CSV helpers), `@aglyn/tenant-runtime`, `@aglyn/tenant-feature-instance` and a few `@aglyn/shared-*` packages. Other plugins that need CSV parsing take it from the core, not from this package.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-data",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.144",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
34
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
35
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.144",
|
|
29
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.144",
|
|
30
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.144",
|
|
31
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.144",
|
|
32
|
+
"@aglyn/shared-util-http": "1.0.0-beta.144",
|
|
33
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.144",
|
|
34
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.144",
|
|
35
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.144",
|
|
36
36
|
"@swc/helpers": "0.5.23"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|