Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
febb5e3
chore - deno 2 deps refresh (tar)
cscheid Apr 18, 2025
b44cb08
turn on cached-only for dev as well, add puppeteer deps to cache
cscheid Apr 18, 2025
709ffd6
chore - pin deno 2 imports to specific versions
cscheid Apr 18, 2025
5e2a787
chore - deno 2 fmt
cscheid Apr 18, 2025
ada4c7d
chore - deno 2 dotenv
cscheid Apr 18, 2025
e8fb291
chore - deno 2 path
cscheid Apr 18, 2025
a53dc03
chore - deno 2 dotenv
cscheid Apr 18, 2025
0cee610
chore - deno 2 imports
cscheid Apr 18, 2025
d210c74
Merge branch 'main' into feature/deno-2-deps
cscheid Apr 22, 2025
6b38b62
chore - deno 2 quarto check version check
cscheid Apr 22, 2025
927baa8
deno 2 - one more vendor dep
cscheid Apr 22, 2025
462b0c7
chore - another attempt at caching vendor deps
cscheid Apr 22, 2025
76bb9cd
chore - more deno 2 import map changes
cscheid Apr 22, 2025
09bd126
chore - deno 2, no more explicit vendoring
cscheid Apr 22, 2025
5dec624
chore - deno 2, no more vendoring
cscheid Apr 22, 2025
7016dbc
chore - deno 2, fix deno install typo
cscheid Apr 22, 2025
3cf06b1
do not clean vendor
cscheid Apr 22, 2025
f1e8082
add --allow-import to windows configuration
cscheid Apr 22, 2025
d1760c4
now installing deps since that's necessary
cscheid Apr 23, 2025
98b6abe
github - use GHA workflow commands to group logs
cscheid Apr 23, 2025
ec3f647
@actions doesn't work on deno, roll our own
cscheid Apr 23, 2025
b968525
chore - deno 2, print DENO_DIR in CI
cscheid Apr 23, 2025
c6235ef
deno 2 - pull puppeteer in
cscheid Apr 23, 2025
bbc8947
update bundler to trim error that confuses eslint
cscheid Apr 23, 2025
b595819
chore - deno 2: vendor dependencies on configuration
cscheid Apr 23, 2025
c553047
chore - deno 2: no more dev_import_map.json
cscheid Apr 23, 2025
3625e76
hopefully better path for CI
cscheid Apr 23, 2025
b8f5731
remove newlines because deno's base64 decoder became more strict
cscheid Apr 23, 2025
13f186d
update dev docs
cscheid Apr 23, 2025
6c51b61
configure.sh - simplify vendoring calls, shellcheck
cscheid Apr 24, 2025
d90fa30
use correct function to check for CI
cscheid Apr 24, 2025
a2baa96
merge
cscheid May 6, 2025
03ce719
pushd instead of cd
cscheid May 6, 2025
9c20ea8
[CI debug] - attempting to diagnose windows failure
cscheid May 6, 2025
64fcc48
invalidate ci cache
cscheid May 6, 2025
9c4bf64
remove all but last retrieval
cscheid May 6, 2025
8b39db5
Set `Deno.execPath()` inside Windows PATH so that `deno task` can fin…
cderv May 6, 2025
a414807
vendor dependencies on windows too
cderv May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions .github/workflows/actions/quarto-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ runs:
uses: actions/cache@v4
with:
path: ./src/resources/deno_std/cache
key: ${{ runner.os }}-deno_std-1-${{ hashFiles('./src/resources/deno_std/deno_std.lock', './package/scripts/deno_std/deno_std.ts') }}
key: ${{ runner.os }}-deno_std-2-${{ hashFiles('./src/resources/deno_std/deno_std.lock', './package/scripts/deno_std/deno_std.ts') }}
restore-keys: |
${{ runner.os }}-deno_std-1-
${{ runner.os }}-deno_std-
${{ runner.os }}-deno_std-2-

- name: Configure Quarto (.sh)
if: runner.os != 'Windows'
Expand Down
22 changes: 3 additions & 19 deletions configure.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,14 @@ echo Configuration done

