@camunda8/cli 4.7.0-alpha.3 → 4.7.0-alpha.31
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/CONTEXT.md +11 -0
- package/PLUGIN-HELP.md +1 -1
- package/README.md +9 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +48 -9
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/helpers/deploy-helpers.d.ts +96 -2
- package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
- package/dist/commands/helpers/deploy-helpers.js +213 -70
- package/dist/commands/helpers/deploy-helpers.js.map +1 -1
- package/dist/commands/mcp-proxy.d.ts.map +1 -1
- package/dist/commands/mcp-proxy.js +13 -8
- package/dist/commands/mcp-proxy.js.map +1 -1
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +13 -7
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +1 -8
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +309 -16
- package/dist/commands/watch.js.map +1 -1
- package/dist/core/client.d.ts +13 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +48 -21
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.d.ts +34 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +91 -9
- package/dist/core/config.js.map +1 -1
- package/dist/core/env-address.d.ts +22 -0
- package/dist/core/env-address.d.ts.map +1 -0
- package/dist/core/env-address.js +30 -0
- package/dist/core/env-address.js.map +1 -0
- package/dist/core/errors.d.ts +17 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +32 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -1
- package/dist/core/logger.js.map +1 -1
- package/dist/core/node-version.d.ts +18 -0
- package/dist/core/node-version.d.ts.map +1 -0
- package/dist/core/node-version.js +38 -0
- package/dist/core/node-version.js.map +1 -0
- package/dist/default-plugins/cluster/README.md +1 -1
- package/dist/default-plugins/cluster/c8ctl-plugin.js +289 -36
- package/dist/default-plugins/element-template/c8ctl-plugin.js +248 -7
- package/dist/default-plugins/mcp/README.md +37 -0
- package/dist/default-plugins/mcp/c8ctl-plugin.js +4973 -0
- package/dist/default-plugins/mcp/package.json +8 -0
- package/dist/default-plugins/modeler/README.md +23 -0
- package/dist/default-plugins/modeler/c8ctl-plugin.js +4314 -0
- package/dist/default-plugins/modeler/package.json +8 -0
- package/dist/default-plugins/setup/README.md +43 -0
- package/dist/default-plugins/setup/c8ctl-plugin.js +6910 -0
- package/dist/default-plugins/setup/package.json +8 -0
- package/dist/default-plugins/skills/README.md +35 -0
- package/dist/default-plugins/skills/c8ctl-plugin.js +3352 -0
- package/dist/default-plugins/skills/package.json +8 -0
- package/dist/framework/argv-parser.d.ts +14 -0
- package/dist/framework/argv-parser.d.ts.map +1 -1
- package/dist/framework/argv-parser.js +25 -0
- package/dist/framework/argv-parser.js.map +1 -1
- package/dist/framework/command-registry.d.ts +26 -0
- package/dist/framework/command-registry.d.ts.map +1 -1
- package/dist/framework/command-registry.js +45 -0
- package/dist/framework/command-registry.js.map +1 -1
- package/dist/framework/plugins/plugin-loader.d.ts +20 -2
- package/dist/framework/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/framework/plugins/plugin-loader.js.map +1 -1
- package/dist/framework/ui/help.d.ts.map +1 -1
- package/dist/framework/ui/help.js +57 -14
- package/dist/framework/ui/help.js.map +1 -1
- package/dist/framework/ui/prompt.d.ts +88 -0
- package/dist/framework/ui/prompt.d.ts.map +1 -1
- package/dist/framework/ui/prompt.js +344 -0
- package/dist/framework/ui/prompt.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -12
- package/dist/index.js.map +1 -1
- package/dist/utils/command-local/mcp-install-helpers.d.ts +68 -0
- package/dist/utils/command-local/mcp-install-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/mcp-install-helpers.js +485 -0
- package/dist/utils/command-local/mcp-install-helpers.js.map +1 -0
- package/dist/utils/command-local/process-instance-helpers.d.ts +6 -0
- package/dist/utils/command-local/process-instance-helpers.d.ts.map +1 -1
- package/dist/utils/command-local/process-instance-helpers.js +9 -0
- package/dist/utils/command-local/process-instance-helpers.js.map +1 -1
- package/dist/utils/command-local/skills-install-helpers.d.ts +45 -0
- package/dist/utils/command-local/skills-install-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/skills-install-helpers.js +423 -0
- package/dist/utils/command-local/skills-install-helpers.js.map +1 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/shared/camunda-json.d.ts +24 -3
- package/dist/utils/shared/camunda-json.d.ts.map +1 -1
- package/dist/utils/shared/camunda-json.js +23 -5
- package/dist/utils/shared/camunda-json.js.map +1 -1
- package/dist/utils/shared/deploy-resource-selection.d.ts +165 -0
- package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -0
- package/dist/utils/shared/deploy-resource-selection.js +466 -0
- package/dist/utils/shared/deploy-resource-selection.js.map +1 -0
- package/dist/utils/shared/ignore.d.ts +26 -0
- package/dist/utils/shared/ignore.d.ts.map +1 -1
- package/dist/utils/shared/ignore.js +6 -2
- package/dist/utils/shared/ignore.js.map +1 -1
- package/package.json +3 -2
- package/dist/utils/command-local/setup-prerequisites.d.ts +0 -67
- package/dist/utils/command-local/setup-prerequisites.d.ts.map +0 -1
- package/dist/utils/command-local/setup-prerequisites.js +0 -238
- package/dist/utils/command-local/setup-prerequisites.js.map +0 -1
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `deployResources` — descriptor-based selection of a project's resources.
|
|
3
|
+
*
|
|
4
|
+
* The optional top-level `deployResources` array in `camunda.json` selects
|
|
5
|
+
* which project files are deployed (and watched with `watch --project`).
|
|
6
|
+
*
|
|
7
|
+
* Patterns use the same engine and syntax as `.c8ignore` (`parsePattern`
|
|
8
|
+
* from `ignore.ts`, evaluated with `node:path#matchesGlob` relative to the
|
|
9
|
+
* project root with `/` separators), with two deliberate differences:
|
|
10
|
+
*
|
|
11
|
+
* - **Inverted polarity.** Selection starts empty; a positive pattern
|
|
12
|
+
* selects, a `!` pattern deselects, and the last matching pattern wins
|
|
13
|
+
* per file.
|
|
14
|
+
* - **Direct descendant selection.** There is no gitignore "excluded
|
|
15
|
+
* parent" rule: a later positive pattern restores a file below an
|
|
16
|
+
* earlier excluded directory. The directory walk therefore never prunes
|
|
17
|
+
* a directory because a negative pattern matched it — it only skips a
|
|
18
|
+
* directory when no positive pattern can match anything below it.
|
|
19
|
+
*
|
|
20
|
+
* Defaults: `node_modules/`, `target/`, `.git/` and the project-root
|
|
21
|
+
* `camunda.json` are evaluated as implicit leading `!` patterns, so any
|
|
22
|
+
* later positive pattern that matches a file inside them overrides them.
|
|
23
|
+
*
|
|
24
|
+
* Hidden files: the engine's wildcards (`*`, `?`, `**`, `[...]`) never
|
|
25
|
+
* match a path segment that starts with `.`. A pattern selects a
|
|
26
|
+
* dot-prefixed file — or anything inside a dot-prefixed directory — only
|
|
27
|
+
* when it names that segment explicitly (e.g. `resources/.prompt.md`,
|
|
28
|
+
* `.config/**`). The walker still descends into hidden directories so
|
|
29
|
+
* such explicit patterns can reach them.
|
|
30
|
+
*/
|
|
31
|
+
import { lstatSync, readdirSync, readFileSync, realpathSync, statSync, } from "node:fs";
|
|
32
|
+
import { join, matchesGlob } from "node:path";
|
|
33
|
+
import { isRecord, normalizeToError } from "../../core/index.js";
|
|
34
|
+
import { CAMUNDA_PROJECT_FILE, DeployResourcesError, decodeCamundaJson, parseCamundaJson, } from "./camunda-json.js";
|
|
35
|
+
import { matchesParsedPattern, parsePattern, } from "./ignore.js";
|
|
36
|
+
/** Name of the descriptor field. */
|
|
37
|
+
export const DEPLOY_RESOURCES_FIELD = "deployResources";
|
|
38
|
+
/**
|
|
39
|
+
* Default exclusions, applied as implicit leading negations before the
|
|
40
|
+
* user's patterns. The root descriptor is anchored; the directories match
|
|
41
|
+
* at any depth (same as the `.c8ignore` defaults).
|
|
42
|
+
*/
|
|
43
|
+
export const DEPLOY_RESOURCES_DEFAULT_EXCLUSIONS = [
|
|
44
|
+
"node_modules/",
|
|
45
|
+
"target/",
|
|
46
|
+
".git/",
|
|
47
|
+
"/camunda.json",
|
|
48
|
+
];
|
|
49
|
+
/** Describe why a single pattern is invalid, or `null` when it is valid. */
|
|
50
|
+
function patternProblem(pattern) {
|
|
51
|
+
// Validate what the matcher sees: `parsePattern` trims trailing
|
|
52
|
+
// whitespace, so `resources/.. ` must be checked as `resources/..`.
|
|
53
|
+
const trimmed = pattern.trimEnd();
|
|
54
|
+
const body = trimmed.startsWith("!") ? trimmed.slice(1) : trimmed;
|
|
55
|
+
if (body.trim() === "") {
|
|
56
|
+
return "patterns must not be empty";
|
|
57
|
+
}
|
|
58
|
+
if (trimmed.startsWith("#")) {
|
|
59
|
+
return "comments are not supported in deployResources";
|
|
60
|
+
}
|
|
61
|
+
// A single leading `/` is the gitignore root anchor (same as .c8ignore),
|
|
62
|
+
// not an absolute path. Absolute paths that cannot be anchors are
|
|
63
|
+
// invalid: a Windows drive letter, a UNC root (`//server`, `\\server`)
|
|
64
|
+
// or any leading backslash.
|
|
65
|
+
if (/^[A-Za-z]:/.test(body) ||
|
|
66
|
+
body.startsWith("//") ||
|
|
67
|
+
body.startsWith("\\")) {
|
|
68
|
+
return "patterns are relative to the project root; drive-letter, UNC and backslash-rooted paths are not allowed (a leading / anchors the pattern to the project root)";
|
|
69
|
+
}
|
|
70
|
+
if (body.split(/[/\\]/).includes("..")) {
|
|
71
|
+
return "patterns must stay inside the project; '..' is not allowed";
|
|
72
|
+
}
|
|
73
|
+
if (parsePattern(pattern) === null) {
|
|
74
|
+
return "pattern does not select anything";
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Validate the raw `deployResources` value read from `camunda.json`.
|
|
80
|
+
*
|
|
81
|
+
* @param value - The raw field value (`CamundaProject.deployResources`).
|
|
82
|
+
* @param source - Descriptor path used in error messages.
|
|
83
|
+
* @returns The validated pattern list (possibly empty).
|
|
84
|
+
* @throws {DeployResourcesError} `invalid-config` when the value is not an
|
|
85
|
+
* array of valid pattern strings.
|
|
86
|
+
*/
|
|
87
|
+
export function parseDeployResources(value, source = "camunda.json") {
|
|
88
|
+
if (!Array.isArray(value)) {
|
|
89
|
+
throw new DeployResourcesError("invalid-config", `Invalid "${DEPLOY_RESOURCES_FIELD}" in ${source}: expected an array of glob strings, ` +
|
|
90
|
+
`got ${value === null ? "null" : typeof value}. ` +
|
|
91
|
+
`Example: "${DEPLOY_RESOURCES_FIELD}": ["resources/**"]`);
|
|
92
|
+
}
|
|
93
|
+
return value.map((entry, index) => {
|
|
94
|
+
if (typeof entry !== "string") {
|
|
95
|
+
throw new DeployResourcesError("invalid-config", `Invalid "${DEPLOY_RESOURCES_FIELD}" in ${source}: entry ${index} must be a string, ` +
|
|
96
|
+
`got ${entry === null ? "null" : typeof entry}`);
|
|
97
|
+
}
|
|
98
|
+
const problem = patternProblem(entry);
|
|
99
|
+
if (problem) {
|
|
100
|
+
throw new DeployResourcesError("invalid-config", `Invalid "${DEPLOY_RESOURCES_FIELD}" pattern ${JSON.stringify(entry)} in ${source}: ${problem}`);
|
|
101
|
+
}
|
|
102
|
+
return entry;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Strictly read the `camunda.json` descriptor of a directory that is being
|
|
107
|
+
* resolved for deployment or watching.
|
|
108
|
+
*
|
|
109
|
+
* Unlike `readCamundaProject` (lenient marker detection), a descriptor
|
|
110
|
+
* that exists but cannot be read — a directory named `camunda.json`, no
|
|
111
|
+
* permission, an I/O error — is an `invalid-config` error. Degrading to
|
|
112
|
+
* "no descriptor" would silently fall back to the default scan and
|
|
113
|
+
* bypass a `deployResources` allowlist.
|
|
114
|
+
*
|
|
115
|
+
* @returns The parsed descriptor, or `null` only when no `camunda.json`
|
|
116
|
+
* exists.
|
|
117
|
+
* @throws {DeployResourcesError} `invalid-config` when the file exists but
|
|
118
|
+
* cannot be read.
|
|
119
|
+
* @throws {DeployResourcesError} `invalid-config` when `camunda.json` is
|
|
120
|
+
* not valid JSON or not a JSON object.
|
|
121
|
+
*/
|
|
122
|
+
export function readProjectDescriptor(dirPath) {
|
|
123
|
+
const file = join(dirPath, CAMUNDA_PROJECT_FILE);
|
|
124
|
+
let buffer;
|
|
125
|
+
try {
|
|
126
|
+
buffer = readFileSync(file);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
const code = isRecord(error) ? error.code : undefined;
|
|
130
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
131
|
+
// No entry at all: not a project. An entry that exists but can't
|
|
132
|
+
// be followed (a dangling symlink) is a broken descriptor.
|
|
133
|
+
let dangling = false;
|
|
134
|
+
try {
|
|
135
|
+
dangling = lstatSync(file).isSymbolicLink();
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// Genuinely absent.
|
|
139
|
+
}
|
|
140
|
+
if (!dangling)
|
|
141
|
+
return null;
|
|
142
|
+
throw new DeployResourcesError("invalid-config", `Failed to read ${file}: it is a dangling symlink (its target does not exist)`);
|
|
143
|
+
}
|
|
144
|
+
throw new DeployResourcesError("invalid-config", `Failed to read ${file}: ${normalizeToError(error).message}`);
|
|
145
|
+
}
|
|
146
|
+
return parseCamundaJson(decodeCamundaJson(buffer), file);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Read a project's `deployResources` state, distinguishing a missing
|
|
150
|
+
* descriptor from a descriptor without the field.
|
|
151
|
+
*
|
|
152
|
+
* @throws {DeployResourcesError} `invalid-config` when the descriptor
|
|
153
|
+
* cannot be read or the field is invalid.
|
|
154
|
+
* @throws {DeployResourcesError} `invalid-config` when `camunda.json` is
|
|
155
|
+
* not valid JSON or not a JSON object.
|
|
156
|
+
*/
|
|
157
|
+
export function readDeployResourcesState(projectRoot) {
|
|
158
|
+
return deployResourcesStateOf(readProjectDescriptor(projectRoot), projectRoot);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The `deployResources` state of an already-read descriptor (`null` when
|
|
162
|
+
* there is none), so a caller can decide from a single read.
|
|
163
|
+
*
|
|
164
|
+
* @throws {DeployResourcesError} `invalid-config` when the field is invalid.
|
|
165
|
+
*/
|
|
166
|
+
export function deployResourcesStateOf(project, projectRoot) {
|
|
167
|
+
if (!project)
|
|
168
|
+
return { kind: "no-descriptor" };
|
|
169
|
+
if (!Object.hasOwn(project, DEPLOY_RESOURCES_FIELD)) {
|
|
170
|
+
return { kind: "no-field" };
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
kind: "patterns",
|
|
174
|
+
patterns: parseDeployResources(project.deployResources, join(projectRoot, CAMUNDA_PROJECT_FILE)),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Read the validated `deployResources` patterns of the project rooted at
|
|
179
|
+
* `projectRoot`.
|
|
180
|
+
*
|
|
181
|
+
* @returns The patterns, or `null` when there is no descriptor or the
|
|
182
|
+
* descriptor has no `deployResources` key (default scan applies).
|
|
183
|
+
* @throws {DeployResourcesError} `invalid-config` when `camunda.json` is
|
|
184
|
+
* not valid JSON or not a JSON object.
|
|
185
|
+
* @throws {DeployResourcesError} `invalid-config` when the descriptor
|
|
186
|
+
* cannot be read or the field is invalid.
|
|
187
|
+
*/
|
|
188
|
+
export function readDeployResources(projectRoot) {
|
|
189
|
+
const state = readDeployResourcesState(projectRoot);
|
|
190
|
+
return state.kind === "patterns" ? state.patterns : null;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Whether glob `segments` could match some path strictly below the
|
|
194
|
+
* directory `dirSegments`. Mirrors the engine's segment semantics: `**`
|
|
195
|
+
* spans zero or more segments but never a dot-prefixed one.
|
|
196
|
+
*/
|
|
197
|
+
function globCouldMatchBelow(dirSegments, globSegments) {
|
|
198
|
+
const step = (d, g) => {
|
|
199
|
+
if (d === dirSegments.length)
|
|
200
|
+
return g < globSegments.length;
|
|
201
|
+
if (g === globSegments.length)
|
|
202
|
+
return false;
|
|
203
|
+
const seg = globSegments[g];
|
|
204
|
+
if (seg === "**") {
|
|
205
|
+
return (step(d, g + 1) || (!dirSegments[d].startsWith(".") && step(d + 1, g)));
|
|
206
|
+
}
|
|
207
|
+
return matchesGlob(dirSegments[d], seg) && step(d + 1, g + 1);
|
|
208
|
+
};
|
|
209
|
+
return step(0, 0);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Expand comma brace groups (`{a,b}`, nesting allowed) into alternative
|
|
213
|
+
* globs. Braces without a top-level comma (`{1..3}`, a literal `{x}`) are
|
|
214
|
+
* left to the matcher.
|
|
215
|
+
*/
|
|
216
|
+
function expandBraces(glob) {
|
|
217
|
+
let depth = 0;
|
|
218
|
+
let start = -1;
|
|
219
|
+
for (let i = 0; i < glob.length; i++) {
|
|
220
|
+
const ch = glob[i];
|
|
221
|
+
if (ch === "\\") {
|
|
222
|
+
i++;
|
|
223
|
+
}
|
|
224
|
+
else if (ch === "{") {
|
|
225
|
+
if (depth === 0)
|
|
226
|
+
start = i;
|
|
227
|
+
depth++;
|
|
228
|
+
}
|
|
229
|
+
else if (ch === "}" && depth > 0) {
|
|
230
|
+
depth--;
|
|
231
|
+
if (depth === 0) {
|
|
232
|
+
const options = splitTopLevel(glob.slice(start + 1, i));
|
|
233
|
+
if (options.length > 1) {
|
|
234
|
+
const prefix = glob.slice(0, start);
|
|
235
|
+
const suffix = glob.slice(i + 1);
|
|
236
|
+
return options.flatMap((option) => expandBraces(`${prefix}${option}${suffix}`));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return [glob];
|
|
242
|
+
}
|
|
243
|
+
/** Split a brace body on its top-level commas. */
|
|
244
|
+
function splitTopLevel(body) {
|
|
245
|
+
const parts = [];
|
|
246
|
+
let depth = 0;
|
|
247
|
+
let current = "";
|
|
248
|
+
for (let i = 0; i < body.length; i++) {
|
|
249
|
+
const ch = body[i];
|
|
250
|
+
if (ch === "\\") {
|
|
251
|
+
current += ch + (body[i + 1] ?? "");
|
|
252
|
+
i++;
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
if (ch === "{" || ch === "(")
|
|
256
|
+
depth++;
|
|
257
|
+
if ((ch === "}" || ch === ")") && depth > 0)
|
|
258
|
+
depth--;
|
|
259
|
+
if (ch === "," && depth === 0) {
|
|
260
|
+
parts.push(current);
|
|
261
|
+
current = "";
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
current += ch;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
parts.push(current);
|
|
268
|
+
return parts;
|
|
269
|
+
}
|
|
270
|
+
/** Whether some `/`-separated segment has an unbalanced group. */
|
|
271
|
+
function hasSplitGroup(glob) {
|
|
272
|
+
return glob.split("/").some((segment) => {
|
|
273
|
+
let depth = 0;
|
|
274
|
+
for (const ch of segment) {
|
|
275
|
+
if (ch === "(" || ch === "{")
|
|
276
|
+
depth++;
|
|
277
|
+
else if (ch === ")" || ch === "}")
|
|
278
|
+
depth--;
|
|
279
|
+
}
|
|
280
|
+
return depth !== 0;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Whether a brace-expanded glob could match a path strictly below the
|
|
285
|
+
* folder `dirSegments`.
|
|
286
|
+
*/
|
|
287
|
+
function globReachesBelow(dirSegments, glob) {
|
|
288
|
+
return (
|
|
289
|
+
// A group that still spans a `/` (an extglob such as `@(a/b|c)`)
|
|
290
|
+
// can't be checked segment by segment: assume it can reach.
|
|
291
|
+
hasSplitGroup(glob) ||
|
|
292
|
+
// Empty (`a//b`) and `.` (`a/./b`) segments are dropped, as the
|
|
293
|
+
// native matcher collapses them. Dropping more than the matcher
|
|
294
|
+
// does only makes the answer more conservative.
|
|
295
|
+
globCouldMatchBelow(dirSegments, glob.split("/").filter((seg) => seg !== "" && seg !== ".")));
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Compile validated `deployResources` patterns into a selector.
|
|
299
|
+
* Call {@link parseDeployResources} first to validate raw input.
|
|
300
|
+
*/
|
|
301
|
+
export function compileDeployResources(patterns) {
|
|
302
|
+
const defaults = DEPLOY_RESOURCES_DEFAULT_EXCLUSIONS.map((p) => parsePattern(`!${p}`)).filter((p) => p !== null);
|
|
303
|
+
const user = patterns
|
|
304
|
+
.map(parsePattern)
|
|
305
|
+
.filter((p) => p !== null);
|
|
306
|
+
const ordered = [...defaults, ...user];
|
|
307
|
+
// Brace groups are expanded so reachability is checked per alternative.
|
|
308
|
+
const positiveAlternatives = user
|
|
309
|
+
.filter((p) => !p.negate)
|
|
310
|
+
.flatMap((p) => p.globs)
|
|
311
|
+
.flatMap(expandBraces);
|
|
312
|
+
return {
|
|
313
|
+
patterns: [...patterns],
|
|
314
|
+
excludesFolder: (relDir) => {
|
|
315
|
+
// In pattern order: a `!` pattern matching the folder excludes it;
|
|
316
|
+
// a later positive pattern that matches the folder or can reach
|
|
317
|
+
// below it cancels that, since it may select files inside.
|
|
318
|
+
const dirSegments = relDir.split("/").filter(Boolean);
|
|
319
|
+
return ordered.reduce((excluded, p) => {
|
|
320
|
+
if (p.negate) {
|
|
321
|
+
return matchesParsedPattern(`${relDir}/`, p) ? true : excluded;
|
|
322
|
+
}
|
|
323
|
+
const reaches = matchesParsedPattern(`${relDir}/`, p) ||
|
|
324
|
+
p.globs
|
|
325
|
+
.flatMap(expandBraces)
|
|
326
|
+
.some((glob) => globReachesBelow(dirSegments, glob));
|
|
327
|
+
return reaches ? false : excluded;
|
|
328
|
+
}, false);
|
|
329
|
+
},
|
|
330
|
+
selects: (relPath) => ordered.reduce((selected, p) => matchesParsedPattern(relPath, p) ? !p.negate : selected, false),
|
|
331
|
+
couldSelectUnder: (relDir) => {
|
|
332
|
+
const dirSegments = relDir.split("/").filter(Boolean);
|
|
333
|
+
return positiveAlternatives.some((glob) => globReachesBelow(dirSegments, glob));
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Walk `projectRoot` and return the project-relative (`/`-separated)
|
|
339
|
+
* paths of every file the selector selects, sorted.
|
|
340
|
+
*
|
|
341
|
+
* - Symlinks are followed (same as the default deploy discovery). A
|
|
342
|
+
* directory reachable under several project-relative paths (a symlink
|
|
343
|
+
* alias and its real path) is walked under each of them, because
|
|
344
|
+
* patterns are evaluated against the project-relative path. Cycles are
|
|
345
|
+
* cut by skipping a directory whose real path is already on the
|
|
346
|
+
* current descent (an active ancestor). Files that resolve to the same
|
|
347
|
+
* real path are kept once (first path in sorted order wins).
|
|
348
|
+
* - Hidden files and directories are not skipped by the walker — the
|
|
349
|
+
* pattern engine decides (see module docs).
|
|
350
|
+
* - Nested `camunda.json` folders are ordinary folders here: nested
|
|
351
|
+
* projects are unsupported and are not excluded from the selection.
|
|
352
|
+
*/
|
|
353
|
+
export function selectProjectFiles(projectRoot, selector) {
|
|
354
|
+
const selected = [];
|
|
355
|
+
// Real paths of the directories on the current descent.
|
|
356
|
+
const activeAncestors = new Set();
|
|
357
|
+
const visit = (dirAbs, relDir) => {
|
|
358
|
+
let real;
|
|
359
|
+
let entries;
|
|
360
|
+
try {
|
|
361
|
+
real = realpathSync(dirAbs);
|
|
362
|
+
entries = readdirSync(dirAbs).sort();
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
// A folder the user excluded explicitly (`!folder/`) is skipped
|
|
366
|
+
// even if a broad pattern could reach into it.
|
|
367
|
+
if (relDir !== "" && selector.excludesFolder(relDir))
|
|
368
|
+
return;
|
|
369
|
+
throw unreadablePath(dirAbs, error, relDir);
|
|
370
|
+
}
|
|
371
|
+
if (activeAncestors.has(real))
|
|
372
|
+
return;
|
|
373
|
+
activeAncestors.add(real);
|
|
374
|
+
for (const entry of entries) {
|
|
375
|
+
const abs = join(dirAbs, entry);
|
|
376
|
+
const rel = relDir ? `${relDir}/${entry}` : entry;
|
|
377
|
+
let stat;
|
|
378
|
+
try {
|
|
379
|
+
stat = statSync(abs);
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
// An entry no pattern can select (as a file or as a folder) is
|
|
383
|
+
// irrelevant. One a pattern can select must never be skipped
|
|
384
|
+
// silently: the deployment would succeed without it.
|
|
385
|
+
// The root camunda.json is the descriptor, already read for
|
|
386
|
+
// this run: it only matters if a pattern selects it as a file
|
|
387
|
+
// (it may be mid-replacement, e.g. briefly a dangling link).
|
|
388
|
+
const isDescriptor = relDir === "" && entry === CAMUNDA_PROJECT_FILE;
|
|
389
|
+
if (!selector.selects(rel) &&
|
|
390
|
+
(isDescriptor ||
|
|
391
|
+
!selector.couldSelectUnder(rel) ||
|
|
392
|
+
selector.excludesFolder(rel))) {
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
throw unreadablePath(abs, error, rel);
|
|
396
|
+
}
|
|
397
|
+
if (stat.isDirectory()) {
|
|
398
|
+
if (selector.couldSelectUnder(rel))
|
|
399
|
+
visit(abs, rel);
|
|
400
|
+
}
|
|
401
|
+
else if (stat.isFile() && selector.selects(rel)) {
|
|
402
|
+
selected.push(rel);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
activeAncestors.delete(real);
|
|
406
|
+
};
|
|
407
|
+
visit(projectRoot, "");
|
|
408
|
+
const seenReal = new Set();
|
|
409
|
+
return selected.sort().filter((rel) => {
|
|
410
|
+
let key = rel;
|
|
411
|
+
try {
|
|
412
|
+
key = realpathSync(join(projectRoot, rel));
|
|
413
|
+
}
|
|
414
|
+
catch {
|
|
415
|
+
// Best effort: fall back to the relative path.
|
|
416
|
+
}
|
|
417
|
+
if (seenReal.has(key))
|
|
418
|
+
return false;
|
|
419
|
+
seenReal.add(key);
|
|
420
|
+
return true;
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* The `read-error` raised when a path a `deployResources` pattern can
|
|
425
|
+
* select cannot be read. Names the path and, for a dangling symlink,
|
|
426
|
+
* says so.
|
|
427
|
+
*/
|
|
428
|
+
export function unreadablePath(path, error,
|
|
429
|
+
/** Project-relative path, used to suggest an exclusion pattern. */
|
|
430
|
+
rel) {
|
|
431
|
+
const code = isRecord(error) ? error.code : undefined;
|
|
432
|
+
let reason = normalizeToError(error).message;
|
|
433
|
+
if (code === "ENOENT") {
|
|
434
|
+
let dangling = false;
|
|
435
|
+
try {
|
|
436
|
+
dangling = lstatSync(path).isSymbolicLink();
|
|
437
|
+
}
|
|
438
|
+
catch {
|
|
439
|
+
// The path itself is gone (removed while deploying).
|
|
440
|
+
}
|
|
441
|
+
reason = dangling
|
|
442
|
+
? "it is a dangling symlink (its target does not exist)"
|
|
443
|
+
: "it was removed while the selection was being read";
|
|
444
|
+
}
|
|
445
|
+
return new DeployResourcesError("read-error", `Cannot read ${path}, which a "${DEPLOY_RESOURCES_FIELD}" pattern can select: ${reason}. ` +
|
|
446
|
+
"Nothing was deployed. Fix the file permissions or the path, or exclude it " +
|
|
447
|
+
(rel
|
|
448
|
+
? `with a ! pattern placed after the patterns that reach it, such as "!${rel}/" for a folder or "!${rel}" for a file.`
|
|
449
|
+
: "with a ! pattern."));
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Resolve the deployed resource set of a project from its validated
|
|
453
|
+
* `deployResources` patterns.
|
|
454
|
+
*
|
|
455
|
+
* @throws {DeployResourcesError} `empty-selection` when nothing is
|
|
456
|
+
* selected (an unmatched pattern alone is silently ignored).
|
|
457
|
+
*/
|
|
458
|
+
export function resolveDeployResources(projectRoot, patterns) {
|
|
459
|
+
const files = selectProjectFiles(projectRoot, compileDeployResources(patterns));
|
|
460
|
+
if (files.length === 0) {
|
|
461
|
+
throw new DeployResourcesError("empty-selection", `No deployable files found: "${DEPLOY_RESOURCES_FIELD}" in ${join(projectRoot, CAMUNDA_PROJECT_FILE)} ` +
|
|
462
|
+
"selects no files. Adjust the patterns so they match at least one project file.");
|
|
463
|
+
}
|
|
464
|
+
return files;
|
|
465
|
+
}
|
|
466
|
+
//# sourceMappingURL=deploy-resource-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-resource-selection.js","sourceRoot":"","sources":["../../../src/utils/shared/deploy-resource-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACN,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,QAAQ,GACR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACN,oBAAoB,EAEpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,oBAAoB,EAEpB,YAAY,GACZ,MAAM,aAAa,CAAC;AAErB,oCAAoC;AACpC,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAsB;IACrE,eAAe;IACf,SAAS;IACT,OAAO;IACP,eAAe;CACf,CAAC;AAEF,4EAA4E;AAC5E,SAAS,cAAc,CAAC,OAAe;IACtC,gEAAgE;IAChE,oEAAoE;IACpE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,OAAO,CAAC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D,IAAI,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;IAC7C,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvB,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC;YACJ,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;QAC7C,CAAC;QAAC,MAAM,CAAC;YACR,qDAAqD;QACtD,CAAC;QACD,MAAM,GAAG,QAAQ;YAChB,CAAC,CAAC,sDAAsD;YACxD,CAAC,CAAC,mDAAmD,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,oBAAoB,CAC9B,YAAY,EACZ,eAAe,IAAI,cAAc,sBAAsB,yBAAyB,MAAM,IAAI;QACzF,4EAA4E;QAC5E,CAAC,GAAG;YACH,CAAC,CAAC,uEAAuE,GAAG,wBAAwB,GAAG,eAAe;YACtH,CAAC,CAAC,mBAAmB,CAAC,CACxB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACrC,WAAmB,EACnB,QAA2B;IAE3B,MAAM,KAAK,GAAG,kBAAkB,CAC/B,WAAW,EACX,sBAAsB,CAAC,QAAQ,CAAC,CAChC,CAAC;IACF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,oBAAoB,CAC7B,iBAAiB,EACjB,+BAA+B,sBAAsB,QAAQ,IAAI,CAAC,WAAW,EAAE,oBAAoB,CAAC,GAAG;YACtG,gFAAgF,CACjF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -17,6 +17,32 @@
|
|
|
17
17
|
export interface Ignore {
|
|
18
18
|
ignores(path: string): boolean;
|
|
19
19
|
}
|
|
20
|
+
/** A single gitignore-style line compiled into `path.matchesGlob` globs. */
|
|
21
|
+
export interface ParsedPattern {
|
|
22
|
+
negate: boolean;
|
|
23
|
+
globs: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Translate a single gitignore-style line into one or more glob patterns
|
|
27
|
+
* suitable for `path.matchesGlob`.
|
|
28
|
+
*
|
|
29
|
+
* Rules applied (subset of gitignore spec). These mirror the behaviour of the
|
|
30
|
+
* `ignore` npm package — see the `c8ignore-parity` regression guard:
|
|
31
|
+
* - Lines starting with `#` and blank lines are skipped.
|
|
32
|
+
* - A leading `!` negates the pattern.
|
|
33
|
+
* - A trailing `/` restricts matching to directories: the pattern matches the
|
|
34
|
+
* directory entry (a path queried *with* a trailing slash, e.g. `build/`)
|
|
35
|
+
* and its contents, but NOT a bare path of the same name (`build`), which
|
|
36
|
+
* gitignore would treat as a file. The directory walker queries directory
|
|
37
|
+
* entries with a trailing slash, so traversal pruning still works.
|
|
38
|
+
* - A trailing `/**` (e.g. `foo/**`) matches everything *inside* the directory
|
|
39
|
+
* but not the directory entry itself.
|
|
40
|
+
* - A leading `/` or an embedded `/` anchors the pattern to the base dir.
|
|
41
|
+
* - Otherwise the pattern matches at any depth.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parsePattern(raw: string): ParsedPattern | null;
|
|
44
|
+
/** Whether a project-relative, `/`-separated path matches a parsed pattern. */
|
|
45
|
+
export declare function matchesParsedPattern(path: string, { globs }: ParsedPattern): boolean;
|
|
20
46
|
/**
|
|
21
47
|
* Load ignore rules from the `.c8ignore` file in `baseDir` (if present)
|
|
22
48
|
* merged with built-in default patterns.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/ignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,sDAAsD;AACtD,MAAM,WAAW,MAAM;IACtB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/ignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,sDAAsD;AACtD,MAAM,WAAW,MAAM;IACtB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA8C9D;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,EAAE,KAAK,EAAE,EAAE,aAAa,GACtB,OAAO,CAET;AA0CD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcvD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACxB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,OAAO,CAcT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAwC5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBpE"}
|
|
@@ -35,7 +35,7 @@ const C8IGNORE_FILENAME = ".c8ignore";
|
|
|
35
35
|
* - A leading `/` or an embedded `/` anchors the pattern to the base dir.
|
|
36
36
|
* - Otherwise the pattern matches at any depth.
|
|
37
37
|
*/
|
|
38
|
-
function parsePattern(raw) {
|
|
38
|
+
export function parsePattern(raw) {
|
|
39
39
|
// Trim trailing whitespace. The full gitignore spec allows a trailing `\ `
|
|
40
40
|
// to preserve spaces, but that edge case is not needed here — we
|
|
41
41
|
// deliberately omit it for simplicity.
|
|
@@ -82,8 +82,12 @@ function parsePattern(raw) {
|
|
|
82
82
|
}
|
|
83
83
|
return { negate, globs };
|
|
84
84
|
}
|
|
85
|
+
/** Whether a project-relative, `/`-separated path matches a parsed pattern. */
|
|
86
|
+
export function matchesParsedPattern(path, { globs }) {
|
|
87
|
+
return globs.some((g) => matchesGlob(path, g));
|
|
88
|
+
}
|
|
85
89
|
function buildIgnoreChecker(patterns) {
|
|
86
|
-
const matches =
|
|
90
|
+
const matches = matchesParsedPattern;
|
|
87
91
|
// gitignore rule: you cannot re-include a file if a parent directory of
|
|
88
92
|
// that file is excluded. Returns true when any ancestor of `rel` is
|
|
89
93
|
// ignored by the first `upTo` patterns (last-match-wins for ancestors).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../src/utils/shared/ignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EACN,OAAO,EACP,UAAU,EACV,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,OAAO,EACP,GAAG,GACH,MAAM,WAAW,CAAC;AAEnB,MAAM,gBAAgB,GAAG,CAAC,eAAe,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAE/D,MAAM,iBAAiB,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../src/utils/shared/ignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EACN,OAAO,EACP,UAAU,EACV,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,OAAO,EACP,GAAG,GACH,MAAM,WAAW,CAAC;AAEnB,MAAM,gBAAgB,GAAG,CAAC,eAAe,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAE/D,MAAM,iBAAiB,GAA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cli",
|
|
3
|
-
"version": "4.7.0-alpha.
|
|
3
|
+
"version": "4.7.0-alpha.31",
|
|
4
4
|
"description": "Camunda 8 CLI - minimal-dependency CLI for Camunda 8 operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"prepare": "
|
|
28
|
+
"prepare": "node scripts/prepare-git-hooks.mjs",
|
|
29
29
|
"build:vendor": "npm run build:vendor:element-template && npm run build:vendor:bpmnlint",
|
|
30
30
|
"build:vendor:element-template": "esbuild default-plugins/element-template/vendor-src/bundle-entry.js --bundle --format=cjs --platform=node --outfile=dist/vendor/bpmn-element-templates.cjs",
|
|
31
31
|
"build:vendor:bpmnlint": "node scripts/build-bpmnlint-vendor.mjs",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@camunda8/orchestration-cluster-api": "^10.0.0-alpha.43",
|
|
81
81
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
82
|
+
"jsonc-parser": "^3.3.1",
|
|
82
83
|
"semver": "^7.6.3"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|