mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
feat(init): Use jsonc for configuration file (#17002)
Generate "deno.jsonc" instead of "deno.json" when running "deno init" subcommand.
This commit is contained in:
parent
653aebfa1a
commit
6794d9fe5d
3 changed files with 4 additions and 4 deletions
|
@ -31,7 +31,7 @@ mod init {
|
|||
assert_contains!(stderr, "deno task dev");
|
||||
assert_contains!(stderr, "deno test");
|
||||
|
||||
assert!(cwd.join("deno.json").exists());
|
||||
assert!(cwd.join("deno.jsonc").exists());
|
||||
|
||||
let mut deno_cmd = util::deno_cmd_with_deno_dir(&deno_dir);
|
||||
let output = deno_cmd
|
||||
|
@ -86,7 +86,7 @@ mod init {
|
|||
assert_contains!(stderr, "deno task dev");
|
||||
assert_contains!(stderr, "deno test");
|
||||
|
||||
assert!(cwd.join("my_dir/deno.json").exists());
|
||||
assert!(cwd.join("my_dir/deno.jsonc").exists());
|
||||
|
||||
let mut deno_cmd = util::deno_cmd_with_deno_dir(&deno_dir);
|
||||
let output = deno_cmd
|
||||
|
@ -137,7 +137,7 @@ mod init {
|
|||
assert!(output.status.success());
|
||||
let stdout = String::from_utf8(output.stdout).unwrap();
|
||||
assert_eq!(stdout, "");
|
||||
assert!(cwd.join("deno.json").exists());
|
||||
assert!(cwd.join("deno.jsonc").exists());
|
||||
|
||||
let mut deno_cmd = util::deno_cmd_with_deno_dir(&deno_dir);
|
||||
let output = deno_cmd
|
||||
|
|
|
@ -41,7 +41,7 @@ pub async fn init_project(init_flags: InitFlags) -> Result<(), AnyError> {
|
|||
.replace("{CURRENT_STD_URL}", deno_std::CURRENT_STD_URL.as_str());
|
||||
create_file(&dir, "main_test.ts", &main_test_ts)?;
|
||||
|
||||
create_file(&dir, "deno.json", include_str!("./templates/deno.json"))?;
|
||||
create_file(&dir, "deno.jsonc", include_str!("./templates/deno.jsonc"))?;
|
||||
|
||||
info!("✅ {}", colors::green("Project initialized"));
|
||||
info!("");
|
||||
|
|
Loading…
Reference in a new issue