Skip to content

Commit

Permalink
feat: Remove @serverless/components CLI integration
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Serverless Components (`@serverless/components`) CLI is no longer integrated with Framework CLI.
  • Loading branch information
medikoo committed Jan 27, 2022
1 parent 10db944 commit 3395395
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/prepare-canary.js
Expand Up @@ -10,7 +10,6 @@ const packageJsonPath = path.resolve(__dirname, '../package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));

packageJson.version = `${packageJson.version}-${process.env.GITHUB_SHA.slice(0, 8)}`;
packageJson.dependencies['@serverless/components'] = 'canary';
packageJson.dependencies['@serverless/dashboard-plugin'] = 'canary';

fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`);
15 changes: 14 additions & 1 deletion bin/serverless.js
Expand Up @@ -44,7 +44,20 @@ require('../lib/cli/triage')().then((cliName) => {
});
return;
case '@serverless/components':
require('@serverless/components').runComponents();
{
const chalk = require('chalk');
process.stdout.write(
`${[
'Serverless Components CLI is no longer bundled with Serverless Framework CLI',
'',
"To run it, ensure it's installed:",
chalk.bold('npm install -g @serverless/components'),
'',
'Then run:',
chalk.bold('components <command> <options>'),
].join('\n')}\n`
);
}
return;
case '@serverless/cli':
require('@serverless/cli').runComponents();
Expand Down
9 changes: 0 additions & 9 deletions lib/cli/handle-error.js
Expand Up @@ -139,13 +139,6 @@ module.exports = async (exception, options = {}) => {
if (isLocallyInstalled != null) return isLocallyInstalled ? ' (local)' : '';
return resolveIsLocallyInstalled() ? ' (local)' : '';
})();
const componentsVersion = (() => {
try {
return require('@serverless/components/package').version;
} catch (error) {
return 'Unavailable';
}
})();

const detailsTextTokens = [
`Environment: ${platform}, node ${nodeVersion}, framework ${slsVersion}${installationModePostfix}, plugin ${sfeVersion}, SDK ${platformClientVersion}`,
Expand Down Expand Up @@ -207,8 +200,6 @@ module.exports = async (exception, options = {}) => {
);
legacy.consoleLog(chalk.yellow(` Plugin Version: ${sfeVersion}`));
legacy.consoleLog(chalk.yellow(` SDK Version: ${platformClientVersion}`));

legacy.consoleLog(chalk.yellow(` Components Version: ${componentsVersion}`));
legacy.consoleLog(' ');

await logDeprecation.printSummary();
Expand Down
9 changes: 2 additions & 7 deletions lib/cli/render-version.js
Expand Up @@ -5,7 +5,6 @@ const os = require('os');
const { version } = require('../../package');
const spawn = require('child-process-ext/spawn');
const { version: dashboardPluginVersion } = require('@serverless/dashboard-plugin/package');
const { version: componentsVersion } = require('@serverless/components/package');
const { platformClientVersion } = require('@serverless/dashboard-plugin');
const { legacy, log, writeText } = require('@serverless/utils/log');
const isStandaloneExecutable = require('../utils/isStandaloneExecutable');
Expand Down Expand Up @@ -82,15 +81,11 @@ module.exports = async () => {
`Framework Core: ${version}${installationModePostfix}\n` +
`Plugin: ${dashboardPluginVersion}\n` +
`SDK: ${platformClientVersion}\n`
}${
tencentCliVersion ? `Tencent CLI: ${tencentCliVersion}\n` : ''
}Components: ${componentsVersion}\n`
}${tencentCliVersion ? `Tencent CLI: ${tencentCliVersion}\n` : ''}`
);
writeText(
`Framework Core: ${version}${installationModePostfix}`,
`Plugin: ${dashboardPluginVersion}`,
`SDK: ${platformClientVersion}\n${
tencentCliVersion ? `Tencent CLI: ${tencentCliVersion}\n` : ''
}Components: ${componentsVersion}`
`SDK: ${platformClientVersion}\n${tencentCliVersion ? `Tencent CLI: ${tencentCliVersion}` : ''}`
);
};
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -23,7 +23,6 @@
},
"dependencies": {
"@serverless/cli": "^1.6.0",
"@serverless/components": "^3.18.2",
"@serverless/dashboard-plugin": "^6.0.0",
"@serverless/platform-client": "^4.3.0",
"@serverless/utils": "^6.0.0",
Expand Down

0 comments on commit 3395395

Please sign in to comment.