Skip to content

Commit b44cb08

Browse files
committed
turn on cached-only for dev as well, add puppeteer deps to cache
1 parent febb5e3 commit b44cb08

6 files changed

Lines changed: 24 additions & 19 deletions

File tree

package/scripts/common/quarto

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ else
3333
fi
3434
QUARTO_SRC_PATH="$QUARTO_ROOT/src"
3535
DEV_PATH=$QUARTO_SRC_PATH/quarto.ts
36+
QUARTO_IMPORT_MAP_ARG=--importmap=$QUARTO_SRC_PATH/import_map.json
37+
3638
if [ -f "$DEV_PATH" ]; then
3739
if [ "$1" == "--version" ] || [ "$1" == "-v" ]; then
3840
if [ "$QUARTO_FORCE_VERSION" != "" ]; then
@@ -48,9 +50,6 @@ if [ -f "$DEV_PATH" ]; then
4850
QUARTO_ACTION=run
4951
fi
5052

51-
# Local import map
52-
QUARTO_IMPORT_MAP_ARG=--importmap=$QUARTO_SRC_PATH/import_map.json
53-
5453
# Turn on type checking for dev version
5554
if [ -z ${QUARTO_NO_TYPECHECK+x} ]; then
5655
QUARTO_DENO_OPTIONS=--check
@@ -63,10 +62,12 @@ if [ -f "$DEV_PATH" ]; then
6362

6463
export QUARTO_BIN_PATH=$SCRIPT_PATH
6564
export QUARTO_SHARE_PATH="${QUARTO_SHARE_PATH=$QUARTO_SRC_PATH/resources/}"
65+
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache
66+
6667
if [ -z ${QUARTO_DEBUG+x} ]; then
6768
export QUARTO_DEBUG=true
6869
fi
69-
# QUARTO_CACHE_OPTIONS="--cached-only"
70+
QUARTO_CACHE_OPTIONS="--cached-only"
7071

7172
# Check for deno update
7273
QUARTO_DIST_CONFIG=$QUARTO_BIN_PATH/../config
@@ -91,7 +92,8 @@ else
9192
QUARTO_ACTION=run
9293
QUARTO_TARGET=${SCRIPT_PATH}/quarto.js
9394
export QUARTO_BIN_PATH=$SCRIPT_PATH
94-
QUARTO_CACHE_OPTIONS=""
95+
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache
96+
QUARTO_CACHE_OPTIONS="--cached-only"
9597

9698
# Turn off type checking for bundled version
9799
QUARTO_DENO_OPTIONS=--no-check
@@ -108,9 +110,6 @@ else
108110
fi
109111
fi
110112

111-
# release vendored import map
112-
QUARTO_IMPORT_MAP_ARG=--importmap=$SCRIPT_PATH/vendor/import_map.json
113-
114113
if [ "$1" == "--version" ] || [ "$1" == "-v" ]; then
115114
if [ "$QUARTO_FORCE_VERSION" != "" ]; then
116115
echo $QUARTO_FORCE_VERSION

package/scripts/vendoring/vendor.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,20 @@ else
2727
exit 1
2828
fi
2929
fi
30+
export DENO_DIR=$QUARTO_BIN_PATH/deno_cache
3031

3132
echo Revendoring quarto dependencies
3233

34+
# remove deno_cache directory first
35+
if [ -d "$DENO_DIR" ]; then
36+
rm -rf $DENO_DIR
37+
fi
38+
3339
pushd ${QUARTO_SRC_PATH}
34-
today=`date +%Y-%m-%d`
35-
mv vendor vendor-${today}
3640
set +e
37-
$DENO_BIN_PATH install --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
38-
# FINISHME We need to move the vendor directory from .. to ./ after this is run.
41+
for entrypoint in quarto.ts vendor_deps.ts ../tests/test-deps.ts ../package/scripts/deno_std/deno_std.ts; do
42+
$DENO_BIN_PATH install --allow-all --no-config --entrypoint $entrypoint $QUARTO_ROOT/package/scripts/deno_std/deno_std.ts --importmap=$QUARTO_SRC_PATH/import_map.json
43+
done
3944
return_code="$?"
4045
set -e
4146
if [[ ${return_code} -ne 0 ]]; then
@@ -46,6 +51,5 @@ if [[ ${return_code} -ne 0 ]]; then
4651
else
4752
rm -rf vendor-${today}
4853
fi
49-
$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
5054
popd
5155
source configure.sh

src/command/render/pandoc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ import {
196196
createMarkdownPipeline,
197197
MarkdownPipelineHandler,
198198
} from "../../core/markdown-pipeline.ts";
199-
import { getEnv } from "../../../package/src/util/utils.ts";
199+
import { getenv } from "../../core/env.ts";
200200
import {
201201
BrandFontBunny,
202202
BrandFontFile,
@@ -351,7 +351,7 @@ export async function runPandoc(
351351
// load the system lua libraries, which may not be compatible with
352352
// the lua version we are using
353353
if (Deno.env.get("QUARTO_LUA_CPATH") !== undefined) {
354-
pandocEnv["LUA_CPATH"] = getEnv("QUARTO_LUA_CPATH");
354+
pandocEnv["LUA_CPATH"] = getenv("QUARTO_LUA_CPATH");
355355
} else {
356356
pandocEnv["LUA_CPATH"] = "";
357357
}

src/core/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class StdErrOutputHandler extends BaseHandler {
156156

157157
return msg;
158158
}
159-
log(msg: string): void {
159+
override log(msg: string): void {
160160
const encoder = new TextEncoder();
161161
const data = encoder.encode(msg);
162162

src/import_map.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
"fmt/": "jsr:/@std/fmt@^0.224.0/",
1414
"fs/": "jsr:/@std/fs@^0.224.0/",
1515
"http/": "jsr:/@std/http@^0.224.0/",
16-
"io/": "jsr:/@std/io@^0.224.0/",
17-
"log": "jsr:/@std/log@^0.224.0",
18-
"log/": "jsr:/@std/log@^0.224.0/",
16+
"io": "jsr:/@std/io@0.224.0",
17+
"io/": "jsr:/@std/io@0.224.0/",
18+
"log": "jsr:/@std/log@0.224.0",
19+
"log/": "jsr:/@std/log@0.224.0/",
1920
"node/": "jsr:/@std/node@^0.224.0/",
2021
"path": "jsr:@std/path@^0.224.0",
2122
"permissions/": "jsr:/@std/permissions@^0.224.0/",

src/vendor_deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ This is only used by vendor.sh and should not be imported by any other code.
99

1010
// for puppeteer
1111
import { dirname, join, SEP } from "https://deno.land/std@0.93.0/path/mod.ts";
12+
import puppeteer from "https://deno.land/x/puppeteer@9.0.2/mod.ts";

0 commit comments

Comments
 (0)