Skip to content

Commit

Permalink
fix: formatting files
Browse files Browse the repository at this point in the history
  • Loading branch information
evenstensberg committed May 30, 2019
1 parent 43c00e0 commit eb3909b
Show file tree
Hide file tree
Showing 41 changed files with 476 additions and 653 deletions.
9 changes: 2 additions & 7 deletions bin/cli.js
Expand Up @@ -326,19 +326,14 @@ For more information, see https://webpack.js.org/api/cli/.`);
const SIX_DAYS = 518400000;
const now = new Date();
if (now.getDay() === MONDAY) {
const {
access,
constants,
statSync,
utimesSync,
} = require("fs");
const { access, constants, statSync, utimesSync } = require("fs");
const lastPrint = statSync(openCollectivePath).atime;
const lastPrintTS = new Date(lastPrint).getTime();
const timeSinceLastPrint = now.getTime() - lastPrintTS;
if (timeSinceLastPrint > SIX_DAYS) {
require(openCollectivePath);
// On windows we need to manually update the atime
access(openCollectivePath, constants.W_OK, (e) => {
access(openCollectivePath, constants.W_OK, e => {
if (!e) utimesSync(openCollectivePath, now, now);
});
}
Expand Down
73 changes: 51 additions & 22 deletions package-lock.json

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

11 changes: 6 additions & 5 deletions package.json
Expand Up @@ -33,9 +33,10 @@
"clean:all": "rimraf node_modules packages/*/{node_modules}",
"commit": "git-cz",
"docs": "typedoc",
"format": "prettier-eslint ./bin/*.js ./test/**/*.js ./packages/**/*.js --write",
"lint:codeOnly": "eslint \"{bin}/**/!(__testfixtures__)/*.js\" \"{bin}/**.js\"",
"lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"packages/**/!(node_modules)/*.ts\"",
"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",
"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",
"reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov",
Expand Down Expand Up @@ -145,8 +146,8 @@
"@commitlint/travis-cli": "^7.2.1",
"@types/jest": "^23.3.14",
"@types/node": "^10.12.9",
"@typescript-eslint/eslint-plugin": "^1.6.0",
"@typescript-eslint/parser": "^1.6.0",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"babel-preset-env": "^1.7.0",
"babel-preset-jest": "^24.3.0",
"bundlesize": "^0.17.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/generators/__tests__/add-generator.test.ts
@@ -1,4 +1,4 @@
import { generatePluginName } from "../utils/plugins"
import { generatePluginName } from "../utils/plugins";

describe("generatePluginName", () => {
it("should return webpack Standard Plugin Name for Name : extract-text-webpack-plugin", () => {
Expand All @@ -11,4 +11,3 @@ describe("generatePluginName", () => {
expect(pluginName).toEqual("webpack.DefinePlugin");
});
});

8 changes: 4 additions & 4 deletions packages/generators/add-generator.ts
Expand Up @@ -16,7 +16,6 @@ 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());


/**
*
* Checks if the given array has a given property
Expand Down Expand Up @@ -91,8 +90,9 @@ export default class AddGenerator extends Generator {
const done: () => {} = this.async();
let action: string;
const self: this = this;
const manualOrListInput: (promptAction: string) => Generator.Question = (promptAction: string): Generator.Question =>
Input("actionAnswer", `What do you want to add to ${promptAction}?`);
const manualOrListInput: (promptAction: string) => Generator.Question = (
promptAction: string
): Generator.Question => Input("actionAnswer", `What do you want to add to ${promptAction}?`);
let inputPrompt: Generator.Question;

// first index indicates if it has a deep prop, 2nd indicates what kind of
Expand Down Expand Up @@ -380,7 +380,7 @@ export default class AddGenerator extends Generator {
(p: boolean): void => {
if (p) {
this.dependencies.push(answerToAction.actionAnswer);
const pluginName = generatePluginName(answerToAction.actionAnswer)
const pluginName = generatePluginName(answerToAction.actionAnswer);
this.configuration.config.topScope.push(
`const ${pluginName} = require("${answerToAction.actionAnswer}")`
);
Expand Down
3 changes: 2 additions & 1 deletion packages/generators/addon-generator.ts
Expand Up @@ -31,7 +31,8 @@ const addonGenerator = (
copyFiles: string[],
copyTemplateFiles: string[],
templateFn: Function
): typeof Generator => class AddonGenerator extends Generator {
): typeof Generator =>
class AddonGenerator extends Generator {
public props: Generator.Question;
public copy: (value: string, index: number, array: string[]) => void;
public copyTpl: (value: string, index: number, array: string[]) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/index.ts
Expand Up @@ -13,5 +13,5 @@ export {
loaderGenerator,
pluginGenerator,
removeGenerator,
updateGenerator,
updateGenerator
};

0 comments on commit eb3909b

Please sign in to comment.