dirvi-lib 0.6.1 → 0.7.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/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/tree-surfer/cursor.d.ts +9 -0
- package/dist/tree-surfer/cursor.d.ts.map +1 -1
- package/dist/tree-surfer/cursor.js +15 -0
- package/dist/tree-surfer/fold-node/fold-node.schema.d.ts +7 -0
- package/dist/tree-surfer/fold-node/fold-node.schema.d.ts.map +1 -0
- package/dist/tree-surfer/fold-node/fold-node.schema.js +16 -0
- package/dist/tree-surfer/index.d.ts +2 -0
- package/dist/tree-surfer/index.d.ts.map +1 -1
- package/dist/tree-surfer/index.js +2 -0
- package/dist/tree-surfer/state.d.ts +6 -0
- package/dist/tree-surfer/state.d.ts.map +1 -1
- package/dist/tree-surfer/state.js +9 -0
- package/dist/tree-surfer/tree-node/tree-node.arb.d.ts +6 -4
- package/dist/tree-surfer/tree-node/tree-node.arb.d.ts.map +1 -1
- package/dist/tree-surfer/tree-node/tree-node.schemas.d.ts +32 -0
- package/dist/tree-surfer/tree-node/tree-node.schemas.d.ts.map +1 -0
- package/dist/tree-surfer/tree-node/tree-node.schemas.js +35 -0
- package/dist/tree-surfer/tree-node/tree-node.types.d.ts +0 -12
- package/dist/tree-surfer/tree-node/tree-node.types.d.ts.map +1 -1
- package/dist/tree-surfer/tree-node/tree-node.types.js +1 -12
- package/dist/tree-surfer-ui/application/intent-to-effect.d.ts +1 -1
- package/dist/tree-surfer-ui/application/intent-to-effect.d.ts.map +1 -1
- package/dist/tree-surfer-ui/application/intent-to-effect.js +3 -13
- package/dist/tree-surfer-ui/application/parse-command.d.ts +4 -0
- package/dist/tree-surfer-ui/application/parse-command.d.ts.map +1 -0
- package/dist/tree-surfer-ui/application/parse-command.js +48 -0
- package/dist/tree-surfer-ui/domain/effect.d.ts +7 -0
- package/dist/tree-surfer-ui/domain/effect.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/domain/posix-node.d.ts +0 -29
- package/dist/domain/posix-node.d.ts.map +0 -1
- package/dist/domain/posix-node.js +0 -20
- package/dist/domain/unix-path.d.ts +0 -6
- package/dist/domain/unix-path.d.ts.map +0 -1
- package/dist/domain/unix-path.js +0 -11
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,4 @@ export * from './tree-surfer-ui/domain/input-state.js';
|
|
|
5
5
|
export * from './tree-surfer-ui/domain/intent.js';
|
|
6
6
|
export * from './tree-surfer-ui/domain/user-input.js';
|
|
7
7
|
export * from './tree-surfer/index.js';
|
|
8
|
-
export * from './domain/posix-node.js';
|
|
9
|
-
export * from './domain/unix-path.js';
|
|
10
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AAEjE,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AAEjE,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,5 +5,3 @@ export * from './tree-surfer-ui/domain/input-state.js';
|
|
|
5
5
|
export * from './tree-surfer-ui/domain/intent.js';
|
|
6
6
|
export * from './tree-surfer-ui/domain/user-input.js';
|
|
7
7
|
export * from './tree-surfer/index.js';
|
|
8
|
-
export * from './domain/posix-node.js';
|
|
9
|
-
export * from './domain/unix-path.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare const CursorKind: {
|
|
2
3
|
readonly Entry: "entry";
|
|
3
4
|
readonly Fold: "fold";
|
|
@@ -13,6 +14,14 @@ export type CursorFold<Id> = {
|
|
|
13
14
|
parentPath: readonly Id[];
|
|
14
15
|
};
|
|
15
16
|
export type Cursor<Id> = CursorEntry<Id> | CursorFold<Id>;
|
|
17
|
+
export declare function createCursorSchema<IdSchema extends z.ZodTypeAny>(idSchema: IdSchema): z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
kind: z.ZodLiteral<"entry">;
|
|
19
|
+
parentPath: z.ZodArray<IdSchema>;
|
|
20
|
+
entryId: IdSchema;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"fold">;
|
|
23
|
+
parentPath: z.ZodArray<IdSchema>;
|
|
24
|
+
}, z.core.$strip>], "kind">;
|
|
16
25
|
export type CursorApi<Id> = {
|
|
17
26
|
isEntry(cursor: Cursor<Id>): cursor is CursorEntry<Id>;
|
|
18
27
|
isFold(cursor: Cursor<Id>): cursor is CursorFold<Id>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/tree-surfer/cursor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,MAAM,MAAM,WAAW,CAAC,EAAE,IAAI;IAC5B,IAAI,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAC9B,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC;IAC1B,OAAO,EAAE,EAAE,CAAC;CACb,CAAC;AAEF,MAAM,MAA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
|
4
5
|
};
|
|
6
|
+
export function createCursorSchema(idSchema) {
|
|
7
|
+
const parentPathSchema = z.array(idSchema);
|
|
8
|
+
return z.discriminatedUnion('kind', [
|
|
9
|
+
z.object({
|
|
10
|
+
kind: z.literal(CursorKind.Entry),
|
|
11
|
+
parentPath: parentPathSchema,
|
|
12
|
+
entryId: idSchema,
|
|
13
|
+
}),
|
|
14
|
+
z.object({
|
|
15
|
+
kind: z.literal(CursorKind.Fold),
|
|
16
|
+
parentPath: parentPathSchema,
|
|
17
|
+
}),
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
5
20
|
export function createCursorApi() {
|
|
6
21
|
const cursorApi = {
|
|
7
22
|
isEntry(cursor) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { FoldNode, FoldNodeRoot } from './fold-node.types.js';
|
|
3
|
+
export declare function createFoldNodeSchemas<Id extends PropertyKey>(idSchema: z.ZodType<Id>): {
|
|
4
|
+
foldNodeSchema: z.ZodType<FoldNode<Id>, unknown, z.core.$ZodTypeInternals<FoldNode<Id>, unknown>>;
|
|
5
|
+
foldNodeRootSchema: z.ZodType<FoldNodeRoot<Id>, unknown, z.core.$ZodTypeInternals<FoldNodeRoot<Id>, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=fold-node.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fold-node.schema.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/fold-node/fold-node.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEnE,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,WAAW,EAC1D,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;;;EAsBxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function createFoldNodeSchemas(idSchema) {
|
|
3
|
+
const foldNodeSchema = z.lazy(() => z.object({
|
|
4
|
+
id: idSchema,
|
|
5
|
+
children: z.array(foldNodeSchema),
|
|
6
|
+
folds: z.array(idSchema).transform((ids) => new Set(ids)),
|
|
7
|
+
}));
|
|
8
|
+
const foldNodeRootSchema = z.object({
|
|
9
|
+
children: z.array(foldNodeSchema),
|
|
10
|
+
folds: z.array(idSchema).transform((ids) => new Set(ids)),
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
foldNodeSchema,
|
|
14
|
+
foldNodeRootSchema,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './fold-node/fold-node.impl.js';
|
|
2
|
+
export * from './fold-node/fold-node.schema.js';
|
|
2
3
|
export * from './fold-node/fold-node.types.js';
|
|
3
4
|
export * from './nav-node/nav-node.impl.js';
|
|
4
5
|
export * from './nav-node/nav-node.types.js';
|
|
5
6
|
export * from './tree-node/tree-node.impl.js';
|
|
7
|
+
export * from './tree-node/tree-node.schemas.js';
|
|
6
8
|
export * from './tree-node/tree-node.types.js';
|
|
7
9
|
export * from './cursor.js';
|
|
8
10
|
export * from './state.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-surfer/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,aAAa,CAAC;AAE5B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-surfer/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,aAAa,CAAC;AAE5B,cAAc,YAAY,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './fold-node/fold-node.impl.js';
|
|
2
|
+
export * from './fold-node/fold-node.schema.js';
|
|
2
3
|
export * from './fold-node/fold-node.types.js';
|
|
3
4
|
export * from './nav-node/nav-node.impl.js';
|
|
4
5
|
export * from './nav-node/nav-node.types.js';
|
|
5
6
|
export * from './tree-node/tree-node.impl.js';
|
|
7
|
+
export * from './tree-node/tree-node.schemas.js';
|
|
6
8
|
export * from './tree-node/tree-node.types.js';
|
|
7
9
|
export * from './cursor.js';
|
|
8
10
|
export * from './state.js';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { Cursor, CursorApi } from './cursor.js';
|
|
2
3
|
import { SerializableKey, TreeNode, TreeNodeApi } from './tree-node/tree-node.types.js';
|
|
3
4
|
import { FoldNodeApi, FoldNodeRoot } from './fold-node/fold-node.types.js';
|
|
4
5
|
import { NavNodeApi } from './nav-node/nav-node.types.js';
|
|
6
|
+
export declare function createStateSchema<Id extends SerializableKey, BufferNode extends TreeNode<Id, BufferNode>>(bufferNodeSchema: z.ZodType<BufferNode>, foldNodeRootSchema: z.ZodType<State<Id, BufferNode>['foldNode']>, cursorSchema: z.ZodType<State<Id, BufferNode>['cursor']>): z.ZodObject<{
|
|
7
|
+
buffer: z.ZodArray<z.ZodType<BufferNode, unknown, z.core.$ZodTypeInternals<BufferNode, unknown>>>;
|
|
8
|
+
foldNode: z.ZodType<FoldNodeRoot<Id>, unknown, z.core.$ZodTypeInternals<FoldNodeRoot<Id>, unknown>>;
|
|
9
|
+
cursor: z.ZodType<Cursor<Id>, unknown, z.core.$ZodTypeInternals<Cursor<Id>, unknown>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
5
11
|
export type State<Id extends SerializableKey, BufferNode extends TreeNode<Id, BufferNode>> = {
|
|
6
12
|
buffer: BufferNode[];
|
|
7
13
|
foldNode: FoldNodeRoot<Id>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/tree-surfer/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,WAAW,EACX,YAAY,EACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/tree-surfer/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,WAAW,EACX,YAAY,EACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,wBAAgB,iBAAiB,CAC/B,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,EAE3C,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EACvC,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,EAChE,YAAY,EAAE,CAA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.js';
|
|
3
|
+
// Schema
|
|
4
|
+
export function createStateSchema(bufferNodeSchema, foldNodeRootSchema, cursorSchema) {
|
|
5
|
+
return z.object({
|
|
6
|
+
buffer: z.array(bufferNodeSchema),
|
|
7
|
+
foldNode: foldNodeRootSchema,
|
|
8
|
+
cursor: cursorSchema,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
2
11
|
export function createStateApi(treeNodeApi, foldNodeApi, cursorApi, navNodeApi) {
|
|
3
12
|
// Helpers
|
|
4
13
|
/**
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as fc from 'fast-check';
|
|
2
2
|
import type { TreeNode } from './tree-node.types.js';
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
type Id = string;
|
|
4
|
+
export declare const idArb: fc.Arbitrary<string>;
|
|
5
|
+
export type StringNode = TreeNode<Id, StringNode>;
|
|
6
|
+
type PathEntry = {
|
|
5
7
|
path: string[];
|
|
6
8
|
node: StringNode;
|
|
7
9
|
};
|
|
8
|
-
|
|
10
|
+
type GeneratedNode = {
|
|
9
11
|
node: StringNode;
|
|
10
12
|
pathEntries: PathEntry[];
|
|
11
13
|
};
|
|
12
|
-
export declare const idArb: fc.Arbitrary<string>;
|
|
13
14
|
export declare const generatedNodeArb: fc.Arbitrary<GeneratedNode>;
|
|
14
15
|
export declare const generatedNodesArrayArb: fc.Arbitrary<GeneratedNode[]>;
|
|
15
16
|
export declare const forestAndPathsArb: fc.Arbitrary<{
|
|
@@ -28,4 +29,5 @@ export declare const nodesArrayAndBranchPathArb: fc.Arbitrary<{
|
|
|
28
29
|
}>;
|
|
29
30
|
export declare const newBranchesArb: fc.Arbitrary<any[]>;
|
|
30
31
|
export declare const newBranchesOrNullArb: fc.Arbitrary<any[] | null>;
|
|
32
|
+
export {};
|
|
31
33
|
//# sourceMappingURL=tree-node.arb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-node.arb.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.arb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tree-node.arb.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.arb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,KAAK,EAAE,GAAG,MAAM,CAAC;AAEjB,eAAO,MAAM,KAAK,sBAGhB,CAAC;AAGH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;AAElD,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,SAAS,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,CA8DnD,CAAC;AAEP,eAAO,MAAM,sBAAsB,+BAIjC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;EAK7B,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;EAQrC,CAAC;AAEJ,eAAO,MAAM,0BAA0B;;;;EAYpC,CAAC;AAEJ,eAAO,MAAM,cAAc,qBAE1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,4BAA8C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SerializableKey, TreeNode } from './tree-node.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Runtime schema for IDs that can be safely represented as serializable
|
|
5
|
+
* primitive values.
|
|
6
|
+
*
|
|
7
|
+
* Strings are accepted as-is. Numbers must be finite, so `NaN`, `Infinity`,
|
|
8
|
+
* and `-Infinity` are rejected.
|
|
9
|
+
*
|
|
10
|
+
* Applications should derive a more specific schema when those constraints
|
|
11
|
+
* are needed.
|
|
12
|
+
*/
|
|
13
|
+
export declare const serializableKeySchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
14
|
+
/**
|
|
15
|
+
* Helper for creating the schemas for the structural variants of a tree node.
|
|
16
|
+
*
|
|
17
|
+
* The concrete application can extend these schemas with additional fields.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createTreeNodeSchemas<Id extends SerializableKey, ChildNode extends TreeNode<Id, ChildNode>>(idSchema: z.ZodType<Id>, childSchema: z.ZodType<ChildNode>): {
|
|
20
|
+
leafSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
closedBranchSchema: z.ZodObject<{
|
|
24
|
+
id: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
|
|
25
|
+
children: z.ZodNull;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
openBranchSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
|
|
29
|
+
children: z.ZodArray<z.ZodType<ChildNode, unknown, z.core.$ZodTypeInternals<ChildNode, unknown>>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=tree-node.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-node.schemas.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,iDAA6C,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,SAAS,eAAe,EAC1B,SAAS,SAAS,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,EACzC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;EAoB3D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime schema for IDs that can be safely represented as serializable
|
|
4
|
+
* primitive values.
|
|
5
|
+
*
|
|
6
|
+
* Strings are accepted as-is. Numbers must be finite, so `NaN`, `Infinity`,
|
|
7
|
+
* and `-Infinity` are rejected.
|
|
8
|
+
*
|
|
9
|
+
* Applications should derive a more specific schema when those constraints
|
|
10
|
+
* are needed.
|
|
11
|
+
*/
|
|
12
|
+
export const serializableKeySchema = z.union([z.string(), z.number().finite()]);
|
|
13
|
+
/**
|
|
14
|
+
* Helper for creating the schemas for the structural variants of a tree node.
|
|
15
|
+
*
|
|
16
|
+
* The concrete application can extend these schemas with additional fields.
|
|
17
|
+
*/
|
|
18
|
+
export function createTreeNodeSchemas(idSchema, childSchema) {
|
|
19
|
+
const leafSchema = z.object({
|
|
20
|
+
id: idSchema,
|
|
21
|
+
});
|
|
22
|
+
const closedBranchSchema = z.object({
|
|
23
|
+
id: idSchema,
|
|
24
|
+
children: z.null(),
|
|
25
|
+
});
|
|
26
|
+
const openBranchSchema = z.object({
|
|
27
|
+
id: idSchema,
|
|
28
|
+
children: z.array(childSchema),
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
leafSchema,
|
|
32
|
+
closedBranchSchema,
|
|
33
|
+
openBranchSchema,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Runtime schema for IDs that can be safely represented as serializable
|
|
4
|
-
* primitive values.
|
|
5
|
-
*
|
|
6
|
-
* Strings are accepted as-is. Numbers must be finite, so `NaN`, `Infinity`,
|
|
7
|
-
* and `-Infinity` are rejected.
|
|
8
|
-
*
|
|
9
|
-
* Applications should derive a more specific schema when those constraints
|
|
10
|
-
* are needed.
|
|
11
|
-
*/
|
|
12
|
-
export declare const serializableKeySchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
13
1
|
/**
|
|
14
2
|
* A serializable primitive suitable for use as a stable tree ID.
|
|
15
3
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-node.types.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tree-node.types.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,eAAe,IAAI;IACrD,EAAE,EAAE,EAAE,CAAC;IACP,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,EAAE,SAAS,eAAe,IAAI;IAC7D,EAAE,EAAE,EAAE,CAAC;IACP,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,CAC5B,EAAE,SAAS,eAAe,EAC1B,SAAS,SAAS,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,IACvC;IACF,EAAE,EAAE,EAAE,CAAC;IACP,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC;AAE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E7C;;;;;;;OAOG;IACH,WAAW,CAAC,IAAI,EAAE,kBAAkB,CAAC,EAAE,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAE1E;;;;;OAKG;IACH,YAAY,CACV,IAAI,EAAE,kBAAkB,CAAC,EAAE,EAAE,SAAS,CAAC,EACvC,EAAE,EAAE,EAAE,GACL,SAAS,GAAG,SAAS,CAAC;IAEzB;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAAS,CAAC,MAAM,EACd,OAAO,EAAE,SAAS,EAAE,EACpB,IAAI,EAAE,EAAE,EAAE,EACV,QAAQ,EAAE,gBAAgB,CAAC,SAAS,EAAE,MAAM,CAAC,GAC5C,MAAM,GAAG,SAAS,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,YAAY,CACV,OAAO,EAAE,SAAS,EAAE,EACpB,IAAI,EAAE,EAAE,EAAE,EACV,QAAQ,EAAE,gBAAgB,CAAC,SAAS,CAAC,GACpC,SAAS,EAAE,GAAG,SAAS,CAAC;CAC5B,CAAC"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Runtime schema for IDs that can be safely represented as serializable
|
|
4
|
-
* primitive values.
|
|
5
|
-
*
|
|
6
|
-
* Strings are accepted as-is. Numbers must be finite, so `NaN`, `Infinity`,
|
|
7
|
-
* and `-Infinity` are rejected.
|
|
8
|
-
*
|
|
9
|
-
* Applications should derive a more specific schema when those constraints
|
|
10
|
-
* are needed.
|
|
11
|
-
*/
|
|
12
|
-
export const serializableKeySchema = z.union([z.string(), z.number().finite()]);
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SerializableKey, TreeNode, TreeNodeApi } from '../../tree-surfer/
|
|
1
|
+
import { SerializableKey, TreeNode, TreeNodeApi } from '../../tree-surfer/index.js';
|
|
2
2
|
import { Effect, Intent } from '../domain/index.js';
|
|
3
3
|
import { CursorApi, State, StateApi } from '../../tree-surfer/index.js';
|
|
4
4
|
export type IntentToEffect<Id extends SerializableKey, BufferNode extends TreeNode<Id, BufferNode>> = (intent: Intent, state: State<Id, BufferNode>) => Effect<Id, BufferNode> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-to-effect.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/intent-to-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"intent-to-effect.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/intent-to-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAIxE,MAAM,MAAM,cAAc,CACxB,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,IACzC,CACF,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,KACzB,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;AAGxC,wBAAgB,oBAAoB,CAClC,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,EAE3C,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,EAClC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,EACxB,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,UAAU,CAAC,GACvC,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,CAkEhC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseCommand } from './parse-command.js';
|
|
1
2
|
// Factory method, since Apis are needed to derive intent
|
|
2
3
|
export function createIntentToEffect(stateApi, cursorApi, treeNodeApi) {
|
|
3
4
|
return (intent, state) => {
|
|
@@ -41,24 +42,13 @@ export function createIntentToEffect(stateApi, cursorApi, treeNodeApi) {
|
|
|
41
42
|
},
|
|
42
43
|
};
|
|
43
44
|
case 'executeCommandLine':
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
effectType: 'quit',
|
|
47
|
-
exitMessage: '',
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
if (intent.commandLine === ':evlp') {
|
|
51
|
-
return {
|
|
52
|
-
effectType: 'emitVisibleLeavesPaths',
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
45
|
+
return (parseCommand(intent.commandLine) ?? {
|
|
56
46
|
effectType: 'setInputState',
|
|
57
47
|
inputState: {
|
|
58
48
|
inputMode: 'normal',
|
|
59
49
|
normalBuffer: '',
|
|
60
50
|
},
|
|
61
|
-
};
|
|
51
|
+
});
|
|
62
52
|
}
|
|
63
53
|
};
|
|
64
54
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SerializableKey, TreeNode } from '../../tree-surfer/index.js';
|
|
2
|
+
import { Effect } from '../domain/index.js';
|
|
3
|
+
export declare function parseCommand<Id extends SerializableKey, BufferNode extends TreeNode<Id, BufferNode>>(commandLine: string): Effect<Id, BufferNode> | undefined;
|
|
4
|
+
//# sourceMappingURL=parse-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-command.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/parse-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,wBAAgB,YAAY,CAC1B,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,EAC3C,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,GAAG,SAAS,CAqDzD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const DEFAULT_VIEW_NAME = 'default';
|
|
2
|
+
export function parseCommand(commandLine) {
|
|
3
|
+
const command = commandLine.trim();
|
|
4
|
+
switch (command) {
|
|
5
|
+
case ':q':
|
|
6
|
+
return {
|
|
7
|
+
effectType: 'quit',
|
|
8
|
+
exitMessage: '',
|
|
9
|
+
};
|
|
10
|
+
case ':evlp':
|
|
11
|
+
return {
|
|
12
|
+
effectType: 'emitVisibleLeavesPaths',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Vim-style view commands:
|
|
17
|
+
*
|
|
18
|
+
* :mkview!
|
|
19
|
+
* :mkview! project
|
|
20
|
+
* :loadview
|
|
21
|
+
* :loadview project
|
|
22
|
+
*
|
|
23
|
+
* The name may contain spaces, so capture the remainder of the command
|
|
24
|
+
* instead of splitting on whitespace.
|
|
25
|
+
*
|
|
26
|
+
* TODO Later: mkview that checks if same named view already saved
|
|
27
|
+
*/
|
|
28
|
+
const viewCommand = command.match(/^:(mkview!|loadview)(?:\s+(.+?))?$/);
|
|
29
|
+
if (viewCommand === null) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const commandName = viewCommand[1];
|
|
33
|
+
const suppliedName = viewCommand[2]?.trim();
|
|
34
|
+
const name = suppliedName || DEFAULT_VIEW_NAME;
|
|
35
|
+
switch (commandName) {
|
|
36
|
+
case 'mkview!':
|
|
37
|
+
return {
|
|
38
|
+
effectType: 'saveView',
|
|
39
|
+
name,
|
|
40
|
+
overwrite: true,
|
|
41
|
+
};
|
|
42
|
+
case 'loadview':
|
|
43
|
+
return {
|
|
44
|
+
effectType: 'loadView',
|
|
45
|
+
name,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -6,6 +6,13 @@ export type Effect<Id extends SerializableKey, BufferNode extends TreeNode<Id, B
|
|
|
6
6
|
} | {
|
|
7
7
|
effectType: 'loadBranchEntries';
|
|
8
8
|
path: Id[];
|
|
9
|
+
} | {
|
|
10
|
+
effectType: 'saveView';
|
|
11
|
+
name: string;
|
|
12
|
+
overwrite: boolean;
|
|
13
|
+
} | {
|
|
14
|
+
effectType: 'loadView';
|
|
15
|
+
name: string;
|
|
9
16
|
} | {
|
|
10
17
|
effectType: 'emitVisibleLeavesPaths';
|
|
11
18
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,MAAM,MAAM,CAChB,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,IAEzC;IACE,UAAU,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,YAAY,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;CACtC,GACD;IACE,UAAU,EAAE,mBAAmB,CAAC;IAChC,IAAI,EAAE,EAAE,EAAE,CAAC;CACZ,GACD;IACE,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,GACD;IACE,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,UAAU,EAAE,wBAAwB,CAAC;CACtC,GACD;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGN,MAAM,MAAM,YAAY,CACtB,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,IAEzC;IACE,gBAAgB,EAAE,WAAW,CAAC;CAC/B,GACD;IACE,gBAAgB,EAAE,WAAW,CAAC;CAC/B,GACD;IACE,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,IAAI,EAAE,EAAE,EAAE,CAAC;IACX,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;CAC9B,GACD;IACE,gBAAgB,EAAE,kBAAkB,CAAC;CACtC,GACD;IACE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,gBAAgB,EAAE,QAAQ,CAAC;CAC5B,GACD;IACE,gBAAgB,EAAE,YAAY,CAAC;CAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { UnixPath } from './unix-path.js';
|
|
3
|
-
import { Cursor, State } from '../tree-surfer/index.js';
|
|
4
|
-
import { FoldNode } from '../tree-surfer/fold-node/fold-node.types.js';
|
|
5
|
-
import { NavNode } from '../tree-surfer/nav-node/nav-node.types.js';
|
|
6
|
-
export declare const PosixNameSchema: z.ZodString;
|
|
7
|
-
export type PosixName = z.output<typeof PosixNameSchema>;
|
|
8
|
-
export type PosixNode = {
|
|
9
|
-
kind: 'file';
|
|
10
|
-
id: PosixName;
|
|
11
|
-
} | {
|
|
12
|
-
kind: 'symlink';
|
|
13
|
-
id: PosixName;
|
|
14
|
-
target: UnixPath;
|
|
15
|
-
} | {
|
|
16
|
-
kind: 'directory';
|
|
17
|
-
id: PosixName;
|
|
18
|
-
children: PosixNode[] | null;
|
|
19
|
-
};
|
|
20
|
-
export declare const PosixNodeApi: import("../tree-surfer/index.js").TreeNodeApi<string, PosixNode>;
|
|
21
|
-
export type PosixCursor = Cursor<PosixName>;
|
|
22
|
-
export declare const PosixCursorApi: import("../tree-surfer/cursor.js").CursorApi<string>;
|
|
23
|
-
export type PosixFoldNode = FoldNode<PosixName>;
|
|
24
|
-
export declare const PosixFoldNodeApi: import("../tree-surfer/index.js").FoldNodeApi<string>;
|
|
25
|
-
export type PosixNavNode = NavNode<PosixName, PosixNode>;
|
|
26
|
-
export declare const PosixNavApi: import("../tree-surfer/index.js").NavNodeApi<string, PosixNode>;
|
|
27
|
-
export type PosixState = State<PosixName, PosixNode>;
|
|
28
|
-
export declare const PosixStateApi: import("../tree-surfer/state.js").StateApi<string, PosixNode>;
|
|
29
|
-
//# sourceMappingURL=posix-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posix-node.d.ts","sourceRoot":"","sources":["../../src/domain/posix-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAGL,MAAM,EACN,KAAK,EACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAIpE,eAAO,MAAM,eAAe,aAQxB,CAAC;AAEL,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAGzD,MAAM,MAAM,SAAS,GACjB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,SAAS,CAAC;CACf,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,SAAS,CAAC;IACd,MAAM,EAAE,QAAQ,CAAC;CAClB,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,EAAE,EAAE,SAAS,CAAC;IACd,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEN,eAAO,MAAM,YAAY,kEAA4C,CAAC;AAStE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE5C,eAAO,MAAM,cAAc,sDAA+B,CAAC;AAG3D,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEhD,eAAO,MAAM,gBAAgB,uDAAiC,CAAC;AAG/D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAEzD,eAAO,MAAM,WAAW,iEAIvB,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAErD,eAAO,MAAM,aAAa,+DAKzB,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { createTreeNodeApi } from '../tree-surfer/tree-node/tree-node.impl.js';
|
|
3
|
-
import { createCursorApi, createStateApi, } from '../tree-surfer/index.js';
|
|
4
|
-
import { createFoldNodeApi } from '../tree-surfer/fold-node/fold-node.impl.js';
|
|
5
|
-
import { createNavNodeApi } from '../tree-surfer/nav-node/nav-node.impl.js';
|
|
6
|
-
// Name
|
|
7
|
-
export const PosixNameSchema = z
|
|
8
|
-
.string()
|
|
9
|
-
.min(1)
|
|
10
|
-
.refine((value) => !value.includes('/'), {
|
|
11
|
-
message: "Entry name must not contain '/'",
|
|
12
|
-
})
|
|
13
|
-
.refine((value) => value !== '.' && value !== '..', {
|
|
14
|
-
message: "Entry name cannot be '.' or '..'",
|
|
15
|
-
});
|
|
16
|
-
export const PosixNodeApi = createTreeNodeApi();
|
|
17
|
-
export const PosixCursorApi = createCursorApi();
|
|
18
|
-
export const PosixFoldNodeApi = createFoldNodeApi();
|
|
19
|
-
export const PosixNavApi = createNavNodeApi(PosixNodeApi, PosixFoldNodeApi, PosixCursorApi);
|
|
20
|
-
export const PosixStateApi = createStateApi(PosixNodeApi, PosixFoldNodeApi, PosixCursorApi, PosixNavApi);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const UnixPathSchema: z.ZodString;
|
|
3
|
-
export type UnixPath = z.output<typeof UnixPathSchema>;
|
|
4
|
-
export declare const UnixAbsolutePathSchema: z.ZodString;
|
|
5
|
-
export type UnixAbsolutePath = z.output<typeof UnixAbsolutePathSchema>;
|
|
6
|
-
//# sourceMappingURL=unix-path.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unix-path.d.ts","sourceRoot":"","sources":["../../src/domain/unix-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc,aAKvB,CAAC;AAEL,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvD,eAAO,MAAM,sBAAsB,aAKlC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/domain/unix-path.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
// UNIX PATHS
|
|
3
|
-
export const UnixPathSchema = z
|
|
4
|
-
.string()
|
|
5
|
-
.min(1)
|
|
6
|
-
.refine((value) => !value.includes('\0'), {
|
|
7
|
-
message: 'Unix paths must not contain null bytes',
|
|
8
|
-
});
|
|
9
|
-
export const UnixAbsolutePathSchema = UnixPathSchema.refine((value) => value.startsWith('/'), {
|
|
10
|
-
message: 'Path must be an absolute Unix path',
|
|
11
|
-
});
|