| 1 | #!/usr/bin/env bash |
| 2 | # This is used in a task in .vscode/tasks.json |
| 3 | # Start developing with: |
| 4 | # - Run Task -> Install Dependencies |
| 5 | # - Debug -> Extension |
| 6 | set -e |
| 7 | |
| 8 | # Check if node version matches .nvmrc |
| 9 | if [ -f .nvmrc ]; then |
| 10 | required_node_version=$(cat .nvmrc) |
| 11 | current_node_version=$(node -v) |
| 12 | |
| 13 | # Remove 'v' prefix from versions for comparison |
| 14 | required_version=${required_node_version#v} |
| 15 | current_version=${current_node_version#v} |
| 16 | |
| 17 | if [ "$required_version" != "$current_version" ]; then |
| 18 | echo "⚠️ Warning: Your Node.js version ($current_node_version) does not match the required version ($required_node_version)" |
| 19 | echo "Please consider switching to the correct version using: nvm use" |
| 20 | |
| 21 | if [ -t 0 ]; then |
| 22 | read -p "Press Enter to continue with installation anyway..." |
| 23 | else |
| 24 | echo "Continuing with installation anyway..." |
| 25 | fi |
| 26 | echo |
| 27 | fi |
| 28 | fi |
| 29 | |
| 30 | echo "Installing root-level dependencies..." |
| 31 | npm install |
| 32 | |
| 33 | echo "Building config-types..." |
| 34 | pushd packages/config-types |
| 35 | npm install |
| 36 | npm run build |
| 37 | popd |
| 38 | |
| 39 | echo "Building fetch..." |
| 40 | pushd packages/fetch |
| 41 | npm install |
| 42 | npm run build |
| 43 | popd |
| 44 | |
| 45 | echo "Building llm-info..." |
| 46 | pushd packages/llm-info |
| 47 | npm install |
| 48 | npm run build |
| 49 | popd |
| 50 | |
| 51 | echo "Building config-yaml..." |
| 52 | pushd packages/config-yaml |
| 53 | npm install |
| 54 | npm run build |
| 55 | popd |
| 56 | |
| 57 | echo "Building openai-adapters..." |
| 58 | pushd packages/openai-adapters |
| 59 | npm install |
| 60 | npm run build |
| 61 | popd |
| 62 | |
| 63 | echo "Building hub..." |
| 64 | pushd packages/hub |
| 65 | npm install |
| 66 | npm run build |
| 67 | popd |
| 68 | |
| 69 | echo "Installing Core extension dependencies..." |
| 70 | pushd core |
| 71 | ## This flag is set because we pull down Chromium at runtime |
| 72 | export PUPPETEER_SKIP_DOWNLOAD='true' |
| 73 | npm install |
| 74 | npm link |
| 75 | popd |
| 76 | |
| 77 | echo "Installing GUI extension dependencies..." |
| 78 | pushd gui |
| 79 | npm install |
| 80 | npm link @continuedev/core |
| 81 | npm run build |
| 82 | popd |
| 83 | |
| 84 | # VSCode Extension (will also package GUI) |
| 85 | echo "Installing VSCode extension dependencies..." |
| 86 | pushd extensions/vscode |
| 87 | # This does way too many things inline but is the common denominator between many of the scripts |
| 88 | npm install |
| 89 | npm link @continuedev/core |
| 90 | # npm run prepackage # not required since npm run package has prescript of prepackage |
| 91 | npm run package |
| 92 | popd |
| 93 | |
| 94 | echo "Installing binary dependencies..." |
| 95 | pushd binary |
| 96 | npm install |
| 97 | npm run build |
| 98 | popd |
| 99 | |
| 100 | echo "Installing docs dependencies..." |
| 101 | pushd docs |
| 102 | npm install |
| 103 | popd |