bun-plugin-stx 0.2.99 → 0.2.100

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/README.md CHANGED
@@ -909,7 +909,7 @@ For help, discussion about best practices, or any other conversation that would
909
909
 
910
910
  For casual chit-chat with others using this package:
911
911
 
912
- [Join the Stacks Discord Server](https://discord.gg/stacksjs)
912
+ [Join the Stacks Discord Server](https://stacksjs.com/discord)
913
913
 
914
914
  ## Postcardware
915
915
 
@@ -197,7 +197,7 @@ class Router {
197
197
  return bSegments - aSegments;
198
198
  return a.pattern.localeCompare(b.pattern);
199
199
  });
200
- const stxDir = path4.join(baseDir, ".stx");
200
+ const stxDir = path4.resolve(baseDir, config.stateDir || process.env.STX_DIR?.trim() || ".stx");
201
201
  generateRouteTypes(this.routes, stxDir);
202
202
  generateRouteManifest(this.routes, stxDir, this.pagesDir);
203
203
  }
package/dist/serve.js CHANGED
@@ -8700,6 +8700,7 @@ var defaultConfigDir4 = resolve12(process20.cwd(), "config");
8700
8700
  var defaultGeneratedDir4 = resolve12(process20.cwd(), "src/generated");
8701
8701
 
8702
8702
  // src/serve.ts
8703
+ import { stateDir, stateDirName } from "@stacksjs/stx";
8703
8704
  var defaultStxModule = import("@stacksjs/stx");
8704
8705
  function buildDynamicRouteRegexes(fileRouteBase) {
8705
8706
  const toPattern = (p) => p.replace(/\[([^\]]+)\]/g, "([^/]+)").replace(/\//g, "\\/");
@@ -9282,11 +9283,11 @@ After installing: bun add bun-plugin-stx`);
9282
9283
  pageMiddlewarePatterns.length = 0;
9283
9284
  await Promise.all(files.map((f) => detectPageMiddleware(f)));
9284
9285
  try {
9285
- const { Router } = await import("./chunk-kgzhgwc6.js");
9286
+ const { Router } = await import("./chunk-0kwywfp1.js");
9286
9287
  const pagesDirs = patterns.map((p) => p.replace(/\/$/, "")).filter(Boolean);
9287
- const router = new Router(process19.cwd(), { pagesDirs });
9288
+ const router = new Router(process19.cwd(), { pagesDirs, stateDir: stateDirName() });
9288
9289
  if (!options.quiet)
9289
- console.log(`[stx] Generated ${router.routes.length} routes \u2192 .stx/routes.ts`);
9290
+ console.log(`[stx] Generated ${router.routes.length} routes \u2192 ${nodePath.join(stateDirName(), "routes.ts")}`);
9290
9291
  } catch (e) {}
9291
9292
  return files;
9292
9293
  }
@@ -9295,7 +9296,7 @@ After installing: bun add bun-plugin-stx`);
9295
9296
  return;
9296
9297
  assetsInitialized = true;
9297
9298
  const assetsDir = "./resources/assets";
9298
- const targetAssetsDir = "./.stx/assets";
9299
+ const targetAssetsDir = stateDir(process19.cwd(), "assets");
9299
9300
  try {
9300
9301
  const assetsExist = await nodeFs.stat(assetsDir).then(() => true).catch(() => false);
9301
9302
  if (assetsExist) {
@@ -10198,7 +10199,7 @@ ${pageSetupScripts.join(`
10198
10199
  }
10199
10200
  if (path.startsWith("/chunk-") || path.endsWith(".js") || path.endsWith(".css")) {
10200
10201
  try {
10201
- const buildFile = Bun.file(`.stx${path}`);
10202
+ const buildFile = Bun.file(stateDir(process19.cwd(), path));
10202
10203
  if (await buildFile.exists()) {
10203
10204
  const ext = path.split(".").pop()?.toLowerCase();
10204
10205
  const contentType = ext === "css" ? "text/css" : ext === "js" ? "application/javascript" : "text/plain";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.99",
4
+ "version": "0.2.100",
5
5
  "description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",