Skip to content

Commit

Permalink
Merge branch 'main' into clarify-warning-source
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSouthpaw committed Nov 25, 2020
2 parents 236c8a1 + 9891c02 commit 5e4591f
Show file tree
Hide file tree
Showing 2,406 changed files with 51,719 additions and 26,104 deletions.
69 changes: 39 additions & 30 deletions .circleci/config.yml
@@ -1,23 +1,13 @@
version: 2.1

aliases:
- &restore-node-modules-cache
keys:
- v1-yarn-deps-{{ checksum "yarn.lock" }}

- &restore-yarn-cache
keys:
- v1-yarn-cache

- &save-node-modules-cache
paths:
- node_modules
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
key: v2-yarn-cache-{{ checksum "yarn.lock" }}

- &save-yarn-cache
paths:
- ~/.yarn-cache
key: v1-yarn-cache
- ~/.yarn/berry/cache
key: v2-yarn-cache-{{ checksum "yarn.lock" }}

- &artifact_babel
path: ~/babel/packages/babel-standalone/babel.js
Expand Down Expand Up @@ -54,7 +44,6 @@ jobs:
steps:
- checkout
- restore_cache: *restore-yarn-cache
- restore_cache: *restore-node-modules-cache
# Builds babel-standalone with the regular Babel config
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
- run: IS_PUBLISH=true make -j build-standalone-ci
Expand All @@ -63,37 +52,37 @@ jobs:
- run: yarn jest "\-standalone/test"
- store_artifacts: *artifact_babel
- store_artifacts: *artifact_babel_min
- save_cache: *save-node-modules-cache
- save_cache: *save-yarn-cache

test262:
executor: node-executor
steps:
- checkout
- run:
name: Sync with latest master branch (only on PRs)
name: Sync with latest main branch (only on PRs)
command: |
if [ -n "$CIRCLE_PULL_REQUEST" ]
then
git fetch origin refs/pull/$CIRCLE_PR_NUMBER/merge
# $CIRCLE_PR_NUMBER is not always defined:
# https://support.circleci.com/hc/en-us/articles/360047521451-Why-is-CIRCLE-PR-NUMBER-empty-
git fetch origin refs/pull/${CIRCLE_PULL_REQUEST##*/}/merge
git checkout -qf FETCH_HEAD
fi
- restore_cache: *restore-yarn-cache
- restore_cache: *restore-node-modules-cache
- run:
name: Build Babel
command: BABEL_ENV=test make bootstrap
- run:
name: Setup Test Runner
command: |
git clone --recurse-submodules https://github.com/babel/babel-test262-runner
git clone --depth=1 --recurse-submodules https://github.com/babel/babel-test262-runner
cd babel-test262-runner
npm ci
npm i tap-mocha-reporter --save-dev
node lib/download-node
- run:
name: Download master branch Test262 artifact
command: node lib/download-master-artifact ~/master.tap
name: Download main branch Test262 artifact
command: node lib/download-main-artifact ~/test262-main.tap
<<: *test262_workdir
- run:
name: Run Test262
Expand All @@ -106,33 +95,33 @@ jobs:
cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true
<<: *test262_workdir
- run:
name: Compare previous master branch & current job results
name: Compare previous main branch & current job results
command: |
mkdir -p ~/test-results/test262
node lib/compare-results ~/master.tap ~/test262.tap | tee ~/diff.tap
node lib/compare-results ~/test262-main.tap ~/test262.tap | tee ~/diff.tap
<<: *test262_workdir
- store_artifacts: *artifact_test262_diff_tap
- run:
name: Output comparision results and report to CircleCI
name: Output comparison results and report to CircleCI
command: |
mkdir -p ~/test-results/test262
cat ~/diff.tap | $(npm bin)/tap-merge | $(npm bin)/tap-mocha-reporter xunit | tee ~/test-results/test262/results.xml
<<: *test262_workdir
- store_test_results: *artifact_test262_xunit
- save_cache: *save-node-modules-cache
- save_cache: *save-yarn-cache

publish-verdaccio:
executor: node-executor
steps:
- checkout
- run: yarn install
- restore_cache: *restore-yarn-cache
- run: ./scripts/integration-tests/publish-local.sh
- persist_to_workspace:
root: /tmp/verdaccio-workspace
paths:
- storage
- htpasswd
- save_cache: *save-yarn-cache

e2e-babel:
executor: node-executor
Expand Down Expand Up @@ -166,33 +155,51 @@ jobs:
at: /tmp/verdaccio-workspace
- run: ./scripts/integration-tests/e2e-vue-cli.sh

e2e-jest:
executor: node-executor
steps:
- checkout
- attach_workspace:
at: /tmp/verdaccio-workspace
- run: ./scripts/integration-tests/e2e-jest.sh

workflows:
version: 2
build-standalone:
jobs:
- build-standalone
test262-master:
test262:
jobs:
- test262:
filters:
branches:
only:
- master
test262:
- main
- next-8-dev
- next-8-rebased
context: babel-test262
test262-pr:
jobs:
- approve-test262-run:
type: approval
filters:
branches:
ignore:
- main
- master
- next-8-dev
- next-8-rebased
- test262:
requires:
- approve-test262-run
filters:
branches:
ignore:
- main
- master
- next-8-dev
- next-8-rebased
context: babel-test262
e2e:
jobs:
- publish-verdaccio
Expand All @@ -208,4 +215,6 @@ workflows:
- e2e-vue-cli:
requires:
- publish-verdaccio

- e2e-jest:
requires:
- publish-verdaccio
3 changes: 1 addition & 2 deletions .codesandbox/ci.json
@@ -1,6 +1,5 @@
{
"installCommand": "codesandbox",
"buildCommand": false,
"buildCommand": "codesandbox:build",
"sandboxes": ["7s08o", "vhm64"],
"packages": ["packages/*"]
}
56 changes: 44 additions & 12 deletions .eslintrc.js
@@ -1,24 +1,42 @@
"use strict";

const path = require("path");

module.exports = {
root: true,
plugins: ["prettier", "@babel/development", "import", "jest"],
// replace it by `@babel/internal` when `@babel/eslint-config-internal` is published
extends: path.resolve(__dirname, "eslint/babel-eslint-config-internal"),
plugins: [
"import",
"jest",
"prettier",
"@babel/development",
"@babel/development-internal",
],
extends: "@babel/internal",
rules: {
"prettier/prettier": "error",
// TODO: remove after babel-eslint-config-internal is fully integrated into this repository.
"max-len": "off",
},
env: {
node: true,
},
overrides: [
{
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": "error",
"no-undef": "off",
"no-redeclare": "off",
},
},
{
files: [
"packages/*/src/**/*.js",
"codemods/*/src/**/*.js",
"eslint/*/src/**/*.js",
"packages/*/src/**/*.{js,ts}",
"codemods/*/src/**/*.{js,ts}",
"eslint/*/src/**/*.{js,ts}",
],
rules: {
"@babel/development/no-undefined-identifier": "error",
Expand All @@ -32,7 +50,7 @@ module.exports = {
"packages/*/test/**/*.js",
"codemods/*/test/**/*.js",
"eslint/*/test/**/*.js",
"packages/babel-helper-transform-fixture-test-runner/src/helpers.js",
"packages/babel-helper-transform-fixture-test-runner/src/helpers.{ts,js}",
"test/**/*.js",
],
env: {
Expand All @@ -44,16 +62,30 @@ module.exports = {
"jest/no-identical-title": "off",
"jest/no-standalone-expect": "off",
"jest/no-test-callback": "off",
"jest/valid-describe": "off"
}
"jest/valid-describe": "off",
},
},
{
files: ["packages/babel-plugin-*/src/index.js"],
files: ["packages/babel-plugin-*/src/index.{js,ts}"],
excludedFiles: ["packages/babel-plugin-transform-regenerator/**/*.js"],
rules: {
"@babel/development/plugin-name": "error",
eqeqeq: ["error", "always", { null: "ignore" }],
},
},
{
files: ["packages/babel-parser/src/**/*.{js,ts}"],
rules: {
"@babel/development-internal/dry-error-messages": [
"error",
{
errorModule: path.resolve(
__dirname,
"packages/babel-parser/src/parser/error.js"
),
},
],
},
},
],
};
6 changes: 5 additions & 1 deletion .flowconfig
Expand Up @@ -16,6 +16,7 @@ lib/parser.js
lib/third-party-libs.js.flow
lib/preset-modules.js.flow
packages/babel-types/lib/index.js.flow
lib/babel-packages.js.flow

[options]
include_warnings=true
Expand All @@ -27,4 +28,7 @@ suppress_type=$FlowSubtype
esproposal.export_star_as=enable
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
module.name_mapper='^@babel\/\([a-zA-Z0-9_\-]+\)$' -> '<PROJECT_ROOT>/packages/babel-\1/src/index'
module.name_mapper='^@babel/\([a-zA-Z0-9_-]+\)$' -> '<PROJECT_ROOT>/packages/babel-\1/src/index'
; Todo: can not make it works, 🤷‍♂️
; module.name_mapper='^@babel/plugin-syntax-import-meta$' -> '<PROJECT_ROOT>/packages/babel-standalone/node_modules/@babel/plugin-syntax-import-meta/lib/index'
module.ignore_non_literal_requires=true
11 changes: 11 additions & 0 deletions .git-blame-ignore-revs
@@ -0,0 +1,11 @@
# git-blame ignored revisions
# To configure, run
# git config blame.ignoreRevsFile .git-blame-ignore-revs
# Requires Git > 2.23
# See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt

# Use prettier (#600)
5180ecdca48e486b4b0f347fcbd752f865df5e55

# Update prettier to v2 (#11579)
41085248560b1403b8d0f99f108491e679531c6c
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Expand Up @@ -14,11 +14,11 @@ assignees: ''

<!--
@babel/eslint-parser:
If you are having issues with JSX you might want to check out eslint-plugin-react. If there's an issue with new experimental syntax you might need check if it's supported by @babel/eslint-plugin.
If you are having issues with JSX you might want to check out eslint-plugin-react. If there's an issue with new experimental syntax you might need to check if it's supported by @babel/eslint-plugin.
-->

**Current behavior**
A clear and concise description of the behavior.
<!-- A clear and concise description of the behavior. -->

- [REPL](babeljs.io/repl), [Codesandbox](https://codesandbox.io/s/babel-repl-custom-plugin-7s08o?file=/src/index.js), or GitHub Repo helps!

Expand All @@ -29,7 +29,7 @@ var your => (code) => here;
```

**Expected behavior**
A clear and concise description of what you expected to happen (or code).
<!-- A clear and concise description of what you expected to happen (or code). -->

**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)**
- Filename: `babel.config.js`
Expand All @@ -55,4 +55,4 @@ A clear and concise description of what you expected to happen (or code).
<!--- If you have suggestions on a fix for the bug -->

**Additional context**
Add any other context about the problem here. Or a screenshot if applicable
<!-- Add any other context about the problem here. Or a screenshot if applicable -->
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Expand Up @@ -13,11 +13,11 @@ assignees: ''
- [ ] I would like to work on this feature!

**Is your feature request related to a problem?**
A concise description of what the problem is. Ex. I have an issue when [...]
<!-- A concise description of what the problem is. Ex. I have an issue when [...] -->

**Describe the solution you'd like**

**Describe alternatives you've considered**.

**Documentation, Adoption, Migration Strategy**
If you can, explain how users will be able to use this and how it might be documented. Maybe a mock-up?
<!-- If you can, explain how users will be able to use this and how it might be documented. Maybe a mock-up? -->
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Expand Up @@ -5,7 +5,7 @@ contact_links:
about: You may have an npm error related to proxies/caching.
- name: 🗣 Ask a Question, Discuss
url: https://github.com/babel/babel/discussions
about: How does X work 🤔? I made this! I have an idea..
about: How does X work 🤔? I made this! I have an idea...
- name: 💡 Propose an RFC
url: https://github.com/babel/rfcs
about: To suggest a new option or substantial change.
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
@@ -1,6 +1,6 @@
<!--
Before making a PR, please read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
https://github.com/babel/babel/blob/main/CONTRIBUTING.md
Please note that the Babel Team requires two approvals before merging most PRs.
Expand Down

0 comments on commit 5e4591f

Please sign in to comment.