diff --git a/CHANGELOG.md b/CHANGELOG.md index cfc15c3..1fb13a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,160 +1,229 @@ CHANGELOG ==== + +v5.0.0 +---- + +#### Feature + +* Support Capacitor Projects (Beta). +* Support Yarn Projects (Beta). +* Detail Changelog in [`monaca-lib@5.0.0`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v500) + v4.2.11 ---- + #### Bug Fix + * Fix a bug where the template was missing * Detail Changelog in [`monaca-lib@4.1.10`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md) v4.2.10 ---- + #### Updates + * Detail Changelog in [`monaca-lib@4.1.9`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md) v4.2.9 ---- + #### Updates + * Add retry option when there is a problem in downloading from the cloud server * Detail Changelog in [`monaca-lib@4.1.8`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v418) v4.2.8 ---- + #### Bug Fix + * Fix HTTPS request error handling in monaca.js v4.2.7 ---- + #### Bug Fix + * Handle uncaught exceptions in monaca.js * Fix incorrect usage of util.print in loginErrorHandler v4.2.6 ---- + #### Updates + * Changed the command message to set a proxy server from "monaca proxy set" to "monaca config proxy" v4.2.5 ---- + #### Updates + * Remove tutorial option from docs command v4.2.4 ---- + #### Updates + * Switch from optimist to minimist v4.2.3 ---- + #### Updates + * Improve error message when download session has expired after running `monaca remote build`. v4.2.2 ---- + #### Updates + * Support iOS Simulator Build. * Detail Changelog in [`monaca-lib@4.1.5`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v415) v4.2.1 ---- + #### Updates + * Detail Changelog in [`monaca-lib@4.1.2`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v412) * Update dependencies v4.2.0 ---- + #### Updates + * Update `monaca info` to use `child_process` to get NPM version * Detail Changelog in [`monaca-lib@4.1.0`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v410) v4.1.1 ---- + #### Updates + * Update Monaca document url v4.1.0 ---- + #### Updates + * Support `debugger` build for `ios` and `android` platforms. Example: `monaca remote build ios --build-type=debugger` and `monaca remote build ios --build-type=debugger` v4.0.2 ---- + #### Updates + * Detail Changelog in [`monaca-lib@4.0.2`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v402) v4.0.1 ---- + #### Updates + * Detail Changelog in [`monaca-lib@4.0.1`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v401) v4.0.0 ---- + #### Updates + * Detail Changelog in [`monaca-lib@4.0.0`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v400) * Run `monaca signup` command will open the registration page if the user is not logged in * Synchronize version with other Monaca Development Kits (Monaca Localkit and Lib) v3.3.8 ---- + #### Bug Fix + * Update dependencies to resolve circular dependency warnings v3.3.7 ---- + #### Feature + * Detail Changelog in [`monaca-lib@3.2.10`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v3210) v3.3.6 ---- + #### Bug Fix + * Fixed running `monaca preview` on windows. v3.3.5 ---- + #### Bug Fix + * Return proper 401 unauthorized access from the server for login and signup operation v3.3.4 ---- + #### Feature + * Detail Changelog in [`monaca-lib@3.2.8`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v328) v3.3.3 ---- + #### Bug Fix + * Fixes to support older version of Nodejs (CERT_HAS_EXPIRED). ## Announcement + * We will drop support of Node `8.x` in the future. Please upgrade Node to `10.x` or higher. v3.3.2 ---- + #### Bug Fix + * Fix bugs in [`monaca-lib@3.2.6`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v326) v3.3.1 ---- + #### Bug Fix + * Fix bugs in [`monaca-lib@3.2.5`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v325) v3.3.0 ---- -#### Feature -* improve monaca plugin add commands to update package.json according to the plugin's plugin.xml file instead of using cordova plugin add commands. For the remote repository, currently support only https://github.com/ and https://gitlab.com/ + +#### Feature + +* improve monaca plugin add commands to update package.json according to the plugin's plugin.xml file instead of using cordova plugin add commands. For the remote repository, currently support only and v3.2.1 ---- + #### Bug Fix + * Fix bugs in [`monaca-lib@3.2.4`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v324) v3.2.0 ---- + #### Feature + * Added support for electron (windows, macos, and linux) and pwa builds. v3.1.4 ---- + #### Bug Fixes + * Generate default build filename for android and ios * Return a proper error message if could not download the build file * Inform user to run `monaca download --delete` after running `monaca remote config` @@ -162,43 +231,54 @@ v3.1.4 v3.1.3 ---- + #### Bug Fixes + * Minor fixed to the `monaca --help` command v3.1.2 ---- + #### Bug Fixes + * Fixed to support interactive commands usage on Windows (for Node 10.x) by using `inquirer` package on Windows platform v3.1.1 ---- + #### Bug Fixes + * Fixed to encode the file path param v3.1.0 ---- #### Features + * Show spinner and file information during file comparision. * `monaca remote config` and `monaca remote build`: added `--skipUpload` to skip uploading local project to cloud when building project. * `monaca remote config` and `monaca remote build`: added `--skipTranspile` to skip transpile process when uploading project to cloud during building. #### Bug Fixes + * Exit the program when `SIGINT` signal is sent to the console. v3.0.4 ---- + * Prompt users for project name and description when creating new project in cloud. * Remove unused resources. * Fix some wording. v3.0.3 ---- + * Fix broken document link. * `monaca debug`: connect to the next available port if the default port `8001` is being used. v3.0.2 ---- + * `monaca update`: fixed not to stringify `package.backup.json`. * `monaca clone`: fixed not to download `node_modules` folder and automatically run `npm install` afterward. * Fixed `monaca download` and `monaca upload` dealing with large project files. @@ -208,16 +288,19 @@ v3.0.1 ---- #### Features + * Added `monaca update` command. This command is used to update project created using Monaca CLI 2.x or lower to Monaca CLI 3. * Added `monaca init` command. This command is used to initialize projects created using other CLI tools to the Monaca structure. * Added `needToUpgrade` function to check if the user can execute a command or needs to update the project (with [`monaca-lib@3.0.0`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v300)). * Modified `isMonacaProject` function (with [`monaca-lib@3.0.0`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v300)). #### Deprecated + * Removed `monaca reconfigure` command. * Removed `monaca demo` command. #### Breaking changes + * Remove `port` and `no-open` option from `monaca preview`. * Remove `generate-config` and `install-dependencies` option from `monaca transpile`. * Modified `monaca preview`, `monaca transpile` and `monaca debug` to execute the new Monaca Commands (with [`monaca-lib@3.0.0`](https://github.com/monaca/monaca-lib/blob/master/CHANGELOG.md#v300)): @@ -228,83 +311,100 @@ v3.0.1 v2.7.14 ---- + * Fixed bugs in `monaca remote build`, `monaca remote config`, `monaca upload` and `monaca download` (with `monaca-lib@2.7.13`). v2.7.13 ---- + * Revert changes made in `2.7.12` due to Monaca proxy server. It only applies to `Monaca Cloud IDE`. v2.7.12 ---- + * fixed the hot reloading for transpile project templates in Monaca Cloud IDE. v2.7.11 ---- + * appended `path` to the `upload` and `download` request url (with `monaca-lib@2.7.11`) * return `upload` and `download` progress to `localkit` (with `monaca-lib@2.7.11`) * remove `platforms` from default `.monacaignore` for project with lower cordova version (with `monaca-lib@2.7.11`) v2.7.10 ---- + * Modified `monaca preview` to include `loader.js` and `loader.css` to `index.html` (with `monaca-lib@2.7.10`) v2.7.9 ---- + * Modified `monaca remote build` to ask users providing the build directory if it is not specified. In addition, the default build directory is changed to `Desktop` directory. * Fixed `monaca import` to NOT set `project_id` to `local_properties.json` (with `monaca-lib@2.7.9`) v2.7.8 ---- + * Always append `webpack-dev-server/client` to webpack configuration to fix `Angular`'s `live reloading` with `monaca-lib@2.7.8` v2.7.7 ---- + * Appended `webpack-dev-server/client` to webpack configuration only if `inline` and `hot` are set to true * Appended `webpack-dev-server/client` to `entry.watch` if supplied * Modified `monaca preview` to write files to `www` directory in `monaca-lib@2.7.7` so that the `monaca debugger` will see the changes immediately without running `monaca transpile` v2.7.6 ---- + * Added `skipTranspile` option to `monaca upload` to skip transpiling if supplied * Generated `.monacaignore` for all project templates and Improved retrieving local project files in `monaca-lib@2.7.6` v2.7.5 ---- + * Fixed `monaca demo` issues for transpile projects. v2.7.4 ---- + * Added `monaca signing` command. This command is used to manage iOS and Android signing configuration such as keystore, certificate, provisioning profile, etc. v2.7.0 ---- + * Stopped livereload in case of transpilable project * Changed web server program - v2.6.1 ---- + * Bumped built-in Cordova CLI dependency to 7.1.0. v2.6.0 ---- + * Added React-Native Project Support v2.5.3 ---- + * Temporary disabled project link on creation because of output issues with recent npm versions. v2.5.2 ---- + * Fixed npm issue during project creation. * Improved error message when a remote build fails. v2.5.1 ---- + * Fixed `debug` inspector issue. v2.5.0 ---- + **All previous Monaca CLI versions will not be anymore compatible with Monaca Cloud Services** * Security enhancements. @@ -312,25 +412,30 @@ v2.5.0 v2.4.6 ---- + * Allowed `preview|serve|demo|debug|transpile|reconfigure` commands to be executed from subdirectories. * Minor bug fix. v2.4.5 ---- + * Fixed broken `transpile`, `preview | serve` commands in specific conditions. v2.4.4 ---- + * Improved compatibility with [Onsen UI vue-cordova-webpack](https://github.com/OnsenUI/vue-cordova-webpack) template. * Warning message fix. v2.4.3 ---- + * Fixed broken `monaca -v` command. * Improved internal login in `monaca-lib` dependency. v2.4.2 ---- + * Bumped up built-in Cordova CLI to version 6.5 * Added `monaca remote config` command. * Added extended general purpose helper by executing `monaca --help`. @@ -338,12 +443,14 @@ v2.4.2 v2.4.1 ---- + * Integrated remote build history (`monaca remote build --build-list`). * Improved logout function. * Added distinction notification between Monaca CLI and Cordova CLI commands. v2.4.0 ---- + * Added Cordova 6.5 support. * Filtered displayed tasks depending on the current dir. * Improved login by adding direct override. @@ -351,17 +458,20 @@ v2.4.0 v2.3.2 ---- + * Added `link to IDE` option during project creation. * Updated Webpack resolvers for transpilable templates. * Added support to updated transpilable templates. v2.3.1 ---- + * Improved `monaca create` command with new options. * Bug fix for Vue templates. v2.3.0 ---- + * Added support to the latest Vue.js 2 and ReactJS templates with Onsen UI 2.4.0. * Fixed debug for the new transpilable projecs when `monaca preview` is executed. * Added `monaca info` command. @@ -372,30 +482,36 @@ v2.3.0 v2.2.7 ---- + * Fixed auto-reloading in `monaca preview/serve/demo`. * New HTTP Server support. v2.2.6 ---- + * Added `monaca demo` command. v2.2.5 ---- + * Fixed local debug bug. Fixed #92. * Fixed project path on Monaca Debugger. v2.2.4 ---- + * Fixed critical sync bug for projects containing special characters in the path. * General performance improvement due to leak fix. v2.2.3 ---- + * Fixed upload issue for Cordova projects. * Added update checker. v2.2.2 ---- + * Fixed transpiling issue on Vue templates. * Added `monaca config` command with API endpoint and proxy management. * Added `monaca docs` command. @@ -403,59 +519,71 @@ v2.2.2 v2.2.1 ---- + * Fixed automatic browser opening and missing log on project preview. v2.2.0 ---- + * Update monaca-lib version in order to support new templates. * Fix template dependencies. v2.1.7 ---- + * Update monaca-lib version. v2.1.6 ---- + * Update monaca-lib version. * Fixed Monaca project check issue. v2.1.5 ---- + * Update monaca-lib version. * Assure Monaca project before reconfigure to handle errors. v2.1.4 ---- + * Update monaca-lib version. v2.1.3 ---- + * Find another port when the first one is in use. * Added command aliases. v2.1.2 ---- + * New optional paramenter `--url` for `monaca create`. * Fix path issues when using NVM or similar. * Improve WebPack output in development mode. v2.1.1 ---- + * Update monaca-lib version. * Preview: Show all possible IPv4 addresses. v2.1.0 ---- + * Support hot reloading of React templates. * Support WebPack configurations. * Major changes in React and Angular 2 templates. v2.0.6 ---- + * Updated monaca-lib to support Cordova 6.2.0. v2.0.5 ---- + * Improved `create` command to show a preview of the template. * Minor fixes. * Implemented command analytics. @@ -463,24 +591,29 @@ v2.0.5 v2.0.4 ---- + * Updated monaca-lib. * Combine SampleApps category with templates in `create` command. v2.0.3 ---- + * Dependencies fix. * Added --no-open parameter for `preview` command. v2.0.2 ---- + * Improved UI prompt. v2.0.1 ---- + * Fix for transpiling and remote build. v2.0.0 ---- + * Code refactored and some major API changes. * Improved UI with better prompt. * Improved connection performance and responsiveness. @@ -494,97 +627,118 @@ v2.0.0 v1.2.10 ---- + * monaca-login: Added optional email parameter. * monaca-remote-build: Added optional email parameter. v1.2.8 ---- + * monaca-download/upload: Allowed upload/download for config files inside the root directory. v1.2.7 ---- - * monaca-download: Fixed wrong files deletion in `downloadProject()`. + +* monaca-download: Fixed wrong files deletion in `downloadProject()`. v1.2.6 ---- - * monaca-remote-build: Added missing `options` parameter. + +* monaca-remote-build: Added missing `options` parameter. v1.2.5 ---- - * monaca-download: Fixed to download some files that were exempted. + +* monaca-download: Fixed to download some files that were exempted. v1.2.4 ---- - * monaca-upload: Added --force, --delete, and --dry-run options. - * monaca-download: Added --force, --delete, and --dry-run options + +* monaca-upload: Added --force, --delete, and --dry-run options. +* monaca-download: Added --force, --delete, and --dry-run options v1.2.3 ---- - * monaca-clone: Fixed project import bug. + +* monaca-clone: Fixed project import bug. v1.2.2 ---- - * monaca-upload: Fixed file uploading error. - * monaca-remote-build: Removed timeout error. - * monaca-multiserve: Fixed issue when calling Ctrl-C in multiserve. - * monaca-create: Fixed monaca create to include project name. + +* monaca-upload: Fixed file uploading error. +* monaca-remote-build: Removed timeout error. +* monaca-multiserve: Fixed issue when calling Ctrl-C in multiserve. +* monaca-create: Fixed monaca create to include project name. v1.2.1 ---- - * monaca: Fixed line encoding for bin/monaca. + +* monaca: Fixed line encoding for bin/monaca. v1.2.0 ---- - * monaca-remote-build: Added non-interactive build for CI purpose. - * monaca-create: Now it will create an app from Cloud templates. - * monaca-help: Removed local build options, and supported `--help` parameter. - * monaca-clone: Rename to monaca-import. New monaca-clone will save local project. - * Updated monaca-lib to fix binary upload error. + +* monaca-remote-build: Added non-interactive build for CI purpose. +* monaca-create: Now it will create an app from Cloud templates. +* monaca-help: Removed local build options, and supported `--help` parameter. +* monaca-clone: Rename to monaca-import. New monaca-clone will save local project. +* Updated monaca-lib to fix binary upload error. v1.1.1 ---- - * monaca-sync: Fixed bug where it cannot clone the project. + +* monaca-sync: Fixed bug where it cannot clone the project. v1.1.0 ---- - * monaca-login: Support authentication parameters. + +* monaca-login: Support authentication parameters. v1.0.10 ---- - * monaca-livesync: Support new `Localkit.initInspector` method. + +* monaca-livesync: Support new `Localkit.initInspector` method. v1.0.9 ---- - * monaca-upload: This command will now only work for Monaca projects and it will search parent directories until it finds one. - * monaca-download: This command will now only work for Monaca projects and it will search parent directories until it finds one. + +* monaca-upload: This command will now only work for Monaca projects and it will search parent directories until it finds one. +* monaca-download: This command will now only work for Monaca projects and it will search parent directories until it finds one. v1.0.7 ---- - * monaca-upload: Fixed bug where it didn't upload if .monaca was empty. + +* monaca-upload: Fixed bug where it didn't upload if .monaca was empty. v1.0.5 ---- - * monaca-login: Added version parameter when signing in. + +* monaca-login: Added version parameter when signing in. v1.0.4 ---- - * core: Updated dependencies. + +* core: Updated dependencies. v1.0.3 ---- - * monaca-plugin: Improved docs. - * monaca-upload: Made prompt case-insensitive. - * monaca-download: Made prompt case-insensitive. + +* monaca-plugin: Improved docs. +* monaca-upload: Made prompt case-insensitive. +* monaca-download: Made prompt case-insensitive. v1.0.2 ---- - * monaca-proxy: Added proxy support. + +* monaca-proxy: Added proxy support. v1.0.1 ---- - * monaca-create: Improved docs. - * monaca-clone: Use the project name as default destination directory. + +* monaca-create: Improved docs. +* monaca-clone: Use the project name as default destination directory. v1.0.0 ------ - * Initial version. + +* Initial version. diff --git a/doc/tasks/remote.json b/doc/tasks/remote.json index bca3894..df6f381 100755 --- a/doc/tasks/remote.json +++ b/doc/tasks/remote.json @@ -4,6 +4,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": false, "react-native": true }, "description": "build a project on Monaca Cloud", @@ -82,6 +83,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": false, "react-native": true }, "description": "open the project configuration on Monaca Cloud", diff --git a/doc/tasks/serve.json b/doc/tasks/serve.json index 854247f..3946e32 100755 --- a/doc/tasks/serve.json +++ b/doc/tasks/serve.json @@ -4,6 +4,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": true, "react-native": false }, "description": "run a local web server for preview (execute `npm run monaca:preview` defined in package.json)", diff --git a/doc/tasks/signing.json b/doc/tasks/signing.json index dc0ae45..a2ffc0b 100755 --- a/doc/tasks/signing.json +++ b/doc/tasks/signing.json @@ -4,6 +4,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": false, "react-native": true }, "description": "manage signing configurations", diff --git a/doc/tasks/sync.json b/doc/tasks/sync.json index b81d0d0..0eb053f 100755 --- a/doc/tasks/sync.json +++ b/doc/tasks/sync.json @@ -42,6 +42,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": true, "react-native": false }, "description": "upload a project to Monaca Cloud", @@ -84,6 +85,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": true, "react-native": false }, "description": "download a project from Monaca Cloud", @@ -121,6 +123,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": true, "react-native": false }, "description": "run app on device using Monaca Debugger (execute `npm run monaca:debug` defined in package.json)", diff --git a/doc/tasks/transpile.json b/doc/tasks/transpile.json index fa541d8..e6895d0 100644 --- a/doc/tasks/transpile.json +++ b/doc/tasks/transpile.json @@ -4,6 +4,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": true, "react-native": false }, "description": "transpile project source code (execute `npm run monaca:transpile` defined in package.json)", diff --git a/doc/tasks/upgrade.json b/doc/tasks/upgrade.json index 2f10fc4..75bbb8b 100755 --- a/doc/tasks/upgrade.json +++ b/doc/tasks/upgrade.json @@ -4,6 +4,7 @@ "category": "project", "frameworkSupport": { "cordova": true, + "capacitor": false, "react-native": false }, "description": "update old projects to Monaca CLI 3.x structure", diff --git a/package-lock.json b/package-lock.json index 5b67ea8..2d4e2de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "monaca", - "version": "4.2.9", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "monaca", - "version": "4.2.9", + "version": "5.0.0", "hasInstallScript": true, "dependencies": { "@xmldom/xmldom": "^0.8.0", @@ -16,7 +16,7 @@ "ip": "^1.1.5", "minimist": "^1.2.8", "monaca-inquirer": "^1.0.4", - "monaca-lib": "^4.1.8", + "monaca-lib": "^5.0.0", "opn": "^5.3.0", "portfinder": "^1.0.7", "q": "^1.1.2", @@ -786,6 +786,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", "dev": true }, "node_modules/acorn": { @@ -1924,6 +1925,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "deprecated": "Use your platform's native DOMException instead", "dev": true, "dependencies": { "webidl-conversions": "^4.0.2" @@ -4853,9 +4855,9 @@ } }, "node_modules/monaca-lib": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/monaca-lib/-/monaca-lib-4.1.8.tgz", - "integrity": "sha512-W1Z2DnlvSxTujS+bFYQyhPkil3jrtcalrPHPiUzjI+6kG/L+aupEEDcl+5ATNzT7ICPBUCsBqJZD6T9vVG52/g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/monaca-lib/-/monaca-lib-5.0.0.tgz", + "integrity": "sha512-1G1IOMaWhtgSuebKD3MbHF3Dt9nxZEFpKCpzglmAUThlJ7xYyiVmMmsSZoR0jLJIF4A8vftt2H9lEwNKABn5Vw==", "dependencies": { "buffer-crc32": "^0.2.4", "compare-versions": "^3.6.0", diff --git a/package.json b/package.json index 009a92d..f7e0319 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monaca", - "version": "4.2.11", + "version": "5.0.0", "description": "Monaca Command Line Tool", "bin": { "monaca": "bin/monaca" @@ -36,7 +36,7 @@ "ip": "^1.1.5", "minimist": "^1.2.8", "monaca-inquirer": "^1.0.4", - "monaca-lib": "^4.1.10", + "monaca-lib": "^5.0.0", "opn": "^5.3.0", "portfinder": "^1.0.7", "q": "^1.1.2", diff --git a/src/capacitor.js b/src/capacitor.js new file mode 100644 index 0000000..ae79424 --- /dev/null +++ b/src/capacitor.js @@ -0,0 +1,36 @@ +(function() { + 'use strict'; + let Capacitor = {}; + + /** + * Not-supported command names. + */ + Capacitor.notSupportedTask = [ + 'remote config', + 'remote build', + 'signing', + 'init', + 'upgrade', + 'update', + 'debug', + 'plugin', + 'platform', + 'prepare', + 'compile', + 'run', + 'build', + 'emulate', + ]; + + /** + * Is not supported for Capacitor. + * + * @param {string} taskName + * @return {boolean} + */ + Capacitor.isNotSupportedTask = function (taskName) { + return Capacitor.notSupportedTask.includes(taskName); + }; + + module.exports = Capacitor; +}()); diff --git a/src/create.js b/src/create.js index 2ce9237..6d7e096 100755 --- a/src/create.js +++ b/src/create.js @@ -12,6 +12,7 @@ var fs = require('fs'), serializer = new XMLSerializer(), Monaca = require('monaca-lib').Monaca, util = require(path.join(__dirname, 'util')), + lib = require(path.join(__dirname, 'lib')), sync = require(path.join(__dirname, 'sync')); var isWindowsPlatform = process.platform === 'win32'; @@ -62,12 +63,17 @@ CreateTask.run = function(taskName, info) { }; CreateTask.createApp = function(template) { - var error = 'Error occurred while creating project: '; + let error = 'Error occurred while creating project: '; report.arg1 = template.name; monaca.downloadTemplate(template.resource, path.resolve(dirName)) .then( function() { + // if it is capacitor project, skip checking config.xml + if (lib.isCapacitorProject(dirName)) { + return Promise.resolve(); + } + // Extract the project name if nested path is given before project name. // E.g. if command is 'create project Apps/Finance/myFinanceApp', then myFinanceApp will be taken as project name. error = 'An error occurred while injecting project name in config.xml: '; @@ -81,7 +87,7 @@ CreateTask.createApp = function(template) { .then( function() { util.success('\nProject is created successfully.') - var message = [ + let message = [ '', 'Type "cd ' + dirName + '" and run monaca command again.', ' > ' + 'monaca preview'.info + ' => Run app in the browser', diff --git a/src/init.js b/src/init.js index 6bda8eb..f02473d 100644 --- a/src/init.js +++ b/src/init.js @@ -12,7 +12,7 @@ let printInitInfo = (commands) => { // www folder util.print(`A. Change the output folder to ${'www'.commands}.`); // config.xml - util.print(`B. In case of not having a ${'config.xml'.commands} file, a new one has been created with Monaca's default settings.`); + util.print(`B. For Cordova project, a new ${'config.xml'.commands} file has been created with Monaca's default settings.`); // monaca commands util.print(`C. Some new commands have been added:\n` + `\t${'monaca:preview'.commands}: ${commands.serve.commands}\n` @@ -31,7 +31,7 @@ let printInitInfo = (commands) => { + `\t\n` + `\t { console.log('\n\nExiting Program...'); process.exit(data); diff --git a/src/util.js b/src/util.js index bd2d607..460a26b 100644 --- a/src/util.js +++ b/src/util.js @@ -3,6 +3,7 @@ var Q = require('q'), fs = require('fs'), + path = require('path'), colors =require('colors'); var UPDATE_INTERVAL = 21600; //6 hours @@ -248,6 +249,23 @@ var getFormatExpirationDate = (timestamp) => { } } +/** + * Checks if a project is using Yarn as its package manager. + * + * @param {string} projectDir - The directory path of the project. + * @returns {boolean} - Returns true if the project uses Yarn, false otherwise. + */ +const isUsingYarn = (projectDir) => { + try { + const projectConfig = require(path.join(projectDir, 'package.json')); + const monacaPreviewScript = projectConfig.scripts && projectConfig.scripts['monaca:preview']; + if (monacaPreviewScript && monacaPreviewScript.indexOf('yarn') >= 0) { + return true; + } + } catch (err) {} + return false; +}; + module.exports = { print: println, info: printinfo, @@ -268,5 +286,6 @@ module.exports = { validateCountryCode: validateCountryCode, validateRequireField: validateRequireField, getFormatExpirationDate: getFormatExpirationDate, + isUsingYarn: isUsingYarn, }; })();