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

fix: remove unnecessary optional peer dependencies #1945

Merged
merged 1 commit into from Oct 14, 2020

Conversation

ylemkimon
Copy link
Contributor

What kind of change does this PR introduce?
Bugfix (this doesn't fix any bugs, but in terms of semver I think it should be a fix)

Did you add tests for your changes?
N/A

If relevant, did you update the documentation?
N/A

Summary
In #1816, default commands packages were added to peer dependencies of @webpack-cli/package-utils, as they were required by packageExists in order to fix #1815.

However, in #1822, packageExists was moved directly into webpack-cli not @webpack-cli/utils, so @webpack-cli/utils doesn't require them.

Does this PR introduce a breaking change?
No

Other information
Note #1815 has been fixed by #1822.

@alexander-akait
Copy link
Member

No, they are needed

@ylemkimon
Copy link
Contributor Author

@evilebottnawi This is every require/import calls in @webpack-cli/utils and they don't seem to require @webpack-cli/info, @webpack-cli/init, or @webpack-cli/serve:

import { JSCodeshift, Node, valueType } from './types/NodePath';
import { isIdentifierStart, isIdentifierChar, isKeyword } from './validate-identifier';
import path from 'path';
import spawn from 'cross-spawn';
import path from 'path';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
return require('global-modules');
export * from './ast-utils';
export * from './copy-utils';
export * from './modify-config-helper';
export * from './npm-exists';
export * from './npm-packages-exists';
export * from './recursive-parser';
export * from './resolve-packages';
export * from './run-prettier';
export * from './scaffold';
export * from './validate-identifier';
export * from './prop-types';
export * from './global-packages-path';
import { version } from 'webpack';
import { green } from 'colorette';
import fs from 'fs';
import logger from 'webpack-cli/lib/utils/logger';
import path from 'path';
import yeoman from 'yeoman-environment';
import Generator from 'yeoman-generator';
import { runTransform } from './scaffold';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
return this.composeWith(require.resolve(pkgPath), {});
const packageData = require(packagePath);
configModule = require(confPath);
import got from 'got';
import { resolve } from 'path';
import { existsSync } from 'fs';
import { red, bold } from 'colorette';
import { npmExists } from './npm-exists';
import { isLocalPath } from './path-utils';
import { resolvePackages } from './resolve-packages';
import { getPathToGlobalPackages } from './global-packages-path';
import findup from 'findup-sync';
import fs from 'fs';
import path from 'path';
import { isWebpack5 } from './isWebpack5';
import { config } from 'webpack';
import { parseTopScope, findRootNodesByName, addProperty, removeProperty, parseMerge, safeTraverse } from './ast-utils';
import { JSCodeshift, Node, valueType } from './types/NodePath';
import logger from 'webpack-cli/lib/utils/logger';
import { bold } from 'colorette';
import logger from 'webpack-cli/lib/utils/logger';
import path from 'path';
import { modifyHelperUtil } from './modify-config-helper';
import { getPathToGlobalPackages } from './global-packages-path';
import { spawnChild } from './spawn-child';
import { isLocalPath } from './path-utils';
import { ExecaSyncReturnValue } from 'execa';
require.resolve(absolutePath);
import fs from 'fs';
import logger from 'webpack-cli/lib/utils/logger';
prettier = require('prettier');
import { green } from 'colorette';
import j from 'jscodeshift';
import logger from 'webpack-cli/lib/utils/logger';
import pEachSeries = require('p-each-series');
import path from 'path';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
import { findProjectRoot } from './path-utils';
import { Error } from './types';
import { Config, TransformConfig } from './types';
import { PROP_TYPES } from './prop-types';
import { recursiveTransform } from './recursive-parser';
import { runPrettier } from './run-prettier';
import { Node } from './types/NodePath';
import path from 'path';
import fs from 'fs';
import { ExecaSyncReturnValue, sync } from 'execa';
import { getPathToGlobalPackages } from './global-packages-path';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';

@alexander-akait
Copy link
Member

alexander-akait commented Oct 14, 2020

They are in require when you use external comamnds, without it yarn pnp doesn't work, do not touch this

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

oh, my mistake, yes, no need to have it, I think it is webpack-cli package

Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

Thanks!

@snitin315 snitin315 merged commit 80b692d into webpack:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

package-utils cannot resolve external commands
4 participants