From d449e7c3ca0abb7379ea4159b0ef0281059077eb Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 13 Mar 2021 08:41:34 -0800 Subject: [PATCH] feat: Support import.meta * fix: enable import.meta + static import by switching from detective to konan * fix(deps): updated lock * Revert "fix(deps): updated lock" This reverts commit b4be07eec6391e60abe30594ee7cd9e17f594013. * Dependency update bumps (#1345) * fix(deps): update lock * fix(deps): merge lock * fix(deps): use module-deps-sortable@5.0.2 * fix(deps): yarn... * Use detective if konan fails https://github.com/Mogztter/module-deps/commit/f78550a9140166b0fea48f308be453a5d1d240af * chore: Use released module-deps Co-authored-by: Markus Felten Co-authored-by: Guillaume Grossetie --- __tests__/__snapshots__/test.js.snap | 21 ++++++++++++ __tests__/fixture/import.meta.input.js | 4 +++ package.json | 2 +- yarn.lock | 46 +++++++++++++++++++++++--- 4 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 __tests__/fixture/import.meta.input.js diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 7f7220ab1..3ced4f9b6 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -20854,6 +20854,27 @@ Object { } `; +exports[`outputs import.meta.input.js JSON 1`] = `Array []`; + +exports[`outputs import.meta.input.js markdown 1`] = ` +" + +### Table of Contents +" +`; + +exports[`outputs import.meta.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + ], + "type": "root", +} +`; + exports[`outputs infer-private.input.js JSON 1`] = ` Array [ Object { diff --git a/__tests__/fixture/import.meta.input.js b/__tests__/fixture/import.meta.input.js new file mode 100644 index 000000000..a2fd80604 --- /dev/null +++ b/__tests__/fixture/import.meta.input.js @@ -0,0 +1,4 @@ +import x from "y"; + + +console.log(import.meta.url); \ No newline at end of file diff --git a/package.json b/package.json index 380dfef2b..b6cd0d2d7 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "mdast-util-inject": "^1.1.0", "micromatch": "^3.1.5", "mime": "^2.2.0", - "module-deps-sortable": "^5.0.1", + "module-deps-sortable": "^5.0.3", "parse-filepath": "^1.0.2", "pify": "^5.0.0", "read-pkg-up": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index 55f9c0e62..c86cc8e8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -291,6 +291,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.5.tgz#b4af32ddd473c0bfa643bd7ff0728b8e71b81ea0" integrity sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ== +"@babel/parser@^7.10.5", "@babel/parser@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.7.tgz#fee7b39fe809d0e73e5b25eecaf5780ef3d73056" + integrity sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg== + "@babel/plugin-proposal-async-generator-functions@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz#dc6c1170e27d8aca99ff65f4925bd06b1c90550e" @@ -1063,6 +1068,21 @@ globals "^11.1.0" lodash "^4.17.19" +"@babel/traverse@^7.10.5": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.7.tgz#572a722408681cef17d6b0bef69ef2e728ca69f1" + integrity sha512-nMWaqsQEeSvMNypswUDzjqQ+0rR6pqCtoQpsqGJC4/Khm9cISwPTSpai57F6/jDaOoEGz8yE/WxcO3PV6tKSmQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.5" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.12.7" + "@babel/types" "^7.12.7" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + "@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.5", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.12.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.6.tgz#ae0e55ef1cce1fbc881cd26f8234eb3e657edc96" @@ -1072,6 +1092,15 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.7.tgz#6039ff1e242640a29452c9ae572162ec9a8f5d13" + integrity sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -4789,6 +4818,14 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +konan@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/konan/-/konan-2.1.1.tgz#eea88f05c56249b78903b952b953393900346dd1" + integrity sha512-7ZhYV84UzJ0PR/RJnnsMZcAbn+kLasJhVNWsu8ZyVEJYRpGA5XESQ9d/7zOa08U0Ou4cmB++hMNY/3OSV9KIbg== + dependencies: + "@babel/parser" "^7.10.5" + "@babel/traverse" "^7.10.5" + lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -5343,10 +5380,10 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -module-deps-sortable@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/module-deps-sortable/-/module-deps-sortable-5.0.1.tgz#b7eec1cb1e556e97db152a78292f768752797615" - integrity sha512-QCQPk/u41XIBX5Hy2PCDyXS5kg2tZZSQGedEhfvZa2bO4FhxUov+4/2WSXZ5dNtvuyMnqBcfCau6XJZp9DqJoA== +module-deps-sortable@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/module-deps-sortable/-/module-deps-sortable-5.0.3.tgz#e640e7450e0869f4ae8e03437665ca2a8a28f843" + integrity sha512-eiyIZj/A0dj1o4ywXWqicazUL3l0HP3TydUR6xF0X3xh3LGBMLqW8a9aFe6MuNH4mxNMk53QKBHM6LOPR8kSgw== dependencies: JSONStream "^1.0.3" browser-resolve "^1.7.0" @@ -5356,6 +5393,7 @@ module-deps-sortable@^5.0.1: detective "^5.2.0" duplexer2 "^0.1.2" inherits "^2.0.1" + konan "^2.1.1" readable-stream "^2.0.2" resolve "^1.1.3" standard-version "^9.0.0"