@sjcx/vorma 0.0.0-pre.6 → 0.0.0-pre.8

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.
Files changed (110) hide show
  1. package/LICENSE +197 -1
  2. package/dist/build/assets/css-static-public-assets.d.ts +22 -0
  3. package/dist/build/assets/static-public-asset-plugin.d.ts +20 -0
  4. package/dist/build/assets/static-public-assets.d.ts +44 -0
  5. package/dist/build/build-application.d.ts +18 -0
  6. package/dist/build/{bundle-client.d.ts → bundling/bundle-client.d.ts} +16 -5
  7. package/dist/build/{client-output-hashing.d.ts → bundling/client-output-hashing.d.ts} +1 -1
  8. package/dist/build/bundling/critical-css.d.ts +19 -0
  9. package/dist/build/cli.js +4773 -849
  10. package/dist/build/config/load-config.d.ts +142 -0
  11. package/dist/build/config/resolve-config.d.ts +63 -0
  12. package/dist/build/{source-layout.d.ts → config/source-layout.d.ts} +4 -6
  13. package/dist/build/config/url-pathname.d.ts +13 -0
  14. package/dist/build/config/vite-options.d.ts +80 -0
  15. package/dist/build/dev/application-process.d.ts +18 -0
  16. package/dist/build/dev/artifacts.d.ts +37 -0
  17. package/dist/build/dev/browser-source.d.ts +25 -0
  18. package/dist/build/dev/build.d.ts +33 -0
  19. package/dist/build/dev/cargo-metadata.d.ts +28 -0
  20. package/dist/build/dev/changes.d.ts +11 -0
  21. package/dist/build/dev/client-inputs.d.ts +25 -0
  22. package/dist/build/dev/client.d.ts +39 -0
  23. package/dist/build/dev/dev-protocol.d.ts +23 -0
  24. package/dist/build/dev/generated-paths.d.ts +27 -0
  25. package/dist/build/dev/generation.d.ts +31 -0
  26. package/dist/build/dev/index-html.d.ts +28 -0
  27. package/dist/build/dev/module-server.d.ts +24 -0
  28. package/dist/build/dev/patterns.d.ts +26 -0
  29. package/dist/build/dev/ports.d.ts +25 -0
  30. package/dist/build/dev/server-process.d.ts +34 -0
  31. package/dist/build/dev/server-sources.d.ts +19 -0
  32. package/dist/build/dev/session.d.ts +28 -0
  33. package/dist/build/dev/sources.d.ts +46 -0
  34. package/dist/build/{development-stylesheet.d.ts → dev/stylesheet.d.ts} +4 -4
  35. package/dist/build/dev/watcher.d.ts +30 -0
  36. package/dist/build/dev/work.d.ts +67 -0
  37. package/dist/build/{client-inputs.d.ts → generation/client-view-entries.d.ts} +1 -3
  38. package/dist/build/generation/compile-application.d.ts +28 -0
  39. package/dist/build/generation/generate-application.d.ts +52 -0
  40. package/dist/build/generation/render-client-contracts.d.ts +15 -0
  41. package/dist/build/{render-source-text.d.ts → generation/render-source-text.d.ts} +3 -7
  42. package/dist/build/inspection/http-method.d.ts +4 -0
  43. package/dist/build/inspection/inspect-application.d.ts +25 -0
  44. package/dist/build/inspection/inspect-projects.d.ts +85 -0
  45. package/dist/build/inspection/rust-server.d.ts +57 -0
  46. package/dist/build/inspection/type-declarations.d.ts +20 -0
  47. package/dist/build/inspection/typescript-projects.d.ts +31 -0
  48. package/dist/build/issues.d.ts +25 -0
  49. package/dist/build/{contained-path.d.ts → output/contained-path.d.ts} +3 -13
  50. package/dist/build/output/content-hash.d.ts +9 -0
  51. package/dist/build/output/dist-dir.d.ts +34 -0
  52. package/dist/build/output/output-files.d.ts +23 -0
  53. package/dist/build/output/output-ownership.d.ts +44 -0
  54. package/dist/build/output/published-file-url.d.ts +6 -0
  55. package/dist/build/patterns/nested-route-chains.d.ts +12 -0
  56. package/dist/build/patterns/pattern-language.d.ts +3 -0
  57. package/dist/build/patterns/route-patterns.d.ts +12 -0
  58. package/dist/build/publication/assemble-artifacts.d.ts +37 -0
  59. package/dist/build/{browser-contracts.d.ts → publication/browser-contracts.d.ts} +1 -1
  60. package/dist/build/publication/build-metadata.d.ts +45 -0
  61. package/dist/build/publication/publish-artifacts.d.ts +17 -0
  62. package/dist/config-FbabCxBO.js +56 -0
  63. package/dist/config.d.ts +106 -0
  64. package/dist/index.d.ts +1 -0
  65. package/dist/index.js +2 -0
  66. package/dist/plugin-api-Btb0teGk.js +36 -0
  67. package/dist/vite/index.d.ts +14 -3
  68. package/dist/vite/index.js +25 -9
  69. package/dist/vite/plugin-api.d.ts +18 -0
  70. package/package.json +12 -16
  71. package/dist/build/assemble-artifacts.d.ts +0 -23
  72. package/dist/build/client-public-urls.d.ts +0 -20
  73. package/dist/build/compare-text.d.ts +0 -5
  74. package/dist/build/compile-application.d.ts +0 -43
  75. package/dist/build/content-digest.d.ts +0 -7
  76. package/dist/build/critical-css.d.ts +0 -7
  77. package/dist/build/css-public-assets.d.ts +0 -15
  78. package/dist/build/development-artifacts.d.ts +0 -36
  79. package/dist/build/development-browser-source.d.ts +0 -3
  80. package/dist/build/development-build.d.ts +0 -27
  81. package/dist/build/development-changes.d.ts +0 -14
  82. package/dist/build/development-client.d.ts +0 -21
  83. package/dist/build/development-generation.d.ts +0 -20
  84. package/dist/build/development-listener.d.ts +0 -14
  85. package/dist/build/development-patterns.d.ts +0 -5
  86. package/dist/build/development-protocol.d.ts +0 -20
  87. package/dist/build/development-server-process.d.ts +0 -30
  88. package/dist/build/development-sources.d.ts +0 -22
  89. package/dist/build/development-watcher.d.ts +0 -15
  90. package/dist/build/development-work.d.ts +0 -33
  91. package/dist/build/development.d.ts +0 -3
  92. package/dist/build/generate-application.d.ts +0 -62
  93. package/dist/build/index.d.ts +0 -14
  94. package/dist/build/index.js +0 -2
  95. package/dist/build/inspect-css-artifacts.d.ts +0 -11
  96. package/dist/build/inspect-projects.d.ts +0 -68
  97. package/dist/build/load-config.d.ts +0 -57
  98. package/dist/build/output-files.d.ts +0 -8
  99. package/dist/build/output-ownership.d.ts +0 -21
  100. package/dist/build/public-assets.d.ts +0 -32
  101. package/dist/build/publish-artifacts.d.ts +0 -20
  102. package/dist/build/render-client-contracts.d.ts +0 -10
  103. package/dist/build/render-client-transport.d.ts +0 -11
  104. package/dist/build/render-server-generated.d.ts +0 -22
  105. package/dist/build/render-types.d.ts +0 -31
  106. package/dist/build/resolve-config.d.ts +0 -47
  107. package/dist/build/typescript-projects.d.ts +0 -43
  108. package/dist/build-Dy9VE6xO.js +0 -3013
  109. package/dist/build-invocation-D7Fu8gBK.js +0 -4
  110. package/dist/vite/build-invocation.d.ts +0 -4
