diff --git a/packages/README.md b/packages/README.md index ecd664cd35..e972297366 100644 --- a/packages/README.md +++ b/packages/README.md @@ -3,22 +3,22 @@ A monorepo, muhahahahahaha. See the [monorepo design doc](/doc/design/monorepo.md) for reasoning. - [Core Packages](#core-packages) -- [Other](#other) +- [Other](#other) - [Presets](#presets) - [Plugins](#plugins) - [Transform Plugins](#transform-plugins) - [Syntax Plugins](#syntax-plugins) - + ### Core Packages | Package | Version | Dependencies | |--------|-------|------------| | [`babel-core`](/packages/babel-core) | [![npm](https://img.shields.io/npm/v/babel-core.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-core) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-core)](https://david-dm.org/babel/babel?path=packages/babel-core) | | [`babylon`](https://github.com/babel/babylon) | [![npm](https://img.shields.io/npm/v/babylon.svg?maxAge=2592000)](https://www.npmjs.com/package/babylon) | [![Dependency Status](https://david-dm.org/babel/babylon.svg)](https://david-dm.org/babel/babylon) | -| [`babel-traverse`](/packages/babel-traverse) | [![npm](https://img.shields.io/npm/v/babel-traverse.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-traverse) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-traverse)](https://david-dm.org/babel/babel?path=packages/babel-traverse) | -| [`babel-generator`](/packages/babel-generator) | [![npm](https://img.shields.io/npm/v/babel-generator.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-generator) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-generator)](https://david-dm.org/babel/babel?path=packages/babel-generator) | +| [`@babel/traverse`](/packages/babel-traverse) | [![npm](https://img.shields.io/npm/v/babel-traverse.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-traverse) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-traverse)](https://david-dm.org/babel/babel?path=packages/babel-traverse) | +| [`@babel/generator`](/packages/babel-generator) | [![npm](https://img.shields.io/npm/v/babel-generator.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-generator) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-generator)](https://david-dm.org/babel/babel?path=packages/babel-generator) | -[`babel-core`](/packages/babel-core) is the Babel compiler itself; it exposes the `babel.transform` method, where `transformedCode = transform(src).code`. +[`@babel/core`](/packages/babel-core) is the Babel compiler itself; it exposes the `babel.transform` method, where `transformedCode = transform(src).code`. The compiler can be broken down into 3 parts: - The parser: [`babylon`](https://github.com/babel/babylon) (moved to a separate repo and versioned independently) @@ -36,23 +36,23 @@ Check out the [`babel-handbook`](https://github.com/thejameskyle/babel-handbook/ | Package | Version | Dependencies | |--------|-------|------------| -| [`babel-cli`](/packages/babel-cli) | [![npm](https://img.shields.io/npm/v/babel-cli.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-cli) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-cli)](https://david-dm.org/babel/babel?path=packages/babel-cli) | -| [`babel-types`](/packages/babel-types) | [![npm](https://img.shields.io/npm/v/babel-types.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-types) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-types)](https://david-dm.org/babel/babel?path=packages/babel-types) | -| [`babel-polyfill`](/packages/babel-polyfill) | [![npm](https://img.shields.io/npm/v/babel-polyfill.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-polyfill) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-polyfill)](https://david-dm.org/babel/babel?path=packages/babel-polyfill) | -| [`babel-runtime`](/packages/babel-runtime) | [![npm](https://img.shields.io/npm/v/babel-runtime.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-runtime) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-runtime)](https://david-dm.org/babel/babel?path=packages/babel-runtime) | -| [`babel-register`](/packages/babel-register) | [![npm](https://img.shields.io/npm/v/babel-register.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-register) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-register)](https://david-dm.org/babel/babel?path=packages/babel-register) | -| [`babel-template`](/packages/babel-template) | [![npm](https://img.shields.io/npm/v/babel-template.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-template) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-template)](https://david-dm.org/babel/babel?path=packages/babel-template) | -| [`babel-helpers`](/packages/babel-helpers) | [![npm](https://img.shields.io/npm/v/babel-helpers.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-helpers) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-helpers)](https://david-dm.org/babel/babel?path=packages/babel-helpers) | -| [`babel-code-frame`](/packages/babel-code-frame) | [![npm](https://img.shields.io/npm/v/babel-code-frame.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-code-frame) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-code-frame)](https://david-dm.org/babel/babel?path=packages/babel-code-frame) | +| [`@babel/cli`](/packages/babel-cli) | [![npm](https://img.shields.io/npm/v/babel-cli.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-cli) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-cli)](https://david-dm.org/babel/babel?path=packages/babel-cli) | +| [`@babel/types`](/packages/babel-types) | [![npm](https://img.shields.io/npm/v/babel-types.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-types) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-types)](https://david-dm.org/babel/babel?path=packages/babel-types) | +| [`@babel/polyfill`](/packages/babel-polyfill) | [![npm](https://img.shields.io/npm/v/babel-polyfill.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-polyfill) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-polyfill)](https://david-dm.org/babel/babel?path=packages/babel-polyfill) | +| [`@babel/runtime`](/packages/babel-runtime) | [![npm](https://img.shields.io/npm/v/babel-runtime.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-runtime) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-runtime)](https://david-dm.org/babel/babel?path=packages/babel-runtime) | +| [`@babel/register`](/packages/babel-register) | [![npm](https://img.shields.io/npm/v/babel-register.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-register) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-register)](https://david-dm.org/babel/babel?path=packages/babel-register) | +| [`@babel/template`](/packages/babel-template) | [![npm](https://img.shields.io/npm/v/babel-template.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-template) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-template)](https://david-dm.org/babel/babel?path=packages/babel-template) | +| [`@babel/helpers`](/packages/babel-helpers) | [![npm](https://img.shields.io/npm/v/babel-helpers.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-helpers) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-helpers)](https://david-dm.org/babel/babel?path=packages/babel-helpers) | +| [`@babel/code-frame`](/packages/babel-code-frame) | [![npm](https://img.shields.io/npm/v/babel-code-frame.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-code-frame) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-code-frame)](https://david-dm.org/babel/babel?path=packages/babel-code-frame) | -- [`babel-cli`](/packages/babel-cli) is the CLI tool that runs `babel-core` and helps with outputting to a directory, a file, stdout and more (also includes `babel-node`). Check out the [docs](https://babeljs.io/docs/usage/cli/). -- [`babel-types`](/packages/babel-types) is used to validate, build and change AST nodes. -- [`babel-polyfill`](/packages/babel-polyfill) is [literally a wrapper](https://github.com/babel/babel/blob/master/packages/babel-polyfill/src/index.js) around [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime). Check out the [docs](https://babeljs.io/docs/usage/polyfill/). -- [`babel-runtime`](/packages/babel-runtime) is similar to the polyfill except that it doesn't modify the global scope and is to be used with [`babel-plugin-transform-runtime`](/packages/babel-plugin-transform-runtime) (usually in library/plugin code). Check out the [docs](https://babeljs.io/docs/plugins/transform-runtime/). -- [`babel-register`](/packages/babel-register) is a way to automatically compile files with Babel on the fly by binding to Node.js `require`. Check out the [docs](http://babeljs.io/docs/usage/require/). -- [`babel-template`](/packages/babel-template) is a helper function that allows constructing AST nodes from a string presentation of the code; this eliminates the tedium of using `babel-types` for building AST nodes. -- [`babel-helpers`](/packages/babel-helpers) is a set of pre-made `babel-template` functions that are used in some Babel plugins. -- [`babel-code-frame`](/packages/babel-code-frame) is a standalone package used to generate errors that print the source code and point to error locations. +- [`@babel/cli`](/packages/babel-cli) is the CLI tool that runs `@babel/core` and helps with outputting to a directory, a file, stdout and more (also includes `babel-node`). Check out the [docs](https://babeljs.io/docs/usage/cli/). +- [`@babel/types`](/packages/babel-types) is used to validate, build and change AST nodes. +- [`@babel/polyfill`](/packages/babel-polyfill) is [literally a wrapper](https://github.com/babel/babel/blob/master/packages/babel-polyfill/src/index.js) around [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime). Check out the [docs](https://babeljs.io/docs/usage/polyfill/). +- [`@babel/runtime`](/packages/babel-runtime) is similar to the polyfill except that it doesn't modify the global scope and is to be used with [`@babel/plugin-transform-runtime`](/packages/babel-plugin-transform-runtime) (usually in library/plugin code). Check out the [docs](https://babeljs.io/docs/plugins/transform-runtime/). +- [`@babel/register`](/packages/babel-register) is a way to automatically compile files with Babel on the fly by binding to Node.js `require`. Check out the [docs](http://babeljs.io/docs/usage/require/). +- [`@babel/template`](/packages/babel-template) is a helper function that allows constructing AST nodes from a string presentation of the code; this eliminates the tedium of using `@babel/types` for building AST nodes. +- [`@babel/helpers`](/packages/babel-helpers) is a set of pre-made `@babel/template` functions that are used in some Babel plugins. +- [`@babel/code-frame`](/packages/babel-code-frame) is a standalone package used to generate errors that print the source code and point to error locations. ### [Presets](http://babeljs.io/docs/plugins/#presets) @@ -62,7 +62,7 @@ The transformer[s] used in Babel are the independent pieces of code that transfo | Package | Version | Dependencies | Description | |--------|-------|------------|---| -| [`babel-preset-env`](https://github.com/babel/babel-preset-env) | [![npm](https://img.shields.io/npm/v/babel-preset-env.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-env) | [![Dependency Status](https://david-dm.org/babel/babel-preset-env.svg)](https://david-dm.org/babel/babel-preset-env) | automatically determines plugins and polyfills you need based on your supported environments | +| [`@babel/preset-env`](https://github.com/babel/babel-preset-env) | [![npm](https://img.shields.io/npm/v/babel-preset-env.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-env) | [![Dependency Status](https://david-dm.org/babel/babel-preset-env.svg)](https://david-dm.org/babel/babel-preset-env) | automatically determines plugins and polyfills you need based on your supported environments | > You can find community maintained presets on [npm](https://www.npmjs.com/search?q=babel-preset) @@ -78,8 +78,8 @@ There are many kinds of plugins: ones that convert ES6/ES2015 to ES5, transform #### Syntax Plugins -These just enable the transform plugins to be able to parse certain features (the transform plugins already include the syntax plugins so you don't need both): `babel-plugin-syntax-x`. Check out our [website for more](http://babeljs.io/docs/plugins/#syntax-plugins). +These just enable the transform plugins to be able to parse certain features (the transform plugins already include the syntax plugins so you don't need both): `@babel/plugin-syntax-x`. Check out our [website for more](http://babeljs.io/docs/plugins/#syntax-plugins). ### Helpers -These are mostly for internal use in various plugins: `babel-helper-x`. +These are mostly for internal use in various plugins: `@babel/helper-x`. diff --git a/packages/babel-cli/README.md b/packages/babel-cli/README.md index ecacbd4d71..8d01bcf8ef 100644 --- a/packages/babel-cli/README.md +++ b/packages/babel-cli/README.md @@ -2,7 +2,7 @@ > Babel command line. -In addition, various entry point scripts live in the top-level package at `babel-cli/bin`. +In addition, various entry point scripts live in the top-level package at `@babel/cli/bin`. There are some shell-executable utility scripts, `babel-external-helpers.js` and `babel-node.js`, and the main Babel cli script, `babel.js`. diff --git a/packages/babel-cli/bin/babel-doctor.js b/packages/babel-cli/bin/babel-doctor.js deleted file mode 100644 index d3d0a3ec96..0000000000 --- a/packages/babel-cli/bin/babel-doctor.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -throw new Error("babel-doctor has been removed."); diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 79cd344c3d..285d58faa4 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -33,7 +33,6 @@ "@babel/helper-fixtures": "7.0.0-beta.3" }, "bin": { - "babel-doctor": "./bin/babel-doctor.js", "babel": "./bin/babel.js", "babel-external-helpers": "./bin/babel-external-helpers.js" } diff --git a/packages/babel-cli/src/babel/index.js b/packages/babel-cli/src/babel/index.js index d04db15816..530501e926 100755 --- a/packages/babel-cli/src/babel/index.js +++ b/packages/babel-cli/src/babel/index.js @@ -123,7 +123,7 @@ commander.option( "specify a custom name for module ids", ); -// "babel" command specific arguments that are not passed to babel-core. +// "babel" command specific arguments that are not passed to @babel/core. commander.option( "-x, --extensions [extensions]", "List of extensions to compile when a directory has been input [.es6,.js,.es,.jsx,.mjs]", @@ -165,7 +165,7 @@ commander.option( ); /* eslint-enable max-len */ -commander.version(pkg.version + " (babel-core " + version + ")"); +commander.version(pkg.version + " (@babel/core " + version + ")"); commander.usage("[options] "); commander.parse(process.argv); @@ -229,7 +229,7 @@ if (opts.configFile) { opts.extends = opts.configFile; } -// Delete options that are specific to babel-cli and shouldn't be passed to babel-core. +// Delete options that are specific to @babel/cli and shouldn't be passed to @babel/core. delete opts.version; delete opts.extensions; delete opts.watch; @@ -244,7 +244,7 @@ delete opts.deleteDirOnStart; delete opts.keepFileExtension; // Commander will default the "--no-" arguments to true, but we want to leave them undefined so that -// babel-core can handle the default-assignment logic on its own. +// @babel/core can handle the default-assignment logic on its own. if (opts.babelrc === true) opts.babelrc = undefined; if (opts.comments === true) opts.comments = undefined; if (opts.highlightCode === true) opts.highlightCode = undefined; diff --git a/packages/babel-code-frame/src/index.js b/packages/babel-code-frame/src/index.js index dbb082c729..61b52e0d66 100644 --- a/packages/babel-code-frame/src/index.js +++ b/packages/babel-code-frame/src/index.js @@ -251,7 +251,7 @@ export default function( deprecationWarningShown = true; const deprecationError = new Error( - "Passing lineNumber and colNumber is deprecated to babel-code-frame. Please use `codeFrameColumns`.", + "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.", ); deprecationError.name = "DeprecationWarning"; diff --git a/packages/babel-core/README.md b/packages/babel-core/README.md index 736498238f..a845fbfdd7 100644 --- a/packages/babel-core/README.md +++ b/packages/babel-core/README.md @@ -97,7 +97,7 @@ Following is a table of the options you can use: | `extends` | `null` | A path to a `.babelrc` file to extend | | `filename` | `"unknown"` | Filename for use in errors etc | | `filenameRelative` | `(filename)` | Filename relative to `sourceRoot` | -| `generatorOpts` | `{}` | An object containing the options to be passed down to the babel code generator, babel-generator | +| `generatorOpts` | `{}` | An object containing the options to be passed down to the babel code generator, @babel/generator | | `getModuleId` | `null` | Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used | | `highlightCode` | `true` | ANSI highlight syntax error code frames | | `ignore` | `null` | Opposite to the `only` option. `ignore` is disregarded if `only` is specified | diff --git a/packages/babel-core/src/config/loading/files/configuration.js b/packages/babel-core/src/config/loading/files/configuration.js index 09bd840230..f014c7c99e 100644 --- a/packages/babel-core/src/config/loading/files/configuration.js +++ b/packages/babel-core/src/config/loading/files/configuration.js @@ -106,7 +106,7 @@ const readConfigJS = makeStrongCache((filepath, cache) => { return null; } - // The `require()` call below can make this code reentrant if a require hook like babel-register has been + // The `require()` call below can make this code reentrant if a require hook like @babel/register has been // loaded into the system. That would cause Babel to attempt to compile the `.babelrc.js` file as it loads // below. To cover this case, we auto-ignore re-entrant config processing. if (LOADING_CONFIGS.has(filepath)) { diff --git a/packages/babel-core/src/config/removed.js b/packages/babel-core/src/config/removed.js index e4205bf31e..09885afec3 100644 --- a/packages/babel-core/src/config/removed.js +++ b/packages/babel-core/src/config/removed.js @@ -25,9 +25,6 @@ export default { message: "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/", }, - // "keepModuleIdExtensions": { - // "message": "" - // }, loose: { message: "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option.", diff --git a/packages/babel-core/src/index.js b/packages/babel-core/src/index.js index 1b50fefbc1..6a7ae92adc 100644 --- a/packages/babel-core/src/index.js +++ b/packages/babel-core/src/index.js @@ -39,8 +39,8 @@ export { default as transformFile } from "./transform-file"; export { default as transformFileSync } from "./transform-file-sync"; /** - * Recommended set of compilable extensions. Not used in babel-core directly, but meant as - * as an easy source for tooling making use of babel-core. + * Recommended set of compilable extensions. Not used in @babel/core directly, but meant as + * as an easy source for tooling making use of @babel/core. */ export const DEFAULT_EXTENSIONS = Object.freeze([ ".js", diff --git a/packages/babel-core/src/transformation/block-hoist-plugin.js b/packages/babel-core/src/transformation/block-hoist-plugin.js index d79301672a..aa9b30031b 100644 --- a/packages/babel-core/src/transformation/block-hoist-plugin.js +++ b/packages/babel-core/src/transformation/block-hoist-plugin.js @@ -9,7 +9,7 @@ let LOADED_PLUGIN: Plugin | void; export default function loadBlockHoistPlugin(): Plugin { if (!LOADED_PLUGIN) { // Lazy-init the internal plugin to remove the init-time circular - // dependency between plugins being passed babel-core's export object, + // dependency between plugins being passed @babel/core's export object, // which loads this file, and this 'loadConfig' loading plugins. const config = loadConfig({ babelrc: false, diff --git a/packages/babel-generator/test/generate-typescript-tests.js b/packages/babel-generator/test/generate-typescript-tests.js index 8ebe7d4699..b7a3219726 100644 --- a/packages/babel-generator/test/generate-typescript-tests.js +++ b/packages/babel-generator/test/generate-typescript-tests.js @@ -1,5 +1,5 @@ /* -Copies tests from babylon's TypeScript test suite to babel-generator. +Copies tests from babylon's TypeScript test suite to @babel/generator. This script assumes that the "babylon" repository is adjacent to "babel". */ diff --git a/packages/babel-helper-annotate-as-pure/README.md b/packages/babel-helper-annotate-as-pure/README.md index 19c5f0355b..2e8d9642f7 100644 --- a/packages/babel-helper-annotate-as-pure/README.md +++ b/packages/babel-helper-annotate-as-pure/README.md @@ -23,7 +23,7 @@ traverse(file, { ## Caveat with UglifyJS pre v3.1.0 -`babel-helper-annotate-as-pure` will append any existing leading comments to the `#__PURE__` annotation. Versions of UglifyJS prior to v3.1.0 will **ignore** these annotations, as they only check the _last_ leading comment for the annotation. +`@babel/helper-annotate-as-pure` will append any existing leading comments to the `#__PURE__` annotation. Versions of UglifyJS prior to v3.1.0 will **ignore** these annotations, as they only check the _last_ leading comment for the annotation. For example, using the `Usage` snippet above: diff --git a/packages/babel-helper-module-imports/README.md b/packages/babel-helper-module-imports/README.md index d65f0db9c2..93c134d0fb 100644 --- a/packages/babel-helper-module-imports/README.md +++ b/packages/babel-helper-module-imports/README.md @@ -3,7 +3,7 @@ ## Installation ```sh -npm install babel-helper-module-imports --save +npm install @babel/helper-module-imports --save ``` ## Usage diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 2c04fdcef4..285fcb814b 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,7 +1,7 @@ { "name": "@babel/helper-transform-fixture-test-runner", "version": "7.0.0-beta.3", - "description": "Transform test runner for babel-helper-fixtures module", + "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index 8a873a9937..06586688a0 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -44,7 +44,7 @@ runModuleInTestContext("@babel/polyfill", __filename); runCodeInTestContext(buildExternalHelpers()); /** - * A basic implementation of CommonJS so we can execute `babel-polyfill` inside our test context. + * A basic implementation of CommonJS so we can execute `@babel/polyfill` inside our test context. * This allows us to run our unittests */ function runModuleInTestContext(id: string, relativeFilename: string) { diff --git a/packages/babel-helpers/README.md b/packages/babel-helpers/README.md index cc93021eed..ce5288bf9b 100644 --- a/packages/babel-helpers/README.md +++ b/packages/babel-helpers/README.md @@ -5,7 +5,7 @@ ## Install ```sh -npm install --save-dev babel-helpers +npm install --save-dev @babel/helpers ``` ## Usage diff --git a/packages/babel-node/README.md b/packages/babel-node/README.md index 2a7407eefb..9abc418ba1 100644 --- a/packages/babel-node/README.md +++ b/packages/babel-node/README.md @@ -7,7 +7,7 @@ babel-node is a CLI that works exactly the same as the Node.js CLI, with the add ## Install ```sh -npm install --save-dev babel-node +npm install --save-dev @babel/node ``` ## Usage diff --git a/packages/babel-plugin-check-es2015-constants/README.md b/packages/babel-plugin-check-es2015-constants/README.md index 12e25d554d..abb52649b7 100644 --- a/packages/babel-plugin-check-es2015-constants/README.md +++ b/packages/babel-plugin-check-es2015-constants/README.md @@ -24,7 +24,7 @@ repl: "a" is read-only ## Installation ```sh -npm install --save-dev babel-plugin-check-es2015-constants +npm install --save-dev @babel/plugin-check-es2015-constants ``` ## Usage diff --git a/packages/babel-plugin-external-helpers/README.md b/packages/babel-plugin-external-helpers/README.md index 6964497970..41052fad86 100644 --- a/packages/babel-plugin-external-helpers/README.md +++ b/packages/babel-plugin-external-helpers/README.md @@ -3,7 +3,7 @@ ## Installation ```sh -npm install --save-dev babel-plugin-external-helpers +npm install --save-dev @babel/plugin-external-helpers ``` ## Usage diff --git a/packages/babel-plugin-transform-numeric-separator/README.md b/packages/babel-plugin-transform-numeric-separator/README.md index 32b97a4d0d..cddad03806 100644 --- a/packages/babel-plugin-transform-numeric-separator/README.md +++ b/packages/babel-plugin-transform-numeric-separator/README.md @@ -93,7 +93,7 @@ require("@babel/core").transform("code", { If you need to further compile ES2015 Decimal, Binary, Hex and Octal number representations to their pre-ES2015 numeric literal form, add the [`"transform-es2015-literals"`](http://babeljs.io/docs/plugins/transform-es2015-literals/) plugin: -> `transform-es2015-literals` is already included in [babel-preset-env](https://github.com/babel/babel-preset-env) and babel-preset-es2015. +> `transform-es2015-literals` is already included in [@babel/preset-env](https://github.com/babel/babel/tree/master/experimental/babel-preset-env) and @babel/preset-es2015. ### Via `.babelrc` (Recommended) diff --git a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/README.md b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/README.md index a7e6730c55..5823c2089c 100644 --- a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/README.md +++ b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/README.md @@ -2,7 +2,7 @@ > This plugin will transform all `Object.setPrototypeOf` calls to a method that will do a shallow defaults of all properties. -**NOTE:** There are some caveats when using this plugin, see the [`babel-plugin-transform-proto-to-assign` README](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-proto-to-assign) for more information.. +**NOTE:** There are some caveats when using this plugin, see the [`@babel/plugin-transform-proto-to-assign` README](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-proto-to-assign) for more information. ## Example diff --git a/packages/babel-plugin-transform-react-inline-elements/README.md b/packages/babel-plugin-transform-react-inline-elements/README.md index e9b3919a22..3b270fa1c5 100644 --- a/packages/babel-plugin-transform-react-inline-elements/README.md +++ b/packages/babel-plugin-transform-react-inline-elements/README.md @@ -8,7 +8,7 @@ When used alongside `transform-runtime`, polyfills (by default including `Symbol Even if `['transform-runtime', { helpers: true, polyfill: false }]` is specified, it might still break, since `helpers` come precompiled. -In this case, we recommend importing/requiring `babel-polyfill` in the entry point of your application and using `babel-preset-env` with the `useBuiltIns` option to only include the polyfills your targets need. Alternatively, you can also import/require `core-js/modules/es6.symbol` by itself. +In this case, we recommend importing/requiring `@babel/polyfill` in the entry point of your application and using `@babel/preset-env` with the `useBuiltIns` option to only include the polyfills your targets need. Alternatively, you can also import/require `core-js/modules/es6.symbol` by itself. This transform **should be enabled only in production** (e.g., just before minifying your code) because, although it improves runtime performance, it makes warning messages more cryptic and skips important checks that happen in development mode, including propTypes. diff --git a/packages/babel-plugin-transform-runtime/README.md b/packages/babel-plugin-transform-runtime/README.md index c4b4f2ab3d..e33f807f8e 100644 --- a/packages/babel-plugin-transform-runtime/README.md +++ b/packages/babel-plugin-transform-runtime/README.md @@ -2,15 +2,15 @@ > Externalise references to helpers and built-ins, automatically polyfilling your code without polluting globals. (This plugin is recommended in a library/tool) -NOTE: Instance methods such as `"foobar".includes("foo")` will not work since that would require modification of existing built-ins (Use [`babel-polyfill`](http://babeljs.io/docs/usage/polyfill) for that). +NOTE: Instance methods such as `"foobar".includes("foo")` will not work since that would require modification of existing built-ins (Use [`@babel/polyfill`](http://babeljs.io/docs/usage/polyfill) for that). ## Why? Babel uses very small helpers for common functions such as `_extend`. By default this will be added to every file that requires it. This duplication is sometimes unnecessary, especially when your application is spread out over multiple files. -This is where the `transform-runtime` plugin comes in: all of the helpers will reference the module `babel-runtime` to avoid duplication across your compiled output. The runtime will be compiled into your build. +This is where the `transform-runtime` plugin comes in: all of the helpers will reference the module `@babel/runtime` to avoid duplication across your compiled output. The runtime will be compiled into your build. -Another purpose of this transformer is to create a sandboxed environment for your code. If you use [babel-polyfill](http://babeljs.io/docs/usage/polyfill/) and the built-ins it provides such as `Promise`, `Set` and `Map`, those will pollute the global scope. While this might be ok for an app or a command line tool, it becomes a problem if your code is a library which you intend to publish for others to use or if you can't exactly control the environment in which your code will run. +Another purpose of this transformer is to create a sandboxed environment for your code. If you use [@babel/polyfill](http://babeljs.io/docs/usage/polyfill/) and the built-ins it provides such as `Promise`, `Set` and `Map`, those will pollute the global scope. While this might be ok for an app or a command line tool, it becomes a problem if your code is a library which you intend to publish for others to use or if you can't exactly control the environment in which your code will run. The transformer will alias these built-ins to `core-js` so you can use them seamlessly without having to require the polyfill. @@ -20,16 +20,16 @@ See the [technical details](#technical-details) section for more information on **NOTE - Production vs. development dependencies** -In most cases, you should install `babel-plugin-transform-runtime` as a development dependency (with `--save-dev`). +In most cases, you should install `@babel/plugin-transform-runtime` as a development dependency (with `--save-dev`). ```sh npm install --save-dev @babel/plugin-transform-runtime ``` -and `babel-runtime` as a production dependency (with `--save`). +and `@babel/runtime` as a production dependency (with `--save`). ```sh -npm install --save babel-runtime +npm install --save @babel/runtime ``` The transformation plugin is typically used only in development, but the runtime itself will be depended on by your deployed/published code. See the examples below for more details. @@ -105,7 +105,7 @@ For more information, see [Regenerator aliasing](#regenerator-aliasing). ### `moduleName` -`string`, defaults to `"babel-runtime"`. +`string`, defaults to `"@babel/runtime"`. Sets the name/path of the module used when importing helpers. @@ -200,13 +200,13 @@ export default function (instance, Constructor) { The `runtime` transformer plugin does three things: -* Automatically requires `babel-runtime/regenerator` when you use generators/async functions. -* Automatically requires `babel-runtime/core-js` and maps ES6 static methods and built-ins. -* Removes the inline Babel helpers and uses the module `babel-runtime/helpers` instead. +* Automatically requires `@babel/runtime/regenerator` when you use generators/async functions. +* Automatically requires `@babel/runtime/core-js` and maps ES6 static methods and built-ins. +* Removes the inline Babel helpers and uses the module `@babel/runtime/helpers` instead. What does this actually mean though? Basically, you can use built-ins such as `Promise`, `Set`, `Symbol`, etc., as well use all the Babel features that require a polyfill seamlessly, without global pollution, making it extremely suitable for libraries. -Make sure you include `babel-runtime` as a dependency. +Make sure you include `@babel/runtime` as a dependency. ### Regenerator aliasing diff --git a/packages/babel-plugin-transform-strict-mode/README.md b/packages/babel-plugin-transform-strict-mode/README.md index 273394280e..e48127d6a7 100644 --- a/packages/babel-plugin-transform-strict-mode/README.md +++ b/packages/babel-plugin-transform-strict-mode/README.md @@ -2,7 +2,7 @@ > This plugin places a `"use strict";` directive at the top of all files to enable [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode). -This plugin may be enabled via `babel-plugin-transform-es2015-modules-commonjs`. +This plugin may be enabled via `@babel/plugin-transform-es2015-modules-commonjs`. If you wish to disable it you can either turn `strict` off or pass `strictMode: false` as an option to the commonjs transform. diff --git a/packages/babel-polyfill/src/index.js b/packages/babel-polyfill/src/index.js index 943e349060..f4057ecb6a 100644 --- a/packages/babel-polyfill/src/index.js +++ b/packages/babel-polyfill/src/index.js @@ -1,5 +1,5 @@ if (global._babelPolyfill) { - throw new Error("only one instance of babel-polyfill is allowed"); + throw new Error("only one instance of @babel/polyfill is allowed"); } global._babelPolyfill = true; diff --git a/packages/babel-preset-react/README.md b/packages/babel-preset-react/README.md index a6e26dad0d..38c3541e92 100644 --- a/packages/babel-preset-react/README.md +++ b/packages/babel-preset-react/README.md @@ -77,7 +77,7 @@ require("@babel/core").transform("code", { `boolean`, defaults to `false`. -Toggles plugins that aid in development, such as [`babel-plugin-transform-react-jsx-self`](https://babeljs.io/docs/plugins/transform-react-jsx-self/) and [`babel-plugin-transform-react-jsx-source`](https://babeljs.io/docs/plugins/transform-react-jsx-source/). +Toggles plugins that aid in development, such as [`@babel/plugin-transform-react-jsx-self`](https://babeljs.io/docs/plugins/transform-react-jsx-self/) and [`@babel/plugin-transform-react-jsx-source`](https://babeljs.io/docs/plugins/transform-react-jsx-source/). This is useful when combined with either a `babelrc.js` or [env option in a .babelrc](https://babeljs.io/docs/usage/babelrc/#env-option) configuration: diff --git a/packages/babel-register/README.md b/packages/babel-register/README.md index e9b3876855..049f9da62b 100644 --- a/packages/babel-register/README.md +++ b/packages/babel-register/README.md @@ -79,7 +79,7 @@ to each file still applies, and takes precedence over any options you pass in he ## Environment variables -By default `babel-node` and `babel-register` will save to a json cache in your +By default `babel-node` and `@babel/register` will save to a json cache in your temporary directory. This will heavily improve with the startup and compilation of your files. There diff --git a/packages/babel-runtime/scripts/build-dist.js b/packages/babel-runtime/scripts/build-dist.js index 51553b749f..54f309907d 100644 --- a/packages/babel-runtime/scripts/build-dist.js +++ b/packages/babel-runtime/scripts/build-dist.js @@ -63,7 +63,7 @@ function adjustImportPath(node, relativePath) { if (helpers.list.indexOf(node.value) >= 0) { node.value = `./${node.value}`; } else { - node.value = node.value.replace(/^babel-runtime/, relativePath) + node.value = node.value.replace(/^@babel\/runtime/, relativePath); } } @@ -91,7 +91,7 @@ function buildRuntimeRewritePlugin(relativePath, helperName, dependencies) { return; } - // replace any reference to babel-runtime and other helpers + // replace any reference to @babel/runtime and other helpers // with a relative path adjustImportPath(path.get("arguments")[0].node, relativePath); }, diff --git a/packages/babel-standalone/README.md b/packages/babel-standalone/README.md index ced004a500..81681ef825 100644 --- a/packages/babel-standalone/README.md +++ b/packages/babel-standalone/README.md @@ -1,12 +1,12 @@ -babel-standalone +@babel/standalone ================ -babel-standalone is a standalone build of Babel for use in non-Node.js environments, including browsers. It's bundled with all the standard Babel plugins and presets, and [a build of babili (babel-minify)](http://dl.vc/babili-standalone) is optionally available too. +@babel/standalone is a standalone build of Babel for use in non-Node.js environments, including browsers. It's bundled with all the standard Babel plugins and presets, and [a build of babili (babel-minify)](http://dl.vc/babili-standalone) is optionally available too. But why?! ========= -It's true that using Babel through Webpack, Browserify or Gulp should be sufficient for most use cases. However, there are some valid use cases for babel-standalone: +It's true that using Babel through Webpack, Browserify or Gulp should be sufficient for most use cases. However, there are some valid use cases for @babel/standalone: - Sites like [JSFiddle](https://jsfiddle.net/), [JS Bin](https://jsbin.com/), the [REPL on the Babel site](http://babeljs.io/repl/), etc. These sites compile user-provided JavaScript in real-time. - Apps that embed a JavaScript engine such as V8 directly, and want to use Babel for compilation @@ -16,11 +16,11 @@ It's true that using Babel through Webpack, Browserify or Gulp should be suffici Installation ============ -There are several ways to get a copy of babel-standalone. Pick whichever one you like: +There are several ways to get a copy of @babel/standalone. Pick whichever one you like: -- Use it via UNPKG: https://unpkg.com/babel-standalone@6/babel.min.js. This is a simple way to embed it on a webpage without having to do any other setup. -- Install via Bower: `bower install babel-standalone` -- Install via NPM: `npm install --save babel-standalone` +- Use it via UNPKG: https://unpkg.com/@babel/standalone@6/babel.min.js. This is a simple way to embed it on a webpage without having to do any other setup. +- Install via Bower: `bower install @babel/standalone` +- Install via NPM: `npm install --save @babel/standalone` - Manually grab `babel.js` and/or `babel.min.js` from the [GitHub releases page](https://github.com/Daniel15/babel-standalone/releases). Every release includes these files. - Install it via Git: You can use the repo at https://github.com/Daniel15/babel-standalone-bower to pull a prebuilt version from Git. Note that this is generally only advised for systems that *must* pull artifacts from Git, such as Bower. @@ -34,11 +34,11 @@ var input = 'const getMessage = () => "Hello World";'; var output = Babel.transform(input, { presets: ['es2015'] }).code; ``` -When loaded in a browser, babel-standalone will automatically compile and execute all script tags with type `text/babel` or `text/jsx`: +When loaded in a browser, @babel/standalone will automatically compile and execute all script tags with type `text/babel` or `text/jsx`: ```html
- + ``` -Note that `.babelrc` doesn't work in babel-standalone, as no file system access is available. The presets and/or plugins to use **must** be specified in the options passed to `Babel.transform`. +Note that `.babelrc` doesn't work in @babel/standalone, as no file system access is available. The presets and/or plugins to use **must** be specified in the options passed to `Babel.transform`. Customisation ============= diff --git a/packages/babel-standalone/test/babel.js b/packages/babel-standalone/test/babel.js index 4d8911fc93..3197856d5f 100644 --- a/packages/babel-standalone/test/babel.js +++ b/packages/babel-standalone/test/babel.js @@ -1,7 +1,7 @@ const assert = require("assert"); const Babel = require("../babel"); -// Basic smoke tests for babel-standalone +// Basic smoke tests for @babel/standalone describe("@babel/standalone", () => { it("handles the es2015-no-commonjs preset", () => { const output = Babel.transform('const getMessage = () => "Hello World"', { diff --git a/packages/babel-template/README.md b/packages/babel-template/README.md index da7a6449e5..cfc16cf5d4 100644 --- a/packages/babel-template/README.md +++ b/packages/babel-template/README.md @@ -43,7 +43,7 @@ Type: `string` #### options -`babel-template` accepts all of the options from [babylon], and specifies +`@babel/template` accepts all of the options from [babylon], and specifies some defaults of its own: * `allowReturnOutsideFunction` is set to `true` by default. @@ -58,7 +58,7 @@ Set this to `true` to preserve any comments from the `code` parameter. #### Return value -`babel-template` returns a `function` which is invoked with an optional object +`@babel/template` returns a `function` which is invoked with an optional object of replacements. See the usage section for an example. [babylon]: https://github.com/babel/babylon#options diff --git a/packages/babel-traverse/README.md b/packages/babel-traverse/README.md index 8be9508999..a25ffe70a5 100644 --- a/packages/babel-traverse/README.md +++ b/packages/babel-traverse/README.md @@ -1,6 +1,6 @@ # @babel/traverse -> babel-traverse maintains the overall tree state, and is responsible for replacing, removing, and adding nodes. +> @babel/traverse maintains the overall tree state, and is responsible for replacing, removing, and adding nodes. ## Install diff --git a/packages/babel-traverse/src/visitors.js b/packages/babel-traverse/src/visitors.js index c95de368fa..fd8a8ece29 100644 --- a/packages/babel-traverse/src/visitors.js +++ b/packages/babel-traverse/src/visitors.js @@ -10,7 +10,7 @@ import clone from "lodash/clone"; * The various shorthands are: * * `Identifier() { ... }` -> `Identifier: { enter() { ... } }` * * `"Identifier|NumericLiteral": { ... }` -> `Identifier: { ... }, NumericLiteral: { ... }` - * * Aliases in `babel-types`: e.g. `Property: { ... }` -> `ObjectProperty: { ... }, ClassProperty: { ... }` + * * Aliases in `@babel/types`: e.g. `Property: { ... }` -> `ObjectProperty: { ... }, ClassProperty: { ... }` * * Other normalizations are: * * Visitors of virtual types are wrapped, so that they are only visited when diff --git a/packages/babel-types/src/definitions/core.js b/packages/babel-types/src/definitions/core.js index 4953fc0ca2..004e21fb40 100644 --- a/packages/babel-types/src/definitions/core.js +++ b/packages/babel-types/src/definitions/core.js @@ -351,7 +351,7 @@ defineType("FunctionExpression", { export const patternLikeCommon = { typeAnnotation: { - // TODO: babel-plugin-transform-flow-comments puts a Noop here, is there a better way? + // TODO: @babel/plugin-transform-flow-comments puts a Noop here, is there a better way? validate: assertNodeType("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true, },