@webhikers/cli 1.1.21 → 1.1.23
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/package.json +1 -1
- package/src/commands/create.js +13 -5
package/package.json
CHANGED
package/src/commands/create.js
CHANGED
|
@@ -187,11 +187,19 @@ export async function createCommand(name) {
|
|
|
187
187
|
JSON.stringify(deployConfig, null, 2) + "\n",
|
|
188
188
|
"utf-8"
|
|
189
189
|
);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
const guardPath = resolve(projectDir, ".claude-guard.json");
|
|
191
|
+
const guard = JSON.parse(readFileSync(guardPath, "utf-8"));
|
|
192
|
+
guard.fileGuard = true;
|
|
193
|
+
guard.syncGuard = true;
|
|
194
|
+
|
|
195
|
+
// Lock template packages — read from package.json at project creation time
|
|
196
|
+
const pkg = JSON.parse(readFileSync(resolve(projectDir, "package.json"), "utf-8"));
|
|
197
|
+
guard.protectedPackages = [
|
|
198
|
+
...Object.keys(pkg.dependencies || {}),
|
|
199
|
+
...Object.keys(pkg.devDependencies || {}),
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
writeFileSync(guardPath, JSON.stringify(guard, null, 2) + "\n", "utf-8");
|
|
195
203
|
run(`git add .deploy.json .claude-guard.json && git commit -m "Enable guards + deploy config" && git push`, { cwd: projectDir });
|
|
196
204
|
console.log(c.green(" ✓ .deploy.json + guards written"));
|
|
197
205
|
|