jsx: trade yarn for npm

we're already using npm at the top-level, using both yarn and npm complicates things

- stop excluding package-lock.json from the repo
This commit is contained in:
Min RK
2023-10-03 13:10:07 +02:00
parent 5deb594933
commit c689ec726d
9 changed files with 10583 additions and 6690 deletions

View File

@@ -198,32 +198,26 @@ class JSX(BaseCommand):
print("JSX admin app is up to date")
return
# jlpm is a version of yarn bundled with JupyterLab
if shutil.which('yarn'):
yarn = 'yarn'
elif shutil.which('jlpm'):
print("yarn not found, using jlpm")
yarn = 'jlpm'
else:
raise Exception('JSX needs to be updated but yarn is not installed')
if not shutil.which('npm'):
raise Exception('JSX needs to be updated but npm is not installed')
print("Installing JSX admin app requirements")
check_call(
[yarn],
['npm', 'install', '--progress=false', '--unsafe-perm'],
cwd=self.jsx_dir,
shell=shell,
)
print("Building JSX admin app")
check_call(
[yarn, 'build'],
["npm", "run", "build"],
cwd=self.jsx_dir,
shell=shell,
)
print("Copying JSX admin app to static/js")
check_call(
[yarn, 'place'],
["npm", "run", "place"],
cwd=self.jsx_dir,
shell=shell,
)