placementt-core 1.400.1174 → 1.400.1176

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 +18 -18
  2. package/package.json +1 -1
package/deploy-all.js CHANGED
@@ -27,24 +27,22 @@ 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) {
40
- console.log(`✅ ${tag} → ${version}`);
41
- return;
42
- }
43
- execSync('sleep 5');
41
+ function pinDistTags() {
42
+ for (const [tag, version] of Object.entries(publishedVersions)) {
43
+ run(`npm dist-tag add placementt-core@${version} ${tag}`);
44
+ console.log(`✅ ${tag} → ${version}`);
44
45
  }
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
46
  }
49
47
 
50
48
  // ---- Keep original file contents for reset ----
@@ -91,7 +89,7 @@ console.log("🚀 Building (dev)...");
91
89
  run('yarn tsc');
92
90
 
93
91
  console.log(`📤 Publishing ${devVersion}`);
94
- publishAndWait(devVersion, 'dev');
92
+ publishWithTag(devVersion, 'dev');
95
93
 
96
94
  // -------------------------------
97
95
  // 2️⃣ EMULATOR VERSION
@@ -111,7 +109,7 @@ console.log("🚀 Building (emulator)...");
111
109
  run('yarn tsc');
112
110
 
113
111
  console.log(`📤 Publishing ${emulatorVersion}`);
114
- publishAndWait(emulatorVersion, 'emu');
112
+ publishWithTag(emulatorVersion, 'emu');
115
113
 
116
114
  // -------------------------------
117
115
  // RESET FILES
@@ -129,7 +127,9 @@ console.log("🚀 Building (prod)...");
129
127
  run('yarn tsc');
130
128
 
131
129
  console.log(`📤 Publishing ${prodVersion}`);
132
- publishAndWait(prodVersion, 'prod');
130
+ publishWithTag(prodVersion, 'prod');
131
+
132
+ pinDistTags();
133
133
 
134
134
  console.log("🎉 Deployment complete!");
135
135
 
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.1176",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {