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.
- package/deploy-all.js +46 -40
- 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️⃣
|
|
80
|
+
// 1️⃣ PROD VERSION (first, so a failing build or publish stops before dev/emu go out)
|
|
81
81
|
// -------------------------------
|
|
82
|
-
|
|
82
|
+
updateVersion(prodVersion);
|
|
83
|
+
|
|
84
|
+
console.log("🚀 Building (prod)...");
|
|
85
|
+
run('yarn tsc');
|
|
83
86
|
|
|
84
|
-
|
|
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
|
-
|
|
93
|
-
|
|
95
|
+
try {
|
|
96
|
+
// -------------------------------
|
|
97
|
+
// 2️⃣ EMULATOR VERSION
|
|
98
|
+
// -------------------------------
|
|
99
|
+
console.log("🛠 Switching to EMULATOR config...");
|
|
94
100
|
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
fs.writeFileSync(firebaseConfigPath, devFirebaseConfig
|
|
102
|
+
.replace(/getFunctions}/g, 'connectFunctionsEmulator, getFunctions}')
|
|
103
|
+
.replace(/\/\/ con/g, 'con'));
|
|
97
104
|
|
|
98
|
-
|
|
99
|
-
publishWithTag(devVersion, 'dev');
|
|
105
|
+
fs.writeFileSync(algoliaConfigPath, toDevAlgoliaConfig(originalAlgoliaConfig));
|
|
100
106
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// -------------------------------
|
|
104
|
-
console.log("🛠 Switching to EMULATOR config...");
|
|
107
|
+
const emulatorVersion = `1.300.${nextPatch}`;
|
|
108
|
+
updateVersion(emulatorVersion);
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.replace(/\/\/ con/g, 'con');
|
|
110
|
+
console.log("🚀 Building (emulator)...");
|
|
111
|
+
run('yarn tsc');
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
console.log(`📤 Publishing ${emulatorVersion}`);
|
|
114
|
+
publishWithTag(emulatorVersion, 'emu');
|
|
111
115
|
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
// -------------------------------
|
|
117
|
+
// 3️⃣ DEV VERSION
|
|
118
|
+
// -------------------------------
|
|
119
|
+
console.log("🛠 Switching to DEV config...");
|
|
114
120
|
|
|
115
|
-
|
|
116
|
-
run('yarn tsc');
|
|
121
|
+
fs.writeFileSync(firebaseConfigPath, devFirebaseConfig);
|
|
117
122
|
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
const devVersion = `1.400.${nextPatch}`;
|
|
124
|
+
updateVersion(devVersion);
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
140
|
+
// Rebuild so lib/ matches the prod source again rather than the dev build.
|
|
134
141
|
run('yarn tsc');
|
|
135
142
|
|
|
136
|
-
|
|
137
|
-
|
|
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!");
|