@hamur/adapter-angular 0.0.1 → 0.0.3

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/src/form.ts CHANGED
@@ -1,253 +1,182 @@
1
- import {
2
- DestroyRef,
3
- Directive,
4
- ElementRef,
5
- InjectionToken,
6
- assertInInjectionContext,
7
- booleanAttribute,
8
- computed,
9
- effect,
10
- inject,
11
- input,
12
- signal,
13
- untracked,
14
- type Signal,
15
- } from "@angular/core"
16
- import {
17
- IDLE_FORM_STATUS,
18
- assertFormMethod,
19
- createActionRunner,
20
- createFormStatus,
21
- functionFormAction,
22
- linkActionRunner,
23
- optimisticSource,
24
- restoredResult,
25
- runFunctionForm,
26
- } from "hamur/adapter"
27
- import type { ActionOptions, ActionRunner, FormStatus, FormStatusStore, Handler } from "hamur/adapter"
28
- import { createForm, enhance } from "hamur/app"
29
- import type {
30
- ActionFailure,
31
- EnhanceOptions,
32
- FieldsOf,
33
- HamurError,
34
- HandlerFormInstance,
35
- PendingRun,
36
- RouteLocation,
37
- } from "hamur/app"
38
- import {
39
- HAMUR_APP,
40
- HAMUR_HREF,
41
- HAMUR_PAYLOAD,
42
- HAMUR_ROUTE,
43
- HAMUR_ROUTER,
44
- detachedHref,
45
- onServer,
46
- required,
47
- } from "./context.ts"
48
-
49
- type FormHandler = Handler<any, any>
50
- type FormAction = string | RouteLocation | FormHandler
51
-
1
+ import { DestroyRef, Directive, ElementRef, InjectionToken, assertInInjectionContext, booleanAttribute, computed, effect, inject, input, signal, untracked, } from "@angular/core";
2
+ import { IDLE_FORM_STATUS, assertFormMethod, createActionRunner, createFormStatus, functionFormAction, linkActionRunner, optimisticSource, restoredResult, runFunctionForm, } from "hamur/adapter";
3
+ import { createForm, enhance } from "hamur/app";
4
+ import { HAMUR_APP, HAMUR_HREF, HAMUR_PAYLOAD, HAMUR_ROUTE, HAMUR_ROUTER, detachedHref, onServer, required, } from "./context.ts";
5
+ import * as i0 from "@angular/core";
52
6
  /** The status of the `Form` a component is created in: what `injectFormStatus` reads and `injectAction` links to. */
53
- const FORM_STATUS = new InjectionToken<FormStatusStore>("hamur form status")
54
-
55
- const handlerStateOf = (payload: Signal<unknown> | null) =>
56
- (payload?.() as { handlerState?: unknown } | undefined)?.handlerState
57
-
7
+ const FORM_STATUS = new InjectionToken("hamur form status");
8
+ const handlerStateOf = (payload) => payload?.()?.handlerState;
58
9
  /**
59
10
  * `<form hamurForm>`. The host bindings write what the other adapters' `Form` writes on its
60
11
  * `<form>`; with a handler it posts to the page with `_fn=<id>` without JavaScript and calls the handler's stub with it.
61
12
  */
