rsf-zero 0.2.0 → 0.2.1

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.
@@ -2,7 +2,7 @@ import path from "path";
2
2
  import { build as viteBuild } from "vite";
3
3
  import viteReact from "@vitejs/plugin-react";
4
4
  import { transformRsfForClientPlugin } from "../../transform/client/transformRsfForClientPlugin.js";
5
- import { debug } from "../../debug.js";
5
+ import { debug } from "../../utils/debug.js";
6
6
  export const buildClientFiles = async (rootDir, onActionFound) => {
7
7
  let actionCounter = 0; // for logging
8
8
  const _onActionFound = (action) => {
@@ -4,7 +4,7 @@ import { createProgram, flattenDiagnosticMessageText, ModuleKind, } from "typesc
4
4
  import md5 from "md5";
5
5
  import * as os from "node:os";
6
6
  import { generateActionRegistryJs, generateActionRegistryTs, generateEmptyActionRegistryJs } from "../../transform/server/generateActionRegistry.js";
7
- import { debug } from "../../debug.js";
7
+ import { debug } from "../../utils/debug.js";
8
8
  export const buildServerFiles = (actions, rootDir) => {
9
9
  const serverOutDir = path.join(rootDir, 'dist/server');
10
10
  const srcDir = path.join(rootDir, 'src');
@@ -2,7 +2,7 @@ import { createServer as createViteServer } from "vite";
2
2
  import fs from "fs";
3
3
  import viteReact from "@vitejs/plugin-react";
4
4
  import { transformRsfForClientPlugin } from "../../transform/client/transformRsfForClientPlugin.js";
5
- import { debug } from "../../debug.js";
5
+ import { debug } from "../../utils/debug.js";
6
6
  export const startVite = async ({ app, onActionFound }) => {
7
7
  debug('starting dev vite');
8
8
  const vite = await createViteServer({
package/dist/cli/dev.js CHANGED
@@ -3,7 +3,7 @@ import morgan from "morgan";
3
3
  import "dotenv/config";
4
4
  import { startVite } from "./dev/startVite.js";
5
5
  import { createActionRoute } from "./start/createActionRoute.js";
6
- import { debug } from "../debug.js";
6
+ import { debug } from "../utils/debug.js";
7
7
  export const dev = async () => {
8
8
  const app = express();
9
9
  const port = 3000;
@@ -1,5 +1,5 @@
1
1
  import { parse, stringify } from "superjson";
2
- import { debug } from "../../debug.js";
2
+ import { debug } from "../../utils/debug.js";
3
3
  export const createActionRoute = (app) => {
4
4
  let actionRegistry = {};
5
5
  const add = (actionId, actionFn) => {
@@ -1,4 +1,4 @@
1
1
  import "dotenv/config";
2
- import { RsfZeroOptions } from "../export-types.ts";
3
- export declare const start: (options: RsfZeroOptions) => Promise<void>;
2
+ import { RsfZeroConfig } from "../utils/export-types.ts";
3
+ export declare const start: (options: RsfZeroConfig) => Promise<void>;
4
4
  //# sourceMappingURL=start.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAC;AAIvB,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAIlD,eAAO,MAAM,KAAK,GAAU,SAAS,cAAc,kBAyBlD,CAAA"}
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAC;AAIvB,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAIvD,eAAO,MAAM,KAAK,GAAU,SAAS,aAAa,kBAyBjD,CAAA"}
package/dist/cli/start.js CHANGED
@@ -11,7 +11,7 @@ import express from "express";
11
11
  import morgan from "morgan";
12
12
  import "dotenv/config";
13
13
  import { createActionRoute } from "./start/createActionRoute.js";
14
- import { debug } from "../debug.js";
14
+ import { debug } from "../utils/debug.js";
15
15
  export const start = async (options) => {
16
16
  const app = express();
17
17
  const port = 3000;
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { dev } from "./cli/dev.js";
3
3
  import { build } from "./cli/build.js";
4
4
  import { start } from "./cli/start.js";
5
- import { loadOptions } from "./options.js";
5
+ import { loadOptions } from "./utils/options.js";
6
6
  import { banner } from "./cli/utils.js";
7
7
  const args = process.argv.slice(2);
8
8
  const command = args[0];
@@ -1,6 +1,6 @@
1
1
  import * as swc from "@swc/core";
2
2
  import { isTopLevelRsfFile } from "../isTopLevelRsfFile.js";
3
- import { debug } from "../../debug.js";
3
+ import { debug } from "../../utils/debug.js";
4
4
  import { getActionId } from "../getActionId.js";
5
5
  /**
6
6
  * Given a file that starts with 'use server', return a transformed client version of that file.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,EAAE,GAAG,OAAO,GAAG,EAAE,SAErD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type serveStatic from "serve-static";
2
+ import type { UserConfig } from "vite";
3
+ export type RsfZeroConfig = {
4
+ startStatic?: serveStatic.ServeStaticOptions;
5
+ };
6
+ export type ViteUserConfig = UserConfig;
7
+ //# sourceMappingURL=export-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-types.d.ts","sourceRoot":"","sources":["../../src/utils/export-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC;CAC9C,CAAA;AAGD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { RsfZeroConfig } from "./export-types.ts";
2
+ /**
3
+ * Load RSF options from rsf0-config.js at project root.
4
+ * Returns an empty object if no file is found or on safe failure.
5
+ */
6
+ export declare function loadOptions(): Promise<RsfZeroConfig>;
7
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/utils/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAelD;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,CAoB1D"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A minimal micro-framework with React Server Functions support",
4
4
  "author": "Igor Nadj",
5
5
  "type": "module",
6
- "version": "0.2.0",
6
+ "version": "0.2.1",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/IgorNadj/rsf-zero.git",
@@ -42,8 +42,8 @@
42
42
  "types": "./dist/lib/client.d.ts",
43
43
  "default": "./dist/lib/client.js"
44
44
  },
45
- "./server": {
46
- "types": "./dist/export-types.d.ts"
45
+ ".": {
46
+ "types": "./dist/utils/export-types.d.ts"
47
47
  }
48
48
  },
49
49
  "files": [
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,EAAE,GAAG,OAAO,GAAG,EAAE,SAErD,CAAC"}
@@ -1,5 +0,0 @@
1
- import type serveStatic from "serve-static";
2
- export type RsfZeroOptions = {
3
- startStatic?: serveStatic.ServeStaticOptions;
4
- };
5
- //# sourceMappingURL=export-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"export-types.d.ts","sourceRoot":"","sources":["../src/export-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC;CAC9C,CAAA"}
package/dist/options.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { RsfZeroOptions } from "./export-types.ts";
2
- /**
3
- * Load RSF options from rsf0-config.js at project root.
4
- * Returns an empty object if no file is found or on safe failure.
5
- */
6
- export declare function loadOptions(): Promise<RsfZeroOptions>;
7
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAenD;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,cAAc,CAAC,CAoB3D"}
File without changes
File without changes
File without changes
File without changes