chore: update all references to main in docs, examples, and templates

This commit is contained in:
Elliot DeNolf
2023-10-08 19:44:55 -04:00
parent aa443d9050
commit b398c44bfe
46 changed files with 141 additions and 102 deletions

View File

@@ -2,20 +2,6 @@
# List all published packages
# parse params: tag=beta or blank string ''
tag=${1:-}
echo
if [ -n "$tag" ]; then
echo "Listing packages with tag: $tag"
tag="@$tag"
else
echo "Listing latest packages"
tag=""
fi
echo
packages=$(find packages -name package.json -type f -exec grep -L '"private": true' {} \; | xargs jq -r '.name')
# sort alphabetically
@@ -23,7 +9,11 @@ packages=$(echo "$packages" | tr ' ' '\n' | sort -u | tr '\n' ' ')
# Loop through each package and print the name and version. Print as table
printf "%-30s %-20s %-20s\n" "package" "latest" "beta"
for package in $packages; do
version=$(npm view "$package""$tag" version 2> /dev/null || echo "N/A")
printf "%-30s %s\n" "$package" "$version"
info=$(npm view "$package" dist-tags --json)
latest=$(echo "$info" | jq -r '.latest')
beta=$(echo "$info" | jq -r '.beta')
printf "%-30s %-20s %-20s\n" "$package" "$latest" "$beta"
done

View File

@@ -22,6 +22,11 @@ async function main() {
process.exit(1)
}
if (packageNames.length > 1 && packageNames.find((p) => p === 'payload')) {
console.error(chalk.bold.red('Cannot publish payload with other packages'))
process.exit(1)
}
console.log(`\n${chalk.bold.green('Publishing packages:')}\n`)
console.log(`${packageNames.map((p) => ` ${p}`).join('\n')}`)
console.log('\n')
@@ -59,7 +64,7 @@ async function main() {
const newVersion = packageObj.version
execSync(`git commit -m "chore(release): ${packageName}@${newVersion}"`, execOpts)
execSync(`pnpm publish -C ${packageDir} --tag beta --no-git-checks`, execOpts)
execSync(`pnpm publish -C ${packageDir} --tag latest --no-git-checks`, execOpts)
results.push({ name: packageName, success: true })
} catch (error) {
console.error(`ERROR: ${error.message}`)