NativeScript / NativeScript/nativescript-cli

Use constants instead of hardcoded `android` and `ios` strings

Open
#4,388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

technical debt
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.
We have "android", "Android", "ANDROID" and "ios", "iOS", "IOS" hardcoded in many places in the CLI. In most of the places, we are also using platform.toLower() in order to workaround this.

Describe the solution you'd like
We should just use the same constants everywhere (e.g. DevicePlatformsConstants)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the NativeScript CLI and search for the hardcoded variants of android, Android, ANDROID, ios, iOS, and IOS, along with existing DevicePlatformsConstants usage. Replace the scattered platform strings with the shared constants and verify that all relevant CLI paths use the same values without needing platform.toLower().

Written by the indexing model from the issue text.

Assessment

Tech stack
android, ios, javascript
Domain
cli, mobile-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.