POPD

if "%CI%" NEQ "true" (
echo Revendoring quarto dependencies

@REM for /F "tokens=2" %%i in ('date /t') do set today=%%i
@REM RENAME src\vendor src\vendor-%today%
@REM pushd src
@REM echo Vendor phase 1
@REM %QUARTO_DENO% vendor quarto.ts %QUARTO_ROOT%\tests\test-deps.ts --importmap=import_map.json
@REM if ERRORLEVEL NEQ 0 (
@REM popd
@REM echo deno vendor failed (likely because of a download error). Please run the configure script again.
@REM RMDIR vendor
@REM RENAME vendor-${today} vendor
@REM exit 1
@REM )
@REM popd
@REM %QUARTO_DENO% run --unstable --allow-all --importmap=src\import_map.json package\src\common\create-dev-import-map.ts
)
REM download typescript dependencies
CALL package\scripts\vendoring\vendor.cmd

ECHO Downloading Deno Stdlib
CALL !QUARTO_PACKAGE_PATH!\scripts\deno_std\download.bat

SET QUARTO_DENO_EXTRA_OPTIONS="--reload"
IF EXIST !QUARTO_BIN_PATH!\quarto.cmd (
SET QUARTO_DENO_EXTRA_OPTIONS=--reload
CALL "!QUARTO_BIN_PATH!\quarto" --version
)

