@camunda8/cli 4.6.0-alpha.7 → 4.6.1-alpha.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.
@@ -24,61 +24,30 @@ shipped layout but during development we run directly from
24
24
 
25
25
  ## OOTB template integration
26
26
 
27
- Four sources publish the OOTB connector templates:
28
-
29
- | | Source-of-truth | Inlines templates? | Has all versions? | Used by |
30
- |---|---|---|---|---|
31
- | `github.com/camunda/connectors` releases (bundle asset) | yes | yes (~1 MB gzip per line) | per minor line | c8ctl |
32
- | `marketplace.cloud.camunda.io/api/v1/ootb-connectors` | mirrors GH | no, URL refs | yes | Desktop Modeler |
33
- | `github.com/camunda/connectors/connector-templates.json` | yes | no, URL refs | yes | (the marketplace) |
34
- | `@camunda/connectors-element-templates` (npm) | derived | yes (~9MB) | yes, may lag | (Web Modeler skill) |
35
-
36
- We use the **release bundle assets** — every connectors release ships a
37
- `connectors-bundle-templates-<tag>.tar.gz` with one JSON file per
38
- template:
39
-
40
- - The marketplace endpoint (Desktop Modeler's source, and c8ctl's
41
- original choice) only publishes *refs* into
42
- `raw.githubusercontent.com`, a host routinely blocked in enterprise
43
- networks — the reason for the switch, see c8ctl#530. Release
44
- downloads are served from `github.com`, which those environments
45
- generally do reach.
46
- - One request per minor line replaces ~650 per-template requests, so a
47
- cold sync is a few MB and a few seconds instead of ~14 MB and ~30 s.
48
- - npm package was rejected: confirmed lag against the GH source and
49
- some entries are missing `version`/`engines` (pre-versioned legacy
50
- templates).
51
-
52
- ### Which releases
53
-
54
- `sync` lists the releases (`api.github.com/repos/camunda/connectors/
55
- releases?per_page=100`, overridable via
56
- `C8CTL_CONNECTORS_RELEASES_URL`) and keeps **the newest release of each
57
- minor line** — 8.8.x, 8.9.x, 8.10.x, ...:
58
-
59
- - Bundles are cumulative within a line, so the newest patch of 8.8
60
- already contains everything 8.8.17 shipped. Across lines they differ,
61
- which is why one release per line is kept rather than just the newest
62
- release overall.
63
- - Alphas count (`8.10.0-alpha3` is the only source for a line that has
64
- no stable release yet); release candidates do not — they are
65
- superseded within days. Note that semver ranks `8.10.0-alpha5-rc3`
66
- *above* `8.10.0-alpha5`, so RCs are filtered explicitly rather than
67
- by ordering.
68
- - Draft releases and releases without a bundle asset (a release that is
69
- still being built) are skipped, so an in-flight release falls back to
70
- the previous one on that line.
71
- - Only the **4 newest minor lines** are kept (`MAX_MINOR_LINES` in
72
- `releases.ts`), roughly Camunda's supported-version window. This keeps
73
- the selection deterministic: the newest release of each selected line
74
- is always within the first page of the listing, whereas an EOL line's
75
- newest release drifts down the listing until it falls off the page and
76
- would silently vanish from the selection.
77
-
78
- Bundles contain a superset of the marketplace index: the `-hybrid`
79
- variants and a few templates the marketplace does not list are cached
80
- too, and templates without a numeric `version` (pre-versioned legacy
81
- entries that version resolution cannot rank) are skipped.
27
+ `sync` reads `@camunda/connectors-element-templates` from npm. npm honours
28
+ the user's registry, scoped registry, proxy, CA and authentication settings.
29
+ The package is published from `camunda/connectors` and includes connector
30
+ templates and their metadata in one archive.
31
+
32
+ The installed package contains arrays of versions in
33
+ `src/element-templates/*.json`. Entries without a numeric `version`
34
+ are legacy duplicates that version resolution cannot rank and are skipped;
35
+ entries without `engines` remain eligible for version selection. Hybrid
36
+ templates are not in the package.
37
+
38
+ Each sync uses `npm install` in a temporary staging directory under the cache
39
+ lock. npm resolves and extracts a single package from
40
+ `C8CTL_ELEMENT_TEMPLATES_PACKAGE` (a package spec, tarball URL or local path)
41
+ or the default package. The package is the one directory in the staging
42
+ `node_modules` that has `src/element-templates`, so discovery does not depend
43
+ on npm's save settings; its name and version come from its installed package
44
+ manifest. npm handles package archive formats and local symlinks; the staging
45
+ directory is removed after reading its templates.
46
+
47
+ Sync ingests one template package: a package that depends on another template
48
+ package fails with an error naming both. Supporting several could ingest every
49
+ template-bearing package in the install tree, with a dependent winning over its
50
+ dependencies and a warning on conflicting `id@version` entries.
82
51
 
