@netnodeag/kraftwerk 0.59.0 → 0.60.1
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/config.d.ts +4 -1
- package/dist/config.js +20 -12
- package/inspector/dist/assets/dist-B2Z6tRw2.js +1 -0
- package/inspector/dist/assets/{dist-BnHHtLbZ.js → dist-B4W5LmFf.js} +1 -1
- package/inspector/dist/assets/{dist-B6cVTS_K.js → dist-BX9aIs8b.js} +1 -1
- package/inspector/dist/assets/{dist-BBzAW2HU.js → dist-COo4GB11.js} +1 -1
- package/inspector/dist/assets/{dist-DpJuyWEa.js → dist-CVLMD0LV.js} +1 -1
- package/inspector/dist/assets/{dist-TPY_1Vs_.js → dist-Cju0gloA.js} +1 -1
- package/inspector/dist/assets/{dist-CekyA4Pg.js → dist-D0abR-Lr.js} +1 -1
- package/inspector/dist/assets/{dist-VW8mXycb.js → dist-DU61vVvI.js} +1 -1
- package/inspector/dist/assets/{dist-CKWFJnpD.js → dist-DjOL4ZwP.js} +1 -1
- package/inspector/dist/assets/{dist-jkeLmq3a.js → dist-VCUjngUx.js} +1 -1
- package/inspector/dist/assets/{dist-D0tnMHH3.js → dist-grivBDMK.js} +1 -1
- package/inspector/dist/assets/{editor-FE4kSYK8.js → editor-dsYnSWbf.js} +3 -3
- package/inspector/dist/assets/index-Buy-k6zj.js +229 -0
- package/inspector/dist/assets/index-DtcQVqun.css +2 -0
- package/inspector/dist/index.html +2 -2
- package/package.json +1 -1
- package/inspector/dist/assets/dist-BEJnMpXA.js +0 -1
- package/inspector/dist/assets/index-BuxIYiBZ.css +0 -2
- package/inspector/dist/assets/index-YV0H4u7b.js +0 -229
package/dist/config.d.ts
CHANGED
|
@@ -275,6 +275,9 @@ export declare const isDir: (p: string) => Promise<boolean>;
|
|
|
275
275
|
/**
|
|
276
276
|
* Resolve the project for a cwd: walk up until a kraftwerk.yml or a
|
|
277
277
|
* workflows root appears; a .git directory is the fallback root, the cwd
|
|
278
|
-
* itself the last resort.
|
|
278
|
+
* itself the last resort. A bare workflows root is only a candidate: a
|
|
279
|
+
* kraftwerk.yml further up whose `workflows:` is that very folder wins, so
|
|
280
|
+
* a command run inside the workspace's own data (kraftwerk-data/projects/<slug>,
|
|
281
|
+
* next to kraftwerk-data/workflows) still finds the workspace.
|
|
279
282
|
*/
|
|
280
283
|
export declare function resolveProject(cwd: string): Promise<Project>;
|
package/dist/config.js
CHANGED
|
@@ -188,32 +188,40 @@ async function findWorkflowsDir(dir, configured) {
|
|
|
188
188
|
/**
|
|
189
189
|
* Resolve the project for a cwd: walk up until a kraftwerk.yml or a
|
|
190
190
|
* workflows root appears; a .git directory is the fallback root, the cwd
|
|
191
|
-
* itself the last resort.
|
|
191
|
+
* itself the last resort. A bare workflows root is only a candidate: a
|
|
192
|
+
* kraftwerk.yml further up whose `workflows:` is that very folder wins, so
|
|
193
|
+
* a command run inside the workspace's own data (kraftwerk-data/projects/<slug>,
|
|
194
|
+
* next to kraftwerk-data/workflows) still finds the workspace.
|
|
192
195
|
*/
|
|
193
196
|
export async function resolveProject(cwd) {
|
|
194
197
|
const start = path.resolve(cwd);
|
|
195
198
|
let gitFallback;
|
|
199
|
+
let bare;
|
|
196
200
|
for (let dir = start;; dir = path.dirname(dir)) {
|
|
197
201
|
const configPath = await findConfigFile(dir);
|
|
198
202
|
if (configPath) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
outputDir: path.resolve(dir, config.output ?? "output")
|
|
206
|
-
}
|
|
203
|
+
// Above a bare candidate an unreadable kraftwerk.yml is someone else's problem.
|
|
204
|
+
const config = bare ? await loadConfig(configPath).catch(() => null) : await loadConfig(configPath);
|
|
205
|
+
if (!config)
|
|
206
|
+
return bare;
|
|
207
|
+
const workflowsRoot = await findWorkflowsDir(dir, config.workflows);
|
|
208
|
+
if (!bare || (workflowsRoot && path.resolve(workflowsRoot) === bare.workflowsRoot)) {
|
|
209
|
+
return { root: dir, config, configPath, workflowsRoot, outputDir: path.resolve(dir, config.output ?? "output") };
|
|
210
|
+
}
|
|
211
|
+
return bare;
|
|
207
212
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
213
|
+
if (!bare) {
|
|
214
|
+
const workflowsRoot = await findWorkflowsDir(dir);
|
|
215
|
+
if (workflowsRoot)
|
|
216
|
+
bare = { root: dir, config: {}, workflowsRoot, outputDir: path.join(dir, "output") };
|
|
211
217
|
}
|
|
212
218
|
if (!gitFallback && (await exists(path.join(dir, ".git"))))
|
|
213
219
|
gitFallback = dir;
|
|
214
220
|
if (dir === path.dirname(dir))
|
|
215
221
|
break;
|
|
216
222
|
}
|
|
223
|
+
if (bare)
|
|
224
|
+
return bare;
|
|
217
225
|
const root = gitFallback ?? start;
|
|
218
226
|
return { root, config: {}, outputDir: path.join(root, "output") };
|
|
219
227
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./editor-dsYnSWbf.js";export{e as markdown};
|