fix(core): update
This commit is contained in:
37
ts/mod_deprecate/index.ts
Normal file
37
ts/mod_deprecate/index.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import * as plugins from './mod.plugins.js';
|
||||
|
||||
import { logger } from '../gitzone.logging.js';
|
||||
|
||||
export const run = async () => {
|
||||
const smartInteract = new plugins.smartinteract.SmartInteract([
|
||||
{
|
||||
name: `oldPackageName`,
|
||||
message: `Whats the name of the OLD package?`,
|
||||
type: `input`,
|
||||
default: ``,
|
||||
validate: (stringInput) => {
|
||||
return stringInput !== '' && !process.env.CI;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: `newPackageName`,
|
||||
message: `Whats the name of the NEW package?`,
|
||||
type: `input`,
|
||||
default: ``,
|
||||
validate: (stringInput) => {
|
||||
return stringInput !== '' && !process.env.CI;
|
||||
},
|
||||
},
|
||||
]);
|
||||
const answerBucket = await smartInteract.runQueue();
|
||||
const oldPackageName = answerBucket.getAnswerFor(`oldPackageName`);
|
||||
const newPackageName = answerBucket.getAnswerFor(`newPackageName`);
|
||||
logger.log('info', `Deprecating package ${oldPackageName} in favour of ${newPackageName}`);
|
||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||
executor: 'bash',
|
||||
});
|
||||
await smartshellInstance.exec(
|
||||
`npm deprecate ${oldPackageName}@* ` +
|
||||
`"${oldPackageName} has been deprecated in favour of ${newPackageName} - please upgrade asap!!!"`
|
||||
);
|
||||
};
|
6
ts/mod_deprecate/mod.plugins.ts
Normal file
6
ts/mod_deprecate/mod.plugins.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export * from '../plugins.js';
|
||||
|
||||
import * as smartinteract from '@push.rocks/smartinteract';
|
||||
import * as smartshell from '@push.rocks/smartshell';
|
||||
|
||||
export { smartinteract, smartshell };
|
Reference in New Issue
Block a user