83
52
  ## Cache strategy
84
53
 
@@ -90,15 +59,13 @@ We mirror Desktop Modeler's approach
90
59
  Modeler's `.camunda-connector-templates.json` shape).
91
60
  - `fetched-at` — epoch ms of last sync.
92
61
  - Each cached template gets
93
- `metadata.upstreamRef = <assetUrl>#<file-in-bundle>` injected. Release
94
- assets are tag-pinned and therefore immutable, so "asset URL already
95
- in the cache" ⇒ "bundle already ingested" ⇒ no re-download.
96
- - `id@version` is deduplicated across bundles, newest release wins.
97
- - Per-release fetch failures are logged + counted, and never abort the
98
- run — unless *every* bundle failed and nothing was reusable from the
99
- cache, in which case `sync` errors out rather than writing an empty
100
- cache. A partial sync also leaves `fetched-at` untouched, so the
101
- staleness nudge keeps asking for a full refresh.
62
+ `metadata.upstreamRef = npm:<package>@<version>#src/element-templates/<file>` injected.
63
+ The single current package replaces matching `id@version` entries, while
64
+ older entries remain until explicitly pruned. It does not combine multiple
65
+ configured packages.
66
+ - An install failure or malformed template file retains the old cache and
67
+ timestamp, and disables pruning.
68
+ A cold sync fails instead of writing an empty cache.
102
69
 
103
70
  ### Lifecycle
104
71
 
@@ -118,18 +85,14 @@ We mirror Desktop Modeler's approach
118
85
  `c8ctl element-template sync`. We don't auto-refresh — surprise
119
86
  network activity inside `apply` is undesirable and a manual sync is
120
87
  cheap.
121
- - **`sync`** always re-fetches the release listing but only downloads
122
- bundles that aren't cached yet. **`sync --prune`** drops cached
123
- entries that no longer belong to a selected release (opt-in: a user
124
- may keep a legacy line intentionally). Pruning is skipped when any
125
- bundle failed to download: a bundle URL changes with every patch, so
126
- the previous patch's cached templates are always "stale", and dropping
127
- them while their replacement failed would delete a whole minor line
128
- over one transient HTTP error.
88
+ - **`sync`** stages a fresh npm install. **`sync --prune`** drops cached
89
+ entries absent from the current package; a failed install never prunes the
90
+ previous cache.
129
91
  - **Atomicity**: `sync` writes `templates.json` and `fetched-at`
130
92
  via a sibling temp file + `renameSync`, so a kill mid-sync leaves
131
93
  the previous cache intact. `apply --in-place` uses the same recipe
132
- for the user's BPMN file.
94
+ for the user's BPMN file. The temporary installation is created under
95
+ the cache lock and removed after its files have been read.
133
96
  - **Concurrent syncs** are serialised by an advisory lock
134
97
  (`<cacheDir>/.sync.lock`) holding `{pid, startedAt}`. A second
135
98
  `sync` exits non-zero with a pointer to the lockfile; stale locks
@@ -142,8 +105,8 @@ We mirror Desktop Modeler's approach
142
105
 
143
106
  Earlier draft considered fetching only the requested `(id, version)`
144
107
  on demand. Rejected because **search needs the template names**, which
145
- means every template has to be read anyway. Bundles make this moot: the
146
- whole line arrives in one request, so eager bulk fetch is both simpler
108
+ means every template has to be read anyway. Installing the package makes this
109
+ moot: the whole package arrives together, so eager bulk fetch is both simpler
147
110
  and faster than any lazy scheme.
148
111
 
149
112
  ## Version resolution
@@ -14,7 +14,7 @@
14
14
  "bpmn-moddle": "^10.2.0"
15
15
  },
16
16
  "devDependencies": {
17
- "bpmn-js-element-templates": "^2.36.3",
17
+ "bpmn-js-element-templates": "^2.38.0",
18
18
  "bpmn-js-headless": "^0.2.0",
19
19
  "zeebe-bpmn-moddle": "^2.0.0"
20
20
  }