Skip to content

Commit

Permalink
chore(chore): conflicts
Browse files Browse the repository at this point in the history
conflicts
  • Loading branch information
anshumanv committed Jun 6, 2019
2 parents 5bf847c + 6b50c96 commit 8c9bfab
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 251 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Expand Up @@ -122,7 +122,7 @@ In case you are suggesting a new feature, we will match your idea with our curre
npm run test:packages
```

- Test a single CLI test case:
- Test a single CLI test case (must run from root of the poject):

```bash
npx jest path/to/my-test.js
Expand Down Expand Up @@ -161,7 +161,7 @@ In case you are suggesting a new feature, we will match your idea with our curre
yarn test:packages
```

- Test a single CLI test case:
- Test a single CLI test case (must run from root of the poject):

```bash
yarn jest path/to/my-test.js
Expand Down
12 changes: 10 additions & 2 deletions package.json
Expand Up @@ -35,8 +35,8 @@
"commit": "git-cz",
"docs": "typedoc",
"format": "npm run format:js && npm run format:ts",
"format:ts": "prettier-eslint ./bin/*.js ./bin/**/*.js ./test/**/*.js ./packages/**/**/*.js ./packages/**/*.js --write",
"format:js": "prettier-eslint ./packages/**/**/*.ts ./packages/**/*.ts ./packages/**/**/**/*.ts --write",
"format:js": "prettier-eslint ./bin/*.js ./bin/**/*.js ./test/**/*.js ./packages/**/**/*.js ./packages/**/*.js --write",
"format:ts": "prettier-eslint ./packages/**/**/*.ts ./packages/**/*.ts ./packages/**/**/**/*.ts --write",
"lint": "eslint \"./bin/*.js\" \"./bin/**/*.js\" \"./test/**/*.js\" \"packages/**/!(node_modules)/*.ts\" \"packages/**/!(node_modules)/**/*.ts\"",
"postinstall": "node ./bin/opencollective.js",
"pretest": "npm run build && npm run lint",
Expand All @@ -63,6 +63,14 @@
"{packages,bin}/**/!(__testfixtures__)/**.js": [
"eslint --fix",
"git add"
],
"*.ts": [
"npm run format:ts",
"git add"
],
"*.js": [
"npm run format:js",
"git add"
]
},
"jest": {
Expand Down
103 changes: 0 additions & 103 deletions packages/add/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 0 additions & 99 deletions packages/generate-loader/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/generate-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/generators/__tests__/add-generator.test.ts
@@ -1,4 +1,4 @@
import { generatePluginName } from "../utils/plugins";
import { generatePluginName } from "../utils";

describe("generatePluginName", () => {
it("should return webpack Standard Plugin Name for Name : extract-text-webpack-plugin", () => {
Expand Down
12 changes: 8 additions & 4 deletions packages/generators/add-generator.ts
Expand Up @@ -10,10 +10,10 @@ import PROP_TYPES from "@webpack-cli/utils/prop-types";
import { AutoComplete, Confirm, Input, List } from "@webpack-cli/webpack-scaffold";

import { SchemaProperties, WebpackOptions } from "./types";
import entryQuestions from "./utils/entry";
import { generatePluginName } from "./utils/plugins";
import { entryQuestions, generatePluginName } from "./utils";
import * as webpackDevServerSchema from "webpack-dev-server/lib/options.json";
import * as webpackSchema from "./utils/optionsSchema.json";

const PROPS: string[] = Array.from(PROP_TYPES.keys());

/**
Expand Down Expand Up @@ -308,7 +308,11 @@ export default class AddGenerator extends Generator {
.pop()
.replace(".js", "")
)
.find((p: string): boolean => p.toLowerCase().indexOf(answeredPluginName) >= 0);
.find(
(p: string): boolean =>
p.toLowerCase().indexOf(answeredPluginName) >= 0 ||
p.indexOf(answeredPluginName) >= 0
);

if (pluginExist) {
this.configuration.config.item = pluginExist;
Expand All @@ -323,7 +327,7 @@ export default class AddGenerator extends Generator {
.split("/")
.pop()
.replace(".json", "")
.indexOf(answeredPluginName) >= 0
.indexOf(pluginExist) >= 0
);
if (pluginsSchemaPath) {
const constructorPrefix: string =
Expand Down
17 changes: 11 additions & 6 deletions packages/generators/init-generator.ts
Expand Up @@ -6,13 +6,18 @@ import * as path from "path";
import { getPackageManager } from "@webpack-cli/utils/package-manager";
import { Confirm, Input, List } from "@webpack-cli/webpack-scaffold";

import { getDefaultOptimization } from "./utils/webpackConfig";
import {
getDefaultOptimization,
LangType,
langQuestionHandler,
tooltip,
generatePluginName,
Loader,
StylingType,
styleQuestionHandler,
entryQuestions
} from "./utils";
import { WebpackOptions } from "./types";
import entryQuestions from "./utils/entry";
import langQuestionHandler, { LangType } from "./utils/languageSupport";
import styleQuestionHandler, { Loader, StylingType } from "./utils/styleSupport";
import tooltip from "./utils/tooltip";
import { generatePluginName } from "./utils/plugins";

/**
*
Expand Down
26 changes: 26 additions & 0 deletions packages/generators/utils/index.ts
@@ -0,0 +1,26 @@
import entryQuestions from "./entry";
import langQuestionHandler, { LangType, getBabelLoader, getTypescriptLoader } from "./languageSupport";
import plugins, { replaceAt, generatePluginName } from "./plugins";
import styleQuestionHandler, { StylingType, LoaderName, StyleRegex, Loader } from "./styleSupport";
import tooltip from "./tooltip";
import validate from "./validate";
import { getDefaultOptimization } from "./webpackConfig";

export {
entryQuestions,
langQuestionHandler,
LangType,
getBabelLoader,
getTypescriptLoader,
plugins,
replaceAt,
generatePluginName,
styleQuestionHandler,
StylingType,
LoaderName,
StyleRegex,
Loader,
tooltip,
validate,
getDefaultOptimization
};

0 comments on commit 8c9bfab

Please sign in to comment.