fix: Booking atom phone booking field and booking fields order (#18678)
* chore: examples app make managed user admin * fix: phone field not appearing * fix: booking fields order * feat: local libraries setup script * chore: add log when parsing booking field fails * fix: backwards compatbile name booking field * chore: libraries publish support scripts * chore: bump libraries * docs * fix: phone default field return label and placeholder * fix: e2e tests
This commit is contained in:
1 parent
79a8ab79f8
commit
f582faed2b
15 files changed
+336
-163
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import fs from "fs";
|
||||
import https from "https";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
// Fetch current version from npm registry
|
||||
function getCurrentVersion() {
|
||||
return new Promise((resolve, reject) => {
|
||||
https
|
||||
.get(
|
||||
"https://registry.npmjs.org/@calcom/platform-libraries",
|
||||
{
|
||||
headers: { Accept: "application/json" },
|
||||
},
|
||||
(res) => {
|
||||
let data = "";
|
||||
res.on("data", (chunk) => (data += chunk));
|
||||
res.on("end", () => {
|
||||
try {
|
||||
const packageInfo = JSON.parse(data);
|
||||
const currentVersion = packageInfo["dist-tags"].latest;
|
||||
resolve(currentVersion);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
)
|
||||
.on("error", reject);
|
||||
});
|
||||
}
|
||||
|
||||
// Increment patch version (a.b.c -> a.b.c+1)
|
||||
function incrementPatchVersion(version) {
|
||||
const parts = version.split(".");
|
||||
parts[2] = String(Number(parts[2]) + 1);
|
||||
return parts.join(".");
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
// Get and increment version
|
||||
const currentVersion = await getCurrentVersion();
|
||||
const newVersion = incrementPatchVersion(currentVersion);
|
||||
console.log(`Current version in npm: ${currentVersion}. Incremented locally to ${newVersion}`);
|
||||
|
||||
// Update libraries package.json version
|
||||
const librariesPath = path.join(__dirname, "..");
|
||||
const librariesPackageJsonPath = path.join(librariesPath, "package.json");
|
||||
const librariesPackageJson = JSON.parse(fs.readFileSync(librariesPackageJsonPath, "utf8"));
|
||||
|
||||
librariesPackageJson.version = newVersion;
|
||||
fs.writeFileSync(librariesPackageJsonPath, `${JSON.stringify(librariesPackageJson, null, 2)}\n`);
|
||||
|
||||
console.log("Successfully incremented @calcom/platform-libraries package.json version.");
|
||||
} catch (error) {
|
||||
console.error("Error:", error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in new issue
Block a user