62
- @Directive({
63
- selector: "form[hamurForm]",
64
- providers: [{ provide: FORM_STATUS, useFactory: createFormStatus }],
65
- host: {
66
- "data-hamur-form": "",
67
- "[attr.method]": "methodAttribute()",
68
- "[attr.action]": "target()",
69
- "[attr.enctype]": "encType()",
70
- "[attr.data-hamur-replace]": "flag(replace())",
71
- "[attr.data-hamur-reset]": "flag(reset())",
72
- "[attr.data-hamur-reload]": "flag(reloadDocument())",
73
- "[attr.data-hamur-refresh]": "refresh() === false ? 'false' : null",
74
- "[attr.data-hamur-restore]": "restore() ? null : 'false'",
75
- },
76
- })
77
13
  export class Form {
78
- readonly action = input<FormAction | undefined, FormAction | "" | undefined>(undefined, {
79
- alias: "hamurForm",
80
- transform: (value) => (value === "" ? undefined : value),
81
- })
82
- readonly method = input<"get" | "post">()
83
- readonly encType = input<"application/x-www-form-urlencoded" | "multipart/form-data">()
84
- readonly replace = input(false, { transform: booleanAttribute })
85
- readonly reset = input(false, { transform: booleanAttribute })
86
- readonly reloadDocument = input(false, { transform: booleanAttribute })
87
- readonly refresh = input<boolean | undefined, unknown>(undefined, {
88
- transform: (value: unknown) => (value === undefined ? undefined : booleanAttribute(value)),
89
- })
90
- readonly restore = input(true, { transform: booleanAttribute })
91
- readonly instance = input<string | number>()
92
-
93
- private readonly app = inject(HAMUR_APP, { optional: true })
94
- private readonly route = inject(HAMUR_ROUTE, { optional: true })
95
- private readonly router = inject(HAMUR_ROUTER, { optional: true })
96
- private readonly resolve = inject(HAMUR_HREF, { optional: true }) ?? detachedHref
97
- private readonly status = inject(FORM_STATUS)
98
- private readonly element = inject<ElementRef<HTMLFormElement>>(ElementRef).nativeElement
99
-
100
- protected readonly methodAttribute = computed(() => (typeof this.action() === "function" ? "post" : "get"))
101
- protected readonly target = computed(() => {
102
- const action = this.action()
103
- assertFormMethod(action, this.method())
104
- const page = this.route ? this.route().fullPath.replace(/#.*$/, "") : undefined
105
- if (typeof action === "function") return functionFormAction(action, this.resolve(page ?? "/"), this.instance())
106
- return action !== undefined ? this.resolve(action) : page !== undefined ? this.resolve(page) : undefined
107
- })
108
-
109
- private readonly posts = computed(() => typeof this.action() === "function")
110
-
111
- constructor() {
112
- const browser = !onServer()
113
- effect((onCleanup) => {
114
- if (!browser) return
115
- const posts = this.posts()
116
- onCleanup(untracked(() => enhance(this.element, this.enhanceOptions(posts))))
117
- })
118
- }
119
-
120
- private enhanceOptions(posts: boolean): EnhanceOptions {
121
- const { status } = this
122
- return {
123
- onSubmit: (args) => status.submitted(args.formData),
124
- ...(posts && this.app
125
- ? { call: (input: Record<string, unknown>, formData: FormData) => this.post(input, formData) }
126
- : {}),
14
+ action = input(undefined, { ...(ngDevMode ? { debugName: "action" } : /* istanbul ignore next */ {}), alias: "hamurForm",
15
+ transform: (value) => (value === "" ? undefined : value) });
16
+ method = input(/* @ts-ignore */
17
+ ...(ngDevMode ? [undefined, { debugName: "method" }] : /* istanbul ignore next */ []));
18
+ encType = input(/* @ts-ignore */
19
+ ...(ngDevMode ? [undefined, { debugName: "encType" }] : /* istanbul ignore next */ []));
20
+ replace = input(false, { ...(ngDevMode ? { debugName: "replace" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
21
+ reset = input(false, { ...(ngDevMode ? { debugName: "reset" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
22
+ reloadDocument = input(false, { ...(ngDevMode ? { debugName: "reloadDocument" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
23
+ refresh = input(undefined, { ...(ngDevMode ? { debugName: "refresh" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : booleanAttribute(value)) });
24
+ restore = input(true, { ...(ngDevMode ? { debugName: "restore" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
25
+ instance = input(/* @ts-ignore */
26
+ ...(ngDevMode ? [undefined, { debugName: "instance" }] : /* istanbul ignore next */ []));
27
+ app = inject(HAMUR_APP, { optional: true });
28
+ route = inject(HAMUR_ROUTE, { optional: true });
29
+ router = inject(HAMUR_ROUTER, { optional: true });
30
+ resolve = inject(HAMUR_HREF, { optional: true }) ?? detachedHref;
31
+ status = inject(FORM_STATUS);
32
+ element = inject(ElementRef).nativeElement;
33
+ methodAttribute = computed(() => (typeof this.action() === "function" ? "post" : "get"), /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "methodAttribute" }] : /* istanbul ignore next */ []));
35
+ target = computed(() => {
36
+ const action = this.action();
37
+ assertFormMethod(action, this.method());
38
+ const page = this.route ? this.route().fullPath.replace(/#.*$/, "") : undefined;
39
+ if (typeof action === "function")
40
+ return functionFormAction(action, this.resolve(page ?? "/"), this.instance());
41
+ return action !== undefined ? this.resolve(action) : page !== undefined ? this.resolve(page) : undefined;
42
+ }, /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
44
+ posts = computed(() => typeof this.action() === "function", /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "posts" }] : /* istanbul ignore next */ []));
46
+ constructor() {
47
+ const browser = !onServer();
48
+ effect((onCleanup) => {
49
+ if (!browser)
50
+ return;
51
+ const posts = this.posts();
52
+ onCleanup(untracked(() => enhance(this.element, this.enhanceOptions(posts))));
53
+ });
54
+ }
55
+ enhanceOptions(posts) {
56
+ const { status } = this;
57
+ return {
58
+ onSubmit: (args) => status.submitted(args.formData),
59
+ ...(posts && this.app
60
+ ? { call: (input, formData) => this.post(input, formData) }
61
+ : {}),
62
+ };
63
+ }
64
+ /** The handler, `refresh` and `instance` of the moment of the submission, as `action` and `_fn` show them. */
65
+ post(input, formData) {
66
+ const action = this.action();
67
+ const { app, router, status } = this;
68
+ if (typeof action !== "function" || !app)
69
+ return Promise.resolve(false);
70
+ return runFunctionForm(app, action, input, formData, () => router?.refresh() ?? Promise.resolve(), status, {
71
+ refresh: this.refresh(),
72
+ instance: this.instance(),
73
+ });
127
74
  }
128
- }
129
-
130
- /** The handler, `refresh` and `instance` of the moment of the submission, as `action` and `_fn` show them. */
131
- private post(input: Record<string, unknown>, formData: FormData) {
132
- const action = this.action()
133
- const { app, router, status } = this
134
- if (typeof action !== "function" || !app) return Promise.resolve(false)
135
- return runFunctionForm(app, action, input, formData, () => router?.refresh() ?? Promise.resolve(), status, {
136
- refresh: this.refresh(),
137
- instance: this.instance(),
138
- })
139
- }
140
-
141
- protected flag(value: boolean): "" | null {
142
- return value ? "" : null
143
- }
75
+ flag(value) {
76
+ return value ? "" : null;
77
+ }
78
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.2", ngImport: i0, type: Form, deps: [], target: i0.ɵɵFactoryTarget.Directive });
79
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.3.2", type: Form, isStandalone: true, selector: "form[hamurForm]", inputs: { action: { classPropertyName: "action", publicName: "hamurForm", isSignal: true, isRequired: false, transformFunction: null }, method: { classPropertyName: "method", publicName: "method", isSignal: true, isRequired: false, transformFunction: null }, encType: { classPropertyName: "encType", publicName: "encType", isSignal: true, isRequired: false, transformFunction: null }, replace: { classPropertyName: "replace", publicName: "replace", isSignal: true, isRequired: false, transformFunction: null }, reset: { classPropertyName: "reset", publicName: "reset", isSignal: true, isRequired: false, transformFunction: null }, reloadDocument: { classPropertyName: "reloadDocument", publicName: "reloadDocument", isSignal: true, isRequired: false, transformFunction: null }, refresh: { classPropertyName: "refresh", publicName: "refresh", isSignal: true, isRequired: false, transformFunction: null }, restore: { classPropertyName: "restore", publicName: "restore", isSignal: true, isRequired: false, transformFunction: null }, instance: { classPropertyName: "instance", publicName: "instance", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-hamur-form": "" }, properties: { "attr.method": "methodAttribute()", "attr.action": "target()", "attr.enctype": "encType()", "attr.data-hamur-replace": "flag(replace())", "attr.data-hamur-reset": "flag(reset())", "attr.data-hamur-reload": "flag(reloadDocument())", "attr.data-hamur-refresh": "refresh() === false ? 'false' : null", "attr.data-hamur-restore": "restore() ? null : 'false'" } }, providers: [{ provide: FORM_STATUS, useFactory: createFormStatus }], ngImport: i0 });
144
80
  }
145
-
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.2", ngImport: i0, type: Form, decorators: [{
82
+ type: Directive,
83
+ args: [{
84
+ selector: "form[hamurForm]",
85
+ providers: [{ provide: FORM_STATUS, useFactory: createFormStatus }],
86
+ host: {
87
+ "data-hamur-form": "",
88
+ "[attr.method]": "methodAttribute()",
89
+ "[attr.action]": "target()",
90
+ "[attr.enctype]": "encType()",
91
+ "[attr.data-hamur-replace]": "flag(replace())",
92
+ "[attr.data-hamur-reset]": "flag(reset())",
93
+ "[attr.data-hamur-reload]": "flag(reloadDocument())",
94
+ "[attr.data-hamur-refresh]": "refresh() === false ? 'false' : null",
95
+ "[attr.data-hamur-restore]": "restore() ? null : 'false'",
96
+ },
97
+ }]
98
+ }], ctorParameters: () => [], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "hamurForm", required: false }] }], method: [{ type: i0.Input, args: [{ isSignal: true, alias: "method", required: false }] }], encType: [{ type: i0.Input, args: [{ isSignal: true, alias: "encType", required: false }] }], replace: [{ type: i0.Input, args: [{ isSignal: true, alias: "replace", required: false }] }], reset: [{ type: i0.Input, args: [{ isSignal: true, alias: "reset", required: false }] }], reloadDocument: [{ type: i0.Input, args: [{ isSignal: true, alias: "reloadDocument", required: false }] }], refresh: [{ type: i0.Input, args: [{ isSignal: true, alias: "refresh", required: false }] }], restore: [{ type: i0.Input, args: [{ isSignal: true, alias: "restore", required: false }] }], instance: [{ type: i0.Input, args: [{ isSignal: true, alias: "instance", required: false }] }] } });
146
99
  /** The run of the `Form` the component is created in; idle outside one. */
147
- export function injectFormStatus(): Signal<FormStatus> {
148
- assertInInjectionContext(injectFormStatus)
149
- const store = inject(FORM_STATUS, { optional: true })
150
- if (!store) return signal(IDLE_FORM_STATUS).asReadonly()
151
- const status = signal(store.get())
152
- inject(DestroyRef).onDestroy(store.subscribe(() => status.set(store.get())))
153
- return status.asReadonly()
154
- }
155
-
156
- /** What `injectForm(fn)` and its `for(key)` return: the field helpers, and the store's values as signals. */
157
- export interface InjectFormInstance<I, O> {
158
- readonly fields: FieldsOf<I>
159
- /** True while a run of this handler and instance is in `pendingRuns`. */
160
- readonly pending: Signal<boolean>
161
- /** What the last run returned, a `fail()` included. */
162
- readonly result: Signal<O | undefined>
100
+ export function injectFormStatus() {
101
+ assertInInjectionContext(injectFormStatus);
102
+ const store = inject(FORM_STATUS, { optional: true });
103
+ if (!store)
104
+ return signal(IDLE_FORM_STATUS).asReadonly();
105
+ const status = signal(store.get(), /* @ts-ignore */
106
+ ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
107
+ inject(DestroyRef).onDestroy(store.subscribe(() => status.set(store.get())));
108
+ return status.asReadonly();
163
109
  }
164
-
165
- export interface InjectFormResult<I, O> extends InjectFormInstance<I, O> {
166
- /** The store of `injectAction(fn, { instance: key })`. */
167
- for(key: string | number): InjectFormInstance<I, O>
168
- }
169
-
170
110
  /** The field helpers of `fn`'s input and the store of its runs; a field's reads follow the store too. */
171
- export function injectForm<I, O>(fn: Handler<I, O>): InjectFormResult<I, O> {
172
- assertInInjectionContext(injectForm)
173
- const payload = inject(HAMUR_PAYLOAD, { optional: true })
174
- const version = signal(0)
175
- const form = createForm(fn, {
176
- app: inject(HAMUR_APP, { optional: true }),
177
- submitted: () => ({ handlerState: handlerStateOf(payload) }),
178
- track: () => void version(),
179
- })
180
- inject(DestroyRef).onDestroy(form.subscribe(() => version.set(form.version())))
181
- const signals = (instance: HandlerFormInstance<I, O>): InjectFormInstance<I, O> => ({
182
- fields: instance.fields,
183
- pending: computed(() => instance.pending),
184
- result: computed(() => instance.result),
185
- })
186
- const instances = new Map<string | number, InjectFormInstance<I, O>>()
187
- return {
188
- ...signals(form),
189
- for(key) {
190
- let instance = instances.get(key)
191
- if (!instance) instances.set(key, (instance = signals(form.for(key))))
192
- return instance
193
- },
194
- }
195
- }
196
-
197
- export interface InjectActionResult<I, O> {
198
- readonly run: ActionRunner<I, O>["run"]
199
- readonly state: Signal<O | undefined>
200
- readonly pending: Signal<boolean>
201
- readonly error: Signal<HamurError | undefined>
202
- readonly failure: Signal<ActionFailure | undefined>
203
- reset(): void
111
+ export function injectForm(fn) {
112
+ assertInInjectionContext(injectForm);
113
+ const payload = inject(HAMUR_PAYLOAD, { optional: true });
114
+ const version = signal(0, /* @ts-ignore */
115
+ ...(ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []));
116
+ const form = createForm(fn, {
117
+ app: inject(HAMUR_APP, { optional: true }),
118
+ submitted: () => ({ handlerState: handlerStateOf(payload) }),
119
+ track: () => void version(),
120
+ });
121
+ inject(DestroyRef).onDestroy(form.subscribe(() => version.set(form.version())));
122
+ const signals = (instance) => ({
123
+ fields: instance.fields,
124
+ pending: computed(() => instance.pending),
125
+ result: computed(() => instance.result),
126
+ });
127
+ const instances = new Map();
128
+ return {
129
+ ...signals(form),
130
+ for(key) {
131
+ let instance = instances.get(key);
132
+ if (!instance)
133
+ instances.set(key, (instance = signals(form.for(key))));
134
+ return instance;
135
+ },
136
+ };
204
137
  }
205
-
206
138
  /** Runs `fn` one call after another; below a `Form` of `fn` it shows that form's posts. */
207
- export function injectAction<I, O>(
208
- fn: Handler<I, O>,
209
- options: ActionOptions<O> & { instance?: string | number } = {},
210
- ): InjectActionResult<I, O> {
211
- assertInInjectionContext(injectAction)
212
- const router = required(HAMUR_ROUTER, "injectAction")
213
- const app = inject(HAMUR_APP, { optional: true })
214
- const { instance } = options
215
- const runner = createActionRunner(fn, {
216
- app,
217
- instance,
218
- options: () => options,
219
- refresh: () => router.refresh(),
220
- restored: restoredResult<O>(handlerStateOf(inject(HAMUR_PAYLOAD, { optional: true })), fn.id, instance),
221
- })
222
- const snapshot = signal(runner.get())
223
- const destroy = inject(DestroyRef)
224
- destroy.onDestroy(runner.subscribe(() => snapshot.set(runner.get())))
225
- const below = inject(FORM_STATUS, { optional: true })
226
- if (below) destroy.onDestroy(below.owner.link(fn.id, runner, instance))
227
- else if (app) destroy.onDestroy(linkActionRunner(app, fn.id, runner, instance))
228
- return {
229
- run: runner.run,
230
- reset: runner.reset,
231
- state: computed(() => snapshot().state),
232
- pending: computed(() => snapshot().pending),
233
- error: computed(() => snapshot().error),
234
- failure: computed(() => snapshot().failure),
235
- }
139
+ export function injectAction(fn, options = {}) {
140
+ assertInInjectionContext(injectAction);
141
+ const router = required(HAMUR_ROUTER, "injectAction");
142
+ const app = inject(HAMUR_APP, { optional: true });
143
+ const { instance } = options;
144
+ const runner = createActionRunner(fn, {
145
+ app,
146
+ instance,
147
+ options: () => options,
148
+ refresh: () => router.refresh(),
149
+ restored: restoredResult(handlerStateOf(inject(HAMUR_PAYLOAD, { optional: true })), fn.id, instance),
150
+ });
151
+ const snapshot = signal(runner.get(), /* @ts-ignore */
152
+ ...(ngDevMode ? [{ debugName: "snapshot" }] : /* istanbul ignore next */ []));
153
+ const destroy = inject(DestroyRef);
154
+ destroy.onDestroy(runner.subscribe(() => snapshot.set(runner.get())));
155
+ const below = inject(FORM_STATUS, { optional: true });
156
+ if (below)
157
+ destroy.onDestroy(below.owner.link(fn.id, runner, instance));
158
+ else if (app)
159
+ destroy.onDestroy(linkActionRunner(app, fn.id, runner, instance));
160
+ return {
161
+ run: runner.run,
162
+ reset: runner.reset,
163
+ state: computed(() => snapshot().state),
164
+ pending: computed(() => snapshot().pending),
165
+ error: computed(() => snapshot().error),
166
+ failure: computed(() => snapshot().failure),
167
+ };
236
168
  }
237
-
238
169
  /** `value` while no handler call runs, else `reduce(value, the running calls)`. */
239
- export function injectOptimistic<T, A = PendingRun>(
240
- value: T | (() => T),
241
- reduce: (current: T, pending: A[]) => T,
242
- ): Signal<T> {
243
- assertInInjectionContext(injectOptimistic)
244
- const source = optimisticSource(inject(HAMUR_APP, { optional: true }))
245
- const pending = signal(source.get())
246
- inject(DestroyRef).onDestroy(source.subscribe(() => pending.set(source.get())))
247
- const read = typeof value === "function" ? (value as () => T) : () => value as T
248
- return computed(() => {
249
- const runs = pending()
250
- const current = read()
251
- return runs.length ? reduce(current, runs as unknown as A[]) : current
252
- })
170
+ export function injectOptimistic(value, reduce) {
171
+ assertInInjectionContext(injectOptimistic);
172
+ const source = optimisticSource(inject(HAMUR_APP, { optional: true }));
173
+ const pending = signal(source.get(), /* @ts-ignore */
174
+ ...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
175
+ inject(DestroyRef).onDestroy(source.subscribe(() => pending.set(source.get())));
176
+ const read = typeof value === "function" ? value : () => value;
177
+ return computed(() => {
178
+ const runs = pending();
179
+ const current = read();
180
+ return runs.length ? reduce(current, runs) : current;
181
+ });
253
182
  }
package/src/hmr.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type {} from "hamur"
2
2
  import type { Adapter } from "hamur/adapter"
3
3
  import { addDevServerHandler, useDevChannel, useHamur, type DevChange, type HamurContext } from "hamur/kit"
4
- import { devProgramOf, releaseDevProgram, setDevBaseURL } from "./compile.ts"
4
+ import { devProgramOf, releaseBuildSources, releaseDevProgram, setDevBaseURL } from "./compile.ts"
5
5
 
6
6
  declare module "hamur" {
7
7
  interface HamurDevEvents {
@@ -16,7 +16,7 @@ const NO_STORE = { "content-type": "text/javascript", "cache-control": "no-store
16
16
 
17
17
  /**
18
18
  * `modules:done` serves `/@ng/component`; `dev:change` sends the update, or lists the components
19
- * that read the file as dependents with `hmr` off, and with it on those a template error is shown in; `close` drops the program.
19
+ * that read the file as dependents with `hmr` off, and with it on those a template error is shown in; `close` drops the program and what the build parsed.
20
20
  */
21
21
  export const angularHooks: NonNullable<Adapter["hooks"]> = {
22
22
  "modules:done": () => {
@@ -57,5 +57,6 @@ export const angularHooks: NonNullable<Adapter["hooks"]> = {
57
57
  close: () => {
58
58
  const { rootDir, buildDir } = useHamur().options
59
59
  releaseDevProgram(rootDir, buildDir)
60
+ releaseBuildSources()
60
61
  },
61
62
  }