🧑💻 use yarn instead of npm
This commit is contained in:
parent
e75a46595e
commit
b99fcbc546
13 changed files with 11826 additions and 37582 deletions
|
|
@ -80,7 +80,7 @@ const targetToLanceDb = {
|
|||
for (const target of targets) {
|
||||
if (targetToLanceDb[target]) {
|
||||
console.log(`[info] Downloading ${target}...`);
|
||||
execSync(`npm install -f ${targetToLanceDb[target]} --no-save`);
|
||||
execSync(`yarn install -f ${targetToLanceDb[target]} --no-save`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
2816
binary/package-lock.json
generated
2816
binary/package-lock.json
generated
File diff suppressed because it is too large
Load diff
3515
binary/yarn.lock
Normal file
3515
binary/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
10138
core/package-lock.json
generated
10138
core/package-lock.json
generated
File diff suppressed because it is too large
Load diff
3022
core/yarn.lock
3022
core/yarn.lock
File diff suppressed because it is too large
Load diff
14808
extensions/vscode/package-lock.json
generated
14808
extensions/vscode/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,103 +0,0 @@
|
|||
# Run from extensions/vscode/scripts directory
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def run(cmd, suppress_errors=False):
|
||||
return subprocess.run(cmd, shell=True, capture_output=suppress_errors)
|
||||
|
||||
|
||||
def remove_existing_vsix_files(build_directory):
|
||||
# Ensure build directory exists
|
||||
if not os.path.exists(build_directory):
|
||||
os.mkdir(build_directory)
|
||||
for filename in os.listdir(build_directory):
|
||||
if filename.endswith(".vsix"):
|
||||
file_path = os.path.join(build_directory, filename)
|
||||
os.remove(file_path)
|
||||
|
||||
|
||||
def return_vsix(build_directory):
|
||||
vsix_files = [
|
||||
filename
|
||||
for filename in os.listdir(build_directory)
|
||||
if filename.endswith(".vsix")
|
||||
]
|
||||
return os.path.join(build_directory, vsix_files[0])
|
||||
|
||||
|
||||
def main():
|
||||
# Clear out old stuff
|
||||
build_directory = "../build"
|
||||
remove_existing_vsix_files(build_directory)
|
||||
run("rm ../../../server/continuedev-0.1.2-py3-none-any.whl", True)
|
||||
|
||||
# Check for Python and Node - we won't install them, but will warn
|
||||
resp1 = run("python --version")
|
||||
resp2 = run("python3 --version")
|
||||
if resp1.returncode != 0 and resp2.returncode != 0:
|
||||
print(
|
||||
"Python is required for Continue but is not installed on your machine. See https://www.python.org/downloads/ to download the latest version, then try again."
|
||||
)
|
||||
return
|
||||
|
||||
resp = run("node --version")
|
||||
if resp.returncode != 0:
|
||||
print(
|
||||
"Node is required for Continue but is not installed on your machine. See https://nodejs.org/en/download/ to download the latest version, then try again."
|
||||
)
|
||||
return
|
||||
|
||||
resp = run("npm --version")
|
||||
if resp.returncode != 0:
|
||||
print(
|
||||
"NPM is required for Continue but is not installed on your machine. See https://nodejs.org/en/download/ to download the latest version, then try again."
|
||||
)
|
||||
return
|
||||
|
||||
resp = run("poetry --version")
|
||||
if resp.returncode != 0:
|
||||
print(
|
||||
"Poetry is required for Continue but is not installed on your machine. See https://python-poetry.org/docs/#installation to download the latest version, then try again."
|
||||
)
|
||||
return
|
||||
|
||||
editor_cmd = None
|
||||
editor_name = None
|
||||
for cmd, editor in [("code", "VSCode"), ("codium", "VSCodium")]:
|
||||
resp = run(f"{cmd} --version", True)
|
||||
if resp.returncode == 0:
|
||||
print(f"{editor} version {resp.stdout.decode()}")
|
||||
editor_cmd = cmd
|
||||
editor_name = editor
|
||||
break
|
||||
|
||||
if not editor_cmd:
|
||||
print(
|
||||
"No code editor command is available. Please install a code editor and try again."
|
||||
)
|
||||
return
|
||||
|
||||
resp = run("cd ../../../server; poetry install; poetry run typegen")
|
||||
if resp.returncode != 0:
|
||||
print("Error running the poetry commands. Please try again.")
|
||||
return
|
||||
|
||||
resp = run("cd ..; npm i; cd gui; npm i; cd ..; npm run package", True)
|
||||
if resp.returncode != 0:
|
||||
print("Error packaging the extension. Please try again.")
|
||||
print("stdout: ", resp.stdout.decode())
|
||||
print("stderr: ", resp.stderr.decode())
|
||||
return
|
||||
|
||||
run(
|
||||
f"NODE_OPTIONS='--no-warnings' {editor_cmd} --install-extension {return_vsix(build_directory)}"
|
||||
)
|
||||
print(
|
||||
f"Continue extension installed successfully in {editor_name}. Please restart your editor to use it."
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -102,16 +102,16 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
}
|
||||
|
||||
// Install node_modules //
|
||||
execCmdSync("npm install --no-save");
|
||||
console.log("[info] npm install in extensions/vscode completed");
|
||||
execCmdSync("yarn install --no-save");
|
||||
console.log("[info] yarn install in extensions/vscode completed");
|
||||
|
||||
process.chdir("../../gui");
|
||||
|
||||
execCmdSync("npm install --no-save");
|
||||
console.log("[info] npm install in gui completed");
|
||||
execCmdSync("yarn install --no-save");
|
||||
console.log("[info] yarn install in gui completed");
|
||||
|
||||
if (ghAction()) {
|
||||
execCmdSync("npm run build");
|
||||
execCmdSync("yarn run build");
|
||||
}
|
||||
|
||||
// Copy over the dist folder to the Intellij extension //
|
||||
|
|
@ -293,7 +293,7 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
"darwin-arm64": "@lancedb/vectordb-darwin-arm64",
|
||||
"linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
|
||||
}[target];
|
||||
execCmdSync(`npm install -f ${packageToInstall} --no-save`);
|
||||
execCmdSync(`yarn install -f ${packageToInstall} --no-save`);
|
||||
}
|
||||
|
||||
// Download and unzip esbuild
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
7046
gui/package-lock.json
generated
7046
gui/package-lock.json
generated
File diff suppressed because it is too large
Load diff
6177
gui/yarn.lock
Normal file
6177
gui/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -72,15 +72,15 @@ if (($null -eq $cargo) -or ($null -eq $node) -or ($null -eq $yarn)) {
|
|||
|
||||
Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White
|
||||
Push-Location core
|
||||
npm install
|
||||
npm link
|
||||
yarn install
|
||||
yarn link
|
||||
Pop-Location
|
||||
|
||||
Write-Output "`nInstalling GUI extension dependencies..." -ForegroundColor White
|
||||
Push-Location gui
|
||||
npm install
|
||||
npm link @continuedev/core
|
||||
npm run build
|
||||
yarn install
|
||||
yarn link @continuedev/core
|
||||
yarn run build
|
||||
Pop-Location
|
||||
|
||||
# VSCode Extension (will also package GUI)
|
||||
|
|
@ -88,10 +88,10 @@ Write-Output "`nInstalling VSCode extension dependencies..." -ForegroundColor Wh
|
|||
Push-Location extensions/vscode
|
||||
|
||||
# This does way too many things inline but is the common denominator between many of the scripts
|
||||
npm install
|
||||
npm link @continuedev/core
|
||||
yarn install
|
||||
yarn link @continuedev/core
|
||||
|
||||
npm run package
|
||||
yarn run package
|
||||
|
||||
Pop-Location
|
||||
|
||||
|
|
@ -99,8 +99,8 @@ Pop-Location
|
|||
Write-Output "`nInstalling binary dependencies..." -ForegroundColor White
|
||||
Push-Location binary
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
yarn install
|
||||
yarn run build
|
||||
|
||||
Pop-Location
|
||||
|
||||
|
|
|
|||
|
|
@ -6,28 +6,28 @@
|
|||
set -e
|
||||
echo "Installing Core extension dependencies..."
|
||||
pushd core
|
||||
npm install
|
||||
npm link
|
||||
yarn install
|
||||
yarn link
|
||||
popd
|
||||
|
||||
echo "Installing GUI extension dependencies..."
|
||||
pushd gui
|
||||
npm install
|
||||
npm link @continuedev/core
|
||||
npm run build
|
||||
yarn install
|
||||
yarn link @continuedev/core
|
||||
yarn run build
|
||||
popd
|
||||
# VSCode Extension (will also package GUI)
|
||||
echo "Installing VSCode extension dependencies..."
|
||||
pushd extensions/vscode
|
||||
|
||||
# This does way too many things inline but is the common denominator between many of the scripts
|
||||
npm install
|
||||
npm link @continuedev/core
|
||||
npm run package
|
||||
yarn install
|
||||
yarn link @continuedev/core
|
||||
yarn run package
|
||||
|
||||
popd
|
||||
|
||||
echo "Installing binary dependencies..."
|
||||
pushd binary
|
||||
npm install
|
||||
npm run build
|
||||
yarn install
|
||||
yarn run build
|
||||
Loading…
Add table
Reference in a new issue