@monimesl/dot-compiler 0.1.0-alpha.9 → 1.0.0-beta.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/dist/index.d.ts CHANGED
@@ -1,34 +1,32 @@
1
1
  import "@monimesl/dot-script-parser";
2
- import { ComponentManifest, ComponentRegistry, DotPermission, SourceError } from "@monimesl/dot-core";
2
+ import { ComponentManifest, ComponentRegistry, DotJsonPermission, SourceError } from "@monimesl/dot-core";
3
3
  import "@monimesl/dot-dml-parser";
4
- //#region src/project/categories.d.ts
5
- declare const CATEGORIES: readonly ["agriculture", "asset_finance", "donations", "education", "electricity", "entertainment", "events", "finance", "food_and_drink", "gambling", "games", "government", "health", "insurance", "internet_service_provider", "investments", "jobs", "lifestyle", "loans", "micro_credit", "microfinance", "news", "other", "productivity", "real_estate", "religion", "remittances", "savings", "shopping", "social", "sports", "telecom", "television", "transport", "travel", "utilities", "water"];
6
- type DotCategory = (typeof CATEGORIES)[number];
7
- //#endregion
8
4
  //#region src/project/dot-json.d.ts
5
+ export declare const DOT_JSON_FILE = "dot.json";
6
+ export declare function isDotPackage(name: string): boolean;
9
7
  interface DotJson {
10
- readonly id: string;
8
+ readonly id?: string | undefined;
9
+ readonly package: string;
11
10
  readonly name: string;
12
11
  readonly version: string;
13
- readonly description?: string | undefined;
14
- readonly categories?: readonly DotCategory[] | undefined;
15
- readonly icon?: string | undefined;
16
- readonly permissions?: Readonly<Partial<Record<DotPermission, string>>> | undefined;
12
+ readonly permissions?: Readonly<Partial<Record<DotJsonPermission, string>>> | undefined;
17
13
  readonly network?: NetworkAccess | undefined;
18
- readonly dash?: DashRequirements | undefined;
14
+ readonly dash?: DashNeeds | undefined;
15
+ }
16
+ interface DashNeeds {
17
+ readonly minApiVersion: string;
19
18
  }
20
19
  interface NetworkAccess {
21
20
  readonly hosts: readonly string[];
22
21
  }
23
- interface DashRequirements {
24
- readonly minVersion?: string | undefined;
25
- }
26
22
  //#endregion
27
23
  //#region src/project/project.d.ts
24
+ export declare const DOT_FILE = "dot.ts";
28
25
  export declare const PAGES_DIR = "pages";
