Skip to content
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

feat: detect and report short imports used in application #4372

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Feb 18, 2019

In NativeScript 5.2.0 we've deprecated support for short imports. Add ability in CLI to check if there are such imports in the application's code and report them to users. The logic will be executed whenever application is prepared for build/livesync or when tns doctor is executed inside project dir.
Create class with static variables for ProjectTypes. These values must not be changed as they are used in Analytics, so changing them will break the current reports.

PR Checklist

What is the current behavior?

Users should search their own code for short imports.

What is the new behavior?

CLI warns users for used short imports in the application when tns run <platform> or tns doctor is executed.

Fixes issue #4375

@rosen-vladimirov rosen-vladimirov added this to the 5.2.1 milestone Feb 18, 2019
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 18, 2019
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/short-imports-warn branch from 07ff1dc to 1be68fb Compare February 18, 2019 18:12
In NativeScript 5.2.0 we've deprecated support for short imports. Add ability in CLI to check if there are such imports in the application's code and report them to users. The logic will be executed whenever application is prepared for build/livesync or when `tns doctor` is executed inside project dir.
Create class with static variables for ProjectTypes. These values must not be changed as they are used in Analytics, so changing them will break the current reports.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/short-imports-warn branch from 1be68fb to f50f22d Compare February 20, 2019 07:40

for (const file of files) {
const fileContent = this.$fs.readText(file);
const strippedComments = helpers.stripComments(fileContent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileContentWithoutComments?

@rosen-vladimirov
Copy link
Contributor Author

run ci

3 similar comments
@rosen-vladimirov
Copy link
Contributor Author

run ci

@rosen-vladimirov
Copy link
Contributor Author

run ci

@rosen-vladimirov
Copy link
Contributor Author

run ci

Copy link
Contributor

@DimitarTachev DimitarTachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test

@rosen-vladimirov rosen-vladimirov merged commit 0fabc39 into release Feb 22, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/short-imports-warn branch February 22, 2019 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants