Skip to content

Commit

Permalink
Merge branch 'main' into magurotuna/deno-test-doc-actually-run
Browse files Browse the repository at this point in the history
  • Loading branch information
magurotuna committed Sep 13, 2024
2 parents fbc7b8e + f2b53d4 commit 50d87d3
Show file tree
Hide file tree
Showing 234 changed files with 997 additions and 882 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
name: promote_to_rc
name: promote_to_release

on:
workflow_dispatch:
inputs:
releaseKind:
description: 'Kind of release'
type: choice
options:
- rc
- lts
required: true
commitHash:
description: Commit to promote to the Release Candidate
description: Commit to promote to release
required: true

jobs:
promote-to-rc:
name: Promote to Release Candidate
promote-to-release:
name: Promote to Release
runs-on: macOS-latest
if: github.repository == 'denoland/deno'
steps:
Expand Down Expand Up @@ -42,14 +49,14 @@ jobs:
./tools/install_prebuilt.js rcodesign
echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
- name: Promote to RC
- name: Promote to Release
env:
APPLE_CODESIGN_KEY: '${{ secrets.APPLE_CODESIGN_KEY }}'
APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
run: |
deno run -A ./tools/release/promote_to_rc.ts ${{github.event.inputs.commitHash}}
deno run -A ./tools/release/promote_to_release.ts ${{github.event.inputs.releaseKind}} ${{github.event.inputs.commitHash}}
- name: Upload archives to dl.deno.land
run: |
gsutil -h "Cache-Control: public, max-age=3600" cp ./*.zip gs://dl.deno.land/release/$(cat release-rc-latest.txt)/
gsutil -h "Cache-Control: no-cache" cp release-rc-latest.txt gs://dl.deno.land/release-rc-latest.txt
gsutil -h "Cache-Control: public, max-age=3600" cp ./*.zip gs://dl.deno.land/release/$(cat release-${{github.event.inputs.commitHash}}-latest.txt)/
gsutil -h "Cache-Control: no-cache" cp release-${{github.event.inputs.commitHash}}-latest.txt gs://dl.deno.land/release-${{github.event.inputs.commitHash}}-latest.txt
58 changes: 44 additions & 14 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ Evaluate the given files, run all benches declared with 'Deno.bench()' and repor
If you specify a directory instead of a file, the path is expanded to all contained files matching the glob <c>{*_,*.,}bench.{js,mjs,ts,mts,jsx,tsx}</>:
<p(245)>deno bench src/</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/bench</>"),
<y>Read more:</> <c>https://docs.deno.com/go/bench</>"),
UnstableArgsConfig::ResolutionAndRuntime,
)
.defer(|cmd| {
Expand Down Expand Up @@ -1724,7 +1724,7 @@ Download and compile a module with all of its static dependencies and save them
Future runs of this module will trigger no downloads or compilation unless --reload is specified
<y>Read more:</> <c>https://docs.deno.com/go/cmd/cache</>"),
<y>Read more:</> <c>https://docs.deno.com/go/cache</>"),
UnstableArgsConfig::ResolutionOnly,
)
.defer(|cmd| {
Expand Down Expand Up @@ -1757,7 +1757,7 @@ fn check_subcommand() -> Command {
Unless --reload is specified, this command will not re-download already cached dependencies
<y>Read more:</> <c>https://docs.deno.com/go/cmd/check</>"),
<y>Read more:</> <c>https://docs.deno.com/go/check</>"),
UnstableArgsConfig::ResolutionAndRuntime
)
.defer(|cmd| {
Expand Down Expand Up @@ -1807,7 +1807,7 @@ Any flags specified which affect runtime behavior will be applied to the resulti
Cross-compiling to different target architectures is supported using the <c>--target</> flag.
On the first invocation with deno will download the proper binary and cache it in <c>$DENO_DIR</>.
<y>Read more:</> <c>https://docs.deno.com/go/cmd/compile</>
<y>Read more:</> <c>https://docs.deno.com/go/compile</>
"),
UnstableArgsConfig::ResolutionAndRuntime,
)
Expand Down Expand Up @@ -1914,7 +1914,7 @@ Write a report using the lcov format:
Generate html reports from lcov:
<p(245)>genhtml -o html_cov cov.lcov</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/coverage</>"),
<y>Read more:</> <c>https://docs.deno.com/go/coverage</>"),
UnstableArgsConfig::None,
)
.defer(|cmd| {
Expand Down Expand Up @@ -2007,7 +2007,7 @@ Show documentation for runtime built-ins:
<p(245)>deno doc</>
<p(245)>deno doc --filter Deno.Listener</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/doc</>"),
<y>Read more:</> <c>https://docs.deno.com/go/doc</>"),
UnstableArgsConfig::ResolutionOnly
)
.defer(|cmd| {
Expand Down Expand Up @@ -2127,7 +2127,7 @@ To evaluate as TypeScript:
This command has implicit access to all permissions.
<y>Read more:</> <c>https://docs.deno.com/go/cmd/eval</>"
<y>Read more:</> <c>https://docs.deno.com/go/eval</>"
),
UnstableArgsConfig::ResolutionAndRuntime,
)
Expand Down Expand Up @@ -2175,7 +2175,7 @@ Ignore formatting code by preceding it with an ignore comment:
Ignore formatting a file by adding an ignore comment at the top of the file:
<p(245)>// deno-fmt-ignore-file</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/fmt</>"),
<y>Read more:</> <c>https://docs.deno.com/go/fmt</>"),
UnstableArgsConfig::None,
)
.defer(|cmd| {
Expand Down Expand Up @@ -2353,7 +2353,7 @@ The following information is shown:
emit: Local path of compiled source code (TypeScript only)
dependencies: Dependency tree of the source file
<y>Read more:</> <c>https://docs.deno.com/go/cmd/info</>"),
<y>Read more:</> <c>https://docs.deno.com/go/info</>"),
UnstableArgsConfig::ResolutionOnly
)
.defer(|cmd| cmd
Expand Down Expand Up @@ -2587,7 +2587,7 @@ To ignore specific diagnostics, you can write an ignore comment on the preceding
To ignore linting on an entire file, you can add an ignore comment at the top of the file:
<p(245)>// deno-lint-ignore-file</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/lint</>
<y>Read more:</> <c>https://docs.deno.com/go/lint</>
"),
UnstableArgsConfig::ResolutionOnly,
)
Expand Down Expand Up @@ -2710,6 +2710,13 @@ fn repl_subcommand() -> Command {
<p(245)>[default: $DENO_DIR/deno_history.txt]</>"))
)
.arg(env_file_arg())
.arg(
Arg::new("args")
.num_args(0..)
.action(ArgAction::Append)
.value_name("ARGS")
.last(true)
)
}

fn run_args(command: Command, top_level: bool) -> Command {
Expand Down Expand Up @@ -2747,7 +2754,7 @@ Grant all permissions:
Specifying the filename '-' to read the file from stdin.
<p(245)>curl https://examples.deno.land/hello-world.ts | deno run -</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/run</>"), UnstableArgsConfig::ResolutionAndRuntime), false)
<y>Read more:</> <c>https://docs.deno.com/go/run</>"), UnstableArgsConfig::ResolutionAndRuntime), false)
}

fn serve_host_validator(host: &str) -> Result<String, String> {
Expand All @@ -2771,7 +2778,7 @@ Start a server defined in server.ts:
Start a server defined in server.ts, watching for changes and running on port 5050:
<p(245)>deno serve --watch --port 5050 server.ts</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/serve</>"), UnstableArgsConfig::ResolutionAndRuntime), true, true)
<y>Read more:</> <c>https://docs.deno.com/go/serve</>"), UnstableArgsConfig::ResolutionAndRuntime), true, true)
.arg(
Arg::new("port")
.long("port")
Expand Down Expand Up @@ -2840,7 +2847,7 @@ Directory arguments are expanded to all contained files matching the glob <c>{*_
or <c>**/__tests__/**</>:
<p(245)>deno test src/</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/test</>"),
<y>Read more:</> <c>https://docs.deno.com/go/test</>"),
UnstableArgsConfig::ResolutionAndRuntime
)
.defer(|cmd|
Expand Down Expand Up @@ -3021,7 +3028,7 @@ If you want to not replace the current Deno executable but instead download an u
different location, use the <c>--output</> flag:
<p(245)>deno upgrade --output $HOME/my_deno</>
<y>Read more:</> <c>https://docs.deno.com/go/cmd/upgrade</>", UPGRADE_USAGE),
<y>Read more:</> <c>https://docs.deno.com/go/upgrade</>", UPGRADE_USAGE),
UnstableArgsConfig::None,
)
.hide(cfg!(not(feature = "upgrade")))
Expand Down Expand Up @@ -4721,6 +4728,10 @@ fn repl_parse(
})
.transpose()?;

if let Some(args) = matches.remove_many::<String>("args") {
flags.argv.extend(args);
}

handle_repl_flags(
flags,
ReplFlags {
Expand Down Expand Up @@ -10746,6 +10757,25 @@ mod tests {
);
}

#[test]
fn repl_user_args() {
let r = flags_from_vec(svec!["deno", "repl", "foo"]);
assert!(r.is_err());
let r = flags_from_vec(svec!["deno", "repl", "--", "foo"]);
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Repl(ReplFlags {
eval_files: None,
eval: None,
is_default_command: false,
}),
argv: svec!["foo"],
..Flags::default()
}
);
}

#[test]
fn bare_with_flag_no_file() {
let r = flags_from_vec(svec!["deno", "--no-config"]);
Expand Down
12 changes: 0 additions & 12 deletions cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,18 +1596,6 @@ impl CliOptions {
}
});

// TODO(2.0): remove this code and enable these features in `99_main.js` by default.
let future_features = [
deno_runtime::deno_ffi::UNSTABLE_FEATURE_NAME.to_string(),
deno_runtime::deno_fs::UNSTABLE_FEATURE_NAME.to_string(),
deno_runtime::deno_webgpu::UNSTABLE_FEATURE_NAME.to_string(),
];
future_features.iter().for_each(|future_feature| {
if !from_config_file.contains(future_feature) {
from_config_file.push(future_feature.to_string());
}
});

if !from_config_file.is_empty() {
// collect unstable granular flags
let mut all_valid_unstable_flags: Vec<&str> =
Expand Down
Loading

0 comments on commit 50d87d3

Please sign in to comment.