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

Use full relative paths to plugins in tests #14680

Merged
merged 1 commit into from Jun 20, 2022
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
Expand Up @@ -16,12 +16,12 @@ config <CWD>/.babelrc
programmatic options from @babel/cli
{
"presets": [
"<ROOTDIR>//packages//babel-preset-react"
"<ROOTDIR>//packages//babel-preset-react//lib//index.js"
],
"plugins": [
"<ROOTDIR>//packages//babel-plugin-transform-arrow-functions",
"<ROOTDIR>//packages//babel-plugin-transform-strict-mode",
"<ROOTDIR>//packages//babel-plugin-transform-modules-commonjs"
"<ROOTDIR>//packages//babel-plugin-transform-arrow-functions//lib//index.js",
"<ROOTDIR>//packages//babel-plugin-transform-strict-mode//lib//index.js",
"<ROOTDIR>//packages//babel-plugin-transform-modules-commonjs//lib//index.js"
],
"sourceFileName": "src/foo.js",
"caller": {
Expand Down
Expand Up @@ -16,12 +16,12 @@ config <CWD>/.babelrc
programmatic options from @babel/cli
{
"presets": [
"<ROOTDIR>/packages/babel-preset-react"
"<ROOTDIR>/packages/babel-preset-react/lib/index.js"
],
"plugins": [
"<ROOTDIR>/packages/babel-plugin-transform-arrow-functions",
"<ROOTDIR>/packages/babel-plugin-transform-strict-mode",
"<ROOTDIR>/packages/babel-plugin-transform-modules-commonjs"
"<ROOTDIR>/packages/babel-plugin-transform-arrow-functions/lib/index.js",
"<ROOTDIR>/packages/babel-plugin-transform-strict-mode/lib/index.js",
"<ROOTDIR>/packages/babel-plugin-transform-modules-commonjs/lib/index.js"
],
"sourceFileName": "src/foo.js",
"caller": {
Expand Down
Expand Up @@ -16,12 +16,12 @@ config <CWD>/.babelrc
programmatic options from @babel/cli
{
"presets": [
"<ROOTDIR>//packages//babel-preset-react"
"<ROOTDIR>//packages//babel-preset-react//lib//index.js"
],
"plugins": [
"<ROOTDIR>//packages//babel-plugin-transform-arrow-functions",
"<ROOTDIR>//packages//babel-plugin-transform-strict-mode",
"<ROOTDIR>//packages//babel-plugin-transform-modules-commonjs"
"<ROOTDIR>//packages//babel-plugin-transform-arrow-functions//lib//index.js",
"<ROOTDIR>//packages//babel-plugin-transform-strict-mode//lib//index.js",
"<ROOTDIR>//packages//babel-plugin-transform-modules-commonjs//lib//index.js"
],
"sourceFileName": "../src/foo.js",
"caller": {
Expand Down
Expand Up @@ -110,12 +110,12 @@ config <CWD>/.babelrc
programmatic options from @babel/cli
{
"presets": [
"<ROOTDIR>/packages/babel-preset-react"
"<ROOTDIR>/packages/babel-preset-react/lib/index.js"
],
"plugins": [
"<ROOTDIR>/packages/babel-plugin-transform-arrow-functions",
"<ROOTDIR>/packages/babel-plugin-transform-strict-mode",
"<ROOTDIR>/packages/babel-plugin-transform-modules-commonjs"
"<ROOTDIR>/packages/babel-plugin-transform-arrow-functions/lib/index.js",
"<ROOTDIR>/packages/babel-plugin-transform-strict-mode/lib/index.js",
"<ROOTDIR>/packages/babel-plugin-transform-modules-commonjs/lib/index.js"
],
"configFile": "./my-config.js",
"sourceFileName": "./src/index.js",
Expand Down
10 changes: 6 additions & 4 deletions packages/babel-cli/test/index.js
Expand Up @@ -25,12 +25,14 @@ const outputFileSync = function (filePath, data) {
fs.writeFileSync(filePath, data);
};

const presetLocs = [path.join(rootDir, "./packages/babel-preset-react")];
const getPath = name => path.join(rootDir, "packages", name, "lib", "index.js");

const presetLocs = [getPath("babel-preset-react")];

const pluginLocs = [
path.join(rootDir, "./packages/babel-plugin-transform-arrow-functions"),
path.join(rootDir, "./packages/babel-plugin-transform-strict-mode"),
path.join(rootDir, "./packages/babel-plugin-transform-modules-commonjs"),
getPath("babel-plugin-transform-arrow-functions"),
getPath("babel-plugin-transform-strict-mode"),
getPath("babel-plugin-transform-modules-commonjs"),
].join(",");

const readDir = function (loc, filter) {
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-helper-fixtures/src/index.ts
Expand Up @@ -309,7 +309,7 @@ function wrapPackagesArray(type, names, optionsDir) {
path.dirname(fileURLToPath(import.meta.url)),
"../../..",
name.startsWith("codemod") ? "codemods" : "packages",
`babel-${type}-${name}`,
`babel-${type}-${name}/lib/index.js`,
);

if (fs.existsSync(monorepoPath)) {
Expand Down