diff --git a/.eslintrc.js b/.eslintrc.js index 6d5203bcfb2..fa66f1777f4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,7 @@ module.exports = { plugins: ['node'], settings: { node: { - allowModules: ['@webpack-cli/generators', '@webpack-cli/utils'], + allowModules: ['@webpack-cli/generators'], }, }, env: { diff --git a/packages/generators/__tests__/utils/languageSupport.test.ts b/packages/generators/__tests__/utils/languageSupport.test.ts index a70a7c5b611..ffb518f808e 100644 --- a/packages/generators/__tests__/utils/languageSupport.test.ts +++ b/packages/generators/__tests__/utils/languageSupport.test.ts @@ -1,5 +1,5 @@ -import language, { LangType, getBabelLoader, getTypescriptLoader } from '../../lib/utils/languageSupport'; -import { CustomGenerator } from '../../lib/types'; +import language, { LangType, getBabelLoader, getTypescriptLoader } from '../../src/utils/languageSupport'; +import { CustomGenerator } from '../../src/types'; describe('languageSupport', () => { const getMockGenerator = (): CustomGenerator => { diff --git a/packages/generators/__tests__/utils/plugins.test.ts b/packages/generators/__tests__/utils/plugins.test.ts index 35c7fe8ecc2..bfe3311f9c1 100644 --- a/packages/generators/__tests__/utils/plugins.test.ts +++ b/packages/generators/__tests__/utils/plugins.test.ts @@ -1,4 +1,4 @@ -import { replaceAt, generatePluginName } from '../../lib/utils/plugins'; +import { replaceAt, generatePluginName } from '../../src/utils/plugins'; describe('generate plugin name', () => { it('should return webpack Standard Plugin Name for Name : extract-text-webpack-plugin', () => { diff --git a/packages/generators/__tests__/utils/styleSupport.test.ts b/packages/generators/__tests__/utils/styleSupport.test.ts index 1bf0009b6d9..8ecf3815961 100644 --- a/packages/generators/__tests__/utils/styleSupport.test.ts +++ b/packages/generators/__tests__/utils/styleSupport.test.ts @@ -1,5 +1,5 @@ -import style, { StylingType } from '../../lib/utils/styleSupport'; -import { CustomGenerator } from '../../lib/types'; +import style, { StylingType } from '../../src/utils/styleSupport'; +import { CustomGenerator } from '../../src/types'; describe('styleSupport', () => { const getMockGenerator = (): CustomGenerator => { diff --git a/packages/generators/package.json b/packages/generators/package.json index 73f23e85c62..c4c069a8204 100644 --- a/packages/generators/package.json +++ b/packages/generators/package.json @@ -17,11 +17,16 @@ "plugin-template" ], "dependencies": { - "@webpack-cli/utils": "^1.2.1", "colorette": "^1.2.1", "log-symbols": "^4.0.0", "yeoman-environment": "^2.10.3", - "yeoman-generator": "^4.12.0" + "yeoman-generator": "^4.12.0", + "execa": "^4.1.0", + "findup-sync": "^4.0.0", + "global-modules": "^2.0.0", + "got": "^11.8.0", + "jscodeshift": "^0.11.0", + "p-each-series": "^2.1.0" }, "peerDependencies": { "webpack": "4.x.x || 5.x.x", @@ -33,7 +38,14 @@ "@types/yeoman-test": "^2.0.5", "rimraf": "^3.0.2", "yeoman-assert": "^3.1.1", - "yeoman-test": "^2.3.0" + "yeoman-test": "^2.3.0", + "@types/got": "^9.6.11", + "@types/prettier": "^2.1.5" + }, + "peerDependenciesMeta": { + "prettier": { + "optional": true + } }, "gitHead": "fb50f766851f500ca12867a2aa9de81fa6e368f9" } diff --git a/packages/generators/src/addon-generator.ts b/packages/generators/src/addon-generator.ts index bcd1be0f5cb..32598c06398 100644 --- a/packages/generators/src/addon-generator.ts +++ b/packages/generators/src/addon-generator.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import path from 'path'; import Generator from 'yeoman-generator'; -import { generatorCopy, generatorCopyTpl } from '@webpack-cli/utils'; +import { generatorCopy, generatorCopyTpl } from '.'; import { utils } from 'webpack-cli'; diff --git a/packages/generators/src/index.ts b/packages/generators/src/index.ts index d4f0a93d18a..bea8e6577ba 100644 --- a/packages/generators/src/index.ts +++ b/packages/generators/src/index.ts @@ -54,3 +54,16 @@ class GeneratorsCommand { export default GeneratorsCommand; export { addonGenerator, initGenerator }; + +export * from './utils/ast-utils'; +export * from './utils/copy-utils'; +export * from './utils/modify-config-helper'; +export * from './utils/npm-exists'; +export * from './utils/npm-packages-exists'; +export * from './utils/recursive-parser'; +export * from './utils/resolve-packages'; +export * from './utils/run-prettier'; +export * from './utils/scaffold'; +export * from './utils/validate-identifier'; +export * from './utils/prop-types'; +export * from './utils/global-packages-path'; diff --git a/packages/utils/__tests__/__snapshots__/ast-utils.test.ts.snap b/packages/generators/src/utils/__tests__/__snapshots__/ast-utils.test.ts.snap similarity index 100% rename from packages/utils/__tests__/__snapshots__/ast-utils.test.ts.snap rename to packages/generators/src/utils/__tests__/__snapshots__/ast-utils.test.ts.snap diff --git a/packages/utils/__tests__/ast-utils.test.ts b/packages/generators/src/utils/__tests__/ast-utils.test.ts similarity index 99% rename from packages/utils/__tests__/ast-utils.test.ts rename to packages/generators/src/utils/__tests__/ast-utils.test.ts index fa06295e3cc..a27f546fc9a 100644 --- a/packages/utils/__tests__/ast-utils.test.ts +++ b/packages/generators/src/utils/__tests__/ast-utils.test.ts @@ -15,8 +15,8 @@ import { getRequire, safeTraverse, safeTraverseAndGetType, -} from '../src/ast-utils'; -import { Node } from '../src/types/NodePath'; +} from '../ast-utils'; +import { Node } from '../types/NodePath'; describe('utils', () => { describe('createProperty', () => { diff --git a/packages/utils/__tests__/find-project-root/package.json b/packages/generators/src/utils/__tests__/find-project-root/package.json similarity index 100% rename from packages/utils/__tests__/find-project-root/package.json rename to packages/generators/src/utils/__tests__/find-project-root/package.json diff --git a/packages/utils/__tests__/find-project-root/project/find-project-root.test.ts b/packages/generators/src/utils/__tests__/find-project-root/project/find-project-root.test.ts similarity index 94% rename from packages/utils/__tests__/find-project-root/project/find-project-root.test.ts rename to packages/generators/src/utils/__tests__/find-project-root/project/find-project-root.test.ts index 83100a33386..6319a0d40ac 100644 --- a/packages/utils/__tests__/find-project-root/project/find-project-root.test.ts +++ b/packages/generators/src/utils/__tests__/find-project-root/project/find-project-root.test.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line node/no-unpublished-import -import { findProjectRoot } from '../../../src/path-utils'; +import { findProjectRoot } from '../../../path-utils'; import { join } from 'path'; beforeAll(() => { diff --git a/packages/utils/__tests__/global-packages-path.test.ts b/packages/generators/src/utils/__tests__/global-packages-path.test.ts similarity index 93% rename from packages/utils/__tests__/global-packages-path.test.ts rename to packages/generators/src/utils/__tests__/global-packages-path.test.ts index e70441e974e..3fbcd785fd8 100644 --- a/packages/utils/__tests__/global-packages-path.test.ts +++ b/packages/generators/src/utils/__tests__/global-packages-path.test.ts @@ -1,7 +1,7 @@ 'use strict'; jest.setMock('webpack-cli/lib/utils/get-package-manager', jest.fn()); -import { getPathToGlobalPackages } from '../lib/global-packages-path'; +import { getPathToGlobalPackages } from '../global-packages-path'; import { utils } from 'webpack-cli'; const { getPackageManager } = utils; diff --git a/packages/utils/__tests__/is-local-path.test.ts b/packages/generators/src/utils/__tests__/is-local-path.test.ts similarity index 93% rename from packages/utils/__tests__/is-local-path.test.ts rename to packages/generators/src/utils/__tests__/is-local-path.test.ts index 4a8150f9467..2790aae28e3 100644 --- a/packages/utils/__tests__/is-local-path.test.ts +++ b/packages/generators/src/utils/__tests__/is-local-path.test.ts @@ -1,7 +1,7 @@ 'use strict'; import path from 'path'; -import { isLocalPath } from '../src/path-utils'; +import { isLocalPath } from '../path-utils'; describe('is-local-path', () => { it('returns true for paths beginning in the current directory', () => { diff --git a/packages/utils/__tests__/npm-exists.test.ts b/packages/generators/src/utils/__tests__/npm-exists.test.ts similarity index 90% rename from packages/utils/__tests__/npm-exists.test.ts rename to packages/generators/src/utils/__tests__/npm-exists.test.ts index 88297b3dbee..5e79cf24351 100644 --- a/packages/utils/__tests__/npm-exists.test.ts +++ b/packages/generators/src/utils/__tests__/npm-exists.test.ts @@ -1,5 +1,5 @@ 'use strict'; -import { npmExists } from '../src/npm-exists'; +import { npmExists } from '../npm-exists'; describe('npm-exists', () => { it('should successfully existence of a published module', () => { diff --git a/packages/utils/__tests__/npm-packages-exists.test.ts b/packages/generators/src/utils/__tests__/npm-packages-exists.test.ts similarity index 76% rename from packages/utils/__tests__/npm-packages-exists.test.ts rename to packages/generators/src/utils/__tests__/npm-packages-exists.test.ts index 0e7762f9720..831e3955c2a 100644 --- a/packages/utils/__tests__/npm-packages-exists.test.ts +++ b/packages/generators/src/utils/__tests__/npm-packages-exists.test.ts @@ -1,8 +1,8 @@ -import { npmPackagesExists } from '../src/npm-packages-exists'; -import { resolvePackages } from '../src/resolve-packages'; +import { npmPackagesExists } from '../npm-packages-exists'; +import { resolvePackages } from '../resolve-packages'; -jest.mock('../src/npm-exists'); -jest.mock('../src/resolve-packages'); +jest.mock('../npm-exists'); +jest.mock('../resolve-packages'); // TS is not aware that jest changes the type of resolvePackages const mockResolvePackages = resolvePackages as jest.Mock; diff --git a/packages/utils/__tests__/recursive-parser/__snapshots__/recursive-parser.test.ts.snap b/packages/generators/src/utils/__tests__/recursive-parser/__snapshots__/recursive-parser.test.ts.snap similarity index 98% rename from packages/utils/__tests__/recursive-parser/__snapshots__/recursive-parser.test.ts.snap rename to packages/generators/src/utils/__tests__/recursive-parser/__snapshots__/recursive-parser.test.ts.snap index 3aa5786cc6e..592b7f56e58 100644 --- a/packages/utils/__tests__/recursive-parser/__snapshots__/recursive-parser.test.ts.snap +++ b/packages/generators/src/utils/__tests__/recursive-parser/__snapshots__/recursive-parser.test.ts.snap @@ -105,7 +105,7 @@ exports[`recursive parser remove transforms correctly using "fixture-3" data 1`] symlinks: true }, module: { - noParse: function(content) { + noParse: function (content) { return /jquery|lodash/.test(content); }, rules: [ @@ -167,7 +167,7 @@ exports[`recursive parser remove transforms correctly using "fixture-3" data 2`] symlinks: true, }, module: { - noParse: function(content) { + noParse: function (content) { return /jquery|lodash/.test(content); }, rules: [ @@ -287,7 +287,7 @@ exports[`recursive parser remove transforms correctly using "fixture-3" data 4`] symlinks: true, }, module: { - noParse: function(content) { + noParse: function (content) { return /jquery|lodash/.test(content); }, rules: [ @@ -349,7 +349,7 @@ exports[`recursive parser remove transforms correctly using "fixture-3" data 5`] symlinks: true, }, module: { - noParse: function(content) { + noParse: function (content) { return /jquery|lodash/.test(content); }, rules: [{ diff --git a/packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-0.input.js b/packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-0.input.js similarity index 100% rename from packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-0.input.js rename to packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-0.input.js diff --git a/packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-1.input.js b/packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-1.input.js similarity index 100% rename from packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-1.input.js rename to packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-1.input.js diff --git a/packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-2.input.js b/packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-2.input.js similarity index 100% rename from packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-2.input.js rename to packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-2.input.js diff --git a/packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-3.input.js b/packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-3.input.js similarity index 97% rename from packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-3.input.js rename to packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-3.input.js index 2f5a73e568b..3d6046eabdd 100644 --- a/packages/utils/__tests__/recursive-parser/__testfixtures__/fixture-3.input.js +++ b/packages/generators/src/utils/__tests__/recursive-parser/__testfixtures__/fixture-3.input.js @@ -35,7 +35,7 @@ module.exports = { symlinks: true, }, module: { - noParse: function(content) { + noParse: function (content) { return /jquery|lodash/.test(content); }, rules: [ diff --git a/packages/utils/__tests__/recursive-parser/recursive-parser.test.ts b/packages/generators/src/utils/__tests__/recursive-parser/recursive-parser.test.ts similarity index 97% rename from packages/utils/__tests__/recursive-parser/recursive-parser.test.ts rename to packages/generators/src/utils/__tests__/recursive-parser/recursive-parser.test.ts index 364ec6bc84b..2f7148f8768 100644 --- a/packages/utils/__tests__/recursive-parser/recursive-parser.test.ts +++ b/packages/generators/src/utils/__tests__/recursive-parser/recursive-parser.test.ts @@ -1,7 +1,7 @@ 'use strict'; import { join } from 'path'; -import defineTest from '../defineTest'; +import defineTest from '../../defineTest'; describe('recursive parser', () => { { diff --git a/packages/utils/__tests__/resolve-packages.test.ts b/packages/generators/src/utils/__tests__/resolve-packages.test.ts similarity index 100% rename from packages/utils/__tests__/resolve-packages.test.ts rename to packages/generators/src/utils/__tests__/resolve-packages.test.ts diff --git a/packages/utils/__tests__/run-prettier.test.ts b/packages/generators/src/utils/__tests__/run-prettier.test.ts similarity index 96% rename from packages/utils/__tests__/run-prettier.test.ts rename to packages/generators/src/utils/__tests__/run-prettier.test.ts index 8a04fa6ab3a..d07e03a63ee 100644 --- a/packages/utils/__tests__/run-prettier.test.ts +++ b/packages/generators/src/utils/__tests__/run-prettier.test.ts @@ -4,7 +4,7 @@ import fs from 'fs'; import path from 'path'; //eslint-disable-next-line node/no-extraneous-import import rimraf from 'rimraf'; -import { runPrettier } from '../src/run-prettier'; +import { runPrettier } from '../run-prettier'; const outputPath = path.join(__dirname, 'test-assets'); const outputFile = path.join(outputPath, 'test.js'); diff --git a/packages/utils/__tests__/validate-identifier.test.ts b/packages/generators/src/utils/__tests__/validate-identifier.test.ts similarity index 97% rename from packages/utils/__tests__/validate-identifier.test.ts rename to packages/generators/src/utils/__tests__/validate-identifier.test.ts index 4f5f4b6a718..dcebfa6f8a1 100644 --- a/packages/utils/__tests__/validate-identifier.test.ts +++ b/packages/generators/src/utils/__tests__/validate-identifier.test.ts @@ -1,6 +1,6 @@ 'use strict'; -import { isKeyword, isIdentifierChar, isIdentifierStart } from '../src/validate-identifier'; +import { isKeyword, isIdentifierChar, isIdentifierStart } from '../validate-identifier'; describe('validate-identifier', () => { it('should return true for reserved keyword', () => { diff --git a/packages/utils/src/ast-utils.ts b/packages/generators/src/utils/ast-utils.ts similarity index 100% rename from packages/utils/src/ast-utils.ts rename to packages/generators/src/utils/ast-utils.ts diff --git a/packages/utils/src/copy-utils.ts b/packages/generators/src/utils/copy-utils.ts similarity index 100% rename from packages/utils/src/copy-utils.ts rename to packages/generators/src/utils/copy-utils.ts diff --git a/packages/utils/__tests__/defineTest.ts b/packages/generators/src/utils/defineTest.ts similarity index 95% rename from packages/utils/__tests__/defineTest.ts rename to packages/generators/src/utils/defineTest.ts index 6f5a51bac9c..ada2f4f1c33 100644 --- a/packages/utils/__tests__/defineTest.ts +++ b/packages/generators/src/utils/defineTest.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; -import { JSCodeshift, Node } from '../src/types/NodePath'; +import { JSCodeshift, Node } from './types/NodePath'; interface Module { (jscodeshift: JSCodeshift, ast: Node, initOptions: string | boolean | object, action: string, transformName?: string): Node; @@ -58,9 +58,9 @@ function runSingleTransform( let module: Module; // Assumes transform and test are on the same level if (action) { - module = require(path.join(dirName, '../../src', 'recursive-parser.ts')); + module = require(path.join(dirName, '../../', 'recursive-parser.ts')); } else { - module = require(path.join(dirName, '../../src', transformName, `${transformName}.ts`)); + module = require(path.join(dirName, '../../src/', transformName, `${transformName}.ts`)); } // Handle ES6 modules using default export for the transform const transform = module.default ? module.default : module; diff --git a/packages/utils/src/global-packages-path.ts b/packages/generators/src/utils/global-packages-path.ts similarity index 100% rename from packages/utils/src/global-packages-path.ts rename to packages/generators/src/utils/global-packages-path.ts diff --git a/packages/utils/src/isWebpack5.ts b/packages/generators/src/utils/isWebpack5.ts similarity index 100% rename from packages/utils/src/isWebpack5.ts rename to packages/generators/src/utils/isWebpack5.ts diff --git a/packages/utils/src/modify-config-helper.ts b/packages/generators/src/utils/modify-config-helper.ts similarity index 100% rename from packages/utils/src/modify-config-helper.ts rename to packages/generators/src/utils/modify-config-helper.ts diff --git a/packages/utils/src/npm-exists.ts b/packages/generators/src/utils/npm-exists.ts similarity index 100% rename from packages/utils/src/npm-exists.ts rename to packages/generators/src/utils/npm-exists.ts diff --git a/packages/utils/src/npm-packages-exists.ts b/packages/generators/src/utils/npm-packages-exists.ts similarity index 100% rename from packages/utils/src/npm-packages-exists.ts rename to packages/generators/src/utils/npm-packages-exists.ts diff --git a/packages/utils/src/path-utils.ts b/packages/generators/src/utils/path-utils.ts similarity index 100% rename from packages/utils/src/path-utils.ts rename to packages/generators/src/utils/path-utils.ts diff --git a/packages/utils/src/prop-types.ts b/packages/generators/src/utils/prop-types.ts similarity index 100% rename from packages/utils/src/prop-types.ts rename to packages/generators/src/utils/prop-types.ts diff --git a/packages/utils/src/recursive-parser.ts b/packages/generators/src/utils/recursive-parser.ts similarity index 100% rename from packages/utils/src/recursive-parser.ts rename to packages/generators/src/utils/recursive-parser.ts diff --git a/packages/utils/src/resolve-packages.ts b/packages/generators/src/utils/resolve-packages.ts similarity index 100% rename from packages/utils/src/resolve-packages.ts rename to packages/generators/src/utils/resolve-packages.ts diff --git a/packages/utils/src/run-prettier.ts b/packages/generators/src/utils/run-prettier.ts similarity index 100% rename from packages/utils/src/run-prettier.ts rename to packages/generators/src/utils/run-prettier.ts diff --git a/packages/utils/src/scaffold.ts b/packages/generators/src/utils/scaffold.ts similarity index 100% rename from packages/utils/src/scaffold.ts rename to packages/generators/src/utils/scaffold.ts diff --git a/packages/utils/src/spawn-child.ts b/packages/generators/src/utils/spawn-child.ts similarity index 100% rename from packages/utils/src/spawn-child.ts rename to packages/generators/src/utils/spawn-child.ts diff --git a/packages/utils/src/types/Config.ts b/packages/generators/src/utils/types/Config.ts similarity index 100% rename from packages/utils/src/types/Config.ts rename to packages/generators/src/utils/types/Config.ts diff --git a/packages/utils/src/types/Error.ts b/packages/generators/src/utils/types/Error.ts similarity index 100% rename from packages/utils/src/types/Error.ts rename to packages/generators/src/utils/types/Error.ts diff --git a/packages/utils/src/types/NodePath.ts b/packages/generators/src/utils/types/NodePath.ts similarity index 100% rename from packages/utils/src/types/NodePath.ts rename to packages/generators/src/utils/types/NodePath.ts diff --git a/packages/utils/src/types/index.ts b/packages/generators/src/utils/types/index.ts similarity index 100% rename from packages/utils/src/types/index.ts rename to packages/generators/src/utils/types/index.ts diff --git a/packages/utils/src/validate-identifier.ts b/packages/generators/src/utils/validate-identifier.ts similarity index 100% rename from packages/utils/src/validate-identifier.ts rename to packages/generators/src/utils/validate-identifier.ts diff --git a/packages/generators/tsconfig.json b/packages/generators/tsconfig.json index b5df5fb69be..173f75d3f62 100644 --- a/packages/generators/tsconfig.json +++ b/packages/generators/tsconfig.json @@ -1,9 +1,9 @@ { "extends": "../../tsconfig.json", + "exclude": ["src/utils/__tests__"], "compilerOptions": { "outDir": "lib", "rootDir": "src" }, - "include": ["src"], - "references": [{ "path": "../utils" }] + "include": ["src"] } diff --git a/packages/init/package.json b/packages/init/package.json index 0898105ef64..4cc235e3bb0 100644 --- a/packages/init/package.json +++ b/packages/init/package.json @@ -12,8 +12,7 @@ "lib" ], "dependencies": { - "@webpack-cli/generators": "^1.2.1", - "@webpack-cli/utils": "^1.2.1" + "@webpack-cli/generators": "^1.2.1" }, "peerDependencies": { "webpack": "4.x.x || 5.x.x", diff --git a/packages/init/src/index.ts b/packages/init/src/index.ts index e0ddd3b209b..f10bd622922 100644 --- a/packages/init/src/index.ts +++ b/packages/init/src/index.ts @@ -1,5 +1,4 @@ -import { initGenerator } from '@webpack-cli/generators'; -import { modifyHelperUtil, npmPackagesExists } from '@webpack-cli/utils'; +import { initGenerator, modifyHelperUtil, npmPackagesExists } from '@webpack-cli/generators'; class InitCommand { async apply(cli): Promise { diff --git a/packages/init/tsconfig.json b/packages/init/tsconfig.json index 5d22b189fd7..ba2474fb584 100644 --- a/packages/init/tsconfig.json +++ b/packages/init/tsconfig.json @@ -5,5 +5,5 @@ "rootDir": "./src" }, "include": ["./src"], - "references": [{ "path": "../generators" }, { "path": "../utils" }] + "references": [{ "path": "../generators" }] } diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md deleted file mode 100644 index caca2302e41..00000000000 --- a/packages/utils/CHANGELOG.md +++ /dev/null @@ -1,69 +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. - -## [1.2.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.2.0...@webpack-cli/utils@1.2.1) (2020-12-31) - -**Note:** Version bump only for package @webpack-cli/utils - -# [1.2.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.1.0...@webpack-cli/utils@1.2.0) (2020-12-25) - -### Bug Fixes - -- remove duplicate log ([#2079](https://github.com/webpack/webpack-cli/issues/2079)) ([112068d](https://github.com/webpack/webpack-cli/commit/112068dc5b962a773c5db00e4e1140e8733ea9ec)) - -### Features - -- **init:** add --generation-path flag ([#2050](https://github.com/webpack/webpack-cli/issues/2050)) ([413eb8c](https://github.com/webpack/webpack-cli/commit/413eb8cf2add4978763a4c9ee6b983582685768b)) - -# [1.1.0](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.0.2...@webpack-cli/utils@1.1.0) (2020-11-04) - -### 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/utils@1.0.1...@webpack-cli/utils@1.0.2) (2020-10-19) - -**Note:** Version bump only for package @webpack-cli/utils - -## [1.0.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.0.1-rc.1...@webpack-cli/utils@1.0.1) (2020-10-10) - -### Bug Fixes - -- cleanup `package-utils` package ([#1822](https://github.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://github.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) -- upgrade lock file ([#1885](https://github.com/webpack/webpack-cli/issues/1885)) ([8df291e](https://github.com/webpack/webpack-cli/commit/8df291eef0fad7c91d912b158b3c2915cddfacd1)) - -## [1.0.1-rc.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.0.1-alpha.5...@webpack-cli/utils@1.0.1-rc.1) (2020-10-06) - -### Bug Fixes - -- add necessary peerDependencies ([#1825](https://github.com/webpack/webpack-cli/issues/1825)) ([0f13ab5](https://github.com/webpack/webpack-cli/commit/0f13ab5ddd9e28e5e7095721d086a58aebaf98a5)) -- regression with migrate command ([7ebcbb8](https://github.com/webpack/webpack-cli/commit/7ebcbb8030b9111df797abdd67e504178b18aeac)) -- use appropriate exit codes ([#1755](https://github.com/webpack/webpack-cli/issues/1755)) ([83f73b0](https://github.com/webpack/webpack-cli/commit/83f73b056e224301b871bee5e9b7254e64e84e95)) - -### Features - -- add flag to force config ([f61e7e0](https://github.com/webpack/webpack-cli/commit/f61e7e0d1b03284d7333c4f0f38294460209a25d)) - -## [1.0.1-alpha.5](https://github.com/ematipico/webpack-cli/compare/@webpack-cli/utils@1.0.1-alpha.4...@webpack-cli/utils@1.0.1-alpha.5) (2020-03-02) - -**Note:** Version bump only for package @webpack-cli/utils - -## [1.0.1-alpha.4](https://github.com/ematipico/webpack-cli/compare/@webpack-cli/utils@1.0.1-alpha.3...@webpack-cli/utils@1.0.1-alpha.4) (2020-02-29) - -**Note:** Version bump only for package @webpack-cli/utils - -## [1.0.1-alpha.3](https://github.com/ematipico/webpack-cli/compare/@webpack-cli/utils@1.0.1-alpha.2...@webpack-cli/utils@1.0.1-alpha.3) (2020-02-23) - -**Note:** Version bump only for package @webpack-cli/utils - -## [1.0.1-alpha.2](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.0.1-alpha.1...@webpack-cli/utils@1.0.1-alpha.2) (2020-02-23) - -**Note:** Version bump only for package @webpack-cli/utils - -## [1.0.1-alpha.1](https://github.com/webpack/webpack-cli/compare/@webpack-cli/utils@1.0.1-alpha.0...@webpack-cli/utils@1.0.1-alpha.1) (2020-02-23) - -### Bug Fixes - -- **init:** fix webpack config scaffold ([#1231](https://github.com/webpack/webpack-cli/issues/1231)) ([2dc495a](https://github.com/webpack/webpack-cli/commit/2dc495a8d050d28478c6c2533d7839e9ff78d76c)), closes [#1230](https://github.com/webpack/webpack-cli/issues/1230) diff --git a/packages/utils/README.md b/packages/utils/README.md deleted file mode 100644 index 4863dd276db..00000000000 --- a/packages/utils/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# webpack-cli utils (WIP, not yet published) - -[![NPM Downloads][downloads]][downloads-url] - -## Description - -This package contains the utilities used across the webpack-cli repositories. - -## Installation - -```bash -npm i -D webpack-cli @webpack-cli/utils -``` - -## Contents - -- AST transformations -- Checking NPM registry -- A Recursive AST parser -- Checking Local Configurations -- Yeoman Generator Adapter -- Package Resolver -- Test Utilities for Jest - -## Usage - -### Node - -```js -const utils = require('@webpack-cli/utils'); -// API yet to be exposed -``` - -[downloads]: https://img.shields.io/npm/dm/@webpack-cli/utils.svg -[downloads-url]: https://www.npmjs.com/package/@webpack-cli/utils diff --git a/packages/utils/package.json b/packages/utils/package.json deleted file mode 100644 index 8f96970b4d4..00000000000 --- a/packages/utils/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@webpack-cli/utils", - "version": "1.2.1", - "description": "webpack-cli utility files", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "publishConfig": { - "access": "public" - }, - "license": "MIT", - "files": [ - "lib" - ], - "dependencies": { - "colorette": "^1.2.1", - "execa": "^5.0.0", - "findup-sync": "^4.0.0", - "global-modules": "^2.0.0", - "got": "^11.8.0", - "jscodeshift": "^0.11.0", - "p-each-series": "^2.1.0", - "yeoman-environment": "^2.10.3", - "yeoman-generator": "^4.12.0" - }, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" - }, - "devDependencies": { - "@types/got": "^9.6.11", - "@types/prettier": "^2.1.5", - "@types/yeoman-generator": "^4.11.3" - }, - "peerDependenciesMeta": { - "prettier": { - "optional": true - } - }, - "gitHead": "fb50f766851f500ca12867a2aa9de81fa6e368f9" -} diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts deleted file mode 100644 index 68fef1ebafe..00000000000 --- a/packages/utils/src/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -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'; diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json deleted file mode 100644 index 279b3e923cc..00000000000 --- a/packages/utils/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src" - }, - "include": ["./src"] -} diff --git a/tsconfig.json b/tsconfig.json index ea484876822..ad41a0d6d32 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,9 +32,6 @@ { "path": "packages/serve" }, - { - "path": "packages/utils" - }, { "path": "packages/configtest" }