@nebulahome/package-sdk 0.0.0-stage → 1.0.0

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/dist/ui.d.ts ADDED
@@ -0,0 +1,320 @@
1
+ import { G as CapabilityState, H as CapabilityCommands, S as FormValues, ct as EntityDomain, d as EntityTypeDefinition, f as ValuesOf, i as SettingsDefinition, lt as EntityId, q as CommandableCapability, r as JsonValue, s as ArgsOf, t as JsonObject, u as CommandsOf, z as ValueOfField } from "./chunks/json.js";
2
+ import { a as PageProps, n as EntityViewProps, t as CardProps } from "./chunks/props.js";
3
+ import { AnchorHTMLAttributes, ComponentType, ReactElement, ReactNode } from "react";
4
+ //#region src/ui/types.d.ts
5
+ /** The package drawn. */
6
+ type PackageInfo = {
7
+ readonly id: string;
8
+ readonly version: string;
9
+ readonly name: string;
10
+ };
11
+ /** One entity of the house, as the interface shows it. */
12
+ type EntityView = {
13
+ readonly entityId: EntityId;
14
+ readonly domain: EntityDomain;
15
+ readonly name: string;
16
+ readonly icon: string | null;
17
+ readonly deviceId: string | null;
18
+ readonly areaId: string | null;
19
+ readonly state: CapabilityState;
20
+ readonly attributes: JsonObject;
21
+ readonly isAvailable: boolean;
22
+ readonly lastChanged: string;
23
+ readonly unitOfMeasurement: string | null;
24
+ readonly deviceClass: string | null;
25
+ readonly displayPrecision: number | null;
26
+ };
27
+ /** Which entities `useEntities` reads. */
28
+ type EntitiesFilter = {
29
+ /** Whose: the package's own (the default), anyone's, or another package's by id. */
30
+ readonly owner?: 'self' | 'any' | (string & Record<never, never>);
31
+ readonly domain?: EntityDomain;
32
+ readonly entityIds?: readonly EntityId[];
33
+ };
34
+ /** One of the package's custom entities, live and typed. */
35
+ type CustomEntityState<TType extends EntityTypeDefinition> = {
36
+ /** Its values, or undefined while it is not known. */
37
+ readonly values: ValuesOf<TType> | undefined;
38
+ readonly isAvailable: boolean;
39
+ readonly lastChanged: string | null;
40
+ /**
41
+ * Sends it one of its type's commands.
42
+ *
43
+ * @param command - The command's id.
44
+ * @param args - Its arguments.
45
+ * @returns Once the platform took it.
46
+ */
47
+ readonly send: <TCommand extends CommandsOf<TType>>(command: TCommand, args: ArgsOf<TType, TCommand>) => Promise<void>;
48
+ };
49
+ /** What sending a command takes. */
50
+ type SendCommand = <TName extends CommandableCapability>(entityId: EntityId, capability: TName, command: CapabilityCommands[TName]) => Promise<void>;
51
+ /** A read of one of the package's methods. */
52
+ type RpcState<TData> = {
53
+ readonly data: TData | undefined;
54
+ readonly error: Error | null;
55
+ readonly isLoading: boolean;
56
+ /** Reads it again. */
57
+ readonly refetch: () => void;
58
+ };
59
+ /** How a read of a method is made. */
60
+ type RpcOptions = {
61
+ /** Reads it again every so often. */
62
+ readonly refetchIntervalMs?: number;
63
+ /** False holds the read back. */
64
+ readonly isEnabled?: boolean;
65
+ };
66
+ /** A call of one of the package's methods, on demand. */
67
+ type PackageCall = <TData = JsonValue>(method: string, input?: JsonValue) => Promise<TData>;
68
+ /** How a mutation is made. */
69
+ type MutationOptions = {
70
+ /** The methods whose reads it refreshes once done; all of the package's when not said. */
71
+ readonly invalidates?: readonly string[];
72
+ };
73
+ /** A call that changes something, with its state. */
74
+ type Mutation<TInput, TOutput> = {
75
+ /**
76
+ * Calls the method.
77
+ *
78
+ * @param input - What it is handed.
79
+ * @returns What it answered.
80
+ */
81
+ readonly mutate: (input: TInput) => Promise<TOutput>;
82
+ readonly isPending: boolean;
83
+ readonly error: Error | null;
84
+ /** Forgets the last error. */
85
+ readonly reset: () => void;
86
+ };
87
+ /** The keys of the settings whose field is a secret. */
88
+ type SecretKeys<TFields> = { [TKey in keyof TFields]: TFields[TKey] extends {
89
+ readonly kind: 'secret';
90
+ } ? TKey : never; }[keyof TFields];
91
+ /** The settings as the interface reads them: a secret is whether one is saved. */
92
+ type VisibleSettings<TSettings> = TSettings extends SettingsDefinition<infer TFields> ? Omit<FormValues<TFields>, SecretKeys<TFields>> & Readonly<Record<SecretKeys<TFields>, boolean>> : JsonObject;
93
+ /** Some of the settings to save: a secret as text. */
94
+ type SettingsPatch<TSettings> = TSettings extends SettingsDefinition<infer TFields> ? { readonly [TKey in keyof TFields]?: ValueOfField<TFields[TKey]>; } : JsonObject;
95
+ /** The package's settings, to show and change. */
96
+ type PackageSettings<TSettings> = {
97
+ /** Every setting; while they are being read, the declared defaults. */
98
+ readonly values: VisibleSettings<TSettings>;
99
+ /** Whether what was saved is still being read. */
100
+ readonly isLoading: boolean;
101
+ /**
102
+ * Saves some of them; a change of a field that is not live restarts the package.
103
+ *
104
+ * @param patch - What changes.
105
+ * @returns Once saved.
106
+ */
107
+ readonly update: (patch: SettingsPatch<TSettings>) => Promise<void>;
108
+ readonly isUpdating: boolean;
109
+ /** Whether the viewer may change them (`package:configure`). */
110
+ readonly canEdit: boolean;
111
+ readonly error: Error | null;
112
+ };
113
+ /** Who is looking. */
114
+ type Viewer = {
115
+ readonly userId: string;
116
+ readonly username: string;
117
+ readonly role: string;
118
+ /**
119
+ * Says whether the viewer holds a permission.
120
+ *
121
+ * @param permission - Its name: `package:configure`, `entity:control`.
122
+ * @returns True when they do.
123
+ */
124
+ readonly can: (permission: string) => boolean;
125
+ };
126
+ /** The viewer's language and time zone, for `Intl`. */
127
+ type Locale = {
128
+ readonly locale: string;
129
+ readonly timeZone: string;
130
+ };
131
+ /** Which theme the interface draws in. */
132
+ type Theme = {
133
+ readonly scheme: 'light' | 'dark';
134
+ };
135
+ /** Where the package's page is: a path of its own, under the platform's address for it. */
136
+ type PackageRoute = {
137
+ /** `/clips/42`, `/` at the page's root. */
138
+ readonly path: string;
139
+ readonly segments: readonly string[];
140
+ readonly query: URLSearchParams;
141
+ };
142
+ /** Goes to a path of the package's page. */
143
+ type PackageNavigate = (to: string, options?: {
144
+ readonly replace?: boolean;
145
+ }) => void;
146
+ /** A place of the platform, named by what it is: its address is the platform's. */
147
+ type PlatformTarget = {
148
+ readonly kind: 'entity';
149
+ readonly entityId: EntityId;
150
+ } | {
151
+ readonly kind: 'device';
152
+ readonly deviceId: string;
153
+ } | {
154
+ readonly kind: 'package';
155
+ readonly packageId: string;
156
+ } | {
157
+ readonly kind: 'dashboard';
158
+ readonly dashboardId?: string;
159
+ };
160
+ /** Goes to a place of the platform. */
161
+ type PlatformNavigate = (target: PlatformTarget) => void;
162
+ /** What a link takes besides where it goes: an anchor's attributes, but its address. */
163
+ type LinkAttributes = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {
164
+ readonly children?: ReactNode;
165
+ };
166
+ /** A link to a path of the package's page. */
167
+ type PackageLinkProps = LinkAttributes & {
168
+ readonly to: string;
169
+ readonly replace?: boolean;
170
+ };
171
+ /** A link to a place of the platform. */
172
+ type PlatformLinkProps = LinkAttributes & {
173
+ readonly to: PlatformTarget;
174
+ };
175
+ /** What the interface lends to implement `/ui`. */
176
+ type UiHost = {
177
+ readonly usePackage: () => PackageInfo;
178
+ readonly useEntity: (entityId: EntityId) => EntityView | undefined;
179
+ readonly useEntities: (filter?: EntitiesFilter) => readonly EntityView[];
180
+ readonly useCustomEntity: <TType extends EntityTypeDefinition>(type: TType, entityId: EntityId) => CustomEntityState<TType>;
181
+ readonly useCommand: () => SendCommand;
182
+ readonly usePackageRpc: <TData = JsonValue>(method: string, input?: JsonValue, options?: RpcOptions) => RpcState<TData>;
183
+ readonly usePackageCall: () => PackageCall;
184
+ readonly usePackageMutation: <TInput extends JsonValue | undefined, TOutput = JsonValue>(method: string, options?: MutationOptions) => Mutation<TInput, TOutput>;
185
+ readonly usePackageSettings: <TSettings extends SettingsDefinition | undefined = undefined>(settings?: TSettings) => PackageSettings<TSettings>;
186
+ readonly useViewer: () => Viewer;
187
+ readonly useLocale: () => Locale;
188
+ readonly useTheme: () => Theme;
189
+ readonly usePortalContainer: () => HTMLElement | null;
190
+ readonly usePackageRoute: () => PackageRoute;
191
+ readonly usePackageNavigate: () => PackageNavigate;
192
+ readonly usePlatformNavigate: () => PlatformNavigate;
193
+ readonly PackageLink: ComponentType<PackageLinkProps>;
194
+ readonly PlatformLink: ComponentType<PlatformLinkProps>;
195
+ };
196
+ //#endregion
197
+ //#region src/ui/index.d.ts
198
+ /**
199
+ * The package drawn.
200
+ *
201
+ * @returns Its id, release and name.
202
+ */
203
+ export declare function usePackage(): PackageInfo;
204
+ /**
205
+ * One entity of the house, live.
206
+ *
207
+ * @param entityId - The entity.
208
+ * @returns It, or undefined while it is not known.
209
+ */
210
+ export declare function useEntity(entityId: EntityId): EntityView | undefined;
211
+ /**
212
+ * Entities of the house, live: the package's own unless the filter says otherwise.
213
+ *
214
+ * @param filter - Whose, of which domain, which ids.
215
+ * @returns Them.
216
+ */
217
+ export declare function useEntities(filter?: EntitiesFilter): readonly EntityView[];
218
+ /**
219
+ * One of the package's custom entities, live and typed by its entity type.
220
+ *
221
+ * @param type - The entity type.
222
+ * @param entityId - The entity.
223
+ * @returns Its values, its availability, and a way to send it commands.
224
+ */
225
+ export declare function useCustomEntity<TType extends EntityTypeDefinition>(type: TType, entityId: EntityId): CustomEntityState<TType>;
226
+ /**
227
+ * Sends commands, as a control does, with the viewer's permissions.
228
+ *
229
+ * @returns What sends one.
230
+ */
231
+ export declare function useCommand(): SendCommand;
232
+ /**
233
+ * Reads one of the package's methods, again when the input changes.
234
+ *
235
+ * @param method - The method.
236
+ * @param input - What it is handed.
237
+ * @param options - How often, and whether at all.
238
+ * @returns The data, the error, whether it loads, and a way to read it again.
239
+ */
240
+ export declare function usePackageRpc<TData = JsonValue>(method: string, input?: JsonValue, options?: RpcOptions): RpcState<TData>;
241
+ /**
242
+ * Calls the package's methods on demand.
243
+ *
244
+ * @returns What calls one.
245
+ */
246
+ export declare function usePackageCall(): PackageCall;
247
+ /**
248
+ * A method that changes something: its call, whether it runs, its error. Once done, the
249
+ * package's reads are refreshed.
250
+ *
251
+ * @param method - The method.
252
+ * @param options - Which reads it refreshes.
253
+ * @returns The mutation.
254
+ */
255
+ export declare function usePackageMutation<TInput extends JsonValue | undefined, TOutput = JsonValue>(method: string, options?: MutationOptions): Mutation<TInput, TOutput>;
256
+ /**
257
+ * The package's settings, to show and - for whoever may configure it - to change.
258
+ *
259
+ * @param settings - Their declaration, for their types; plain JSON without it.
260
+ * @returns Their values, a way to save some, and whether the viewer may.
261
+ */
262
+ export declare function usePackageSettings<TSettings extends SettingsDefinition | undefined = undefined>(settings?: TSettings): PackageSettings<TSettings>;
263
+ /**
264
+ * Who is looking.
265
+ *
266
+ * @returns The viewer, and what they may do.
267
+ */
268
+ export declare function useViewer(): Viewer;
269
+ /**
270
+ * The viewer's language and time zone.
271
+ *
272
+ * @returns Them, for `Intl`.
273
+ */
274
+ export declare function useLocale(): Locale;
275
+ /**
276
+ * The theme the interface draws in, for what draws its own colours: a canvas, a chart.
277
+ *
278
+ * @returns Light or dark.
279
+ */
280
+ export declare function useTheme(): Theme;
281
+ /**
282
+ * A node inside the package's scope, for portals: what is drawn outside it is unstyled.
283
+ *
284
+ * @returns The node, or null before it is there.
285
+ */
286
+ export declare function usePortalContainer(): HTMLElement | null;
287
+ /**
288
+ * Where the package's page is.
289
+ *
290
+ * @returns Its path, segments and query.
291
+ */
292
+ export declare function usePackageRoute(): PackageRoute;
293
+ /**
294
+ * Goes to a path of the package's page.
295
+ *
296
+ * @returns What goes there.
297
+ */
298
+ export declare function usePackageNavigate(): PackageNavigate;
299
+ /**
300
+ * Goes to a place of the platform.
301
+ *
302
+ * @returns What goes there.
303
+ */
304
+ export declare function usePlatformNavigate(): PlatformNavigate;
305
+ /**
306
+ * A link to a path of the package's page, from its page, a card or a view.
307
+ *
308
+ * @param props - Where it goes, and an anchor's attributes.
309
+ * @returns The link.
310
+ */
311
+ export declare function PackageLink(props: PackageLinkProps): ReactElement;
312
+ /**
313
+ * A link to a place of the platform.
314
+ *
315
+ * @param props - Where it goes, and an anchor's attributes.
316
+ * @returns The link.
317
+ */
318
+ export declare function PlatformLink(props: PlatformLinkProps): ReactElement;
319
+ //#endregion
320
+ export type { CardProps, CustomEntityState, EntitiesFilter, EntityView, EntityViewProps, Locale, Mutation, MutationOptions, PackageCall, PackageInfo, PackageLinkProps, PackageNavigate, PackageRoute, PackageSettings, PageProps, PlatformLinkProps, PlatformNavigate, PlatformTarget, RpcOptions, RpcState, SendCommand, SettingsPatch, Theme, UiHost, Viewer, VisibleSettings };
package/dist/ui.js ADDED
@@ -0,0 +1,180 @@
1
+ import { n as UI_MODULE, r as hostMember } from "./chunks/host.js";
2
+ import { createElement } from "react";
3
+ //#region src/ui/index.ts
4
+ /**
5
+ * `@nebulahome/package-sdk/ui`: what a package's page, cards and entity views are written with
6
+ * (PACKAGES_DOCS.md 6).
7
+ *
8
+ * Every hook and link here forwards to the interface's own implementation, which it lends the
9
+ * package at run time ({@link UiHost}): the package draws with the interface's React, its data
10
+ * and its session. What a package bundles of this module is these forwarders.
11
+ */
12
+ /**
13
+ * The interface's implementation of one member of `/ui`.
14
+ *
15
+ * @param name - The member.
16
+ * @param since - The SDK version that added it.
17
+ * @returns The implementation.
18
+ */
19
+ function ui(name, since) {
20
+ return hostMember(UI_MODULE, name, since);
21
+ }
22
+ /**
23
+ * The package drawn.
24
+ *
25
+ * @returns Its id, release and name.
26
+ */
27
+ function usePackage() {
28
+ return ui("usePackage", "1.0")();
29
+ }
30
+ /**
31
+ * One entity of the house, live.
32
+ *
33
+ * @param entityId - The entity.
34
+ * @returns It, or undefined while it is not known.
35
+ */
36
+ function useEntity(entityId) {
37
+ return ui("useEntity", "1.0")(entityId);
38
+ }
39
+ /**
40
+ * Entities of the house, live: the package's own unless the filter says otherwise.
41
+ *
42
+ * @param filter - Whose, of which domain, which ids.
43
+ * @returns Them.
44
+ */
45
+ function useEntities(filter) {
46
+ return ui("useEntities", "1.0")(filter);
47
+ }
48
+ /**
49
+ * One of the package's custom entities, live and typed by its entity type.
50
+ *
51
+ * @param type - The entity type.
52
+ * @param entityId - The entity.
53
+ * @returns Its values, its availability, and a way to send it commands.
54
+ */
55
+ function useCustomEntity(type, entityId) {
56
+ return ui("useCustomEntity", "1.0")(type, entityId);
57
+ }
58
+ /**
59
+ * Sends commands, as a control does, with the viewer's permissions.
60
+ *
61
+ * @returns What sends one.
62
+ */
63
+ function useCommand() {
64
+ return ui("useCommand", "1.0")();
65
+ }
66
+ /**
67
+ * Reads one of the package's methods, again when the input changes.
68
+ *
69
+ * @param method - The method.
70
+ * @param input - What it is handed.
71
+ * @param options - How often, and whether at all.
72
+ * @returns The data, the error, whether it loads, and a way to read it again.
73
+ */
74
+ function usePackageRpc(method, input, options) {
75
+ return ui("usePackageRpc", "1.0")(method, input, options);
76
+ }
77
+ /**
78
+ * Calls the package's methods on demand.
79
+ *
80
+ * @returns What calls one.
81
+ */
82
+ function usePackageCall() {
83
+ return ui("usePackageCall", "1.0")();
84
+ }
85
+ /**
86
+ * A method that changes something: its call, whether it runs, its error. Once done, the
87
+ * package's reads are refreshed.
88
+ *
89
+ * @param method - The method.
90
+ * @param options - Which reads it refreshes.
91
+ * @returns The mutation.
92
+ */
93
+ function usePackageMutation(method, options) {
94
+ return ui("usePackageMutation", "1.0")(method, options);
95
+ }
96
+ /**
97
+ * The package's settings, to show and - for whoever may configure it - to change.
98
+ *
99
+ * @param settings - Their declaration, for their types; plain JSON without it.
100
+ * @returns Their values, a way to save some, and whether the viewer may.
101
+ */
102
+ function usePackageSettings(settings) {
103
+ return ui("usePackageSettings", "1.0")(settings);
104
+ }
105
+ /**
106
+ * Who is looking.
107
+ *
108
+ * @returns The viewer, and what they may do.
109
+ */
110
+ function useViewer() {
111
+ return ui("useViewer", "1.0")();
112
+ }
113
+ /**
114
+ * The viewer's language and time zone.
115
+ *
116
+ * @returns Them, for `Intl`.
117
+ */
118
+ function useLocale() {
119
+ return ui("useLocale", "1.0")();
120
+ }
121
+ /**
122
+ * The theme the interface draws in, for what draws its own colours: a canvas, a chart.
123
+ *
124
+ * @returns Light or dark.
125
+ */
126
+ function useTheme() {
127
+ return ui("useTheme", "1.0")();
128
+ }
129
+ /**
130
+ * A node inside the package's scope, for portals: what is drawn outside it is unstyled.
131
+ *
132
+ * @returns The node, or null before it is there.
133
+ */
134
+ function usePortalContainer() {
135
+ return ui("usePortalContainer", "1.0")();
136
+ }
137
+ /**
138
+ * Where the package's page is.
139
+ *
140
+ * @returns Its path, segments and query.
141
+ */
142
+ function usePackageRoute() {
143
+ return ui("usePackageRoute", "1.0")();
144
+ }
145
+ /**
146
+ * Goes to a path of the package's page.
147
+ *
148
+ * @returns What goes there.
149
+ */
150
+ function usePackageNavigate() {
151
+ return ui("usePackageNavigate", "1.0")();
152
+ }
153
+ /**
154
+ * Goes to a place of the platform.
155
+ *
156
+ * @returns What goes there.
157
+ */
158
+ function usePlatformNavigate() {
159
+ return ui("usePlatformNavigate", "1.0")();
160
+ }
161
+ /**
162
+ * A link to a path of the package's page, from its page, a card or a view.
163
+ *
164
+ * @param props - Where it goes, and an anchor's attributes.
165
+ * @returns The link.
166
+ */
167
+ function PackageLink(props) {
168
+ return createElement(ui("PackageLink", "1.0"), props);
169
+ }
170
+ /**
171
+ * A link to a place of the platform.
172
+ *
173
+ * @param props - Where it goes, and an anchor's attributes.
174
+ * @returns The link.
175
+ */
176
+ function PlatformLink(props) {
177
+ return createElement(ui("PlatformLink", "1.0"), props);
178
+ }
179
+ //#endregion
180
+ export { PackageLink, PlatformLink, useCommand, useCustomEntity, useEntities, useEntity, useLocale, usePackage, usePackageCall, usePackageMutation, usePackageNavigate, usePackageRoute, usePackageRpc, usePackageSettings, usePlatformNavigate, usePortalContainer, useTheme, useViewer };
package/dist/vite.d.ts ADDED
@@ -0,0 +1,88 @@
1
+ import { LogLevel, Plugin } from "vite";
2
+ //#region src/generate/problems.d.ts
3
+ /**
4
+ * What is wrong with a package's declaration, every problem at once and each with where it is,
5
+ * so an author fixes them in one pass rather than one build at a time.
6
+ */
7
+ /** Thrown when a declaration does not hold together. */
8
+ export declare class PackageConfigError extends Error {
9
+ /** Every problem, one line each: `cards[0].options.days: …`. */
10
+ readonly problems: readonly string[];
11
+ /**
12
+ * Gathers the problems.
13
+ *
14
+ * @param problems - Each problem, with where it is.
15
+ */
16
+ constructor(problems: readonly string[]);
17
+ }
18
+ //#endregion
19
+ //#region src/generate/manifest.d.ts
20
+ /** What a release holds, generated. */
21
+ type GeneratedPackage = {
22
+ /** `nebula.package.json`, as the platform reads it. */
23
+ readonly manifest: Readonly<Record<string, unknown>>;
24
+ /** `setup.json`, or null for a package with no settings. */
25
+ readonly setup: Readonly<Record<string, unknown>> | null;
26
+ /** Files of the declaration to copy into the release: from the config's folder, to the release. */
27
+ readonly copies: readonly {
28
+ readonly from: string;
29
+ readonly to: string;
30
+ }[];
31
+ /** The server's entry module, from the config's folder, or null. */
32
+ readonly server: string | null;
33
+ /** Whether the package draws anything: a page, cards or entity views. */
34
+ readonly hasUi: boolean;
35
+ };
36
+ //#endregion
37
+ //#region src/vite/build.d.ts
38
+ /** What building takes. */
39
+ type BuildOptions = {
40
+ /** The package's folder: the working directory when not said. */
41
+ readonly root?: string;
42
+ /** How much Vite says. */
43
+ readonly logLevel?: LogLevel;
44
+ };
45
+ /** A package, checked: its declaration and what it generates, before anything is built. */
46
+ type CheckedPackage = {
47
+ readonly root: string;
48
+ readonly configPath: string;
49
+ readonly outDir: string;
50
+ readonly definition: unknown;
51
+ readonly packageJson: Readonly<Record<string, unknown>>;
52
+ readonly generated: GeneratedPackage;
53
+ };
54
+ /**
55
+ * Checks a package without building it: its declaration against the platform's schemas, and the
56
+ * files it names.
57
+ *
58
+ * @param options - Where the package is.
59
+ * @returns The package, checked.
60
+ * @throws {PackageConfigError} With every problem, when it does not hold together.
61
+ */
62
+ export declare function checkPackage(options?: BuildOptions): Promise<CheckedPackage>;
63
+ /**
64
+ * Builds a package's release into its `outDir`: checked, both halves built, the manifest written.
65
+ *
66
+ * @param options - Where the package is, and how much Vite says.
67
+ * @returns The package, as released.
68
+ * @throws {PackageConfigError} With every problem, when it does not hold together.
69
+ */
70
+ export declare function buildPackage(options?: BuildOptions): Promise<CheckedPackage>;
71
+ //#endregion
72
+ //#region src/vite/plugin.d.ts
73
+ /** What `nebula()` takes. */
74
+ type NebulaOptions = {
75
+ /** The package's declaration, relative to the root: `nebula.config.ts` when not said. */
76
+ readonly config?: string;
77
+ /** Where the release is staged: `dist` when not said. */
78
+ readonly outDir?: string;
79
+ };
80
+ /**
81
+ * The plugin that builds a package's interface and server.
82
+ *
83
+ * @param options - Where its config is, and where the release goes.
84
+ * @returns The plugin.
85
+ */
86
+ export declare function nebula(options?: NebulaOptions): Plugin;
87
+ //#endregion
88
+ export type { BuildOptions, CheckedPackage, NebulaOptions };
package/dist/vite.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as checkPackage, r as nebula, t as buildPackage, w as PackageConfigError } from "./chunks/node-build.js";
2
+ export { PackageConfigError, buildPackage, checkPackage, nebula };