forgecraft 1.3.3 → 1.4.0
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.
|
@@ -134,20 +134,26 @@ public/
|
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
// src/core/adapters/django.ts
|
|
137
|
+
var isWin = process.platform === "win32";
|
|
138
|
+
var venvBin = isWin ? "venv\\Scripts" : "venv/bin";
|
|
139
|
+
var python = isWin ? "python" : "python3";
|
|
140
|
+
var venvPython = isWin ? `${venvBin}\\python` : `${venvBin}/python`;
|
|
141
|
+
var venvPip = isWin ? `${venvBin}\\pip` : `${venvBin}/pip`;
|
|
142
|
+
var venvDjangoAdmin = isWin ? `${venvBin}\\django-admin` : `${venvBin}/django-admin`;
|
|
137
143
|
var djangoAdapter = {
|
|
138
144
|
id: "django",
|
|
139
145
|
name: "Django",
|
|
140
146
|
language: "python",
|
|
141
147
|
scaffoldCommands: [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
`${python} -m venv venv`,
|
|
149
|
+
`${venvPip} install django djangorestframework django-cors-headers python-dotenv`,
|
|
150
|
+
`${venvDjangoAdmin} startproject config .`,
|
|
151
|
+
`${venvPython} manage.py startapp core`
|
|
146
152
|
],
|
|
147
|
-
buildCommand:
|
|
148
|
-
lintCommand:
|
|
149
|
-
typecheckCommand: "echo 'Type checking skipped (Python)'",
|
|
150
|
-
devCommand:
|
|
153
|
+
buildCommand: `${venvPython} manage.py check --deploy`,
|
|
154
|
+
lintCommand: `${venvPython} -m py_compile manage.py`,
|
|
155
|
+
typecheckCommand: isWin ? "echo Type checking skipped (Python)" : "echo 'Type checking skipped (Python)'",
|
|
156
|
+
devCommand: `${venvPython} manage.py runserver`,
|
|
151
157
|
devPort: 8e3,
|
|
152
158
|
designSupport: false,
|
|
153
159
|
packageManager: "pip",
|
|
@@ -167,6 +173,11 @@ FOR DJANGO:
|
|
|
167
173
|
- Register models in admin.py for Django Admin access
|
|
168
174
|
- Use django-cors-headers for API CORS configuration
|
|
169
175
|
|
|
176
|
+
PLATFORM NOTE:
|
|
177
|
+
- On Windows, use venv\\Scripts\\python instead of venv/bin/python
|
|
178
|
+
- On Unix/macOS, use venv/bin/python
|
|
179
|
+
- Detect the platform and use the correct path
|
|
180
|
+
|
|
170
181
|
SECURITY:
|
|
171
182
|
- CSRF protection enabled by default \u2014 don't disable it
|
|
172
183
|
- Use Django's built-in auth system (User model, login/logout views)
|
|
@@ -174,12 +185,12 @@ SECURITY:
|
|
|
174
185
|
- Configure ALLOWED_HOSTS properly
|
|
175
186
|
|
|
176
187
|
AFTER WRITING CODE:
|
|
177
|
-
1. Run:
|
|
178
|
-
2. Run:
|
|
179
|
-
3. Run:
|
|
188
|
+
1. Run: ${venvPython} manage.py makemigrations
|
|
189
|
+
2. Run: ${venvPython} manage.py migrate
|
|
190
|
+
3. Run: ${venvPython} manage.py check --deploy
|
|
180
191
|
4. Fix any warnings or errors before proceeding
|
|
181
192
|
|
|
182
|
-
ALWAYS generate a requirements.txt with:
|
|
193
|
+
ALWAYS generate a requirements.txt with: ${venvPip} freeze > requirements.txt
|
|
183
194
|
`.trim(),
|
|
184
195
|
designPromptAdditions: `
|
|
185
196
|
DJANGO DESIGN:
|
|
@@ -301,20 +312,32 @@ import { exec } from "child_process";
|
|
|
301
312
|
import { platform } from "os";
|
|
302
313
|
function playSound() {
|
|
303
314
|
if (!process.stdout.isTTY) return;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
try {
|
|
316
|
+
switch (platform()) {
|
|
317
|
+
case "darwin":
|
|
318
|
+
exec("afplay /System/Library/Sounds/Blow.aiff", () => {
|
|
319
|
+
});
|
|
320
|
+
break;
|
|
321
|
+
case "win32":
|
|
322
|
+
exec(
|
|
323
|
+
'powershell -NoProfile -NonInteractive -Command "[System.Media.SystemSounds]::Exclamation.Play()"',
|
|
324
|
+
{ shell: "cmd.exe" },
|
|
325
|
+
() => {
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
break;
|
|
329
|
+
case "linux":
|
|
330
|
+
exec(
|
|
331
|
+
"paplay /usr/share/sounds/freedesktop/stereo/complete.oga",
|
|
332
|
+
(err) => {
|
|
333
|
+
if (err) process.stdout.write("\x07");
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
break;
|
|
337
|
+
default:
|
|
338
|
+
process.stdout.write("\x07");
|
|
339
|
+
}
|
|
340
|
+
} catch {
|
|
318
341
|
}
|
|
319
342
|
}
|
|
320
343
|
|
|
@@ -1923,7 +1946,7 @@ var GitHubSync = class {
|
|
|
1923
1946
|
}
|
|
1924
1947
|
/** Check if `gh` CLI is installed and authenticated */
|
|
1925
1948
|
static isAvailable() {
|
|
1926
|
-
const result = spawnSync("gh", ["auth", "status"], { stdio: "ignore" });
|
|
1949
|
+
const result = spawnSync("gh", ["auth", "status"], { stdio: "ignore", shell: true });
|
|
1927
1950
|
return result.status === 0;
|
|
1928
1951
|
}
|
|
1929
1952
|
/** Create GitHub labels for forge story tracking */
|
|
@@ -1951,7 +1974,7 @@ var GitHubSync = class {
|
|
|
1951
1974
|
"--description",
|
|
1952
1975
|
label.description,
|
|
1953
1976
|
"--force"
|
|
1954
|
-
], { stdio: "ignore" });
|
|
1977
|
+
], { stdio: "ignore", shell: true });
|
|
1955
1978
|
}
|
|
1956
1979
|
}
|
|
1957
1980
|
/** Sync all stories in a plan to GitHub Issues */
|
|
@@ -1997,7 +2020,7 @@ var GitHubSync = class {
|
|
|
1997
2020
|
".[0].number",
|
|
1998
2021
|
"--state",
|
|
1999
2022
|
"all"
|
|
2000
|
-
], { encoding: "utf-8" });
|
|
2023
|
+
], { encoding: "utf-8", shell: true });
|
|
2001
2024
|
const existingNumber = searchResult.stdout?.trim();
|
|
2002
2025
|
if (existingNumber && /^\d+$/.test(existingNumber)) {
|
|
2003
2026
|
const args = [
|
|
@@ -2022,7 +2045,7 @@ var GitHubSync = class {
|
|
|
2022
2045
|
existingNumber,
|
|
2023
2046
|
"--repo",
|
|
2024
2047
|
this.repo
|
|
2025
|
-
], { stdio: "ignore" });
|
|
2048
|
+
], { stdio: "ignore", shell: true });
|
|
2026
2049
|
}
|
|
2027
2050
|
return "updated";
|
|
2028
2051
|
}
|
|
@@ -2239,7 +2262,9 @@ var AutoPipeline = class {
|
|
|
2239
2262
|
process.exit(130);
|
|
2240
2263
|
};
|
|
2241
2264
|
process.on("SIGINT", handler);
|
|
2242
|
-
process.
|
|
2265
|
+
if (process.platform !== "win32") {
|
|
2266
|
+
process.on("SIGTERM", handler);
|
|
2267
|
+
}
|
|
2243
2268
|
}
|
|
2244
2269
|
// ── Resume an interrupted sprint ──────────────────────────
|
|
2245
2270
|
async resume(existingPlan) {
|
|
@@ -3101,4 +3126,4 @@ export {
|
|
|
3101
3126
|
validateConfig,
|
|
3102
3127
|
loadAndValidateConfig
|
|
3103
3128
|
};
|
|
3104
|
-
//# sourceMappingURL=chunk-
|
|
3129
|
+
//# sourceMappingURL=chunk-NYOV5D5J.js.map
|