Skip to content

Commit

Permalink
Chore: deno -> 1.33.1 (quarto-dev#5247)
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid authored May 3, 2023
1 parent 2746e0c commit 29a775f
Show file tree
Hide file tree
Showing 617 changed files with 35,523 additions and 72,133 deletions.
2 changes: 1 addition & 1 deletion configuration
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# deno_dom should match release at https://github.com/b-fuze/deno-dom/releases

# Binary dependencies
export DENO=v1.28.2
export DENO=v1.33.1
export DENO_DOM=v0.1.35-alpha-artifacts
export PANDOC=3.1.2
export DARTSASS=1.55.0
Expand Down
1,301 changes: 645 additions & 656 deletions deno.jsonc

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package/scripts/common/quarto
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [ -f "$DEV_PATH" ]; then
fi

# Local import map
QUARTO_IMPORT_ARGMAP=--importmap=$QUARTO_SRC_PATH/dev_import_map.json
QUARTO_IMPORT_ARGMAP=--importmap="$QUARTO_SRC_PATH/dev_import_map.json"

# Turn on type checking for dev version
QUARTO_DENO_OPTIONS=--check
Expand All @@ -57,6 +57,7 @@ if [ -f "$DEV_PATH" ]; then
export QUARTO_BIN_PATH=$SCRIPT_PATH
export QUARTO_SHARE_PATH="${QUARTO_SHARE_PATH=$QUARTO_SRC_PATH/resources/}"
export QUARTO_DEBUG=true
QUARTO_CACHE_OPTIONS="--cached-only"

# Check for deno update
QUARTO_DIST_CONFIG=$QUARTO_BIN_PATH/../config
Expand All @@ -81,10 +82,9 @@ else
QUARTO_ACTION=run
QUARTO_TARGET=${SCRIPT_PATH}/quarto.js
export QUARTO_BIN_PATH=$SCRIPT_PATH
QUARTO_CACHE_OPTIONS=""

QUARTO_IMPORT_ARGMAP=--importmap=$SCRIPT_PATH/vendor/import_map.json

# Turn of type checking for bundled version
# Turn off type checking for bundled version
QUARTO_DENO_OPTIONS=--no-check

# If Quarto is bundled into an `.app` file, it will be looking for the
Expand Down Expand Up @@ -153,6 +153,6 @@ fi

export DENO_NO_UPDATE_CHECK=1
# Be sure to include any already defined QUARTO_DENO_OPTIONS
QUARTO_DENO_OPTIONS="--unstable --no-config --cached-only --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi ${QUARTO_DENO_OPTIONS}"
QUARTO_DENO_OPTIONS="--unstable --no-config ${QUARTO_CACHE_OPTIONS} --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi ${QUARTO_DENO_OPTIONS}"

"${QUARTO_DENO}" ${QUARTO_ACTION} ${QUARTO_DENO_OPTIONS} ${QUARTO_DENO_EXTRA_OPTIONS} "${QUARTO_IMPORT_ARGMAP}" "${QUARTO_TARGET}" "$@"
"${QUARTO_DENO}" ${QUARTO_ACTION} ${QUARTO_DENO_OPTIONS} ${QUARTO_DENO_EXTRA_OPTIONS} ${QUARTO_IMPORT_ARGMAP} "${QUARTO_TARGET}" "$@"
256 changes: 135 additions & 121 deletions package/scripts/deno_std/deno_std.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package/scripts/vendoring/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pushd ${QUARTO_SRC_PATH}
today=`date +%Y-%m-%d`
mv vendor vendor-${today}
set +e
$DENO_BIN_PATH vendor --no-config quarto.ts $QUARTO_ROOT/tests/test-deps.ts --importmap=$QUARTO_SRC_PATH/import_map.json
$DENO_BIN_PATH vendor --no-config quarto.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="$?"
set -e
if [[ ${return_code} -ne 0 ]]; then
Expand Down
18 changes: 11 additions & 7 deletions package/src/common/configure.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* dependencies.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*
*/
* dependencies.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*/
import { dirname, join, SEP } from "path/mod.ts";
import { existsSync } from "node/fs.ts";
import { existsSync } from "fs/mod.ts";
import { ensureDirSync } from "fs/mod.ts";
import { info, warning } from "log/mod.ts";

Expand All @@ -21,7 +20,7 @@ import {
kDependencies,
} from "./dependencies/dependencies.ts";
import { suggestUserBinPaths } from "../../../src/core/env.ts";

import { buildQuartoPreviewJs } from "../../../src/core/previewjs.ts";

export async function configure(
config: Configuration,
Expand All @@ -47,6 +46,11 @@ export async function configure(
}
}

const result = buildQuartoPreviewJs(config.directoryInfo.src);
if (!result.success) {
throw new Error();
}

// Move the quarto script into place
info("Creating Quarto script");
copyQuartoScript(config, config.directoryInfo.bin);
Expand Down
6 changes: 3 additions & 3 deletions package/src/common/create-deno-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expandGlobSync } from "https://deno.land/std@0.178.0/fs/mod.ts";
import { expandGlobSync } from "https://deno.land/std@0.185.0/fs/mod.ts";

