From cecba979fada6e65b7b93646e2ba24730cb04d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Tue, 5 Jul 2022 04:29:53 +0100 Subject: [PATCH] fix(ci): wrong 'node' and 'deploy' workflows when using node versions >14 Error: - In the `node` workflow, the `npm ci` command does not work, it needs the `package-lock.json` file to work, but this file is removed by the npm `preinstall` script. - In the `node` workflow, the version 16 check does not work because the `console.log` file is not allowed by eslint in the `EditorJson.vue` file. Solution: - Use in workflows the `npm install` command instead of `npm ci`. The `npm install` automatically runs the npm `preinstall` script which already does a clean install, removing the `node_modules` folder and the `package-lock.json` file. - Disables the `no-console` slint rule in the `EditorJson.vue` file. - Use `node` version 14 for the project, the following versions still do not work. Resolutions: - https://stackoverflow.com/a/68095189/10855837 - https://stackoverflow.com/a/53325242/10855837 - https://github.com/rogeriochaves/npm-force-resolutions/issues/17 - https://www.npmjs.com/package/force-resolutions --- .github/workflows/gh-pages-deploy.yml | 4 +- .github/workflows/node.js.yml | 2 +- package-lock.json | 106 +++++++++++++------------- src/components/EditorJSON.vue | 8 +- 4 files changed, 62 insertions(+), 58 deletions(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index a9a481e2..66ae81d5 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -16,8 +16,8 @@ jobs: - name: Checkout branch uses: actions/checkout@v3 - - name: Clean install dependencies - run: npm ci + - name: Clean install dependencies (install:clean) + run: npm install - name: Run deploy script run: | diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 680ef25e..7dae8862 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -24,6 +24,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - run: npm ci + - run: npm install - run: npm run build --if-present - run: npm test --if-present diff --git a/package-lock.json b/package-lock.json index bba48286..c35d2b0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1251,9 +1251,9 @@ }, "dependencies": { "globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", + "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -1402,9 +1402,9 @@ } }, "@jridgewell/resolve-uri": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.8.tgz", - "integrity": "sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true }, "@jridgewell/set-array": { @@ -1678,9 +1678,9 @@ "dev": true }, "@types/node": { - "version": "18.0.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.1.tgz", - "integrity": "sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==", + "version": "18.0.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.3.tgz", + "integrity": "sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==", "dev": true }, "@types/normalize-package-data": { @@ -1842,9 +1842,9 @@ } }, "@vue/babel-preset-app": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@vue/babel-preset-app/-/babel-preset-app-5.0.6.tgz", - "integrity": "sha512-hoVr5M5RIvAL8F6MX8ZG0RvjA7MB7eDOkykK+M+qThkkrsAvlianzygnE86xN1N7JVSq7kGOyZk0Te+L20KqeQ==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vue/babel-preset-app/-/babel-preset-app-5.0.7.tgz", + "integrity": "sha512-oepDJNWbYxosfopP7SPDZTBQl0k7KN5xs/uGWT12K+ih6f54Qo/4gEEoIVI8p2yuCRLIIc46SIhZn3AugOgx1g==", "dev": true, "requires": { "@babel/core": "^7.12.16", @@ -1982,14 +1982,14 @@ "dev": true }, "@vue/cli-plugin-babel": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@vue/cli-plugin-babel/-/cli-plugin-babel-5.0.6.tgz", - "integrity": "sha512-ruQhfhj2WM6Fe/VDQneQc/kqNp/p138SjQMfz7q/rxMTMG1kpV5B0jYWschXHXLQ6aDsFnqmBmIK+XjU3XTF3g==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-babel/-/cli-plugin-babel-5.0.7.tgz", + "integrity": "sha512-qWrwhX7rZ8vQq6+niKG8OkBak0vDhIWzJsLXH5i+xzm04mcudPJwPZhQOBpN3XXkipsic1ZCkhS9d3+VjsWQYg==", "dev": true, "requires": { "@babel/core": "^7.12.16", - "@vue/babel-preset-app": "^5.0.6", - "@vue/cli-shared-utils": "^5.0.6", + "@vue/babel-preset-app": "^5.0.7", + "@vue/cli-shared-utils": "^5.0.7", "babel-loader": "^8.2.2", "thread-loader": "^3.0.0", "webpack": "^5.54.0" @@ -2041,12 +2041,12 @@ } }, "@vue/cli-plugin-eslint": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-5.0.6.tgz", - "integrity": "sha512-fuc8w2IujzoenA/cdr/QYYMq2yaI1fYr0Fqom/M55B+DmW19GIuIRxYQvh0CEeCbFB2hAl3Flrazfx96/nAaQA==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-5.0.7.tgz", + "integrity": "sha512-KOiMq+zcMkKC1oUpPWHGYd4g+7ehCx2/NJqqA3Ds2wsLSNPZCJWGTfzK1p1j87kDVgM3zTPXxRCBFHa2lZW8eg==", "dev": true, "requires": { - "@vue/cli-shared-utils": "^5.0.6", + "@vue/cli-shared-utils": "^5.0.7", "eslint-webpack-plugin": "^3.1.0", "globby": "^11.0.2", "webpack": "^5.54.0", @@ -2197,18 +2197,18 @@ } }, "@vue/cli-plugin-router": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@vue/cli-plugin-router/-/cli-plugin-router-5.0.6.tgz", - "integrity": "sha512-5ikUdfsSoKqpBhB5GhGYijH6mJnU+ZGqDv3QBf0brDeeh7PhClntxNAOLkB73c+LNxjBrlNCTkItuByF+AD29w==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-router/-/cli-plugin-router-5.0.7.tgz", + "integrity": "sha512-DarQql1AYvmC0qnfOPtlFR0EKnWpVVbmuIyjoAxu9Ki4PQI/mFUa7PL286ntVxmVCvLY8YXIJMCtG1MqBSayuw==", "dev": true, "requires": { - "@vue/cli-shared-utils": "^5.0.6" + "@vue/cli-shared-utils": "^5.0.7" } }, "@vue/cli-plugin-vuex": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@vue/cli-plugin-vuex/-/cli-plugin-vuex-5.0.6.tgz", - "integrity": "sha512-9bwkaLxGqqrD5FPN7iNsIe5x60P0nScioMQvHf2ZIIoFAiM5yuTgOQkdSKGBhn0YG4IjYd1tnlVY4Q/P4ZHaTA==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-vuex/-/cli-plugin-vuex-5.0.7.tgz", + "integrity": "sha512-X8RbsUDE/4K32LGd91RgqDnjOYxVQlLU0J40dtHJJv/z3IwFD5vTZBT8a8s7bf3KD3YvYPisZjymUJnMObEhEg==", "dev": true }, "@vue/cli-service": { @@ -3043,9 +3043,9 @@ } }, "@vue/cli-shared-utils": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-5.0.6.tgz", - "integrity": "sha512-5HmlRtMByOCFO0P3mMUx8dVruTRhZ3pqQ0f1cCH9TmAoDjetmD/Ib7yx/5KxTHV8QY3xZJxYvgAmOU5C49K5xA==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-5.0.7.tgz", + "integrity": "sha512-SzpqSExsp31gg7w+UAsqdrFyZGxKNTIE8MVwcfkevEx4BgugpLcmUxgcelgDktMs7GGykxluPIm0ZHDk3ytXeg==", "dev": true, "requires": { "@achrinza/node-ipc": "^9.2.5", @@ -3164,9 +3164,9 @@ } }, "@vue/compiler-sfc": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.0.tgz", - "integrity": "sha512-hPOI15RsXO1G8aK6FNF93ld9C/D4e/uAJBE59K8NnL8giuKqeVksvamgu4jKhCJ9f9bbUpj5BuSV3sufIx2hmw==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.2.tgz", + "integrity": "sha512-khG5m63A4DSeHEOe5yyjHQY2TAE0pUXqKqxgauNUcFaa8M4+J55OWhagy8Bk8O6cO4GhKbQf2NDYzceijmOy8A==", "requires": { "@babel/parser": "^7.18.4", "postcss": "^8.4.14", @@ -6339,9 +6339,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.177", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.177.tgz", - "integrity": "sha512-FYPir3NSBEGexSZUEeht81oVhHfLFl6mhUKSkjHN/iB/TwEIt/WHQrqVGfTLN5gQxwJCQkIJBe05eOXjI7omgg==", + "version": "1.4.180", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.180.tgz", + "integrity": "sha512-7at5ash3FD9U5gPa3/wPr6OdiZd/zBjvDZaaHBpcqFOFUhZiWnb7stkqk8xUFL9H9nk7Yok5vCCNK8wyC/+f8A==", "dev": true }, "elliptic": { @@ -6599,9 +6599,9 @@ } }, "globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", + "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -6672,9 +6672,9 @@ } }, "eslint-plugin-vue": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.1.1.tgz", - "integrity": "sha512-W9n5PB1X2jzC7CK6riG0oAcxjmKrjTF6+keL1rni8n57DZeilx/Fulz+IRJK3lYseLNAygN0I62L7DvioW40Tw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.2.0.tgz", + "integrity": "sha512-W2hc+NUXoce8sZtWgZ45miQTy6jNyuSdub5aZ1IBune4JDeAyzucYX0TzkrQ1jMO52sNUDYlCIHDoaNePe0p5g==", "dev": true, "requires": { "eslint-utils": "^3.0.0", @@ -11817,9 +11817,9 @@ "dev": true }, "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "dev": true }, "public-encrypt": { @@ -14454,11 +14454,11 @@ "dev": true }, "vue": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.0.tgz", - "integrity": "sha512-su25f1hocH+QNkVEqk+Oj7B+mkDIWU70l0YY7nYSJFEs3Z64njXxo65RUXnWH46ooEhKmEWyLdW6HcYn8coNrg==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.2.tgz", + "integrity": "sha512-fQPKEfdiUP4bDlrGEjI5MOTkC5s/XIbnfKAx0B3MxJHI4qwh8FPLSo8/9tFkgFiRH3HwvcHjZQ1tCTifOUH0tg==", "requires": { - "@vue/compiler-sfc": "2.7.0", + "@vue/compiler-sfc": "2.7.2", "csstype": "^3.1.0" } }, @@ -14628,9 +14628,9 @@ } }, "vue-template-compiler": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.0.tgz", - "integrity": "sha512-b9kKOPNS6J2BVf9skXkKsUwQLP3Bjfb/gG6UoBt3fn4xUVEDko5TSWmkPGW6dSSeAOOvYEMALdouv9caKlTq0Q==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.2.tgz", + "integrity": "sha512-3PDLIPankm7b1YZHk6/mTz9kMZaDSd1Vhp1tFPITot5uW9WjnIyv6zRax3+j1kwF0DHmvfIVXMX8G+Rn/BHfaQ==", "dev": true, "requires": { "de-indent": "^1.0.2", diff --git a/src/components/EditorJSON.vue b/src/components/EditorJSON.vue index bc99cf06..ac449c6a 100644 --- a/src/components/EditorJSON.vue +++ b/src/components/EditorJSON.vue @@ -61,7 +61,9 @@ }, methods: { onJsonChange(value) { + /* eslint-disable no-alert, no-console, no-debugger */ console.log('value:', value); + /* eslint-enable no-alert, no-console */ }, getPikachu() { const url = 'https://pokeapi.co/api/v2/pokemon/pikachu'; @@ -72,13 +74,15 @@ }); }, onCopy() { - // eslint-disable-next-line no-alert + /* eslint-disable no-alert, no-console, no-debugger */ alert('Copied JSON to the clipboard'); + /* eslint-enable no-alert, no-console */ }, onError(e) { - // eslint-disable-next-line no-alert, no-console + /* eslint-disable no-alert, no-console, no-debugger */ alert('Failed to copy JSON to the clipboard'); console.log(e); + /* eslint-enable no-alert, no-console */ }, onSave() { localStorage.setItem('editor-json', JSON.stringify(this.json));