Skip to content

Introduce command (tns migrate) to migrate old project to 6.0.0 requirements #4646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue May 26, 2019 · 2 comments
Assignees
Labels
docs update Describes issues related to update command or updating from one version of CLI to another
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented May 26, 2019

Is your feature request related to a problem? Please describe.
In 6.0.0 release, we'll have new requirements for applications build process, i.e. all apps must have webpack as dependencies, several development plugins should be replaced with others, etc.
All of these changes could take a lot of time to the users and several issues might occur during the process. So it will be great in case tns update command can handle all these changes.

Describe the solution you'd like
The tns update command should update the following components of the application:

  • runtime versions
  • tns-core-modules and tns-core-modules-widgets versions
  • nativescript-dev-webpack version
  • webpack.config.js file according to latest changes - create a backup of the old one
  • hooks directory - create backup of it and allow npm to recreate it on its own
  • remove all dev plugins that will not be supported anymore and add required development dependencies instead of them:
    • nativescript-dev-sass should be replaced with node-sass
    • nativescript-dev-typescript should be replaced with typescript (possibly typescript is already a devDependency of the project)
    • nativescript-dev-less should be replaced with less
  • it will be great if the command can update all dependencies to their latest versions - due to changes around AndroidX most of the plugins will need a new version to be published. Their old versions will not work with Android runtime that supports only AndroidX.

After updating the package.json and backing up the directories, CLI should execute npm rebuild, so all new dependencies and devDependencies will be installed and all required hooks will be generated in the project.

Also it will be great to check the project files and notify the users if there are .xml/.css files that do not follow the convention requirements of our webpack logic (i.e. they do not have page or root in the name) and show warnings for them.

Describe alternatives you've considered
CLI might show interactive prompts which of the mentioned components to be updated.

@rosen-vladimirov rosen-vladimirov added docs update Describes issues related to update command or updating from one version of CLI to another labels May 26, 2019
@rosen-vladimirov rosen-vladimirov added this to the 6.0.0 milestone May 26, 2019
@AlexandreCarvalhoDeMelo

Also add the -page suffix to the files that need it.

@KristianDD KristianDD self-assigned this Jun 4, 2019
@endarova
Copy link
Contributor

endarova commented Jul 1, 2019

Acceptance criteria tns update:

  • tns update should take versions of tns-core-modules, tns-core-modules-widgets,tns-ios, tns-android and nativescript-dev-webpack from the latest compatible hello world template based on your app flavor and your cli version
  • tns update {version}/{tag} should take versions of dependencies from the latest compatible hello world template based on your app flavor and the specified cli version or tag
  • tns update {version}/{tag} should exit with error when invalid tag or version are specified
  • tns update should only update dependencies (not add or remove any)
  • tns update should exit with info for migrate command when your app in not 6.0 compatible

Acceptance criteria tns migrate:

  • All templates created with [email protected] should be able to run, preview, test and debug after tns migrate
  • tns migrate should exit with info about tns update if the project is already compatible with 6.0
  • tns migrate and tns update should exit with already updated/migrated info for newly created apps
  • tns migrate should remove 'UseLegacyWorkflow:' from nsconfig.json
  • tns migrate should do tns resources update
  • tns migrate should give warring for nativescript-less
  • tns migrate should get the TypeScript version from the Angular peer dependency when available
  • tns migrate should remove all *.js, *.js.map, *.css files in app folder when they have the corresponding *.ts, *sccs, *.sass, *.less files
  • tns migrate should backup all files affected by migration in {projectDir}/.migration_backup folder
  • tns migrate should migrate project dependencies only if versions are lower than:
    private migrationDependencies: IMigrationDependency[] = [

@rosen-vladimirov rosen-vladimirov changed the title tns update should be able to migrate old project to 6.0.0 requirements Introduce command (tns migrate) to migrate old project to 6.0.0 requirements Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs update Describes issues related to update command or updating from one version of CLI to another
Projects
None yet
Development

No branches or pull requests

4 participants