Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e7acf4

Browse files
committed
chore: wip
1 parent 7765923 commit 3e7acf4

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

packages/ts/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./dist"
5+
},
6+
"include": [
7+
"src/**/*.ts"
8+
],
9+
"exclude": [
10+
"node_modules",
11+
"dist"
12+
]
13+
}

scripts/publish.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# Exit on error
4+
set -e
5+
6+
# Enable debug if needed
7+
# set -x
8+
9+
echo "Publishing all packages..."
10+
11+
for dir in packages/*/ ; do
12+
if [ -d "$dir" ]; then
13+
package_name=$(basename "$dir")
14+
package_json="$dir/package.json"
15+
16+
echo "----------------------------------------"
17+
echo "Processing $package_name..."
18+
19+
# Check if package is private using Bun
20+
if command -v bun >/dev/null 2>&1; then
21+
is_private=$(bun --eval "try { const pkg = JSON.parse(require('fs').readFileSync('$package_json', 'utf8')); console.log(pkg.private === true ? 'true' : 'false'); } catch(e) { console.log('false'); }")
22+
# Then try jq as a fallback
23+
elif command -v jq >/dev/null 2>&1; then
24+
is_private=$(jq -r '.private // false' "$package_json")
25+
# Finally fall back to grep
26+
else
27+
private_check=$(grep -E '"private":\s*true' "$package_json" || echo "")
28+
if [ -n "$private_check" ]; then
29+
is_private="true"
30+
else
31+
is_private="false"
32+
fi
33+
fi
34+
35+
echo "Package $package_name private status: $is_private"
36+
37+
if [ "$is_private" = "true" ]; then
38+
echo "Skipping $package_name (private package)"
39+
else
40+
echo "Publishing $package_name..."
41+
cd "$dir"
42+
bun publish --access public
43+
cd - > /dev/null # Suppress the directory change message
44+
fi
45+
46+
echo "----------------------------------------"
47+
fi
48+
done
49+
50+
echo "All packages published successfully!"

0 commit comments

Comments
 (0)