@sleekcms/sync 1.1.0 ā 1.2.2
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/dist/AGENT.md +1 -1
- package/dist/cli.js +9 -8
- package/dist/setup-site.js +3 -0
- package/dist/watcher.js +1 -0
- package/package.json +1 -1
package/dist/AGENT.md
CHANGED
|
@@ -44,7 +44,7 @@ Examples:
|
|
|
44
44
|
/pages/<key>.ejs Page templates
|
|
45
45
|
/entries/<key>.ejs Entry templates
|
|
46
46
|
/blocks/<key>.ejs Block templates
|
|
47
|
-
/layouts/<name>.ejs Layout wrappers
|
|
47
|
+
/layouts/<name>.ejs Layout wrappers (default is common.ejs)
|
|
48
48
|
|
|
49
49
|
/css/<name>.css Stylesheets (require head injection)
|
|
50
50
|
/css/tailwind.css Tailwind CSS (auto-compiled, auto-injected)
|
package/dist/cli.js
CHANGED
|
@@ -95,14 +95,14 @@ function setupKeyboardInput(handlers) {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
const EDITOR_CANDIDATES = [
|
|
99
|
+
{ name: "VS Code", cmd: "code", args: (dir) => ["-n", dir] },
|
|
100
|
+
{ name: "Cursor", cmd: "cursor", args: (dir) => ["-n", dir] },
|
|
101
|
+
];
|
|
98
102
|
function showEditorMenu(viewsDir, handlers) {
|
|
99
|
-
const editors =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
if (commandExists("cursor")) {
|
|
104
|
-
editors.push({ key: "2", name: "Cursor", cmd: "cursor" });
|
|
105
|
-
}
|
|
103
|
+
const editors = EDITOR_CANDIDATES
|
|
104
|
+
.filter(e => commandExists(e.cmd))
|
|
105
|
+
.map((e, i) => ({ ...e, key: String(i + 1) }));
|
|
106
106
|
if (editors.length === 0) {
|
|
107
107
|
console.log("\nš Watching for changes...");
|
|
108
108
|
showWatchHelp();
|
|
@@ -135,9 +135,10 @@ function showEditorMenu(viewsDir, handlers) {
|
|
|
135
135
|
const selected = editors.find(e => e.key === answer.trim());
|
|
136
136
|
if (selected) {
|
|
137
137
|
console.log(`š Watching for changes... (opened ${selected.name})`);
|
|
138
|
-
(0, child_process_1.spawn)(selected.cmd,
|
|
138
|
+
(0, child_process_1.spawn)(selected.cmd, selected.args(viewsDir), {
|
|
139
139
|
detached: true,
|
|
140
140
|
stdio: "ignore",
|
|
141
|
+
...(selected.cwd ? { cwd: selected.cwd(viewsDir) } : {}),
|
|
141
142
|
}).unref();
|
|
142
143
|
}
|
|
143
144
|
else {
|
package/dist/setup-site.js
CHANGED
|
@@ -120,6 +120,7 @@ async function syncSite(opts) {
|
|
|
120
120
|
await fs_extra_1.default.outputJson(statePath, { fileMap }, { spaces: 2 });
|
|
121
121
|
return { viewsDir, site, isFirstRun, pushed, pulled };
|
|
122
122
|
}
|
|
123
|
+
const IGNORED_FILENAMES = new Set([".DS_Store", "Thumbs.db", "desktop.ini"]);
|
|
123
124
|
async function walkFiles(viewsDir) {
|
|
124
125
|
const sourceRoot = path_1.default.join(viewsDir, "src");
|
|
125
126
|
if (!(await fs_extra_1.default.pathExists(sourceRoot)))
|
|
@@ -128,6 +129,8 @@ async function walkFiles(viewsDir) {
|
|
|
128
129
|
async function walk(dir) {
|
|
129
130
|
const entries = await fs_extra_1.default.readdir(dir, { withFileTypes: true });
|
|
130
131
|
for (const entry of entries) {
|
|
132
|
+
if (IGNORED_FILENAMES.has(entry.name))
|
|
133
|
+
continue;
|
|
131
134
|
const full = path_1.default.join(dir, entry.name);
|
|
132
135
|
if (entry.isDirectory())
|
|
133
136
|
await walk(full);
|
package/dist/watcher.js
CHANGED
|
@@ -74,6 +74,7 @@ function monitorFiles() {
|
|
|
74
74
|
watcher = chokidar_1.default.watch(watchTargets(viewsDir), {
|
|
75
75
|
persistent: true,
|
|
76
76
|
ignoreInitial: true,
|
|
77
|
+
ignored: /(^|[/\\])(\.DS_Store|Thumbs\.db|desktop\.ini)$/,
|
|
77
78
|
})
|
|
78
79
|
.on("change", () => { scheduleSync(); })
|
|
79
80
|
.on("add", () => { scheduleSync(); })
|
package/package.json
CHANGED