placementt-core 1.400.1203 → 1.400.1204

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 +46 -40
  2. package/package.json +1 -1
package/deploy-all.js CHANGED
@@ -77,65 +77,71 @@ function toDevAlgoliaConfig(source) {
77
77
  const prodVersion = `1.1.${nextPatch}`;
78
78
 
79
79
  // -------------------------------
80
- // 1️⃣ DEV VERSION
80
+ // 1️⃣ PROD VERSION (first, so a failing build or publish stops before dev/emu go out)
81
81
  // -------------------------------
82
- console.log("🛠 Switching to DEV config...");
82
+ updateVersion(prodVersion);
83
+
84
+ console.log("🚀 Building (prod)...");
85
+ run('yarn tsc');
83
86
 
84
- let firebaseConfig = originalFirebaseConfig.replace(
87
+ console.log(`📤 Publishing ${prodVersion}`);
88
+ publishWithTag(prodVersion, 'prod');
89
+
90
+ const devFirebaseConfig = originalFirebaseConfig.replace(
85
91
  /\(credentialsProd\)/g,
86
92
  '(credentialsDev)'
87
93
  );
88
- fs.writeFileSync(firebaseConfigPath, firebaseConfig);
89
-
90
- fs.writeFileSync(algoliaConfigPath, toDevAlgoliaConfig(originalAlgoliaConfig));
91
94
 
92
- const devVersion = `1.400.${nextPatch}`;
93
- updateVersion(devVersion);
95
+ try {
96
+ // -------------------------------
97
+ // 2️⃣ EMULATOR VERSION
98
+ // -------------------------------
99
+ console.log("🛠 Switching to EMULATOR config...");
94
100
 
95
- console.log("🚀 Building (dev)...");
96
- run('yarn tsc');
101
+ fs.writeFileSync(firebaseConfigPath, devFirebaseConfig
102
+ .replace(/getFunctions}/g, 'connectFunctionsEmulator, getFunctions}')
103
+ .replace(/\/\/ con/g, 'con'));
97
104
 
98
- console.log(`📤 Publishing ${devVersion}`);
99
- publishWithTag(devVersion, 'dev');
105
+ fs.writeFileSync(algoliaConfigPath, toDevAlgoliaConfig(originalAlgoliaConfig));
100
106
 
101
- // -------------------------------
102
- // 2️⃣ EMULATOR VERSION
103
- // -------------------------------
104
- console.log("🛠 Switching to EMULATOR config...");
107
+ const emulatorVersion = `1.300.${nextPatch}`;
108
+ updateVersion(emulatorVersion);
105
109
 
106
- firebaseConfig = firebaseConfig
107
- .replace(/getFunctions}/g, 'connectFunctionsEmulator, getFunctions}')
108
- .replace(/\/\/ con/g, 'con');
110
+ console.log("🚀 Building (emulator)...");
111
+ run('yarn tsc');
109
112
 
110
- fs.writeFileSync(firebaseConfigPath, firebaseConfig);
113
+ console.log(`📤 Publishing ${emulatorVersion}`);
114
+ publishWithTag(emulatorVersion, 'emu');
111
115
 
112
- const emulatorVersion = `1.300.${nextPatch}`;
113
- updateVersion(emulatorVersion);
116
+ // -------------------------------
117
+ // 3️⃣ DEV VERSION
118
+ // -------------------------------
119
+ console.log("🛠 Switching to DEV config...");
114
120
 
115
- console.log("🚀 Building (emulator)...");
116
- run('yarn tsc');
121
+ fs.writeFileSync(firebaseConfigPath, devFirebaseConfig);
117
122
 
118
- console.log(`📤 Publishing ${emulatorVersion}`);
119
- publishWithTag(emulatorVersion, 'emu');
123
+ const devVersion = `1.400.${nextPatch}`;
124
+ updateVersion(devVersion);
120
125
 
121
- // -------------------------------
122
- // RESET FILES
123
- // -------------------------------
124
- console.log("🧹 Resetting source files...");
125
- fs.writeFileSync(firebaseConfigPath, originalFirebaseConfig);
126
- fs.writeFileSync(algoliaConfigPath, originalAlgoliaConfig);
126
+ console.log("🚀 Building (dev)...");
127
+ run('yarn tsc');
127
128
 
128
- // -------------------------------
129
- // PROD VERSION (last, so nothing publishes after it and clobbers its tag)
130
- // -------------------------------
131
- updateVersion(prodVersion);
129
+ console.log(`📤 Publishing ${devVersion}`);
130
+ publishWithTag(devVersion, 'dev');
131
+ } finally {
132
+ // -------------------------------
133
+ // RESET FILES
134
+ // -------------------------------
135
+ console.log("🧹 Resetting source files...");
136
+ fs.writeFileSync(firebaseConfigPath, originalFirebaseConfig);
137
+ fs.writeFileSync(algoliaConfigPath, originalAlgoliaConfig);
138
+ }
132
139
 
133
- console.log("🚀 Building (prod)...");
140
+ // Rebuild so lib/ matches the prod source again rather than the dev build.
134
141
  run('yarn tsc');
135
142
 
136
- console.log(`📤 Publishing ${prodVersion}`);
137
- publishWithTag(prodVersion, 'prod');
138
-
143
+ // Prod no longer publishes last, so a later publish may have clobbered its tag;
144
+ // pinning re-points every tag at the version it was published with.
139
145
  pinDistTags();
140
146
 
141
147
  console.log("🎉 Deployment complete!");
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.1203",
5
+ "version": "1.400.1204",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {