@oneblink/release-cli 3.3.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +8 -0
- package/dist/startUpdateDependents.js +24 -16
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -64,10 +64,13 @@ ${chalk.grey('Update all product code bases that depend on an NPM package.')}
|
|
|
64
64
|
to the current working directory, defaults to the current
|
|
65
65
|
working directory.
|
|
66
66
|
|
|
67
|
+
--force ........ Update all dependencies without prompting the user.
|
|
68
|
+
|
|
67
69
|
${chalk.bold('Examples')}
|
|
68
70
|
|
|
69
71
|
oneblink-release update-dependents
|
|
70
72
|
oneblink-release update-dependents --cwd ../path/to/code
|
|
73
|
+
oneblink-release update-dependents --force
|
|
71
74
|
`, {
|
|
72
75
|
importMeta: import.meta,
|
|
73
76
|
flags: {
|
|
@@ -96,6 +99,10 @@ ${chalk.bold('Examples')}
|
|
|
96
99
|
type: 'string',
|
|
97
100
|
default: process.cwd(),
|
|
98
101
|
},
|
|
102
|
+
force: {
|
|
103
|
+
type: 'boolean',
|
|
104
|
+
default: false,
|
|
105
|
+
},
|
|
99
106
|
},
|
|
100
107
|
});
|
|
101
108
|
async function getReleaseName({ name, preRelease, }) {
|
|
@@ -125,6 +132,7 @@ async function run() {
|
|
|
125
132
|
case 'update-dependents': {
|
|
126
133
|
await startUpdateDependents({
|
|
127
134
|
cwd,
|
|
135
|
+
force: cli.flags.force,
|
|
128
136
|
});
|
|
129
137
|
break;
|
|
130
138
|
}
|
|
@@ -4,7 +4,7 @@ import getRepositoryPlugin from './repositories-plugins/plugins-factory.js';
|
|
|
4
4
|
import enquirer from 'enquirer';
|
|
5
5
|
import executeCommand from './executeCommand.js';
|
|
6
6
|
import boxen from 'boxen';
|
|
7
|
-
export default async function startUpdateDependents({ cwd }) {
|
|
7
|
+
export default async function startUpdateDependents({ cwd, force = false, }) {
|
|
8
8
|
const dependencyRepositoryPlugin = await getRepositoryPlugin({
|
|
9
9
|
cwd,
|
|
10
10
|
});
|
|
@@ -70,21 +70,29 @@ export default async function startUpdateDependents({ cwd }) {
|
|
|
70
70
|
console.log(`Skipping "${productRepository.repositoryName}" as it's version of "${dependency}" is already "${currentDependencyVersion}".`);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
let isUpdating;
|
|
74
|
+
if (force) {
|
|
75
|
+
isUpdating = 'yes';
|
|
76
|
+
console.log(`Auto-updating "${dependency}" in "${productRepository.repositoryName}" (${currentDependencyVersion} > ${dependencyResult.packageJson.version})`);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const updateResult = await enquirer.prompt({
|
|
80
|
+
type: 'select',
|
|
81
|
+
name: 'isUpdating',
|
|
82
|
+
message: `Would you like to update "${dependency}" in "${productRepository.repositoryName}" (${currentDependencyVersion} > ${dependencyResult.packageJson.version})?`,
|
|
83
|
+
choices: [
|
|
84
|
+
{
|
|
85
|
+
message: 'Yes, update dependency!',
|
|
86
|
+
name: 'yes',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
message: `No! "${productRepository.repositoryName}" does not need to be updated.`,
|
|
90
|
+
name: 'no',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
});
|
|
94
|
+
isUpdating = updateResult.isUpdating;
|
|
95
|
+
}
|
|
88
96
|
if (isUpdating === 'no') {
|
|
89
97
|
return;
|
|
90
98
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneblink/release-cli",
|
|
3
3
|
"description": "Used internally by OneBlink to release repositories quickly and consistently",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"author": "OneBlink <developers@oneblink> (https://github.com/oneblink)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"oneblink-release": "dist/bin.js"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"prepare": "npm run build",
|
|
80
80
|
"prerelease": "npm run build",
|
|
81
81
|
"pretest": "npm run eslint",
|
|
82
|
-
"release": "
|
|
82
|
+
"release": "node dist/bin.js repository --no-name --cwd .",
|
|
83
83
|
"test": "npm run jest",
|
|
84
84
|
"typescript": "tsc --noEmit"
|
|
85
85
|
},
|