prodobit
Version:
Open-core business application development platform
85 lines (68 loc) โข 2.74 kB
JavaScript
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();