From 160fbb4a17b7d80e4b39bc84f7147aafa660906c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 4 Jul 2022 02:38:27 +0200 Subject: [PATCH] =?UTF-8?q?fix(ci):=20wrong=20=E2=80=98node'=20and=20?= =?UTF-8?q?=E2=80=98deploy'=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - In the `node` workflow, the `npm ci` command needs the `package-lock.json` file to work, but this file is removed before running `npm install` with the npm `preinstall` script. - In the `node` workflow, the version 16 check does not work because the `console.log` is not allowed by eslint in the `EditorJson.vue` file. Solution: - Update the `preinstall` npm script to make it faster. - In the `node` workflow, use the `npm install` command instead of `npm ci`, this command auto 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. 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 | 2 +- .github/workflows/node.js.yml | 4 +- gh-pages-deploy.js | 2 +- package-lock.json | 61 ++++++++++++--------------- package.json | 2 +- src/components/EditorJSON.vue | 1 + 6 files changed, 32 insertions(+), 40 deletions(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index a9a481e2..4b720536 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -11,7 +11,7 @@ jobs: - name: Setup Node.js for use with actions uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 16.x - name: Checkout branch uses: actions/checkout@v3 diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 680ef25e..53e93c69 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [14.x] + node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v3 @@ -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/gh-pages-deploy.js b/gh-pages-deploy.js index c22d66f8..696fa1e8 100644 --- a/gh-pages-deploy.js +++ b/gh-pages-deploy.js @@ -1,4 +1,4 @@ -/* eslint-disable no-console */ +// eslint-disable no-console const execa = require('execa'); const emoji = require('node-emoji'); const chalk = require('chalk'); diff --git a/package-lock.json b/package-lock.json index bba48286..2569ebd0 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" @@ -2546,9 +2546,6 @@ "glob-parent": { "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - }, "dependencies": { "is-glob": { "version": "3.1.0", @@ -3164,9 +3161,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.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.1.tgz", + "integrity": "sha512-YQRE2uYhlvyFgHmKAqySCdLm7O37XZc+yG9dujwD3h8em+rD1qGOthxc0H3XcijOy50gj/pYHgBO6C3MjV+oug==", "requires": { "@babel/parser": "^7.18.4", "postcss": "^8.4.14", @@ -5230,12 +5227,12 @@ }, "dependencies": { "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { - "is-extglob": "^2.1.0" + "is-extglob": "^2.1.1" } } } @@ -6339,9 +6336,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.178", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.178.tgz", + "integrity": "sha512-aWuhJXkwIdoQzGR8p2QvR3N0OzdUKZSP8+P/hzuMzNQIPZoEa8HiCGM75bQBHjyz+eKT5PB9dVCzkK/tyQ4B5Q==", "dev": true }, "elliptic": { @@ -6599,9 +6596,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" @@ -11817,9 +11814,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 +14451,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.1", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.1.tgz", + "integrity": "sha512-X1YkFddhbTAU2FPK0gBZ/vDOcOMA8ZT4uHoFVor1bUb7BpVGdEswS286YGtODsf/Ghfr1LM1sBMFAY8XT+dVhA==", "requires": { - "@vue/compiler-sfc": "2.7.0", + "@vue/compiler-sfc": "2.7.1", "csstype": "^3.1.0" } }, @@ -14628,9 +14625,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.1", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.1.tgz", + "integrity": "sha512-ku/H1k1yHAgY0BEdoXVj7xZIjuFSwB2IV3nQWnmUMJ6U1jzK56LPHLWzEe5bTzt0WR0b/rJRkuiig44SUoaBoQ==", "dev": true, "requires": { "de-indent": "^1.0.2", @@ -14801,9 +14798,6 @@ "glob-parent": { "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - }, "dependencies": { "is-glob": { "version": "3.1.0", @@ -15807,9 +15801,6 @@ "glob-parent": { "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - }, "dependencies": { "is-glob": { "version": "3.1.0", diff --git a/package.json b/package.json index 78c1c198..072352e3 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "preinstall": "rm -rf node_modules package-lock.json && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions", + "preinstall": "(rm -rf node_modules package-lock.json && npm install --package-lock-only --ignore-scripts --no-audit); npx force-resolutions", "postinstall": "npm run lint", "serve": "vue-cli-service serve", "build": "vue-cli-service build", diff --git a/src/components/EditorJSON.vue b/src/components/EditorJSON.vue index bc99cf06..b4719275 100644 --- a/src/components/EditorJSON.vue +++ b/src/components/EditorJSON.vue @@ -61,6 +61,7 @@ }, methods: { onJsonChange(value) { + // eslint-disable-next-line no-console console.log('value:', value); }, getPikachu() {