Expand Down
44 changes: 28 additions & 16 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,58 @@ function download() {

QUARTO_VENDOR_BINARIES=${QUARTO_VENDOR_BINARIES=true}

DENO_BIN=${QUARTO_DENO=$QUARTO_BIN_PATH/tools/$DENO_DIR/deno}
DENO_BIN=${QUARTO_DENO=$QUARTO_BIN_PATH/tools/$DENO_ARCH_DIR/deno}

if [[ "${QUARTO_VENDOR_BINARIES}" = "true" ]]; then
DENO_VERSION_NO_V=$(echo $DENO | sed 's/v//')
if [[ (! -f "$DENO_BIN") || $("$DENO_BIN" --version | grep $DENO_VERSION_NO_V) == "" ]]; then
DENO_VERSION_NO_V=$(echo "$DENO" | sed 's/v//')
if [[ (! -f "$DENO_BIN") || $("$DENO_BIN" --version | grep "$DENO_VERSION_NO_V") == "" ]]; then
# Ensure directory is there for Deno
echo "Bootstrapping Deno..."

rm -rf $QUARTO_DIST_PATH
rm -rf "$QUARTO_DIST_PATH"

## Binary Directory
mkdir -p "$QUARTO_BIN_PATH/tools"
cd $QUARTO_BIN_PATH/tools
pushd "$QUARTO_BIN_PATH/tools"

# Download Deno
for DENOFILE in $DENOFILES; do
download "$DENOURL/$DENO/$DENOFILE" "$DENOFILE"
unzip -o $DENOFILE

mkdir -p $DENO_DIR
mv deno $DENO_DIR
rm $DENOFILE
unzip -o "$DENOFILE"
mkdir -p "$DENO_ARCH_DIR"
mv deno "$DENO_ARCH_DIR"
rm "$DENOFILE"
done

# we create a symlink here so that we need only one quarto-cli.code-workspace file
ln -s $DENO_DIR/deno deno
ln -s $DENO_ARCH_DIR/deno deno

# If a canary commit is provided, upgrade to that
if [ ! -z "$DENO_CANARY_COMMIT" ]; then
if [ -n "$DENO_CANARY_COMMIT" ]; then
echo [Upgrading Deno to Canary]
./deno upgrade --canary --version $DENO_CANARY_COMMIT
./deno upgrade --canary --version "$DENO_CANARY_COMMIT"
fi

# write deno version file for later use
mkdir -p $QUARTO_BIN_PATH/../config
echo $DENO > $QUARTO_BIN_PATH/../config/deno-version
mkdir -p "$QUARTO_BIN_PATH/../config"
echo "$DENO" > "$QUARTO_BIN_PATH/../config/deno-version"

popd
fi
export DENO_BIN_PATH=$QUARTO_BIN_PATH/tools/$DENO_DIR/deno
export DENO_BIN_PATH=$QUARTO_BIN_PATH/tools/$DENO_ARCH_DIR/deno
else
if [ -z "$DENO_BIN_PATH" ]; then
echo "DENO_BIN_PATH is not set. You either need to allow QUARTO_VENDOR_BINARIES or set DENO_BIN_PATH to the path of a deno binary."
exit 1
fi
fi

if [ "$QUARTO_DENO_DIR" == "" ]; then
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache
else
export DENO_DIR=$QUARTO_DENO_DIR
fi

echo "Downloading Deno Stdlib"
"${QUARTO_PACKAGE_PATH}/scripts/deno_std/download.sh"

Expand All @@ -82,6 +89,11 @@ pushd "$QUARTO_PACKAGE_PATH/src/"
# Run the configure command to bootstrap installation
./quarto-bld configure --log-level info

popd

# download typescript dependencies
source package/scripts/vendoring/vendor.sh

# Run the quarto command with 'reload', which will force the import_map dependencies
# to be reloaded
if ! quarto_loc="$(type -p quarto)" || [[ -z $quarto_loc ]]; then
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/add-typescript-dependency.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ We vendor all external dependencies to avoid downloads during the execution of q

- If the dependency is meant to be exposed to quarto typescript script (through `quarto run`), then add the import to `package/scripts/deno_std/deno_std.ts` as well (notice the slightly different syntax there, and adapt accordingly).

Then, run the `./package/scripts/vendoring/vendor.sh` scripts to update the vendored dependencies. This script will update `src/dev_import_map.json`, as well as files in `src/vendor`, `src/resources/deno_std`, and `src/resources/vendor`. Check those changes in version control.
Then, rerun `./configure.sh`, which calls the `./package/scripts/vendoring/vendor.sh` scripts to update the deno cache with the downloaded dependencies.
2 changes: 1 addition & 1 deletion dev-docs/upgrade-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Contact Carlos so he uploads the binaries to the S3 bucket.

- In `src/import_map.json`, change the version number of the imports like `https://deno.land/[email protected]/archive` to the new version number (e.g. `0.205.0`).

- run `./package/scripts/vendoring/vendor.sh`
- run `./configure.sh`.

### Upgrade Deno download link for RHEL build from conda-forge

Expand Down
15 changes: 7 additions & 8 deletions package/scripts/common/quarto
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ else
fi
QUARTO_SRC_PATH="$QUARTO_ROOT/src"
DEV_PATH=$QUARTO_SRC_PATH/quarto.ts
QUARTO_IMPORT_MAP_ARG=--importmap=$QUARTO_SRC_PATH/import_map.json

if [ -f "$DEV_PATH" ]; then
if [ "$1" == "--version" ] || [ "$1" == "-v" ]; then
if [ "$QUARTO_FORCE_VERSION" != "" ]; then
Expand All @@ -48,9 +50,6 @@ if [ -f "$DEV_PATH" ]; then
QUARTO_ACTION=run
fi

# Local import map
QUARTO_IMPORT_MAP_ARG=--importmap=$QUARTO_SRC_PATH/import_map.json

# Turn on type checking for dev version
if [ -z ${QUARTO_NO_TYPECHECK+x} ]; then
QUARTO_DENO_OPTIONS=--check
Expand All @@ -63,10 +62,12 @@ if [ -f "$DEV_PATH" ]; then

export QUARTO_BIN_PATH=$SCRIPT_PATH
export QUARTO_SHARE_PATH="${QUARTO_SHARE_PATH=$QUARTO_SRC_PATH/resources/}"
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache

if [ -z ${QUARTO_DEBUG+x} ]; then
export QUARTO_DEBUG=true
fi
# QUARTO_CACHE_OPTIONS="--cached-only"
QUARTO_CACHE_OPTIONS="--cached-only"

# Check for deno update
QUARTO_DIST_CONFIG=$QUARTO_BIN_PATH/../config
Expand All @@ -91,7 +92,8 @@ else
QUARTO_ACTION=run
QUARTO_TARGET=${SCRIPT_PATH}/quarto.js
export QUARTO_BIN_PATH=$SCRIPT_PATH
QUARTO_CACHE_OPTIONS=""
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache
QUARTO_CACHE_OPTIONS="--cached-only"

# Turn off type checking for bundled version
QUARTO_DENO_OPTIONS=--no-check
Expand All @@ -108,9 +110,6 @@ else
fi
fi

# release vendored import map
QUARTO_IMPORT_MAP_ARG=--importmap=$SCRIPT_PATH/vendor/import_map.json

if [ "$1" == "--version" ] || [ "$1" == "-v" ]; then
if [ "$QUARTO_FORCE_VERSION" != "" ]; then
echo $QUARTO_FORCE_VERSION
Expand Down
10 changes: 5 additions & 5 deletions package/scripts/common/utils.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# DENOFILES is only required at configure.sh, but DENO_DIR is used in many places
# DENOFILES is only required at configure.sh, but DENO_ARCH_DIR is used in many places

if [[ $OSTYPE == 'darwin'* ]]; then
DENOURL=https://github.com/denoland/deno/releases/download
FULLARCH=$(uname -sm)


if [[ $FULLARCH == "Darwin x86_64" ]]; then
DENO_DIR=x86_64
DENO_ARCH_DIR=x86_64
DENOFILES="deno-x86_64-apple-darwin.zip"
elif [[ $FULLARCH == "Darwin arm64" ]]; then
DENO_DIR=aarch64
DENO_ARCH_DIR=aarch64
DENOFILES="deno-aarch64-apple-darwin.zip"
else
echo "configure script failed: unrecognized architecture " ${FULLARCH}
Expand All @@ -21,11 +21,11 @@ else
if [[ $NIXARCH == "x86_64" ]]; then
DENOURL=https://github.com/denoland/deno/releases/download
DENOFILES=deno-x86_64-unknown-linux-gnu.zip
DENO_DIR=x86_64
DENO_ARCH_DIR=x86_64
elif [[ $NIXARCH == "aarch64" ]]; then
DENOURL=https://github.com/denoland/deno/releases/download
DENOFILES=deno-aarch64-unknown-linux-gnu.zip
DENO_DIR=aarch64
DENO_ARCH_DIR=aarch64
else
echo "configure script failed: unrecognized architecture " ${NIXARCH}
exit 1
Expand Down
2 changes: 1 addition & 1 deletion package/scripts/deno_std/download.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ if NOT DEFINED QUARTO_DENO (
)

set DENO_DIR=%~dp0\..\..\..\src\resources\deno_std\cache
%QUARTO_DENO% cache --unstable-ffi --lock %~dp0\..\..\..\src\resources\deno_std\deno_std.lock %~dp0\deno_std.ts
%QUARTO_DENO% cache --allow-import --unstable-ffi --lock %~dp0\..\..\..\src\resources\deno_std\deno_std.lock %~dp0\deno_std.ts
2 changes: 1 addition & 1 deletion package/scripts/deno_std/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "$SCRIPT_PATH/../../../configuration"
source "$SCRIPT_PATH/../../src/set_package_paths.sh"

if [ -z "$QUARTO_DENO" ]; then
export QUARTO_DENO="$QUARTO_DIST_PATH/bin/tools/$DENO_DIR/deno"
export QUARTO_DENO="$QUARTO_DIST_PATH/bin/tools/$DENO_ARCH_DIR/deno"
fi


Expand Down
36 changes: 36 additions & 0 deletions package/scripts/vendoring/vendor.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF
REM You should not need to run this script directly.
REM It is sourced by the configure.cmd script.
SETLOCAL ENABLEDELAYEDEXPANSION

IF "%QUARTO_VENDOR_BINARIES%"=="true" (
SET DENO_BIN_PATH=!QUARTO_BIN_PATH!\tools\!DENO_ARCH_DIR!\deno.exe
) ELSE (
IF NOT DEFINED DENO_BIN_PATH (
ECHO DENO_BIN_PATH is not set. You either need to allow QUARTO_VENDOR_BINARIES or set DENO_BIN_PATH to the path of a deno binary.
EXIT /B 1
)
)

IF NOT DEFINED DENO_DIR (
SET DENO_DIR=!QUARTO_BIN_PATH!\deno_cache
)

ECHO Revendoring quarto dependencies

REM remove deno_cache directory first
IF EXIST "!DENO_DIR!" (
RMDIR /S /Q "!DENO_DIR!"
)

PUSHD "!QUARTO_SRC_PATH!"

FOR %%E IN (quarto.ts vendor_deps.ts ..\tests\test-deps.ts ..\package\scripts\deno_std\deno_std.ts) DO (
CALL !DENO_BIN_PATH! install --allow-all --no-config --entrypoint %%E --importmap="!QUARTO_SRC_PATH!\import_map.json"
)

REM Return to the original directory
POPD


EXIT /B 0
53 changes: 16 additions & 37 deletions package/scripts/vendoring/vendor.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,29 @@
#!/usr/bin/env bash

source configuration

# Defaults are set in configuration file, but can be overridden here.
# We can't put these overrides in the configuration file because it is parsed
# very naively on windows.
export DENO=${DENO_VERSION=$DENO}
export DENO_DOM=${DENO_DOM_VERSION=$DENO_DOM}
export PANDOC=${PANDOC_VERSION=$PANDOC}
export DARTSASS=${DART_SASS_VERSION=$DARTSASS}
export ESBUILD=${ESBUILD_VERSION=$ESBUILD}
export TYPST=${TYPST_VERSION=$TYPST}

source package/scripts/common/utils.sh
source package/src/set_package_paths.sh

QUARTO_VENDOR_BINARIES=${QUARTO_VENDOR_BINARIES=true}

DENO_BIN=${QUARTO_DENO=$QUARTO_BIN_PATH/tools/$DENO_DIR/deno}

# You should not need to run this script directly.
# It is sourced by the configure.sh script.
if [[ "${QUARTO_VENDOR_BINARIES}" = "true" ]]; then
export DENO_BIN_PATH=$QUARTO_BIN_PATH/tools/$DENO_DIR/deno
export DENO_BIN_PATH=$QUARTO_BIN_PATH/tools/$DENO_ARCH_DIR/deno
else
if [ -z "$DENO_BIN_PATH" ]; then
echo "DENO_BIN_PATH is not set. You either need to allow QUARTO_VENDOR_BINARIES or set DENO_BIN_PATH to the path of a deno binary."
exit 1
fi
fi

if [ -z "$DENO_DIR" ]; then
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache
fi

echo Revendoring quarto dependencies

pushd ${QUARTO_SRC_PATH}
today=`date +%Y-%m-%d`
mv vendor vendor-${today}
# remove deno_cache directory first
if [ -d "$DENO_DIR" ]; then
rm -rf "$DENO_DIR"
fi

pushd "${QUARTO_SRC_PATH}"
set +e
$DENO_BIN_PATH vendor --no-config quarto.ts $QUARTO_ROOT/src/vendor_deps.ts $QUARTO_ROOT/tests/test-deps.ts $QUARTO_ROOT/package/scripts/deno_std/deno_std.ts --importmap=$QUARTO_SRC_PATH/import_map.json
return_code="$?"
for entrypoint in quarto.ts vendor_deps.ts ../tests/test-deps.ts ../package/scripts/deno_std/deno_std.ts; do
$DENO_BIN_PATH install --allow-all --no-config --entrypoint $entrypoint "--importmap=$QUARTO_SRC_PATH/import_map.json"
done
set -e
if [[ ${return_code} -ne 0 ]]; then
echo "deno vendor failed (likely because of a download error). Please run the configure script again."
rm -rf vendor
mv vendor-${today} vendor
exit 1
else
rm -rf vendor-${today}
fi
$DENO_BIN_PATH run --no-config --unstable-ffi --allow-all --importmap=$QUARTO_SRC_PATH/import_map.json $QUARTO_PACKAGE_PATH/src/common/create-dev-import-map.ts
popd
source configure.sh
Loading
Loading