@absolutejs/absolute 0.20.0-beta.167 → 0.20.0-beta.169
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/CHANGELOG.md +18 -0
- package/README.md +81 -0
- package/changelog.json +35 -0
- package/dist/angular/browser.js +3 -3
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +211 -197
- package/dist/angular/index.js.map +8 -8
- package/dist/angular/server.js +211 -197
- package/dist/angular/server.js.map +8 -8
- package/dist/build.js +1324 -998
- package/dist/build.js.map +12 -8
- package/dist/cli/{add-kwyqxccz.js → add-7azr0c83.js} +5 -5
- package/dist/cli/{androidEmulatorController-3zn6a4j3.js → androidEmulatorController-68jjdxmx.js} +3 -3
- package/dist/cli/{androidNativeWatcher-wz7vhnkr.js → androidNativeWatcher-x032x9yr.js} +3 -3
- package/dist/cli/{api-m3n8xbcv.js → api-mshjr4ah.js} +1 -1
- package/dist/cli/{compile-30m09382.js → compile-4jnfxts9.js} +2 -2
- package/dist/cli/config/server.js +129 -115
- package/dist/cli/{dev-ny2vah78.js → dev-9tk5hn2e.js} +9 -9
- package/dist/cli/{emulatorDoctor-1m4rr9y3.js → emulatorDoctor-p3yt7140.js} +2 -2
- package/dist/cli/{emulatorInstaller-70v711bj.js → emulatorInstaller-4pm2kx9w.js} +3 -3
- package/dist/cli/{expoDevController-hen9sra5.js → expoDevController-0vj8dvkh.js} +3 -3
- package/dist/cli/{generate-vx6tz1y2.js → generate-v75p2fct.js} +4 -4
- package/dist/cli/{htmx-dym03fq5.js → htmx-427swtdz.js} +2 -2
- package/dist/cli/{index-j9yrhw7a.js → index-066qhc6n.js} +1 -1
- package/dist/cli/{index-x1swv7rw.js → index-3vmc30gf.js} +1 -1
- package/dist/cli/{index-g8489j4d.js → index-a4ws2jwd.js} +1 -1
- package/dist/cli/{index-xj68ep9n.js → index-b7hjgknf.js} +2 -2
- package/dist/cli/{index-vkba3289.js → index-bhbs6d5z.js} +2 -2
- package/dist/cli/{index-v4cg4dvm.js → index-exfkpjja.js} +4 -3
- package/dist/cli/{index-vy8zejts.js → index-eyzwc7gz.js} +1 -1
- package/dist/cli/{index-d3br7c47.js → index-k3y8cb6c.js} +1 -1
- package/dist/cli/{index-52a2csjm.js → index-ppphkyps.js} +1 -1
- package/dist/cli/{index-bvwkwgjw.js → index-s3xvccq3.js} +1 -1
- package/dist/cli/{index-6ps18fvr.js → index-t8cf0zj9.js} +2 -2
- package/dist/cli/{index-wwnnfhm6.js → index-w09fzs9f.js} +1 -1
- package/dist/cli/{index-px7fqsfk.js → index-zd3cna19.js} +1 -1
- package/dist/cli/index.js +16 -16
- package/dist/cli/{info-9ffx5h3h.js → info-mn125212.js} +1 -1
- package/dist/cli/{iosNativeWatcher-ntzec3hx.js → iosNativeWatcher-0nm6qad5.js} +4 -4
- package/dist/cli/{iosSimulatorController-hjzy6pq6.js → iosSimulatorController-hza2c3rv.js} +4 -4
- package/dist/cli/{islands-rq6wx0kh.js → islands-8sgky9gh.js} +1 -1
- package/dist/cli/{mobile-41sev6v0.js → mobile-hcxjr2gf.js} +10 -10
- package/dist/cli/{ps-0tryaye0.js → ps-ezmzyscn.js} +1 -1
- package/dist/cli/{psTui-0nx63pmr.js → psTui-3x3ykjve.js} +1 -1
- package/dist/cli/{remoteMacProtocol-2ej6fbnj.js → remoteMacProtocol-g09myqt5.js} +4 -4
- package/dist/cli/{remove-qgme4h2s.js → remove-1ycjx85k.js} +4 -4
- package/dist/cli/{start-0ebxkwga.js → start-mbaejxhm.js} +3 -3
- package/dist/cli/{typecheck-7yhekrc0.js → typecheck-dr068pmh.js} +209 -43
- package/dist/cli/{workspace-atcxzyee.js → workspace-1sycp9g1.js} +7 -4
- package/dist/client/index.js +8 -3
- package/dist/client/index.js.map +4 -4
- package/dist/index.js +1402 -1075
- package/dist/index.js.map +14 -10
- package/dist/islands/browser.js +3 -3
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +3 -3
- package/dist/islands/index.js.map +3 -3
- package/dist/mobile/index.js.map +1 -1
- package/dist/react/browser.js +3 -3
- package/dist/react/browser.js.map +3 -3
- package/dist/react/index.js +231 -217
- package/dist/react/index.js.map +9 -9
- package/dist/react/server.js +231 -191
- package/dist/react/server.js.map +9 -8
- package/dist/src/build/islandBootstrap.d.ts +22 -0
- package/dist/src/build/missingClientFrameworks.d.ts +29 -0
- package/dist/src/build/svelteDeclarations.d.ts +27 -0
- package/dist/src/cli/utils.d.ts +5 -1
- package/dist/src/client/islandResolver.d.ts +3 -1
- package/dist/src/core/build.d.ts +1 -1
- package/dist/src/core/islandManifest.d.ts +10 -0
- package/dist/src/core/islandPageContext.d.ts +2 -0
- package/dist/src/dev/svelteDeclarationRefresher.d.ts +6 -0
- package/dist/svelte/browser.js +3 -3
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +211 -197
- package/dist/svelte/index.js.map +8 -8
- package/dist/svelte/server.js +211 -171
- package/dist/svelte/server.js.map +8 -7
- package/dist/vue/browser.js +3 -3
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +231 -217
- package/dist/vue/index.js.map +9 -9
- package/dist/vue/server.js +231 -191
- package/dist/vue/server.js.map +9 -8
- package/package.json +6 -1
- /package/dist/cli/{index-e6ysp900.js → index-z794p5qg.js} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BuildArtifact } from 'bun';
|
|
2
|
+
/** Base name of the generated default bootstrap. Its natural manifest key
|
|
3
|
+
* (the PascalCased name) IS the reserved key, so no alias is needed and no
|
|
4
|
+
* second key is created (asserted in tests). */
|
|
5
|
+
export declare const DEFAULT_ISLAND_BOOTSTRAP_NAME = "absoluteIslandBootstrap";
|
|
6
|
+
export declare const DEFAULT_ISLAND_BOOTSTRAP_SOURCE = "import {\n\tcreateIslandManifestResolver,\n\tstartIslands\n} from '@absolutejs/absolute/client';\n\nstartIslands({\n\tregistry: {},\n\tresolveComponent: createIslandManifestResolver()\n});\n";
|
|
7
|
+
/** Writes the default bootstrap into the island-entry root (the island
|
|
8
|
+
* client pass's `root`), so it builds to `<build>/islands/` beside the
|
|
9
|
+
* island chunks. Returns the entry path. */
|
|
10
|
+
export declare const writeDefaultIslandBootstrap: (islandEntriesRoot: string) => string;
|
|
11
|
+
/** Web path of a configured bootstrap's client output: the entry-point
|
|
12
|
+
* artifact Bun wrote for `bootstrapPath` under `[dir]/[name].[hash].js`,
|
|
13
|
+
* with `[dir]` relative to the pass's `root`. Matched by name (and, when the
|
|
14
|
+
* pass root is known, directory), not by manifest key, because the key
|
|
15
|
+
* depends on the file name. */
|
|
16
|
+
export type BootstrapOutputLookup = {
|
|
17
|
+
bootstrapPath: string;
|
|
18
|
+
buildPath: string;
|
|
19
|
+
outputs: Pick<BuildArtifact, 'hash' | 'kind' | 'path'>[];
|
|
20
|
+
passRoot: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const findBootstrapOutputPath: ({ bootstrapPath, buildPath, outputs, passRoot }: BootstrapOutputLookup) => string | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BunPlugin } from 'bun';
|
|
2
|
+
import type { BuildConfig } from '../../types/build';
|
|
3
|
+
export type ClientFramework = 'angular' | 'react' | 'svelte' | 'vue';
|
|
4
|
+
/** True when `packageName` has a `node_modules/<name>/package.json` in
|
|
5
|
+
* `projectRoot` or any ancestor, which is how Bun's resolver finds it. A
|
|
6
|
+
* file check, not `Bun.resolveSync`, because not every package exports its
|
|
7
|
+
* main entry or `package.json` under the default conditions. */
|
|
8
|
+
export declare const isPackageInstalled: (packageName: string, projectRoot: string) => boolean;
|
|
9
|
+
export type MissingClientFrameworksOptions = {
|
|
10
|
+
/** Frameworks the project configures a directory for. Their runtimes
|
|
11
|
+
* must resolve, so they never count as missing. */
|
|
12
|
+
configured: Partial<Record<ClientFramework, unknown>>;
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
/** Injectable for tests; defaults to a `node_modules` lookup. */
|
|
15
|
+
isInstalled?: (packageName: string, projectRoot: string) => boolean;
|
|
16
|
+
};
|
|
17
|
+
/** Frameworks that are neither configured nor installed. An installed but
|
|
18
|
+
* unconfigured framework isn't missing: the bundler can resolve it, and
|
|
19
|
+
* user code may import it directly. */
|
|
20
|
+
export declare const resolveMissingClientFrameworks: ({ configured, isInstalled, projectRoot }: MissingClientFrameworksOptions) => ClientFramework[];
|
|
21
|
+
/** `resolveMissingClientFrameworks` for a build config: a framework counts
|
|
22
|
+
* as configured when its directory is set. */
|
|
23
|
+
export declare const resolveMissingClientFrameworksForConfig: (config: Pick<BuildConfig, "angularDirectory" | "reactDirectory" | "svelteDirectory" | "vueDirectory">, projectRoot: string) => ClientFramework[];
|
|
24
|
+
/** Bare specifiers belonging to `frameworks`, as one anchored pattern. */
|
|
25
|
+
export declare const missingFrameworkSpecifierPattern: (frameworks: readonly ClientFramework[]) => RegExp | null;
|
|
26
|
+
/** The stub's source: CommonJS (so any named import binds at build time),
|
|
27
|
+
* throwing on evaluation with the package and framework it stands in for. */
|
|
28
|
+
export declare const createMissingClientFrameworkPlugin: (frameworks: readonly ClientFramework[]) => BunPlugin | null;
|
|
29
|
+
export declare const missingFrameworkStubSource: (specifier: string) => string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Mirror root, relative to the project root. */
|
|
2
|
+
export declare const SVELTE_DECLARATIONS_ROOT = ".absolutejs/types/svelte";
|
|
3
|
+
export type SvelteDeclarationsResult = {
|
|
4
|
+
status: 'generated';
|
|
5
|
+
durationMs: number;
|
|
6
|
+
outDir: string;
|
|
7
|
+
} | {
|
|
8
|
+
status: 'unchanged';
|
|
9
|
+
outDir: string;
|
|
10
|
+
} | {
|
|
11
|
+
status: 'unavailable';
|
|
12
|
+
reason: string;
|
|
13
|
+
};
|
|
14
|
+
/** Generates (or reuses) the declaration mirror for one Svelte directory.
|
|
15
|
+
* Never throws: a project without svelte2tsx, or a component svelte2tsx
|
|
16
|
+
* can't declare, keeps the loose ambient types it had before. */
|
|
17
|
+
export type SvelteDeclarationsOptions = {
|
|
18
|
+
projectRoot: string;
|
|
19
|
+
svelteDirectory: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const generateSvelteDeclarations: ({ projectRoot, svelteDirectory }: SvelteDeclarationsOptions) => Promise<SvelteDeclarationsResult>;
|
|
22
|
+
/** The `rootDirs` entries a tsconfig needs for the generated declarations to
|
|
23
|
+
* resolve: the project root and the mirror, relative to `fromDir`. */
|
|
24
|
+
export declare const svelteDeclarationRootDirs: (projectRoot: string, fromDir: string) => string[];
|
|
25
|
+
/** Whether the project's own tsconfig (what editors read) lists the mirror
|
|
26
|
+
* in `rootDirs`. */
|
|
27
|
+
export declare const tsconfigHasSvelteDeclarationRoot: (rootDirs: unknown) => boolean;
|
package/dist/src/cli/utils.d.ts
CHANGED
|
@@ -10,7 +10,11 @@ export declare const findFreePort: () => Promise<number>;
|
|
|
10
10
|
* left running.
|
|
11
11
|
*/
|
|
12
12
|
export declare const isOwnStaleProcess: (command: string, directory: string | null, projectDirectory: string) => boolean;
|
|
13
|
-
export declare const killStaleProcesses: (port: number, logMessage?: (message: string) => void) =>
|
|
13
|
+
export declare const killStaleProcesses: (port: number, logMessage?: (message: string) => void) => {
|
|
14
|
+
command: string;
|
|
15
|
+
directory: string | null;
|
|
16
|
+
pid: number;
|
|
17
|
+
}[];
|
|
14
18
|
export declare const openUrlInBrowser: (url: string, onError?: (message: string) => void) => boolean;
|
|
15
19
|
export declare const printHelp: (subject?: string, mobile?: boolean) => void;
|
|
16
20
|
export declare const printHint: () => void;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { IslandFramework } from '../../types/island';
|
|
2
|
-
|
|
2
|
+
/** Resolves island components from the build manifest's per-island chunks.
|
|
3
|
+
* Defaults to the manifest the server injected into the page. */
|
|
4
|
+
export declare const createIslandManifestResolver: (manifest?: Record<string, string>) => (framework: IslandFramework, component: string) => Promise<any>;
|
package/dist/src/core/build.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { BuildConfig, BuildPassError, BunBuildConfigOverride, BunBuildPassK
|
|
|
9
9
|
* production build scans once, so it opts out and pays no stat pass. */
|
|
10
10
|
export declare const scanWorkerReferences: (dirs: string[], memoise?: boolean) => Promise<string[]>;
|
|
11
11
|
type BunBuildOptions = Parameters<typeof bunBuild>[0];
|
|
12
|
-
export declare const resolveBunBuildOverride: (config: BuildConfig["bunBuild"], pass: BunBuildPassKey) => Partial<Omit<Bun.BuildConfig, "target" | "entrypoints" | "outdir" | "root" | "format" | "throw"
|
|
12
|
+
export declare const resolveBunBuildOverride: (config: BuildConfig["bunBuild"], pass: BunBuildPassKey) => Partial<Omit<Bun.BuildConfig, "compile" | "target" | "entrypoints" | "outdir" | "root" | "format" | "throw">>;
|
|
13
13
|
/** Resolve the Bun `sourcemap` mode for CLIENT bundles from the `sourcemaps`
|
|
14
14
|
* config. Dev always uses inline maps (HMR / devtools); production emits
|
|
15
15
|
* external maps only when explicitly enabled — they're then chained back to
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { IslandFramework } from '../../types/island';
|
|
2
|
+
/** Manifest key the server injects as the islands bootstrap script on any
|
|
3
|
+
* page with island markers. The build records the configured
|
|
4
|
+
* `islands.bootstrap` (whatever its file name) or a generated default under
|
|
5
|
+
* it — see build/islandBootstrap.ts. */
|
|
6
|
+
export declare const ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap";
|
|
7
|
+
/** Key a bootstrap file named `bootstrapClient.*` gets naturally, which is
|
|
8
|
+
* all the server used to look for. Still honored for manifests built
|
|
9
|
+
* before the reserved key existed. */
|
|
10
|
+
export declare const LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient";
|
|
11
|
+
export declare const getIslandBootstrapPath: (manifest: Record<string, string>) => string | undefined;
|
|
2
12
|
export declare const getIslandManifestEntries: (manifest: Record<string, string>) => Partial<Record<IslandFramework, Record<string, string>>>;
|
|
3
13
|
export declare const getIslandManifestKey: (framework: IslandFramework, component: string) => string;
|
|
@@ -2,6 +2,8 @@ declare global {
|
|
|
2
2
|
var __absoluteManifest: Record<string, string> | undefined;
|
|
3
3
|
var __ABS_ISLAND_STATE__: Record<string, Record<string, unknown>> | undefined;
|
|
4
4
|
}
|
|
5
|
+
/** @internal Test hook: lets each test observe the one-time warning. */
|
|
6
|
+
export declare const resetIslandBootstrapWarning: () => void;
|
|
5
7
|
export declare const htmlContainsIslands: (html: string) => boolean;
|
|
6
8
|
export declare const injectIslandPageContext: (html: string, options?: {
|
|
7
9
|
hasIslands?: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BuildConfig } from '../../types/build';
|
|
2
|
+
export declare const createSvelteDeclarationRefresher: (config: BuildConfig) => {
|
|
3
|
+
refresh: () => void;
|
|
4
|
+
/** Call for every watcher event; only Svelte-directory sources count. */
|
|
5
|
+
onFileChange: (filePath: string) => void;
|
|
6
|
+
} | null;
|
package/dist/svelte/browser.js
CHANGED
|
@@ -73,7 +73,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
73
73
|
var __require = import.meta.require;
|
|
74
74
|
|
|
75
75
|
// src/core/islandManifest.ts
|
|
76
|
-
var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
|
|
76
|
+
var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
|
|
77
77
|
const entries = {};
|
|
78
78
|
let found = false;
|
|
79
79
|
for (const [key, value] of Object.entries(manifest)) {
|
|
@@ -86,7 +86,7 @@ var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + fram
|
|
|
86
86
|
found = true;
|
|
87
87
|
}
|
|
88
88
|
return found ? entries : undefined;
|
|
89
|
-
}, getIslandManifestEntries = (manifest) => {
|
|
89
|
+
}, getIslandBootstrapPath = (manifest) => manifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ?? manifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY], getIslandManifestEntries = (manifest) => {
|
|
90
90
|
const islands = {};
|
|
91
91
|
const frameworks = ["react", "svelte", "vue", "angular"];
|
|
92
92
|
for (const framework of frameworks) {
|
|
@@ -283,5 +283,5 @@ export {
|
|
|
283
283
|
useIslandStore
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
//# debugId=
|
|
286
|
+
//# debugId=EA3CBDFF95967DAC64756E2164756E21
|
|
287
287
|
//# sourceMappingURL=browser.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/core/islandManifest.ts", "../src/core/islands.ts", "../src/core/islandMarkupAttributes.ts", "../src/svelte/createIsland.browser.ts", "../src/svelte/resolveIslandHtml.browser.ts", "../node_modules/zustand/esm/vanilla.mjs", "../node_modules/zustand/esm/middleware.mjs", "../src/client/islandStore.ts", "../src/svelte/islandStore.ts", "../src/svelte/browser.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { IslandFramework } from '../../types/island';\n\nconst toIslandFrameworkSegment = (framework: IslandFramework) =>\n\tframework[0]?.toUpperCase() + framework.slice(1);\n\nconst collectFrameworkIslands = (\n\tmanifest: Record<string, string>,\n\tprefix: string\n) => {\n\tconst entries: Record<string, string> = {};\n\tlet found = false;\n\n\tfor (const [key, value] of Object.entries(manifest)) {\n\t\tif (!key.startsWith(prefix)) continue;\n\n\t\tconst component = key.slice(prefix.length);\n\t\tif (!component) continue;\n\n\t\tentries[component] = value;\n\t\tfound = true;\n\t}\n\n\treturn found ? entries : undefined;\n};\n\nexport const getIslandManifestEntries = (manifest: Record<string, string>) => {\n\tconst islands: Partial<Record<IslandFramework, Record<string, string>>> =\n\t\t{};\n\tconst frameworks: IslandFramework[] = ['react', 'svelte', 'vue', 'angular'];\n\n\tfor (const framework of frameworks) {\n\t\tconst prefix = `Island${toIslandFrameworkSegment(framework)}`;\n\t\tconst entries = collectFrameworkIslands(manifest, prefix);\n\t\tif (entries) islands[framework] = entries;\n\t}\n\n\treturn islands;\n};\nexport const getIslandManifestKey = (\n\tframework: IslandFramework,\n\tcomponent: string\n) => `Island${toIslandFrameworkSegment(framework)}${component}`;\n",
|
|
5
|
+
"import type { IslandFramework } from '../../types/island';\n\n/** Manifest key the server injects as the islands bootstrap script on any\n * page with island markers. The build records the configured\n * `islands.bootstrap` (whatever its file name) or a generated default under\n * it — see build/islandBootstrap.ts. */\nexport const ISLAND_BOOTSTRAP_MANIFEST_KEY = 'AbsoluteIslandBootstrap';\n\n/** Key a bootstrap file named `bootstrapClient.*` gets naturally, which is\n * all the server used to look for. Still honored for manifests built\n * before the reserved key existed. */\nexport const LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = 'BootstrapClient';\n\nconst toIslandFrameworkSegment = (framework: IslandFramework) =>\n\tframework[0]?.toUpperCase() + framework.slice(1);\n\nconst collectFrameworkIslands = (\n\tmanifest: Record<string, string>,\n\tprefix: string\n) => {\n\tconst entries: Record<string, string> = {};\n\tlet found = false;\n\n\tfor (const [key, value] of Object.entries(manifest)) {\n\t\tif (!key.startsWith(prefix)) continue;\n\n\t\tconst component = key.slice(prefix.length);\n\t\tif (!component) continue;\n\n\t\tentries[component] = value;\n\t\tfound = true;\n\t}\n\n\treturn found ? entries : undefined;\n};\n\nexport const getIslandBootstrapPath = (manifest: Record<string, string>) =>\n\tmanifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ??\n\tmanifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY];\nexport const getIslandManifestEntries = (manifest: Record<string, string>) => {\n\tconst islands: Partial<Record<IslandFramework, Record<string, string>>> =\n\t\t{};\n\tconst frameworks: IslandFramework[] = ['react', 'svelte', 'vue', 'angular'];\n\n\tfor (const framework of frameworks) {\n\t\tconst prefix = `Island${toIslandFrameworkSegment(framework)}`;\n\t\tconst entries = collectFrameworkIslands(manifest, prefix);\n\t\tif (entries) islands[framework] = entries;\n\t}\n\n\treturn islands;\n};\nexport const getIslandManifestKey = (\n\tframework: IslandFramework,\n\tcomponent: string\n) => `Island${toIslandFrameworkSegment(framework)}${component}`;\n",
|
|
6
6
|
"import type {\n\tIslandComponentDefinition,\n\tIslandRegistry,\n\tIslandRegistryInput\n} from '../../types/island';\n\nexport const defineIslandComponent = <Component>(\n\tcomponent: Component,\n\toptions: {\n\t\texport?: string;\n\t\tsource: string;\n\t}\n): IslandComponentDefinition<Component> => ({\n\tcomponent,\n\texport: options.export,\n\tsource: options.source\n});\nexport const defineIslandRegistry = <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T>\n) => registry;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nexport const getIslandBuildReference = <Component>(\n\tcomponent: Component | IslandComponentDefinition<Component>\n) => {\n\tif (!isIslandComponentDefinition(component)) return null;\n\n\treturn {\n\t\texport: component.export,\n\t\tsource: component.source\n\t};\n};\nexport const isIslandComponentDefinition = <Component>(\n\tvalue: Component | IslandComponentDefinition<Component>\n): value is IslandComponentDefinition<Component> =>\n\tisRecord(value) &&\n\t'component' in value &&\n\t'source' in value &&\n\ttypeof value.source === 'string';\n\nexport function getIslandComponent<Component>(component: Component): Component;\nexport function getIslandComponent<Component>(\n\tcomponent: IslandComponentDefinition<Component>\n): Component;\nexport function getIslandComponent<Component>(\n\tcomponent: Component | IslandComponentDefinition<Component>\n) {\n\tif (isIslandComponentDefinition(component)) {\n\t\treturn component.component;\n\t}\n\n\treturn component;\n}\nexport const parseIslandProps = (rawProps: string | null) => {\n\tif (!rawProps) return {};\n\n\treturn JSON.parse(rawProps);\n};\nexport const serializeIslandProps = (props: unknown) =>\n\tJSON.stringify(props ?? {});\n\nexport {\n\tgetIslandManifestEntries,\n\tgetIslandManifestKey\n} from './islandManifest';\n",
|
|
7
7
|
"import type { RuntimeIslandRenderProps } from '../../types/island';\nimport { serializeIslandProps } from './islands';\n\ntype IslandMarkerAttributes = {\n\t'data-component': string;\n\t'data-framework': string;\n\t'data-hydrate': string;\n\t'data-island': 'true';\n\t'data-island-id'?: string;\n\t'data-props': string;\n};\n\nexport const getIslandMarkerAttributes = (\n\tprops: RuntimeIslandRenderProps,\n\tislandId?: string\n): IslandMarkerAttributes => ({\n\t'data-component': props.component,\n\t'data-framework': props.framework,\n\t'data-hydrate': props.hydrate ?? 'load',\n\t'data-island': 'true',\n\t...(islandId ? { 'data-island-id': islandId } : {}),\n\t'data-props': serializeIslandProps(props.props)\n});\n\nconst escapeHtmlAttribute = (value: string) =>\n\tvalue\n\t\t.replaceAll('&', '&')\n\t\t.replaceAll('\"', '"')\n\t\t.replaceAll('<', '<')\n\t\t.replaceAll('>', '>');\n\nexport const serializeIslandAttributes = (attributes: Record<string, string>) =>\n\tObject.entries(attributes)\n\t\t.map(([key, value]) => `${key}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t.join(' ');\n",
|
|
8
8
|
"import type {\n\tIslandRegistry,\n\tIslandRegistryInput,\n\tTypedIslandRenderProps\n} from '../../types/island';\nimport {\n\tgetIslandMarkerAttributes,\n\tserializeIslandAttributes\n} from '../core/islandMarkupAttributes';\n\nexport const createTypedIsland =\n\t<T extends IslandRegistryInput>(_registry: IslandRegistry<T>) =>\n\t(props: TypedIslandRenderProps<T>) => {\n\t\tconst attributes = getIslandMarkerAttributes(props);\n\n\t\treturn `<div ${serializeIslandAttributes(attributes)}></div>`;\n\t};\n",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"import type { StoreApi } from 'zustand/vanilla';\nimport {\n\treadIslandStore,\n\tsubscribeIslandStore,\n\ttype IslandStoreState\n} from '../client/islandStore';\n\nexport const useIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => ({\n\tsubscribe(listener: (value: TSelected) => void) {\n\t\tlistener(readIslandStore(store, selector));\n\n\t\treturn subscribeIslandStore(store, selector, listener);\n\t}\n});\n",
|
|
14
14
|
"export { createTypedIsland } from './createIsland.browser';\nexport { resolveIslandHtml } from './resolveIslandHtml.browser';\nexport { useIslandStore } from './islandStore';\n\nexport const renderIsland = async () => {\n\tthrow new Error(\n\t\t'renderIsland is server-only. Use it during SSR, not in the browser.'\n\t);\n};\n"
|
|
15
15
|
],
|
|
16
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
17
|
-
"debugId": "
|
|
16
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMa,gCAAgC,2BAKhC,uCAAuC,mBAE9C,2BAA2B,CAAC,cACjC,UAAU,IAAI,YAAY,IAAI,UAAU,MAAM,CAAC,GAE1C,0BAA0B,CAC/B,UACA,WACI;AAAA,EACJ,MAAM,UAAkC,CAAC;AAAA,EACzC,IAAI,QAAQ;AAAA,EAEZ,YAAY,KAAK,UAAU,OAAO,QAAQ,QAAQ,GAAG;AAAA,IACpD,IAAI,CAAC,IAAI,WAAW,MAAM;AAAA,MAAG;AAAA,IAE7B,MAAM,YAAY,IAAI,MAAM,OAAO,MAAM;AAAA,IACzC,IAAI,CAAC;AAAA,MAAW;AAAA,IAEhB,QAAQ,aAAa;AAAA,IACrB,QAAQ;AAAA,EACT;AAAA,EAEA,OAAO,QAAQ,UAAU;AAAA,GAGb,yBAAyB,CAAC,aACtC,SAAS,kCACT,SAAS,uCACG,2BAA2B,CAAC,aAAqC;AAAA,EAC7E,MAAM,UACL,CAAC;AAAA,EACF,MAAM,aAAgC,CAAC,SAAS,UAAU,OAA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