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:
1 parent
1ccfc65766
commit
80fad2aab9
16 files changed
+3720
-157
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user