Azure / Azure/static-web-apps-cli

swa init --yes should consider yarn.lock

Open
#657 1 comment 2 reactions 1 assignee Claimed by @Reshmi-Sriram View on GitHub
command: init type: enhancement
Dominant language
TypeScript
Stars
668
Forks
156
PR merge metrics
No merged PRs in 30d

Description

**Are you accessing the CLI from the default port `:4280` ?**

- [x] Yes, I am accessing the CLI from port `:4280`

**Describe the bug**
If `yarn.lock` exists, `swa init --yes` should use `yarn` instead of `npm`

**To Reproduce**
```bash
yarn create next-app # accept all defaults
cd my-app
swa init -y
cat .\swa-cli.config.json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"my-app": {
"appLocation": ".",
"outputLocation": ".next",
"appBuildCommand": "npm run build",
"run": "npm run dev",
"appDevserverUrl": "http://localhost:3000"
}
}
}
```

**Expected behavior**
```bash
cat .\swa-cli.config.json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"my-app": {
"appLocation": ".",
"outputLocation": ".next",
"appBuildCommand": "yarn build",
"run": "yarn dev",
"appDevserverUrl": "http://localhost:3000"
}
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.