nativescript-timedatepicker icon indicating copy to clipboard operation
nativescript-timedatepicker copied to clipboard

Not compatible with webpack v0.9.0

Open manojdcoder opened this issue 7 years ago • 5 comments

I guess it is due to the new AngularCompilerPlugin (angular/angular-cli/issues/8284), deleting all the ts files under node_modules/nativescript-timedatepicker folder solved the issue Or alternatively can add those files into include section of tsconfig.json.

Please exclude ts files during release, that will solve this issue.

manojdcoder avatar Dec 22 '17 22:12 manojdcoder

As a follow up to @manojdcoder answer: Until this plugin gets updated I just added a before prepare hook which deleted relevant files, to avoid situation where plugin would be reinstalled:

var fs = require('fs');

module.exports = function($logger) {
    var pickerAndroidTsFile = 'node_modules/nativescript-timedatepicker/timedatepicker-handler.android.ts';
    var pickerIosTsFile = 'node_modules/nativescript-timedatepicker/timedatepicker-handler.ios.ts';
    console.log('GetAlert BeforePrepare Hook: modify existing plugins');
    if (fs.existsSync(pickerAndroidTsFile)) {
        fs.unlink(pickerAndroidTsFile);
    }
    if (fs.existsSync(pickerIosTsFile)) {
        fs.unlink(pickerIosTsFile);
    }
};

souly1 avatar Dec 26 '17 07:12 souly1

@AntonioCuevaUrraco does this plugin still gets maintained or do we have to create our own fork?

RaphaelJenni avatar Apr 12 '18 12:04 RaphaelJenni

@RaphaelJenni I stop using NS a year ago. I think you can take this project as a contributor or create your own to update as more breaking changes come

AntonioCuevaUrraco avatar Apr 12 '18 14:04 AntonioCuevaUrraco

As a follow up to @manojdcoder answer: Until this plugin gets updated I just added a before prepare hook which deleted relevant files, to avoid situation where plugin would be reinstalled:

var fs = require('fs');

module.exports = function($logger) {
    var pickerAndroidTsFile = 'node_modules/nativescript-timedatepicker/timedatepicker-handler.android.ts';
    var pickerIosTsFile = 'node_modules/nativescript-timedatepicker/timedatepicker-handler.ios.ts';
    console.log('GetAlert BeforePrepare Hook: modify existing plugins');
    if (fs.existsSync(pickerAndroidTsFile)) {
        fs.unlink(pickerAndroidTsFile);
    }
    if (fs.existsSync(pickerIosTsFile)) {
        fs.unlink(pickerIosTsFile);
    }
};

This should be saved in both before-prepare and before-watch folders for Nativescript 5

erkanarslan avatar Dec 24 '18 17:12 erkanarslan

for the record, unlink needs a callback..

var fs = require('fs');

module.exports = function($logger) {
    var pickerAndroidTsFile = 'node_modules/nativescript-timedatepicker/timedatepicker-handler.android.ts';
    var pickerIosTsFile = 'node_modules/nativescript-timedatepicker/timedatepicker-handler.ios.ts';
    console.log('GetAlert BeforePrepare Hook: modify existing plugins');
    if (fs.existsSync(pickerAndroidTsFile)) {
        fs.unlink(pickerAndroidTsFile,(err) => {
            if (err) throw err;
          });
    }
    if (fs.existsSync(pickerIosTsFile)) {
        fs.unlink(pickerIosTsFile,(err) => {
            if (err) throw err;
          });
    }
};

vincentduprez avatar Oct 31 '19 00:10 vincentduprez