foldkit 0.9.0-canary.1 → 0.10.0-canary.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 CHANGED
@@ -8,22 +8,26 @@
8
8
 
9
9
  ## Installation
10
10
 
11
+ The best way to get started with Foldkit is to use `create-foldkit-app`. This
12
+ will guide you through creating a new Foldkit project with your preferred
13
+ package manager and example template.
14
+
11
15
  ```bash
12
- npm install foldkit effect
16
+ npx create-foldkit-app@latest --wizard
13
17
  ```
14
18
 
15
19
  ## Counter Example
16
20
 
17
- ```typescript
21
+ ```ts
18
22
  import { Match as M, Schema } from 'effect'
19
23
  import { Runtime } from 'foldkit'
20
24
  import { Class, Html, OnClick, button, div } from 'foldkit/html'
21
- import { ST, ts } from 'foldkit/schema'
25
+ import { ts } from 'foldkit/schema'
22
26
 
23
27
  // MODEL
24
28
 
25
29
  const Model = Schema.Number
26
- type Model = ST<typeof Model>
30
+ type Model = typeof Model.Type
27
31
 
28
32
  // MESSAGE
29
33
 
@@ -33,11 +37,11 @@ const Reset = ts('Reset')
33
37
 
34
38
  const Message = Schema.Union(Decrement, Increment, Reset)
35
39
 
36
- type Decrement = ST<typeof Decrement>
37
- type Increment = ST<typeof Increment>
38
- type Reset = ST<typeof Reset>
40
+ type Decrement = typeof Decrement.Type
41
+ type Increment = typeof Increment.Type
42
+ type Reset = typeof Reset.Type
39
43
 
40
- type Message = ST<typeof Message>
44
+ type Message = typeof Message.Type
41
45
 
42
46
  // UPDATE
43
47
 
@@ -9,11 +9,11 @@ export declare const Internal: S.TaggedStruct<"Internal", {
9
9
  hash: S.OptionFromSelf<typeof S.String>;
10
10
  }>;
11
11
  }>;
12
- export type Internal = S.Schema.Type<typeof Internal>;
12
+ export type Internal = typeof Internal.Type;
13
13
  export declare const External: S.TaggedStruct<"External", {
14
14
  href: typeof S.String;
15
15
  }>;
16
- export type External = S.Schema.Type<typeof External>;
16
+ export type External = typeof External.Type;
17
17
  export declare const UrlRequest: S.Union<[S.TaggedStruct<"Internal", {
18
18
  url: S.Struct<{
19
19
  protocol: typeof S.String;
@@ -26,5 +26,5 @@ export declare const UrlRequest: S.Union<[S.TaggedStruct<"Internal", {
26
26
  }>, S.TaggedStruct<"External", {
27
27
  href: typeof S.String;
28
28
  }>]>;
29
- export type UrlRequest = S.Schema.Type<typeof UrlRequest>;
29
+ export type UrlRequest = typeof UrlRequest.Type;
30
30
  //# sourceMappingURL=urlRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"urlRequest.d.ts","sourceRoot":"","sources":["../../src/runtime/urlRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAIpC,eAAO,MAAM,QAAQ;;;;;;;;;EAEnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,QAAQ;;EAEnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,UAAU;;;;;;;;;;;IAA8B,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAA"}
1
+ {"version":3,"file":"urlRequest.d.ts","sourceRoot":"","sources":["../../src/runtime/urlRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAIpC,eAAO,MAAM,QAAQ;;;;;;;;;EAEnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C,eAAO,MAAM,QAAQ;;EAEnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C,eAAO,MAAM,UAAU;;;;;;;;;;;IAA8B,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA"}
package/dist/schema.d.ts CHANGED
@@ -17,21 +17,4 @@ export declare const ts: {
17
17
  <Tag extends string>(tag: Tag): S.TaggedStruct<Tag, {}>;
18
18
  <Tag extends string, Fields extends S.Struct.Fields>(tag: Tag, fields: Fields): S.TaggedStruct<Tag, Fields>;
19
19
  };
20
- /**
21
- * Extracts the TypeScript type from an Effect Schema.
22
- *
23
- * Abbreviated as `ST` (Schema Type) because it's used frequently throughout Foldkit applications.
24
- *
25
- * @example
26
- * ```typescript
27
- * const Model = S.Struct({ count: S.Number })
28
- * type Model = ST<typeof Model> // { count: number }
29
- *
30
- * const Reset = ts('Reset')
31
- * type Reset = ST<typeof Reset> // { _tag: "Reset" }
32
- * ```
33
- *
34
- * @template T - The Schema to extract the type from
35
- */
36
- export type ST<T> = S.Schema.Type<T>;
37
20
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEpC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,EAAE,EAAE;IACf,CAAC,GAAG,SAAS,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IACvD,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,EACjD,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,GACb,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;CAEG,CAAA;AAEnC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEpC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,EAAE,EAAE;IACf,CAAC,GAAG,SAAS,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IACvD,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,EACjD,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,GACb,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;CAEG,CAAA"}
package/dist/url.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare const Url: S.Struct<{
7
7
  search: S.OptionFromSelf<typeof S.String>;
8
8
  hash: S.OptionFromSelf<typeof S.String>;
9
9
  }>;
10
- export type Url = S.Schema.Type<typeof Url>;
10
+ export type Url = typeof Url.Type;
11
11
  export declare const fromString: (str: string) => Option.Option<{
12
12
  readonly search: Option.Option<string>;
13
13
  readonly protocol: string;
package/dist/url.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAe,MAAM,IAAI,CAAC,EAAU,MAAM,QAAQ,CAAA;AAIzE,eAAO,MAAM,GAAG;;;;;;;EAOd,CAAA;AACF,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;AAyE3C,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM;;;;;;;EAAuC,CAAA;AAC7E,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,WAAqC,CAAA"}
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAe,MAAM,IAAI,CAAC,EAAU,MAAM,QAAQ,CAAA;AAIzE,eAAO,MAAM,GAAG;;;;;;;EAOd,CAAA;AACF,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,IAAI,CAAA;AAyEjC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM;;;;;;;EAAuC,CAAA;AAC7E,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,WAAqC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit",
3
- "version": "0.9.0-canary.1",
3
+ "version": "0.10.0-canary.0",
4
4
  "description": "Elm-inspired UI framework powered by Effect",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",