@dr.pogodin/react-utils 1.41.0 → 1.41.1

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.
Files changed (2) hide show
  1. package/bin/setup.js +11 -1
  2. package/package.json +1 -1
package/bin/setup.js CHANGED
@@ -42,6 +42,11 @@ program
42
42
  libs = libraries.length ? libraries : ['@dr.pogodin/react-utils'];
43
43
  })
44
44
  .description(COMMAND_DESCRIPTION)
45
+ .option(
46
+ '--force',
47
+ 'Uses "--force" option for underlying npm install & dedupe operations',
48
+ false,
49
+ )
45
50
  .option(
46
51
  '--just-fix-deps',
47
52
  'Skips library installation, just fixes dependencies.',
@@ -52,7 +57,7 @@ program
52
57
 
53
58
  const cmdLineArgs = program.opts();
54
59
 
55
- const { verbose } = cmdLineArgs;
60
+ const { force, verbose } = cmdLineArgs;
56
61
 
57
62
  /**
58
63
  * Generates a string containing name and version of the package to be
@@ -100,6 +105,7 @@ function adoptDevDependencies(donorData, hostData) {
100
105
  deps = Object.entries(deps).map(generateTargetPackage);
101
106
  if (deps.length) {
102
107
  const args = ['install', '--save-dev'].concat(deps);
108
+ if (force) args.push('--force');
103
109
  if (verbose) args.push('--verbose');
104
110
  spawnSync(NPM_COMMAND, args, {
105
111
  stdio: 'inherit',
@@ -150,6 +156,7 @@ function install(library) {
150
156
  if (!name.includes('@', 1)) name += '@latest';
151
157
  const args = ['install', '--save', name];
152
158
 
159
+ if (force) args.push('--force');
153
160
  if (verbose) {
154
161
  console.log(`Installing "${library}"...`);
155
162
  args.push('--verbose');
@@ -179,6 +186,7 @@ function updateProdDependencies(donorData, hostData) {
179
186
  if (deps.length) {
180
187
  deps = deps.map(generateTargetPackage);
181
188
  const args = ['install', '--save'].concat(deps);
189
+ if (force) args.push('--force');
182
190
  if (verbose) args.push('--verbose');
183
191
  spawnSync(NPM_COMMAND, args, { stdio: 'inherit' });
184
192
  }
@@ -196,6 +204,7 @@ libs.forEach((library) => {
196
204
 
197
205
  {
198
206
  const arg = ['install'];
207
+ if (force) arg.push('--force');
199
208
  if (verbose) arg.push('--verbose');
200
209
  spawnSync(NPM_COMMAND, arg, { stdio: 'inherit' });
201
210
  }
@@ -208,6 +217,7 @@ libs.forEach((library) => {
208
217
 
209
218
  {
210
219
  const arg = ['dedupe'];
220
+ if (force) arg.push('--force');
211
221
  if (verbose) arg.push('--verbose');
212
222
  spawnSync(NPM_COMMAND, arg, { stdio: 'inherit' });
213
223
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.41.0",
2
+ "version": "1.41.1",
3
3
  "bin": {
4
4
  "react-utils-build": "bin/build.js",
5
5
  "react-utils-setup": "bin/setup.js"