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

Remove es5 builds #9945

Merged
merged 1 commit into from May 2, 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
12 changes: 0 additions & 12 deletions .circleci/config.yml
Expand Up @@ -104,17 +104,6 @@ jobs:
- store_test_results:
path: reports/junit

test-browser:
working_directory: ~/jest
docker:
- image: circleci/node:12-browsers
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run: yarn test-ci-es5-build-in-browser

test-or-deploy-website:
working_directory: ~/jest
docker:
Expand All @@ -140,6 +129,5 @@ workflows:
- test-node-13
- test-node-14 # current
- test-jest-circus
- test-browser
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
1 change: 0 additions & 1 deletion .eslintignore
Expand Up @@ -3,7 +3,6 @@
bin/
flow-typed/**
packages/*/build/**
packages/*/build-es5/**
packages/jest-diff/src/cleanupSemantic.ts
website/blog
website/build
Expand Down
1 change: 0 additions & 1 deletion .eslintrc.js
Expand Up @@ -95,7 +95,6 @@ module.exports = {
files: [
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'e2e/browser-support/browserTest.js',
'**/vendor/**/*',
],
rules: {
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nodejs.yml
Expand Up @@ -45,8 +45,6 @@ jobs:
run: yarn verify-old-ts
- name: run eslint
run: yarn lint
- name: run eslint on browser builds
run: yarn lint-es5-build
- name: run prettier
run: yarn lint:prettier:ci
- name: check copyright headers
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -17,7 +17,6 @@
/node_modules

/packages/*/build/
/packages/*/build-es5/
/packages/*/coverage/
/packages/*/node_modules/
/packages/*/package-lock.json
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@

### Chore & Maintenance

- `[expect, jest-mock, pretty-format]` [**BREAKING**] Remove `build-es5` from package ([#9945](https://github.com/facebook/jest/pull/9945))

### Performance

## 25.5.3
Expand Down
28 changes: 0 additions & 28 deletions e2e/browser-support/browserTest.js

This file was deleted.

2 changes: 0 additions & 2 deletions jest.config.js
Expand Up @@ -23,7 +23,6 @@ module.exports = {
modulePathIgnorePatterns: [
'examples/.*',
'packages/.*/build',
'packages/.*/build-es5',
'packages/jest-runtime/src/__tests__/test_root.*',
'website/.*',
'e2e/runtime-internal-module-registry/__mocks__',
Expand All @@ -44,7 +43,6 @@ module.exports = {
'/e2e/global-teardown',
'\\.snap$',
'/packages/.*/build',
'/packages/.*/build-es5',
'/packages/.*/src/__tests__/setPrettyPrint.ts',
'/packages/jest-core/src/__tests__/test_root',
'/packages/jest-core/src/__tests__/__fixtures__/',
Expand Down
25 changes: 0 additions & 25 deletions karma.conf.js

This file was deleted.

7 changes: 0 additions & 7 deletions package.json
Expand Up @@ -59,10 +59,6 @@
"jest-snapshot-serializer-raw": "^1.1.0",
"jest-watch-typeahead": "^0.5.0",
"jquery": "^3.2.1",
"karma": "^4.0.1",
"karma-chrome-launcher": "^3.0.0",
"karma-mocha": "^1.3.0",
"karma-webpack": "^4.0.2",
"lerna": "^3.20.2",
"make-dir": "^3.0.0",
"micromatch": "^4.0.2",
Expand All @@ -82,7 +78,6 @@
"tempy": "~0.3.0",
"throat": "^5.0.0",
"typescript": "^3.8.2",
"webpack": "^4.28.4",
"which": "^2.0.1"
},
"scripts": {
Expand All @@ -96,14 +91,12 @@
"jest": "node ./packages/jest-cli/bin/jest.js",
"jest-coverage": "yarn jest --coverage",
"lint": "eslint . --cache --ext js,jsx,ts,tsx,md",
"lint-es5-build": "eslint --no-eslintrc --no-ignore --env=browser packages/*/build-es5",
"lint:prettier": "prettier '**/*.{md,yml,yaml}' 'website/static/**/*.{css,js}' --write --ignore-path .gitignore",
"lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/static/**/*.{css,js}' --check --ignore-path .gitignore",
"postinstall": "opencollective postinstall && yarn build",
"install-no-ts-build": "node ./scripts/remove-postinstall && yarn --no-progress --frozen-lockfile && node ./scripts/build",
"remove-prettier-dep": "node ./scripts/remove-prettier-dep",
"publish": "yarn build-clean && yarn build && lerna publish --silent",
"test-ci-es5-build-in-browser": "karma start --single-run",
"test-ci": "yarn jest-coverage --color -i --config jest.config.ci.js && yarn test-leak && node ./scripts/mapCoverage.js && codecov",
"test-ci-partial": "yarn jest --color -i --config jest.config.ci.js",
"test-pretty-format-perf": "node packages/pretty-format/perf/test.js",
Expand Down
1 change: 0 additions & 1 deletion packages/expect/package.json
Expand Up @@ -16,7 +16,6 @@
]
}
},
"browser": "build-es5/index.js",
"dependencies": {
"@jest/types": "^25.5.0",
"ansi-styles": "^4.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/jest-mock/package.json
Expand Up @@ -25,7 +25,6 @@
]
}
},
"browser": "build-es5/index.js",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 0 additions & 1 deletion packages/pretty-format/package.json
Expand Up @@ -17,7 +17,6 @@
]
}
},
"browser": "build-es5/index.js",
"author": "James Kyle <me@thejameskyle.com>",
"dependencies": {
"@jest/types": "^25.5.0",
Expand Down
87 changes: 0 additions & 87 deletions scripts/browserBuild.js

This file was deleted.

39 changes: 0 additions & 39 deletions scripts/build.js
Expand Up @@ -30,11 +30,9 @@ const chalk = require('chalk');
const micromatch = require('micromatch');
const prettier = require('prettier');
const {getPackages, adjustToTerminalWidth, OK} = require('./buildUtils');
const browserBuild = require('./browserBuild');

const SRC_DIR = 'src';
const BUILD_DIR = 'build';
const BUILD_ES5_DIR = 'build-es5';
const JS_FILES_PATTERN = '**/*.js';
const TS_FILES_PATTERN = '**/*.ts';
const IGNORE_PATTERN = '**/__{tests,mocks}__/**';
Expand Down Expand Up @@ -72,39 +70,6 @@ function buildNodePackage(p) {
process.stdout.write(`${OK}\n`);
}

function buildBrowserPackage(p) {
const srcDir = path.resolve(p, SRC_DIR);
const pkgJsonPath = path.resolve(p, 'package.json');

if (!fs.existsSync(pkgJsonPath)) {
return;
}

const browser = require(pkgJsonPath).browser;
if (browser) {
if (browser.indexOf(BUILD_ES5_DIR) !== 0) {
throw new Error(
`browser field for ${pkgJsonPath} should start with "${BUILD_ES5_DIR}"`,
);
}
let indexFile = path.resolve(srcDir, 'index.js');

if (!fs.existsSync(indexFile)) {
indexFile = indexFile.replace(/\.js$/, '.ts');
}

browserBuild(p.split('/').pop(), indexFile, path.resolve(p, browser))
.then(() => {
process.stdout.write(adjustToTerminalWidth(`${path.basename(p)}\n`));
process.stdout.write(`${OK}\n`);
})
.catch(e => {
console.error(e);
process.exit(1);
});
}
}

function buildFile(file, silent) {
const destPath = getBuildPath(file, BUILD_DIR);

Expand Down Expand Up @@ -187,8 +152,4 @@ if (files.length) {
const packages = getPackages();
process.stdout.write(chalk.inverse(' Building packages \n'));
packages.forEach(buildNodePackage);
process.stdout.write('\n');

process.stdout.write(chalk.inverse(' Building browser packages \n'));
packages.forEach(buildBrowserPackage);
}
3 changes: 1 addition & 2 deletions tsconfig.json
Expand Up @@ -29,7 +29,6 @@
".yarn/releases/*",
"**/__tests__/**/*",
"**/__mocks__/**/*",
"**/build/**/*",
"**/build-es5/**/*"
"**/build/**/*"
]
}