Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

fix: avoid getting js template in a ts project #717

Merged
merged 3 commits into from
Dec 1, 2018

Conversation

DimitarTachev
Copy link
Contributor

@DimitarTachev DimitarTachev commented Nov 20, 2018

PR Checklist

What is the current behavior?

We don't have the typescript dependency hardcoded in our templates anymore and we depend on the nativescript-dev-typescript postinstall script to generate it.

It seems that npm is executing the postintalls script in alphabetical order and the nativescript-dev-typescript plugin is generating the typescript dependency before the postintall script of nativescript-dev-webpack. In this way, everything is working as expected.

However, when the NativeScript CLI is used with yarn instead of npm, the postinstall scripts are run in parallell and the nativescript-dev-webpack plugin is copying the javascript webpack.config instead of the typescript one because the typescript dependency is still missing.

What is the new behavior?

We don't have a hidden dependency to the nativescript-dev-typescript plugin anymore because we depend on nativescript-dev-typescript dependency which is part of the templates.

Related to: #716

… `typescript` dependency in the templates anymore
Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

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

There are some bits in webpack.typescript.js that are necessary only for TS projects and shouldn't be part of the webpack configuration of the JS projects. For example, the awesome-typescript-loader -

loader: "awesome-typescript-loader",
.

Maybe, we could think of another way to differentiate the TS and JS projects. Here are a few ways off the top of my head:
1). Check the extensions of the files in the app/ folder;
2). Check if the nativescript-dev-typescript plugin is a dependency;
3). Add some key to the nsconfig that denotes the type of the template.

@DimitarTachev DimitarTachev force-pushed the tachev/fix-yarn-ts-projects-creation branch 4 times, most recently from 3604e24 to 64745cb Compare November 21, 2018 08:45
@DimitarTachev DimitarTachev force-pushed the tachev/fix-yarn-ts-projects-creation branch from 64745cb to e3b661b Compare November 21, 2018 08:46
@DimitarTachev
Copy link
Contributor Author

run ci

2 similar comments
@DimitarTachev
Copy link
Contributor Author

run ci

@DimitarTachev
Copy link
Contributor Author

run ci

@dtopuzov dtopuzov merged commit c121c24 into master Dec 1, 2018
@vchimev vchimev deleted the tachev/fix-yarn-ts-projects-creation branch December 2, 2018 20:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants