Skip to content

Commit fd5b92b

Browse files
authored
fix: cleanup package-utils package (#1822)
This commit removes the redundant `package-utils` package and moves the shared outing utils to the core CLI. This is because we felt the package was redundant and this seemed like the better way of doing things. All the tests and code has been migrated to core CLI and any packages which use it directly read it from the main CLI package.
1 parent c0eb280 commit fd5b92b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+399
-465
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ packages/generators/lib
77
packages/info/lib
88
packages/init/lib
99
packages/migrate/lib
10-
packages/package-utils/lib
1110
packages/serve/lib
1211
packages/utils/lib
1312
packages/webpack-scaffold/lib
@@ -28,4 +27,4 @@ test/loader/test-loader/examples/simple/webpack.config.js
2827
test/loader/test-loader/examples/simple/src/static-esm-module.js
2928
test/loader/test-loader/examples/simple/src/lazy-module.js
3029
test/loader/test-loader/examples/simple/example_dist/**
31-
lib/test/loader/error-test/src/index.d.ts
30+
lib/test/loader/error-test/src/index.d.ts

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ packages/**/*.map
5252
# build files
5353
packages/**/lib
5454
packages/**/yarn.lock
55+
!packages/webpack-cli/lib/utils/__tests__/**/yarn.lock
56+
!packages/webpack-cli/lib/utils/__tests__/**/package-lock.json
5557
!packages/webpack-cli/lib
5658

5759
# test output files

packages/generators/__tests__/addon-generator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
jest.setMock('@webpack-cli/package-utils', {
1+
jest.setMock('@webpack-cli/utils', {
22
getPackageManager: jest.fn(),
33
});
44

55
import fs from 'fs';
66
import path from 'path';
77
import mkdirp from 'mkdirp';
88
import rimraf from 'rimraf';
9-
import { getPackageManager } from '@webpack-cli/package-utils';
9+
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
1010
import addonGenerator from '../src/addon-generator';
1111

1212
// TODO: enable after jest release

packages/generators/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"templates"
1515
],
1616
"dependencies": {
17-
"@webpack-cli/package-utils": "^1.0.1-rc.1",
1817
"@webpack-cli/utils": "^1.0.1-rc.1",
1918
"@webpack-cli/webpack-scaffold": "^1.0.1-rc.1",
2019
"colorette": "^1.2.1",

packages/generators/src/addon-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import logger from 'webpack-cli/lib/utils/logger';
22
import mkdirp from 'mkdirp';
33
import path from 'path';
44
import Generator from 'yeoman-generator';
5-
import { getPackageManager } from '@webpack-cli/package-utils';
65
import { generatorCopy, generatorCopyTpl } from '@webpack-cli/utils';
6+
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
77

88
/**
99
* Creates a Yeoman Generator that generates a project conforming

packages/generators/src/init-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { blue, green, bold } from 'colorette';
22
import logger from 'webpack-cli/lib/utils/logger';
33
import logSymbols from 'log-symbols';
44
import path from 'path';
5-
import { getPackageManager } from '@webpack-cli/package-utils';
5+
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
66
import { Confirm, Input, List } from '@webpack-cli/webpack-scaffold';
77

88
import {

packages/generators/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"rootDir": "src"
66
},
77
"include": ["src"],
8-
"references": [{ "path": "../package-utils" }, { "path": "../utils" }, { "path": "../webpack-scaffold" }]
8+
"references": [{ "path": "../utils" }, { "path": "../webpack-scaffold" }]
99
}

packages/package-utils/CHANGELOG.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/package-utils/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/package-utils/__tests__/index.test.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)