Description
Victor Grousset/tuxayo
2024-10-14 17:16:55 UTC
Created attachment 172754 [details] [review] Bug 38167: Migrate ESLint config to new flat format Test: 1. Do not apply 2. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 3. It should fail 4. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 5. It should work 6. Apply patches 7. Restart KTD to have a clean state of dependencies and check that provisionning still works. 8. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 9. It should fail 10. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 11. It should work 12 Double check rspack still works: rspack build Because we removed babel. Created attachment 172755 [details] [review] Bug 38167: Remove Babel which was only used by Webpack And our old versions was depending on a old buggy version of "globals" that broke ESLint when using new config file format. Removing Babel if it's not used anymore instead of updating it. (There would be a way to test the updat works anyway. @vue/cli-service was depending on babel core. Removing it since it's deprecated (see replacements below) instead having to keep a subset of Babel packages and updating them. https://cli.vuejs.org/#getting-started https://github.com/vuejs/vue-cli If this is merged as it is. A note will have to be left in bug 37824 because > - we can always fallback onto webpack, it's not going anywhere. To leave a trace of changes that relevant to an eventual fallback to webpack. Created attachment 173070 [details] [review] Bug 38167: Remove remaining @vue/cli-service use Created attachment 173071 [details] [review] Bug 38167: Make Prettier and ESLint happier for cypress/plugins/index.js Created attachment 174429 [details] [review] Bug 38167: Migrate ESLint config to new flat format Test: 1. Do not apply 2. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 3. It should fail 4. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 5. It should work 6. Apply patches 7. Restart KTD to have a clean state of dependencies and check that provisionning still works. 8. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 9. It should fail 10. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 11. It should work 12 Double check rspack still works: rspack build Because we removed babel. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174430 [details] [review] Bug 38167: Remove Babel which was only used by Webpack And our old versions was depending on a old buggy version of "globals" that broke ESLint when using new config file format. Removing Babel if it's not used anymore instead of updating it. (There would be a way to test the updat works anyway. @vue/cli-service was depending on babel core. Removing it since it's deprecated (see replacements below) instead having to keep a subset of Babel packages and updating them. https://cli.vuejs.org/#getting-started https://github.com/vuejs/vue-cli Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174431 [details] [review] Bug 38167: Remove remaining @vue/cli-service use Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174432 [details] [review] Bug 38167: Make Prettier and ESLint happier for cypress/plugins/index.js Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (In reply to Paul Derscheid from comment #8) > Created attachment 174431 [details] [review] [review] > Bug 38167: Remove remaining @vue/cli-service use > > Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Isn't this occurrence of "vue-cli" related? cypress.config.ts: framework: "vue-cli", Good find, I guess it is. Context: ``` component: { devServer: { framework: "vue-cli", bundler: "webpack", }, ``` What operation could use this config? Because just running the tests didn't use this and didn't fail. Whereas the stuff removed in the commit had to be removed to be able run the tests. https://docs.cypress.io/app/component-testing/component-framework-configuration > Custom Dev Server > A custom function can be passed into the devServer option, which allows the use of build systems not provided by Cypress out of the box. After this plus other search it's still blurry what is a dev server. I think this is unused because we don't have component tests yet. If I am not mistaken we just went e2e. There's https://www.npmjs.com/package/cypress-rspack-dev-server (btw) but it doesn't support vue yet (just react). But if we don't have any yet, I just want to casually advocate for adding component tests in the future. Huge gains in actual test coverage for behaviour, comparatively little effort. Created attachment 174855 [details] [review] Bug 38167: Migrate ESLint config to new flat format Test: 1. Do not apply 2. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 3. It should fail 4. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 5. It should work 6. Apply patches 7. Restart KTD to have a clean state of dependencies and check that provisionning still works. 8. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 9. It should fail 10. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 11. It should work 12 Double check rspack still works: rspack build Because we removed babel. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174856 [details] [review] Bug 38167: Remove Babel which was only used by Webpack And our old versions was depending on a old buggy version of "globals" that broke ESLint when using new config file format. Removing Babel if it's not used anymore instead of updating it. (There would be a way to test the updat works anyway. @vue/cli-service was depending on babel core. Removing it since it's deprecated (see replacements below) instead having to keep a subset of Babel packages and updating them. https://cli.vuejs.org/#getting-started https://github.com/vuejs/vue-cli Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174857 [details] [review] Bug 38167: [DO NOT PUSH] yarn.lock changes And our old versions was depending on a old buggy version of "globals" that broke ESLint when using new config file format. Removing Babel if it's not used anymore instead of updating it. (There would be a way to test the updat works anyway. @vue/cli-service was depending on babel core. Removing it since it's deprecated (see replacements below) instead having to keep a subset of Babel packages and updating them. https://cli.vuejs.org/#getting-started https://github.com/vuejs/vue-cli Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174858 [details] [review] Bug 38167: Remove remaining @vue/cli-service use Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174859 [details] [review] Bug 38167: Make Prettier and ESLint happier for cypress/plugins/index.js Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Rebased and split yarn.lock changes to their own commit. |