swift-rust 1.4.0 → 1.5.0

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.
@@ -1730,12 +1730,25 @@ function setupWatcher() {
1730
1730
  if (!existsSync(APP_DIR)) return;
1731
1731
  const watchers = new Map();
1732
1732
 
1733
+ const IGNORE_DIRS = new Set([
1734
+ "node_modules",
1735
+ "dist",
1736
+ "build",
1737
+ "out",
1738
+ "coverage",
1739
+ "target",
1740
+ ".git",
1741
+ ".vercel",
1742
+ ".turbo",
1743
+ ".swift-rust",
1744
+ ".next",
1745
+ ]);
1733
1746
  function walk(dir) {
1734
1747
  if (watchers.has(dir)) return;
1735
1748
  try {
1736
1749
  const entries = readdirSync(dir, { withFileTypes: true });
1737
1750
  for (const e of entries) {
1738
- if (e.isDirectory() && !e.name.startsWith(".") && e.name !== "node_modules") {
1751
+ if (e.isDirectory() && !e.name.startsWith(".") && !IGNORE_DIRS.has(e.name)) {
1739
1752
  walk(join(dir, e.name));
1740
1753
  }
1741
1754
  }
@@ -1776,13 +1789,10 @@ function setupWatcher() {
1776
1789
  logLine([` ${paint("dim", "watch error:")} ${paint("red", err.message)}`], 1);
1777
1790
  }
1778
1791
  }
1779
- walk(APP_DIR);
1780
- // Also watch sibling source dirs that pages/layouts import fromwithout
1781
- // this, edits to components/, lib/, etc. never trigger a reload.
1782
- for (const extra of ["components", "lib", "app"]) {
1783
- const p = resolve(cwd, extra);
1784
- if (existsSync(p)) walk(p);
1785
- }
1792
+ // Watch the WHOLE project (minus dep/build dirs) so a change to *any* source
1793
+ // file pages, components, lib, hooks, content, config, wherevertriggers
1794
+ // a recompile + reload. No more "edit this folder and nothing happens".
1795
+ walk(cwd);
1786
1796
  }
1787
1797
 
1788
1798
  const networkUrls = [];
@@ -2473,6 +2483,9 @@ try {
2473
2483
  serverHandle = Bun.serve({
2474
2484
  port,
2475
2485
  hostname,
2486
+ // Bun defaults to a 10s idle timeout, which aborts slow renders / large
2487
+ // payloads (e.g. the first compile of a heavy page). 255s is Bun's max.
2488
+ idleTimeout: 255,
2476
2489
  async fetch(req) {
2477
2490
  return await handleFetch(req);
2478
2491
  },
package/dist/link.d.ts CHANGED
@@ -7,4 +7,5 @@ export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>,
7
7
  scroll?: boolean;
8
8
  }
9
9
  export declare function Link({ href, prefetch, replace, scroll, children, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
10
+ export default Link;
10
11
  //# sourceMappingURL=link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,2CAYrF"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,2CAYrF;AAID,eAAe,IAAI,CAAC"}
package/dist/link.js CHANGED
@@ -11,4 +11,7 @@ export function Link({ href, prefetch, replace, scroll, children, ...rest }) {
11
11
  dataAttrs["data-sr-prefetch"] = "false";
12
12
  return (_jsx("a", { href: href, ...dataAttrs, ...rest, children: children }));
13
13
  }
14
+ // Default export too, so both `import { Link } from "swift-rust"` and the
15
+ // Next.js-style `import Link from "swift-rust/link"` work.
16
+ export default Link;
14
17
  //# sourceMappingURL=link.js.map
package/dist/link.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","sourceRoot":"","sources":["../src/link.tsx"],"names":[],"mappings":";AAUA,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAa;IACpF,0EAA0E;IAC1E,0EAA0E;IAC1E,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,IAAI,OAAO;QAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC;IACnD,IAAI,MAAM,KAAK,KAAK;QAAE,SAAS,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC;IAC5D,IAAI,QAAQ,KAAK,KAAK;QAAE,SAAS,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC;IAChE,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,KAAM,SAAS,KAAM,IAAI,YACnC,QAAQ,GACP,CACL,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"link.js","sourceRoot":"","sources":["../src/link.tsx"],"names":[],"mappings":";AAUA,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAa;IACpF,0EAA0E;IAC1E,0EAA0E;IAC1E,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,IAAI,OAAO;QAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC;IACnD,IAAI,MAAM,KAAK,KAAK;QAAE,SAAS,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC;IAC5D,IAAI,QAAQ,KAAK,KAAK;QAAE,SAAS,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC;IAChE,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,KAAM,SAAS,KAAM,IAAI,YACnC,QAAQ,GACP,CACL,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,2DAA2D;AAC3D,eAAe,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swift-rust",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "The full-stack React framework powered with Rust + Bun. TSX-first, Rust rendering, 10x faster than Next.js, single binary deploy.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://swift-rust.dev",