feat(init): add --npm flag to initialize npm projects (#26896)

This commit adds support for `deno init --npm <package>`.

Running this will actually call to `npm:create-<package>` package that
is equivalent to running `npm create <package>`.

User will be prompted if they want to allow all permissions and
lifecycle scripts to be executed.
Closes https://github.com/denoland/deno/issues/26461

---------

Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
This commit is contained in:
Bartek Iwańczuk 2024-11-21 00:03:11 +00:00 committed by GitHub
parent f0b245c8ee
commit d17f4590a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 191 additions and 12 deletions

View file

@ -144,9 +144,7 @@ async fn run_subcommand(flags: Arc<Flags>) -> Result<i32, AnyError> {
}
DenoSubcommand::Init(init_flags) => {
spawn_subcommand(async {
// make compiler happy since init_project is sync
tokio::task::yield_now().await;
tools::init::init_project(init_flags)
tools::init::init_project(init_flags).await
})
}
DenoSubcommand::Info(info_flags) => {