create-task-ops 0.1.6 → 0.1.7

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.
@@ -138,6 +138,22 @@ function copySelectedFiles(sourceDir, targetDir, projectName, force, selectedFil
138
138
  }
139
139
  }
140
140
 
141
+ function assertReceiverPathsAvailable(targetDir, force, selectedFiles) {
142
+ if (force) {
143
+ return;
144
+ }
145
+
146
+ for (const relativeFile of selectedFiles) {
147
+ const targetPath = path.join(targetDir, relativeFile);
148
+ if (existsSync(targetPath)) {
149
+ console.error(`Refusing to overwrite existing receiver file: ${targetPath}`);
150
+ console.error("This path is reserved for task API integration.");
151
+ console.error("Use --force if you want to replace the existing receiver files.");
152
+ process.exit(1);
153
+ }
154
+ }
155
+ }
156
+
141
157
  function main() {
142
158
  const options = parseArgs(args);
143
159
  if (options.command === "add") {
@@ -169,6 +185,10 @@ function main() {
169
185
 
170
186
  const skipExistingDocs = options.command === "add";
171
187
 
188
+ if (options.command === "add" && options.mode === "api") {
189
+ assertReceiverPathsAvailable(targetDir, options.force, addApiFiles);
190
+ }
191
+
172
192
  copyTemplateTree(commonDir, targetDir, projectName, options.force, skipExistingDocs);
173
193
 
174
194
  if (options.command === "add" && options.mode === "api") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-task-ops",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Next.js-first task-ops scaffold generator for task docs and task APIs",
5
5
  "license": "MIT",
6
6
  "type": "module",