flare-plugin-sdk 0.1.0-beta.4 → 0.1.0-beta.6
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 +125 -43
- package/bin/cli.mjs +2 -0
- package/package.json +2 -1
- package/skill/flare-plugin/README.md +28 -13
- package/skill/flare-plugin/assets/github-template/README.md +127 -19
- package/skill/flare-plugin/assets/github-template/manifest.json +1 -0
- package/skill/flare-plugin/examples/pixelfed/manifest.json +1 -0
- package/skill/flare-plugin/manifest.schema.json +1856 -0
- package/skill/flare-plugin/references/manifest.md +42 -0
- package/skill/flare-plugin/references/publishing.md +28 -9
|
@@ -6,10 +6,52 @@ Defaults below apply when a field is omitted; use omission for optional fields
|
|
|
6
6
|
rather than sending null for non-nullable values. Start from the complete
|
|
7
7
|
[template manifest](../assets/github-template/manifest.json).
|
|
8
8
|
|
|
9
|
+
## JSON Schema and editor support
|
|
10
|
+
|
|
11
|
+
The self-contained [manifest.schema.json](../manifest.schema.json) uses JSON Schema
|
|
12
|
+
draft-07. Editors such as VS Code use it for field completion, descriptions, enum
|
|
13
|
+
choices, required properties, ranges and static login/capability combinations.
|
|
14
|
+
`npx flare-plugin-sdk@next init my-plugin` adds a `$schema` URL pinned to that SDK
|
|
15
|
+
version. The source templates use the npm `next` channel.
|
|
16
|
+
|
|
17
|
+
For an existing project, add this editor hint at the manifest root:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"$schema": "https://unpkg.com/flare-plugin-sdk@next/skill/flare-plugin/manifest.schema.json"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Keep the other manifest fields. For reproducible editor behavior, replace `next`
|
|
26
|
+
with your chosen SDK version. For offline authoring, install the SDK as a development
|
|
27
|
+
dependency and use `./node_modules/flare-plugin-sdk/skill/flare-plugin/manifest.schema.json`
|
|
28
|
+
as the `$schema` value; all schema references are local to that file.
|
|
29
|
+
|
|
30
|
+
Flare accepts `$schema` as optional editor metadata and never fetches or executes
|
|
31
|
+
it. Older Flare builds that reject it can still use editor assistance: remove
|
|
32
|
+
`$schema` from the manifest and associate the schema in VS Code workspace settings
|
|
33
|
+
(`.vscode/settings.json`):
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"json.schemas": [{
|
|
38
|
+
"fileMatch": ["/manifest.json"],
|
|
39
|
+
"url": "https://unpkg.com/flare-plugin-sdk@next/skill/flare-plugin/manifest.schema.json"
|
|
40
|
+
}]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Schema validation does not fill defaults or replace Host validation. Flare also
|
|
45
|
+
checks unique IDs/interactions, canonical/approved origins, captured Deep Link
|
|
46
|
+
values, referenced timelines, localized catalog keys, relational compose limits,
|
|
47
|
+
actual JavaScript registration and runtime behavior. Some text limits use UTF-16
|
|
48
|
+
length in the Host rather than JSON Schema's Unicode code point count.
|
|
49
|
+
|
|
9
50
|
## Root object
|
|
10
51
|
|
|
11
52
|
| Field | Required / default | Contract |
|
|
12
53
|
| --- | --- | --- |
|
|
54
|
+
| `$schema` | Omitted | Editor schema URL/path only; never loaded by Flare |
|
|
13
55
|
| `schemaVersion` | `1` | Manifest schema, currently exactly 1 |
|
|
14
56
|
| `apiVersion` | Required | Runtime ABI, currently exactly 1 |
|
|
15
57
|
| `id` | Required | Stable reverse-domain plugin ID; `[a-z][a-z0-9]*(?:\.[a-z][a-z0-9-]*)+` |
|
|
@@ -26,7 +26,9 @@ copy that example's contents into a repository you own first.
|
|
|
26
26
|
## Prepare and publish
|
|
27
27
|
|
|
28
28
|
1. Adapt the website endpoints and verify the advertised features. Replace the
|
|
29
|
-
|
|
29
|
+
name, description, and placeholder icon before publication. For manual template
|
|
30
|
+
copies, replace the example plugin/platform IDs; keep the unique IDs generated
|
|
31
|
+
by `npx flare-plugin-sdk@next init my-plugin` stable.
|
|
30
32
|
Keep real tokens, Cookies, passwords, and private fixtures out of Git history.
|
|
31
33
|
2. Put the required files at root and check that a clean checkout contains them.
|
|
32
34
|
Include README instructions for supported website/instances, token acquisition
|
|
@@ -45,6 +47,10 @@ copy that example's contents into a repository you own first.
|
|
|
45
47
|
retry. Successful installs take effect immediately; verify the installed
|
|
46
48
|
tag/version and running behavior without restarting Flare.
|
|
47
49
|
|
|
50
|
+
For a first release from a generated project, follow the complete Git setup,
|
|
51
|
+
commit/push and tag commands in the [project walkthrough](../assets/github-template/README.md#3-publish-and-install-through-github-recommended).
|
|
52
|
+
Stop development for the same plugin before installation or updating it.
|
|
53
|
+
|
|
48
54
|
Private repositories, arbitrary branch tracking, prerelease tags, automatic
|
|
49
55
|
installation, and build-on-device are unsupported. A public repo without a stable
|
|
50
56
|
version tag has no installable version, even if its default branch has valid files.
|
|
@@ -95,17 +101,30 @@ plugin authors do not control it.
|
|
|
95
101
|
|
|
96
102
|
## Optional local installation
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
Use `.fpp` as an alternative for offline transfer or local testing. In your plugin
|
|
105
|
+
project, create a new, empty `dist` directory. Copy only `manifest.json`, `plugin.js`,
|
|
106
|
+
one supported `assets/icon.<extension>`, and optional `locales/*.json` into it,
|
|
107
|
+
preserving those paths. From the project root:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
npx --package=flare-plugin-sdk@next flare-plugin-pack ./dist ../my-plugin.fpp
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The complete skill also includes the standard-library-only packer for use without
|
|
114
|
+
npm. For example, from this skill directory:
|
|
100
115
|
|
|
101
116
|
```sh
|
|
102
117
|
node pack.mjs assets/github-template /tmp/example-feed-0.1.0.fpp
|
|
103
118
|
```
|
|
104
119
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
that directory to pack.mjs. The packer ignores only a root README.md; unlike
|
|
108
|
-
GitHub import it rejects other development files, including .git, tests, and type
|
|
120
|
+
The packer ignores only a root README.md; unlike GitHub import it rejects other
|
|
121
|
+
development files, including .git, tests, and type
|
|
109
122
|
declarations. Keep the output outside the input directory. Packaging success is
|
|
110
|
-
not full manifest/registration/behavior validation.
|
|
111
|
-
|
|
123
|
+
not full manifest/registration/behavior validation.
|
|
124
|
+
|
|
125
|
+
Stop development for this plugin, then in **Settings → Plugins → Add** choose file
|
|
126
|
+
installation, select the `.fpp`, review its source/permissions, and confirm. Local
|
|
127
|
+
packages are unverified and still require review. Installation takes effect
|
|
128
|
+
immediately; test the account and declared features on the target device. No
|
|
129
|
+
GitHub source/update tracking is recorded, so later file updates require manually
|
|
130
|
+
importing another package.
|