@xtrable-ltd/nanoesis 0.1.21 → 0.1.23
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/adapter-azure-blob.d.ts +12 -3
- package/dist/adapter-azure-blob.js +16 -1
- package/dist/adapter-fs.d.ts +11 -2
- package/dist/adapter-fs.js +14 -1
- package/dist/{chunk-26VCV3IE.js → chunk-SHGYQTZ7.js} +317 -203
- package/dist/editor-api.d.ts +102 -2
- package/dist/editor-api.js +7 -1
- package/dist/index.d.ts +17 -1
- package/dist/mcp.js +2 -2
- package/editor/assets/{MigrationsPane-BuDy6yfL.js → MigrationsPane-hBGg21Ij.js} +1 -1
- package/editor/assets/{TemplatesPane-B0p3MU6k.js → TemplatesPane-BzZB6Kts.js} +7 -7
- package/editor/assets/{cssMode-QvwrYsqW.js → cssMode-Ds5VxRKY.js} +1 -1
- package/editor/assets/{freemarker2-Dv-zJ_IC.js → freemarker2-Gw8CKJiZ.js} +1 -1
- package/editor/assets/{handlebars-C1cz1CE1.js → handlebars-DVp1g4p2.js} +1 -1
- package/editor/assets/{html-Bzw5MVgw.js → html-kkPnNaEo.js} +1 -1
- package/editor/assets/{htmlMode-BVD0ozaS.js → htmlMode-BiG4uwoG.js} +1 -1
- package/editor/assets/{index-B55NpHIl.css → index-C9dl_3yI.css} +1 -1
- package/editor/assets/{index-CLQXsAlc.js → index-DxbHJHyK.js} +74 -73
- package/editor/assets/{javascript-CmaCtnu1.js → javascript-BC4Bf5K5.js} +1 -1
- package/editor/assets/{jsonMode-CDzmaDvb.js → jsonMode-lLRUZoYu.js} +1 -1
- package/editor/assets/{liquid-DelfLp1i.js → liquid-BPzeih2Z.js} +1 -1
- package/editor/assets/{mdx-BfB8QRKT.js → mdx-BxKzBYDE.js} +1 -1
- package/editor/assets/{python-ZH9O8Nnr.js → python-DvM64iSM.js} +1 -1
- package/editor/assets/{razor-CpsZTRhn.js → razor-CG83wwEb.js} +1 -1
- package/editor/assets/{tsMode-DnMjBpsC.js → tsMode-D3JNQ8by.js} +1 -1
- package/editor/assets/{typescript-Cb9pXSMO.js → typescript-zv70Ruos.js} +1 -1
- package/editor/assets/{xml-1ERPoWKr.js → xml-CBgqXGl5.js} +1 -1
- package/editor/assets/{yaml-YVqB6TxT.js → yaml-Bg6knfUf.js} +1 -1
- package/editor/index.html +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContainerClient } from '@azure/storage-blob';
|
|
2
|
-
import { BlobStore, ArtifactSink } from '@nanoesis/engine';
|
|
2
|
+
import { BlobStore, ArtifactSink, Storage } from '@nanoesis/engine';
|
|
3
3
|
export { contentTypeFor } from '@nanoesis/engine';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -34,7 +34,7 @@ declare class InMemoryBlobContainer implements BlobContainer {
|
|
|
34
34
|
constructor(seed?: Readonly<Record<string, Uint8Array | string>>);
|
|
35
35
|
list(prefix: string): Promise<readonly string[]>;
|
|
36
36
|
read(name: string): Promise<Uint8Array | null>;
|
|
37
|
-
write(name: string, data: Uint8Array): Promise<void>;
|
|
37
|
+
write(name: string, data: Uint8Array, contentType?: string): Promise<void>;
|
|
38
38
|
remove(name: string): Promise<void>;
|
|
39
39
|
/** Test helper: the current blob names. */
|
|
40
40
|
get names(): readonly string[];
|
|
@@ -90,6 +90,15 @@ declare class BlobArtifactSink implements ArtifactSink {
|
|
|
90
90
|
write(path: string, contents: string | Uint8Array): Promise<void>;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* A ready-made {@link Storage} over an Azure Blob container: get/put/delete (via
|
|
95
|
+
* {@link BlobContainerStore}) plus `wipe` (delete every blob). Pass it to `createEditor`
|
|
96
|
+
* as `editorFiles` (the working container) and `website` (the published `$web` container).
|
|
97
|
+
* For the working container, also pass `enumerate: () => container.list('')` so the editor
|
|
98
|
+
* can reconcile its content index.
|
|
99
|
+
*/
|
|
100
|
+
declare function azureStorage(container: BlobContainer): Storage;
|
|
101
|
+
|
|
93
102
|
/**
|
|
94
103
|
* Pure path/name helper for the blob adapters. Blob storage is a *flat* namespace, a blob
|
|
95
104
|
* is just a name like "content/blog/post.json", so the only mapping the SDK glue needs is
|
|
@@ -100,4 +109,4 @@ declare class BlobArtifactSink implements ArtifactSink {
|
|
|
100
109
|
/** Normalise a site path to a blob name: forward slashes, no leading/trailing slash. */
|
|
101
110
|
declare function normalizeBlobName(path: string): string;
|
|
102
111
|
|
|
103
|
-
export { AzureBlobContainer, BlobArtifactSink, type BlobContainer, BlobContainerStore, InMemoryBlobContainer, normalizeBlobName };
|
|
112
|
+
export { AzureBlobContainer, BlobArtifactSink, type BlobContainer, BlobContainerStore, InMemoryBlobContainer, azureStorage, normalizeBlobName };
|
|
@@ -20,7 +20,8 @@ var InMemoryBlobContainer = class {
|
|
|
20
20
|
async read(name) {
|
|
21
21
|
return this.blobs.get(name) ?? null;
|
|
22
22
|
}
|
|
23
|
-
async write(name, data) {
|
|
23
|
+
async write(name, data, contentType) {
|
|
24
|
+
void contentType;
|
|
24
25
|
this.blobs.set(name, data);
|
|
25
26
|
}
|
|
26
27
|
async remove(name) {
|
|
@@ -117,11 +118,25 @@ var BlobArtifactSink = class {
|
|
|
117
118
|
await this.container.write(name, data, contentTypeFor(name));
|
|
118
119
|
}
|
|
119
120
|
};
|
|
121
|
+
|
|
122
|
+
// ../../adapters/azure-blob/src/azure-storage.ts
|
|
123
|
+
function azureStorage(container) {
|
|
124
|
+
const store = new BlobContainerStore(container);
|
|
125
|
+
return {
|
|
126
|
+
get: (key) => store.get(key),
|
|
127
|
+
put: (key, bytes) => store.put(key, bytes),
|
|
128
|
+
delete: (key) => store.delete(key),
|
|
129
|
+
wipe: async () => {
|
|
130
|
+
for (const name of await container.list("")) await container.remove(name);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
120
134
|
export {
|
|
121
135
|
AzureBlobContainer,
|
|
122
136
|
BlobArtifactSink,
|
|
123
137
|
BlobContainerStore,
|
|
124
138
|
InMemoryBlobContainer,
|
|
139
|
+
azureStorage,
|
|
125
140
|
contentTypeFor,
|
|
126
141
|
normalizeBlobName
|
|
127
142
|
};
|
package/dist/adapter-fs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlobStore, ArtifactSink } from '@nanoesis/engine';
|
|
1
|
+
import { BlobStore, ArtifactSink, Storage } from '@nanoesis/engine';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Filesystem implementation of the engine's {@link BlobStore} port (DESIGN §11c): get /
|
|
@@ -35,4 +35,13 @@ declare class FsArtifactSink implements ArtifactSink {
|
|
|
35
35
|
wipe(): Promise<void>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* A ready-made {@link Storage} over a local directory: get/put/delete (via
|
|
40
|
+
* {@link FsBlobStore}) plus `wipe` (remove the directory). Pass it straight to
|
|
41
|
+
* `createEditor` as `editorFiles` and/or `website` for a zero-implementation local host
|
|
42
|
+
* (DESIGN §11c): `createEditor({ editorFiles: folderStorage('./site'), website:
|
|
43
|
+
* folderStorage('./public'), login: devNoAuth() })`.
|
|
44
|
+
*/
|
|
45
|
+
declare function folderStorage(root: string): Storage;
|
|
46
|
+
|
|
47
|
+
export { FsArtifactSink, FsBlobStore, folderStorage };
|
package/dist/adapter-fs.js
CHANGED
|
@@ -48,7 +48,20 @@ var FsArtifactSink = class {
|
|
|
48
48
|
await rm2(this.root, { recursive: true, force: true });
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
+
|
|
52
|
+
// ../../adapters/fs/src/folder-storage.ts
|
|
53
|
+
import { rm as rm3 } from "fs/promises";
|
|
54
|
+
function folderStorage(root) {
|
|
55
|
+
const blobs = new FsBlobStore(root);
|
|
56
|
+
return {
|
|
57
|
+
get: (key) => blobs.get(key),
|
|
58
|
+
put: (key, bytes) => blobs.put(key, bytes),
|
|
59
|
+
delete: (key) => blobs.delete(key),
|
|
60
|
+
wipe: () => rm3(root, { recursive: true, force: true })
|
|
61
|
+
};
|
|
62
|
+
}
|
|
51
63
|
export {
|
|
52
64
|
FsArtifactSink,
|
|
53
|
-
FsBlobStore
|
|
65
|
+
FsBlobStore,
|
|
66
|
+
folderStorage
|
|
54
67
|
};
|