placementt-core 1.400.1174 → 1.400.1177
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/deploy-all.js +23 -16
- package/package.json +1 -1
package/deploy-all.js
CHANGED
|
@@ -27,24 +27,29 @@ function updateVersion(version) {
|
|
|
27
27
|
console.log(`✅ Updated version to ${version}`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
30
|
+
// A publish that lands while the previous one is still being processed can
|
|
31
|
+
// overwrite that one's dist-tag (the version itself survives). Polling `npm view`
|
|
32
|
+
// to wait it out reads the CDN-cached packument, which lags by many minutes, so
|
|
33
|
+
// instead re-point every tag directly once all three are published.
|
|
34
|
+
const publishedVersions = {};
|
|
35
|
+
|
|
36
|
+
function publishWithTag(version, tag) {
|
|
35
37
|
run(`npm publish --tag ${tag}`);
|
|
38
|
+
publishedVersions[tag] = version;
|
|
39
|
+
}
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
// The trusted publisher can only manage dist-tags once "Allow npm dist-tag" is
|
|
42
|
+
// enabled on the package, so a refusal here warns rather than failing a deploy
|
|
43
|
+
// whose publishes have already gone out (and skipping the version bump push).
|
|
44
|
+
function pinDistTags() {
|
|
45
|
+
for (const [tag, version] of Object.entries(publishedVersions)) {
|
|
46
|
+
try {
|
|
47
|
+
run(`npm dist-tag add placementt-core@${version} ${tag}`);
|
|
40
48
|
console.log(`✅ ${tag} → ${version}`);
|
|
41
|
-
|
|
49
|
+
} catch {
|
|
50
|
+
console.warn(`⚠️ Could not pin ${tag} → ${version}. Fix with: npm dist-tag add placementt-core@${version} ${tag}`);
|
|
42
51
|
}
|
|
43
|
-
execSync('sleep 5');
|
|
44
52
|
}
|
|
45
|
-
|
|
46
|
-
console.error(`❌ ${tag} still not pointing at ${version} after 15 minutes. Fix with: npm dist-tag add placementt-core@${version} ${tag}`);
|
|
47
|
-
process.exit(1);
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
// ---- Keep original file contents for reset ----
|
|
@@ -91,7 +96,7 @@ console.log("🚀 Building (dev)...");
|
|
|
91
96
|
run('yarn tsc');
|
|
92
97
|
|
|
93
98
|
console.log(`📤 Publishing ${devVersion}`);
|
|
94
|
-
|
|
99
|
+
publishWithTag(devVersion, 'dev');
|
|
95
100
|
|
|
96
101
|
// -------------------------------
|
|
97
102
|
// 2️⃣ EMULATOR VERSION
|
|
@@ -111,7 +116,7 @@ console.log("🚀 Building (emulator)...");
|
|
|
111
116
|
run('yarn tsc');
|
|
112
117
|
|
|
113
118
|
console.log(`📤 Publishing ${emulatorVersion}`);
|
|
114
|
-
|
|
119
|
+
publishWithTag(emulatorVersion, 'emu');
|
|
115
120
|
|
|
116
121
|
// -------------------------------
|
|
117
122
|
// RESET FILES
|
|
@@ -129,7 +134,9 @@ console.log("🚀 Building (prod)...");
|
|
|
129
134
|
run('yarn tsc');
|
|
130
135
|
|
|
131
136
|
console.log(`📤 Publishing ${prodVersion}`);
|
|
132
|
-
|
|
137
|
+
publishWithTag(prodVersion, 'prod');
|
|
138
|
+
|
|
139
|
+
pinDistTags();
|
|
133
140
|
|
|
134
141
|
console.log("🎉 Deployment complete!");
|
|
135
142
|
|