rwsdk 1.0.0-alpha.20 → 1.0.0-alpha.20-test.20250929150023
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/dist/lib/constants.mjs +1 -2
- package/dist/lib/e2e/browser.d.mts +1 -1
- package/dist/lib/e2e/browser.mjs +3 -4
- package/dist/lib/e2e/dev.mjs +1 -1
- package/dist/lib/e2e/environment.d.mts +1 -5
- package/dist/lib/e2e/environment.mjs +5 -61
- package/dist/lib/e2e/index.d.mts +5 -5
- package/dist/lib/e2e/index.mjs +5 -5
- package/dist/lib/e2e/release.mjs +4 -4
- package/dist/lib/e2e/setup.d.mts +1 -1
- package/dist/lib/e2e/tarball.d.mts +1 -1
- package/dist/lib/e2e/tarball.mjs +3 -3
- package/dist/lib/e2e/testHarness.d.mts +1 -1
- package/dist/lib/e2e/testHarness.mjs +7 -8
- package/dist/lib/getShortName.mjs +1 -2
- package/dist/lib/getShortName.test.mjs +2 -2
- package/dist/lib/getSrcPaths.js +2 -2
- package/dist/lib/hasPkgScript.test.mjs +2 -2
- package/dist/lib/jsonUtils.test.mjs +2 -2
- package/dist/lib/normalizeModulePath.test.mjs +2 -2
- package/dist/lib/setupEnvFiles.mjs +2 -2
- package/dist/lib/smokeTests/artifacts.mjs +2 -2
- package/dist/lib/smokeTests/browser.d.mts +1 -1
- package/dist/lib/smokeTests/browser.mjs +6 -7
- package/dist/lib/smokeTests/cleanup.mjs +6 -9
- package/dist/lib/smokeTests/codeUpdates.mjs +5 -5
- package/dist/lib/smokeTests/development.mjs +2 -2
- package/dist/lib/smokeTests/environment.d.mts +2 -3
- package/dist/lib/smokeTests/environment.mjs +17 -3
- package/dist/lib/smokeTests/release.d.mts +2 -2
- package/dist/lib/smokeTests/release.mjs +3 -3
- package/dist/lib/smokeTests/reporting.mjs +2 -2
- package/dist/lib/smokeTests/runSmokeTests.mjs +4 -4
- package/dist/lib/smokeTests/utils.mjs +3 -3
- package/dist/lib/testUtils/stubEnvVars.mjs +1 -1
- package/dist/runtime/client/client.d.ts +2 -2
- package/dist/runtime/client/client.js +2 -2
- package/dist/runtime/client/navigation.test.js +1 -1
- package/dist/runtime/client/types.d.ts +1 -1
- package/dist/runtime/entries/client.d.ts +2 -2
- package/dist/runtime/entries/client.js +2 -2
- package/dist/runtime/entries/router.d.ts +1 -1
- package/dist/runtime/entries/router.js +1 -1
- package/dist/runtime/entries/worker.d.ts +5 -5
- package/dist/runtime/entries/worker.js +5 -5
- package/dist/runtime/imports/worker.js +1 -1
- package/dist/runtime/lib/auth/session.js +1 -1
- package/dist/runtime/lib/db/DOWorkerDialect.d.ts +1 -1
- package/dist/runtime/lib/db/DOWorkerDialect.js +1 -1
- package/dist/runtime/lib/db/SqliteDurableObject.js +2 -2
- package/dist/runtime/lib/db/index.d.ts +2 -2
- package/dist/runtime/lib/db/index.js +2 -2
- package/dist/runtime/lib/db/migrations.d.ts +1 -1
- package/dist/runtime/lib/db/typeInference/builders/alterTable.d.ts +3 -3
- package/dist/runtime/lib/db/typeInference/builders/columnDefinition.d.ts +1 -1
- package/dist/runtime/lib/db/typeInference/builders/createTable.d.ts +2 -2
- package/dist/runtime/lib/db/typeInference/builders/createView.d.ts +1 -1
- package/dist/runtime/lib/db/typeInference/builders/dropTable.d.ts +1 -1
- package/dist/runtime/lib/db/typeInference/builders/dropView.d.ts +1 -1
- package/dist/runtime/lib/db/typeInference/builders/schema.d.ts +3 -3
- package/dist/runtime/lib/db/typeInference/database.d.ts +2 -2
- package/dist/runtime/lib/memoizeOnId.test.js +1 -1
- package/dist/runtime/lib/realtime/client.js +2 -2
- package/dist/runtime/lib/realtime/durableObject.js +1 -1
- package/dist/runtime/lib/realtime/protocol.test.js +1 -1
- package/dist/runtime/lib/realtime/shared.test.js +1 -1
- package/dist/runtime/lib/realtime/validateUpgradeRequest.test.js +1 -1
- package/dist/runtime/lib/realtime/worker.js +2 -2
- package/dist/runtime/lib/router.d.ts +1 -1
- package/dist/runtime/lib/router.test.js +2 -2
- package/dist/runtime/lib/rwContext.d.ts +1 -1
- package/dist/runtime/lib/turnstile/useTurnstile.js +1 -1
- package/dist/runtime/lib/turnstile/verifyTurnstileToken.test.js +1 -1
- package/dist/runtime/register/worker.js +1 -1
- package/dist/runtime/render/createThenableFromReadableStream.js +1 -1
- package/dist/runtime/render/preloads.d.ts +1 -1
- package/dist/runtime/render/renderDocumentHtmlStream.js +1 -1
- package/dist/runtime/render/renderToStream.d.ts +1 -1
- package/dist/runtime/render/renderToStream.js +2 -2
- package/dist/runtime/requestInfo/worker.d.ts +1 -1
- package/dist/runtime/script.js +1 -1
- package/dist/runtime/ssrBridge.d.ts +2 -2
- package/dist/runtime/ssrBridge.js +2 -2
- package/dist/runtime/worker.d.ts +1 -1
- package/dist/runtime/worker.js +3 -3
- package/dist/scripts/addon.d.mts +1 -0
- package/dist/scripts/addon.mjs +75 -0
- package/dist/scripts/debug-sync.mjs +4 -4
- package/dist/scripts/ensure-deploy-env.mjs +6 -6
- package/dist/scripts/migrate-new.mjs +3 -4
- package/dist/scripts/smoke-test.mjs +2 -2
- package/dist/scripts/worker-run.mjs +7 -9
- package/dist/vite/buildApp.mjs +1 -1
- package/dist/vite/checkIsUsingPrisma.test.mjs +1 -1
- package/dist/vite/configPlugin.mjs +1 -1
- package/dist/vite/createDirectiveLookupPlugin.mjs +1 -1
- package/dist/vite/createDirectiveLookupPlugin.test.mjs +2 -2
- package/dist/vite/createViteAwareResolver.d.mts +1 -2
- package/dist/vite/createViteAwareResolver.mjs +1 -1
- package/dist/vite/directiveModulesDevPlugin.mjs +3 -3
- package/dist/vite/directiveModulesDevPlugin.test.mjs +2 -2
- package/dist/vite/directivesPlugin.mjs +3 -3
- package/dist/vite/directivesPlugin.test.mjs +1 -1
- package/dist/vite/ensureAliasArray.test.mjs +1 -1
- package/dist/vite/findSpecifiers.mjs +1 -1
- package/dist/vite/findSpecifiers.test.mjs +2 -2
- package/dist/vite/findSsrSpecifiers.mjs +1 -1
- package/dist/vite/findSsrSpecifiers.test.mjs +1 -1
- package/dist/vite/getViteEsbuild.mjs +1 -1
- package/dist/vite/hasDirective.test.mjs +1 -1
- package/dist/vite/index.d.mts +1 -1
- package/dist/vite/invalidateCacheIfPrismaClientChanged.mjs +2 -2
- package/dist/vite/isJsFile.test.mjs +1 -1
- package/dist/vite/knownDepsResolverPlugin.d.mts +1 -1
- package/dist/vite/knownDepsResolverPlugin.mjs +1 -1
- package/dist/vite/linkerPlugin.mjs +2 -2
- package/dist/vite/linkerPlugin.test.mjs +1 -1
- package/dist/vite/miniflareHMRPlugin.mjs +5 -5
- package/dist/vite/miniflareHMRPlugin.test.mjs +1 -1
- package/dist/vite/prismaPlugin.mjs +1 -1
- package/dist/vite/redwoodPlugin.mjs +16 -16
- package/dist/vite/redwoodPlugin.test.mjs +2 -2
- package/dist/vite/runDirectivesScan.mjs +6 -5
- package/dist/vite/runDirectivesScan.test.mjs +2 -2
- package/dist/vite/ssrBridgePlugin.mjs +2 -2
- package/dist/vite/transformClientComponents.mjs +2 -2
- package/dist/vite/transformClientComponents.test.mjs +1 -1
- package/dist/vite/transformJsxScriptTagsPlugin.mjs +1 -1
- package/dist/vite/transformJsxScriptTagsPlugin.test.mjs +2 -2
- package/dist/vite/transformServerFunctions.mjs +4 -4
- package/package.json +7 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
2
2
|
import os from "os";
|
|
3
|
-
import
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { VENDOR_CLIENT_BARREL_EXPORT_PATH, VENDOR_CLIENT_BARREL_PATH, VENDOR_SERVER_BARREL_EXPORT_PATH, VENDOR_SERVER_BARREL_PATH, } from "../lib/constants.mjs";
|
|
4
5
|
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
5
|
-
import { VENDOR_CLIENT_BARREL_PATH, VENDOR_SERVER_BARREL_PATH, VENDOR_CLIENT_BARREL_EXPORT_PATH, VENDOR_SERVER_BARREL_EXPORT_PATH, } from "../lib/constants.mjs";
|
|
6
6
|
import { runDirectivesScan } from "./runDirectivesScan.mjs";
|
|
7
7
|
export const generateVendorBarrelContent = (files, projectRootDir) => {
|
|
8
8
|
const imports = [...files]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import {
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { generateAppBarrelContent, generateVendorBarrelContent, } from "./directiveModulesDevPlugin.mjs";
|
|
3
3
|
describe("directiveModulesDevPlugin helpers", () => {
|
|
4
4
|
const projectRootDir = "/Users/test/project";
|
|
5
5
|
describe("generateVendorBarrelContent", () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import fs from "node:fs/promises";
|
|
3
1
|
import debug from "debug";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
4
5
|
import { transformClientComponents } from "./transformClientComponents.mjs";
|
|
5
6
|
import { transformServerFunctions } from "./transformServerFunctions.mjs";
|
|
6
|
-
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
7
7
|
const log = debug("rwsdk:vite:rsc-directives-plugin");
|
|
8
8
|
export const getLoader = (filePath) => {
|
|
9
9
|
const ext = path.extname(filePath).slice(1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { ensureAliasArray } from "./ensureAliasArray.mjs";
|
|
3
3
|
describe("ensureAliasArray", () => {
|
|
4
4
|
it("should create resolve and alias array if resolve is undefined", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Lang, Lang as SgLang, parse as sgParse } from "@ast-grep/napi";
|
|
2
2
|
import path from "path";
|
|
3
3
|
// These patterns are used to match import statements in code for SSR transformations.
|
|
4
4
|
export const IMPORT_PATTERNS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import {
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { findExports, findImportSpecifiers } from "./findSpecifiers.mjs";
|
|
3
3
|
function dedupeImports(imports) {
|
|
4
4
|
const seen = new Set();
|
|
5
5
|
return imports.filter((imp) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Lang, Lang as SgLang, parse as sgParse } from "@ast-grep/napi";
|
|
2
2
|
import path from "path";
|
|
3
3
|
/**
|
|
4
4
|
* Finds callsites for __vite_ssr_import__ and __vite_ssr_dynamic_import__ with their ranges.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { findSsrImportCallSites } from "./findSsrSpecifiers.mjs";
|
|
3
3
|
describe("findSsrImportCallSites", () => {
|
|
4
4
|
it("should find __vite_ssr_import__ with double quotes", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import { createRequire } from "node:module";
|
|
2
|
+
import path from "node:path";
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
4
|
export async function getViteEsbuild(projectRootDir) {
|
|
5
5
|
const vitePath = require.resolve("vite/package.json", {
|
package/dist/vite/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { redwoodPlugin as redwood, type RedwoodPluginOptions, } from "./redwoodPlugin.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { remove, pathExists } from "fs-extra";
|
|
1
|
+
import { pathExists, remove } from "fs-extra";
|
|
3
2
|
import { stat } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
4
|
export const invalidateCacheIfPrismaClientChanged = async ({ projectRootDir, }) => {
|
|
5
5
|
const viteDepsCachePath = resolve(projectRootDir, "node_modules", ".vite", `deps_worker`, `@prisma_client.js`);
|
|
6
6
|
// Get mtimes for comparison
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import debug from "debug";
|
|
2
|
-
import { ROOT_DIR } from "../lib/constants.mjs";
|
|
3
2
|
import enhancedResolve from "enhanced-resolve";
|
|
3
|
+
import { ROOT_DIR } from "../lib/constants.mjs";
|
|
4
4
|
import { ensureAliasArray } from "./ensureAliasArray.mjs";
|
|
5
5
|
const log = debug("rwsdk:vite:known-deps-resolver-plugin");
|
|
6
6
|
const KNOWN_PREFIXES = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import debug from "debug";
|
|
2
2
|
import fsp from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
3
4
|
import { CLIENT_MANIFEST_RELATIVE_PATH } from "../lib/constants.mjs";
|
|
4
|
-
import debug from "debug";
|
|
5
5
|
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
6
6
|
const log = debug("rwsdk:vite:linker-plugin");
|
|
7
7
|
export function linkWorkerBundle({ code, manifestContent, projectRootDir, }) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import debug from "debug";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
1
3
|
import { resolve } from "node:path";
|
|
2
4
|
import colors from "picocolors";
|
|
3
|
-
import {
|
|
4
|
-
import debug from "debug";
|
|
5
|
-
import { VIRTUAL_SSR_PREFIX } from "./ssrBridgePlugin.mjs";
|
|
5
|
+
import { getShortName } from "../lib/getShortName.mjs";
|
|
6
6
|
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
7
7
|
import { hasDirective as sourceHasDirective } from "./hasDirective.mjs";
|
|
8
|
-
import { isJsFile } from "./isJsFile.mjs";
|
|
9
8
|
import { invalidateModule } from "./invalidateModule.mjs";
|
|
10
|
-
import {
|
|
9
|
+
import { isJsFile } from "./isJsFile.mjs";
|
|
10
|
+
import { VIRTUAL_SSR_PREFIX } from "./ssrBridgePlugin.mjs";
|
|
11
11
|
const log = debug("rwsdk:vite:hmr-plugin");
|
|
12
12
|
let hasErrored = false;
|
|
13
13
|
const hasDirective = async (filepath, directive) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
|
-
import { invalidateCacheIfPrismaClientChanged } from "./invalidateCacheIfPrismaClientChanged.mjs";
|
|
3
2
|
import { checkPrismaStatus } from "./checkIsUsingPrisma.mjs";
|
|
4
3
|
import { ensureAliasArray } from "./ensureAliasArray.mjs";
|
|
4
|
+
import { invalidateCacheIfPrismaClientChanged } from "./invalidateCacheIfPrismaClientChanged.mjs";
|
|
5
5
|
export const prismaPlugin = async ({ projectRootDir, }) => {
|
|
6
6
|
if (!checkPrismaStatus({ projectRootDir }).isUsingPrisma) {
|
|
7
7
|
return;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
+
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
1
2
|
import { resolve } from "node:path";
|
|
2
3
|
import { unstable_readConfig } from "wrangler";
|
|
3
|
-
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
4
4
|
import { devServerConstantPlugin } from "./devServerConstant.mjs";
|
|
5
5
|
import { hasOwnCloudflareVitePlugin } from "./hasOwnCloudflareVitePlugin.mjs";
|
|
6
6
|
import { hasOwnReactVitePlugin } from "./hasOwnReactVitePlugin.mjs";
|
|
7
7
|
import reactPlugin from "@vitejs/plugin-react";
|
|
8
8
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
9
|
-
import {
|
|
10
|
-
import { directivesPlugin } from "./directivesPlugin.mjs";
|
|
11
|
-
import { useClientLookupPlugin } from "./useClientLookupPlugin.mjs";
|
|
12
|
-
import { useServerLookupPlugin } from "./useServerLookupPlugin.mjs";
|
|
13
|
-
import { miniflareHMRPlugin } from "./miniflareHMRPlugin.mjs";
|
|
14
|
-
import { moveStaticAssetsPlugin } from "./moveStaticAssetsPlugin.mjs";
|
|
15
|
-
import { configPlugin } from "./configPlugin.mjs";
|
|
9
|
+
import { pathExists } from "fs-extra";
|
|
16
10
|
import { $ } from "../lib/$.mjs";
|
|
17
|
-
import { knownDepsResolverPlugin } from "./knownDepsResolverPlugin.mjs";
|
|
18
11
|
import { findWranglerConfig } from "../lib/findWranglerConfig.mjs";
|
|
19
|
-
import { pathExists } from "fs-extra";
|
|
20
|
-
import { injectVitePreamble } from "./injectVitePreamblePlugin.mjs";
|
|
21
|
-
import { vitePreamblePlugin } from "./vitePreamblePlugin.mjs";
|
|
22
|
-
import { prismaPlugin } from "./prismaPlugin.mjs";
|
|
23
|
-
import { ssrBridgePlugin } from "./ssrBridgePlugin.mjs";
|
|
24
12
|
import { hasPkgScript } from "../lib/hasPkgScript.mjs";
|
|
13
|
+
import { configPlugin } from "./configPlugin.mjs";
|
|
25
14
|
import { devServerTimingPlugin } from "./devServerTimingPlugin.mjs";
|
|
26
|
-
import { manifestPlugin } from "./manifestPlugin.mjs";
|
|
27
|
-
import { linkerPlugin } from "./linkerPlugin.mjs";
|
|
28
15
|
import { directiveModulesDevPlugin } from "./directiveModulesDevPlugin.mjs";
|
|
29
16
|
import { directivesFilteringPlugin } from "./directivesFilteringPlugin.mjs";
|
|
17
|
+
import { directivesPlugin } from "./directivesPlugin.mjs";
|
|
18
|
+
import { injectVitePreamble } from "./injectVitePreamblePlugin.mjs";
|
|
19
|
+
import { knownDepsResolverPlugin } from "./knownDepsResolverPlugin.mjs";
|
|
20
|
+
import { linkerPlugin } from "./linkerPlugin.mjs";
|
|
21
|
+
import { manifestPlugin } from "./manifestPlugin.mjs";
|
|
22
|
+
import { miniflareHMRPlugin } from "./miniflareHMRPlugin.mjs";
|
|
23
|
+
import { moveStaticAssetsPlugin } from "./moveStaticAssetsPlugin.mjs";
|
|
24
|
+
import { prismaPlugin } from "./prismaPlugin.mjs";
|
|
30
25
|
import { resolveForcedPaths } from "./resolveForcedPaths.mjs";
|
|
26
|
+
import { ssrBridgePlugin } from "./ssrBridgePlugin.mjs";
|
|
27
|
+
import { transformJsxScriptTagsPlugin } from "./transformJsxScriptTagsPlugin.mjs";
|
|
28
|
+
import { useClientLookupPlugin } from "./useClientLookupPlugin.mjs";
|
|
29
|
+
import { useServerLookupPlugin } from "./useServerLookupPlugin.mjs";
|
|
30
|
+
import { vitePreamblePlugin } from "./vitePreamblePlugin.mjs";
|
|
31
31
|
export const determineWorkerEntryPathname = async ({ projectRootDir, workerConfigPath, options, readConfig = unstable_readConfig, }) => {
|
|
32
32
|
if (options.entry?.worker) {
|
|
33
33
|
return resolve(projectRootDir, options.entry.worker);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { determineWorkerEntryPathname } from "./redwoodPlugin.mjs";
|
|
3
1
|
import path from "node:path";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { determineWorkerEntryPathname } from "./redwoodPlugin.mjs";
|
|
4
4
|
describe("determineWorkerEntryPathname", () => {
|
|
5
5
|
const projectRootDir = "/test/project";
|
|
6
6
|
it("should use the entry path from options if provided", async () => {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import { compile } from "@mdx-js/mdx";
|
|
3
|
+
import debug from "debug";
|
|
1
4
|
import fsp from "node:fs/promises";
|
|
2
|
-
import { hasDirective } from "./hasDirective.mjs";
|
|
3
5
|
import path from "node:path";
|
|
4
|
-
import debug from "debug";
|
|
5
|
-
import { getViteEsbuild } from "./getViteEsbuild.mjs";
|
|
6
|
-
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
7
6
|
import { INTERMEDIATES_OUTPUT_DIR } from "../lib/constants.mjs";
|
|
7
|
+
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
8
8
|
import { externalModules } from "./constants.mjs";
|
|
9
9
|
import { createViteAwareResolver } from "./createViteAwareResolver.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { getViteEsbuild } from "./getViteEsbuild.mjs";
|
|
11
|
+
import { hasDirective } from "./hasDirective.mjs";
|
|
11
12
|
const log = debug("rwsdk:vite:run-directives-scan");
|
|
12
13
|
// Copied from Vite's source code.
|
|
13
14
|
// https://github.com/vitejs/vite/blob/main/packages/vite/src/shared/utils.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import {
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { classifyModule, resolveModuleWithEnvironment, } from "./runDirectivesScan.mjs";
|
|
3
3
|
describe("runDirectivesScan helpers", () => {
|
|
4
4
|
describe("resolveModuleWithEnvironment", () => {
|
|
5
5
|
it("should use the client resolver when importerEnv is 'client'", async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import debug from "debug";
|
|
2
|
-
import { findSsrImportCallSites } from "./findSsrSpecifiers.mjs";
|
|
3
|
-
import { INTERMEDIATE_SSR_BRIDGE_PATH } from "../lib/constants.mjs";
|
|
4
2
|
import MagicString from "magic-string";
|
|
3
|
+
import { INTERMEDIATE_SSR_BRIDGE_PATH } from "../lib/constants.mjs";
|
|
4
|
+
import { findSsrImportCallSites } from "./findSsrSpecifiers.mjs";
|
|
5
5
|
const log = debug("rwsdk:vite:ssr-bridge-plugin");
|
|
6
6
|
export const VIRTUAL_SSR_PREFIX = "virtual:rwsdk:ssr:";
|
|
7
7
|
export const ssrBridgePlugin = ({ clientFiles, serverFiles, }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import MagicString from "magic-string";
|
|
2
1
|
import debug from "debug";
|
|
3
|
-
import
|
|
2
|
+
import MagicString from "magic-string";
|
|
4
3
|
import { findExports } from "./findSpecifiers.mjs";
|
|
4
|
+
import { hasDirective } from "./hasDirective.mjs";
|
|
5
5
|
const logVite = debug("rwsdk:vite:transform-client-components:vite");
|
|
6
6
|
const logEsbuild = debug("rwsdk:vite:transform-client-components:esbuild");
|
|
7
7
|
export async function transformClientComponents(code, normalizedId, ctx) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Project, Node, SyntaxKind, } from "ts-morph";
|
|
2
1
|
import debug from "debug";
|
|
2
|
+
import { Node, Project, SyntaxKind, } from "ts-morph";
|
|
3
3
|
import { normalizeModulePath } from "../lib/normalizeModulePath.mjs";
|
|
4
4
|
const log = debug("rwsdk:vite:transform-jsx-script-tags");
|
|
5
5
|
function transformAssetPath(importPath, projectRootDir) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
-
import { transformJsxScriptTagsCode } from "./transformJsxScriptTagsPlugin.mjs";
|
|
3
1
|
import jsBeautify from "js-beautify";
|
|
2
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
4
3
|
import stubEnvVars from "../lib/testUtils/stubEnvVars.mjs";
|
|
4
|
+
import { transformJsxScriptTagsCode } from "./transformJsxScriptTagsPlugin.mjs";
|
|
5
5
|
// Helper function to normalize code formatting for test comparisons
|
|
6
6
|
function normalizeCode(code) {
|
|
7
7
|
return jsBeautify(code, { indent_size: 2 });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Lang, Lang as SgLang, parse as sgParse } from "@ast-grep/napi";
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import
|
|
4
|
-
import { findExports } from "./findSpecifiers.mjs";
|
|
5
|
-
import { parse as sgParse, Lang as SgLang, Lang } from "@ast-grep/napi";
|
|
3
|
+
import MagicString from "magic-string";
|
|
6
4
|
import path from "path";
|
|
5
|
+
import { findExports } from "./findSpecifiers.mjs";
|
|
6
|
+
import { hasDirective } from "./hasDirective.mjs";
|
|
7
7
|
const log = debug("rwsdk:vite:transform-server-functions");
|
|
8
8
|
export const findExportedFunctions = (code, normalizedId) => {
|
|
9
9
|
return findExportInfo(code, normalizedId).localFunctions;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rwsdk",
|
|
3
|
-
"version": "1.0.0-alpha.20",
|
|
3
|
+
"version": "1.0.0-alpha.20-test.20250929150023",
|
|
4
4
|
"description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"rw-scripts": "./bin/rw-scripts.mjs",
|
|
8
|
+
"rwsdk": "./bin/rw-scripts.mjs",
|
|
8
9
|
"rwsync": "./bin/rwsync"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
@@ -136,6 +137,7 @@
|
|
|
136
137
|
"@cloudflare/workers-types": "~4.20250924.0",
|
|
137
138
|
"@mdx-js/mdx": "~3.1.1",
|
|
138
139
|
"@puppeteer/browsers": "~2.10.0",
|
|
140
|
+
"@types/decompress": "~4.2.7",
|
|
139
141
|
"@types/fs-extra": "~11.0.4",
|
|
140
142
|
"@types/react": "~19.1.2",
|
|
141
143
|
"@types/react-dom": "~19.1.2",
|
|
@@ -146,6 +148,7 @@
|
|
|
146
148
|
"enhanced-resolve": "~5.18.1",
|
|
147
149
|
"eventsource-parser": "~3.0.0",
|
|
148
150
|
"execa": "~9.6.0",
|
|
151
|
+
"find-up": "~8.0.0",
|
|
149
152
|
"fs-extra": "~11.3.0",
|
|
150
153
|
"glob": "~11.0.1",
|
|
151
154
|
"ignore": "~7.0.4",
|
|
@@ -154,7 +157,6 @@
|
|
|
154
157
|
"kysely-do": "~0.0.1-rc.1",
|
|
155
158
|
"lodash": "~4.17.21",
|
|
156
159
|
"magic-string": "~0.30.17",
|
|
157
|
-
"miniflare": "~4.20250924.0",
|
|
158
160
|
"picocolors": "~1.1.1",
|
|
159
161
|
"proper-lockfile": "~4.1.2",
|
|
160
162
|
"puppeteer-core": "~24.22.0",
|
|
@@ -176,15 +178,18 @@
|
|
|
176
178
|
},
|
|
177
179
|
"packageManager": "pnpm@10.0.0+sha512.b8fef5494bd3fe4cbd4edabd0745df2ee5be3e4b0b8b08fa643aa3e4c6702ccc0f00d68fa8a8c9858a735a0032485a44990ed2810526c875e416f001b17df12b",
|
|
178
180
|
"devDependencies": {
|
|
181
|
+
"@cloudflare/vite-plugin": "1.13.3",
|
|
179
182
|
"@types/debug": "~4.1.12",
|
|
180
183
|
"@types/js-beautify": "~1.14.3",
|
|
181
184
|
"@types/lodash": "~4.17.16",
|
|
182
185
|
"@types/node": "~24.5.2",
|
|
183
186
|
"@types/proper-lockfile": "~4.1.4",
|
|
187
|
+
"decompress": "~4.2.1",
|
|
184
188
|
"js-beautify": "~1.15.4",
|
|
185
189
|
"semver": "~7.7.1",
|
|
186
190
|
"tsx": "~4.20.0",
|
|
187
191
|
"typescript": "~5.9.0",
|
|
192
|
+
"vite": "7.1.6",
|
|
188
193
|
"vitest": "~3.2.0"
|
|
189
194
|
}
|
|
190
195
|
}
|