zackad / prettier-plugin-twig

Code formatting plugin for Prettier to handle Twig templates
Apache License 2.0
55 stars 6 forks source link

Upgrade babel to ^7.24 to remove dependency on core-js 2.6 #35

Closed ampedweb closed 4 months ago

ampedweb commented 4 months ago

Tests seem to still pass after upgrading to a later version of Babel so hopefully this PR is OK?

The current core-js@2.6 package the babel packages rely on is deprecated, this removes the deprecated package and warnings related to it.

Happy to discuss though!

zackad commented 4 months ago

running yarn install on my machine causing yarn.lock file to be updated.

diff --git a/yarn.lock b/yarn.lock
index 19bf3a8..fc364c6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -40,7 +40,7 @@
   resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.8.tgz#58a4dbbcad7eb1d48930524a3fd93d93e9084c6f"
   integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==

-"@babel/template@^7.24":
+"@babel/template@^7.24.7":
   version "7.24.7"
   resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.7.tgz#02efcee317d0609d2c07117cb70ef8fb17ab7315"
   integrity sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==
@@ -49,7 +49,7 @@
     "@babel/parser" "^7.24.7"
     "@babel/types" "^7.24.7"

-"@babel/types@^7.24", "@babel/types@^7.24.7":
+"@babel/types@^7.24.7", "@babel/types@^7.24.9":
   version "7.24.9"
   resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.9.tgz#228ce953d7b0d16646e755acf204f4cf3d08cc73"
   integrity sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ==

did you forget to commit the correct version of your lock file?

ampedweb commented 4 months ago

@zackad Hmm this is strange. No it looks like I committed the correct one here. It was all part of the same commit as the updates. Could you try with yarn install --frozen-lockfile maybe?

zackad commented 4 months ago

nope, it give me error.

yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

seems like you have mismatch version between package.json and yarn.lock

diff --git a/package.json b/package.json
index 0ab3356..84d053d 100644
--- a/package.json
+++ b/package.json
@@ -19,8 +19,8 @@
         "test": "vitest --run"
     },
     "dependencies": {
-        "babel-template": "^6.26.0",
-        "babel-types": "^6.26.0",
+        "@babel/template": "^7.24.7",
+        "@babel/types": "^7.24.9",
         "he": "^1.2.0",
         "lodash": "^4.17.21",
         "prettier": "^3.0.0",,

maybe you could re-add @babel/template and @babel/types packages and commit the lockfile.

ampedweb commented 4 months ago

@zackad There you go, see if that works! 👍

zackad commented 4 months ago

Merged via 79cf386854433050c3bbbb96ad6ee413a8f600ba

Thanks @ampedweb.