Skip to content

Commit

Permalink
Rename syntax plugin for consistency with import defer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 23, 2023
1 parent be09b57 commit 1ae288e
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/helper-compilation-targets": "workspace:^",
"@babel/helper-module-imports": "workspace:^",
"@babel/helper-plugin-utils": "workspace:^",
"@babel/plugin-syntax-import-source-phase": "workspace:^"
"@babel/plugin-syntax-import-source": "workspace:^"
},
"peerDependencies": {
"@babel/core": "^7.22.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NodePath } from "@babel/traverse";
import type { types as t, File } from "@babel/core";
import { addNamed } from "@babel/helper-module-imports";
import { isRequired } from "@babel/helper-compilation-targets";
import syntaxImportSourcePhase from "@babel/plugin-syntax-import-source-phase";
import syntaxImportSourcePhase from "@babel/plugin-syntax-import-source";

// `import.meta.resolve` compat data.
// Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve#browser_compatibility
Expand Down
19 changes: 0 additions & 19 deletions packages/babel-plugin-syntax-import-source-phase/README.md

This file was deleted.

19 changes: 19 additions & 0 deletions packages/babel-plugin-syntax-import-source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @babel/plugin-syntax-import-source

> Allow parsing of the `import source` proposal.
See our website [@babel/plugin-syntax-import-source](https://babeljs.io/docs/babel-plugin-syntax-import-source) for more information.

## Install

Using npm:

```sh
npm install --save-dev @babel/plugin-syntax-import-source
```

or using yarn:

```sh
yarn add @babel/plugin-syntax-import-source --dev
```
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@babel/plugin-syntax-import-source-phase",
"name": "@babel/plugin-syntax-import-source",
"version": "7.22.5",
"description": "Allow parsing of the `import source` proposal.",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-syntax-import-source-phase"
"directory": "packages/babel-plugin-syntax-import-source"
},
"license": "MIT",
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default declare(api => {
api.assertVersion("^7.22.0");

return {
name: "syntax-import-source-phase",
name: "syntax-import-source",

manipulateOptions({ parserOpts }) {
parserOpts.plugins.push("sourcePhaseImports");
Expand Down
184 changes: 48 additions & 136 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"./packages/babel-plugin-syntax-import-attributes/src/**/*.ts",
"./packages/babel-plugin-syntax-import-defer/src/**/*.ts",
"./packages/babel-plugin-syntax-import-reflection/src/**/*.ts",
"./packages/babel-plugin-syntax-import-source-phase/src/**/*.ts",
"./packages/babel-plugin-syntax-import-source/src/**/*.ts",
"./packages/babel-plugin-syntax-jsx/src/**/*.ts",
"./packages/babel-plugin-syntax-module-blocks/src/**/*.ts",
"./packages/babel-plugin-syntax-partial-application/src/**/*.ts",
Expand Down Expand Up @@ -165,12 +165,8 @@
],
"compilerOptions": {
"paths": {
"@babel/cli": [
"./packages/babel-cli/src"
],
"@babel/code-frame": [
"./packages/babel-code-frame/src"
],
"@babel/cli": ["./packages/babel-cli/src"],
"@babel/code-frame": ["./packages/babel-code-frame/src"],
"@babel/compat-data/plugins": [
"./packages/babel-compat-data/data/plugins.json"
],
Expand All @@ -189,12 +185,8 @@
"@babel/compat-data/plugin-bugfixes": [
"./packages/babel-compat-data/data/plugin-bugfixes.json"
],
"@babel/core": [
"./packages/babel-core/src"
],
"@babel/generator": [
"./packages/babel-generator/src"
],
"@babel/core": ["./packages/babel-core/src"],
"@babel/generator": ["./packages/babel-generator/src"],
"@babel/helper-annotate-as-pure": [
"./packages/babel-helper-annotate-as-pure/src"
],
Expand All @@ -219,9 +211,7 @@
"@babel/helper-environment-visitor": [
"./packages/babel-helper-environment-visitor/src"
],
"@babel/helper-fixtures": [
"./packages/babel-helper-fixtures/src"
],
"@babel/helper-fixtures": ["./packages/babel-helper-fixtures/src"],
"@babel/helper-function-name": [
"./packages/babel-helper-function-name/src"
],
Expand Down Expand Up @@ -276,18 +266,10 @@
"@babel/helper-wrap-function": [
"./packages/babel-helper-wrap-function/src"
],
"@babel/helpers": [
"./packages/babel-helpers/src"
],
"@babel/highlight": [
"./packages/babel-highlight/src"
],
"@babel/node": [
"./packages/babel-node/src"
],
"@babel/parser": [
"./packages/babel-parser/src"
],
"@babel/helpers": ["./packages/babel-helpers/src"],
"@babel/highlight": ["./packages/babel-highlight/src"],
"@babel/node": ["./packages/babel-node/src"],
"@babel/parser": ["./packages/babel-parser/src"],
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": [
"./packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/src"
],
Expand Down Expand Up @@ -369,9 +351,7 @@
"@babel/plugin-syntax-export-default-from": [
"./packages/babel-plugin-syntax-export-default-from/src"
],
"@babel/plugin-syntax-flow": [
"./packages/babel-plugin-syntax-flow/src"
],
"@babel/plugin-syntax-flow": ["./packages/babel-plugin-syntax-flow/src"],
"@babel/plugin-syntax-function-bind": [
"./packages/babel-plugin-syntax-function-bind/src"
],
Expand All @@ -390,12 +370,10 @@
"@babel/plugin-syntax-import-reflection": [
"./packages/babel-plugin-syntax-import-reflection/src"
],
"@babel/plugin-syntax-import-source-phase": [
"./packages/babel-plugin-syntax-import-source-phase/src"
],
"@babel/plugin-syntax-jsx": [
"./packages/babel-plugin-syntax-jsx/src"
"@babel/plugin-syntax-import-source": [
"./packages/babel-plugin-syntax-import-source/src"
],
"@babel/plugin-syntax-jsx": ["./packages/babel-plugin-syntax-jsx/src"],
"@babel/plugin-syntax-module-blocks": [
"./packages/babel-plugin-syntax-module-blocks/src"
],
Expand Down Expand Up @@ -621,105 +599,57 @@
"@babel/plugin-transform-unicode-sets-regex": [
"./packages/babel-plugin-transform-unicode-sets-regex/src"
],
"@babel/preset-env": [
"./packages/babel-preset-env/src"
],
"@babel/preset-flow": [
"./packages/babel-preset-flow/src"
],
"@babel/preset-react": [
"./packages/babel-preset-react/src"
],
"@babel/preset-typescript": [
"./packages/babel-preset-typescript/src"
],
"@babel/register": [
"./packages/babel-register/src"
],
"@babel/standalone": [
"./packages/babel-standalone/src"
],
"@babel/template": [
"./packages/babel-template/src"
],
"@babel/traverse": [
"./packages/babel-traverse/src"
],
"@babel/types": [
"./packages/babel-types/src"
],
"@babel/preset-env": ["./packages/babel-preset-env/src"],
"@babel/preset-flow": ["./packages/babel-preset-flow/src"],
"@babel/preset-react": ["./packages/babel-preset-react/src"],
"@babel/preset-typescript": ["./packages/babel-preset-typescript/src"],
"@babel/register": ["./packages/babel-register/src"],
"@babel/standalone": ["./packages/babel-standalone/src"],
"@babel/template": ["./packages/babel-template/src"],
"@babel/traverse": ["./packages/babel-traverse/src"],
"@babel/types": ["./packages/babel-types/src"],
"@babel/plugin-codemod-object-assign-to-object-spread": [
"./codemods/babel-plugin-codemod-object-assign-to-object-spread/src"
],
"@babel/plugin-codemod-optional-catch-binding": [
"./codemods/babel-plugin-codemod-optional-catch-binding/src"
],
"@babel/plugin-syntax-async-functions": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-async-generators": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-bigint": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-class-properties": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-class-static-block": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-dynamic-import": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-async-functions": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-async-generators": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-bigint": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-class-properties": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-class-static-block": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-dynamic-import": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-exponentiation-operator": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-export-extensions": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-export-extensions": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-export-namespace-from": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-import-meta": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-json-strings": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-import-meta": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-json-strings": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-logical-assignment-operators": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-module-string-names": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-module-string-names": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-nullish-coalescing-operator": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-numeric-separator": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-object-rest-spread": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-numeric-separator": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-object-rest-spread": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-optional-catch-binding": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-optional-chaining": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-optional-chaining": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-private-property-in-object": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-top-level-await": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-top-level-await": ["./lib/archived-libs.d.ts"],
"@babel/plugin-syntax-trailing-function-commas": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-unicode-sets-regex": [
"./lib/archived-libs.d.ts"
],
"@babel/plugin-syntax-unicode-sets-regex": ["./lib/archived-libs.d.ts"],
"@babel/preset-modules/lib/plugins/transform-async-arrows-in-class": [
"./lib/third-party-libs.d.ts"
],
Expand All @@ -738,39 +668,21 @@
"@babel/preset-modules/lib/plugins/transform-safari-for-shadowing": [
"./lib/third-party-libs.d.ts"
],
"babel-plugin-polyfill-corejs2": [
"./lib/third-party-libs.d.ts"
],
"babel-plugin-polyfill-corejs3": [
"./lib/third-party-libs.d.ts"
],
"babel-plugin-polyfill-regenerator": [
"./lib/third-party-libs.d.ts"
],
"regenerator-transform": [
"./lib/third-party-libs.d.ts"
],
"babel-plugin-polyfill-corejs2": ["./lib/third-party-libs.d.ts"],
"babel-plugin-polyfill-corejs3": ["./lib/third-party-libs.d.ts"],
"babel-plugin-polyfill-regenerator": ["./lib/third-party-libs.d.ts"],
"regenerator-transform": ["./lib/third-party-libs.d.ts"],
"babel-plugin-dynamic-import-node/utils": [
"./lib/babel-plugin-dynamic-import-node.d.ts"
],
"globals": [
"./node_modules/globals-BABEL_8_BREAKING-true"
],
"js-tokens": [
"./node_modules/js-tokens-BABEL_8_BREAKING-true"
],
"regexpu-core": [
"./lib/regexpu-core.d.ts"
],
"globals": ["./node_modules/globals-BABEL_8_BREAKING-true"],
"js-tokens": ["./node_modules/js-tokens-BABEL_8_BREAKING-true"],
"regexpu-core": ["./lib/regexpu-core.d.ts"],
"to-fast-properties": [
"./node_modules/to-fast-properties-BABEL_8_BREAKING-true"
],
"slash": [
"./node_modules/slash-BABEL_8_BREAKING-true"
],
"kexec": [
"./lib/kexec.d.ts"
]
"slash": ["./node_modules/slash-BABEL_8_BREAKING-true"],
"kexec": ["./lib/kexec.d.ts"]
}
}
}
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ __metadata:
"@babel/helper-module-imports": "workspace:^"
"@babel/helper-plugin-test-runner": "workspace:^"
"@babel/helper-plugin-utils": "workspace:^"
"@babel/plugin-syntax-import-source-phase": "workspace:^"
"@babel/plugin-syntax-import-source": "workspace:^"
peerDependencies:
"@babel/core": ^7.22.0
languageName: unknown
Expand Down Expand Up @@ -1982,9 +1982,9 @@ __metadata:
languageName: unknown
linkType: soft

"@babel/plugin-syntax-import-source-phase@workspace:^, @babel/plugin-syntax-import-source-phase@workspace:packages/babel-plugin-syntax-import-source-phase":
"@babel/plugin-syntax-import-source@workspace:^, @babel/plugin-syntax-import-source@workspace:packages/babel-plugin-syntax-import-source":
version: 0.0.0-use.local
resolution: "@babel/plugin-syntax-import-source-phase@workspace:packages/babel-plugin-syntax-import-source-phase"
resolution: "@babel/plugin-syntax-import-source@workspace:packages/babel-plugin-syntax-import-source"
dependencies:
"@babel/core": "workspace:^"
"@babel/helper-plugin-utils": "workspace:^"
Expand Down

0 comments on commit 1ae288e

Please sign in to comment.