@primate/core 0.5.0 → 0.6.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/lib/private/App.d.ts +263 -26
- package/lib/private/App.js +42 -14
- package/lib/private/Flags.d.ts +8 -4
- package/lib/private/Module.d.ts +4 -16
- package/lib/private/Module.js +1 -17
- package/lib/private/app/EnvSchema.d.ts +5 -0
- package/lib/private/app/EnvSchema.js +2 -0
- package/lib/private/app/Facade.browser.d.ts +11 -0
- package/lib/private/app/Facade.browser.js +19 -0
- package/lib/private/app/Facade.d.ts +272 -27
- package/lib/private/app/Facade.js +23 -0
- package/lib/private/build/client/index.js +8 -3
- package/lib/private/build/client/plugin/app-request.d.ts +4 -0
- package/lib/private/build/client/plugin/app-request.js +19 -0
- package/lib/private/build/client/plugin/view.d.ts +4 -0
- package/lib/private/build/client/plugin/view.js +13 -0
- package/lib/private/build/hook.d.ts +1 -2
- package/lib/private/build/hook.js +21 -16
- package/lib/private/build/index.d.ts +2 -1
- package/lib/private/build/index.js +20 -21
- package/lib/private/build/server/index.js +7 -9
- package/lib/private/build/server/plugin/app-request.d.ts +4 -0
- package/lib/private/build/server/plugin/app-request.js +19 -0
- package/lib/private/build/server/plugin/assets.js +1 -1
- package/lib/private/build/server/plugin/live-reload.js +9 -9
- package/lib/private/build/server/plugin/native-addons.js +4 -7
- package/lib/private/build/server/plugin/route.js +2 -2
- package/lib/private/build/server/plugin/store.js +9 -31
- package/lib/private/build/server/plugin/stores.js +11 -7
- package/lib/private/build/server/plugin/view.js +1 -1
- package/lib/private/build/shared/plugin/app-request.d.ts +4 -0
- package/lib/private/build/shared/plugin/app-request.js +19 -0
- package/lib/private/client/Data.d.ts +3 -2
- package/lib/private/{frontend → client}/Render.d.ts +1 -1
- package/lib/private/{frontend → client}/ViewResponse.d.ts +1 -1
- package/lib/private/client/app.js +1 -2
- package/lib/private/client/boot.d.ts +5 -0
- package/lib/private/client/boot.js +64 -0
- package/lib/private/client/create-form.d.ts +1 -0
- package/lib/private/client/create-form.js +19 -20
- package/lib/private/client/extract-issues.js +2 -1
- package/lib/private/client/http.d.ts +13 -0
- package/lib/private/client/http.js +57 -0
- package/lib/private/client/index.d.ts +23 -0
- package/lib/private/client/index.js +16 -0
- package/lib/private/client/navigate.d.ts +13 -0
- package/lib/private/client/navigate.js +67 -0
- package/lib/private/client/root.d.ts +9 -0
- package/lib/private/client/root.js +11 -0
- package/lib/private/client/submit.d.ts +2 -0
- package/lib/private/client/submit.js +41 -0
- package/lib/private/config/index.d.ts +7 -2
- package/lib/private/config/index.js +3 -2
- package/lib/private/config/schema.d.ts +82 -26
- package/lib/private/config/schema.js +17 -4
- package/lib/private/cookie.d.ts +12 -6
- package/lib/private/db/DB.d.ts +21 -5
- package/lib/private/db/DB.js +1 -0
- package/lib/private/db/MemoryDB.d.ts +2 -4
- package/lib/private/db/MemoryDB.js +40 -22
- package/lib/private/db/common.d.ts +7 -0
- package/lib/private/db/common.js +31 -0
- package/lib/private/db/errors.d.ts +104 -0
- package/lib/private/db/errors.js +237 -0
- package/lib/private/db/migrate/apply.d.ts +2 -0
- package/lib/private/db/migrate/apply.js +32 -0
- package/lib/private/db/migrate/bundle.d.ts +3 -0
- package/lib/private/db/migrate/bundle.js +22 -0
- package/lib/private/db/migrate/create.d.ts +2 -0
- package/lib/private/db/migrate/create.js +154 -0
- package/lib/private/db/migrate/index.d.ts +10 -0
- package/lib/private/db/migrate/index.js +6 -0
- package/lib/private/db/migrate/status.d.ts +2 -0
- package/lib/private/db/migrate/status.js +38 -0
- package/lib/private/db/migrate/store.d.ts +5 -0
- package/lib/private/db/migrate/store.js +33 -0
- package/lib/private/db/sql.js +3 -3
- package/lib/private/db/test.js +461 -95
- package/lib/private/errors.d.ts +88 -0
- package/lib/private/errors.js +211 -0
- package/lib/private/frontend.d.ts +72 -0
- package/lib/private/frontend.js +245 -0
- package/lib/private/i18n/Formatter.js +2 -2
- package/lib/private/i18n/errors.d.ts +16 -0
- package/lib/private/i18n/errors.js +27 -0
- package/lib/private/i18n/module.d.ts +3 -0
- package/lib/private/i18n/module.js +115 -0
- package/lib/private/i18n/schema.d.ts +10 -5
- package/lib/private/i18n/validate.js +5 -7
- package/lib/private/index.d.ts +14 -0
- package/lib/private/index.js +2 -0
- package/lib/private/log.js +6 -5
- package/lib/private/module/Setup.d.ts +21 -0
- package/lib/private/module/Setup.js +2 -0
- package/lib/private/module/create.d.ts +16 -0
- package/lib/private/module/create.js +28 -0
- package/lib/private/orm/ExtractSchema.d.ts +9 -0
- package/lib/private/orm/ExtractSchema.js +2 -0
- package/lib/private/orm/ForeignKey.d.ts +5 -2
- package/lib/private/orm/ForeignKey.js +3 -0
- package/lib/private/orm/PrimaryKey.d.ts +5 -3
- package/lib/private/orm/PrimaryKey.js +9 -6
- package/lib/private/orm/StoreInput.d.ts +10 -0
- package/lib/private/orm/StoreInput.js +2 -0
- package/lib/private/orm/key.d.ts +6 -6
- package/lib/private/orm/key.js +7 -3
- package/lib/private/orm/parse.d.ts +5 -4
- package/lib/private/orm/parse.js +2 -2
- package/lib/private/orm/relation.d.ts +2 -2
- package/lib/private/orm/{Store.d.ts → store.d.ts} +33 -17
- package/lib/private/orm/{Store.js → store.js} +91 -67
- package/lib/private/paths.js +3 -3
- package/lib/private/request/RequestBag.d.ts +4 -0
- package/lib/private/request/RequestBag.js +5 -2
- package/lib/private/request/RequestBody.d.ts +6 -9
- package/lib/private/request/RequestBody.js +49 -54
- package/lib/private/request/RequestFacade.d.ts +3 -8
- package/lib/private/request/RequestPublic.d.ts +9 -0
- package/lib/private/request/RequestPublic.js +2 -0
- package/lib/private/request/RequestView.d.ts +11 -0
- package/lib/private/request/RequestView.js +3 -0
- package/lib/private/request/handle.d.ts +4 -0
- package/lib/private/request/handle.js +18 -0
- package/lib/private/request/parse.js +1 -0
- package/lib/private/request/route.js +8 -9
- package/lib/private/request/router.js +21 -49
- package/lib/private/request/storage.d.ts +4 -0
- package/lib/private/request/storage.js +5 -0
- package/lib/private/response/ResponseFunction.d.ts +1 -1
- package/lib/private/response/binary.js +1 -1
- package/lib/private/response/error.d.ts +1 -1
- package/lib/private/response/error.js +1 -1
- package/lib/private/response/json.d.ts +1 -1
- package/lib/private/response/json.js +1 -1
- package/lib/private/response/redirect.d.ts +5 -5
- package/lib/private/response/redirect.js +8 -9
- package/lib/private/response/respond.js +9 -7
- package/lib/private/response/sse.d.ts +1 -1
- package/lib/private/response/sse.js +1 -1
- package/lib/private/response/text.d.ts +1 -1
- package/lib/private/response/text.js +1 -1
- package/lib/private/response/view.d.ts +1 -1
- package/lib/private/response/view.js +6 -13
- package/lib/private/response/ws.d.ts +1 -1
- package/lib/private/route/router.d.ts +3 -3
- package/lib/private/route/router.js +7 -10
- package/lib/private/serve/App.d.ts +6 -7
- package/lib/private/serve/App.js +52 -43
- package/lib/private/serve/Init.d.ts +2 -2
- package/lib/private/serve/dev-module.d.ts +2 -0
- package/lib/private/serve/dev-module.js +34 -0
- package/lib/private/serve/hook.d.ts +1 -2
- package/lib/private/serve/hook.js +2 -3
- package/lib/private/serve/index.d.ts +1 -1
- package/lib/private/serve/index.js +32 -2
- package/lib/private/server/TAG.d.ts +3 -0
- package/lib/private/server/TAG.js +2 -0
- package/lib/private/server/index.d.ts +5 -0
- package/lib/private/server/index.js +6 -0
- package/lib/private/session/SessionHandle.js +2 -1
- package/lib/private/session/index.d.ts +1 -1
- package/lib/private/session/module.d.ts +3 -0
- package/lib/private/session/module.js +114 -0
- package/lib/private/session/schema.d.ts +17 -9
- package/lib/private/session/schema.js +9 -5
- package/lib/private/target/Manager.js +6 -12
- package/lib/public/client.d.ts +2 -13
- package/lib/public/client.js +1 -9
- package/lib/public/db/errors.d.ts +2 -0
- package/lib/public/db/errors.js +2 -0
- package/lib/public/db/migrate.d.ts +2 -0
- package/lib/public/db/migrate.js +2 -0
- package/lib/public/db.d.ts +3 -3
- package/lib/public/frontend.d.ts +3 -0
- package/lib/public/frontend.js +2 -0
- package/lib/public/index.d.ts +2 -0
- package/lib/public/index.js +2 -0
- package/lib/public/orm/store.d.ts +2 -0
- package/lib/public/orm/store.js +2 -0
- package/lib/public/request/server.d.ts +5 -0
- package/lib/public/request/server.js +7 -0
- package/lib/public/response.d.ts +4 -4
- package/lib/public/server.d.ts +3 -0
- package/lib/public/server.js +2 -0
- package/package.json +30 -25
- package/lib/private/AppError.d.ts +0 -4
- package/lib/private/AppError.js +0 -8
- package/lib/private/backend/Module.d.ts +0 -18
- package/lib/private/backend/Module.js +0 -19
- package/lib/private/backend/TAG.d.ts +0 -3
- package/lib/private/backend/TAG.js +0 -2
- package/lib/private/build/server/plugin/db-default.d.ts +0 -4
- package/lib/private/build/server/plugin/db-default.js +0 -45
- package/lib/private/build/server/plugin/store-wrap.d.ts +0 -4
- package/lib/private/build/server/plugin/store-wrap.js +0 -33
- package/lib/private/client/spa/index.d.ts +0 -6
- package/lib/private/client/spa/index.js +0 -200
- package/lib/private/db/error.d.ts +0 -81
- package/lib/private/db/error.js +0 -199
- package/lib/private/db/symbol/wrap.d.ts +0 -3
- package/lib/private/db/symbol/wrap.js +0 -2
- package/lib/private/fail.d.ts +0 -3
- package/lib/private/fail.js +0 -5
- package/lib/private/frontend/Module.d.ts +0 -62
- package/lib/private/frontend/Module.js +0 -255
- package/lib/private/i18n/Module.d.ts +0 -16
- package/lib/private/i18n/Module.js +0 -133
- package/lib/private/module/BuildHook.d.ts +0 -5
- package/lib/private/module/BuildHook.js +0 -2
- package/lib/private/module/NextBuild.d.ts +0 -5
- package/lib/private/module/NextBuild.js +0 -2
- package/lib/private/module/NextServe.d.ts +0 -5
- package/lib/private/module/NextServe.js +0 -2
- package/lib/private/orm/Set.d.ts +0 -11
- package/lib/private/orm/Set.js +0 -2
- package/lib/private/orm/foreign.d.ts +0 -4
- package/lib/private/orm/foreign.js +0 -5
- package/lib/private/orm/primary.d.ts +0 -5
- package/lib/private/orm/primary.js +0 -5
- package/lib/private/orm/types.d.ts +0 -18
- package/lib/private/orm/types.js +0 -2
- package/lib/private/orm/wrap.d.ts +0 -5
- package/lib/private/orm/wrap.js +0 -5
- package/lib/private/reducer.d.ts +0 -24
- package/lib/private/reducer.js +0 -10
- package/lib/private/serve/module/Dev.d.ts +0 -11
- package/lib/private/serve/module/Dev.js +0 -32
- package/lib/private/serve/module/Handle.d.ts +0 -10
- package/lib/private/serve/module/Handle.js +0 -15
- package/lib/private/session/SessionModule.d.ts +0 -14
- package/lib/private/session/SessionModule.js +0 -122
- package/lib/public/App.d.ts +0 -2
- package/lib/public/App.js +0 -2
- package/lib/public/AppError.d.ts +0 -2
- package/lib/public/AppError.js +0 -2
- package/lib/public/BuildApp.d.ts +0 -2
- package/lib/public/BuildApp.js +0 -2
- package/lib/public/BuildHook.d.ts +0 -2
- package/lib/public/BuildHook.js +0 -2
- package/lib/public/Mode.d.ts +0 -2
- package/lib/public/Mode.js +0 -2
- package/lib/public/Module.d.ts +0 -2
- package/lib/public/Module.js +0 -2
- package/lib/public/Next.d.ts +0 -2
- package/lib/public/Next.js +0 -2
- package/lib/public/NextBuild.d.ts +0 -2
- package/lib/public/NextBuild.js +0 -2
- package/lib/public/NextHandle.d.ts +0 -2
- package/lib/public/NextHandle.js +0 -2
- package/lib/public/NextRoute.d.ts +0 -3
- package/lib/public/NextRoute.js +0 -2
- package/lib/public/NextServe.d.ts +0 -2
- package/lib/public/NextServe.js +0 -2
- package/lib/public/ServeApp.d.ts +0 -2
- package/lib/public/ServeApp.js +0 -2
- package/lib/public/Target.d.ts +0 -2
- package/lib/public/Target.js +0 -2
- package/lib/public/backend/Module.d.ts +0 -2
- package/lib/public/backend/Module.js +0 -2
- package/lib/public/backend/TAG.d.ts +0 -2
- package/lib/public/backend/TAG.js +0 -2
- package/lib/public/client/Data.d.ts +0 -2
- package/lib/public/client/Data.js +0 -2
- package/lib/public/client/spa.d.ts +0 -2
- package/lib/public/client/spa.js +0 -2
- package/lib/public/db/error.d.ts +0 -2
- package/lib/public/db/error.js +0 -2
- package/lib/public/fail.d.ts +0 -2
- package/lib/public/fail.js +0 -2
- package/lib/public/frontend/Module.d.ts +0 -2
- package/lib/public/frontend/Module.js +0 -2
- package/lib/public/frontend/Publish.d.ts +0 -2
- package/lib/public/frontend/Publish.js +0 -2
- package/lib/public/frontend/Render.d.ts +0 -2
- package/lib/public/frontend/Render.js +0 -2
- package/lib/public/frontend/ViewResponse.d.ts +0 -2
- package/lib/public/frontend/ViewResponse.js +0 -2
- package/lib/public/orm/Store.d.ts +0 -2
- package/lib/public/orm/Store.js +0 -2
- package/lib/public/orm/wrap.d.ts +0 -2
- package/lib/public/orm/wrap.js +0 -2
- package/lib/public/request.d.ts +0 -4
- package/lib/public/request.js +0 -2
- /package/lib/private/{frontend → client}/Publish.d.ts +0 -0
- /package/lib/private/{frontend → client}/Publish.js +0 -0
- /package/lib/private/{frontend → client}/Render.js +0 -0
- /package/lib/private/{frontend → client}/ServerData.d.ts +0 -0
- /package/lib/private/{frontend → client}/ServerData.js +0 -0
- /package/lib/private/{frontend → client}/ServerView.d.ts +0 -0
- /package/lib/private/{frontend → client}/ServerView.js +0 -0
- /package/lib/private/{frontend → client}/View.d.ts +0 -0
- /package/lib/private/{frontend → client}/View.js +0 -0
- /package/lib/private/{frontend → client}/ViewOptions.d.ts +0 -0
- /package/lib/private/{frontend → client}/ViewOptions.js +0 -0
- /package/lib/private/{frontend → client}/ViewResponse.js +0 -0
- /package/lib/private/client/{spa/storage.d.ts → storage.d.ts} +0 -0
- /package/lib/private/client/{spa/storage.js → storage.js} +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type EnvSchema from "#app/EnvSchema";
|
|
2
|
+
import type ServerView from "#client/ServerView";
|
|
1
3
|
import type Config from "#config/Config";
|
|
2
|
-
import type ServerView from "#frontend/ServerView";
|
|
3
4
|
import type ServeApp from "#serve/App";
|
|
5
|
+
import type { ObjectType } from "pema";
|
|
4
6
|
declare const s_attach: unique symbol;
|
|
5
7
|
declare const s_config: unique symbol;
|
|
6
8
|
export { s_attach, s_config };
|
|
7
|
-
export default class AppFacade {
|
|
9
|
+
export default class AppFacade<T extends EnvSchema = EnvSchema> {
|
|
8
10
|
#private;
|
|
9
11
|
constructor(config: Config);
|
|
10
12
|
[s_attach](app: ServeApp): void;
|
|
@@ -27,14 +29,25 @@ export default class AppFacade {
|
|
|
27
29
|
host: string | undefined;
|
|
28
30
|
port: number | undefined;
|
|
29
31
|
};
|
|
30
|
-
|
|
32
|
+
db: {
|
|
33
|
+
migrations: {
|
|
34
|
+
table: string;
|
|
35
|
+
db: import("../db/DB.js").default;
|
|
36
|
+
} | undefined;
|
|
37
|
+
};
|
|
38
|
+
env: {
|
|
39
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
40
|
+
[x: string]: unknown;
|
|
41
|
+
}> | undefined;
|
|
42
|
+
};
|
|
43
|
+
modules: import("../Module.js").default[];
|
|
31
44
|
request: {
|
|
32
45
|
body: {
|
|
33
46
|
parse: boolean;
|
|
34
47
|
};
|
|
35
48
|
};
|
|
36
49
|
};
|
|
37
|
-
config<P extends string>(path: P): P extends `${infer P1}.${infer Rest}` ? P1 extends "http" | "livereload" | "request" | "modules" ? (Rest extends `${infer P1}.${infer Rest}` ? P1 extends keyof Exclude<{
|
|
50
|
+
config<P extends string>(path: P): P extends `${infer P1}.${infer Rest}` ? P1 extends "http" | "livereload" | "db" | "env" | "request" | "modules" ? (Rest extends `${infer P1}.${infer Rest}` ? P1 extends keyof Exclude<{
|
|
38
51
|
http: {
|
|
39
52
|
csp: Record<string, string[]> | undefined;
|
|
40
53
|
headers: Record<string, string> | undefined;
|
|
@@ -53,7 +66,18 @@ export default class AppFacade {
|
|
|
53
66
|
host: string | undefined;
|
|
54
67
|
port: number | undefined;
|
|
55
68
|
};
|
|
56
|
-
|
|
69
|
+
db: {
|
|
70
|
+
migrations: {
|
|
71
|
+
table: string;
|
|
72
|
+
db: import("../db/DB.js").default;
|
|
73
|
+
} | undefined;
|
|
74
|
+
};
|
|
75
|
+
env: {
|
|
76
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
77
|
+
[x: string]: unknown;
|
|
78
|
+
}> | undefined;
|
|
79
|
+
};
|
|
80
|
+
modules: import("../Module.js").default[];
|
|
57
81
|
request: {
|
|
58
82
|
body: {
|
|
59
83
|
parse: boolean;
|
|
@@ -78,7 +102,18 @@ export default class AppFacade {
|
|
|
78
102
|
host: string | undefined;
|
|
79
103
|
port: number | undefined;
|
|
80
104
|
};
|
|
81
|
-
|
|
105
|
+
db: {
|
|
106
|
+
migrations: {
|
|
107
|
+
table: string;
|
|
108
|
+
db: import("../db/DB.js").default;
|
|
109
|
+
} | undefined;
|
|
110
|
+
};
|
|
111
|
+
env: {
|
|
112
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
113
|
+
[x: string]: unknown;
|
|
114
|
+
}> | undefined;
|
|
115
|
+
};
|
|
116
|
+
modules: import("../Module.js").default[];
|
|
82
117
|
request: {
|
|
83
118
|
body: {
|
|
84
119
|
parse: boolean;
|
|
@@ -103,7 +138,18 @@ export default class AppFacade {
|
|
|
103
138
|
host: string | undefined;
|
|
104
139
|
port: number | undefined;
|
|
105
140
|
};
|
|
106
|
-
|
|
141
|
+
db: {
|
|
142
|
+
migrations: {
|
|
143
|
+
table: string;
|
|
144
|
+
db: import("../db/DB.js").default;
|
|
145
|
+
} | undefined;
|
|
146
|
+
};
|
|
147
|
+
env: {
|
|
148
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
149
|
+
[x: string]: unknown;
|
|
150
|
+
}> | undefined;
|
|
151
|
+
};
|
|
152
|
+
modules: import("../Module.js").default[];
|
|
107
153
|
request: {
|
|
108
154
|
body: {
|
|
109
155
|
parse: boolean;
|
|
@@ -128,7 +174,18 @@ export default class AppFacade {
|
|
|
128
174
|
host: string | undefined;
|
|
129
175
|
port: number | undefined;
|
|
130
176
|
};
|
|
131
|
-
|
|
177
|
+
db: {
|
|
178
|
+
migrations: {
|
|
179
|
+
table: string;
|
|
180
|
+
db: import("../db/DB.js").default;
|
|
181
|
+
} | undefined;
|
|
182
|
+
};
|
|
183
|
+
env: {
|
|
184
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
185
|
+
[x: string]: unknown;
|
|
186
|
+
}> | undefined;
|
|
187
|
+
};
|
|
188
|
+
modules: import("../Module.js").default[];
|
|
132
189
|
request: {
|
|
133
190
|
body: {
|
|
134
191
|
parse: boolean;
|
|
@@ -153,7 +210,18 @@ export default class AppFacade {
|
|
|
153
210
|
host: string | undefined;
|
|
154
211
|
port: number | undefined;
|
|
155
212
|
};
|
|
156
|
-
|
|
213
|
+
db: {
|
|
214
|
+
migrations: {
|
|
215
|
+
table: string;
|
|
216
|
+
db: import("../db/DB.js").default;
|
|
217
|
+
} | undefined;
|
|
218
|
+
};
|
|
219
|
+
env: {
|
|
220
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
221
|
+
[x: string]: unknown;
|
|
222
|
+
}> | undefined;
|
|
223
|
+
};
|
|
224
|
+
modules: import("../Module.js").default[];
|
|
157
225
|
request: {
|
|
158
226
|
body: {
|
|
159
227
|
parse: boolean;
|
|
@@ -178,7 +246,18 @@ export default class AppFacade {
|
|
|
178
246
|
host: string | undefined;
|
|
179
247
|
port: number | undefined;
|
|
180
248
|
};
|
|
181
|
-
|
|
249
|
+
db: {
|
|
250
|
+
migrations: {
|
|
251
|
+
table: string;
|
|
252
|
+
db: import("../db/DB.js").default;
|
|
253
|
+
} | undefined;
|
|
254
|
+
};
|
|
255
|
+
env: {
|
|
256
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
257
|
+
[x: string]: unknown;
|
|
258
|
+
}> | undefined;
|
|
259
|
+
};
|
|
260
|
+
modules: import("../Module.js").default[];
|
|
182
261
|
request: {
|
|
183
262
|
body: {
|
|
184
263
|
parse: boolean;
|
|
@@ -203,7 +282,18 @@ export default class AppFacade {
|
|
|
203
282
|
host: string | undefined;
|
|
204
283
|
port: number | undefined;
|
|
205
284
|
};
|
|
206
|
-
|
|
285
|
+
db: {
|
|
286
|
+
migrations: {
|
|
287
|
+
table: string;
|
|
288
|
+
db: import("../db/DB.js").default;
|
|
289
|
+
} | undefined;
|
|
290
|
+
};
|
|
291
|
+
env: {
|
|
292
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
293
|
+
[x: string]: unknown;
|
|
294
|
+
}> | undefined;
|
|
295
|
+
};
|
|
296
|
+
modules: import("../Module.js").default[];
|
|
207
297
|
request: {
|
|
208
298
|
body: {
|
|
209
299
|
parse: boolean;
|
|
@@ -228,7 +318,18 @@ export default class AppFacade {
|
|
|
228
318
|
host: string | undefined;
|
|
229
319
|
port: number | undefined;
|
|
230
320
|
};
|
|
231
|
-
|
|
321
|
+
db: {
|
|
322
|
+
migrations: {
|
|
323
|
+
table: string;
|
|
324
|
+
db: import("../db/DB.js").default;
|
|
325
|
+
} | undefined;
|
|
326
|
+
};
|
|
327
|
+
env: {
|
|
328
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
329
|
+
[x: string]: unknown;
|
|
330
|
+
}> | undefined;
|
|
331
|
+
};
|
|
332
|
+
modules: import("../Module.js").default[];
|
|
232
333
|
request: {
|
|
233
334
|
body: {
|
|
234
335
|
parse: boolean;
|
|
@@ -253,7 +354,18 @@ export default class AppFacade {
|
|
|
253
354
|
host: string | undefined;
|
|
254
355
|
port: number | undefined;
|
|
255
356
|
};
|
|
256
|
-
|
|
357
|
+
db: {
|
|
358
|
+
migrations: {
|
|
359
|
+
table: string;
|
|
360
|
+
db: import("../db/DB.js").default;
|
|
361
|
+
} | undefined;
|
|
362
|
+
};
|
|
363
|
+
env: {
|
|
364
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
365
|
+
[x: string]: unknown;
|
|
366
|
+
}> | undefined;
|
|
367
|
+
};
|
|
368
|
+
modules: import("../Module.js").default[];
|
|
257
369
|
request: {
|
|
258
370
|
body: {
|
|
259
371
|
parse: boolean;
|
|
@@ -278,7 +390,18 @@ export default class AppFacade {
|
|
|
278
390
|
host: string | undefined;
|
|
279
391
|
port: number | undefined;
|
|
280
392
|
};
|
|
281
|
-
|
|
393
|
+
db: {
|
|
394
|
+
migrations: {
|
|
395
|
+
table: string;
|
|
396
|
+
db: import("../db/DB.js").default;
|
|
397
|
+
} | undefined;
|
|
398
|
+
};
|
|
399
|
+
env: {
|
|
400
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
401
|
+
[x: string]: unknown;
|
|
402
|
+
}> | undefined;
|
|
403
|
+
};
|
|
404
|
+
modules: import("../Module.js").default[];
|
|
282
405
|
request: {
|
|
283
406
|
body: {
|
|
284
407
|
parse: boolean;
|
|
@@ -303,7 +426,18 @@ export default class AppFacade {
|
|
|
303
426
|
host: string | undefined;
|
|
304
427
|
port: number | undefined;
|
|
305
428
|
};
|
|
306
|
-
|
|
429
|
+
db: {
|
|
430
|
+
migrations: {
|
|
431
|
+
table: string;
|
|
432
|
+
db: import("../db/DB.js").default;
|
|
433
|
+
} | undefined;
|
|
434
|
+
};
|
|
435
|
+
env: {
|
|
436
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
437
|
+
[x: string]: unknown;
|
|
438
|
+
}> | undefined;
|
|
439
|
+
};
|
|
440
|
+
modules: import("../Module.js").default[];
|
|
307
441
|
request: {
|
|
308
442
|
body: {
|
|
309
443
|
parse: boolean;
|
|
@@ -328,7 +462,18 @@ export default class AppFacade {
|
|
|
328
462
|
host: string | undefined;
|
|
329
463
|
port: number | undefined;
|
|
330
464
|
};
|
|
331
|
-
|
|
465
|
+
db: {
|
|
466
|
+
migrations: {
|
|
467
|
+
table: string;
|
|
468
|
+
db: import("../db/DB.js").default;
|
|
469
|
+
} | undefined;
|
|
470
|
+
};
|
|
471
|
+
env: {
|
|
472
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
473
|
+
[x: string]: unknown;
|
|
474
|
+
}> | undefined;
|
|
475
|
+
};
|
|
476
|
+
modules: import("../Module.js").default[];
|
|
332
477
|
request: {
|
|
333
478
|
body: {
|
|
334
479
|
parse: boolean;
|
|
@@ -353,7 +498,18 @@ export default class AppFacade {
|
|
|
353
498
|
host: string | undefined;
|
|
354
499
|
port: number | undefined;
|
|
355
500
|
};
|
|
356
|
-
|
|
501
|
+
db: {
|
|
502
|
+
migrations: {
|
|
503
|
+
table: string;
|
|
504
|
+
db: import("../db/DB.js").default;
|
|
505
|
+
} | undefined;
|
|
506
|
+
};
|
|
507
|
+
env: {
|
|
508
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
509
|
+
[x: string]: unknown;
|
|
510
|
+
}> | undefined;
|
|
511
|
+
};
|
|
512
|
+
modules: import("../Module.js").default[];
|
|
357
513
|
request: {
|
|
358
514
|
body: {
|
|
359
515
|
parse: boolean;
|
|
@@ -378,7 +534,18 @@ export default class AppFacade {
|
|
|
378
534
|
host: string | undefined;
|
|
379
535
|
port: number | undefined;
|
|
380
536
|
};
|
|
381
|
-
|
|
537
|
+
db: {
|
|
538
|
+
migrations: {
|
|
539
|
+
table: string;
|
|
540
|
+
db: import("../db/DB.js").default;
|
|
541
|
+
} | undefined;
|
|
542
|
+
};
|
|
543
|
+
env: {
|
|
544
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
545
|
+
[x: string]: unknown;
|
|
546
|
+
}> | undefined;
|
|
547
|
+
};
|
|
548
|
+
modules: import("../Module.js").default[];
|
|
382
549
|
request: {
|
|
383
550
|
body: {
|
|
384
551
|
parse: boolean;
|
|
@@ -403,7 +570,18 @@ export default class AppFacade {
|
|
|
403
570
|
host: string | undefined;
|
|
404
571
|
port: number | undefined;
|
|
405
572
|
};
|
|
406
|
-
|
|
573
|
+
db: {
|
|
574
|
+
migrations: {
|
|
575
|
+
table: string;
|
|
576
|
+
db: import("../db/DB.js").default;
|
|
577
|
+
} | undefined;
|
|
578
|
+
};
|
|
579
|
+
env: {
|
|
580
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
581
|
+
[x: string]: unknown;
|
|
582
|
+
}> | undefined;
|
|
583
|
+
};
|
|
584
|
+
modules: import("../Module.js").default[];
|
|
407
585
|
request: {
|
|
408
586
|
body: {
|
|
409
587
|
parse: boolean;
|
|
@@ -428,7 +606,18 @@ export default class AppFacade {
|
|
|
428
606
|
host: string | undefined;
|
|
429
607
|
port: number | undefined;
|
|
430
608
|
};
|
|
431
|
-
|
|
609
|
+
db: {
|
|
610
|
+
migrations: {
|
|
611
|
+
table: string;
|
|
612
|
+
db: import("../db/DB.js").default;
|
|
613
|
+
} | undefined;
|
|
614
|
+
};
|
|
615
|
+
env: {
|
|
616
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
617
|
+
[x: string]: unknown;
|
|
618
|
+
}> | undefined;
|
|
619
|
+
};
|
|
620
|
+
modules: import("../Module.js").default[];
|
|
432
621
|
request: {
|
|
433
622
|
body: {
|
|
434
623
|
parse: boolean;
|
|
@@ -453,7 +642,18 @@ export default class AppFacade {
|
|
|
453
642
|
host: string | undefined;
|
|
454
643
|
port: number | undefined;
|
|
455
644
|
};
|
|
456
|
-
|
|
645
|
+
db: {
|
|
646
|
+
migrations: {
|
|
647
|
+
table: string;
|
|
648
|
+
db: import("../db/DB.js").default;
|
|
649
|
+
} | undefined;
|
|
650
|
+
};
|
|
651
|
+
env: {
|
|
652
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
653
|
+
[x: string]: unknown;
|
|
654
|
+
}> | undefined;
|
|
655
|
+
};
|
|
656
|
+
modules: import("../Module.js").default[];
|
|
457
657
|
request: {
|
|
458
658
|
body: {
|
|
459
659
|
parse: boolean;
|
|
@@ -478,7 +678,18 @@ export default class AppFacade {
|
|
|
478
678
|
host: string | undefined;
|
|
479
679
|
port: number | undefined;
|
|
480
680
|
};
|
|
481
|
-
|
|
681
|
+
db: {
|
|
682
|
+
migrations: {
|
|
683
|
+
table: string;
|
|
684
|
+
db: import("../db/DB.js").default;
|
|
685
|
+
} | undefined;
|
|
686
|
+
};
|
|
687
|
+
env: {
|
|
688
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
689
|
+
[x: string]: unknown;
|
|
690
|
+
}> | undefined;
|
|
691
|
+
};
|
|
692
|
+
modules: import("../Module.js").default[];
|
|
482
693
|
request: {
|
|
483
694
|
body: {
|
|
484
695
|
parse: boolean;
|
|
@@ -503,7 +714,18 @@ export default class AppFacade {
|
|
|
503
714
|
host: string | undefined;
|
|
504
715
|
port: number | undefined;
|
|
505
716
|
};
|
|
506
|
-
|
|
717
|
+
db: {
|
|
718
|
+
migrations: {
|
|
719
|
+
table: string;
|
|
720
|
+
db: import("../db/DB.js").default;
|
|
721
|
+
} | undefined;
|
|
722
|
+
};
|
|
723
|
+
env: {
|
|
724
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
725
|
+
[x: string]: unknown;
|
|
726
|
+
}> | undefined;
|
|
727
|
+
};
|
|
728
|
+
modules: import("../Module.js").default[];
|
|
507
729
|
request: {
|
|
508
730
|
body: {
|
|
509
731
|
parse: boolean;
|
|
@@ -528,13 +750,24 @@ export default class AppFacade {
|
|
|
528
750
|
host: string | undefined;
|
|
529
751
|
port: number | undefined;
|
|
530
752
|
};
|
|
531
|
-
|
|
753
|
+
db: {
|
|
754
|
+
migrations: {
|
|
755
|
+
table: string;
|
|
756
|
+
db: import("../db/DB.js").default;
|
|
757
|
+
} | undefined;
|
|
758
|
+
};
|
|
759
|
+
env: {
|
|
760
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
761
|
+
[x: string]: unknown;
|
|
762
|
+
}> | undefined;
|
|
763
|
+
};
|
|
764
|
+
modules: import("../Module.js").default[];
|
|
532
765
|
request: {
|
|
533
766
|
body: {
|
|
534
767
|
parse: boolean;
|
|
535
768
|
};
|
|
536
769
|
};
|
|
537
|
-
}[P1] & undefined) : undefined : P extends "http" | "livereload" | "request" | "modules" ? {
|
|
770
|
+
}[P1] & undefined) : undefined : P extends "http" | "livereload" | "db" | "env" | "request" | "modules" ? {
|
|
538
771
|
http: {
|
|
539
772
|
csp: Record<string, string[]> | undefined;
|
|
540
773
|
headers: Record<string, string> | undefined;
|
|
@@ -553,14 +786,26 @@ export default class AppFacade {
|
|
|
553
786
|
host: string | undefined;
|
|
554
787
|
port: number | undefined;
|
|
555
788
|
};
|
|
556
|
-
|
|
789
|
+
db: {
|
|
790
|
+
migrations: {
|
|
791
|
+
table: string;
|
|
792
|
+
db: import("../db/DB.js").default;
|
|
793
|
+
} | undefined;
|
|
794
|
+
};
|
|
795
|
+
env: {
|
|
796
|
+
schema: ObjectType<import("@rcompat/dict").Dict<import("pema").Parsed<unknown>>, {
|
|
797
|
+
[x: string]: unknown;
|
|
798
|
+
}> | undefined;
|
|
799
|
+
};
|
|
800
|
+
modules: import("../Module.js").default[];
|
|
557
801
|
request: {
|
|
558
802
|
body: {
|
|
559
803
|
parse: boolean;
|
|
560
804
|
};
|
|
561
805
|
};
|
|
562
806
|
}[P] : undefined;
|
|
563
|
-
|
|
807
|
+
env<K extends keyof T>(key: K): T[K]["infer"];
|
|
808
|
+
view<SV = ServerView>(name: string): SV;
|
|
564
809
|
get root(): import("@rcompat/fs").FileRef;
|
|
565
810
|
}
|
|
566
811
|
//# sourceMappingURL=Facade.d.ts.map
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
+
import E from "#errors";
|
|
1
2
|
import dict from "@rcompat/dict";
|
|
3
|
+
import env from "@rcompat/env";
|
|
4
|
+
import ParseError from "pema/ParseError";
|
|
2
5
|
const s_attach = Symbol("attach");
|
|
3
6
|
const s_config = Symbol("config");
|
|
4
7
|
export { s_attach, s_config };
|
|
5
8
|
export default class AppFacade {
|
|
6
9
|
#config;
|
|
7
10
|
#app;
|
|
11
|
+
#env;
|
|
8
12
|
constructor(config) {
|
|
9
13
|
this.#config = config;
|
|
10
14
|
}
|
|
11
15
|
[s_attach](app) {
|
|
12
16
|
this.#app = app;
|
|
17
|
+
const schema = this.#config.env.schema;
|
|
18
|
+
if (schema !== undefined) {
|
|
19
|
+
try {
|
|
20
|
+
this.#env = schema.coerce(env.toJSON());
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (ParseError.is(error))
|
|
24
|
+
throw E.env_invalid_schema(error);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
13
28
|
}
|
|
14
29
|
get [s_config]() {
|
|
15
30
|
return this.#config;
|
|
@@ -17,6 +32,14 @@ export default class AppFacade {
|
|
|
17
32
|
config(path) {
|
|
18
33
|
return dict.get(this.#config, path);
|
|
19
34
|
}
|
|
35
|
+
env(key) {
|
|
36
|
+
if (this.#env !== undefined) {
|
|
37
|
+
if (!(key in this.#env))
|
|
38
|
+
throw E.env_missing_key(key);
|
|
39
|
+
return this.#env[key];
|
|
40
|
+
}
|
|
41
|
+
return env.get(key);
|
|
42
|
+
}
|
|
20
43
|
get #with() {
|
|
21
44
|
if (!this.#app)
|
|
22
45
|
throw new Error("ServeApp not bound yet (used too early)");
|
|
@@ -2,6 +2,8 @@ import plugin_alias from "#build/client/plugin/alias";
|
|
|
2
2
|
import plugin_entrypoint from "#build/client/plugin/entrypoint";
|
|
3
3
|
import plugin_frontend from "#build/client/plugin/frontend";
|
|
4
4
|
import plugin_server_stamp from "#build/client/plugin/server-stamp";
|
|
5
|
+
import plugin_view from "#build/client/plugin/view";
|
|
6
|
+
import plugin_app_request from "#build/shared/plugin/app-request";
|
|
5
7
|
import location from "#location";
|
|
6
8
|
import * as esbuild from "esbuild";
|
|
7
9
|
const write_bootstrap = async (app, mode) => {
|
|
@@ -34,8 +36,8 @@ const write_bootstrap = async (app, mode) => {
|
|
|
34
36
|
views,
|
|
35
37
|
pages,
|
|
36
38
|
mode: "${mode}",
|
|
37
|
-
session_config,
|
|
38
|
-
i18n_config,
|
|
39
|
+
session: session_config,
|
|
40
|
+
i18n: i18n_config,
|
|
39
41
|
target: "${app.target.name}",
|
|
40
42
|
});
|
|
41
43
|
|
|
@@ -46,6 +48,8 @@ const write_bootstrap = async (app, mode) => {
|
|
|
46
48
|
export default async function build_client(app) {
|
|
47
49
|
app.plugin("client", plugin_frontend(app));
|
|
48
50
|
app.plugin("client", plugin_alias(app));
|
|
51
|
+
app.plugin("client", plugin_view(app));
|
|
52
|
+
app.plugin("client", plugin_app_request(app));
|
|
49
53
|
app.plugin("client", plugin_server_stamp(app));
|
|
50
54
|
app.plugin("client", plugin_entrypoint(app));
|
|
51
55
|
const imports = await app.path.static.files({
|
|
@@ -57,6 +61,7 @@ export default async function build_client(app) {
|
|
|
57
61
|
app.entrypoint(`import "./${location.static}${src}";`);
|
|
58
62
|
});
|
|
59
63
|
app.entrypoint("import \"primate/client/app\";");
|
|
64
|
+
const tsconfig = app.root.join("tsconfig.json");
|
|
60
65
|
const conditions = app.conditions.values();
|
|
61
66
|
const build_options = {
|
|
62
67
|
plugins: app.plugins("client"),
|
|
@@ -64,7 +69,7 @@ export default async function build_client(app) {
|
|
|
64
69
|
entryPoints: ["app:client"],
|
|
65
70
|
conditions: ["style", "browser", "default", "module", ...conditions],
|
|
66
71
|
resolveExtensions: [".ts", ".js", ...app.frontendExtensions],
|
|
67
|
-
tsconfig
|
|
72
|
+
...await tsconfig.exists() ? { tsconfig: tsconfig.path } : {},
|
|
68
73
|
bundle: true,
|
|
69
74
|
format: "esm",
|
|
70
75
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default function plugin_client_request(app) {
|
|
2
|
+
return {
|
|
3
|
+
name: "primate/client/app/request",
|
|
4
|
+
setup(build) {
|
|
5
|
+
build.onResolve({ filter: /^app:request$/ }, ({ importer }) => {
|
|
6
|
+
const frontend = [...app.frontends.entries()]
|
|
7
|
+
.find(([, exts]) => exts.some(ext => importer.endsWith(ext)));
|
|
8
|
+
return frontend !== undefined
|
|
9
|
+
? { namespace: "request", path: frontend[0] }
|
|
10
|
+
: undefined;
|
|
11
|
+
});
|
|
12
|
+
build.onLoad({ filter: /.*/, namespace: "request" }, async ({ path }) => {
|
|
13
|
+
const contents = `export { default } from "@primate/${path}/request";`;
|
|
14
|
+
return { contents, resolveDir: app.root.path };
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=app-request.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import location from "#location";
|
|
2
|
+
export default function plugin_client_view(app) {
|
|
3
|
+
return {
|
|
4
|
+
name: "primate/client/view",
|
|
5
|
+
setup(build) {
|
|
6
|
+
build.onResolve({ filter: /^view:/ }, args => {
|
|
7
|
+
const name = args.path.slice("view:".length);
|
|
8
|
+
return { path: app.root.join(location.views, name).path };
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import build_client from "#build/client/index";
|
|
2
2
|
import build_server from "#build/server/index";
|
|
3
|
-
import
|
|
3
|
+
import E from "#errors";
|
|
4
4
|
import location from "#location";
|
|
5
5
|
import log from "#log";
|
|
6
|
-
import reducer from "#reducer";
|
|
7
6
|
import $router from "#request/router";
|
|
8
7
|
import s_layout_depth from "#symbol/layout-depth";
|
|
9
8
|
import c from "@rcompat/cli/color";
|
|
@@ -11,22 +10,16 @@ import fs from "@rcompat/fs";
|
|
|
11
10
|
const core_pkg = await fs.project.package(import.meta.dirname);
|
|
12
11
|
const { version } = await core_pkg.json();
|
|
13
12
|
async function pre(app) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
throw
|
|
13
|
+
const build_json = app.path.build.join("build.json");
|
|
14
|
+
const build_path = app.path.build;
|
|
15
|
+
if (await build_path.exists() && !await build_json.exists()) {
|
|
16
|
+
throw E.build_previous_build_exists(build_path);
|
|
18
17
|
}
|
|
19
|
-
// remove build directory if exists
|
|
20
18
|
await app.path.build.remove();
|
|
21
19
|
await app.path.build.create();
|
|
22
|
-
// touch a .primate file to indicate this is a Primate build directory
|
|
23
|
-
await dot_primate.write(version);
|
|
24
20
|
await app.runpath(location.client).create();
|
|
25
21
|
const stamp = app.runpath("client", "server-stamp.js");
|
|
26
22
|
await stamp.write("export default 0;\n");
|
|
27
|
-
// this has to occur before post, so that layout depth is available for
|
|
28
|
-
// compiling root views
|
|
29
|
-
// bindings should have been registered during `init`
|
|
30
23
|
const router = await $router(app.path.routes, app.extensions);
|
|
31
24
|
app.set(s_layout_depth, router.depth("layout"));
|
|
32
25
|
const i18n_ts = app.path.config.join("i18n.ts");
|
|
@@ -35,16 +28,28 @@ async function pre(app) {
|
|
|
35
28
|
const session_ts = app.path.config.join("session.ts");
|
|
36
29
|
const session_js = app.path.config.join("session.js");
|
|
37
30
|
app.session_active = await session_ts.exists() || await session_js.exists();
|
|
38
|
-
return app;
|
|
39
31
|
}
|
|
40
|
-
;
|
|
41
32
|
async function post(app) {
|
|
42
33
|
await build_client(app);
|
|
43
34
|
await build_server(app);
|
|
35
|
+
// write build.json with version and migration_version
|
|
36
|
+
const migrations_dir = app.root.join("migrations");
|
|
37
|
+
let migration_version = 0;
|
|
38
|
+
if (await migrations_dir.exists()) {
|
|
39
|
+
const files = await migrations_dir.files({ filter: /\d+-.*\.[jt]s$/ });
|
|
40
|
+
migration_version = files.length === 0 ? 0 : Math.max(...files.map(f => parseInt(f.name.split("-")[0])));
|
|
41
|
+
}
|
|
42
|
+
await app.path.build.join("build.json").writeJSON({
|
|
43
|
+
version,
|
|
44
|
+
migration_version,
|
|
45
|
+
});
|
|
44
46
|
log.print(`✓ build path ${c.dim(app.path.build.path)}\n`);
|
|
45
47
|
app.cleanup();
|
|
46
48
|
return app;
|
|
47
49
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
export default async function run_build_hooks(app) {
|
|
51
|
+
await pre(app);
|
|
52
|
+
await app.build_hooks(app);
|
|
53
|
+
return post(app);
|
|
54
|
+
}
|
|
50
55
|
//# sourceMappingURL=hook.js.map
|