@polytoria-ts/pojo 1.0.1 → 1.0.3
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/index.mjs +5 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import chokidar from "chokidar";
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
|
|
8
8
|
const WATCH_DIR = "out/";
|
|
9
|
+
const INCLUDE_DIR = "include/";
|
|
9
10
|
const GAME_DIR = "game/";
|
|
10
11
|
const TREE_JSON_PATH = "default.project.json";
|
|
11
12
|
|
|
@@ -65,7 +66,6 @@ function getHierarchyForFile(filePath) {
|
|
|
65
66
|
|
|
66
67
|
segments.push(cleanFileName);
|
|
67
68
|
const fullHierarchy = [...treePath, ...segments];
|
|
68
|
-
// console.log(`${filePath} logically belongs in ${fullHierarchy} as ${baseType}`);
|
|
69
69
|
return {
|
|
70
70
|
hierarchy : fullHierarchy,
|
|
71
71
|
type : baseType,
|
|
@@ -82,7 +82,7 @@ const treeWatcher = chokidar.watch(TREE_JSON_PATH, {
|
|
|
82
82
|
stabilityThreshold: 100,
|
|
83
83
|
pollInterval: 50,
|
|
84
84
|
},
|
|
85
|
-
})
|
|
85
|
+
});
|
|
86
86
|
|
|
87
87
|
treeWatcher.on("add", (_path, _stats) => { walk(); });
|
|
88
88
|
treeWatcher.on("change", (_path, _stats) => { walk(); });
|
|
@@ -94,7 +94,7 @@ const watcher = chokidar.watch(WATCH_DIR, {
|
|
|
94
94
|
stabilityThreshold: 100,
|
|
95
95
|
pollInterval: 50,
|
|
96
96
|
},
|
|
97
|
-
});
|
|
97
|
+
}).add(INCLUDE_DIR);
|
|
98
98
|
|
|
99
99
|
let work = [];
|
|
100
100
|
|
|
@@ -104,6 +104,8 @@ function handleAdd(filePath) {
|
|
|
104
104
|
const gameScriptPath = path.join(GAME_DIR, "scripts", hierarchy.join(path.sep) + ".luau");
|
|
105
105
|
const editorScriptPath = path.join("scripts", hierarchy.join(path.sep) + ".luau");
|
|
106
106
|
console.log(`cp ${filePath} ${gameScriptPath}`)
|
|
107
|
+
|
|
108
|
+
fs.mkdirSync(path.dirname(gameScriptPath), { recursive: true });
|
|
107
109
|
fs.copyFileSync(filePath, gameScriptPath);
|
|
108
110
|
|
|
109
111
|
const existingWorkItem = work.find(workItem => workItem.hierarchy.join("/") === hierarchy.join("/"));
|