29
26
  interface PageSource {
30
27
  readonly path: string;
31
28
  readonly id: string;
29
+ readonly share: readonly string[] | null;
32
30
  readonly view: string;
33
31
  readonly state: string;
34
32
  readonly controller: string;
@@ -42,6 +40,9 @@ interface Project {
42
40
  }
43
41
  export declare function loadProject(root: string): Promise<Project>;
44
42
  //#endregion
43
+ //#region src/build/bundle.d.ts
44
+ type BuildMode = 'production' | 'development';
45
+ //#endregion
45
46
  //#region src/errors.d.ts
46
47
  export declare class CompileError extends SourceError {
47
48
  readonly name = "CompileError";
@@ -55,7 +56,7 @@ export declare class CompileWarning extends SourceError {
55
56
  interface BuildOptions {
56
57
  root: string;
57
58
  outDir?: string | undefined;
58
- mode?: 'production' | 'development' | undefined;
59
+ mode?: BuildMode | undefined;
59
60
  components?: readonly ComponentManifest[] | undefined;
60
61
  conditions?: readonly string[] | undefined;
61
62
  }
@@ -67,12 +68,13 @@ interface BuildResult {
67
68
  /** Compiles and bundles the dot into `outDir` for hosts, and refreshes the types in `.dot/`. */
68
69
  export declare function build(options: BuildOptions): Promise<BuildResult>;
69
70
  /** What a host needs to run the build: dot.json without `$schema`, where it starts and its pages. */
70
- interface DotManifest extends Omit<DotJson, 'icon'> {
71
+ interface DotManifest extends DotJson {
71
72
  readonly runtime: string;
72
73
  readonly react: string;
73
74
  readonly entry: string;
74
75
  readonly pages: readonly string[];
75
- readonly icon: string | undefined;
76
+ readonly share: Readonly<Record<string, readonly string[]>>;
77
+ readonly dash: DashNeeds;
76
78
  }
77
79
  //#endregion
78
80
  //#region src/build/packages.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/project/categories.ts","../src/project/dot-json.ts","../src/project/project.ts","../src/errors.ts","../src/build/build.ts","../src/build/packages.ts","../src/view/compiler.ts","../src/view/compile.ts","../src/view/control-flow.ts","../src/project/statics.ts"],"mappings":";;;;cACa;KAwCD,sBAAsB;;;UCJjB;WACN;WACA;WACA;WACA;WAEA,sBAAsB;WAEtB;WAEA,cAAc,SAAS,QAAQ,OAAO;WACtC,UAAU;WACV,OAAO;;UAIR;WAEC;;UAID;WAEC;;;;qBCjDE;UAOI;WAEN;WAEA;WACA;WACA;WACA;;UAGM;WACN;WAEA,SAAS;WAET;WAEA,gBAAgB;WAEhB;;wBAGW,YAAY,eAAe,QAAQ;;;qBCvC5C,qBAAqB;WACd;;;qBAIP,uBAAuB;WAChB;;;;UC0BH;EACf;EAEA;EAEA;EACA,sBAAsB;EACtB;;UAGe;WACN;WACA;WACA,mBAAmB;;;wBAIR,MAAM,SAAS,eAAe,QAAQ;;UAqJ3C,oBAAoB,KAAK;WAE/B;WAEA;WACA;WACA;WAEA;;;;UCtMM;WACN;WACA,OAAO;WAEP;;UAIM;WACN;WAEA;;wBAQK,iBAAiB,eAAe;;;UCb/B;EACf;EACA,aAAa;EAEb;EAEA;EAEA;EACA,cAAc,SAAS;EAEvB,gBAAgB;;qBAKL;qBAMA;wBAmWG,QAAQ;wBASR,gBAAgB,QAAQ,mBAAmB,OAAO;;;wBC7YlD,YAAY,gBAAgB,SAAS;;;qBCCxC,mBAAmB,SAC9B;WAA0B;WAAwC;;;;qBCCvD;wBAoBS,YAAY,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/project/dot-json.ts","../src/project/project.ts","../src/build/bundle.ts","../src/errors.ts","../src/build/build.ts","../src/build/packages.ts","../src/view/compiler.ts","../src/view/compile.ts","../src/view/control-flow.ts","../src/project/statics.ts"],"mappings":";;;;qBAea;wBA4BG,aAAa;UAIZ;WAEN;WACA;WACA;WACA;WAEA,cAAc,SAAS,QAAQ,OAAO;WACtC,UAAU;WACV,OAAO;;UAID;WAEN;;UAID;WAEC;;;;qBCzDE;qBACA;UAOI;WAEN;WAEA;WAEA;WACA;WACA;WACA;;UAGM;WACN;WAEA,SAAS;WAET;WAEA,gBAAgB;WAEhB;;wBAGW,YAAY,eAAe,QAAQ;;;KCjC7C;;;qBCRC,qBAAqB;WACd;;;qBAIP,uBAAuB;WAChB;;;;UC+BH;EACf;EAEA;EAEA,OAAO;EACP,sBAAsB;EACtB;;UAGe;WACN;WACA;WACA,mBAAmB;;;wBAIR,MAAM,SAAS,eAAe,QAAQ;;UA2J3C,oBAAoB;WAE1B;WAEA;WACA;WACA;WAEA,OAAO,SAAS;WAEhB,MAAM;;;;UCnNA;WACN;WACA,OAAO;WAEP;;UAIM;WACN;WAEA;;wBAQK,iBAAiB,eAAe;;;UCT/B;EACf;EACA,aAAa;EAEb;EAEA;EAEA;EACA,cAAc,SAAS;EAEvB,gBAAgB;;qBAKL;qBAMA;wBAmZG,QAAQ;wBA2BR,gBAAgB,QAAQ,mBAAmB,OAAO;;;wBCndlD,YAAY,gBAAgB,SAAS;;;qBCCxC,mBAAmB,SAC9B;WAA0B;WAAwC;;;;qBCEvD;wBAoBS,YAAY,eAAe"}