Mirrored from GitHub github.com/roostorg/coop
0

Configure Feed

Select the types of activity you want to include in your feed.

[Types] Rename published package to @roostorg/coop-types (#602)

* types: Rename published package to @roostorg/coop-types

* code review fixes

* code review fixes

author
Juan Mrad
committer
GitHub
date (May 27, 2026, 1:27 PM -0500) commit 6f676dcb parent 8a6ecb8e
+29 -22
+6 -5
.github/workflows/publish-types.yaml
··· 28 28 - name: Check and publish types 29 29 run: | 30 30 cd types 31 + PKG_NAME=$(node -p "require('./package.json').name") 31 32 VERSION=$(node -p "require('./package.json').version") 32 - echo "Checking @roostorg/types@$VERSION..." 33 - 34 - if npm view "@roostorg/types@$VERSION" version >/dev/null 2>&1; then 35 - echo "⚠️ Version $VERSION of @roostorg/types already exists on npm - skipping" 33 + echo "Checking $PKG_NAME@$VERSION..." 34 + 35 + if npm view "$PKG_NAME@$VERSION" version >/dev/null 2>&1; then 36 + echo "⚠️ Version $VERSION of $PKG_NAME already exists on npm - skipping" 36 37 else 37 - echo "✅ Publishing @roostorg/types@$VERSION..." 38 + echo "✅ Publishing $PKG_NAME@$VERSION..." 38 39 npm ci --ignore-scripts 39 40 npm run build 40 41 npm publish
+16 -10
scripts/publish-packages.sh
··· 45 45 # Function to publish package if version doesn't exist 46 46 publish_if_needed() { 47 47 local package_dir=$1 48 - local package_name=$2 49 - 48 + 50 49 cd "$package_dir" 51 - 52 - # Get current version from package.json 53 - local version=$(node -p "require('./package.json').version") 54 - 50 + 51 + # Derive name and version from package.json so the script stays in sync 52 + # with whatever npm publish will actually publish (avoids drift if the 53 + # package is renamed without updating this script). 54 + # Declare and assign separately so `set -e` catches node -p failures 55 + # (shellcheck SC2155: `local foo=$(...)` masks the subshell's exit status). 56 + local package_name 57 + package_name=$(node -p "require('./package.json').name") 58 + local version 59 + version=$(node -p "require('./package.json').version") 60 + 55 61 echo "📦 Checking $package_name@$version..." 56 - 62 + 57 63 if check_version_exists "$package_name" "$version"; then 58 64 echo "⏭️ Skipping $package_name@$version (already published)" 59 65 cd .. 60 66 return 61 67 fi 62 - 68 + 63 69 echo "📦 Publishing $package_name@$version..." 64 70 npm install 65 71 npm run build ··· 68 74 } 69 75 70 76 # Publish packages 71 - publish_if_needed "types" "@roostorg/types" 72 - publish_if_needed "migrator" "@roostorg/db-migrator" 77 + publish_if_needed "types" 78 + publish_if_needed "migrator" 73 79 74 80 echo "✅ All packages published successfully!" 75 81 echo ""
+4 -4
types/package-lock.json
··· 1 1 { 2 - "name": "@roostorg/types", 3 - "version": "2.1.0", 2 + "name": "@roostorg/coop-types", 3 + "version": "2.2.0", 4 4 "lockfileVersion": 2, 5 5 "requires": true, 6 6 "packages": { 7 7 "": { 8 - "name": "@roostorg/types", 9 - "version": "2.1.0", 8 + "name": "@roostorg/coop-types", 9 + "version": "2.2.0", 10 10 "license": "ISC", 11 11 "dependencies": { 12 12 "date-fns": "^2.29.3",
+3 -3
types/package.json
··· 1 1 { 2 - "name": "@roostorg/types", 2 + "name": "@roostorg/coop-types", 3 3 "type": "module", 4 - "version": "2.1.0", 5 - "description": "Shared types across Coop services", 4 + "version": "2.2.0", 5 + "description": "Shared TypeScript types for Coop: schema primitives, signal data maps, and integration contracts.", 6 6 "module": "transpiled/index.js", 7 7 "typings": "./transpiled/index.d.ts", 8 8 "scripts": {