Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Switch between SDK4 and SDK6 with CLI with single code base

As all developers I was forced to use the CLI now.
In the studio I have multiple package.json. one for SDK4 and one for SDK6.

 

I have duplicated the.gui and .view files so that I have a single project / codebase to manage. Switching betweek SDK in studio only involved renaming the Package.jsonSDK6 to Package.json

In the CLI, I think the fastest way is to. Rename the package.sjon. Remove package.lock.jason. do "npm install", "NPX fitbit"  and then "build". Is this truly the fastest way, or are there other methods?

The installing of NPM does not always go without errors which makes switching SDK more time consuming. 

Best Answer
0 Votes
1 REPLY 1

Hi @Pietero - renaming the package.json and deleting the lock file works but the node_modules are different.

Another way is to duplicate the projects which has the following advantages.

  • you only need install the node_modules once
  • you don't have to rename the package.json files
  • you can eliminate the redundant .view or .gui  from each version so the builds are smaller/quicker
  • you can work on both versions simultaneously [using multiple simulators]
  • you only have to copy the source changes from the master version [and make the adaptations where necessary, generally the imports]
  • it does require more space [for the node_modules]
  • it does avoid the NPM issues [only done once]

Author | ch, passion for improvement.

Best Answer