diff --git a/packages/info/CHANGELOG.md b/packages/info/CHANGELOG.md deleted file mode 100644 index e02c7b40c27..00000000000 --- a/packages/info/CHANGELOG.md +++ /dev/null @@ -1,127 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [3.0.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@3.0.0...@webpack-cli/info@3.0.1) (2024-12-20) - -### Bug Fixes - -- update peer dependencies ([#4356](https://github.com/webpack/webpack-cli/issues/4356)) ([7a7e5d9](https://github.com/webpack/webpack-cli/commit/7a7e5d9f4bd796c7d1089db228b9581e97cc897e)) - -# [3.0.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@2.0.2...@webpack-cli/info@3.0.0) (2024-12-19) - -**Note:** Version bump only for package @webpack-cli/info - -## [2.0.2](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@2.0.1...@webpack-cli/info@2.0.2) (2023-06-04) - -**Note:** Version bump only for package @webpack-cli/info - -## [2.0.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@2.0.0...@webpack-cli/info@2.0.1) (2022-12-05) - -**Note:** Version bump only for package @webpack-cli/info - -# [2.0.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.5.0...@webpack-cli/info@2.0.0) (2022-11-17) - -### Features - -- **info:** show information for webpack-cli packages by default ([#3362](https://github.com/webpack/webpack-cli/issues/3362)) ([a1161a8](https://github.com/webpack/webpack-cli/commit/a1161a83d1c8be942ebd2fc93c20e463db38f632)) - -### BREAKING CHANGES - -- the minimum supported webpack version is v5.0.0 (#3342) ([b1af0dc](https://github.com/webpack/webpack-cli/commit/b1af0dc7ebcdf746bc37889e4c1f978c65acc4a5)), closes [#3342](https://github.com/webpack/webpack-cli/issues/3342) -- webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0 - -# [1.5.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.4.1...@webpack-cli/info@1.5.0) (2022-06-13) - -### Features - -- added types ([8ec1375](https://github.com/webpack/webpack-cli/commit/8ec1375092a6f9676e82fa4231dd88b1016c2302)) - -## [1.4.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.4.0...@webpack-cli/info@1.4.1) (2022-01-24) - -**Note:** Version bump only for package @webpack-cli/info - -# [1.4.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.3.0...@webpack-cli/info@1.4.0) (2021-10-06) - -### Features - -- **info:** added the `--additional-package` option ([06cd267](https://github.com/webpack/webpack-cli/commit/06cd267663955f64b70685c604105d051ffd6beb)) -- allow to run commands without webpack installation where it is unnecessary ([#2907](https://github.com/webpack/webpack-cli/issues/2907)) ([603041d](https://github.com/webpack/webpack-cli/commit/603041d7e6a9b764bd79d1a8effd22a3e0f019cb)) - -# [1.3.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.2.4...@webpack-cli/info@1.3.0) (2021-06-07) - -### Bug Fixes - -- prettier config ([#2719](https://github.com/webpack/webpack-cli/issues/2719)) ([181295f](https://github.com/webpack/webpack-cli/commit/181295fb1b1973c201c221813562219d85b845ae)) - -### Features - -- **info:** add alias for --output ([#2709](https://github.com/webpack/webpack-cli/issues/2709)) ([3453053](https://github.com/webpack/webpack-cli/commit/34530530f99750a5efc382293127753f05fc8064)) - -## [1.2.4](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.2.3...@webpack-cli/info@1.2.4) (2021-05-06) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.2.3](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.2.2...@webpack-cli/info@1.2.3) (2021-03-27) - -### Bug Fixes - -- grammar in description of `--output` ([#2554](https://github.com/webpack/webpack-cli/issues/2554)) ([c6f781d](https://github.com/webpack/webpack-cli/commit/c6f781d741da3b07b25756c053427e5c358ad14f)) - -## [1.2.2](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.2.1...@webpack-cli/info@1.2.2) (2021-02-02) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.2.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.2.0...@webpack-cli/info@1.2.1) (2020-12-31) - -### Bug Fixes - -- the `--help` option is working without `webpack-dev-server` ([#2267](https://github.com/webpack/webpack-cli/issues/2267)) ([1dae54d](https://github.com/webpack/webpack-cli/commit/1dae54da94d3220437b9257efe512447023de1d3)) - -# [1.2.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.1.0...@webpack-cli/info@1.2.0) (2020-12-25) - -### Features - -- display monorepos in info output ([#2203](https://github.com/webpack/webpack-cli/issues/2203)) ([d0acf30](https://github.com/webpack/webpack-cli/commit/d0acf3072edd8182c95e37997ac91789da899d66)) - -# [1.1.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.0.2...@webpack-cli/info@1.1.0) (2020-11-04) - -### Bug Fixes - -- **info:** throw error and exit for invalid --output value ([#2020](https://github.com/webpack/webpack-cli/issues/2020)) ([a994d4b](https://github.com/webpack/webpack-cli/commit/a994d4b52a99b3b77d25aac88f741e036a1c44ec)) - -### Features - -- export utils from core for other packages ([#2011](https://github.com/webpack/webpack-cli/issues/2011)) ([3004549](https://github.com/webpack/webpack-cli/commit/3004549c06b3fe00708d8e1eecf42419e0f72f66)) - -## [1.0.2](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.0.1...@webpack-cli/info@1.0.2) (2020-10-19) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.0.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.0.1-rc.1...@webpack-cli/info@1.0.1) (2020-10-10) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.0.1-rc.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.0.1-alpha.4...@webpack-cli/info@1.0.1-rc.1) (2020-10-06) - -### Bug Fixes - -- **info:** throw an error if help or version is passed as an arg ([#1737](https://github.com/webpack/webpack-cli/issues/1737)) ([c8ca878](https://github.com/webpack/webpack-cli/commit/c8ca87858b81e0c23e161d227558d2f0aeac003a)) -- **packages:** make packages have correct main paths to index ([#1366](https://github.com/webpack/webpack-cli/issues/1366)) ([5dd7bd6](https://github.com/webpack/webpack-cli/commit/5dd7bd62046568481996e48328b15a335557f8ae)) - -## [1.0.1-alpha.4](https://github.com/ematipico/webpack-cli/compare/@webpack-cli/info@1.0.1-alpha.3...@webpack-cli/info@1.0.1-alpha.4) (2020-03-02) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.0.1-alpha.3](https://github.com/ematipico/webpack-cli/compare/@webpack-cli/info@1.0.1-alpha.2...@webpack-cli/info@1.0.1-alpha.3) (2020-02-23) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.0.1-alpha.2](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.0.1-alpha.1...@webpack-cli/info@1.0.1-alpha.2) (2020-02-23) - -**Note:** Version bump only for package @webpack-cli/info - -## [1.0.1-alpha.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/info@1.0.1-alpha.0...@webpack-cli/info@1.0.1-alpha.1) (2020-02-23) - -**Note:** Version bump only for package @webpack-cli/info diff --git a/packages/info/README.md b/packages/info/README.md deleted file mode 100644 index 44a310e7725..00000000000 --- a/packages/info/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# webpack-cli info - -[![NPM Downloads][downloads]][downloads-url] - -> **Note** -> -> This package is used by webpack-cli under-the-hood and is not intended for installation - -## Description - -This package returns a set of information related to the local environment. - -## Installation - -```bash -# npm -npm i -D @webpack-cli/info - -# yarn -yarn add -D @webpack-cli/info - -``` - -## Usage - -```bash -# npx -npx webpack info [options] - -# global installation -webpack info [options] - -``` - -### Args / Flags - -#### Output format - -| Flag | Description | Type | -| ------------------------------------- | --------------------------------------- | ------ | -| `-o, --output < json or markdown >` | To get the output in a specified format | string | -| `-a, --additional-package ` | Adds additional packages to the output | string | - -_Not supported for config_ - -#### Options - -| Flag | Description | Type | -| ----------- | ------------------------------------------ | ------- | -| `--help` | Show help | boolean | -| `--version` | Show version number of `@webpack-cli/info` | boolean | - -[downloads]: https://img.shields.io/npm/dm/@webpack-cli/info.svg -[downloads-url]: https://www.npmjs.com/package/@webpack-cli/info diff --git a/packages/info/package.json b/packages/info/package.json deleted file mode 100644 index 385271f60da..00000000000 --- a/packages/info/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@webpack-cli/info", - "version": "3.0.1", - "description": "Outputs info about system and webpack config", - "homepage": "https://github.com/webpack/webpack-cli/tree/main/packages/info", - "repository": { - "type": "git", - "url": "https://github.com/webpack/webpack-cli.git" - }, - "license": "MIT", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "files": [ - "lib" - ], - "peerDependencies": { - "webpack": "^5.82.0", - "webpack-cli": "6.x.x" - }, - "engines": { - "node": ">=18.12.0" - }, - "publishConfig": { - "access": "public" - }, - "gitHead": "fb50f766851f500ca12867a2aa9de81fa6e368f9" -} diff --git a/packages/info/src/index.ts b/packages/info/src/index.ts deleted file mode 100644 index fac1eb2a6db..00000000000 --- a/packages/info/src/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { type IWebpackCLI } from "webpack-cli"; - -class InfoCommand { - async apply(cli: IWebpackCLI): Promise { - await cli.makeCommand( - { - rawName: "info", - name: "info", - alias: "i", - description: "Outputs information about your system.", - usage: "[options]", - pkg: "@webpack-cli/info", - }, - cli.getInfoOptions(), - async (options: { output: string; additionalPackage: string[] }) => { - const info = await cli.getInfoOutput(options); - - cli.logger.raw(info); - }, - ); - } -} - -export default InfoCommand; diff --git a/packages/info/tsconfig.json b/packages/info/tsconfig.json deleted file mode 100644 index 1c6d02ef88c..00000000000 --- a/packages/info/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src" - }, - "include": ["./src"], - "references": [ - { - "path": "../webpack-cli" - } - ] -} diff --git a/packages/webpack-cli/src/webpack-cli.ts b/packages/webpack-cli/src/webpack-cli.ts index c8638c8a175..288dc7e4927 100644 --- a/packages/webpack-cli/src/webpack-cli.ts +++ b/packages/webpack-cli/src/webpack-cli.ts @@ -1153,6 +1153,13 @@ class WebpackCLI implements IWebpackCLI { description: "Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.", }, + info: { + rawName: "info", + name: "info", + alias: "i", + usage: "[options]", + description: "Outputs information about your system.", + }, help: { rawName: "help", name: "help [command] [option]", @@ -1166,13 +1173,6 @@ class WebpackCLI implements IWebpackCLI { alias: ["server", "s"], pkg: "@webpack-cli/serve", }, - info: { - rawName: "info", - external: true, - name: "info", - alias: "i", - pkg: "@webpack-cli/info", - }, configtest: { rawName: "configtest", name: "configtest [config-path]", @@ -1240,6 +1240,16 @@ class WebpackCLI implements IWebpackCLI { async (options: { output: string; additionalPackage: string[] }) => { const info = await this.getInfoOutput(options); + this.logger.raw(info); + }, + ); + } else if (this.#isCommand(commandName, WebpackCLI.#commands.info)) { + this.makeCommand( + WebpackCLI.#commands.info, + this.getInfoOptions(), + async (options: { output: string; additionalPackage: string[] }) => { + const info = await this.getInfoOutput(options); + this.logger.raw(info); }, ); diff --git a/smoketests/index.js b/smoketests/index.js index fc990c6fba3..f178f87ad24 100644 --- a/smoketests/index.js +++ b/smoketests/index.js @@ -3,7 +3,6 @@ const tests = [ require("./missing-packages/webpack.test"), require("./missing-packages/webpack-bundle-analyzer.test"), require("./missing-command-packages/serve.test"), - require("./missing-command-packages/info.test"), ]; // eslint-disable-next-line unicorn/prefer-top-level-await diff --git a/smoketests/missing-command-packages/info.test.js b/smoketests/missing-command-packages/info.test.js deleted file mode 100644 index 968122504a6..00000000000 --- a/smoketests/missing-command-packages/info.test.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -const { runTest, runTestWithHelp } = require("../helpers"); - -const packageName = "info"; -const isSubPackage = true; - -const infoTest = () => { - const args = ["info"]; - const logMessage = "For using this command you need to install: '@webpack-cli/info' package"; - - return runTest(packageName, args, logMessage, isSubPackage); -}; - -const infoTestWithHelp = () => { - const args = ["help", "info"]; - const logMessage = "For using 'info' command you need to install '@webpack-cli/info' package"; - - return runTestWithHelp(packageName, args, logMessage, isSubPackage); -}; - -module.exports.name = "Missing @webpack-cli/info"; -module.exports.run = [infoTest, infoTestWithHelp]; diff --git a/tsconfig.json b/tsconfig.json index d97dc7dfde7..b385f7cf35e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,9 +21,6 @@ "declaration": true }, "references": [ - { - "path": "packages/info" - }, { "path": "packages/serve" },