Skip to content

Commit

Permalink
Revert "[babel] transform rambdax paths ala NT"
Browse files Browse the repository at this point in the history
This reverts commit 23de4471ffbb7f1b337966f9557e36f7ce275c6e.
  • Loading branch information
radex committed Sep 16, 2020
1 parent b0d9e8d commit de8071f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 69 deletions.
28 changes: 0 additions & 28 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
const path = require('path')
const fs = require('fs-extra')

const readNodeModulesDir = (...paths) =>
fs.readdirSync(path.resolve(__dirname, 'node_modules', ...paths))
const rambdaxModules = readNodeModulesDir('rambdax', 'src')
const rambdaModules = readNodeModulesDir('rambdax', 'src', 'rambda')

const getRambdaPath = ({ importName }) => {
if (rambdaModules.includes(`${importName}.js`)) {
return `rambdax/src/rambda/${importName}`
} else if (rambdaxModules.includes(`${importName}.js`)) {
return `rambdax/src/${importName}`
}

throw new Error(`Unknown import of ${importName} from rambdax`)
}

const plugins = [
[
'@babel/plugin-transform-runtime',
Expand All @@ -24,16 +6,6 @@ const plugins = [
// regenerator: true,
},
],
[
'transform-imports',
{
rambdax: {
transform: importName => getRambdaPath({ importName }),
preventFullImport: true,
skipDefaultConversion: true,
},
},
],
[
'@babel/plugin-transform-modules-commonjs',
{
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"babel-plugin-minify-guarded-expressions": "^0.4.3",
"babel-plugin-minify-replace": "^0.5.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-imports": "^2.0.0",
"better-sqlite3": "^7.1.0",
"big-list-of-naughty-strings": "https://github.com/radex/big-list-of-naughty-strings#8346238a82f1e3a6f62389def1e668d80e4023fb",
"cavy": "git+https://github.com/Nozbe/cavy.git",
Expand Down
44 changes: 4 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,6 @@
dependencies:
"@babel/types" "^7.4.4"

"@babel/helper-validator-identifier@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2"
integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==

"@babel/helper-wrap-function@^7.1.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa"
Expand Down Expand Up @@ -1173,15 +1168,6 @@
lodash "^4.17.10"
to-fast-properties "^2.0.0"

"@babel/types@^7.4":
version "7.11.0"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.0.tgz#2ae6bf1ba9ae8c3c43824e5861269871b206e90d"
integrity sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==
dependencies:
"@babel/helper-validator-identifier" "^7.10.4"
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@babel/types@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0"
Expand Down Expand Up @@ -1882,13 +1868,10 @@ babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0:
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf"
integrity sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ==

babel-plugin-transform-imports@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-imports/-/babel-plugin-transform-imports-2.0.0.tgz#9e5f49f751a9d34ba8f4bb988c7e48ed2419c6b6"
integrity sha512-65ewumYJ85QiXdcB/jmiU0y0jg6eL6CdnDqQAqQ8JMOKh1E52VPG3NJzbVKWcgovUR5GBH8IWpCXQ7I8Q3wjgw==
dependencies:
"@babel/types" "^7.4"
is-valid-path "^0.1.1"
babel-plugin-transform-remove-console@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780"
integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=

babel-preset-fbjs@^3.0.0, babel-preset-fbjs@^3.0.1:
version "3.2.0"
Expand Down Expand Up @@ -4538,13 +4521,6 @@ is-glob@^4.0.0, is-glob@^4.0.1:
dependencies:
is-extglob "^2.1.1"

is-invalid-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/is-invalid-path/-/is-invalid-path-0.1.0.tgz#307a855b3cf1a938b44ea70d2c61106053714f34"
integrity sha1-MHqFWzzxqTi0TqcNLGEQYFNxTzQ=
dependencies:
is-glob "^2.0.0"

is-number@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
Expand Down Expand Up @@ -4637,13 +4613,6 @@ is-typedarray@~1.0.0:
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=

is-valid-path@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/is-valid-path/-/is-valid-path-0.1.1.tgz#110f9ff74c37f663e1ec7915eb451f2db93ac9df"
integrity sha1-EQ+f90w39mPh7HkV60UfLbk6yd8=
dependencies:
is-invalid-path "^0.1.0"

is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
Expand Down Expand Up @@ -5500,11 +5469,6 @@ lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==

lodash@^4.17.19:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==

log-symbols@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"
Expand Down

0 comments on commit de8071f

Please sign in to comment.