Files
next.js/scripts/check-examples.sh
T
1948f5b4ba fix(create-next-app): link to app dir docs in next-env.d.ts in app dir templates (#68534)
Fixes #68533

A link to docs in `next-dev.d.ts` linked to the pages router docs in app
router templates. This was confusing, because some sections on this page
only work with pages router. This PR fixes that

---------

Co-authored-by: Sam Ko <[email protected]>
2024-08-09 22:21:28 +00:00

27 lines
751 B
Bash
Executable File

#!/usr/bin/env bash
for folder in examples/* ; do
if [ -f "$folder/package.json" ]; then
cat $folder/package.json | jq '
.private = true |
del(.license, .version, .name, .author, .description)
' | sponge $folder/package.json
fi
if [ -f "$folder/tsconfig.json" ]; then
if [ -d "$folder/app" ]; then
cp packages/create-next-app/templates/app/ts/next-env.d.ts $folder/next-env.d.ts
else
cp packages/create-next-app/templates/default/ts/next-env.d.ts $folder/next-env.d.ts
fi
fi
if [ ! -f "$folder/.gitignore" ]; then
cp packages/create-next-app/templates/default/js/gitignore $folder/.gitignore;
fi
done;
if [[ ! -z $(git status -s) ]];then
echo "Detected changes"
git status
exit 1
fi