Skip to content

Commit

Permalink
Update repo scripts to separate folder (vercel#26787)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored Jul 1, 2021
1 parent b508d90 commit 612889d
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
path: ./*
key: ${{ github.sha }}
- run: ./check-pre-compiled.sh
- run: ./scripts/check-pre-compiled.sh
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

testUnit:
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
path: ./*
key: ${{ github.sha }}

- run: bash ./test-pnp.sh
- run: bash ./scripts/test-pnp.sh
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

testsPass:
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
path: ./*
key: ${{ github.sha }}

- run: ./publish-release.sh
- run: ./scripts/publish-release.sh

prStats:
name: Release Stats
Expand All @@ -263,7 +263,7 @@ jobs:
with:
path: ./*
key: ${{ github.sha }}
- run: ./release-stats.sh
- run: ./scripts/release-stats.sh
- uses: ./.github/actions/next-stats-action
env:
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"publish-canary": "lerna version prerelease --preid canary --force-publish && release --pre --skip-questions",
"publish-stable": "lerna version --force-publish",
"lint-staged": "lint-staged",
"next-with-deps": "./scripts/next-with-deps.sh",
"next": "node --trace-deprecation --enable-source-maps packages/next/dist/bin/next",
"debug": "node --inspect packages/next/dist/bin/next"
},
Expand Down
2 changes: 0 additions & 2 deletions check-examples.sh → scripts/check-examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

cd `dirname $0`

for folder in examples/* ; do
cp -n packages/create-next-app/templates/default/gitignore $folder/.gitignore;
if [ -f "$folder/package.json" ]; then
Expand Down
File renamed without changes.
39 changes: 39 additions & 0 deletions scripts/next-with-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

START_DIR=$PWD
# gets last argument which should be the project dir
for PROJECT_DIR in $@;do :;done

if [ -z $PROJECT_DIR ];then
echo "No project directory provided, exiting..."
exit 1;
fi;

if [ ! -d $PROJECT_DIR ];then
echo "Invalid project directory provided, exiting..."
exit 1;
fi;

if [ $PROJECT_DIR == $PWD ] || [ "$PROJECT_DIR" == "." ];then
echo "Project directory can not be root, exiting..."
exit 1;
fi;

CONFLICTING_DEPS=("react" "react-dom" "styled-jsx" "next")

for dep in ${CONFLICTING_DEPS[@]};do
if [ -d "$PROJECT_DIR/node_modules/$dep" ];then
HAS_CONFLICTING_DEP="yup"
fi;
done

if [ ! -z $HAS_CONFLICTING_DEP ] || [ ! -d "$PROJECT_DIR/node_modules" ];then
cd $PROJECT_DIR
yarn install
for dep in ${CONFLICTING_DEPS[@]};do
rm -rf node_modules/$dep
done
fi

cd $START_DIR
yarn next $@
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 10 additions & 1 deletion skip-docs-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ const { exec: execOrig, spawn } = require('child_process')

const exec = promisify(execOrig)

const DOCS_FOLDERS = ['bench', 'docs', 'errors', 'examples']
const DOCS_FOLDERS = [
'bench',
'docs',
'errors',
'examples',
'UPGRADING.md',
'contributing.md',
'CODE_OF_CONDUCT.md',
'readme.md',
]

async function main() {
await exec('git fetch origin canary')
Expand Down

0 comments on commit 612889d

Please sign in to comment.