@septkit/shell-lib 0.0.34 → 0.0.36

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/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export type * from './types';
2
2
  export { SHELL_DB_PREFIX, LIBRARY_DB_PREFIX, TEMP_DOCUMENT_PREFIX, TEMP_PROJECT_PREFIX, RESERVED_DB_PREFIXES, isReservedDatabaseName, } from './constants';
3
- export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, } from './shell-context';
3
+ export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, getProjectStorage, } from './shell-context';
package/dist/index.js CHANGED
@@ -9,8 +9,13 @@ function a(e) {
9
9
  return i.some((t) => e.startsWith(t));
10
10
  }
11
11
  //#endregion
12
- //#region node_modules/.pnpm/@dialecte+core@0.8.0/node_modules/@dialecte/core/dist/utils-USNkj4sT.js
13
- var o = "https://dialecte.github.io/core", s = {
12
+ //#region node_modules/.pnpm/@dialecte+core@0.10.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js
13
+ var o = "https://dialecte.github.io/core", s = /* @__PURE__ */ new Set([
14
+ "throwDialecteError",
15
+ "createDialecteError",
16
+ "invariant",
17
+ "reportFailure"
18
+ ]), c = {
14
19
  UNKNOWN: {
15
20
  code: "D0001",
16
21
  message: "An unknown error occurred",
@@ -24,7 +29,7 @@ var o = "https://dialecte.github.io/core", s = {
24
29
  code: "D0002",
25
30
  message: "Assertion failed",
26
31
  explanation: {
27
- when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, an engine running an sqlite-wasm older than 3.54.1, which removes a project on a failed install).",
32
+ when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, a store running on a dependency older than the one it supports).",
28
33
  fix: "Read `detail`: it names the condition. Give `invariant` a key of its own when the failure is one a caller should handle.",
29
34
  docs: `${o}/guide/development/state-and-errors#error-catalog`
30
35
  }
@@ -33,8 +38,8 @@ var o = "https://dialecte.github.io/core", s = {
33
38
  code: "D1001",
34
39
  message: "Failed to open database",
35
40
  explanation: {
36
- when: "The project's database could not be opened (the SQLite file or its worker did not start), or the origin's hub could not be joined: its SharedWorker failed to start or was blocked, or a child's port went unanswered past the welcome budget (its page unbound it).",
37
- fix: "Check the browser supports the store (OPFS, workers, SharedWorker for the hub) and that no other tab holds the project; reload, or open the project with another storage. A child view refused so is bound again by its page (`createHubPort`, then `adoptHubPort`).",
41
+ when: "The store could not open the project's data, or could not reach what serves it (its database, a worker, a server): it failed to start, was blocked, or went unanswered; the failure is the `cause` when there is one.",
42
+ fix: "Check the browser supports what the store needs and that no other tab holds the project; reload, or open the project with another storage. The store's own docs name what it needs.",
38
43
  docs: `${o}/api/project#store-errors`
39
44
  }
40
45
  },
@@ -123,38 +128,11 @@ var o = "https://dialecte.github.io/core", s = {
123
128
  code: "D1011",
124
129
  message: "Failed to read from database",
125
130
  explanation: {
126
- when: "The SQLite store's database failed under a read; the failure is the `cause`.",
131
+ when: "The store's database failed under a read; the failure is the `cause`.",
127
132
  fix: "Read `cause`; reopen the project. A lasting failure means the file is damaged: import its documents again.",
128
133
  docs: `${o}/api/project#store-errors`
129
134
  }
130
135
  },
131
- STORE_PROTOCOL_MISMATCH: {
132
- code: "D1012",
133
- message: "Another version of the library holds the shared store connection",
134
- explanation: {
135
- when: "Another version of the library already holds the shared store connection (another tab runs an older or newer build).",
136
- fix: "Close the other tabs of the app, or reload them all on the same version.",
137
- docs: `${o}/api/project#store-errors`
138
- }
139
- },
140
- STORE_REALM_ID_TAKEN: {
141
- code: "D1013",
142
- message: "A view with this id is already connected to the shared store",
143
- explanation: {
144
- when: "A view joined the shared store with an id another connected view already uses.",
145
- fix: "Give each view its own id; reload the page that reused one.",
146
- docs: `${o}/api/project#store-errors`
147
- }
148
- },
149
- STORE_REALM_UNKNOWN: {
150
- code: "D1014",
151
- message: "The shared store does not know this view",
152
- explanation: {
153
- when: "A view spoke to the shared store without having joined it, or after it left.",
154
- fix: "Join (open the project) before reading or writing; reload a view that was disconnected.",
155
- docs: `${o}/api/project#store-errors`
156
- }
157
- },
158
136
  STORE_VALUE_NOT_JSON: {
159
137
  code: "D1015",
160
138
  message: "A value handed to the store is not JSON",
@@ -168,8 +146,8 @@ var o = "https://dialecte.github.io/core", s = {
168
146
  code: "D1016",
169
147
  message: "This browser gives the page no storage for a project",
170
148
  explanation: {
171
- when: "The browser gives the page no private file system (a private window), or a worker no synchronous file access, so the SQLite project store cannot create, open or destroy the project; nothing is changed.",
172
- fix: "Open the app in a normal (not private) window of a browser that supports the origin private file system.",
149
+ when: "The browser gives the page none of the storage the store needs (a private window, an API the browser lacks), so it cannot create, open or destroy the project; nothing is changed.",
150
+ fix: "Open the app in a normal (not private) window of a browser that supports what the project's store needs, or open the project with another storage.",
173
151
  docs: `${o}/api/project#store-errors`
174
152
  }
175
153
  },
@@ -177,27 +155,27 @@ var o = "https://dialecte.github.io/core", s = {
177
155
  code: "D1017",
178
156
  message: "Not enough storage left for the project",
179
157
  explanation: {
180
- when: "The origin has too little storage left: for a new project's files, for an import (eight times the file's size and at least 1 MiB, less the project's free pages), or the file system refused a write for want of space; nothing of the call applied. The SQLite project store answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`) until it moves to SQLite; the in-memory store has no limit.",
158
+ when: "The origin has too little storage left for what the call needs (a new project's files, an import's room ahead of it), or the store's storage refused a write for want of space; nothing of the call applied. A store that checks the room it needs answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`); the in-memory store has no limit.",
181
159
  fix: "Free storage for the origin (delete projects no longer needed) or import a smaller file, then try again; `meta.needed` and `meta.available` give the sizes when known.",
182
160
  docs: `${o}/api/project#store-errors`
183
161
  }
184
162
  },
185
- STORE_ENGINE_LOST: {
163
+ STORE_CONNECTION_LOST: {
186
164
  code: "D1018",
187
- message: "The project engine stopped answering",
165
+ message: "The store lost its connection",
188
166
  explanation: {
189
- when: "A call to a project engine served from a worker lost that engine: it ended with what hosted it or gave no answer within its budget (`meta.reason` `'host-gone'`), it sent nothing for too long while the call waited (`'no-heartbeat'`, it may still finish), or the hub dropped this view with the page that bound it - frozen, gone, or unbinding it (`'realm-dropped'`: every call, `getWriteOutcome` too, is refused so until the view is bound again).",
190
- fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (a silent engine may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. For `'realm-dropped'`, every call is refused until the page binds the view again once it is back (`onRejoined`, then `createHubPort`, its port handed to the view's `adoptHubPort`).",
191
- docs: `${o}/api/project#store-errors`
167
+ when: "A call to a store whose project is served elsewhere (a worker, another realm, a server) lost its connection to what serves it: that went away or gave no answer within its budget, sent nothing for too long while the call waited (the call may still finish), or dropped this view. `meta.reason` is the store's own word for why, listed in its docs; a write's refusal carries `meta.writeId`.",
168
+ fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (what serves the store may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. The store's docs say what each `meta.reason` asks of the app.",
169
+ docs: `${o}/api/project#a-lost-connection`
192
170
  }
193
171
  },
194
- STORE_HUB_SPAWNERS_FIXED: {
195
- code: "D1019",
196
- message: "The page's hub connection runs another version of this dialecte's engine",
172
+ STORE_KIND_TAKEN: {
173
+ code: "D1021",
174
+ message: "This storage type is registered already by another kind",
197
175
  explanation: {
198
- when: "`connectHub({ spawners })` named a dialecte whose engine the page's connection already runs at another version, or a project was opened (or destroyed by name) on `sqlite` from a factory of such a version (the project offers its engine to the hub as it opens): a page runs one version of each dialecte's engine (two would split a project's views between two engines). A later call adds the engines of dialectes the page does not run yet. `meta.spawners` names the dialectes (id and version) refused; nothing of the call was added, nothing opened.",
199
- fix: "Ship one version of each dialecte in the app: register each dialecte's `factory.spawner` from the copy the app opens its projects with.",
200
- docs: `${o}/api/project#store-errors`
176
+ when: "`registerStorageKind({ type, kind })` named a type a kind of another `id` holds already: the first registration in the realm is kept, nothing replaced (the same `id` again does nothing: a module evaluated twice, or another copy of the package). `meta`: `type`, `registered` (the id kept), `asked` (the id refused).",
177
+ fix: "Register each storage type once, from one package: import the entry that registers it from a single copy, or give the other kind a type of its own.",
178
+ docs: `${o}/guide/development/implementing-a-store#register-a-storage-kind`
201
179
  }
202
180
  },
203
181
  ELEMENT_NOT_FOUND: {
@@ -488,47 +466,20 @@ var o = "https://dialecte.github.io/core", s = {
488
466
  docs: `${o}/api/project#blobs`
489
467
  }
490
468
  },
491
- PROJECT_LAYOUT_OUTDATED: {
492
- code: "D7005",
493
- message: "Project stored by another version of the library",
494
- explanation: {
495
- when: "The project file was stored by another version of the library (another layout); nothing was written to it.",
496
- fix: "Delete the project and import its files again with this version.",
497
- docs: `${o}/api/project#store-errors`
498
- }
499
- },
500
- PROJECT_ENGINE_UNAVAILABLE: {
501
- code: "D7006",
502
- message: "No view can start the project engine",
503
- explanation: {
504
- when: "The project's engine could not be started or reached: its worker failed to load or never answered its open within the open budget; through the origin's hub, no open view offers an engine for the project's dialecte, or the engine never said it opened; a destroy still running past the open budget, or one asked by a page suspended before the hub granted it.",
505
- fix: "Keep one tab of the app open and reload; check the dialecte's `engineUrl` points at its worker and that it loads (the console names a script that fails); a destroy refused so is asked again once the project is closed elsewhere.",
506
- docs: `${o}/api/project#store-errors`
507
- }
508
- },
509
- PROJECT_ENGINE_BUSY: {
510
- code: "D7007",
511
- message: "The project is still held by another engine",
512
- explanation: {
513
- when: "Another engine still holds the project (another tab or a worker that did not stop).",
514
- fix: "Close the other tabs of the app, then open the project again.",
515
- docs: `${o}/api/project#store-errors`
516
- }
517
- },
518
469
  PROJECT_DIALECTE_MISMATCH: {
519
470
  code: "D7008",
520
- message: "The project's engine or file is of another dialecte",
471
+ message: "The project's data is of another dialecte",
521
472
  explanation: {
522
- when: "A project file stored by another dialecte was opened (nothing of it written); or an engine was asked for a project of another dialecte than its own - the dialecte's `engineUrl` (its project factory's, or a hub spawner's) pointing at another dialecte's worker. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `projectDialecteId` (the engine's or the file's), `realmDialecteId` (the one asked).",
523
- fix: "Open the project with the dialecte it was created with; point the dialecte's `engineUrl` at its own worker.",
473
+ when: "A project stored by another dialecte was opened (nothing of it written), or what serves the store (a worker, a server) was asked for a project of a dialecte it does not serve. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `realmDialecteId` (the one asked), and `projectDialecteId` (the project's), or the dialectes served, as the store's docs name them.",
474
+ fix: "Open the project with the dialecte it was created with; serve every dialecte the app opens projects of, as the store's docs say.",
524
475
  docs: `${o}/api/project#store-errors`
525
476
  }
526
477
  },
527
478
  PROJECT_DIALECTE_VERSION_MISMATCH: {
528
479
  code: "D7009",
529
- message: "The project engine runs another version of the dialecte",
480
+ message: "The project's store runs another version of the dialecte",
530
481
  explanation: {
531
- when: "The project's engine runs another version of the dialecte than this view.",
482
+ when: "What serves the project's store (a worker, a server) runs another version of the dialecte than this view: another tab's, or one this page runs already for the project (a page runs one version of each dialecte).",
532
483
  fix: "Reload every tab of the app so they run the same version.",
533
484
  docs: `${o}/api/project#store-errors`
534
485
  }
@@ -537,7 +488,7 @@ var o = "https://dialecte.github.io/core", s = {
537
488
  code: "D7010",
538
489
  message: "The project could not be deleted",
539
490
  explanation: {
540
- when: "Destroying a project left its files in place: another tab or worker still holds one.",
491
+ when: "Destroying a project left its data in place: another tab, window or connection still holds it.",
541
492
  fix: "Close the other tabs or windows of the app that have the project open, then destroy it again.",
542
493
  docs: `${o}/api/project#lifecycle`
543
494
  }
@@ -551,20 +502,11 @@ var o = "https://dialecte.github.io/core", s = {
551
502
  docs: `${o}/api/project#lifecycle`
552
503
  }
553
504
  },
554
- PROJECT_DATABASE_LOST: {
555
- code: "D7012",
556
- message: "The project's database is gone",
557
- explanation: {
558
- when: "The project's files hold data but none of them is its database any more: the database file's header was damaged (by the disk, another program, or site data changed outside the app). Nothing is opened or changed: no empty database is made in its place. `meta.project` names the project.",
559
- fix: "The project's data cannot be read back. Offer the user a reset, never automatically: `destroy()` on the same Project instance whose `open` was refused (keep it: `const project = new Project(params)`, then `await project.open(name)`) removes what the refused store holds, without opening it; `open(name)` then makes it again, empty, and its documents can be imported again.",
560
- docs: `${o}/api/project#lifecycle`
561
- }
562
- },
563
505
  PROJECT_DESTROYED_WHILE_AWAY: {
564
506
  code: "D7013",
565
507
  message: "The project was deleted while this view was away",
566
508
  explanation: {
567
- when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, its engine started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",
509
+ when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, what serves its store started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",
568
510
  fix: "Tell the user the project was deleted elsewhere; close it in this view (`project.close()`), then open it again by its name for what is there now, or choose another.",
569
511
  docs: `${o}/api/project#lifecycle`
570
512
  }
@@ -573,27 +515,18 @@ var o = "https://dialecte.github.io/core", s = {
573
515
  code: "D7014",
574
516
  message: "The project's name cannot name its files",
575
517
  explanation: {
576
- when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a SQLite project's files sit in a directory named after both, which no directory can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",
518
+ when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a store may name its files after both, which no file can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",
577
519
  fix: "Give the project a name of its own (and the dialecte an id) other than an empty one, `.` or `..`.",
578
520
  docs: `${o}/api/project#lifecycle`
579
521
  }
580
522
  },
581
- PROJECT_ENGINE_NOT_DECLARED: {
582
- code: "D7015",
583
- message: "This project has no engine to open it on SQLite",
584
- explanation: {
585
- when: "A project was opened on `storage: { type: 'sqlite' }` but made by no dialecte's project factory: its engine (the dialecte's id, its version and its engine worker's URL) is known to no one, so nothing can start it. Nothing was opened.",
586
- fix: "Make the project with the dialecte's project factory (`createProjectFactory({ dialecte, engineUrl })`, as a dialecte package exports it), or open it on another storage.",
587
- docs: `${o}/api/project#sqlite-storage`
588
- }
589
- },
590
- PROJECT_SQLITE_NOT_IMPORTED: {
591
- code: "D7016",
592
- message: "SQLite storage needs `import '@dialecte/core/sqlite'`",
523
+ PROJECT_STORAGE_NOT_REGISTERED: {
524
+ code: "D7018",
525
+ message: "The project's storage type is not registered",
593
526
  explanation: {
594
- when: "A project was opened (or destroyed by name) on `storage: { type: 'sqlite' }`, or a test asked for the `sqlite` test store, but the app never imported `@dialecte/core/sqlite`: the SQLite storage kind lives behind that entry, so an app that never imports it neither emits nor downloads the SQLite engine, its wasm or the hub. Nothing was opened.",
595
- fix: "Add `import '@dialecte/core/sqlite'` once to the app's entry (for tests, to the test runner's setup file), before the first project is opened on SQLite; or open the project on another storage. Imported already? The import registers the kind for every copy of @dialecte/core of the same SQLite storage version in the realm: a copy of another one (a dialecte bringing its own core) does not see it - align the core versions.",
596
- docs: `${o}/api/project#sqlite-storage`
527
+ when: "A project was opened (or destroyed by name), or a test asked for a test store, on a `storage.type` no kind is registered for in this realm: core serves `local`, `inMemory` and `custom` itself, every other type comes from the entry that registers it (`registerStorageKind`). Nothing was opened. `meta`: `project`, `type`.",
528
+ fix: "Import the entry that registers the type once in the app's entry (for tests, in the test runner's setup file), before the first project opens on it; or open the project on another storage. Imported already? A kind is shared by every copy of @dialecte/core of the same storage version in the realm: one registered by a copy of another version (a package bringing its own core) is not seen - align the core versions.",
529
+ docs: `${o}/guide/development/implementing-a-store#register-a-storage-kind`
597
530
  }
598
531
  },
599
532
  DOCUMENT_PATH_INVALID: {
@@ -615,13 +548,14 @@ var o = "https://dialecte.github.io/core", s = {
615
548
  }
616
549
  }
617
550
  };
618
- function c(e, t) {
619
- throw l(e, t);
620
- }
551
+ new Set(Object.values(c).map((e) => e.code));
621
552
  function l(e, t) {
553
+ throw u(e, t);
554
+ }
555
+ function u(e, t) {
622
556
  let n = typeof e == "string" ? {
623
557
  key: e,
624
- ...s[e]
558
+ ...c[e]
625
559
  } : e, r = {
626
560
  code: n.code,
627
561
  key: n.key,
@@ -634,13 +568,6 @@ function l(e, t) {
634
568
  }, i = Error(t.detail);
635
569
  return i.cause = r, i;
636
570
  }
637
- new Set(Object.values(s).map((e) => e.code));
638
- var u = /* @__PURE__ */ new Set([
639
- "throwDialecteError",
640
- "createDialecteError",
641
- "invariant",
642
- "reportFailure"
643
- ]);
644
571
  function d(e) {
645
572
  if (!e) return "unknown";
646
573
  let t = e.split("\n").slice(1).map((e) => e.match(/\bat\s+(?:async\s+)?(\S+)(?:\s+\[as\s+[^\]]+\])?\s+\(([^)]+)\)/)).find((e) => !f(e?.[1])), n = t?.[1]?.replace(/^Object\./, ""), r = t?.[2];
@@ -649,7 +576,7 @@ function d(e) {
649
576
  return i ? `${i[1].replace(/\.[^/.]+$/, "")}::${n}` : n;
650
577
  }
651
578
  function f(e) {
652
- return e ? u.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
579
+ return e ? s.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
653
580
  }
654
581
  `${{
655
582
  uri: "http://dialecte.dev/XML/DEV",
@@ -663,7 +590,7 @@ var p = {
663
590
  function m(e, t) {
664
591
  if (e) return;
665
592
  let { detail: n, key: r = "ASSERTION_FAILED", ref: i, meta: a } = t;
666
- c(r, {
593
+ l(r, {
667
594
  detail: n,
668
595
  ref: i,
669
596
  meta: a
@@ -693,5 +620,8 @@ function x() {
693
620
  function S() {
694
621
  return m(h, { detail: "getPwa: shell context not set. Call setShellContext(api) before app.mount()." }), m(h.pwa, { detail: "getPwa: no PWA surface provided by the shell." }), h.pwa;
695
622
  }
623
+ function C() {
624
+ return h?.projectStorage ?? { type: "local" };
625
+ }
696
626
  //#endregion
697
- export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, _ as clearShellContext, y as getActiveDocumentId, b as getCommands, v as getProject, S as getPwa, x as getStorageSources, a as isReservedDatabaseName, g as setShellContext };
627
+ export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, _ as clearShellContext, y as getActiveDocumentId, b as getCommands, v as getProject, C as getProjectStorage, S as getPwa, x as getStorageSources, a as isReservedDatabaseName, g as setShellContext };
@@ -1,5 +1,6 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
2
  import { Observable, ShellCommands } from './types/api';
3
+ import { ProjectStorage } from './types/project-storage';
3
4
  import { PwaInstall } from './types/pwa-install';
4
5
  import { StorageSources } from './types/storage-source';
5
6
  interface ShellContext {
@@ -8,6 +9,7 @@ interface ShellContext {
8
9
  commands: ShellCommands;
9
10
  storageSources?: StorageSources;
10
11
  pwa?: PwaInstall;
12
+ projectStorage?: ProjectStorage;
11
13
  }
12
14
  export declare function setShellContext(ctx: ShellContext): void;
13
15
  export declare function clearShellContext(): void;
@@ -16,4 +18,5 @@ export declare function getActiveDocumentId(): Observable<string>;
16
18
  export declare function getCommands(): ShellCommands;
17
19
  export declare function getStorageSources(): StorageSources;
18
20
  export declare function getPwa(): PwaInstall;
21
+ export declare function getProjectStorage(): ProjectStorage;
19
22
  export {};
@@ -1,4 +1,5 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
+ import { ProjectStorage } from './project-storage';
2
3
  import { PwaInstall } from './pwa-install';
3
4
  import { StorageSources } from './storage-source';
4
5
  export interface ShellCommands {
@@ -17,4 +18,5 @@ export interface ExtensionAPI {
17
18
  commands: ShellCommands;
18
19
  storageSources?: StorageSources;
19
20
  pwa?: PwaInstall;
21
+ projectStorage?: ProjectStorage;
20
22
  }
@@ -1,3 +1,4 @@
1
1
  export type * from './api';
2
2
  export type * from './storage-source';
3
3
  export type * from './pwa-install';
4
+ export type * from './project-storage';
@@ -0,0 +1,5 @@
1
+ import { StorageParam } from '@dialecte/core';
2
+ export type {} from '@dialecte/core/sqlite';
3
+ export type ProjectStorage = Extract<StorageParam, {
4
+ type: 'local' | 'sqlite';
5
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@septkit/shell-lib",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@dialecte/core": "0.8.0",
17
- "@dialecte/scl": "0.11.0"
16
+ "@dialecte/core": "0.10.0",
17
+ "@dialecte/scl": "0.16.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "oxlint": "~1.6.0",