const json = JSON.parse(
Deno.readTextFileSync("package/src/common/deno-meta.json"),
Expand All @@ -23,8 +23,8 @@ for (const file of meta.excludeGlobs) {
// drop the current working directory from the paths
excludes = excludes.map((e) => e.replace(Deno.cwd() + "/", ""));

json.lint.files.exclude = excludes;
json.fmt.files.exclude = excludes;
json.lint.exclude = excludes;
json.fmt.exclude = excludes;

console.log("// auto-generated by package/src/common/create-deno-config.ts");
console.log("// see dev-docs/update-deno_jsonc.md");
Expand Down
8 changes: 2 additions & 6 deletions package/src/common/deno-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@
]
},
"lint": {
"files": {
"include": ["src/"]
},
"include": ["src/"],
"rules": {
"exclude": ["require-await", "no-inferrable-types"]
}
},
"fmt": {
"files": {
"include": ["src/"]
}
"include": ["src/"]
}
}
3 changes: 1 addition & 2 deletions package/src/common/dependencies/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/
import { Dependency } from "./dependencies.ts";
import { Configuration } from "../config.ts";
import { join } from "path/mod.ts";
import { dirname } from "../../../../src/vendor/deno.land/[email protected]/path/win32.ts";
import { join, dirname } from "path/mod.ts";
import { unzip } from "../../util/utils.ts";

export function deno(version: string): Dependency {
Expand Down
9 changes: 9 additions & 0 deletions package/src/common/prepare-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "./dependencies/dependencies.ts";
import { copyQuartoScript } from "./configure.ts";
import { deno } from "./dependencies/deno.ts";
import { buildQuartoPreviewJs } from "../../../src/core/previewjs.ts";

export async function prepareDist(
config: Configuration,
Expand Down Expand Up @@ -95,6 +96,14 @@ export async function prepareDist(
}
}

// build quarto-preview.js
info("Building Quarto Web UI");
const result = buildQuartoPreviewJs(config.directoryInfo.src);
if (!result.success) {
throw new Error();
}


// Place the quarto sciprt
// Move the quarto script into place
info("Moving Quarto script");
Expand Down
2 changes: 1 addition & 1 deletion package/src/util/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { writeAll } from "streams/conversion.ts";
import { writeAll } from "streams/write_all.ts";
import { CmdResult, runCmd } from "./cmd.ts";

// Read an environment variable
Expand Down
11 changes: 5 additions & 6 deletions src/command/capabilities/cmd.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* cmd.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*
*/
* cmd.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*/

import { writeAllSync } from "streams/conversion.ts";
import { writeAllSync } from "streams/write_all.ts";

import { Command } from "cliffy/command/mod.ts";
import { capabilities } from "./capabilities.ts";
Expand Down
10 changes: 10 additions & 0 deletions src/command/check/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ async function checkVersions(_services: RenderServices) {
const sassVersion = (await dartCommand(["--version"]))?.trim();
checkVersion(sassVersion, ">=1.32.8", "Dart Sass");

// manually check Deno version without shelling out
// because we're actually running in Deno right now
if (!satisfies(Deno.version.deno, "1.33.1")) {
info(
` NOTE: Deno version ${Deno.version.deno} is too old. Please upgrade to 1.33.1 or later.`,
);
} else {
info(` Deno version ${Deno.version.deno}: OK`);
}

completeMessage("Checking versions of quarto dependencies......OK");
}

Expand Down
11 changes: 5 additions & 6 deletions src/command/convert/cmd.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* cmd.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*
*/
* cmd.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*/

import { existsSync } from "node/fs.ts";
import { existsSync } from "fs/mod.ts";
import { join } from "path/mod.ts";
import { info } from "log/mod.ts";

Expand Down
11 changes: 5 additions & 6 deletions src/command/convert/jupyter.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* jupyter.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*
*/
* jupyter.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*/

import { stringify } from "encoding/yaml.ts";
import { stringify } from "yaml/mod.ts";

import {
partitionYamlFrontMatter,
Expand Down
18 changes: 0 additions & 18 deletions src/command/create/cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { CreateDirective } from "./artifacts/artifact-shared.ts";

import { Command } from "cliffy/command/mod.ts";
import {
Checkbox,
prompt,
Select,
SelectValueOptions,
Expand Down Expand Up @@ -134,14 +133,6 @@ export const createCommand = new Command()
let nextPrompt = resolvedArtifact.nextPrompt(createOptions);
while (nextPrompt !== undefined) {
if (nextPrompt) {
if (
(nextPrompt.type === Select ||
nextPrompt.type === Checkbox) &&
nextPrompt.hint === undefined
) {
nextPrompt.hint = arrowKeyHint();
}

const result = await prompt([nextPrompt]);
createOptions.options = {
...createOptions.options,
Expand Down Expand Up @@ -219,24 +210,15 @@ const resolveArtifact = async (type?: string, prompt?: boolean) => {
};
};

// The hint that is displayed to windows users to work around
// the fact that the arrow keys don't work on Windows.
function arrowKeyHint() {
return Deno.build.os === "windows"
? `ℹ | Next: d, n | Previous: u, p |`
: undefined;
}

// Wrapper that will provide keyboard selection hint (if necessary)
async function promptSelect(
message: string,
options: SelectValueOptions,
) {
const hint = arrowKeyHint();
return await Select.prompt({
message,
options,
hint,
});
}

Expand Down
Loading

0 comments on commit 29a775f

Please sign in to comment.