UNPKG

prodobit

Version:

Open-core business application development platform

85 lines (68 loc) โ€ข 2.74 kB
#!/usr/bin/env node const { execSync } = require("child_process"); const path = require("path"); const packages = [ "types", "config", "database", "sdk", "server", "react-sdk", "business-ui", ]; async function publishPackages() { try { console.log("๐Ÿ”ง Preparing packages for publish..."); execSync("node scripts/publish-prep.js", { stdio: "inherit" }); console.log("\n๐Ÿ“ฆ Building all packages..."); execSync("pnpm build", { stdio: "inherit" }); console.log("\n๐Ÿš€ Publishing packages..."); for (const pkg of packages) { console.log(`\n๐Ÿ“ค Publishing @prodobit/${pkg}...`); try { execSync(`cd packages/${pkg} && npm publish --access public`, { stdio: "inherit", }); console.log(`โœ… Published @prodobit/${pkg}`); } catch (error) { console.error(`โŒ Failed to publish @prodobit/${pkg}:`, error.message); } } console.log("\n๐Ÿ“ค Publishing meta-package prodobit..."); try { execSync("npm publish --access public", { stdio: "inherit" }); console.log("โœ… Published prodobit"); } catch (error) { console.error("โŒ Failed to publish prodobit:", error.message); } console.log("\n๐ŸŽฏ Preparing Flutter SDK for publish..."); try { const flutterPath = path.join(process.cwd(), "packages", "flutter-sdk"); console.log("๐Ÿ“ฆ Getting Flutter dependencies..."); execSync("flutter pub get", { cwd: flutterPath, stdio: "inherit" }); console.log("๐Ÿ” Running Flutter analysis..."); execSync("flutter analyze", { cwd: flutterPath, stdio: "inherit" }); console.log("๐Ÿงช Running Flutter tests..."); execSync("flutter test", { cwd: flutterPath, stdio: "inherit" }); console.log("๐Ÿ”จ Running code generation..."); execSync("flutter packages pub run build_runner build --delete-conflicting-outputs", { cwd: flutterPath, stdio: "inherit" }); console.log("๐Ÿš€ Publishing Flutter SDK to pub.dev..."); console.log("โš ๏ธ Make sure you're logged in with 'dart pub login'"); console.log("๐Ÿ“ค Publishing Flutter SDK automatically..."); // Auto-publish Flutter SDK execSync("dart pub publish", { cwd: flutterPath, stdio: "inherit" }); console.log("โœ… Published Flutter SDK"); } catch (error) { console.error("โŒ Failed to publish Flutter SDK:", error.message); } } catch (error) { console.error("โŒ Publish failed:", error.message); } finally { console.log("\n๐Ÿ”„ Restoring workspace references..."); execSync("node scripts/publish-restore.js", { stdio: "inherit" }); } } publishPackages();