في أحدث إصدار من تكوين التدقيق القياسي لـ Discourse، قمنا بتمكين قاعدة require-strict-mode في ember-template-lint. سيؤدي هذا إلى ظهور خطأ تدقيق لأي ملفات .hbs.
لاستخدام codemod، تأكد أولاً من تحديث تبعيات التدقيق الخاصة بك عن طريق نسخ أحدث package.json من هيكل المكون الإضافي أو هيكل السمة. بعد ذلك، قم بتشغيل eslint و prettier:
pnpm i
pnpm eslint --fix .
pnpm prettier --write "**/*.{gjs,js,hbs,scss}"
إذا لم يكن من الممكن إصلاح أي مشكلات تلقائيًا، فقم بحلها يدويًا الآن. لا تقم بتشغيل ember-template-lint بعد - من المتوقع أن يفشل.
*) pfaffman@noreno:~/src/pfaffman/discourse-pfaffmanager$ pnpm dlx https://github.com/discourse/discourse-gjs-codemod
Username for 'https://github.com': pfaffman
Password for 'https://pfaffman@github.com':
/home/pfaffman/.cache/pnpm/dlx/txqdpi2aznswmhsvgh3pgqp3te/1971d72469d-323788:
ERROR Command failed with exit code 128: git ls-remote git+ssh://git@github.com/discourse/discourse-gjs-codemod.git HEAD
ERROR: Repository not found.
fatal: Could not read from remote repository.
تم الإنجاز في 1.6 ثانية باستخدام pnpm v9.15.9
file:///home/pfaffman/.cache/pnpm/dlx/txqdpi2aznswmhsvgh3pgqp3te/1971d8d4970-32e7a4/node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/return/final-error.js:6
return new ErrorClass(message, options);
^
ExecaError: فشل الأمر مع رمز الخروج 255: '/home/pfaffman/.cache/pnpm/dlx/txqdpi2aznswmhsvgh3pgqp3te/1971d8d4970-32e7a4/node_modules/.pnpm/@embroider+template-
tag-codemod@1.2.1-unstable.ce3535d_@glimmer+component@2.0.0_handlebars@4._arnanpbg4hbtumvl4wyacggoiu/node_modules/@embroider/template-tag-codemod/dist/src/cli.js' '
--relativeLocalPaths=false' '--nativeRouteTemplates=false' '--nativeLexicalThis=false' '--templateInsertion=end' --addNameToTemplateOnly '--customResolver=/home/pfa
ffman/.cache/pnpm/dlx/txqdpi2aznswmhsvgh3pgqp3te/1971d8d4970-32e7a4/node_modules/.pnpm/discourse-gjs-codemod@https+++codeload.github.com+discourse+discourse-gjs-cod
emod+tar.gz+a4bc_2dxbzd2itovnk6l7sa4geot32y/node_modules/discourse-gjs-codemod/custom-resolver.js' '--renamingRules=/home/pfaffman/.cache/pnpm/dlx/txqdpi2aznswmhsvg
h3pgqp3te/1971d8d4970-32e7a4/node_modules/.pnpm/discourse-gjs-codemod@https+++codeload.github.com+discourse+discourse-gjs-codemod+tar.gz+a4bc_2dxbzd2itovnk6l7sa4geo
t32y/node_modules/discourse-gjs-codemod/rules.js' '--renderTests=test/**/*.js' '--routeTemplates=**/templates/**/*.hbs' '--components=**/components/**/*.hbs'
ولكن يبدو أنه قام بتحويل كل القوالب باستثناء عدد قليل منها، وعلى الرغم من أنني لم أفهم السبب بعد، إلا أنني لست متفاجئًا، لأنها تحتوي على بعض الأشياء الغريبة وكنت بصدد إعادة كتابتها على أي حال.