sliftutils 0.35.0 → 0.36.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/builders/webBuild.ts +8 -1
- package/package.json +1 -1
- package/spec.txt +3 -0
- package/storage/DiskCollection.ts +9 -3
package/builders/webBuild.ts
CHANGED
|
@@ -38,8 +38,8 @@ async function main() {
|
|
|
38
38
|
// Collect all files to copy
|
|
39
39
|
let filesToCopy: string[] = [];
|
|
40
40
|
|
|
41
|
+
filesToCopy.push(yargObj.indexHtml);
|
|
41
42
|
if (hasIndexHtml) {
|
|
42
|
-
filesToCopy.push(yargObj.indexHtml);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Add assets folder files if it exists
|
|
@@ -59,6 +59,8 @@ async function main() {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
let indexHtmlOutput = "";
|
|
63
|
+
|
|
62
64
|
let filesCopied = 0;
|
|
63
65
|
let root = path.resolve(".");
|
|
64
66
|
for (const file of filesToCopy) {
|
|
@@ -70,6 +72,10 @@ async function main() {
|
|
|
70
72
|
let relativePath = path.relative(root, sourcePath);
|
|
71
73
|
let destPath = path.join(yargObj.outputFolder, relativePath);
|
|
72
74
|
|
|
75
|
+
if (file === yargObj.indexHtml) {
|
|
76
|
+
indexHtmlOutput = destPath;
|
|
77
|
+
}
|
|
78
|
+
|
|
73
79
|
let sourceTimestamp = await getTimestamp(sourcePath);
|
|
74
80
|
let destTimestamp = await getTimestamp(destPath);
|
|
75
81
|
if (sourceTimestamp > destTimestamp) {
|
|
@@ -84,6 +90,7 @@ async function main() {
|
|
|
84
90
|
|
|
85
91
|
let duration = Date.now() - time;
|
|
86
92
|
console.log(`Web build completed in ${formatTime(duration)}`);
|
|
93
|
+
console.log(`file://${path.resolve(indexHtmlOutput).replaceAll("\\", "/")}`);
|
|
87
94
|
}
|
|
88
95
|
main().catch(console.error).finally(() => process.exit());
|
|
89
96
|
|
package/package.json
CHANGED
package/spec.txt
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
TODO: Take the half finished apiServer code in vidfrontend, finish the todos, and move it here.
|
|
2
|
+
- Having an alternate version, where we run a server that does watching is nice, it's heavier and does require setting up certificates. but it makes hot reloading faster. And... It can be used to run an actual site that's public.
|
|
3
|
+
|
|
1
4
|
ALSO, go fix our typings in socket-function as well
|
|
2
5
|
|
|
3
6
|
TODO:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNode } from "typesafecss";
|
|
2
2
|
import { DelayedStorage } from "./DelayedStorage";
|
|
3
3
|
import { FileStorage, getFileStorage, getFileStorageNested } from "./FileFolderAPI";
|
|
4
|
-
import { IStorage, IStorageSync } from "./IStorage";
|
|
4
|
+
import { IStorage, IStorageRaw, IStorageSync } from "./IStorage";
|
|
5
5
|
import { JSONStorage } from "./JSONStorage";
|
|
6
6
|
import { StorageSync } from "./StorageObservable";
|
|
7
7
|
import { TransactionStorage } from "./TransactionStorage";
|
|
@@ -90,8 +90,14 @@ export class DiskCollectionBrowser<T> implements IStorageSync<T> {
|
|
|
90
90
|
}
|
|
91
91
|
public transactionStorage: TransactionStorage | undefined;
|
|
92
92
|
async initStorage(): Promise<IStorage<T>> {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
let curCollection: IStorageRaw | undefined;
|
|
94
|
+
if (isNode()) {
|
|
95
|
+
let fileStorage = await getFileStorage();
|
|
96
|
+
let collections = await fileStorage.folder.getStorage("collections");
|
|
97
|
+
curCollection = await collections.folder.getStorage(this.collectionName);
|
|
98
|
+
} else {
|
|
99
|
+
curCollection = await new PrivateFileSystemStorage(`collections/${this.collectionName}`);
|
|
100
|
+
}
|
|
95
101
|
let baseStorage = new TransactionStorage(curCollection, this.collectionName);
|
|
96
102
|
return new JSONStorage<T>(baseStorage);
|
|
97
103
|
}
|