fix: create event type with output of another create event type (#21273)

* feat: accept location booking field with label customization

* feat: return location label

* chore: bump libraries

* test

* fix: tests
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2025-05-16 16:34:44 +03:00
1 parent 1ccfc65766
commit 80fad2aab9
16 files changed
+3720 -157

No files matched your search

+1 -4
View File
@@ -7,10 +7,7 @@ Here is the workflow:
1. If you change platform libraries for the first time, then run `yarn local` to build them locally for the first time. This will also make v2 api point to the local libraries.
2. If you change them for the second time, then run `yarn build:dev` to re-build them.
3. Once you are happy with platform libraries:
- run `yarn publish` - it will check "@calcom/platform-libraries" version in npm and update it's package.json to the next version and then it will publish the package to np.
- run `yarn postpublish` - it will update the version of "@calcom/platform-libraries" in the api v2 package.json, reset "@calcom/platform-libraries" to 0.0.0 and run yarn install.
note(Lauris) - we could have 1 publish script but the problem is that `yarn publish` does not exit for some reason.
- run `yarn publish-npm` - it will check "@calcom/platform-libraries" version in npm and update it's package.json to the next version and then it will publish the package to npm, update the version of "@calcom/platform-libraries" in the api v2 package.json, reset "@calcom/platform-libraries" to 0.0.0 and run yarn install.
# Before Merging to main
+1 -2
View File
@@ -14,8 +14,7 @@
"watch-lru-fix": "watch -n 1 'sed -i'' -e \"s/const CACHE = new lruCache\\.LRUCache({ max: 1e3 });/const CACHE = new lruCache({ max: 1e3 });/g\" ./dist/index.cjs'",
"build:dev": "yarn vite build && sed -i'' -e 's/const CACHE = new lruCache\\.LRUCache({ max: 1e3 });/const CACHE = new lruCache({ max: 1e3 });/g' ./dist/index.cjs",
"local": "node scripts/local.js && rm -rf dist && yarn build:dev && cd ../../.. && yarn",
"publish": "yarn && node scripts/prepublish.js && rm -rf dist && yarn build && npm publish --access public",
"postpublish": "node scripts/postpublish.js"
"publish-npm": "yarn && node scripts/prepublish.js && rm -rf dist && yarn build && npm publish --access public && node scripts/postpublish.js"
},
"dependencies": {
"@calcom/features": "*",
@@ -3,9 +3,13 @@ import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
import { getCurrentVersion } from "./prepublish.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
main();
async function main() {
try {
// Get the published version before resetting
@@ -14,6 +18,9 @@ async function main() {
const librariesPackageJson = JSON.parse(fs.readFileSync(librariesPackageJsonPath, "utf8"));
const publishedVersion = librariesPackageJson.version;
// Wait for the npm registry to reflect our published version
await waitForNewestNpmRelease(publishedVersion);
// Reset libraries package.json version to 0.0.0
librariesPackageJson.version = "0.0.0";
fs.writeFileSync(librariesPackageJsonPath, `${JSON.stringify(librariesPackageJson, null, 2)}\n`);
@@ -55,4 +62,36 @@ async function main() {
}
}
main();
async function waitForNewestNpmRelease(publishedVersion) {
console.log(`Waiting for npm registry to update with version ${publishedVersion}...`);
let npmVersion;
let attempts = 0;
const maxAttempts = 12;
while (true) {
attempts++;
npmVersion = await getCurrentVersion();
if (publishedVersion === npmVersion) {
console.log(
`Version match confirmed (${publishedVersion}) after ${attempts} attempts. Proceeding with updates...`
);
break;
}
if (attempts >= maxAttempts) {
console.log(
`Reached maximum attempts (${maxAttempts}). Latest npm version: ${npmVersion}, local version: ${publishedVersion}`
);
console.log("Proceeding with updates anyway...");
break;
}
console.log(
`Attempt ${attempts}/${maxAttempts}: npm version (${npmVersion}) doesn't match local version (${publishedVersion}) yet. Retrying in 5 seconds...`
);
await new Promise((resolve) => setTimeout(resolve, 5000));
}
return npmVersion;
}
@@ -7,7 +7,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Fetch current version from npm registry
function getCurrentVersion() {
export function getCurrentVersion() {
return new Promise((resolve, reject) => {
https
.get(