package/LICENSE CHANGED
@@ -1,4 +1,17 @@
1
- MIT
1
+ LICENSE
2
+
3
+ Copyright 2023 Samuel J. Cook
4
+
5
+ This software is licensed under either of:
6
+
7
+ (i) the MIT License; or
8
+ (ii) the Apache License, Version 2.0,
9
+
10
+ at your option. Each license is below.
11
+
12
+ ---BEGIN MIT LICENSE---
13
+
14
+ MIT License
2
15
 
3
16
  Copyright 2023 Samuel J. Cook
4
17
 
@@ -18,3 +31,186 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
31
  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
32
  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
33
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
+
35
+ ---END MIT LICENSE---
36
+
37
+ ---BEGIN APACHE LICENSE, VERSION 2.0---
38
+
39
+ Apache License
40
+ Version 2.0, January 2004
41
+ http://www.apache.org/licenses/
42
+
43
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
44
+
45
+ 1. Definitions.
46
+
47
+ "License" shall mean the terms and conditions for use, reproduction,
48
+ and distribution as defined by Sections 1 through 9 of this document.
49
+
50
+ "Licensor" shall mean the copyright owner or entity authorized by
51
+ the copyright owner that is granting the License.
52
+
53
+ "Legal Entity" shall mean the union of the acting entity and all
54
+ other entities that control, are controlled by, or are under common
55
+ control with that entity. For the purposes of this definition,
56
+ "control" means (i) the power, direct or indirect, to cause the
57
+ direction or management of such entity, whether by contract or
58
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
59
+ outstanding shares, or (iii) beneficial ownership of such entity.
60
+
61
+ "You" (or "Your") shall mean an individual or Legal Entity
62
+ exercising permissions granted by this License.
63
+
64
+ "Source" form shall mean the preferred form for making modifications,
65
+ including but not limited to software source code, documentation
66
+ source, and configuration files.
67
+
68
+ "Object" form shall mean any form resulting from mechanical
69
+ transformation or translation of a Source form, including but
70
+ not limited to compiled object code, generated documentation,
71
+ and conversions to other media types.
72
+
73
+ "Work" shall mean the work of authorship, whether in Source or
74
+ Object form, made available under the License, as indicated by a
75
+ copyright notice that is included in or attached to the work
76
+ (an example is provided in the Appendix below).
77
+
78
+ "Derivative Works" shall mean any work, whether in Source or Object
79
+ form, that is based on (or derived from) the Work and for which the
80
+ editorial revisions, annotations, elaborations, or other modifications
81
+ represent, as a whole, an original work of authorship. For the purposes
82
+ of this License, Derivative Works shall not include works that remain
83
+ separable from, or merely link (or bind by name) to the interfaces of,
84
+ the Work and Derivative Works thereof.
85
+
86
+ "Contribution" shall mean any work of authorship, including
87
+ the original version of the Work and any modifications or additions
88
+ to that Work or Derivative Works thereof, that is intentionally
89
+ submitted to Licensor for inclusion in the Work by the copyright owner
90
+ or by an individual or Legal Entity authorized to submit on behalf of
91
+ the copyright owner. For the purposes of this definition, "submitted"
92
+ means any form of electronic, verbal, or written communication sent
93
+ to the Licensor or its representatives, including but not limited to
94
+ communication on electronic mailing lists, source code control systems,
95
+ and issue tracking systems that are managed by, or on behalf of, the
96
+ Licensor for the purpose of discussing and improving the Work, but
97
+ excluding communication that is conspicuously marked or otherwise
98
+ designated in writing by the copyright owner as "Not a Contribution."
99
+
100
+ "Contributor" shall mean Licensor and any individual or Legal Entity
101
+ on behalf of whom a Contribution has been received by Licensor and
102
+ subsequently incorporated within the Work.
103
+
104
+ 2. Grant of Copyright License. Subject to the terms and conditions of
105
+ this License, each Contributor hereby grants to You a perpetual,
106
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
107
+ copyright license to reproduce, prepare Derivative Works of,
108
+ publicly display, publicly perform, sublicense, and distribute the
109
+ Work and such Derivative Works in Source or Object form.
110
+
111
+ 3. Grant of Patent License. Subject to the terms and conditions of
112
+ this License, each Contributor hereby grants to You a perpetual,
113
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
114
+ (except as stated in this section) patent license to make, have made,
115
+ use, offer to sell, sell, import, and otherwise transfer the Work,
116
+ where such license applies only to those patent claims licensable
117
+ by such Contributor that are necessarily infringed by their
118
+ Contribution(s) alone or by combination of their Contribution(s)
119
+ with the Work to which such Contribution(s) was submitted. If You
120
+ institute patent litigation against any entity (including a
121
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
122
+ or a Contribution incorporated within the Work constitutes direct
123
+ or contributory patent infringement, then any patent licenses
124
+ granted to You under this License for that Work shall terminate
125
+ as of the date such litigation is filed.
126
+
127
+ 4. Redistribution. You may reproduce and distribute copies of the
128
+ Work or Derivative Works thereof in any medium, with or without
129
+ modifications, and in Source or Object form, provided that You
130
+ meet the following conditions:
131
+
132
+ (a) You must give any other recipients of the Work or
133
+ Derivative Works a copy of this License; and
134
+
135
+ (b) You must cause any modified files to carry prominent notices
136
+ stating that You changed the files; and
137
+
138
+ (c) You must retain, in the Source form of any Derivative Works
139
+ that You distribute, all copyright, patent, trademark, and
140
+ attribution notices from the Source form of the Work,
141
+ excluding those notices that do not pertain to any part of
142
+ the Derivative Works; and
143
+
144
+ (d) If the Work includes a "NOTICE" text file as part of its
145
+ distribution, then any Derivative Works that You distribute must
146
+ include a readable copy of the attribution notices contained
147
+ within such NOTICE file, excluding those notices that do not
148
+ pertain to any part of the Derivative Works, in at least one
149
+ of the following places: within a NOTICE text file distributed
150
+ as part of the Derivative Works; within the Source form or
151
+ documentation, if provided along with the Derivative Works; or,
152
+ within a display generated by the Derivative Works, if and
153
+ wherever such third-party notices normally appear. The contents
154
+ of the NOTICE file are for informational purposes only and
155
+ do not modify the License. You may add Your own attribution
156
+ notices within Derivative Works that You distribute, alongside
157
+ or as an addendum to the NOTICE text from the Work, provided
158
+ that such additional attribution notices cannot be construed
159
+ as modifying the License.
160
+
161
+ You may add Your own copyright statement to Your modifications and
162
+ may provide additional or different license terms and conditions
163
+ for use, reproduction, or distribution of Your modifications, or
164
+ for any such Derivative Works as a whole, provided Your use,
165
+ reproduction, and distribution of the Work otherwise complies with
166
+ the conditions stated in this License.
167
+
168
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
169
+ any Contribution intentionally submitted for inclusion in the Work
170
+ by You to the Licensor shall be under the terms and conditions of
171
+ this License, without any additional terms or conditions.
172
+ Notwithstanding the above, nothing herein shall supersede or modify
173
+ the terms of any separate license agreement you may have executed
174
+ with Licensor regarding such Contributions.
175
+
176
+ 6. Trademarks. This License does not grant permission to use the trade
177
+ names, trademarks, service marks, or product names of the Licensor,
178
+ except as required for reasonable and customary use in describing the
179
+ origin of the Work and reproducing the content of the NOTICE file.
180
+
181
+ 7. Disclaimer of Warranty. Unless required by applicable law or
182
+ agreed to in writing, Licensor provides the Work (and each
183
+ Contributor provides its Contributions) on an "AS IS" BASIS,
184
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
185
+ implied, including, without limitation, any warranties or conditions
186
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
187
+ PARTICULAR PURPOSE. You are solely responsible for determining the
188
+ appropriateness of using or redistributing the Work and assume any
189
+ risks associated with Your exercise of permissions under this License.
190
+
191
+ 8. Limitation of Liability. In no event and under no legal theory,
192
+ whether in tort (including negligence), contract, or otherwise,
193
+ unless required by applicable law (such as deliberate and grossly
194
+ negligent acts) or agreed to in writing, shall any Contributor be
195
+ liable to You for damages, including any direct, indirect, special,
196
+ incidental, or consequential damages of any character arising as a
197
+ result of this License or out of the use or inability to use the
198
+ Work (including but not limited to damages for loss of goodwill,
199
+ work stoppage, computer failure or malfunction, or any and all
200
+ other commercial damages or losses), even if such Contributor
201
+ has been advised of the possibility of such damages.
202
+
203
+ 9. Accepting Warranty or Additional Liability. While redistributing
204
+ the Work or Derivative Works thereof, You may choose to offer,
205
+ and charge a fee for, acceptance of support, warranty, indemnity,
206
+ or other liability obligations and/or rights consistent with this
207
+ License. However, in accepting such obligations, You may act only
208
+ on Your own behalf and on Your sole responsibility, not on behalf
209
+ of any other Contributor, and only if You agree to indemnify,
210
+ defend, and hold each Contributor harmless for any liability
211
+ incurred by, or claims asserted against, such Contributor by reason
212
+ of your accepting any such warranty or additional liability.
213
+
214
+ END OF TERMS AND CONDITIONS
215
+
216
+ ---END APACHE LICENSE, VERSION 2.0---
@@ -0,0 +1,22 @@
1
+ import { type Plugin, type RenderBuiltAssetUrl } from "vite";
2
+ import type { StaticPublicAssetProjection } from "./static-public-assets.ts";
3
+ export type CssStaticPublicAssets = {
4
+ readonly jsAssets: ReadonlyMap<string, ReadonlyArray<JsAssetReference>>;
5
+ /** The plugins that resolve `@public/` URLs and record the assets that scripts reference. */
6
+ readonly plugins: ReadonlyArray<Plugin>;
7
+ readonly updateStaticPublicAssets: (staticPublicAssets: Pick<StaticPublicAssetProjection, "staticPublicAssetUrls">) => void;
8
+ };
9
+ /** Native URL-hook metadata for nonblocking resource hints. */
10
+ export type JsAssetReference = {
11
+ readonly fileName: string;
12
+ readonly renderedUrl: ReturnType<RenderBuiltAssetUrl>;
13
+ };
14
+ /**
15
+ * Resolves `@public/` URLs in the stylesheets that Vite compiles, after
16
+ * Vite's own CSS processing, so that the application's PostCSS configuration
17
+ * and its CSS transformer run as they do without Vorma. The replacement runs
18
+ * before Vite extracts and hashes the stylesheet, so the stylesheet's file
19
+ * name follows the hashed URLs that it contains. Static public assets are already
20
+ * published.
21
+ */
22
+ export declare function createCssStaticPublicAssets(staticPublicAssets: Pick<StaticPublicAssetProjection, "staticPublicAssetUrls">): CssStaticPublicAssets;
@@ -0,0 +1,20 @@
1
+ import type { Plugin } from "vite";
2
+ import type { StaticPublicAssetLookup } from "../inspection/inspect-projects.ts";
3
+ import type { StaticPublicAsset } from "./static-public-assets.ts";
4
+ /** The asset key as the static public assets map spells it: without a leading slash. */
5
+ export declare function normalizeStaticPublicAssetKey(key: string): string;
6
+ type StaticPublicAssetPluginInput = {
7
+ readonly lookups: ReadonlyArray<StaticPublicAssetLookup>;
8
+ readonly sourceTexts: ReadonlyMap<string, string>;
9
+ readonly staticPublicAssets: ReadonlyArray<StaticPublicAsset>;
10
+ readonly publicDir: string;
11
+ /** Native retained file references, keyed by the compiler's preliminary chunk filename. */
12
+ readonly referencedAssets: Map<string, Set<string>>;
13
+ };
14
+ type StaticPublicAssetPluginApi = {
15
+ readonly updateInput: (input: StaticPublicAssetPluginInput) => void;
16
+ };
17
+ export declare function createStaticPublicAssetPlugin(input: StaticPublicAssetPluginInput): Plugin<StaticPublicAssetPluginApi> & {
18
+ readonly api: StaticPublicAssetPluginApi;
19
+ };
20
+ export {};
@@ -0,0 +1,44 @@
1
+ import { Effect } from "effect";
2
+ import * as FileSystem from "effect/FileSystem";
3
+ import * as Path from "effect/Path";
4
+ import type { ApplicationSourceLayout } from "../config/source-layout.ts";
5
+ export type StaticPublicAssetIssue = {
6
+ readonly _tag: "StaticPublicAssetIssue";
7
+ readonly sourcePath: string;
8
+ readonly msg: string;
9
+ readonly cause?: unknown;
10
+ };
11
+ export type StaticPublicAsset = {
12
+ readonly sourceKey: string;
13
+ readonly sourcePath: string;
14
+ /** Relative to the published public directory, with decoded path segments. */
15
+ readonly fileName: string;
16
+ readonly url: string;
17
+ readonly hash: string;
18
+ };
19
+ export type StaticPublicAssetProjection = {
20
+ readonly assets: ReadonlyArray<StaticPublicAsset>;
21
+ readonly staticPublicAssetUrls: Readonly<Record<string, string>>;
22
+ readonly uniqueStaticPublicAssetUrls: ReadonlyArray<string>;
23
+ };
24
+ /** The exact names that the public directory never publishes, at any depth. */
25
+ export declare const IGNORED_STATIC_PUBLIC_ASSET_NAMES: ReadonlySet<string>;
26
+ /** The prefix of the names that the public directory never publishes, at any depth. */
27
+ export declare const IGNORED_STATIC_PUBLIC_ASSET_NAME_PREFIX = ".env.";
28
+ /**
29
+ * Whether the public directory skips a file of this name: env files hold
30
+ * secrets by convention, and everything in the public output is public.
31
+ */
32
+ export declare function testIgnoredStaticPublicAssetName(name: string): boolean;
33
+ /**
34
+ * Hashes and publishes each static public asset's exact bytes, retaining only
35
+ * metadata. Entries named `.DS_Store` or `.env`, or starting with `.env.`, are
36
+ * skipped at every depth.
37
+ */
38
+ export declare function collectStaticPublicAssets(config: ApplicationSourceLayout): Effect.Effect<StaticPublicAssetProjection, StaticPublicAssetIssue, FileSystem.FileSystem | Path.Path>;
39
+ /** An asset key union type, one key per line, at the given tab depth. */
40
+ export declare function renderAssetKeyDeclaration(input: {
41
+ readonly prefix: string;
42
+ readonly assets: ReadonlyArray<StaticPublicAsset>;
43
+ readonly depth: number;
44
+ }): string;
@@ -0,0 +1,18 @@
1
+ import { Effect, Path } from "effect";
2
+ import type { ResolvedVormaConfig } from "./config/resolve-config.ts";
3
+ /**
4
+ * Builds and publishes one production application while holding the build
5
+ * directory's lock, as `vorma build` does. `resolved` is the decoded and
6
+ * resolved configuration, in which every configured path is resolved against
7
+ * the directory of the configuration file that `core.importMetaUrl`
8
+ * identifies. The Vite configuration is the one that `client.viteConfigFile`
9
+ * names, whose `vorma({ config })` plugin receives the same configuration. The
10
+ * build writes into a staging directory inside the build directory and
11
+ * publishes it when it completes. It fails with every issue that it found,
12
+ * each described by its message.
13
+ */
14
+ export declare function buildVormaApplication(input: {
15
+ readonly resolved: ResolvedVormaConfig;
16
+ }): Effect.Effect<{
17
+ clientBuildId: string;
18
+ }, import("./issues.ts").VormaBuildIssues, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem | Path.Path>;
@@ -1,10 +1,21 @@
1
- import { type ClientModule, type ClientViewModule } from "@vorma/protocol";
2
1
  import { Effect } from "effect";
3
2
  import * as FileSystem from "effect/FileSystem";
4
3
  import * as Path from "effect/Path";
5
- import type { ApplicationGeneration } from "./generate-application.ts";
4
+ import type { ApplicationGeneration } from "../generation/generate-application.ts";
5
+ import { type ClientModule } from "../publication/build-metadata.ts";
6
+ /**
7
+ * The ids of the modules that Vorma names. Rolldown identifies a module by
8
+ * the form that Vite's `normalizePath` gives its path, so every comparison
9
+ * with a module id uses these.
10
+ */
11
+ type EntryModuleIds = {
12
+ readonly clientEntry: string;
13
+ readonly criticalCssEntry: string | undefined;
14
+ };
15
+ export declare function getEntryModuleIds(generation: ApplicationGeneration): EntryModuleIds;
6
16
  export type ClientBundleIssue = {
7
17
  readonly _tag: "ClientBundleIssue";
18
+ readonly msg: string;
8
19
  readonly cause: unknown;
9
20
  };
10
21
  export type ClientBundle = {
@@ -12,7 +23,6 @@ export type ClientBundle = {
12
23
  readonly outputs: ReadonlyArray<{
13
24
  readonly fileName: string;
14
25
  readonly source: string | Uint8Array;
15
- readonly immutable: boolean;
16
26
  }>;
17
27
  readonly chunks: ReadonlyArray<{
18
28
  readonly fileName: string;
@@ -23,7 +33,8 @@ export type ClientBundle = {
23
33
  readonly dynamicImports: ReadonlyArray<string>;
24
34
  }>;
25
35
  readonly clientEntry: ClientModule;
26
- readonly clientViews: Readonly<Record<string, ClientViewModule>>;
36
+ readonly clientViews: Readonly<Record<string, ClientModule>>;
27
37
  };
28
- /** Builds browser entries directly into Vorma's prepared public directory. */
38
+ /** Builds browser entries directly into the build directory's prepared public directory. */
29
39
  export declare function bundleClient(generation: ApplicationGeneration): Effect.Effect<ClientBundle, ClientBundleIssue, FileSystem.FileSystem | Path.Path>;
40
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from "vite";
2
2
  /** Native naming retains Vite's content hashing and dependency URL rewriting. */
3
- export declare function createClientOutputHashingPlugin(immutableFiles: Set<string>): Plugin;
3
+ export declare function createClientOutputHashingPlugin(): Plugin;
@@ -0,0 +1,19 @@
1
+ import { Result } from "effect";
2
+ import type { Rollup } from "vite";
3
+ /**
4
+ * The critical stylesheet, minified whatever the application's Vite `minify`
5
+ * and `cssMinify` settings are. Vorma inlines it into every document that it
6
+ * serves, so its size costs every page load.
7
+ */
8
+ export declare function minifyCriticalCss(input: {
9
+ readonly css: string;
10
+ }): Result.Result<string, string>;
11
+ /**
12
+ * Finds the configured critical stylesheet through Vite's module-to-CSS
13
+ * association. `sourceId` is the critical CSS entry's module id, the form in
14
+ * which each output names its modules.
15
+ */
16
+ export declare function findCriticalCssFileName(input: {
17
+ readonly sourceId: string | undefined;
18
+ readonly outputs: ReadonlyArray<Rollup.OutputAsset | Rollup.OutputChunk>;
19
+ }): Result.Result<string | undefined, string>;