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.
Files changed (2) hide show
  1. package/deploy-all.js +23 -16
  2. 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
- // npm processes publishes asynchronously, and a publish that lands while the
31
- // previous one is still being processed can overwrite that one's dist-tag (the
32
- // version itself survives). Wait for each publish to settle before the next —
33
- // the first publish of a run regularly takes 5+ minutes to become visible.
34
- function publishAndWait(version, tag) {
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
- for (let attempt = 0; attempt < 180; attempt++) {
38
- const tags = JSON.parse(execSync('npm view placementt-core dist-tags --json --prefer-online', { encoding: 'utf8' }));
39
- if (tags[tag] === version) {
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
- return;
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
- publishAndWait(devVersion, 'dev');
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
- publishAndWait(emulatorVersion, 'emu');
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
- publishAndWait(prodVersion, 'prod');
137
+ publishWithTag(prodVersion, 'prod');
138
+
139
+ pinDistTags();
133
140
 
134
141
  console.log("🎉 Deployment complete!");
135
142
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "placementt-core",
4
4
  "author": "Placementt",
5
- "version": "1.400.1174",
5
+ "version": "1.400.1177",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {