[jira] [Commented] (CB-14027) cordova-plugin-statusbar default style isn't work in Huawei and 360 and some android phone
[ https://issues.apache.org/jira/browse/CB-14027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515375#comment-16515375 ] Ben Ritter commented on CB-14027: - This happens on my Nexus 5, Android 6.0.1. > cordova-plugin-statusbar default style isn't work in Huawei and 360 and some > android phone > -- > > Key: CB-14027 > URL: https://issues.apache.org/jira/browse/CB-14027 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-plugin-statusbar >Affects Versions: 2.4.1 >Reporter: miao >Priority: Major > Attachments: image-2018-04-12-12-18-38-075.png, > image-2018-04-16-10-25-40-198.png > > > I used the latest version of cordova-plugin-statusbar with the default style, > but the in HuaWei, 360 and some android phone, the status bar's information > disappeared, only the black background bar here. > !image-2018-04-12-12-18-38-075.png|width=199,height=363! -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-13891) StatusBar.styleDefault() causes status bar to vanish on Android.
[ https://issues.apache.org/jira/browse/CB-13891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515374#comment-16515374 ] Ben Ritter commented on CB-13891: - I see the same issue using the plugin in a Meteor project. Just adding the plugin to the project without adding any settings or function calls causes the blank status bar as in blank.png on my Android 6.0.1 phone. > StatusBar.styleDefault() causes status bar to vanish on Android. > > > Key: CB-13891 > URL: https://issues.apache.org/jira/browse/CB-13891 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-plugin-statusbar >Affects Versions: 2.3.0, 2.4.0, 2.4.1 > Environment: ⇒ cordova platform ls > Installed platforms: > android 6.2.3 > Available platforms: > blackberry10 ~3.8.0 (deprecated) > browser ~4.1.0 > ubuntu ~4.3.4 (deprecated) > webos ~3.7.0 > > ⇒ cordova plugin ls > cordova-plugin-device 2.0.1 "Device" > cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard" > cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview" > cordova-plugin-splashscreen 5.0.2 "Splashscreen" > cordova-plugin-statusbar 2.3.0 "StatusBar" > cordova-plugin-whitelist 1.3.3 "Whitelist" > ⇒ cordova --version > 7.0.1 >Reporter: Alex Ward >Priority: Major > Labels: android > Attachments: blank.png, noblank.png > > > On any version of cordova-plugin-statusbar past 2.2.3 I'm seeing that a call > to `StatusBar.styleDefault()` will cause the status bar to disappear on > Android, whereas on 2.2.3 and lower it is simply a no-op. > I made a github repo to demonstrate the problem - > [https://github.com/cthos/status-bar-bug|https://github.com/cthos/status-bar-bug.] > . The relevant code is in the ionic component, inside of the onDeviceReady - > [https://github.com/cthos/status-bar-bug/blob/master/src/app/app.component.ts#L13.] > Downgrading to the 2.2.3 version of the plugin resolves the issue and > produces the noblank.png screenshot. > Those screenshots were taken on a Moto G4, but I've seen it on the Galaxy > Line of Phones as well, so I don't think it's isolated to a particular > version or type. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-13685) Android Adaptive Icons
[ https://issues.apache.org/jira/browse/CB-13685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515287#comment-16515287 ] ASF GitHub Bot commented on CB-13685: - codecov-io commented on issue #448: CB-13685 android: Adaptive Icon Support URL: https://github.com/apache/cordova-android/pull/448#issuecomment-397924030 # [Codecov](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=h1) Report > Merging [#448](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-android/commit/2c3db1931055e0959faf801c7af7cfe32ea79ac0?src=pr&el=desc) will **decrease** coverage by `0.51%`. > The diff coverage is `66.92%`. [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-android/pull/448/graphs/tree.svg?src=pr&token=q14nMf6C5a&width=650&height=150)](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=tree) ```diff @@Coverage Diff @@ ## master #448 +/- ## == - Coverage 44.27% 43.75% -0.52% == Files 17 18 +1 Lines1694 2027 +333 Branches 311 386 +75 == + Hits 750 887 +137 - Misses944 1140 +196 ``` | [Impacted Files](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [bin/templates/cordova/lib/AndroidManifest.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9BbmRyb2lkTWFuaWZlc3QuanM=) | `35.44% <40%> (+0.3%)` | :arrow_up: | | [bin/templates/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9wcmVwYXJlLmpz) | `41.66% <68%> (ø)` | | | [...in/templates/cordova/lib/builders/GradleBuilder.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9idWlsZGVycy9HcmFkbGVCdWlsZGVyLmpz) | `20.25% <0%> (-0.51%)` | :arrow_down: | | [bin/templates/cordova/lib/pluginHandlers.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9wbHVnaW5IYW5kbGVycy5qcw==) | `86.2% <0%> (-0.5%)` | :arrow_down: | | [bin/templates/cordova/lib/check\_reqs.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9jaGVja19yZXFzLmpz) | `48.13% <0%> (-0.45%)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=footer). Last update [2c3db19...656e9c6](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Android Adaptive Icons > -- > > Key: CB-13685 > URL: https://issues.apache.org/jira/browse/CB-13685 > Project: Apache Cordova > Issue Type: Improvement > Components: cordova-android > Environment: All >Reporter: Josef Brandl >Assignee: Joe Bowser >Priority: Minor > > Starting with Android 8 Oreo (API level 26) Android allows developers to > create app icons using a background and a foreground image file. This feature > is called "adaptive icons". One major change that goes with this feature is > that icons get now clipped into a shape by the system. This leads to a very > uniform and clean design like on iOS where all icons are a rounded rectangle. > The other advantage is that visual effects can be applied to the icon by the > system due to the separation between foreground an background. > Android Studio greatly assists the developer at the creation of the app icon > resources because it creates backwards compatible icons for older devices > that don't support the adaptive icons feature. > https://developer.android.com/studio/write/image-asset-studio.html > The following resources are created. > {code} > r
[jira] [Commented] (CB-13685) Android Adaptive Icons
[ https://issues.apache.org/jira/browse/CB-13685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515284#comment-16515284 ] ASF GitHub Bot commented on CB-13685: - codecov-io commented on issue #448: CB-13685 android: Adaptive Icon Support URL: https://github.com/apache/cordova-android/pull/448#issuecomment-397924030 # [Codecov](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=h1) Report > Merging [#448](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-android/commit/2c3db1931055e0959faf801c7af7cfe32ea79ac0?src=pr&el=desc) will **decrease** coverage by `0.51%`. > The diff coverage is `66.92%`. [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-android/pull/448/graphs/tree.svg?token=q14nMf6C5a&src=pr&width=650&height=150)](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=tree) ```diff @@Coverage Diff @@ ## master #448 +/- ## == - Coverage 44.27% 43.75% -0.52% == Files 17 18 +1 Lines1694 2027 +333 Branches 311 386 +75 == + Hits 750 887 +137 - Misses944 1140 +196 ``` | [Impacted Files](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [bin/templates/cordova/lib/AndroidManifest.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9BbmRyb2lkTWFuaWZlc3QuanM=) | `35.44% <40%> (+0.3%)` | :arrow_up: | | [bin/templates/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9wcmVwYXJlLmpz) | `41.66% <68%> (ø)` | | | [...in/templates/cordova/lib/builders/GradleBuilder.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9idWlsZGVycy9HcmFkbGVCdWlsZGVyLmpz) | `20.25% <0%> (-0.51%)` | :arrow_down: | | [bin/templates/cordova/lib/pluginHandlers.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9wbHVnaW5IYW5kbGVycy5qcw==) | `86.2% <0%> (-0.5%)` | :arrow_down: | | [bin/templates/cordova/lib/check\_reqs.js](https://codecov.io/gh/apache/cordova-android/pull/448/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9jb3Jkb3ZhL2xpYi9jaGVja19yZXFzLmpz) | `48.13% <0%> (-0.45%)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=footer). Last update [2c3db19...656e9c6](https://codecov.io/gh/apache/cordova-android/pull/448?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Android Adaptive Icons > -- > > Key: CB-13685 > URL: https://issues.apache.org/jira/browse/CB-13685 > Project: Apache Cordova > Issue Type: Improvement > Components: cordova-android > Environment: All >Reporter: Josef Brandl >Assignee: Joe Bowser >Priority: Minor > > Starting with Android 8 Oreo (API level 26) Android allows developers to > create app icons using a background and a foreground image file. This feature > is called "adaptive icons". One major change that goes with this feature is > that icons get now clipped into a shape by the system. This leads to a very > uniform and clean design like on iOS where all icons are a rounded rectangle. > The other advantage is that visual effects can be applied to the icon by the > system due to the separation between foreground an background. > Android Studio greatly assists the developer at the creation of the app icon > resources because it creates backwards compatible icons for older devices > that don't support the adaptive icons feature. > https://developer.android.com/studio/write/image-asset-studio.html > The following resources are created. > {code} > r
[jira] [Commented] (CB-14133) Avoid reinstalling already installed plugins in cordova-fetch
[ https://issues.apache.org/jira/browse/CB-14133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515247#comment-16515247 ] Zak commented on CB-14133: -- We run our Cordova builds in CI which does a clean install on each build. The adding platform step was taking a few minutes for the dozen plugins on each build (re-checking and installing plugins that were already installed in the npm install phase). Takes far less time now. > Avoid reinstalling already installed plugins in cordova-fetch > - > > Key: CB-14133 > URL: https://issues.apache.org/jira/browse/CB-14133 > Project: Apache Cordova > Issue Type: Wish > Components: cordova-cli, cordova-fetch >Affects Versions: 8.0.0 >Reporter: Zak >Assignee: Raphael >Priority: Minor > > Relates to CB-13992 > The pull request for CB-13992 removed the {{dependency-ls}} package which > helped to speed up the platform add step. However, each plugin still gets > {{npm install}} ed seemingly just to determine the package name. > Typical workflow is to run {{npm install}} as the first task after cloning a > node repository. The current practice for cordova is to save plugins to the > package.json meaning that plugins are already installed to the node_modules > directory, so running {{npm install}} for each of them individually is > redundant. > If the main function in {{cordova-fetch}} is simplified to just return the > path to the given module (albeit this isn't the most elegant implementation): > {code:javascript} > module.exports = function (target, dest, opts = {}) { > var fetchArgs = opts.link ? ['link'] : ['list']; > var nodeModulesDir = dest + '/node_modules/'; > // check if npm is installed > return module.exports.isNpmInstalled() > .then(function () { > const mod = target.slice(0, target.lastIndexOf('@')); > return path.resolve(nodeModulesDir, mod) > }) > .catch(function (err) { > throw new CordovaError(err); > }); > }; > {code} > the platform add process runs almost instantly rather than taking a few > minutes. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14133) Avoid reinstalling already installed plugins in cordova-fetch
[ https://issues.apache.org/jira/browse/CB-14133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515245#comment-16515245 ] Raphael commented on CB-14133: -- I'm glad it works for you. Would you mind sharing what improvement you could achieve with this on a real project? > Avoid reinstalling already installed plugins in cordova-fetch > - > > Key: CB-14133 > URL: https://issues.apache.org/jira/browse/CB-14133 > Project: Apache Cordova > Issue Type: Wish > Components: cordova-cli, cordova-fetch >Affects Versions: 8.0.0 >Reporter: Zak >Assignee: Raphael >Priority: Minor > > Relates to CB-13992 > The pull request for CB-13992 removed the {{dependency-ls}} package which > helped to speed up the platform add step. However, each plugin still gets > {{npm install}} ed seemingly just to determine the package name. > Typical workflow is to run {{npm install}} as the first task after cloning a > node repository. The current practice for cordova is to save plugins to the > package.json meaning that plugins are already installed to the node_modules > directory, so running {{npm install}} for each of them individually is > redundant. > If the main function in {{cordova-fetch}} is simplified to just return the > path to the given module (albeit this isn't the most elegant implementation): > {code:javascript} > module.exports = function (target, dest, opts = {}) { > var fetchArgs = opts.link ? ['link'] : ['list']; > var nodeModulesDir = dest + '/node_modules/'; > // check if npm is installed > return module.exports.isNpmInstalled() > .then(function () { > const mod = target.slice(0, target.lastIndexOf('@')); > return path.resolve(nodeModulesDir, mod) > }) > .catch(function (err) { > throw new CordovaError(err); > }); > }; > {code} > the platform add process runs almost instantly rather than taking a few > minutes. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14133) Avoid reinstalling already installed plugins in cordova-fetch
[ https://issues.apache.org/jira/browse/CB-14133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515243#comment-16515243 ] Zak commented on CB-14133: -- Fantastic work. Just tried nightly build and works a treat 👍 > Avoid reinstalling already installed plugins in cordova-fetch > - > > Key: CB-14133 > URL: https://issues.apache.org/jira/browse/CB-14133 > Project: Apache Cordova > Issue Type: Wish > Components: cordova-cli, cordova-fetch >Affects Versions: 8.0.0 >Reporter: Zak >Assignee: Raphael >Priority: Minor > > Relates to CB-13992 > The pull request for CB-13992 removed the {{dependency-ls}} package which > helped to speed up the platform add step. However, each plugin still gets > {{npm install}} ed seemingly just to determine the package name. > Typical workflow is to run {{npm install}} as the first task after cloning a > node repository. The current practice for cordova is to save plugins to the > package.json meaning that plugins are already installed to the node_modules > directory, so running {{npm install}} for each of them individually is > redundant. > If the main function in {{cordova-fetch}} is simplified to just return the > path to the given module (albeit this isn't the most elegant implementation): > {code:javascript} > module.exports = function (target, dest, opts = {}) { > var fetchArgs = opts.link ? ['link'] : ['list']; > var nodeModulesDir = dest + '/node_modules/'; > // check if npm is installed > return module.exports.isNpmInstalled() > .then(function () { > const mod = target.slice(0, target.lastIndexOf('@')); > return path.resolve(nodeModulesDir, mod) > }) > .catch(function (err) { > throw new CordovaError(err); > }); > }; > {code} > the platform add process runs almost instantly rather than taking a few > minutes. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Comment Edited] (CB-14133) Avoid reinstalling already installed plugins in cordova-fetch
[ https://issues.apache.org/jira/browse/CB-14133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515243#comment-16515243 ] Zak edited comment on CB-14133 at 6/17/18 10:49 PM: Fantastic work. Just tried nightly build and works a treat 👍 Thanks! was (Author: zbarbuto): Fantastic work. Just tried nightly build and works a treat 👍 > Avoid reinstalling already installed plugins in cordova-fetch > - > > Key: CB-14133 > URL: https://issues.apache.org/jira/browse/CB-14133 > Project: Apache Cordova > Issue Type: Wish > Components: cordova-cli, cordova-fetch >Affects Versions: 8.0.0 >Reporter: Zak >Assignee: Raphael >Priority: Minor > > Relates to CB-13992 > The pull request for CB-13992 removed the {{dependency-ls}} package which > helped to speed up the platform add step. However, each plugin still gets > {{npm install}} ed seemingly just to determine the package name. > Typical workflow is to run {{npm install}} as the first task after cloning a > node repository. The current practice for cordova is to save plugins to the > package.json meaning that plugins are already installed to the node_modules > directory, so running {{npm install}} for each of them individually is > redundant. > If the main function in {{cordova-fetch}} is simplified to just return the > path to the given module (albeit this isn't the most elegant implementation): > {code:javascript} > module.exports = function (target, dest, opts = {}) { > var fetchArgs = opts.link ? ['link'] : ['list']; > var nodeModulesDir = dest + '/node_modules/'; > // check if npm is installed > return module.exports.isNpmInstalled() > .then(function () { > const mod = target.slice(0, target.lastIndexOf('@')); > return path.resolve(nodeModulesDir, mod) > }) > .catch(function (err) { > throw new CordovaError(err); > }); > }; > {code} > the platform add process runs almost instantly rather than taking a few > minutes. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14140) Use fs-extra (and which) instead of shelljs
[ https://issues.apache.org/jira/browse/CB-14140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515078#comment-16515078 ] ASF GitHub Bot commented on CB-14140: - raphinesse closed pull request #19: CB-14140 Use fs-extra instead of shelljs URL: https://github.com/apache/cordova-create/pull/19 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/index.js b/index.js index ec88303..22cc582 100644 --- a/index.js +++ b/index.js @@ -17,13 +17,13 @@ under the License. */ -var fs = require('fs'); +const fs = require('fs-extra'); + var os = require('os'); var path = require('path'); var Promise = require('q'); var isUrl = require('is-url'); -var shell = require('shelljs'); var isObject = require('isobject'); var requireFresh = require('import-fresh'); var validateIdentifier = require('valid-identifier'); @@ -201,11 +201,11 @@ module.exports = function (dir, optionalId, optionalName, cfg, extEvents) { copyIfNotExists(stockAssetPath('hooks'), path.join(dir, 'hooks')); var configXmlExists = projectConfig(dir); // moves config to root if in www if (!configXmlExists) { -shell.cp(stockAssetPath('config.xml'), path.join(dir, 'config.xml')); +fs.copySync(stockAssetPath('config.xml'), path.join(dir, 'config.xml')); } } catch (e) { if (!dirAlreadyExisted) { -shell.rm('-rf', dir); +fs.removeSync(dir); } if (process.platform.slice(0, 3) === 'win' && e.code === 'EPERM') { throw new CordovaError('Symlinks on Windows require Administrator privileges'); @@ -235,8 +235,8 @@ module.exports = function (dir, optionalId, optionalName, cfg, extEvents) { } // Create basic project structure. -shell.mkdir('-p', path.join(dir, 'platforms')); -shell.mkdir('-p', path.join(dir, 'plugins')); +fs.ensureDirSync(path.join(dir, 'platforms')); +fs.ensureDirSync(path.join(dir, 'plugins')); var configPath = path.join(dir, 'config.xml'); // only update config.xml if not a symlink @@ -259,8 +259,7 @@ module.exports = function (dir, optionalId, optionalName, cfg, extEvents) { */ function copyIfNotExists (src, dst) { if (!fs.existsSync(dst) && src) { -shell.mkdir(dst); -shell.cp('-R', path.join(src, '*'), dst); +fs.copySync(src, dst); } } @@ -279,7 +278,7 @@ function copyTemplateFiles (templateDir, projectDir, isSubDir) { // if template is a www dir if (path.basename(templateDir) === 'www') { copyPath = path.resolve(templateDir); -shell.cp('-R', copyPath, projectDir); +fs.copySync(copyPath, path.resolve(projectDir, 'www')); } else { var templateFiles = fs.readdirSync(templateDir); // Remove directories, and files that are unwanted @@ -290,10 +289,10 @@ function copyTemplateFiles (templateDir, projectDir, isSubDir) { }); } // Copy each template file after filter -for (var i = 0; i < templateFiles.length; i++) { -copyPath = path.resolve(templateDir, templateFiles[i]); -shell.cp('-R', copyPath, projectDir); -} +templateFiles.forEach(f => { +copyPath = path.resolve(templateDir, f); +fs.copySync(copyPath, path.resolve(projectDir, f)); +}); } } @@ -325,9 +324,7 @@ function linkFromTemplate (templateDir, projectDir) { var linkSrc, linkDst, linkFolders, copySrc, copyDst; function rmlinkSync (src, dst, type) { if (src && dst) { -if (fs.existsSync(dst)) { -shell.rm('-rf', dst); -} +fs.removeSync(dst); if (fs.existsSync(src)) { fs.symlinkSync(src, dst, type); } @@ -355,7 +352,7 @@ function linkFromTemplate (templateDir, projectDir) { // if template/www/config.xml then copy to project/config.xml copyDst = path.join(projectDir, 'config.xml'); if (!fs.existsSync(copyDst) && fs.existsSync(copySrc)) { -shell.cp(copySrc, projectDir); +fs.copySync(copySrc, copyDst); } } diff --git a/package.json b/package.json index 3cacb07..6893db8 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,11 @@ "cordova-app-hello-world": "^3.11.0", "cordova-common": "^2.2.0", "cordova-fetch": "^1.3.0", +"fs-extra": "^6.0.1", "import-fresh": "^2.0.0", "is-url": "^1.2.4", "isobject": "^3.0.1", "q": "^1.5.1", -
[jira] [Commented] (CB-14140) Use fs-extra (and which) instead of shelljs
[ https://issues.apache.org/jira/browse/CB-14140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515079#comment-16515079 ] ASF GitHub Bot commented on CB-14140: - raphinesse closed pull request #14: CB-14140 WIP fs-extra instead of shelljs URL: https://github.com/apache/cordova-create/pull/14 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/index.js b/index.js index 61181ca..30b9fcf 100644 --- a/index.js +++ b/index.js @@ -17,13 +17,13 @@ under the License. */ -var fs = require('fs'); +const fs = require('fs-extra'); + var os = require('os'); var path = require('path'); var Promise = require('q'); var isUrl = require('is-url'); -var shell = require('shelljs'); var requireFresh = require('import-fresh'); var validateIdentifier = require('valid-identifier'); @@ -232,11 +232,11 @@ module.exports = function (dir, optionalId, optionalName, cfg, extEvents) { copyIfNotExists(stockAssetPath('hooks'), path.join(dir, 'hooks')); var configXmlExists = projectConfig(dir); // moves config to root if in www if (!configXmlExists) { -shell.cp(stockAssetPath('config.xml'), path.join(dir, 'config.xml')); +fs.copySync(stockAssetPath('config.xml'), path.join(dir, 'config.xml')); } } catch (e) { if (!dirAlreadyExisted) { -shell.rm('-rf', dir); +fs.removeSync(dir); } if (process.platform.slice(0, 3) === 'win' && e.code === 'EPERM') { throw new CordovaError('Symlinks on Windows require Administrator privileges'); @@ -266,8 +266,8 @@ module.exports = function (dir, optionalId, optionalName, cfg, extEvents) { } // Create basic project structure. -shell.mkdir('-p', path.join(dir, 'platforms')); -shell.mkdir('-p', path.join(dir, 'plugins')); +fs.ensureDirSync(path.join(dir, 'platforms')); +fs.ensureDirSync(path.join(dir, 'plugins')); var configPath = path.join(dir, 'config.xml'); // only update config.xml if not a symlink @@ -290,8 +290,7 @@ module.exports = function (dir, optionalId, optionalName, cfg, extEvents) { */ function copyIfNotExists (src, dst) { if (!fs.existsSync(dst) && src) { -shell.mkdir(dst); -shell.cp('-R', path.join(src, '*'), dst); +fs.copySync(src, dst); } } @@ -310,7 +309,7 @@ function copyTemplateFiles (templateDir, projectDir, isSubDir) { // if template is a www dir if (path.basename(templateDir) === 'www') { copyPath = path.resolve(templateDir); -shell.cp('-R', copyPath, projectDir); +fs.copySync(copyPath, path.resolve(projectDir, 'www')); } else { var templateFiles = fs.readdirSync(templateDir); // Remove directories, and files that are unwanted @@ -321,10 +320,10 @@ function copyTemplateFiles (templateDir, projectDir, isSubDir) { }); } // Copy each template file after filter -for (var i = 0; i < templateFiles.length; i++) { -copyPath = path.resolve(templateDir, templateFiles[i]); -shell.cp('-R', copyPath, projectDir); -} +templateFiles.forEach(f => { +copyPath = path.resolve(templateDir, f); +fs.copySync(copyPath, path.resolve(projectDir, f)); +}); } } @@ -373,9 +372,7 @@ function linkFromTemplate (templateDir, projectDir) { var linkSrc, linkDst, linkFolders, copySrc, copyDst; function rmlinkSync (src, dst, type) { if (src && dst) { -if (fs.existsSync(dst)) { -shell.rm('-rf', dst); -} +fs.removeSync(dst); if (fs.existsSync(src)) { fs.symlinkSync(src, dst, type); } @@ -403,7 +400,7 @@ function linkFromTemplate (templateDir, projectDir) { // if template/www/config.xml then copy to project/config.xml copyDst = path.join(projectDir, 'config.xml'); if (!fs.existsSync(copyDst) && fs.existsSync(copySrc)) { -shell.cp(copySrc, projectDir); +fs.copySync(copySrc, copyDst); } } diff --git a/package.json b/package.json index 9ac95d1..c4e7f37 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,10 @@ "cordova-app-hello-world": "^3.11.0", "cordova-common": "^2.2.0", "cordova-fetch": "^1.3.0", +"fs-extra": "^6.0.1", "import-fresh": "^2.0.0", "is-url": "^1.2.4", "q": "^1.5.1", -"shelljs": "^0.8.2", "valid-identifier": "0.0.1" },
[jira] [Commented] (CB-14140) Use fs-extra (and which) instead of shelljs
[ https://issues.apache.org/jira/browse/CB-14140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515077#comment-16515077 ] ASF GitHub Bot commented on CB-14140: - raphinesse commented on issue #19: CB-14140 Use fs-extra instead of shelljs URL: https://github.com/apache/cordova-create/pull/19#issuecomment-397879029 Merging now as #14 had been approved already. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Use fs-extra (and which) instead of shelljs > --- > > Key: CB-14140 > URL: https://issues.apache.org/jira/browse/CB-14140 > Project: Apache Cordova > Issue Type: Improvement > Components: cordova-android, cordova-common, cordova-create, > cordova-fetch, cordova-ios, cordova-lib, cordova-osx, cordova-windows >Reporter: Chris Brody >Assignee: Darryl Pogue >Priority: Minor > > It is more efficient to use fs-extra, sometimes with some help from which, > than shelljs. > This improvement has already landed in the master branch of cordova-common > for the next major release, and work has already been started in some other > packages. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14140) Use fs-extra (and which) instead of shelljs
[ https://issues.apache.org/jira/browse/CB-14140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515076#comment-16515076 ] ASF GitHub Bot commented on CB-14140: - raphinesse opened a new pull request #19: CB-14140 Use fs-extra instead of shelljs URL: https://github.com/apache/cordova-create/pull/19 A rebased version of #14. Resolves #14. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Use fs-extra (and which) instead of shelljs > --- > > Key: CB-14140 > URL: https://issues.apache.org/jira/browse/CB-14140 > Project: Apache Cordova > Issue Type: Improvement > Components: cordova-android, cordova-common, cordova-create, > cordova-fetch, cordova-ios, cordova-lib, cordova-osx, cordova-windows >Reporter: Chris Brody >Assignee: Darryl Pogue >Priority: Minor > > It is more efficient to use fs-extra, sometimes with some help from which, > than shelljs. > This improvement has already landed in the master branch of cordova-common > for the next major release, and work has already been started in some other > packages. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org