flare-plugin-sdk 0.1.0-beta.5 → 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 +17 -0
- package/bin/cli.mjs +2 -0
- package/package.json +2 -1
- package/skill/flare-plugin/README.md +1 -0
- package/skill/flare-plugin/assets/github-template/README.md +7 -0
- 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/README.md
CHANGED
|
@@ -33,6 +33,11 @@ them. The command uses bundled files only and does not install dependencies,
|
|
|
33
33
|
initialize Git, contact your website, or publish anything. Run
|
|
34
34
|
`npx flare-plugin-sdk@next --help` for usage.
|
|
35
35
|
|
|
36
|
+
The generated `manifest.json` includes a `$schema` URL pinned to the SDK version
|
|
37
|
+
used to create it. Open it in VS Code or another JSON Schema editor for property
|
|
38
|
+
completion, descriptions, enum choices, and static validation. The complete schema
|
|
39
|
+
is bundled at `skill/flare-plugin/manifest.schema.json` inside the SDK.
|
|
40
|
+
|
|
36
41
|
Edit `plugin.js` to use your website's real authentication, endpoints, response
|
|
37
42
|
mapping, and pagination. The starter's `/api/me` and `/api/posts` are illustrative;
|
|
38
43
|
no demonstration server is included. Update the description, login methods and
|
|
@@ -141,6 +146,15 @@ registration, permissions, and behavior. File installs have no GitHub update tra
|
|
|
141
146
|
|
|
142
147
|
## Optional: editor types and TypeScript
|
|
143
148
|
|
|
149
|
+
For JSON Schema use without network access, install the SDK below and set the
|
|
150
|
+
manifest's `$schema` to `./node_modules/flare-plugin-sdk/skill/flare-plugin/manifest.schema.json`.
|
|
151
|
+
Keep these development files outside the optional `.fpp` staging directory.
|
|
152
|
+
Flare treats `$schema` as editor metadata and never downloads it. With an older
|
|
153
|
+
Flare build that rejects this field, remove it and use a VS Code `json.schemas`
|
|
154
|
+
association in workspace settings instead. See the
|
|
155
|
+
[manifest editor guide](https://github.com/DimensionDev/Flare/blob/feature/plugin/feature/plugin/sdk/skill/flare-plugin/references/manifest.md#json-schema-and-editor-support)
|
|
156
|
+
and [VS Code schema settings](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings).
|
|
157
|
+
|
|
144
158
|
Install editor types in your authoring project:
|
|
145
159
|
|
|
146
160
|
```sh
|
|
@@ -182,6 +196,9 @@ Initializer tests cover valid unique IDs, empty/nested/Unicode paths, invalid
|
|
|
182
196
|
arguments, and preserving existing directories, files, and symlinks. They do not
|
|
183
197
|
contact a website or publish to npm. Flare's Host and platform acceptance checks are
|
|
184
198
|
documented in `skill/flare-plugin/references/testing.md`.
|
|
199
|
+
The draft-07 schema is compiled with Ajv in strict mode. Shared manifest cases
|
|
200
|
+
exercise both Schema and Host validation; Host tests also compare every field,
|
|
201
|
+
required property, enum, and known capability operation against Kotlin descriptors.
|
|
185
202
|
|
|
186
203
|
To try the SDK from a checkout before npm publication, run
|
|
187
204
|
`npm pack --pack-destination /tmp` after those checks, then install the resulting `.tgz` in
|
package/bin/cli.mjs
CHANGED
|
@@ -32,6 +32,8 @@ async function main() {
|
|
|
32
32
|
const template = fileURLToPath(new URL("../skill/flare-plugin/assets/github-template/", import.meta.url));
|
|
33
33
|
const manifestPath = join(template, "manifest.json");
|
|
34
34
|
const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
35
|
+
const { version } = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
|
|
36
|
+
manifest.$schema = `https://unpkg.com/flare-plugin-sdk@${version}/skill/flare-plugin/manifest.schema.json`;
|
|
35
37
|
const identity = randomUUID().replaceAll("-", "");
|
|
36
38
|
manifest.id = `local.plugin.p${identity}`;
|
|
37
39
|
manifest.name = name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flare-plugin-sdk",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"description": "Types, tooling, templates and authoring references for Flare plugins",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://github.com/DimensionDev/Flare#plugins-beta",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"test": "node --test scripts/*.test.mjs"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"ajv": "8.20.0",
|
|
35
36
|
"typescript": "6.0.3"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -204,6 +204,7 @@ is not a plugin installation URL. A GitHub Release or `.fpp` upload is unnecessa
|
|
|
204
204
|
| Boundary contract and registration | [ABI.md](ABI.md) |
|
|
205
205
|
| Exact JavaScript signatures and field comments | [flare-plugin.d.ts](flare-plugin.d.ts) |
|
|
206
206
|
| Manifest fields, defaults, enums, and validation | [Manifest](references/manifest.md) |
|
|
207
|
+
| JSON editor completion and static manifest checks | [JSON Schema](manifest.schema.json), [editor setup](references/manifest.md#json-schema-and-editor-support) |
|
|
207
208
|
| All twelve capabilities, minimum methods, and UI requirements | [Capabilities](references/capabilities.md) |
|
|
208
209
|
| Platform engines, async completion, HTTP, permissions, credentials, and state | [Runtime and HTTP](references/runtime-http.md) |
|
|
209
210
|
| Detection and all five login methods | [Authentication](references/authentication.md) |
|
|
@@ -13,6 +13,13 @@ inside `my-plugin` and keep its generated plugin/platform IDs. If you copied the
|
|
|
13
13
|
template manually, first copy its contents to your repository root and replace
|
|
14
14
|
the example `manifest.id`, `platform.id`, and names. Keep IDs stable for updates.
|
|
15
15
|
|
|
16
|
+
The generated manifest's `$schema` is pinned to the SDK version that created it.
|
|
17
|
+
Open `manifest.json` in VS Code or another JSON Schema editor for completion,
|
|
18
|
+
field descriptions, enum choices and static errors. Flare treats the URL as
|
|
19
|
+
metadata and never downloads it; actual registration and behavior are checked in
|
|
20
|
+
Flare. See the [manifest editor guide](https://github.com/DimensionDev/Flare/blob/feature/plugin/feature/plugin/sdk/skill/flare-plugin/references/manifest.md#json-schema-and-editor-support)
|
|
21
|
+
for offline use and older Flare builds that reject `$schema`.
|
|
22
|
+
|
|
16
23
|
1. Update the description, login methods, and declared capabilities in
|
|
17
24
|
`manifest.json`. Replace the one-pixel placeholder PNG with your own icon.
|
|
18
25
|
2. Adapt `plugin.js` using the
|