create-task-ops 0.1.5 → 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.
- package/README.md +2 -2
- package/bin/create-task-ops.js +21 -1
- package/package.json +1 -1
- package/templates/api/app/api/orbitops/tasks/[id]/route.ts +1 -1
- package/templates/api/app/api/orbitops/tasks/route.ts +1 -1
- package/templates/full/app/api/orbitops/tasks/[id]/route.ts +1 -1
- package/templates/full/app/api/orbitops/tasks/route.ts +1 -1
- package/templates/full/app/page.tsx +1 -1
- /package/templates/api/lib/{task-api.ts → orbitops/task-api.ts} +0 -0
- /package/templates/full/lib/{task-api.ts → orbitops/task-api.ts} +0 -0
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ npx create-task-ops add --docs-only
|
|
|
58
58
|
- `app/api/orbitops/health/route.ts`
|
|
59
59
|
- `app/api/orbitops/tasks/route.ts`
|
|
60
60
|
- `app/api/orbitops/tasks/[id]/route.ts`
|
|
61
|
-
- `lib/task-api.ts`
|
|
61
|
+
- `lib/orbitops/task-api.ts`
|
|
62
62
|
|
|
63
63
|
즉 기존 `package.json`, `app/page.tsx`, `app/layout.tsx`, `tsconfig.json` 같은 루트 파일은 건드리지 않는다.
|
|
64
64
|
|
|
@@ -69,7 +69,7 @@ npx create-task-ops add --docs-only
|
|
|
69
69
|
- `app/api/orbitops/health/route.ts`
|
|
70
70
|
- `app/api/orbitops/tasks/route.ts`
|
|
71
71
|
- `app/api/orbitops/tasks/[id]/route.ts`
|
|
72
|
-
- `lib/task-api.ts`
|
|
72
|
+
- `lib/orbitops/task-api.ts`
|
|
73
73
|
|
|
74
74
|
이 receiver 파일까지 강제로 교체하려면 `--force` 를 쓴다.
|
|
75
75
|
|
package/bin/create-task-ops.js
CHANGED
|
@@ -12,7 +12,7 @@ const addApiFiles = [
|
|
|
12
12
|
"app/api/orbitops/health/route.ts",
|
|
13
13
|
"app/api/orbitops/tasks/route.ts",
|
|
14
14
|
"app/api/orbitops/tasks/[id]/route.ts",
|
|
15
|
-
"lib/task-api.ts",
|
|
15
|
+
"lib/orbitops/task-api.ts",
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
function parseArgs(argv) {
|
|
@@ -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
|
File without changes
|
|
File without changes
|