create-caspian-app 0.2.0-beta.80 → 0.2.0-beta.82

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.
@@ -1,9 +1,10 @@
1
1
  import { type ChildProcess, execFile, spawn } from "node:child_process";
2
- import { mkdir, readFile, readFileSync, rm, rmSync, writeFile } from "node:fs";
2
+ import { existsSync, mkdir, readFile, readFileSync, rm, rmSync, writeFile } from "node:fs";
3
3
  import { promisify } from "node:util";
4
4
  import { dirname, join } from "node:path";
5
5
  import process from "node:process";
6
6
  import { createSrcWatcher, DebouncedWorker, DEFAULT_AWF, DEFAULT_IGNORES } from "./utils.js";
7
+ import caspianConfig from "../caspian.config.json";
7
8
 
8
9
  const mode: "watch" | "build" =
9
10
  process.argv[2] === "watch" ? "watch" : "build";
@@ -178,7 +179,7 @@ function createWatchers(rebuildWorker: DebouncedWorker): ClosableWatcher[] {
178
179
  rebuildWorker.schedule(relPath);
179
180
  };
180
181
 
181
- return [
182
+ const watchers: ClosableWatcher[] = [
182
183
  createSrcWatcher(join(process.cwd(), "src", "**", "*"), {
183
184
  exts: [".css", ".html", ".js", ".py"],
184
185
  ignored: WATCH_IGNORES,
@@ -186,13 +187,6 @@ function createWatchers(rebuildWorker: DebouncedWorker): ClosableWatcher[] {
186
187
  logPrefix: "tailwind:src",
187
188
  onEvent: scheduleRebuild,
188
189
  }),
189
- createSrcWatcher(join(process.cwd(), "ts", "**", "*"), {
190
- exts: [".js", ".jsx", ".ts", ".tsx"],
191
- ignored: WATCH_IGNORES,
192
- awaitWriteFinish: DEFAULT_AWF,
193
- logPrefix: "tailwind:ts",
194
- onEvent: scheduleRebuild,
195
- }),
196
190
  createSrcWatcher(join(process.cwd(), "postcss.config.js"), {
197
191
  exts: [".js"],
198
192
  ignored: WATCH_IGNORES,
@@ -201,6 +195,21 @@ function createWatchers(rebuildWorker: DebouncedWorker): ClosableWatcher[] {
201
195
  onEvent: scheduleRebuild,
202
196
  }),
203
197
  ];
198
+
199
+ const tsRoot = join(process.cwd(), "ts");
200
+ if (caspianConfig.typescript && existsSync(tsRoot)) {
201
+ watchers.push(
202
+ createSrcWatcher(join(tsRoot, "**", "*"), {
203
+ exts: [".js", ".jsx", ".ts", ".tsx"],
204
+ ignored: WATCH_IGNORES,
205
+ awaitWriteFinish: DEFAULT_AWF,
206
+ logPrefix: "tailwind:ts",
207
+ onEvent: scheduleRebuild,
208
+ }),
209
+ );
210
+ }
211
+
212
+ return watchers;
204
213
  }
205
214
 
206
215
  async function closeWatchers(): Promise<void> {
@@ -34,7 +34,7 @@ def build_auth_settings() -> AuthSettings:
34
34
  is_role_based=False,
35
35
  role_identifier="role",
36
36
 
37
- # IMPORTANT: your current casp.auth expects PATH -> [ROLES]
37
+ # IMPORTANT: your current casp.auth expects ROUTE/PATTERN -> [ROLES]
38
38
  # Example (when enabled):
39
39
  # role_based_routes={
40
40
  # "/report": ["admin"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-caspian-app",
3
- "version": "0.2.0-beta.80",
3
+ "version": "0.2.0-beta.82",
4
4
  "description": "Scaffold a new Caspian project (FastAPI-powered reactive Python framework).",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",