@sjcx/vorma 0.0.0-pre.5 → 0.0.0-pre.7
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/LICENSE +197 -1
- package/dist/build/assets/css-static-public-assets.d.ts +22 -0
- package/dist/build/assets/static-public-asset-plugin.d.ts +20 -0
- package/dist/build/assets/static-public-assets.d.ts +44 -0
- package/dist/build/build-application.d.ts +18 -0
- package/dist/build/{bundle-client.d.ts → bundling/bundle-client.d.ts} +16 -5
- package/dist/build/{client-output-hashing.d.ts → bundling/client-output-hashing.d.ts} +1 -1
- package/dist/build/bundling/critical-css.d.ts +19 -0
- package/dist/build/cli.js +4793 -860
- package/dist/build/config/load-config.d.ts +142 -0
- package/dist/build/config/resolve-config.d.ts +63 -0
- package/dist/build/{source-layout.d.ts → config/source-layout.d.ts} +4 -6
- package/dist/build/config/url-pathname.d.ts +13 -0
- package/dist/build/config/vite-options.d.ts +80 -0
- package/dist/build/dev/application-process.d.ts +18 -0
- package/dist/build/dev/artifacts.d.ts +37 -0
- package/dist/build/dev/browser-source.d.ts +25 -0
- package/dist/build/dev/build.d.ts +33 -0
- package/dist/build/dev/cargo-metadata.d.ts +28 -0
- package/dist/build/dev/changes.d.ts +11 -0
- package/dist/build/dev/client-inputs.d.ts +25 -0
- package/dist/build/dev/client.d.ts +39 -0
- package/dist/build/dev/dev-protocol.d.ts +23 -0
- package/dist/build/dev/generated-paths.d.ts +27 -0
- package/dist/build/dev/generation.d.ts +31 -0
- package/dist/build/dev/index-html.d.ts +28 -0
- package/dist/build/dev/module-server.d.ts +24 -0
- package/dist/build/dev/patterns.d.ts +26 -0
- package/dist/build/dev/ports.d.ts +25 -0
- package/dist/build/dev/server-process.d.ts +34 -0
- package/dist/build/dev/server-sources.d.ts +19 -0
- package/dist/build/dev/session.d.ts +28 -0
- package/dist/build/dev/sources.d.ts +46 -0
- package/dist/build/{development-stylesheet.d.ts → dev/stylesheet.d.ts} +4 -4
- package/dist/build/dev/watcher.d.ts +30 -0
- package/dist/build/dev/work.d.ts +67 -0
- package/dist/build/generation/client-view-entries.d.ts +8 -0
- package/dist/build/generation/compile-application.d.ts +28 -0
- package/dist/build/generation/generate-application.d.ts +52 -0
- package/dist/build/generation/render-client-contracts.d.ts +15 -0
- package/dist/build/{render-source-text.d.ts → generation/render-source-text.d.ts} +3 -7
- package/dist/build/inspection/http-method.d.ts +4 -0
- package/dist/build/inspection/inspect-application.d.ts +25 -0
- package/dist/build/inspection/inspect-projects.d.ts +85 -0
- package/dist/build/inspection/rust-server.d.ts +57 -0
- package/dist/build/inspection/type-declarations.d.ts +20 -0
- package/dist/build/inspection/typescript-projects.d.ts +31 -0
- package/dist/build/issues.d.ts +25 -0
- package/dist/build/{contained-path.d.ts → output/contained-path.d.ts} +3 -13
- package/dist/build/output/content-hash.d.ts +9 -0
- package/dist/build/output/dist-dir.d.ts +34 -0
- package/dist/build/output/output-files.d.ts +23 -0
- package/dist/build/output/output-ownership.d.ts +44 -0
- package/dist/build/output/published-file-url.d.ts +6 -0
- package/dist/build/patterns/nested-route-chains.d.ts +12 -0
- package/dist/build/patterns/pattern-language.d.ts +3 -0
- package/dist/build/patterns/route-patterns.d.ts +12 -0
- package/dist/build/publication/assemble-artifacts.d.ts +37 -0
- package/dist/build/{browser-contracts.d.ts → publication/browser-contracts.d.ts} +1 -1
- package/dist/build/publication/build-metadata.d.ts +45 -0
- package/dist/build/publication/publish-artifacts.d.ts +17 -0
- package/dist/config-FbabCxBO.js +56 -0
- package/dist/config.d.ts +106 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/plugin-api-Btb0teGk.js +36 -0
- package/dist/vite/index.d.ts +14 -3
- package/dist/vite/index.js +25 -9
- package/dist/vite/plugin-api.d.ts +18 -0
- package/package.json +12 -16
- package/dist/build/assemble-artifacts.d.ts +0 -23
- package/dist/build/client-inputs.d.ts +0 -11
- package/dist/build/client-public-urls.d.ts +0 -20
- package/dist/build/compare-text.d.ts +0 -5
- package/dist/build/compile-application.d.ts +0 -40
- package/dist/build/content-digest.d.ts +0 -7
- package/dist/build/critical-css.d.ts +0 -7
- package/dist/build/css-public-assets.d.ts +0 -15
- package/dist/build/development-artifacts.d.ts +0 -36
- package/dist/build/development-browser-source.d.ts +0 -3
- package/dist/build/development-build.d.ts +0 -27
- package/dist/build/development-changes.d.ts +0 -14
- package/dist/build/development-client.d.ts +0 -21
- package/dist/build/development-generation.d.ts +0 -20
- package/dist/build/development-listener.d.ts +0 -14
- package/dist/build/development-patterns.d.ts +0 -5
- package/dist/build/development-protocol.d.ts +0 -20
- package/dist/build/development-server-process.d.ts +0 -30
- package/dist/build/development-sources.d.ts +0 -22
- package/dist/build/development-watcher.d.ts +0 -15
- package/dist/build/development-work.d.ts +0 -33
- package/dist/build/development.d.ts +0 -3
- package/dist/build/generate-application.d.ts +0 -62
- package/dist/build/index.d.ts +0 -14
- package/dist/build/index.js +0 -2
- package/dist/build/inspect-css-artifacts.d.ts +0 -11
- package/dist/build/inspect-projects.d.ts +0 -69
- package/dist/build/load-config.d.ts +0 -57
- package/dist/build/output-files.d.ts +0 -8
- package/dist/build/output-ownership.d.ts +0 -21
- package/dist/build/public-assets.d.ts +0 -32
- package/dist/build/publish-artifacts.d.ts +0 -20
- package/dist/build/render-client-contracts.d.ts +0 -10
- package/dist/build/render-client-transport.d.ts +0 -11
- package/dist/build/render-server-generated.d.ts +0 -22
- package/dist/build/render-types.d.ts +0 -31
- package/dist/build/resolve-config.d.ts +0 -47
- package/dist/build/typescript-projects.d.ts +0 -43
- package/dist/build-BeUTL6eX.js +0 -3036
- package/dist/build-invocation-D7Fu8gBK.js +0 -4
- package/dist/vite/build-invocation.d.ts +0 -4
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type Plugin } from "vite";
|
|
2
|
+
import type { VormaConfig } from "../config.ts";
|
|
3
|
+
import { type VormaPluginApi } from "./plugin-api.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Connects the application's Vite configuration to its Vorma configuration.
|
|
6
|
+
* In every tool that loads the Vite configuration, the plugin sets Vite's root
|
|
7
|
+
* to the directory of `client.viteConfigFile` and gives Vorma's browser peers
|
|
8
|
+
* one identity. It runs no Vorma build and does not decode the configuration;
|
|
9
|
+
* `vorma build` and `vorma dev` decode it once, do the build work, and check
|
|
10
|
+
* the pairing.
|
|
11
|
+
*/
|
|
12
|
+
export default function createVormaPlugin(options: {
|
|
13
|
+
readonly config: VormaConfig;
|
|
14
|
+
}): Plugin<VormaPluginApi>;
|
package/dist/vite/index.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { i as readConfigFilePath, n as VORMA_PLUGIN_NAME, t as CLIENT_SHARED_PACKAGES } from "../plugin-api-Btb0teGk.js";
|
|
2
|
+
import { Result } from "effect";
|
|
3
|
+
import { normalizePath } from "vite";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
2
5
|
//#region src/vite/index.ts
|
|
3
|
-
/**
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Connects the application's Vite configuration to its Vorma configuration.
|
|
8
|
+
* In every tool that loads the Vite configuration, the plugin sets Vite's root
|
|
9
|
+
* to the directory of `client.viteConfigFile` and gives Vorma's browser peers
|
|
10
|
+
* one identity. It runs no Vorma build and does not decode the configuration;
|
|
11
|
+
* `vorma build` and `vorma dev` decode it once, do the build work, and check
|
|
12
|
+
* the pairing.
|
|
13
|
+
*/
|
|
14
|
+
function createVormaPlugin(options) {
|
|
5
15
|
return {
|
|
6
|
-
name:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
name: VORMA_PLUGIN_NAME,
|
|
17
|
+
api: { config: options.config },
|
|
18
|
+
config(userConfig) {
|
|
19
|
+
const configFilePath = readConfigFilePath(options.config.core.importMetaUrl);
|
|
20
|
+
if (Result.isFailure(configFilePath)) return this.error(configFilePath.failure);
|
|
21
|
+
const root = dirname(resolve(dirname(configFilePath.success), options.config.client.viteConfigFile));
|
|
22
|
+
if (userConfig.root !== void 0 && normalizePath(resolve(userConfig.root)) !== normalizePath(root)) return this.error(`The Vite configuration sets root to ${resolve(userConfig.root)}, but Vorma sets Vite's root to ${root}, the directory of client.viteConfigFile. Remove root.`);
|
|
23
|
+
return {
|
|
24
|
+
root,
|
|
25
|
+
resolve: { dedupe: CLIENT_SHARED_PACKAGES }
|
|
26
|
+
};
|
|
11
27
|
}
|
|
12
28
|
};
|
|
13
29
|
}
|
|
14
30
|
//#endregion
|
|
15
|
-
export {
|
|
31
|
+
export { createVormaPlugin as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
2
|
+
import type { Plugin } from "vite";
|
|
3
|
+
import type { VormaConfig } from "../config.ts";
|
|
4
|
+
/** The name by which Vorma's commands find the application's plugin in a resolved Vite configuration. */
|
|
5
|
+
export declare const VORMA_PLUGIN_NAME = "vorma";
|
|
6
|
+
export type VormaPluginApi = {
|
|
7
|
+
readonly config: VormaConfig;
|
|
8
|
+
};
|
|
9
|
+
/** Runtime peers that must have one browser identity in every Vite invocation. */
|
|
10
|
+
export declare const CLIENT_SHARED_PACKAGES: string[];
|
|
11
|
+
/** The path of the configuration file that a configuration's `core.importMetaUrl` identifies. */
|
|
12
|
+
export declare function readConfigFilePath(importMetaUrl: string): Result.Result<string, string>;
|
|
13
|
+
export declare function findVormaPlugin(plugins: ReadonlyArray<Plugin>): Plugin<VormaPluginApi> | undefined;
|
|
14
|
+
/** Checks that a resolved Vite configuration's plugin carries the Vorma configuration file that a command loaded. */
|
|
15
|
+
export declare function checkVormaPlugin(input: {
|
|
16
|
+
readonly plugins: ReadonlyArray<Plugin>;
|
|
17
|
+
readonly configFilePath: string;
|
|
18
|
+
}): Result.Result<void, string>;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcx/vorma",
|
|
3
|
-
"version": "0.0.0-pre.
|
|
3
|
+
"version": "0.0.0-pre.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"license": "MIT",
|
|
6
|
+
"license": "(MIT OR Apache-2.0)",
|
|
7
7
|
"author": "Samuel J. Cook",
|
|
8
8
|
"bin": {
|
|
9
9
|
"vorma": "./dist/build/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
|
-
"
|
|
13
|
-
"types": "./dist/
|
|
14
|
-
"import": "./dist/
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
15
|
},
|
|
16
16
|
"./vite": {
|
|
17
17
|
"types": "./dist/vite/index.d.ts",
|
|
@@ -19,26 +19,22 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@effect/platform-node-shared": "^4.0.0
|
|
22
|
+
"@effect/platform-node-shared": "^4.0.0",
|
|
23
23
|
"@noble/hashes": "^2.4.0",
|
|
24
24
|
"@scure/base": "^2.4.0",
|
|
25
|
-
"@vorma
|
|
26
|
-
"@vorma/protocol": "npm:@sjcx/vorma-protocol@0.0.0-pre.5",
|
|
25
|
+
"@sjcx/vorma-primitives": "0.0.0-pre.7",
|
|
27
26
|
"chokidar": "^5.0.0",
|
|
27
|
+
"effect": "^4.0.0",
|
|
28
28
|
"lightningcss": "^1.33.0",
|
|
29
29
|
"rolldown": "^1.2.6",
|
|
30
|
-
"typescript": "
|
|
30
|
+
"typescript": "7.0.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@vorma
|
|
34
|
-
"
|
|
35
|
-
"vite": "*"
|
|
33
|
+
"@sjcx/vorma-client": "*",
|
|
34
|
+
"vite": ">=8.0.0-0"
|
|
36
35
|
},
|
|
37
36
|
"peerDependenciesMeta": {
|
|
38
|
-
"@vorma
|
|
39
|
-
"optional": true
|
|
40
|
-
},
|
|
41
|
-
"effect": {
|
|
37
|
+
"@sjcx/vorma-client": {
|
|
42
38
|
"optional": true
|
|
43
39
|
},
|
|
44
40
|
"vite": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type ProductionBuildMetadata } from "@vorma/protocol";
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
import type { ClientBundle } from "./bundle-client.ts";
|
|
4
|
-
import type { ApplicationGeneration } from "./generate-application.ts";
|
|
5
|
-
export type ApplicationArtifact = {
|
|
6
|
-
/** Relative to the published public directory, with decoded filenames. */
|
|
7
|
-
readonly fileName: string;
|
|
8
|
-
readonly url: string;
|
|
9
|
-
readonly digest: string;
|
|
10
|
-
readonly immutable: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type ApplicationArtifacts = {
|
|
13
|
-
readonly metadata: ProductionBuildMetadata;
|
|
14
|
-
};
|
|
15
|
-
export type ArtifactAssemblyIssue = {
|
|
16
|
-
readonly _tag: "ArtifactAssemblyIssue";
|
|
17
|
-
readonly reason: string;
|
|
18
|
-
};
|
|
19
|
-
/** Joins published file metadata and checks paths, collisions, and module projections. */
|
|
20
|
-
export declare function assembleApplicationArtifacts(input: {
|
|
21
|
-
readonly generation: ApplicationGeneration;
|
|
22
|
-
readonly client: ClientBundle;
|
|
23
|
-
}): Effect.Effect<ApplicationArtifacts, ArtifactAssemblyIssue>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ApplicationGeneration } from "./generate-application.ts";
|
|
2
|
-
/** Runtime peers that must have one browser identity in development and production. */
|
|
3
|
-
export declare const CLIENT_SHARED_PACKAGES: string[];
|
|
4
|
-
export type ClientViewEntry = {
|
|
5
|
-
readonly pattern: string;
|
|
6
|
-
readonly id: string;
|
|
7
|
-
readonly exportNames: ReadonlyArray<string>;
|
|
8
|
-
readonly source: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
/** Keeps value identity checks inside the selected route's normal module load. */
|
|
11
|
-
export declare function getClientViewEntries(generation: ApplicationGeneration): ReadonlyArray<ClientViewEntry>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "vite";
|
|
2
|
-
import type { PublicUrlSite } from "./inspect-projects.ts";
|
|
3
|
-
import type { PublicAsset } from "./public-assets.ts";
|
|
4
|
-
/** The asset key as the public file map spells it: without a leading slash. */
|
|
5
|
-
export declare function normalizePublicAssetKey(key: string): string;
|
|
6
|
-
type ClientPublicUrlInput = {
|
|
7
|
-
readonly sites: ReadonlyArray<PublicUrlSite>;
|
|
8
|
-
readonly sourceTexts: ReadonlyMap<string, string>;
|
|
9
|
-
readonly publicAssets: ReadonlyArray<PublicAsset>;
|
|
10
|
-
readonly publicDirectory: string;
|
|
11
|
-
/** Native retained file references, keyed by the compiler's preliminary chunk filename. */
|
|
12
|
-
readonly referencedAssets: Map<string, Set<string>>;
|
|
13
|
-
};
|
|
14
|
-
type ClientPublicUrlPluginApi = {
|
|
15
|
-
readonly updateInputFn: (input: ClientPublicUrlInput) => void;
|
|
16
|
-
};
|
|
17
|
-
export declare function createClientPublicUrlPlugin(input: ClientPublicUrlInput): Plugin<ClientPublicUrlPluginApi> & {
|
|
18
|
-
readonly api: ClientPublicUrlPluginApi;
|
|
19
|
-
};
|
|
20
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { CompiledNestedPattern, PatternCompileError } from "@vorma/primitives/matcher";
|
|
2
|
-
import { type ConflictingDynamicParameterNameError } from "@vorma/protocol/path";
|
|
3
|
-
import { type PathWireError } from "@vorma/protocol/path";
|
|
4
|
-
import { Result } from "effect";
|
|
5
|
-
import type { DeclarationSource, InspectedClientView, InspectedEndpoint, InspectedProjects, InspectedServerDeclaration, InspectedUiLoader } from "./inspect-projects.ts";
|
|
6
|
-
export type ApplicationSegment = {
|
|
7
|
-
/** The authored pattern, as the loader or the view wrote it. */
|
|
8
|
-
readonly pattern: string;
|
|
9
|
-
readonly registered: CompiledNestedPattern;
|
|
10
|
-
readonly loader: InspectedUiLoader | undefined;
|
|
11
|
-
readonly view: InspectedClientView | undefined;
|
|
12
|
-
/** The search contracts of the loaders from the chain root to this segment, as type text, in chain order. */
|
|
13
|
-
readonly searchOwnerInputs: ReadonlyArray<string>;
|
|
14
|
-
};
|
|
15
|
-
export type ApplicationModel = {
|
|
16
|
-
/** Every registered server declaration, ordered by file and export name. */
|
|
17
|
-
readonly serverDeclarations: ReadonlyArray<InspectedServerDeclaration>;
|
|
18
|
-
readonly uiLoaders: ReadonlyArray<InspectedUiLoader>;
|
|
19
|
-
readonly endpoints: ReadonlyArray<InspectedEndpoint>;
|
|
20
|
-
readonly clientViews: ReadonlyArray<InspectedClientView>;
|
|
21
|
-
readonly clientViewCandidates: ReadonlyMap<string, ReadonlyArray<InspectedClientView>>;
|
|
22
|
-
/** The authored view modules in stable order, for generated type imports. */
|
|
23
|
-
readonly clientViewModules: ReadonlyArray<string>;
|
|
24
|
-
readonly clientApplication: DeclarationSource;
|
|
25
|
-
readonly segments: ReadonlyArray<ApplicationSegment>;
|
|
26
|
-
};
|
|
27
|
-
export type ApplicationModelIssue = {
|
|
28
|
-
readonly _tag: "InvalidPattern";
|
|
29
|
-
readonly role: "uiLoader" | "endpoint" | "clientView";
|
|
30
|
-
readonly pattern: string;
|
|
31
|
-
readonly source: DeclarationSource;
|
|
32
|
-
readonly cause: PatternCompileError | PathWireError;
|
|
33
|
-
} | {
|
|
34
|
-
readonly _tag: "ConflictingUiPatternParameters";
|
|
35
|
-
readonly patterns: ReadonlyArray<string>;
|
|
36
|
-
readonly sources: ReadonlyArray<DeclarationSource>;
|
|
37
|
-
readonly cause: ConflictingDynamicParameterNameError;
|
|
38
|
-
};
|
|
39
|
-
/** Joins the inspected declarations and views into one validated model. */
|
|
40
|
-
export declare function compileApplicationModel(inspection: InspectedProjects): Result.Result<ApplicationModel, ReadonlyArray<ApplicationModelIssue>>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Schema } from "effect";
|
|
2
|
-
/** BLAKE3 content identity, encoded as lowercase base32 without padding. */
|
|
3
|
-
export declare function toContentDigest(source: string | Uint8Array): string;
|
|
4
|
-
/** Encodes an already computed BLAKE3 digest. */
|
|
5
|
-
export declare function encodeContentDigest(digest: Uint8Array): string;
|
|
6
|
-
/** Canonical object ordering; array order carries framework semantics. */
|
|
7
|
-
export declare function encodeCanonicalJson(value: Schema.Json): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Result } from "effect";
|
|
2
|
-
import type { Rollup } from "vite";
|
|
3
|
-
/** Finds the configured critical stylesheet through Vite's module-to-CSS association. */
|
|
4
|
-
export declare function findCriticalCssFileName(input: {
|
|
5
|
-
readonly sourcePath: string | undefined;
|
|
6
|
-
readonly outputs: ReadonlyArray<Rollup.OutputAsset | Rollup.OutputChunk>;
|
|
7
|
-
}): Result.Result<string | undefined, string>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Plugin, RenderBuiltAssetUrl } from "vite";
|
|
2
|
-
import type { PublicAssetProjection } from "./public-assets.ts";
|
|
3
|
-
export type CssPublicAssets = {
|
|
4
|
-
readonly cssAssets: ReadonlySet<string>;
|
|
5
|
-
readonly javascriptAssets: ReadonlyMap<string, ReadonlyArray<JavascriptAssetReference>>;
|
|
6
|
-
readonly plugin: Plugin;
|
|
7
|
-
readonly updatePublicAssetsFn: (publicAssets: Pick<PublicAssetProjection, "publicFilemap">) => void;
|
|
8
|
-
};
|
|
9
|
-
/** Native URL-hook metadata for nonblocking resource hints. */
|
|
10
|
-
export type JavascriptAssetReference = {
|
|
11
|
-
readonly fileName: string;
|
|
12
|
-
readonly renderedUrl: ReturnType<RenderBuiltAssetUrl>;
|
|
13
|
-
};
|
|
14
|
-
/** Replaces public URLs before Vite hashes CSS; public files are already published. */
|
|
15
|
-
export declare function createCssPublicAssets(publicAssets: Pick<PublicAssetProjection, "publicFilemap">): CssPublicAssets;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ClientModule } from "@vorma/protocol";
|
|
2
|
-
import type { DevelopmentBuild, DevelopmentClient } from "./development-build.ts";
|
|
3
|
-
export declare function toDevelopmentModuleUrl(input: {
|
|
4
|
-
readonly origin: string;
|
|
5
|
-
readonly root: string;
|
|
6
|
-
readonly id: string;
|
|
7
|
-
}): string;
|
|
8
|
-
/** Keeps source URLs and browser contracts on the server; responses project only requested views. */
|
|
9
|
-
export declare function assembleDevelopmentArtifacts(input: {
|
|
10
|
-
readonly build: DevelopmentBuild;
|
|
11
|
-
readonly client: DevelopmentClient;
|
|
12
|
-
readonly developmentHeadHtml: string;
|
|
13
|
-
}): {
|
|
14
|
-
metadata: {
|
|
15
|
-
runtimeMode: "development";
|
|
16
|
-
clientBuildId: string;
|
|
17
|
-
clientEntry: ClientModule;
|
|
18
|
-
clientViews: {
|
|
19
|
-
[k: string]: {
|
|
20
|
-
importUrl: string;
|
|
21
|
-
depUrls: ReadonlyArray<string>;
|
|
22
|
-
cssBundleUrls: ReadonlyArray<string>;
|
|
23
|
-
staticAssetUrls: ReadonlyArray<string>;
|
|
24
|
-
exportNames: readonly string[];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
criticalCss: string;
|
|
28
|
-
developmentHeadHtml: string;
|
|
29
|
-
publicFilemap: Readonly<Record<string, string>>;
|
|
30
|
-
publicFiles: {
|
|
31
|
-
url: string;
|
|
32
|
-
fileName: string;
|
|
33
|
-
immutable: true;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import type { startDevelopmentClient } from "./development-client.ts";
|
|
3
|
-
import type { DevelopmentGeneration } from "./development-generation.ts";
|
|
4
|
-
import type { DevelopmentWork } from "./development-work.ts";
|
|
5
|
-
export type DevelopmentClient = Effect.Success<ReturnType<typeof startDevelopmentClient>>;
|
|
6
|
-
export type DevelopmentBuild = {
|
|
7
|
-
readonly generation: DevelopmentGeneration;
|
|
8
|
-
readonly stylesheet: {
|
|
9
|
-
readonly css: string;
|
|
10
|
-
readonly inputFilePaths: ReadonlyArray<string>;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
/** Prepares native CSS after the generation's public-asset inputs exist. */
|
|
14
|
-
export declare function prepareDevelopmentBuild(input: {
|
|
15
|
-
readonly generation: DevelopmentGeneration;
|
|
16
|
-
readonly client: DevelopmentClient;
|
|
17
|
-
readonly previous?: {
|
|
18
|
-
readonly build: DevelopmentBuild;
|
|
19
|
-
readonly work: DevelopmentWork;
|
|
20
|
-
};
|
|
21
|
-
}): Effect.Effect<{
|
|
22
|
-
generation: DevelopmentGeneration;
|
|
23
|
-
stylesheet: {
|
|
24
|
-
readonly css: string;
|
|
25
|
-
readonly inputFilePaths: ReadonlyArray<string>;
|
|
26
|
-
};
|
|
27
|
-
}, import("./development-stylesheet.ts").DevelopmentStylesheetIssue, never>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
export type DevelopmentWatchIssue = {
|
|
3
|
-
readonly _tag: "DevelopmentWatchIssue";
|
|
4
|
-
readonly cause: unknown;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Batches native watcher events after 30 ms without another event. Completed
|
|
8
|
-
* batches accumulate while the consumer rebuilds; no changed path is discarded.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createDevelopmentChanges(): Effect.Effect<{
|
|
11
|
-
take: Effect.Effect<ReadonlySet<string>, DevelopmentWatchIssue, never>;
|
|
12
|
-
recordChangeFn: (filePath: string) => void;
|
|
13
|
-
recordErrorFn: (cause: unknown) => void;
|
|
14
|
-
}, never, import("effect/Scope").Scope>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { type ViteDevServer } from "vite";
|
|
3
|
-
import type { DevelopmentClientInputs } from "./development-protocol.ts";
|
|
4
|
-
export type DevelopmentClientIssue = {
|
|
5
|
-
readonly _tag: "DevelopmentClientIssue";
|
|
6
|
-
readonly operation: "create" | "listen" | "close";
|
|
7
|
-
readonly cause: unknown;
|
|
8
|
-
};
|
|
9
|
-
/** Starts Vite for one inspected application; the surrounding Effect scope closes it. */
|
|
10
|
-
export declare function startDevelopmentClient(inputs: DevelopmentClientInputs, port: number, recordChangeFn: (filePath: string) => void): Effect.Effect<{
|
|
11
|
-
server: ViteDevServer;
|
|
12
|
-
readonly configurationRevision: number;
|
|
13
|
-
restart: Effect.Effect<void, import("effect/Cause").UnknownError, never>;
|
|
14
|
-
origin: string;
|
|
15
|
-
listen: Effect.Effect<void, import("./development-listener.ts").DevelopmentListenerIssue, never>;
|
|
16
|
-
readonly views: readonly import("./client-inputs.ts").ClientViewEntry[];
|
|
17
|
-
resumeInspectionFn: (reload: boolean) => void;
|
|
18
|
-
readHeadHtml: Effect.Effect<string, DevelopmentClientIssue, never>;
|
|
19
|
-
/** Replaces inspected sources and asset references within the existing Vite configuration. */
|
|
20
|
-
updateInputsFn(next: DevelopmentClientInputs): void;
|
|
21
|
-
}, DevelopmentClientIssue, import("effect/Scope").Scope>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { type DevelopmentSourceInputs } from "./development-sources.ts";
|
|
3
|
-
import type { DevelopmentWork } from "./development-work.ts";
|
|
4
|
-
import { type ApplicationGeneration } from "./generate-application.ts";
|
|
5
|
-
import type { ApplicationSourceLayout } from "./source-layout.ts";
|
|
6
|
-
export type DevelopmentGeneration = {
|
|
7
|
-
readonly application: ApplicationGeneration;
|
|
8
|
-
readonly sources: DevelopmentSourceInputs;
|
|
9
|
-
};
|
|
10
|
-
/** Captures independent source and public inputs concurrently, without activating a runtime. */
|
|
11
|
-
export declare function prepareDevelopmentGeneration(input: {
|
|
12
|
-
readonly layout: ApplicationSourceLayout;
|
|
13
|
-
readonly previous?: {
|
|
14
|
-
readonly generation: DevelopmentGeneration;
|
|
15
|
-
readonly work: DevelopmentWork;
|
|
16
|
-
};
|
|
17
|
-
}): Effect.Effect<{
|
|
18
|
-
application: ApplicationGeneration;
|
|
19
|
-
sources: DevelopmentSourceInputs;
|
|
20
|
-
}, import("./generate-application.ts").ApplicationModelIssues | import("./generate-application.ts").GeneratedApplicationWriteError | import("./inspect-projects.ts").InspectionIssue | import("./public-assets.ts").PublicAssetIssue | import("./typescript-projects.ts").TypescriptProjectError | import("./generate-application.ts").UnknownPublicAssetKey, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type RequestListener } from "node:http";
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
export type DevelopmentListenerIssue = {
|
|
4
|
-
readonly _tag: "DevelopmentListenerIssue";
|
|
5
|
-
readonly cause: unknown;
|
|
6
|
-
};
|
|
7
|
-
/** Hosts only Vite middleware and its WebSocket; the application has its own server. */
|
|
8
|
-
export declare function createDevelopmentListener(port: number): Effect.Effect<{
|
|
9
|
-
server: import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse>;
|
|
10
|
-
listen: Effect.Effect<void, DevelopmentListenerIssue, never>;
|
|
11
|
-
port: number;
|
|
12
|
-
origin: string;
|
|
13
|
-
setHandlerFn(next: RequestListener): void;
|
|
14
|
-
}, never, import("effect/Scope").Scope>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { DevelopmentSourceInputs } from "./development-sources.ts";
|
|
2
|
-
import type { ApplicationGeneration } from "./generate-application.ts";
|
|
3
|
-
/** Inspected build information stays in the orchestrator, never in a browser manifest. */
|
|
4
|
-
export type DevelopmentClientInputs = ReturnType<typeof toDevelopmentClientInputs>;
|
|
5
|
-
export declare function toDevelopmentClientInputs(generation: ApplicationGeneration, sources: DevelopmentSourceInputs): {
|
|
6
|
-
viteConfigFilePath: string;
|
|
7
|
-
clientEntryFilePath: string;
|
|
8
|
-
clientViewModules: readonly string[];
|
|
9
|
-
coordinatedResolutionFiles: ReadonlySet<string>;
|
|
10
|
-
generatedDirectories: string[];
|
|
11
|
-
clientTransport: import("./render-source-text.ts").GeneratedSource;
|
|
12
|
-
views: readonly import("./client-inputs.ts").ClientViewEntry[];
|
|
13
|
-
publicUrlSites: readonly import("./inspect-projects.ts").PublicUrlSite[];
|
|
14
|
-
clientSourceTexts: {
|
|
15
|
-
[k: string]: string;
|
|
16
|
-
};
|
|
17
|
-
publicAssets: readonly import("./public-assets.ts").PublicAsset[];
|
|
18
|
-
publicFilemap: Readonly<Record<string, string>>;
|
|
19
|
-
publicDirectory: string;
|
|
20
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
export type DevelopmentServerExit = {
|
|
3
|
-
readonly _tag: "DevelopmentServerExit";
|
|
4
|
-
readonly exitCode: number;
|
|
5
|
-
};
|
|
6
|
-
export type DevelopmentServerReadinessIssue = {
|
|
7
|
-
readonly _tag: "DevelopmentServerReadinessIssue";
|
|
8
|
-
readonly url: string;
|
|
9
|
-
};
|
|
10
|
-
/** Reserves a port until the enclosing allocation scope closes. */
|
|
11
|
-
export declare function getDevelopmentServerPort(): Effect.Effect<number, import("effect/unstable/socket/SocketServer").SocketServerError, import("effect/Scope").Scope>;
|
|
12
|
-
/** Runs the configured server command; its Effect scope owns process termination. */
|
|
13
|
-
export declare function startDevelopmentServerProcess(input: {
|
|
14
|
-
readonly command: readonly [string, ...Array<string>];
|
|
15
|
-
readonly configDirectory: string;
|
|
16
|
-
readonly port: number;
|
|
17
|
-
}): Effect.Effect<{
|
|
18
|
-
process: import("effect/unstable/process/ChildProcessSpawner").ChildProcessHandle;
|
|
19
|
-
origin: string;
|
|
20
|
-
unexpectedExit: Effect.Effect<never, import("effect/PlatformError").PlatformError | {
|
|
21
|
-
_tag: "DevelopmentServerExit";
|
|
22
|
-
exitCode: number & import("effect/Brand").Brand<"ExitCode">;
|
|
23
|
-
}, never>;
|
|
24
|
-
}, import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/PlatformError").PlatformError | import("effect/Cause").TimeoutError | {
|
|
25
|
-
_tag: "DevelopmentServerExit";
|
|
26
|
-
exitCode: number & import("effect/Brand").Brand<"ExitCode">;
|
|
27
|
-
} | {
|
|
28
|
-
_tag: "DevelopmentServerReadinessIssue";
|
|
29
|
-
url: string;
|
|
30
|
-
}, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/Scope").Scope>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Effect, Path } from "effect";
|
|
2
|
-
import type { ApplicationSourceLayout } from "./source-layout.ts";
|
|
3
|
-
export type DevelopmentSourceInputs = {
|
|
4
|
-
readonly serverFiles: ReadonlySet<string>;
|
|
5
|
-
readonly clientFiles: ReadonlySet<string>;
|
|
6
|
-
readonly serverRootFiles: ReadonlySet<string>;
|
|
7
|
-
readonly clientRootFiles: ReadonlySet<string>;
|
|
8
|
-
/** Configuration and resolution inputs that are not program source files. */
|
|
9
|
-
readonly resolutionFiles: ReadonlySet<string>;
|
|
10
|
-
/** Native compiler directory enumeration, including configured inclusion scopes. */
|
|
11
|
-
readonly directories: ReadonlySet<string>;
|
|
12
|
-
};
|
|
13
|
-
/** Inspects declarations and records native compiler inputs without replacing filesystem behavior. */
|
|
14
|
-
export declare function inspectDevelopmentSources(layout: ApplicationSourceLayout): Effect.Effect<{
|
|
15
|
-
inspection: import("./inspect-projects.ts").InspectedProjects;
|
|
16
|
-
inputs: DevelopmentSourceInputs;
|
|
17
|
-
}, import("./inspect-projects.ts").InspectionIssue | import("./typescript-projects.ts").TypescriptProjectError, Path.Path>;
|
|
18
|
-
/** Watches native compiler inputs while keeping generated writes out of the event stream. */
|
|
19
|
-
export declare function getDevelopmentSourceWatchPaths(input: {
|
|
20
|
-
readonly layout: ApplicationSourceLayout;
|
|
21
|
-
readonly sources: DevelopmentSourceInputs;
|
|
22
|
-
}): Effect.Effect<string[], never, Path.Path>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { type DevelopmentWatchIssue } from "./development-changes.ts";
|
|
3
|
-
/** Application watching survives Vite restarts and failed replacement builds. */
|
|
4
|
-
export declare function createDevelopmentWatcher(input: {
|
|
5
|
-
readonly configFilePath: string;
|
|
6
|
-
readonly generatedDirectories: ReadonlyArray<string>;
|
|
7
|
-
}): Effect.Effect<{
|
|
8
|
-
take: Effect.Effect<ReadonlySet<string>, DevelopmentWatchIssue, never>;
|
|
9
|
-
recordChangeFn: (filePath: string) => void;
|
|
10
|
-
recordErrorFn: (cause: unknown) => void;
|
|
11
|
-
watchPathsFn(next: {
|
|
12
|
-
readonly paths: ReadonlyArray<string>;
|
|
13
|
-
readonly generatedDirectories: ReadonlyArray<string>;
|
|
14
|
-
}): Effect.Effect<void, DevelopmentWatchIssue, never>;
|
|
15
|
-
}, DevelopmentWatchIssue, import("effect/Scope").Scope>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Effect, Path } from "effect";
|
|
2
|
-
import type { DevelopmentSourceInputs } from "./development-sources.ts";
|
|
3
|
-
import type { ApplicationSourceLayout } from "./source-layout.ts";
|
|
4
|
-
/** Independent work accumulated from one or more watcher batches. */
|
|
5
|
-
export type DevelopmentWork = {
|
|
6
|
-
readonly restartConfiguration: boolean;
|
|
7
|
-
readonly inspectSources: boolean;
|
|
8
|
-
readonly restartServer: boolean;
|
|
9
|
-
readonly restartVite: boolean;
|
|
10
|
-
readonly capturePublicAssets: boolean;
|
|
11
|
-
readonly prepareCriticalCss: boolean;
|
|
12
|
-
readonly revalidateClient: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type DevelopmentInputs = {
|
|
15
|
-
readonly sources: DevelopmentSourceInputs;
|
|
16
|
-
readonly configurationFiles: ReadonlySet<string>;
|
|
17
|
-
readonly viteConfigurationFiles: ReadonlySet<string>;
|
|
18
|
-
readonly criticalCssFiles: ReadonlySet<string>;
|
|
19
|
-
};
|
|
20
|
-
/** Classifies application work; ordinary browser modules remain Vite's HMR inputs. */
|
|
21
|
-
export declare function classifyDevelopmentChanges(input: {
|
|
22
|
-
readonly layout: ApplicationSourceLayout;
|
|
23
|
-
readonly inputs: DevelopmentInputs;
|
|
24
|
-
readonly changedPaths: ReadonlySet<string>;
|
|
25
|
-
}): Effect.Effect<{
|
|
26
|
-
restartConfiguration: boolean;
|
|
27
|
-
inspectSources: boolean;
|
|
28
|
-
restartServer: boolean;
|
|
29
|
-
restartVite: boolean;
|
|
30
|
-
capturePublicAssets: boolean;
|
|
31
|
-
prepareCriticalCss: boolean;
|
|
32
|
-
revalidateClient: boolean;
|
|
33
|
-
}, import("./typescript-projects.ts").TypescriptProjectError, Path.Path>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Effect, FileSystem, Path } from "effect";
|
|
2
|
-
/** Runs until interrupted; configuration replacement releases the complete previous session. */
|
|
3
|
-
export declare function developApplication(configFilePath: string): Effect.Effect<never, unknown, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import * as FileSystem from "effect/FileSystem";
|
|
3
|
-
import * as Path from "effect/Path";
|
|
4
|
-
import { type ApplicationModel, type ApplicationModelIssue } from "./compile-application.ts";
|
|
5
|
-
import { type InspectedProjects, type InspectionIssue } from "./inspect-projects.ts";
|
|
6
|
-
import { type PublicAssetIssue, type PublicAssetProjection } from "./public-assets.ts";
|
|
7
|
-
import type { GeneratedSource } from "./render-source-text.ts";
|
|
8
|
-
import type { ConfigResolutionError } from "./resolve-config.ts";
|
|
9
|
-
import type { ApplicationSourceLayout, ApplicationSourceLayoutIssues } from "./source-layout.ts";
|
|
10
|
-
import { type TypescriptProjectRoots, type TypescriptProjectError } from "./typescript-projects.ts";
|
|
11
|
-
export type ApplicationModelIssues = {
|
|
12
|
-
readonly _tag: "ApplicationModelIssues";
|
|
13
|
-
readonly issues: ReadonlyArray<ApplicationModelIssue>;
|
|
14
|
-
};
|
|
15
|
-
/** A `getPublicUrl` call names an asset that the public directory does not contain. */
|
|
16
|
-
export type UnknownPublicAssetKey = {
|
|
17
|
-
readonly _tag: "UnknownPublicAssetKey";
|
|
18
|
-
readonly filePath: string;
|
|
19
|
-
readonly position: number;
|
|
20
|
-
readonly key: string;
|
|
21
|
-
};
|
|
22
|
-
export type GeneratedApplicationWriteError = {
|
|
23
|
-
readonly _tag: "GeneratedApplicationWriteError";
|
|
24
|
-
readonly filePath: string;
|
|
25
|
-
readonly cause: unknown;
|
|
26
|
-
};
|
|
27
|
-
export type ApplicationGenerationError = ConfigResolutionError | PublicAssetIssue | TypescriptProjectError | InspectionIssue | ApplicationSourceLayoutIssues | ApplicationModelIssues | UnknownPublicAssetKey;
|
|
28
|
-
export type ApplicationGeneration = {
|
|
29
|
-
readonly config: ApplicationSourceLayout;
|
|
30
|
-
readonly model: ApplicationModel;
|
|
31
|
-
readonly inspection: InspectedProjects;
|
|
32
|
-
/** The declaration augmenting `@vorma/client` with this application's contracts: types only. */
|
|
33
|
-
readonly clientContracts: GeneratedSource;
|
|
34
|
-
/** Runtime adapters for the Effect data types that occur in this application's contracts. */
|
|
35
|
-
readonly clientTransport: GeneratedSource;
|
|
36
|
-
readonly publicAssets: PublicAssetProjection;
|
|
37
|
-
};
|
|
38
|
-
/** Writes correlated generated sources and verifies their native TypeScript inclusion. */
|
|
39
|
-
export declare function writeAndCheckApplicationGeneration(generation: ApplicationGeneration, knownRootFiles?: TypescriptProjectRoots): Effect.Effect<void, GeneratedApplicationWriteError | TypescriptProjectError, FileSystem.FileSystem | Path.Path>;
|
|
40
|
-
/** Reads both projects through the checker, captures public assets, and prepares generated build inputs without publishing them. */
|
|
41
|
-
export declare function prepareApplicationGeneration(sourceLayout: ApplicationSourceLayout): Effect.Effect<ApplicationGeneration, ApplicationGenerationError, FileSystem.FileSystem | Path.Path>;
|
|
42
|
-
/** Reads declarations and public URL call sites independently of public asset hashing. */
|
|
43
|
-
export declare function inspectApplicationSources(sourceLayout: ApplicationSourceLayout): Effect.Effect<InspectedProjects, InspectionIssue | TypescriptProjectError, Path.Path>;
|
|
44
|
-
/** Prepares correlated build inputs from an inspection and a captured public directory. */
|
|
45
|
-
export declare function assembleApplicationGeneration(input: {
|
|
46
|
-
readonly sourceLayout: ApplicationSourceLayout;
|
|
47
|
-
readonly inspection: InspectedProjects;
|
|
48
|
-
readonly publicAssets: PublicAssetProjection;
|
|
49
|
-
}): Effect.Effect<ApplicationGeneration, ApplicationModelIssues | UnknownPublicAssetKey, Path.Path>;
|
|
50
|
-
/**
|
|
51
|
-
* Writes the client's generated declarations, transport adapters, and an ignore
|
|
52
|
-
* file in each owned output directory. Cleanup uses the complete client/server
|
|
53
|
-
* output plan, so server source can be written concurrently with this work.
|
|
54
|
-
*/
|
|
55
|
-
export declare function writeApplicationGeneration(generation: ApplicationGeneration): Effect.Effect<void, GeneratedApplicationWriteError, FileSystem.FileSystem | Path.Path>;
|
|
56
|
-
/**
|
|
57
|
-
* Writes the internal registration module and the application
|
|
58
|
-
* contract types before application startup.
|
|
59
|
-
*/
|
|
60
|
-
export declare function writeGeneratedServerApplication(input: {
|
|
61
|
-
readonly generation: ApplicationGeneration;
|
|
62
|
-
}): Effect.Effect<void, GeneratedApplicationWriteError, FileSystem.FileSystem | Path.Path>;
|