Skip to content

feat: move all source code to the app folder #41

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

Merged
merged 3 commits into from
Jul 10, 2019
Merged

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jul 10, 2019

Till now nativescript-dev-webpack plugin requires automatically all (root|page)(.css|.xml|.js|.ts) files from the unit-test-runner. However, this behavior was changed and now nativescript-dev-webpack plugin requires automatically all files except the files from App_Resources and .d.ts files. This led to the problem that preuninstall.js and postinstall.js scripts are automatically required. These scripts require nativescript-hook. On the other side nativescript-hook has a dynamic require here https://github.com/NativeScript/nativescript-hook/blob/master/index.js#L56. As this dynamic require is not compatible with webpack's concept for dynamic requires, the following warning is shown:

WARNING in ../node_modules/nativescript-hook/index.js 56:27-51
Critical dependency: the request of a dependency is an expression
 @ ../node_modules/nativescript-unit-test-runner/postinstall.js
 @ ../node_modules/nativescript-unit-test-runner sync (?<!App_Resources.*).(xml|css|js|(?<!d.)ts|scss)$
 @ ./app.js

This PR do the followings:

  • Move all the app's related code to the app folder. This way nativescript-dev-webpack will require automatically all files from app folder and the unneeded files (as postinstall and preuninstall) will not be required.
  • Add a before-liveSync hook in order to throw an error when CLI <= 5.4.2 + nativescript-dev-webpack@latest + nativescript-unit-test-runner@next are used.

Rel to: NativeScript/nativescript-cli#4821

Till now `nativescript-dev-webpack` plugin requires automatically all (root|page)(.css|.xml|.js|.ts) files from the unit-test-runner. However, this behavior was changed and now `nativescript-dev-webpack` plugin requires automatically all files except the files from App_Resources and .d.ts files. This led to the problem that `preuninstall.js` and `postinstall.js` scripts are automatically required. These scripts require `nativescript-hook`. On the other side `nativescript-hook` has a dynamic require here https://github.com/NativeScript/nativescript-hook/blob/master/index.js#L56. As this dynamic require is not compatible with webpack's concept for dynamic requires, the following warning is shown:
```
WARNING in ../node_modules/nativescript-hook/index.js 56:27-51
Critical dependency: the request of a dependency is an expression
 @ ../node_modules/nativescript-unit-test-runner/postinstall.js
 @ ../node_modules/nativescript-unit-test-runner sync (?<!App_Resources.*).(xml|css|js|(?<!d.)ts|scss)$
 @ ./app.js
```

This PR moves all the app's related code to the app folder. This way `nativescript-dev-webpack` will require automatically all files from app folder and the unneeded files (as postinstall and preuninstall) will not be required.
@cla-bot cla-bot bot added the cla: yes label Jul 10, 2019
@Fatme Fatme changed the title feat: move all the source code to app folder feat: move all source code to the app folder Jul 10, 2019
@Fatme Fatme merged commit 000c639 into master Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants