@faable/faable 1.26.0 → 1.26.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.
|
@@ -11,19 +11,15 @@ const gitRunner = (workdir) => command => new Promise(resolve => {
|
|
|
11
11
|
resolve(out || undefined);
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
|
-
// Loose version shape: "starts like semver". Filters out non-version tags
|
|
15
|
-
// (e.g. "nightly", "deploy-2026-07-01") when falling back to git describe;
|
|
16
|
-
// explicit values (--release / FAABLE_RELEASE) are NEVER validated — the
|
|
17
|
-
// platform treats release as free text.
|
|
18
|
-
const looksLikeVersion = (v) => /^\d+\.\d+\.\d+/.test(v);
|
|
19
|
-
const stripV = (tag) => tag.replace(/^v/, "");
|
|
20
14
|
/**
|
|
21
15
|
* Propose the release version for a deploy (Sentry propose-version pattern):
|
|
22
16
|
* explicit `--release` > `FAABLE_RELEASE` env > latest reachable git tag
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
17
|
+
* (e.g. the tag semantic-release created) > undefined. The release is FREE
|
|
18
|
+
* TEXT and travels VERBATIM — no `v` stripping, no shape validation; only
|
|
19
|
+
* the dashboard footer prepends a display `v`. When undefined the field is
|
|
20
|
+
* omitted from the deployment and the platform injects no FAABLE_RELEASE —
|
|
21
|
+
* the app falls back to its own version source. No SHA fallback: the commit
|
|
22
|
+
* already travels as `github_commit`.
|
|
27
23
|
*/
|
|
28
24
|
const propose_release = async (opts) => {
|
|
29
25
|
const env = opts?.env ?? process.env;
|
|
@@ -32,20 +28,15 @@ const propose_release = async (opts) => {
|
|
|
32
28
|
return { release: opts.explicit, source: "--release" };
|
|
33
29
|
if (env.FAABLE_RELEASE)
|
|
34
30
|
return { release: env.FAABLE_RELEASE, source: "FAABLE_RELEASE env" };
|
|
35
|
-
// Latest tag reachable from HEAD.
|
|
36
|
-
// repo that also tags non-releases still
|
|
37
|
-
// repos whose release tags carry no `v` prefix.
|
|
31
|
+
// Latest tag reachable from HEAD, verbatim. Version-shaped tags are tried
|
|
32
|
+
// first so a repo that also tags non-releases still prefers its releases.
|
|
38
33
|
for (const cmd of [
|
|
39
34
|
`git describe --tags --abbrev=0 --match "v[0-9]*"`,
|
|
40
35
|
`git describe --tags --abbrev=0`,
|
|
41
36
|
]) {
|
|
42
37
|
const tag = await run(cmd);
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
const version = stripV(tag);
|
|
46
|
-
if (looksLikeVersion(version)) {
|
|
47
|
-
return { release: version, source: `git tag ${tag}` };
|
|
48
|
-
}
|
|
38
|
+
if (tag)
|
|
39
|
+
return { release: tag, source: `git tag ${tag}` };
|
|
49
40
|
}
|
|
50
41
|
return undefined;
|
|
51
42
|
};
|