Skip to content

Commit

Permalink
fix: cleanup package-utils package (#1822)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anshumanv committed Oct 10, 2020
1 parent c0eb280 commit fd5b92b
Show file tree
Hide file tree
Showing 44 changed files with 399 additions and 465 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Expand Up @@ -7,7 +7,6 @@ packages/generators/lib
packages/info/lib
packages/init/lib
packages/migrate/lib
packages/package-utils/lib
packages/serve/lib
packages/utils/lib
packages/webpack-scaffold/lib
Expand All @@ -28,4 +27,4 @@ test/loader/test-loader/examples/simple/webpack.config.js
test/loader/test-loader/examples/simple/src/static-esm-module.js
test/loader/test-loader/examples/simple/src/lazy-module.js
test/loader/test-loader/examples/simple/example_dist/**
lib/test/loader/error-test/src/index.d.ts
lib/test/loader/error-test/src/index.d.ts
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -52,6 +52,8 @@ packages/**/*.map
# build files
packages/**/lib
packages/**/yarn.lock
!packages/webpack-cli/lib/utils/__tests__/**/yarn.lock
!packages/webpack-cli/lib/utils/__tests__/**/package-lock.json
!packages/webpack-cli/lib

# test output files
Expand Down
4 changes: 2 additions & 2 deletions packages/generators/__tests__/addon-generator.test.ts
@@ -1,12 +1,12 @@
jest.setMock('@webpack-cli/package-utils', {
jest.setMock('@webpack-cli/utils', {
getPackageManager: jest.fn(),
});

import fs from 'fs';
import path from 'path';
import mkdirp from 'mkdirp';
import rimraf from 'rimraf';
import { getPackageManager } from '@webpack-cli/package-utils';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
import addonGenerator from '../src/addon-generator';

// TODO: enable after jest release
Expand Down
1 change: 0 additions & 1 deletion packages/generators/package.json
Expand Up @@ -14,7 +14,6 @@
"templates"
],
"dependencies": {
"@webpack-cli/package-utils": "^1.0.1-rc.1",
"@webpack-cli/utils": "^1.0.1-rc.1",
"@webpack-cli/webpack-scaffold": "^1.0.1-rc.1",
"colorette": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/src/addon-generator.ts
Expand Up @@ -2,8 +2,8 @@ import logger from 'webpack-cli/lib/utils/logger';
import mkdirp from 'mkdirp';
import path from 'path';
import Generator from 'yeoman-generator';
import { getPackageManager } from '@webpack-cli/package-utils';
import { generatorCopy, generatorCopyTpl } from '@webpack-cli/utils';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';

/**
* Creates a Yeoman Generator that generates a project conforming
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/src/init-generator.ts
Expand Up @@ -2,7 +2,7 @@ import { blue, green, bold } from 'colorette';
import logger from 'webpack-cli/lib/utils/logger';
import logSymbols from 'log-symbols';
import path from 'path';
import { getPackageManager } from '@webpack-cli/package-utils';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
import { Confirm, Input, List } from '@webpack-cli/webpack-scaffold';

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/tsconfig.json
Expand Up @@ -5,5 +5,5 @@
"rootDir": "src"
},
"include": ["src"],
"references": [{ "path": "../package-utils" }, { "path": "../utils" }, { "path": "../webpack-scaffold" }]
"references": [{ "path": "../utils" }, { "path": "../webpack-scaffold" }]
}
34 changes: 0 additions & 34 deletions packages/package-utils/CHANGELOG.md

This file was deleted.

11 changes: 0 additions & 11 deletions packages/package-utils/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions packages/package-utils/__tests__/index.test.ts

This file was deleted.

183 changes: 0 additions & 183 deletions packages/package-utils/__tests__/packageUtils.test.ts

This file was deleted.

57 changes: 0 additions & 57 deletions packages/package-utils/package.json

This file was deleted.

2 changes: 0 additions & 2 deletions packages/package-utils/src/index.ts

This file was deleted.

0 comments on commit fd5b92b

Please sign in to comment.