Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update release script #1913

Merged
merged 4 commits into from Oct 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.js
@@ -1,8 +1,14 @@
module.exports = {
root: true,
reportUnusedDisableDirectives: true,
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended', 'prettier'],
parserOptions: { ecmaVersion: 2018, sourceType: 'script' },
plugins: ['node'],
settings: {
node: {
allowModules: ['@webpack-cli/generators', '@webpack-cli/webpack-scaffold', '@webpack-cli/utils'],
},
},
env: {
node: true,
es6: true,
Expand Down
21 changes: 0 additions & 21 deletions bin/utils/validate-options.js

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
@@ -1,6 +1,5 @@
{
"name": "webpack-cli-monorepo",
"version": "4.0.0-beta.9",
"description": "CLI for webpack & friends",
"license": "MIT",
"private": true,
Expand Down Expand Up @@ -41,7 +40,7 @@
"test:ci": "yarn test:cli && yarn test:packages",
"test:watch": "jest test/ packages/ --watch",
"test:smoke": "smoketests/smoketests.sh",
"publish:monorepo": "yarn build && lerna version prerelease --preid rc && lerna publish from-git --canary --preid rc --dist-tag next"
"publish:monorepo": "yarn build && lerna version && lerna publish from-git"
},
"config": {
"commitizen": {
Expand Down
1 change: 1 addition & 0 deletions packages/generators/__tests__/utils/entry.test.ts
Expand Up @@ -4,6 +4,7 @@ jest.setMock('@webpack-cli/webpack-scaffold', {
});

import { Input, InputValidate } from '@webpack-cli/webpack-scaffold';
// eslint-disable-next-line node/no-missing-import
import entry from '../../lib/utils/entry';

describe('entry', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/generators/__tests__/utils/languageSupport.test.ts
@@ -1,4 +1,6 @@
// eslint-disable-next-line node/no-missing-import
import language, { LangType, getBabelLoader, getTypescriptLoader } from '../../lib/utils/languageSupport';
// eslint-disable-next-line node/no-missing-import
import { CustomGenerator } from '../../lib/types';

// TODO: enable after jest release
Expand Down
1 change: 1 addition & 0 deletions packages/generators/__tests__/utils/plugins.test.ts
@@ -1,3 +1,4 @@
// eslint-disable-next-line node/no-missing-import
import { replaceAt, generatePluginName } from '../../lib/utils/plugins';

describe('generate plugin name', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/generators/__tests__/utils/styleSupport.test.ts
@@ -1,4 +1,6 @@
// eslint-disable-next-line node/no-missing-import
import style, { StylingType } from '../../lib/utils/styleSupport';
// eslint-disable-next-line node/no-missing-import
import { CustomGenerator } from '../../lib/types';

// TODO: enable after jest release
Expand Down
1 change: 0 additions & 1 deletion packages/generators/templates/addon-package.json.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
module.exports = (name) => {
return {
version: '1.0.0',
Expand Down
1 change: 0 additions & 1 deletion packages/generators/templates/package.json.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
module.exports = (usingDefaults) => {
const scripts = {
build: 'webpack',
Expand Down
Expand Up @@ -170,7 +170,6 @@ export default function (j: JSCodeshift, ast: Node): Node {
cacheGroup[chunkKey] = [];
}

// eslint-disable-next-line
cacheGroup[chunkKey] = cacheGroup[chunkKey].map((prop): string | void =>
prop.key.name === 'test' ? mergeTestPropArrowFunction(j, chunkKey, pathValue) : prop,
);
Expand Down
5 changes: 2 additions & 3 deletions packages/utils/__tests__/defineTest.ts
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import fs from 'fs';
import path from 'path';
import * as fs from 'fs';
import * as path from 'path';

import { JSCodeshift, Node } from '../src/types/NodePath';

Expand Down
5 changes: 3 additions & 2 deletions packages/utils/__tests__/global-packages-path.test.ts
Expand Up @@ -2,15 +2,16 @@
jest.setMock('webpack-cli/lib/utils/get-package-manager', {
getPackageManager: jest.fn(),
});
// eslint-disable-next-line node/no-missing-import
import { getPathToGlobalPackages } from '../lib/global-packages-path';
import { getPackageManager } from 'webpack-cli/lib/utils/get-package-manager';
jest.mock('execa');
jest.mock('cross-spawn');
const globalModulesNpmValue = 'test-npm';
jest.setMock('global-modules', globalModulesNpmValue);

import path from 'path';
import spawn from 'cross-spawn';
import * as path from 'path';
import * as spawn from 'cross-spawn';

describe('getPathToGlobalPackages', () => {
it('uses global-modules if package manager is npm', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/npm-packages-exists.ts
Expand Up @@ -60,7 +60,6 @@ export function npmPackagesExists(pkg: string[]): void {
})
.catch((err: Error): void => {
console.error(err.stack || err);
// eslint-disable-next-line no-process-exit
process.exit(2);
})
.then(resolvePackagesIfReady);
Expand Down
1 change: 0 additions & 1 deletion packages/webpack-cli/__tests__/init.test.js
Expand Up @@ -43,7 +43,6 @@ describe('init', () => {
// Test regressively files are scaffolded
const files = ['./sw.js', './package.json', './src/index.js'];

// eslint-disable-next-line prettier/prettier
files.forEach((file) => {
expect(fs.existsSync(path.resolve(genPath, file))).toBeTruthy();
});
Expand Down
1 change: 0 additions & 1 deletion packages/webpack-cli/__tests__/serve/webpack.config.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line node/no-unpublished-require
const WebpackCLITestPlugin = require('../../../../test/utils/webpack-cli-test-plugin');

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/lib/bootstrap.js
Expand Up @@ -96,7 +96,7 @@ const runCLI = async (cliArgs) => {
});
// Filter out the value for the overridden key
const newArgKeys = Object.keys(argsMap).filter((arg) => !keysToDelete.includes(argsMap[arg].pos));
// eslint-disable-next-line require-atomic-updates

cliArgs = newArgKeys;
args = argParser('', core, cliArgs);
await cli.run(args.opts, core);
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/lib/utils/Compiler.js
Expand Up @@ -72,7 +72,7 @@ class Compiler {
if (err) {
lastHash = null;
logger.error(err.stack || err);
process.exit(1); // eslint-disable-line
process.exit(1);
}
if (!outputOptions.watch && stats.hasErrors()) {
process.exitCode = 1;
Expand Down
3 changes: 1 addition & 2 deletions packages/webpack-cli/lib/utils/prompt-installation.js
Expand Up @@ -9,7 +9,6 @@ const { packageExists } = require('./package-exists');
* @param packageName
* @param preMessage Message to show before the question
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
async function promptInstallation(packageName, preMessage) {
const packageManager = getPackageManager();
const options = [packageManager === 'yarn' ? 'add' : 'install', '-D', packageName];
Expand All @@ -31,7 +30,7 @@ async function promptInstallation(packageName, preMessage) {
await runCommand(commandToBeRun);
return packageExists(packageName);
}
// eslint-disable-next-line require-atomic-updates

process.exitCode = 2;
}

Expand Down
1 change: 0 additions & 1 deletion packages/webpack-scaffold/src/index.ts
Expand Up @@ -136,7 +136,6 @@ export function Confirm(self: Generator, name: string, message: string, defaultC
}

// TODO: to understand this type
// eslint-disable-next-line
export function AutoComplete(name: string, message: string, options: object = {}): any {
return Object.assign(
{
Expand Down
3 changes: 0 additions & 3 deletions smoketests/watch/watch.array.smoketest.js
Expand Up @@ -27,7 +27,6 @@ const testEntryFiles = [
*/
async function setup() {
await testEntryFiles.forEach(async (file) => {
// eslint-disable-next-line
file.cpFP = await copyFileAsync(__dirname, file.name);
});
}
Expand All @@ -48,7 +47,6 @@ async function teardown() {
});
}

// eslint-disable-next-line
(async () => {
try {
await setup();
Expand Down Expand Up @@ -87,7 +85,6 @@ async function teardown() {
});

// Buffer should have compiled equal amount of each compilation and have diff output directories
// eslint-disable-next-line
webpackProc.stderr.on('close', async () => {
assert.strictEqual(dataBuffer.length > 3, true, 'expected buffer for array configuration to be more than 3');
const nCompilationBufferOne = [];
Expand Down
3 changes: 0 additions & 3 deletions smoketests/watch/watch.single.smoketest.js
Expand Up @@ -22,7 +22,6 @@ const testEntryFiles = [
*/
async function setup() {
await testEntryFiles.forEach(async (file) => {
// eslint-disable-next-line
file.cpFP = await copyFileAsync(__dirname, file.name);
});
}
Expand All @@ -43,7 +42,6 @@ async function teardown() {
});
}

// eslint-disable-next-line
(async () => {
try {
await setup();
Expand Down Expand Up @@ -81,7 +79,6 @@ async function teardown() {
});

// Buffer should have compiled equal amount of each compilation and have diff output directories
// eslint-disable-next-line
webpackProc.stderr.on('close', async () => {
assert.strictEqual(dataBuffer.length >= 1, true, 'expected single configuration to re-compile');
await teardown();
Expand Down
3 changes: 0 additions & 3 deletions test/binCases/errors/v5-schema-validation/options.js

This file was deleted.

17 changes: 0 additions & 17 deletions test/binCases/errors/v5-schema-validation/validation.test.js

This file was deleted.

1 change: 0 additions & 1 deletion test/config-format/typescript/typescript.test.js
@@ -1,4 +1,3 @@
/* eslint-disable node/no-missing-require */
/* eslint-disable node/no-unpublished-require */
const { run, runInstall } = require('../../utils/test-utils');
const { stat } = require('fs');
Expand Down
1 change: 0 additions & 1 deletion test/config/multiple/multiple-config.test.js
@@ -1,6 +1,5 @@
const { existsSync } = require('fs');
const { resolve } = require('path');
// eslint-disable-next-line node/no-missing-require
const { run } = require('../../utils/test-utils');

describe('Multiple config flag: ', () => {
Expand Down
1 change: 0 additions & 1 deletion test/entry/scss/scss.test.js
@@ -1,4 +1,3 @@
/* eslint-disable node/no-missing-require */
/* eslint-disable node/no-unpublished-require */
const { run, runInstall } = require('../../utils/test-utils');

Expand Down
1 change: 0 additions & 1 deletion test/info/info-output.test.js
@@ -1,4 +1,3 @@
/* eslint-disable space-before-function-paren */
'use strict';

const { red } = require('colorette');
Expand Down
1 change: 0 additions & 1 deletion test/init/auto/init-auto.test.js
Expand Up @@ -35,7 +35,6 @@ describe('init auto flag', () => {
// Test regressively files are scaffolded
const files = ['./sw.js', './package.json', './src/index.js'];

// eslint-disable-next-line prettier/prettier
files.forEach((file) => {
expect(fs.existsSync(resolve(genPath, file))).toBeTruthy();
});
Expand Down
1 change: 0 additions & 1 deletion test/init/force/init-force.test.js
Expand Up @@ -29,7 +29,6 @@ describe('init force flag', () => {
// Test regressively files are scaffolded
const files = ['./sw.js', './package.json', './src/index.js', './webpack.config.js'];

// eslint-disable-next-line prettier/prettier
files.forEach((file) => {
expect(fs.existsSync(resolve(genPath, file))).toBeTruthy();
});
Expand Down
1 change: 0 additions & 1 deletion test/init/generator/init-inquirer.test.js
Expand Up @@ -29,7 +29,6 @@ describe('init', () => {
// Test regressively files are scaffolded
const files = ['./sw.js', './package.json', './src/index.js'];

// eslint-disable-next-line prettier/prettier
files.forEach((file) => {
expect(fs.existsSync(resolve(genPath, file))).toBeTruthy();
});
Expand Down
1 change: 0 additions & 1 deletion test/init/language/css/init-language-css.test.js
Expand Up @@ -34,7 +34,6 @@ describe('init with SCSS', () => {
// Test regressively files are scaffolded
const files = ['./package.json', './.yo-rc.json', './src/index.js', 'webpack.config.js'];

// eslint-disable-next-line prettier/prettier
files.forEach((file) => {
expect(fs.existsSync(resolve(genPath, file))).toBeTruthy();
});
Expand Down
1 change: 0 additions & 1 deletion test/init/language/js/init-language-js.test.js
Expand Up @@ -30,7 +30,6 @@ describe('init with Typescript', () => {
// Test regressively files are scaffolded
const files = ['./package.json', './.yo-rc.json', './tsconfig.json', './src/index.ts', 'webpack.config.js'];

// eslint-disable-next-line prettier/prettier
files.forEach((file) => {
expect(fs.existsSync(resolve(genPath, file))).toBeTruthy();
});
Expand Down
2 changes: 1 addition & 1 deletion test/init/multipleEntries/init-multipleEntries.test.js
Expand Up @@ -32,7 +32,7 @@ describe('init with multiple entries', () => {

// Test regressively files are scaffolded
const files = ['./package.json', './src/a.js', './src/b.js', './.yo-rc.json'];
// eslint-disable-next-line prettier/prettier

files.forEach((file) => {
expect(fs.existsSync(path.resolve(genPath, file))).toBeTruthy();
});
Expand Down
1 change: 0 additions & 1 deletion test/loader/loader.test.js
@@ -1,4 +1,3 @@
/* eslint-disable node/no-unpublished-require */
'use strict';

const { existsSync } = require('fs');
Expand Down
2 changes: 0 additions & 2 deletions test/migrate/config/bad-webpack.config.js
@@ -1,5 +1,3 @@
/* eslint-disable */

module.exports = {
output: {
badOption: true,
Expand Down
1 change: 0 additions & 1 deletion test/mode/mode-single-arg/webpack.config.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line node/no-unpublished-require
const WebpackCLITestPlugin = require('../../utils/webpack-cli-test-plugin');

module.exports = {
Expand Down
3 changes: 1 addition & 2 deletions test/no-stats/with-config/no-stats-with-config.test.js
@@ -1,7 +1,6 @@
'use strict';
// eslint-disable-next-line node/no-unpublished-require

const { run } = require('../../utils/test-utils');
// eslint-disable-next-line node/no-extraneous-require
const { version } = require('webpack');

describe('stats flag', () => {
Expand Down
1 change: 0 additions & 1 deletion test/no-stats/with-config/webpack.config.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line node/no-unpublished-require
const WebpackCLITestPlugin = require('../../utils/webpack-cli-test-plugin');

module.exports = {
Expand Down
3 changes: 1 addition & 2 deletions test/no-stats/with-flags/no-stats.test.js
@@ -1,7 +1,6 @@
'use strict';
// eslint-disable-next-line node/no-unpublished-require

const { run } = require('../../utils/test-utils');
// eslint-disable-next-line node/no-extraneous-require
const { version } = require('webpack');

describe('stats flag', () => {
Expand Down
1 change: 0 additions & 1 deletion test/no-stats/with-flags/webpack.config.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line node/no-unpublished-require
const WebpackCLITestPlugin = require('../../utils/webpack-cli-test-plugin');

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion test/progress/progress-flag.test.js
@@ -1,6 +1,5 @@
'use strict';

// eslint-disable-next-line node/no-unpublished-require
const { run } = require('../utils/test-utils');

describe('progress flag', () => {
Expand Down
1 change: 0 additions & 1 deletion test/serve/basic/webpack.config.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line node/no-unpublished-require
const WebpackCLITestPlugin = require('../../utils/webpack-cli-test-plugin');

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion test/serve/with-custom-port/webpack.config.js
@@ -1,4 +1,3 @@
// eslint-disable-next-line node/no-unpublished-require
const WebpackCLITestPlugin = require('../../utils/webpack-cli-test-plugin');

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion test/stats/cli-flags/stats.test.js
@@ -1,4 +1,3 @@
/* eslint-disable node/no-extraneous-require */
/* eslint-disable node/no-unpublished-require */
'use strict';

Expand Down