Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add messaging to use new package #420

Merged
merged 2 commits into from
Jan 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/cms-cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

const yargs = require('yargs');
const updateNotifier = require('update-notifier');
const chalk = require('chalk');

const { logger } = require('@hubspot/cms-lib/logger');
const { logErrorInstance } = require('@hubspot/cms-lib/errorHandlers');
const { setLogLevel, getCommandName } = require('../lib/commonOpts');
const { trackHelpUsage } = require('../lib/usageTracking');
const pkg = require('../package.json');
const { version } = require('../package.json');

const removeCommand = require('../commands/remove');
const initCommand = require('../commands/init');
Expand All @@ -27,10 +28,16 @@ const listCommand = require('../commands/list');
const openCommand = require('../commands/open');
const mvCommand = require('../commands/mv');

// Point update-notifier towards @hubspot/cli
const pkg = { name: '@hubspot/cli', version };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I'm not clear on is if cms-cli version will continue to increment with cli? If so, we'll probably want to hard code this to a lower version number

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan is to continue using the same version scheme so that the tags / versions in the repo continue to be meaningful. We'll start with 3.0 for the @hubspot/cli release so that there is adequate space in the versioning scheme for @hubspot/cms-cli should a patch be needed.


const notifier = updateNotifier({ pkg });

notifier.notify({
shouldNotifyInNpmScript: true,
message:
chalk.bold('The CMS CLI is now the HubSpot CLI') +
'\n\nTo upgrade, run:\n\nnpm uninstall -g @hubspot/cms-cli\nand npm install -g @hubspot/cli',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we adjust the logic such that we're detecting that this code is part of @hubspot/cms-cli so that we can merge the changes back into master so that the process of merging changes from cms-cli branch back into master is straightforward?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, updated

});

const argv = yargs
Expand Down