deltafold 0.1.0 → 0.2.1
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 +96 -1
- package/dist/changelog.d.ts +10 -10
- package/dist/changelog.js +4 -4
- package/dist/changelog.js.map +1 -1
- package/dist/{document-BZcZo9nr.js → document-HfPyYxEd.js} +20 -20
- package/dist/{document-BZcZo9nr.js.map → document-HfPyYxEd.js.map} +1 -1
- package/dist/{document-DWHsgywm.d.ts → document-gtXeGFJR.d.ts} +41 -41
- package/dist/{document-DWHsgywm.d.ts.map → document-gtXeGFJR.d.ts.map} +1 -1
- package/dist/html.d.ts +2 -2
- package/dist/html.js +2 -2
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +681 -102
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +908 -235
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +2 -2
- package/dist/markdown.js.map +1 -1
- package/dist/{mdast-DiRsYwPU.js → mdast-Oqkh0Gs1.js} +2 -2
- package/dist/{mdast-DiRsYwPU.js.map → mdast-Oqkh0Gs1.js.map} +1 -1
- package/dist/{package-BfBYnaCz.d.ts → package-CA5R57IC.d.ts} +117 -112
- package/dist/{package-BfBYnaCz.d.ts.map → package-CA5R57IC.d.ts.map} +1 -1
- package/package.json +3 -3
- package/src/features/documents/changelog.ts +8 -8
- package/src/features/documents/document.ts +39 -39
- package/src/features/documents/index.ts +2 -2
- package/src/features/execution/executor.ts +631 -272
- package/src/features/execution/handler.ts +205 -84
- package/src/features/execution/interaction.ts +174 -0
- package/src/features/execution/observation.ts +489 -0
- package/src/features/execution/observer.ts +395 -0
- package/src/features/execution/promise-callback.ts +76 -0
- package/src/features/package.ts +3 -3
- package/src/features/planning/history.ts +10 -10
- package/src/features/planning/identifiers.ts +7 -4
- package/src/features/planning/resolve-error.ts +13 -13
- package/src/features/planning/resolve.ts +11 -4
- package/src/features/planning/rewrite.ts +1 -1
- package/src/features/planning/validate.ts +1 -1
- package/src/foundation/action.ts +17 -17
- package/src/foundation/change.ts +10 -10
- package/src/foundation/instruction.ts +5 -5
- package/src/foundation/migration.ts +12 -12
- package/src/foundation/plan.ts +23 -18
- package/src/foundation/rule.ts +6 -6
- package/src/foundation/shortcut.ts +6 -6
- package/src/foundation/version.ts +6 -6
- package/src/index.ts +15 -11
- package/src/renderers/html.ts +1 -1
- package/src/renderers/markdown.ts +1 -1
package/src/foundation/rule.ts
CHANGED
|
@@ -6,11 +6,11 @@ import type * as Action from "./action.ts";
|
|
|
6
6
|
* What a rule matches: an action instance, or a parallel group matched by its branch
|
|
7
7
|
* structure. Matching a parallel group is an explicit structural rule.
|
|
8
8
|
*
|
|
9
|
-
* @since
|
|
9
|
+
* @since 0.0.1
|
|
10
10
|
*/
|
|
11
11
|
export type Pattern = Action.Any | Action.Parallel;
|
|
12
12
|
|
|
13
|
-
/** @since
|
|
13
|
+
/** @since 0.0.1 */
|
|
14
14
|
export type Rule<A extends Action.Any = Action.Any> = {
|
|
15
15
|
readonly _tag: "Rule";
|
|
16
16
|
readonly id: string;
|
|
@@ -22,14 +22,14 @@ export type Rule<A extends Action.Any = Action.Any> = {
|
|
|
22
22
|
/**
|
|
23
23
|
* Any rule.
|
|
24
24
|
*
|
|
25
|
-
* @since
|
|
25
|
+
* @since 0.0.1
|
|
26
26
|
*/
|
|
27
27
|
export type Any = Rule<any>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* The action instances a rule can contribute to a plan.
|
|
31
31
|
*
|
|
32
|
-
* @since
|
|
32
|
+
* @since 0.0.1
|
|
33
33
|
*/
|
|
34
34
|
export type ActionsOf<R> = R extends Rule<infer A> ? A : never;
|
|
35
35
|
|
|
@@ -55,7 +55,7 @@ export type ActionsOf<R> = R extends Rule<infer A> ? A : never;
|
|
|
55
55
|
* });
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
58
|
-
* @since
|
|
58
|
+
* @since 0.0.1
|
|
59
59
|
*/
|
|
60
60
|
export const replace = <A extends Action.Any = never>(
|
|
61
61
|
id: string,
|
|
@@ -70,5 +70,5 @@ export const replace = <A extends Action.Any = never>(
|
|
|
70
70
|
replacement: options.replacement,
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
/** @since
|
|
73
|
+
/** @since 0.0.1 */
|
|
74
74
|
export const isRule = (value: unknown): value is Any => Predicate.isTagged(value, "Rule");
|
|
@@ -5,7 +5,7 @@ import type * as Change from "./change.ts";
|
|
|
5
5
|
import type * as Migration from "./migration.ts";
|
|
6
6
|
import type { Version } from "./version.ts";
|
|
7
7
|
|
|
8
|
-
/** @since
|
|
8
|
+
/** @since 0.0.1 */
|
|
9
9
|
export type Shortcut<A extends Action.Any = Action.Any, C extends Change.Any = Change.Any> = {
|
|
10
10
|
readonly _tag: "Shortcut";
|
|
11
11
|
readonly id: string;
|
|
@@ -22,21 +22,21 @@ export type Shortcut<A extends Action.Any = Action.Any, C extends Change.Any = C
|
|
|
22
22
|
/**
|
|
23
23
|
* Any shortcut.
|
|
24
24
|
*
|
|
25
|
-
* @since
|
|
25
|
+
* @since 0.0.1
|
|
26
26
|
*/
|
|
27
27
|
export type Any = Shortcut<any>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* The action instances a shortcut can contribute to a plan.
|
|
31
31
|
*
|
|
32
|
-
* @since
|
|
32
|
+
* @since 0.0.1
|
|
33
33
|
*/
|
|
34
34
|
export type ActionsOf<S> = S extends Shortcut<infer A> ? A : never;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The changes addressed by a shortcut's migrations.
|
|
38
38
|
*
|
|
39
|
-
* @since
|
|
39
|
+
* @since 0.0.1
|
|
40
40
|
*/
|
|
41
41
|
export type ChangesOf<S> = S extends Shortcut<any, infer C> ? C : never;
|
|
42
42
|
|
|
@@ -54,7 +54,7 @@ export type ChangesOf<S> = S extends Shortcut<any, infer C> ? C : never;
|
|
|
54
54
|
* });
|
|
55
55
|
* ```
|
|
56
56
|
*
|
|
57
|
-
* @since
|
|
57
|
+
* @since 0.0.1
|
|
58
58
|
*/
|
|
59
59
|
export const make = <A extends Action.Any, C extends Change.Any = never>(
|
|
60
60
|
id: string,
|
|
@@ -75,5 +75,5 @@ export const make = <A extends Action.Any, C extends Change.Any = never>(
|
|
|
75
75
|
cost: options.cost,
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
/** @since
|
|
78
|
+
/** @since 0.0.1 */
|
|
79
79
|
export const isShortcut = (value: unknown): value is Any => Predicate.isTagged(value, "Shortcut");
|
|
@@ -2,7 +2,7 @@ import { Predicate } from "effect";
|
|
|
2
2
|
|
|
3
3
|
import type * as Change from "./change.ts";
|
|
4
4
|
|
|
5
|
-
/** @since
|
|
5
|
+
/** @since 0.0.1 */
|
|
6
6
|
export type Version<C extends Change.Any = Change.Any> = {
|
|
7
7
|
readonly _tag: "Version";
|
|
8
8
|
readonly id: string;
|
|
@@ -16,7 +16,7 @@ export type Version<C extends Change.Any = Change.Any> = {
|
|
|
16
16
|
readonly changes: ReadonlyArray<C>;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
/** @since
|
|
19
|
+
/** @since 0.0.1 */
|
|
20
20
|
export type Options<C extends Change.Any = Change.Any> = {
|
|
21
21
|
readonly previous?: Version;
|
|
22
22
|
readonly changes: ReadonlyArray<C>;
|
|
@@ -31,7 +31,7 @@ export type Options<C extends Change.Any = Change.Any> = {
|
|
|
31
31
|
* const v100 = Version.make("1.0.0", { previous: v0, changes: [timeoutRenamed] });
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
|
-
* @since
|
|
34
|
+
* @since 0.0.1
|
|
35
35
|
*/
|
|
36
36
|
export const make = <C extends Change.Any = never>(
|
|
37
37
|
id: string,
|
|
@@ -43,14 +43,14 @@ export const make = <C extends Change.Any = never>(
|
|
|
43
43
|
changes: options.changes,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
/** @since
|
|
46
|
+
/** @since 0.0.1 */
|
|
47
47
|
export const isVersion = (value: unknown): value is Version => Predicate.isTagged(value, "Version");
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Release metadata attached to a version by release tooling. It does not modify the
|
|
51
51
|
* version registered in history.
|
|
52
52
|
*
|
|
53
|
-
* @since
|
|
53
|
+
* @since 0.0.1
|
|
54
54
|
*/
|
|
55
55
|
export type Release<M> = {
|
|
56
56
|
readonly _tag: "Release";
|
|
@@ -69,7 +69,7 @@ export type Release<M> = {
|
|
|
69
69
|
* });
|
|
70
70
|
* ```
|
|
71
71
|
*
|
|
72
|
-
* @since
|
|
72
|
+
* @since 0.0.1
|
|
73
73
|
*/
|
|
74
74
|
export const withMetadata = <const M>(version: Version, metadata: M): Release<M> => ({
|
|
75
75
|
_tag: "Release",
|
package/src/index.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
/** @since
|
|
1
|
+
/** @since 0.0.1 */
|
|
2
2
|
export * as Action from "./foundation/action.ts";
|
|
3
|
-
/** @since
|
|
3
|
+
/** @since 0.0.1 */
|
|
4
4
|
export * as Change from "./foundation/change.ts";
|
|
5
|
-
/** @since
|
|
5
|
+
/** @since 0.0.1 */
|
|
6
6
|
export * as Executor from "./features/execution/executor.ts";
|
|
7
|
-
/** @since
|
|
7
|
+
/** @since 0.0.1 */
|
|
8
8
|
export * as Handler from "./features/execution/handler.ts";
|
|
9
|
-
/** @since
|
|
9
|
+
/** @since 0.2.0 */
|
|
10
|
+
export * as Interaction from "./features/execution/interaction.ts";
|
|
11
|
+
/** @since 0.0.1 */
|
|
10
12
|
export * as History from "./features/planning/history.ts";
|
|
11
|
-
/** @since
|
|
13
|
+
/** @since 0.0.1 */
|
|
12
14
|
export * as Migration from "./foundation/migration.ts";
|
|
13
|
-
/** @since
|
|
15
|
+
/** @since 0.2.1 */
|
|
16
|
+
export * as Observer from "./features/execution/observer.ts";
|
|
17
|
+
/** @since 0.0.1 */
|
|
14
18
|
export * as Package from "./features/package.ts";
|
|
15
|
-
/** @since
|
|
19
|
+
/** @since 0.0.1 */
|
|
16
20
|
export * as Plan from "./foundation/plan.ts";
|
|
17
|
-
/** @since
|
|
21
|
+
/** @since 0.0.1 */
|
|
18
22
|
export * as Rule from "./foundation/rule.ts";
|
|
19
|
-
/** @since
|
|
23
|
+
/** @since 0.0.1 */
|
|
20
24
|
export * as Shortcut from "./foundation/shortcut.ts";
|
|
21
|
-
/** @since
|
|
25
|
+
/** @since 0.0.1 */
|
|
22
26
|
export * as Version from "./foundation/version.ts";
|
package/src/renderers/html.ts
CHANGED
|
@@ -7,6 +7,6 @@ import { toMdast } from "./mdast.ts";
|
|
|
7
7
|
/**
|
|
8
8
|
* Renders a document as an HTML fragment. Throws `DocumentError` for unsupported structure.
|
|
9
9
|
*
|
|
10
|
-
* @since
|
|
10
|
+
* @since 0.0.1
|
|
11
11
|
*/
|
|
12
12
|
export const render = (document: Document): string => toHtml(toHast(toMdast(document)));
|
|
@@ -6,7 +6,7 @@ import { toMdast } from "./mdast.ts";
|
|
|
6
6
|
/**
|
|
7
7
|
* Renders a document as Markdown. Throws `DocumentError` for unsupported structure.
|
|
8
8
|
*
|
|
9
|
-
* @since
|
|
9
|
+
* @since 0.0.1
|
|
10
10
|
*/
|
|
11
11
|
export const render = (document: Document): string =>
|
|
12
12
|
toMarkdown(toMdast(document), { bullet: "-", emphasis: "_", strong: "*" });
|