parent
7aba00b372
commit
eabf52f61b
3 changed files with 47 additions and 3 deletions
@ -0,0 +1,14 @@ |
||||
export function ReadonlyEditor(props: any) { |
||||
return ( |
||||
<div className="fixed bottom-0 left-0 right-0 top-0 z-[9999] border bg-white p-5 text-black"> |
||||
<h2 className="mb-2 text-xl font-semibold">Private Component</h2> |
||||
<p className="mb-4"> |
||||
Renderer is a private component. If you are a collaborator and have |
||||
access to it. Run the following command: |
||||
</p> |
||||
<code className="mt-5 rounded-md bg-gray-800 p-2 text-white"> |
||||
npm run generate-renderer |
||||
</code> |
||||
</div> |
||||
); |
||||
} |
@ -0,0 +1,32 @@ |
||||
-#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
|
||||
# ignore cloning if .temp/web-draw already exists |
||||
if [ ! -d ".temp/web-draw" ]; then |
||||
mkdir -p .temp |
||||
git clone git@github.com:roadmapsh/web-draw.git .temp/web-draw |
||||
fi |
||||
|
||||
rm -rf editor |
||||
mkdir editor |
||||
|
||||
# copy the files at /src/editor/* to /editor |
||||
# while replacing any existing files |
||||
cp -rf .temp/web-draw/src/editor/* editor |
||||
|
||||
# Add @ts-nocheck to the top of each ts and tsx file |
||||
# so that the typescript compiler doesn't complain |
||||
# about the missing types |
||||
find editor -type f \( -name "*.ts" -o -name "*.tsx" \) -print0 | while IFS= read -r -d '' file; do |
||||
if [ -f "$file" ]; then |
||||
echo "// @ts-nocheck" > temp |
||||
cat "$file" >> temp |
||||
mv temp "$file" |
||||
echo "Added @ts-nocheck to $file" |
||||
fi |
||||
done |
||||
|
||||
|
||||
# ignore the worktree changes for the editor directory |
||||
git update-index --skip-worktree editor/* |
Loading…
Reference in new issue