@opencrvs/create-countryconfig 2.1.0-beta → 2.1.0-beta.2
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/index.js +21 -27
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -96,27 +96,29 @@ function getLatestCommonReleaseTag() {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* version (stripped of the "-rc.<sha>" suffix) tells apart two different
|
|
103
|
-
* situations: an RC for a version already being stabilized on its own
|
|
104
|
-
* "release/X.Y.Z" branch (e.g. "2.0.1-rc.*" while a patch release is in
|
|
105
|
-
* progress) versus an RC for a version that hasn't been branched off yet and
|
|
106
|
-
* only exists on develop (e.g. "2.1.0-rc.*" while that release branch hasn't
|
|
107
|
-
* been cut). Scaffold from the release branch when it exists in both
|
|
108
|
-
* repositories, otherwise fall back to develop.
|
|
99
|
+
* Resolves the ref that both repositories are cloned from. A single ref
|
|
100
|
+
* clones both, so every candidate must exist in *both* - a tag present in
|
|
101
|
+
* only one of them can't be used.
|
|
109
102
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
103
|
+
* The exact "v<version>" tag wins whenever it exists: it pins a commit, so
|
|
104
|
+
* a release, an explicit `@X.Y.Z` pin, or a blessed prerelease (npm `@beta`,
|
|
105
|
+
* published from that tag) reproduces however late it's scaffolded.
|
|
106
|
+
*
|
|
107
|
+
* Otherwise a prerelease falls back to a branch, since a rolling release
|
|
108
|
+
* candidate (npm `@next`) is never tagged: "release/X.Y.Z" of the base
|
|
109
|
+
* version when that release has been cut, otherwise develop. A release
|
|
110
|
+
* falls back to the highest tag common to both repositories - never a
|
|
111
|
+
* mismatched pairing of the two at different releases - or errors.
|
|
118
112
|
*/
|
|
119
113
|
function resolveRef() {
|
|
114
|
+
const versionTag = 'v' + version
|
|
115
|
+
if (
|
|
116
|
+
tagExists(CORE_REPO_URL, versionTag) &&
|
|
117
|
+
tagExists(INFRASTRUCTURE_REPO_URL, versionTag)
|
|
118
|
+
) {
|
|
119
|
+
return versionTag
|
|
120
|
+
}
|
|
121
|
+
|
|
120
122
|
if (version.includes('-')) {
|
|
121
123
|
const releaseBranch = 'release/' + version.split('-')[0]
|
|
122
124
|
if (
|
|
@@ -128,19 +130,11 @@ function resolveRef() {
|
|
|
128
130
|
return 'develop'
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
const tag = 'v' + version
|
|
132
|
-
if (
|
|
133
|
-
tagExists(CORE_REPO_URL, tag) &&
|
|
134
|
-
tagExists(INFRASTRUCTURE_REPO_URL, tag)
|
|
135
|
-
) {
|
|
136
|
-
return tag
|
|
137
|
-
}
|
|
138
|
-
|
|
139
133
|
const latestCommonTag = getLatestCommonReleaseTag()
|
|
140
134
|
if (latestCommonTag) {
|
|
141
135
|
console.warn(
|
|
142
136
|
'\nWarning: tag "' +
|
|
143
|
-
|
|
137
|
+
versionTag +
|
|
144
138
|
'" was not found in both repositories; falling back to the latest ' +
|
|
145
139
|
'available release, ' +
|
|
146
140
|
latestCommonTag +
|