Nativescript-cli: Ability to ignore files from build and livesync

Created on 8 Sep 2015  路  9Comments  路  Source: NativeScript/nativescript-cli

Users should be able to setup the CLI to ignore particular files, usually ts, .d.ts, or other source files in a language that compiles to JS / CSS.

We can use the same rules, default rules and implementation code from AppBuilder CLI.

Things to consider:

  • We can move the rules into package.json, introduce a dedicated .tnsignore file, or use .abignore file - the latest option brings 100% interoperability with Telerik Platform

    • Implement interoperability with AppBuilder- i.e. appbuilder init from existing {N} project should consume existing {N} specific ignore rules.

feature

Most helpful comment

In my opinion .tnsignore is better!

All 9 comments

This is must have after we enabled transpilers.

Let's use .abignore - this way the project will work like a charm inside AppBuilder :)

In my opinion .tnsignore is better!

I'm closing this one since we need TypeScript files for debugging purposes (these files can be excluded with --release). Additionally every transpiler CLI hook can handle the logic per case internally.

@enchev This is not simply about transpiling and such, it is also about the fact that some editors add temporary files alongside files currently being edited.

Hi @casp-simberg,

Indeed, you are right. We had an issue with the temporary files some IDEs create and we've fixed it, so now these files are not livesynced anymore. Do you think there is some other case you'd need to exclude files from livesyncing?

@pkoleva Not that I can think of right now. Sorry for the late response.

I am interested in a way to add a filter on which kinds of files to watch. Usually this can be expressed as a RegExp or by some simpler means (filename extension, but this isn't enough in my case).

Emacs, when auto-saving, creates files with the format '.#', and sometimes '##' also shows up, but I think that's a different feature. And then we have some versions which save the file with a tilde in the end (~). So the easiest way would be to allow a list of filters. For example --watch-ignore [".#", "##"], where the strings will differ depending on the approach you take I suppose, RegExp or a simpler way of matching.

This was still a problem the last time I ran 'tns run android' (which I think is livesync, correct?) in my project. May have been fixed since this was before the big release. But is there a way to add the filter(s) manually?

Another case when ignoring files will be useful:

tns create TestApp --ng
tns build android --path TestApp --release <and all the options hare>

Result will be ~1200 .d.ts files at TestApp/platforms/android/src/main/assets/app/tns_modules

As we are now using webpack to build the application, I think this issue can be closed. Webpack includes only files required and used in the application, so we no longer have problem with filtering.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NickIliev picture NickIliev  路  3Comments

Fatme picture Fatme  路  3Comments

ZMW9 picture ZMW9  路  3Comments

NickIliev picture NickIliev  路  3Comments

DimitarTachev picture DimitarTachev  路  3Comments