Skip to content

Commit

Permalink
Merge pull request #205 from monaca/dev_MN-5020
Browse files Browse the repository at this point in the history
fix: Fixed GA-related bugs
  • Loading branch information
as-hirose authored Feb 5, 2024
2 parents b73243a + d5a6328 commit d17a1be
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 41 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

CHANGELOG
====
v5.0.2
----

#### Bug Fix

* Fixed an error when specifying a directory in the `--output` option of `monaca remote build`.
* Fixed `monaca debug`.

v5.0.1
----
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monaca",
"version": "5.0.1",
"version": "5.0.2",
"description": "Monaca Command Line Tool",
"bin": {
"monaca": "bin/monaca"
Expand Down Expand Up @@ -36,7 +36,7 @@
"ip": "^1.1.5",
"minimist": "^1.2.8",
"monaca-inquirer": "^1.0.4",
"monaca-lib": "^5.1.1",
"monaca-lib": "^5.1.2",
"opn": "^5.3.0",
"portfinder": "^1.0.7",
"q": "^1.1.2",
Expand Down
6 changes: 5 additions & 1 deletion src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ AuthTask.login = function() {
};

AuthTask._performLogin = function() {
var report = {
const report = {
event: 'login'
};
monaca.reportAnalytics(report);
Expand Down Expand Up @@ -151,6 +151,10 @@ AuthTask.signup = function() {
util.print('You are signed in. Please sign out with \'monaca logout\' before creating a new account.');
},
function() {
var report = {
event: 'signup'
};
monaca.reportAnalytics(report);
util.warn('\nPlease finish the registration process and try login with command \'monaca login\'.');
open('https://monaca.mobi/en/signup', {wait: false});
}.bind(this)
Expand Down
6 changes: 4 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ ConfigTask.setProxy = function(proxyServer) {
var report = {
event: 'proxy'
};
monaca.reportAnalytics(report);

monaca.setConfig('http_proxy', proxyServer)
.then(
monaca.reportAnalytics.bind(monaca, report),
monaca.reportFinish.bind(monaca, report),
monaca.reportFail.bind(monaca, report)
)
.then(
Expand Down Expand Up @@ -88,10 +89,11 @@ ConfigTask.setAPIEndpoint = function(APIEndpoint) {
var report = {
event: 'api_endpoint'
};
monaca.reportAnalytics(report);

monaca.setConfig('api_endpoint', APIEndpoint)
.then(
monaca.reportAnalytics.bind(monaca, report),
monaca.reportFinish.bind(monaca, report),
monaca.reportFail.bind(monaca, report)
)
.then(
Expand Down
19 changes: 9 additions & 10 deletions src/cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ const isListCMD = args => args[3] === 'list';
CordovaTask.run = async function (taskName, info) {

monaca = new Monaca(info);
const args = process.argv.length > 3 ? process.argv.slice(3).join(' ') : '';

const report = {
event: 'plugin',
params: { args }
};
monaca.reportAnalytics(report);

const projectDir = await lib.findProjectDir(process.cwd(), monaca);

Expand All @@ -32,6 +39,7 @@ CordovaTask.run = async function (taskName, info) {
util.fail(`${err}\n`);
}

const pluginArg = process.argv;
if (isAddCMD(process.argv)) {
try {
return await addPlugin(process.argv, projectDir);
Expand All @@ -56,19 +64,10 @@ CordovaTask.run = async function (taskName, info) {

util.warn('Attention, the requested command is a Cordova CLI ' + (cordovaJson.version ? cordovaJson.version : '') + ' command.');
util.warn('In case of issue, refer to the official Cordova CLI documentation.\n');

let args = process.argv.length > 3 ? process.argv.slice(3).join(' ') : '';

let cmd = path.join(projectDir, 'node_modules', '.bin', 'cordova') + ' ' + taskName + ' ' + args;

let needReport = taskName === 'plugin' && process.argv[3], reportErrors = '';
let report = {
event: 'plugin',
arg1: args
};

if (needReport) {
monaca.reportAnalytics(report);
}

let childProcess = exec(cmd);

Expand Down
2 changes: 1 addition & 1 deletion src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CreateTask.run = function(taskName, info) {

CreateTask.createApp = function(template) {
let error = 'Error occurred while creating project: ';
report.arg1 = template.name;
report.params = { template: template.name };

monaca.downloadTemplate(template.resource, path.resolve(dirName))
.then(
Expand Down
6 changes: 3 additions & 3 deletions src/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
};

ConfigTask.openDocs = function(docsType) {
var rawArgv = process.argv.slice(3);
var report = {
const args = process.argv.length > 3 ? process.argv.slice(3).join(' ') : '';
const report = {
event: 'docs',
arg1: rawArgv
params: { args }
};

var openDocs = function(docsType) {
Expand Down
11 changes: 10 additions & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ module.exports = {
let monaca = new Monaca(info);
let commands = {}, isTranspile;

const report = {
event: taskName
};
monaca.reportAnalytics(report);

util.warn(`Before trying to initialize your project, please take a look at ${CLI_MIGRATION_DOC_URL} to get the basic information about how to do this process.`);
return lib.confirmMessage(confirmMessage, true)
.then(
Expand Down Expand Up @@ -104,7 +109,11 @@ module.exports = {
printInitInfo(commands);
return projectDir;
})
.then(
monaca.reportFinish.bind(monaca, report),
monaca.reportFail.bind(monaca, report)
)
.then(info => util.success(`${taskName} process finished.`))
.catch(err => util.fail(`Project ${taskName} failed. ${err}`))
}
}
}
10 changes: 5 additions & 5 deletions src/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ RemoteTask.remote = function(task) {
if (!params.browser && !params['build-list'] && task !== 'config' && (!params.platform || !params.purpose)) {
util.fail('Missing parameters. Please write --help to see the correct usage.');
}

var report = {
event: 'remote-' + task,
arg1: params.platform,
otherArgs: JSON.stringify(params)
const args = process.argv.length > 3 ? process.argv.slice(3).join(' ') : '';
const report = {
event: 'remote_' + task,
params: { args }
};

monaca.reportAnalytics(report);

var cwd, projectInfo, error = '';
Expand Down
7 changes: 6 additions & 1 deletion src/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ let ServeTask = {}; let monaca;
*/
ServeTask.run = function (taskName, info) {
monaca = new Monaca(info);
const report = {
event: taskName
};
monaca.reportAnalytics(report);

lib.findProjectDir(process.cwd(), monaca)
.then( dir => {
lib.needToUpgrade(dir, monaca);
Expand All @@ -41,4 +46,4 @@ ServeTask.run = function (taskName, info) {
.catch( util.fail.bind(null, 'Project ' + taskName + ' failed: ') );
};

module.exports = ServeTask;
module.exports = ServeTask;
8 changes: 8 additions & 0 deletions src/signing.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,14 @@ module.exports = {
let action = '';
let target = '';

const args = process.argv.length > 3 ? process.argv.slice(3).join(' ') : '';
const report = {
event: task,
params: { args }
};

monaca.reportAnalytics(report);

lib.findProjectDir(process.cwd(), monaca)
.then(
(cwd) => {
Expand Down
18 changes: 9 additions & 9 deletions src/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ SyncTask.run = function(taskName, info, options) {
} else {
return monaca.prepareSession().then(
function() {
if (taskName === 'clone') {
this.clone(true); // 'true' flag ensures that cloud project id is saved locally.
} else if (taskName === 'import') {
this.clone(false);
if (taskName === 'clone' || taskName === 'import') {
this.clone(taskName); // 'true' flag ensures that cloud project id is saved locally.
} else if (taskName === 'upload' || taskName === 'download') {
this.load(taskName, options);
}
Expand Down Expand Up @@ -105,12 +103,13 @@ SyncTask.load = function(action, arg) {
);
};

SyncTask.clone = function(saveCloudProjectID) {
SyncTask.clone = function(taskName) {
util.print('Fetching project list...');
var saveCloudProjectID = taskName === 'clone';
var project;

var report = {
event: 'clone'
event: taskName
};
monaca.reportAnalytics(report);

Expand Down Expand Up @@ -139,7 +138,7 @@ SyncTask.clone = function(saveCloudProjectID) {
project.destPath = answers.destPath;
project.absolutePath = path.resolve(answers.destPath);

report.arg1 = project.name;
report.params = { project: project.name };
return project;
}
);
Expand Down Expand Up @@ -271,9 +270,10 @@ SyncTask.livesync = function() {
projects.push(projectDir);
}

var report = {
const args = process.argv.length > 3 ? process.argv.slice(3).join(' ') : '';
const report = {
event: 'debug',
arg1: JSON.stringify(projects)
params: { args }
};
monaca.reportAnalytics(report);

Expand Down
10 changes: 10 additions & 0 deletions src/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ module.exports = {
opts.overwrite = !!argv.force || (options && options.force) || false;
opts.createPackageJson = !!argv.createPackageJson || (options && options.createPackageJson) || false;

const report = {
event: taskName
};

monaca.reportAnalytics(report);

process.on('SIGINT', err => util.fail(`Project ${taskName} failed. ${err}`) );

// Checking if the path is under a Monaca Project.
Expand Down Expand Up @@ -47,6 +53,10 @@ module.exports = {
}
)
.then(answer => { if (answer) { opts.overwrite = answer.value; return monaca.upgrade(projectDir, opts); } })
.then(
monaca.reportFinish.bind(monaca, report),
monaca.reportFail.bind(monaca, report)
)
.then(() => {
util.success(`${taskName} process finished.`);
util.print(`For more details about the changes, please refer to ${CLI_UPDATE_DOC_URL.url}`);
Expand Down

0 comments on commit d17a1be

Please sign in to comment.