create-prisma-php-app 4.4.6-beta → 4.4.7-beta

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.
@@ -3,7 +3,7 @@ import { writeFileSync, existsSync, mkdirSync } from "fs";
3
3
  import browserSync, { BrowserSyncInstance } from "browser-sync";
4
4
  import prismaPhpConfigJson from "../prisma-php.json";
5
5
  import { generateFileListJson } from "./files-list.js";
6
- import { join, dirname } from "path";
6
+ import { join, dirname, relative } from "path";
7
7
  import { getFileMeta, PUBLIC_DIR, SRC_DIR } from "./utils.js";
8
8
  import { updateAllClassLogs } from "./class-log.js";
9
9
  import {
@@ -15,9 +15,10 @@ import { checkComponentImports } from "./component-import-checker";
15
15
  import { DebouncedWorker, createSrcWatcher, DEFAULT_AWF } from "./utils.js";
16
16
 
17
17
  const { __dirname } = getFileMeta();
18
-
19
18
  const bs: BrowserSyncInstance = browserSync.create();
20
19
 
20
+ const PUBLIC_IGNORE_DIRS = [''];
21
+
21
22
  const pipeline = new DebouncedWorker(
22
23
  async () => {
23
24
  await generateFileListJson();
@@ -68,7 +69,19 @@ createSrcWatcher(join(SRC_DIR, "**", "*"), {
68
69
  });
69
70
 
70
71
  createSrcWatcher(join(PUBLIC_DIR, "**", "*"), {
71
- onEvent: (_ev, _abs, rel) => publicPipeline.schedule(rel),
72
+ onEvent: (_ev, abs, _) => {
73
+ const relFromPublic = relative(PUBLIC_DIR, abs);
74
+ const normalized = relFromPublic.replace(/\\/g, "/");
75
+
76
+ const segments = normalized.split("/").filter(Boolean);
77
+ const firstSegment = segments[0] || "";
78
+
79
+ if (PUBLIC_IGNORE_DIRS.includes(firstSegment)) {
80
+ return;
81
+ }
82
+
83
+ publicPipeline.schedule(relFromPublic);
84
+ },
72
85
  awaitWriteFinish: DEFAULT_AWF,
73
86
  logPrefix: "watch-public",
74
87
  usePolling: true,
@@ -10,6 +10,11 @@ const entries = Object.fromEntries(
10
10
  })
11
11
  );
12
12
 
13
+ const VITE_WATCH_EXCLUDE = [
14
+ "public/js/**",
15
+ "node_modules/**",
16
+ ];
17
+
13
18
  function browserSyncNotify(): Plugin {
14
19
  const flagFile = path.resolve(__dirname, ".pp", ".vite-build-complete");
15
20
 
@@ -30,7 +35,7 @@ export default defineConfig(({ command, mode }) => ({
30
35
  sourcemap: false,
31
36
  watch:
32
37
  command === "build" && mode === "development"
33
- ? { exclude: ["public/**", "node_modules/**"] }
38
+ ? { exclude: VITE_WATCH_EXCLUDE }
34
39
  : undefined,
35
40
  rollupOptions: {
36
41
  input: entries,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "4.4.6-beta",
3
+ "version": "4.4.7-beta",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",