hekireki 0.10.2 → 0.20.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/README.md +179 -1189
- package/dist/bin/activerecord.js +1 -1
- package/dist/bin/ajv.js +1 -1
- package/dist/bin/arktype.js +1 -1
- package/dist/bin/atlas.js +1 -1
- package/dist/bin/django.js +1 -1
- package/dist/bin/drizzle.js +1 -1
- package/dist/bin/ecto.js +1 -1
- package/dist/bin/effect.js +1 -1
- package/dist/bin/eloquent.js +1 -1
- package/dist/bin/er.js +6 -0
- package/dist/bin/gorm.js +1 -1
- package/dist/bin/hekireki.js +176 -0
- package/dist/bin/kysely.js +1 -1
- package/dist/bin/pydantic.js +1 -1
- package/dist/bin/sea-orm.js +1 -1
- package/dist/bin/sqlalchemy.js +1 -1
- package/dist/bin/typebox.js +1 -1
- package/dist/bin/valibot.js +1 -1
- package/dist/bin/zod.js +1 -1
- package/dist/{bin-9aHkP_Bs.js → bin-CPb5ZV8W.js} +1436 -1751
- package/dist/file-yN0By3gn.js +48 -0
- package/dist/schema-DwMNeEei.js +823 -0
- package/dist/start-Blp4k61D.js +5764 -0
- package/dist/studio/assets/cells-lAj-v64A.js +2 -0
- package/dist/studio/assets/codicon-Brq4_Ui5.ttf +0 -0
- package/dist/studio/assets/docs-CpeTt3O2.js +34 -0
- package/dist/studio/assets/editor.worker-D9zwrD0f.js +30 -0
- package/dist/studio/assets/enums._name-My5PypWw.js +1 -0
- package/dist/studio/assets/hooks-CiUANSpJ.js +1 -0
- package/dist/studio/assets/index-C4wWEcwe.js +188 -0
- package/dist/studio/assets/index-ZSt1ppSG.css +2 -0
- package/dist/studio/assets/labels-DBXIkmbm.js +1 -0
- package/dist/studio/assets/lazyRouteComponent-DmCXXiGp.js +1 -0
- package/dist/studio/assets/models._name-oUX64rwK.js +1 -0
- package/dist/studio/assets/not-found-DxAsuyR5.js +1 -0
- package/dist/studio/assets/prisma-Bk53qnxm.js +891 -0
- package/dist/studio/assets/prisma-C2rAM-pV.css +1 -0
- package/dist/studio/assets/routes-ZmrohHNP.js +1 -0
- package/dist/studio/assets/schema-gate-DJ_-6NYR.js +1 -0
- package/dist/studio/assets/schema-view-BaoCWAL8.js +8 -0
- package/dist/studio/assets/sql-DpzkSc6F.js +1 -0
- package/dist/studio/assets/useMatch-D73HO_WB.js +1 -0
- package/dist/studio/index.html +16 -0
- package/package.json +53 -25
- package/dist/bin/dbml.js +0 -6
- package/dist/bin/docs.js +0 -6
- package/dist/bin/mermaid-er.d.ts +0 -1
- package/dist/bin/mermaid-er.js +0 -6
- package/dist/cli/index.d.ts +0 -138
- package/dist/cli/index.js +0 -134
- /package/dist/bin/{dbml.d.ts → er.d.ts} +0 -0
- /package/dist/bin/{docs.d.ts → hekireki.d.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NodeFileSystem } from "@effect/platform-node";
|
|
2
|
+
import { Effect, FileSystem, Stream } from "effect";
|
|
3
|
+
//#region src/file/index.ts
|
|
4
|
+
/** The Node.js `FileSystem` service every function below reads from; provide it once at the program boundary. */
|
|
5
|
+
const fileSystemLayer = NodeFileSystem.layer;
|
|
6
|
+
/** Reads a UTF-8 text file. */
|
|
7
|
+
function readFile(path) {
|
|
8
|
+
return Effect.gen(function* () {
|
|
9
|
+
return yield* (yield* FileSystem.FileSystem).readFileString(path);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** Writes text or bytes, replacing the file. */
|
|
13
|
+
function writeFile(path, data) {
|
|
14
|
+
return Effect.gen(function* () {
|
|
15
|
+
const fs = yield* FileSystem.FileSystem;
|
|
16
|
+
return yield* typeof data === "string" ? fs.writeFileString(path, data) : fs.writeFile(path, data);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Creates the directory and its parents; an existing directory is not an error. */
|
|
20
|
+
function makeDirectory(path) {
|
|
21
|
+
return Effect.gen(function* () {
|
|
22
|
+
return yield* (yield* FileSystem.FileSystem).makeDirectory(path, { recursive: true });
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** Lists the entry names of a directory. */
|
|
26
|
+
function readDirectory(path) {
|
|
27
|
+
return Effect.gen(function* () {
|
|
28
|
+
return yield* (yield* FileSystem.FileSystem).readDirectory(path);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** Whether the path exists at all. */
|
|
32
|
+
function exists(path) {
|
|
33
|
+
return Effect.gen(function* () {
|
|
34
|
+
return yield* (yield* FileSystem.FileSystem).exists(path);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** Whether the path is a directory; fails when it does not exist. */
|
|
38
|
+
function isDirectory(path) {
|
|
39
|
+
return Effect.gen(function* () {
|
|
40
|
+
return (yield* (yield* FileSystem.FileSystem).stat(path)).type === "Directory";
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** File events of a directory (paths are relative to it) or of a single file. */
|
|
44
|
+
function watch(path) {
|
|
45
|
+
return Stream.unwrap(Effect.map(FileSystem.FileSystem, (fs) => fs.watch(path)));
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { readDirectory as a, writeFile as c, makeDirectory as i, fileSystemLayer as n, readFile as o, isDirectory as r, watch as s, exists as t };
|