@acrylblends/blends-frame 0.1.1 → 0.1.3
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/lib/app-plugins.d.ts +32 -5
- package/lib/client.js +31886 -367
- package/lib/client.js.map +1 -1
- package/lib/contract.d.ts +116 -0
- package/lib/github-connect.d.ts +44 -0
- package/lib/graph-contract.d.ts +85 -0
- package/lib/graph-inspect.d.ts +16 -0
- package/lib/index.d.ts +20 -3
- package/lib/index.js +1040 -36
- package/lib/index.js.map +1 -1
- package/lib/plain.d.ts +26 -0
- package/lib/plugin-graph.d.ts +38 -0
- package/lib/registry.d.ts +71 -0
- package/lib/types/client/AppSection.d.ts +10 -0
- package/lib/types/client/BlendsFrame.d.ts +7 -1
- package/lib/types/client/GraphView.d.ts +22 -0
- package/lib/types/client/NameYourApp.d.ts +10 -0
- package/lib/types/client/PluginsSection.d.ts +11 -1
- package/lib/types/client/RegistryView.d.ts +11 -0
- package/lib/types/client/SettingsExpand.d.ts +6 -0
- package/lib/types/client/ShareChooser.d.ts +21 -0
- package/lib/types/client/desktop-app.d.ts +65 -0
- package/lib/types/client/graph-api.d.ts +11 -0
- package/lib/types/client/graph-canvas.d.ts +63 -0
- package/lib/types/client/graph-link.d.ts +21 -0
- package/lib/types/client/graph-model.d.ts +23 -0
- package/lib/types/client/graph-styles.d.ts +3 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/plain-failure.d.ts +10 -0
- package/lib/types/client/plugins-navigator.d.ts +37 -7
- package/lib/types/client/registry-api.d.ts +21 -0
- package/lib/types/client/registry-list.d.ts +14 -0
- package/lib/types/client/settings-fullscreen.d.ts +13 -0
- package/lib/types/client/theme-switch.d.ts +27 -0
- package/lib/types/contract.d.ts +116 -0
- package/lib/types/graph-contract.d.ts +85 -0
- package/lib/types/graph-inspect.d.ts +16 -0
- package/package.json +9 -7
package/lib/app-plugins.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* switch when its Loader row (`app-plugins`) loads again, which the client asks for.
|
|
6
6
|
*/
|
|
7
7
|
import { type PublishGitPort, type RepositoryHostPort } from '@webboxes/plugin-hub';
|
|
8
|
-
import { type AppPluginView, type FramePluginState, type FramePluginView, type SharedPluginView, type SharePlan } from './contract.ts';
|
|
8
|
+
import { type AppPluginView, type FramePluginState, type FramePluginView, type SavedPluginResult, type SavedPluginView, type ShareVisibility, type SharedPluginView, type SharePlan } from './contract.ts';
|
|
9
9
|
/** One row of `blend.yaml`'s `spec.rows`: where its block starts and ends (line indexes, end exclusive). */
|
|
10
10
|
export interface BlendRow {
|
|
11
11
|
readonly id: string;
|
|
@@ -49,7 +49,18 @@ export type RepositoryCheck = (url: string) => Promise<boolean | undefined>;
|
|
|
49
49
|
export declare const ghRepositoryCheck: RepositoryCheck;
|
|
50
50
|
/** The share records, each checked once: a repository GitHub says is gone is marked so, and the row offers a new share. */
|
|
51
51
|
export declare function checkedShares(records: Readonly<Record<string, SharedPluginView>>, check: RepositoryCheck): Promise<Record<string, SharedPluginView>>;
|
|
52
|
-
|
|
52
|
+
/** Where a plugin's code is: its folder (absolute) and its main file relative to the app's folder (absent when the file is outside the app). */
|
|
53
|
+
export interface PluginLocation {
|
|
54
|
+
readonly folder: string;
|
|
55
|
+
readonly main?: string;
|
|
56
|
+
}
|
|
57
|
+
/** A path inside `root` as a relative path with forward slashes, or undefined when it is outside. */
|
|
58
|
+
export declare function insideApp(root: string, file: string): string | undefined;
|
|
59
|
+
/** Where a plugin of `blend.yaml` or the frame has its code: a folder of the app's `plugins/`, else the package the app installed (read-only). */
|
|
60
|
+
export declare function pluginLocation(root: string, name: string): Promise<PluginLocation | undefined>;
|
|
61
|
+
/** The newest packed copy of each plugin kept in the app's plugin store, by name. An unreadable store lists nothing. */
|
|
62
|
+
export declare function savedCopies(storeRoot: string | undefined): ReadonlyMap<string, SavedPluginView>;
|
|
63
|
+
export declare function readAppPlugins(root: string, git: GitPort, sharedFile?: string, check?: RepositoryCheck, storeRoot?: string): Promise<AppPluginView[]>;
|
|
53
64
|
/**
|
|
54
65
|
* Switch one plugin in `blend.yaml`: a row (a library row, or one of the app's own plugins that has a row) gets or loses `disabled: true`; an own
|
|
55
66
|
* plugin without a row is put in or taken out of the `extensions` row's `off` list. @throws when there is no such plugin.
|
|
@@ -70,7 +81,7 @@ export declare function frameRowState(row: FrameRow): FramePluginState;
|
|
|
70
81
|
export declare function readFramePlugins(root: string, rows: readonly FrameRow[]): Promise<FramePluginView[]>;
|
|
71
82
|
/** The package.json a local plugin is shared with: the fields the builder's package_plugin writes (plugins/builder/index.ts), plus the Loader
|
|
72
83
|
* patch the plugin-hub's share requires so the package can also be installed as a row. */
|
|
73
|
-
export declare function pluginPackageManifest(name: string, description: string, version?: string): Record<string, unknown>;
|
|
84
|
+
export declare function pluginPackageManifest(name: string, description: string, version?: string, license?: string): Record<string, unknown>;
|
|
74
85
|
/**
|
|
75
86
|
* The shares this app completed, from its own home (`shared-plugins.json`). The record is written only after the hub's whole share succeeded: a
|
|
76
87
|
* package.json can name a repository before the release exists, because the hub prepares it before its guards, and a refused share must not look
|
|
@@ -82,15 +93,26 @@ export declare function recordShare(file: string, name: string, shared: SharedPl
|
|
|
82
93
|
/** Where the frame packages the plugins it shares: under the app's home, never in the app's folder, so a share leaves no file to save. */
|
|
83
94
|
export declare const pluginPackagesOf: (home: string) => string;
|
|
84
95
|
/** Copy one local plugin into its package folder under `packages`, the way the builder's package_plugin does; answers the folder. */
|
|
85
|
-
export declare function packageAppPlugin(root: string, name: string, packages: string): Promise<string>;
|
|
96
|
+
export declare function packageAppPlugin(root: string, name: string, packages: string, license?: string): Promise<string>;
|
|
86
97
|
/** Bump one package folder's patch version (what the hub asks for after a release), and answer the new version. */
|
|
87
98
|
export declare function bumpPackageVersion(dir: string): Promise<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Keep a packed copy of one local plugin on this machine: the plugin is packaged under the app's home as a share does, then put in the app's plugin
|
|
101
|
+
* store with its checksum. A version is stored once: when this version is already saved with other content, the version is raised (patch) and saved
|
|
102
|
+
* again, so a changed plugin never overwrites an earlier copy. Nothing leaves the machine.
|
|
103
|
+
*/
|
|
104
|
+
export declare function saveAppPlugin(root: string, home: string, name: string): Promise<SavedPluginResult>;
|
|
88
105
|
/** Where a share goes through: the user's own `gh` (the repository host) and `git`; a test passes stand-ins, so no test publishes. */
|
|
89
106
|
export interface SharePorts {
|
|
90
107
|
readonly host: RepositoryHostPort;
|
|
91
108
|
readonly git: PublishGitPort;
|
|
92
109
|
}
|
|
93
110
|
export declare const githubSharePorts: () => SharePorts;
|
|
111
|
+
/**
|
|
112
|
+
* The hub labels every release with the topics catalogs find a plugin by, and `cordis-plugin` is the one the registry's sync lists a public repository
|
|
113
|
+
* by. A share that was not asked to go to the registry must not put the repository there, so its host takes no topics; a registry share passes them on.
|
|
114
|
+
*/
|
|
115
|
+
export declare function listedOnlyWhenAsked(host: RepositoryHostPort, listed: boolean): RepositoryHostPort;
|
|
94
116
|
/** A completed share: where it went. */
|
|
95
117
|
export type ShareAppPluginResult = SharedPluginView & {
|
|
96
118
|
readonly owner: string;
|
|
@@ -100,10 +122,15 @@ export type ShareAppPluginResult = SharedPluginView & {
|
|
|
100
122
|
/**
|
|
101
123
|
* What sharing one local plugin would do, read without sending anything: it packages the plugin under the app's home and asks the host who is
|
|
102
124
|
* signed in, whether the repository exists and whether this version is released there (then the plan releases the next patch).
|
|
103
|
-
* @param options - the repository owner (the signed-in account when absent)
|
|
125
|
+
* @param options - the repository owner (the signed-in account when absent), the visibility the person asked for (private when absent: a share is
|
|
126
|
+
* public only when the person chose it, because anyone can then read and pull it), the license of a public share (MIT when absent; the plan names it)
|
|
127
|
+
* and whether the public registry lists it (`registry`: the share sets the `cordis-plugin` topic, which the registry's hourly sync finds).
|
|
104
128
|
*/
|
|
105
129
|
export declare function planAppPluginShare(root: string, home: string, name: string, options: {
|
|
106
130
|
readonly owner?: string;
|
|
131
|
+
readonly visibility?: ShareVisibility;
|
|
132
|
+
readonly license?: string;
|
|
133
|
+
readonly registry?: boolean;
|
|
107
134
|
}, ports: SharePorts): Promise<SharePlan>;
|
|
108
135
|
/**
|
|
109
136
|
* Share one local plugin through the plugin-hub path, exactly as the person confirmed it: the plan is read again, and when it no longer matches
|