@ivogt/rsc-router 0.0.0-experimental.12 → 0.0.0-experimental.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/vite/index.ts CHANGED
@@ -33,13 +33,13 @@ export { exposeLocationStateId } from "./expose-location-state-id.ts";
33
33
  * before Vite's plugin system can handle virtual modules.
34
34
  */
35
35
  const versionEsbuildPlugin = {
36
- name: "rsc-router-version",
36
+ name: "@ivogt/rsc-router-version",
37
37
  setup(build: any) {
38
38
  build.onResolve({ filter: /^rsc-router:version$/ }, (args: any) => ({
39
39
  path: args.path,
40
- namespace: "rsc-router-virtual",
40
+ namespace: "@ivogt/rsc-router-virtual",
41
41
  }));
42
- build.onLoad({ filter: /.*/, namespace: "rsc-router-virtual" }, () => ({
42
+ build.onLoad({ filter: /.*/, namespace: "@ivogt/rsc-router-virtual" }, () => ({
43
43
  contents: `export const VERSION = "dev";`,
44
44
  loader: "js",
45
45
  }));
@@ -184,7 +184,7 @@ function createVirtualEntriesPlugin(
184
184
  }
185
185
 
186
186
  return {
187
- name: "rsc-router:virtual-entries",
187
+ name: "@ivogt/rsc-router:virtual-entries",
188
188
  enforce: "pre",
189
189
 
190
190
  resolveId(id) {
@@ -254,7 +254,7 @@ function createVersionPlugin(): Plugin {
254
254
  let server: any = null;
255
255
 
256
256
  return {
257
- name: "rsc-router:version",
257
+ name: "@ivogt/rsc-router:version",
258
258
  enforce: "pre",
259
259
 
260
260
  configResolved(config) {
@@ -323,7 +323,7 @@ function createVersionInjectorPlugin(rscEntryPath: string): Plugin {
323
323
  let resolvedEntryPath = "";
324
324
 
325
325
  return {
326
- name: "rsc-router:version-injector",
326
+ name: "@ivogt/rsc-router:version-injector",
327
327
  enforce: "pre",
328
328
 
329
329
  configResolved(config) {
@@ -346,7 +346,7 @@ function createVersionInjectorPlugin(rscEntryPath: string): Plugin {
346
346
  }
347
347
 
348
348
  // Check if VERSION is already imported
349
- if (code.includes("rsc-router:version")) {
349
+ if (code.includes("@ivogt/rsc-router:version")) {
350
350
  return null;
351
351
  }
352
352
 
@@ -382,7 +382,7 @@ function createVersionInjectorPlugin(rscEntryPath: string): Plugin {
382
382
  }
383
383
 
384
384
  // Insert VERSION import
385
- const versionImport = `import { VERSION } from "rsc-router:version";\n`;
385
+ const versionImport = `import { VERSION } from "@ivogt/rsc-router:version";\n`;
386
386
  let newCode = code.slice(0, insertIndex) + versionImport + code.slice(insertIndex);
387
387
 
388
388
  // Add version: VERSION to createRSCHandler call
@@ -454,7 +454,7 @@ export async function rscRouter(
454
454
  };
455
455
 
456
456
  plugins.push({
457
- name: "rsc-router:cloudflare-integration",
457
+ name: "@ivogt/rsc-router:cloudflare-integration",
458
458
  enforce: "pre",
459
459
  config() {
460
460
  // Configure environments for cloudflare deployment
@@ -561,7 +561,7 @@ export async function rscRouter(
561
561
  let hasWarnedDuplicate = false;
562
562
 
563
563
  plugins.push({
564
- name: "rsc-router:rsc-integration",
564
+ name: "@ivogt/rsc-router:rsc-integration",
565
565
  enforce: "pre",
566
566
 
567
567
  config() {
@@ -691,7 +691,7 @@ export async function rscRouter(
691
691
  */
692
692
  function createCjsToEsmPlugin(): Plugin {
693
693
  return {
694
- name: "rsc-router:cjs-to-esm",
694
+ name: "@ivogt/rsc-router:cjs-to-esm",
695
695
  enforce: "pre",
696
696
  transform(code, id) {
697
697
  const cleanId = id.split("?")[0];
@@ -12,7 +12,7 @@ import packageJson from "../../package.json" with { type: "json" };
12
12
  /**
13
13
  * The canonical name used in virtual entries (without scope)
14
14
  */
15
- const VIRTUAL_PACKAGE_NAME = "rsc-router";
15
+ const VIRTUAL_PACKAGE_NAME = "@ivogt/rsc-router";
16
16
 
17
17
  /**
18
18
  * Get the published package name (e.g., "@ivogt/rsc-router")
@@ -25,12 +25,12 @@ export function getPublishedPackageName(): string {
25
25
  * Check if the package is installed from npm (scoped) vs workspace (unscoped)
26
26
  *
27
27
  * In workspace development:
28
- * - Package is installed as "rsc-router" via pnpm workspace alias
28
+ * - Package is installed as "@ivogt/rsc-router" via pnpm workspace alias
29
29
  * - The scoped name (@ivogt/rsc-router) doesn't exist in node_modules
30
30
  *
31
31
  * When installed from npm:
32
32
  * - Package is installed as "@ivogt/rsc-router"
33
- * - We need aliases to map "rsc-router/*" to "@ivogt/rsc-router/*"
33
+ * - We need aliases to map "@ivogt/rsc-router/*" to "@ivogt/rsc-router/*"
34
34
  */
35
35
  export function isInstalledFromNpm(): boolean {
36
36
  const packageName = getPublishedPackageName();
@@ -3,7 +3,7 @@
3
3
  * This module is provided by the Vite plugin at build/dev time.
4
4
  */
5
5
 
6
- declare module "rsc-router:version" {
6
+ declare module "@ivogt/rsc-router:version" {
7
7
  /**
8
8
  * Auto-generated version string for cache invalidation.
9
9
  * Changes on server restart (dev) or build (prod).
@@ -10,11 +10,11 @@ import {
10
10
  setServerCallback,
11
11
  encodeReply,
12
12
  createTemporaryReferenceSet,
13
- } from "rsc-router/internal/deps/browser";
13
+ } from "@ivogt/rsc-router/internal/deps/browser";
14
14
  import { createElement, StrictMode } from "react";
15
15
  import { hydrateRoot } from "react-dom/client";
16
- import { rscStream } from "rsc-router/internal/deps/html-stream-client";
17
- import { initBrowserApp, RSCRouter } from "rsc-router/browser";
16
+ import { rscStream } from "@ivogt/rsc-router/internal/deps/html-stream-client";
17
+ import { initBrowserApp, RSCRouter } from "@ivogt/rsc-router/browser";
18
18
 
19
19
  async function initializeApp() {
20
20
  const deps = {
@@ -37,10 +37,10 @@ initializeApp().catch(console.error);
37
37
  `.trim();
38
38
 
39
39
  export const VIRTUAL_ENTRY_SSR: string = `
40
- import { createFromReadableStream } from "rsc-router/internal/deps/ssr";
40
+ import { createFromReadableStream } from "@ivogt/rsc-router/internal/deps/ssr";
41
41
  import { renderToReadableStream } from "react-dom/server.edge";
42
- import { injectRSCPayload } from "rsc-router/internal/deps/html-stream-server";
43
- import { createSSRHandler } from "rsc-router/ssr";
42
+ import { injectRSCPayload } from "@ivogt/rsc-router/internal/deps/html-stream-server";
43
+ import { createSSRHandler } from "@ivogt/rsc-router/ssr";
44
44
 
45
45
  export const renderHTML = createSSRHandler({
46
46
  createFromReadableStream,
@@ -63,10 +63,10 @@ import {
63
63
  loadServerAction,
64
64
  decodeAction,
65
65
  decodeFormState,
66
- } from "rsc-router/internal/deps/rsc";
66
+ } from "@ivogt/rsc-router/internal/deps/rsc";
67
67
  import { router } from "${routerPath}";
68
- import { createRSCHandler } from "rsc-router/rsc";
69
- import { VERSION } from "rsc-router:version";
68
+ import { createRSCHandler } from "@ivogt/rsc-router/rsc";
69
+ import { VERSION } from "@ivogt/rsc-router:version";
70
70
 
71
71
  // Import loader manifest to ensure all fetchable loaders are registered at startup
72
72
  // This is critical for serverless/multi-process deployments where the loader module
@@ -97,7 +97,7 @@ export const VIRTUAL_IDS = {
97
97
  browser: "virtual:rsc-router/entry.browser.js",
98
98
  ssr: "virtual:rsc-router/entry.ssr.js",
99
99
  rsc: "virtual:rsc-router/entry.rsc.js",
100
- version: "rsc-router:version",
100
+ version: "@ivogt/rsc-router:version",
101
101
  } as const;
102
102
 
103
103
  /**