@datalayer/agent-runtimes 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/apply-patches.sh +32 -0
package/package.json
CHANGED
package/scripts/apply-patches.sh
CHANGED
|
@@ -11,6 +11,7 @@ set -e
|
|
|
11
11
|
# Colors for output
|
|
12
12
|
GREEN='\033[0;32m'
|
|
13
13
|
BLUE='\033[0;34m'
|
|
14
|
+
YELLOW='\033[0;33m'
|
|
14
15
|
NC='\033[0m' # No Color
|
|
15
16
|
|
|
16
17
|
echo -e "${BLUE}📝 Applying patches...${NC}"
|
|
@@ -21,6 +22,37 @@ CORE_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
|
|
|
21
22
|
|
|
22
23
|
cd "$CORE_ROOT"
|
|
23
24
|
|
|
25
|
+
# Check if patches directory has any patch files (excluding .gitkeep)
|
|
26
|
+
PATCH_COUNT=$(find patches -name "*.patch" 2>/dev/null | wc -l)
|
|
27
|
+
|
|
28
|
+
if [ "$PATCH_COUNT" -eq 0 ]; then
|
|
29
|
+
echo -e "${YELLOW}⏭️ No patches to apply${NC}"
|
|
30
|
+
exit 0
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Check if required packages exist in node_modules
|
|
34
|
+
# In a monorepo, packages may be hoisted to root node_modules
|
|
35
|
+
MISSING_PACKAGES=false
|
|
36
|
+
|
|
37
|
+
for patch_file in patches/*.patch; do
|
|
38
|
+
if [ -f "$patch_file" ]; then
|
|
39
|
+
# Extract package name from patch filename (e.g., @datalayer+jupyter-lexical+1.0.8.patch)
|
|
40
|
+
filename=$(basename "$patch_file")
|
|
41
|
+
# Handle scoped packages: @datalayer+jupyter-lexical+1.0.8.patch -> @datalayer/jupyter-lexical
|
|
42
|
+
pkg_name=$(echo "$filename" | sed 's/+/\//; s/+.*//')
|
|
43
|
+
|
|
44
|
+
if [ ! -d "node_modules/$pkg_name" ]; then
|
|
45
|
+
echo -e "${YELLOW}⚠️ Package $pkg_name not found in local node_modules (may be hoisted in monorepo)${NC}"
|
|
46
|
+
MISSING_PACKAGES=true
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
if [ "$MISSING_PACKAGES" = true ]; then
|
|
52
|
+
echo -e "${YELLOW}⏭️ Skipping patches - packages not in local node_modules (monorepo setup)${NC}"
|
|
53
|
+
exit 0
|
|
54
|
+
fi
|
|
55
|
+
|
|
24
56
|
npx patch-package
|
|
25
57
|
|
|
26
58
|
echo -e "${GREEN}✅ Patches applied successfully${NC}"
|