From d6587c5380f870cc195dfb1e38e81c222fa94879 Mon Sep 17 00:00:00 2001 From: Sebastian Good <2230835+scagood@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:33:57 +0100 Subject: [PATCH] ci: use pulsar in ci (#39) * ci: use pulsar in ci * chore: use ppm on windows * chore: only use one version of node per build * chore: install npm packages on windows * ci: hack to install deps on windows (#1) --------- Co-authored-by: Tony Brix --- .github/workflows/CI.yml | 49 +-- package-lock.json | 482 +++++++++++++++++++++++++- package.json | 2 + patches/atom-package-deps+8.0.0.patch | 8 + spec/node-bin-spec.js | 3 +- spec/package-interaction-spec.js | 5 +- windows-deps/package.json | 1 + 7 files changed, 517 insertions(+), 33 deletions(-) create mode 100644 patches/atom-package-deps+8.0.0.patch create mode 100644 windows-deps/package.json diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1707f63..7340de5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -6,33 +6,25 @@ on: jobs: Test: - name: ${{ matrix.os }} - Atom ${{ matrix.atom_channel }} - node ${{ matrix.node_version }} + name: ${{ matrix.os }} - Pulsar runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - atom_channel: [stable, beta] - node_version: ['lts/*'] - include: - - os: ubuntu-latest - atom_channel: stable - node_version: '*' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - uses: actions/checkout@v3 - - uses: UziTech/action-setup-atom@v3 - with: - version: ${{ matrix.atom_channel }} + - uses: pulsar-edit/action-pulsar-dependency@v3.3 - uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node_version }} - - uses: volta-cli/action@v1.7.0 + node-version: 'lts/*' + - uses: volta-cli/action@v4 - name: Install multiple Node versions if: runner.os != 'Windows' run: | - volta install node@10 - echo "NODE_10=$(volta which node)" >> $GITHUB_ENV - echo "NODE_10_VERSION=$(node --version)" >> $GITHUB_ENV volta install node@latest echo "NODE_LATEST=$(volta which node)" >> $GITHUB_ENV echo "NODE_LATEST_VERSION=$(node --version)" >> $GITHUB_ENV @@ -42,9 +34,6 @@ jobs: - name: Install multiple Node versions (Windows) if: runner.os == 'Windows' run: | - volta install node@10 - echo "NODE_10=$(volta which node)" >> $env:GITHUB_ENV - echo "NODE_10_VERSION=$(node --version)" >> $env:GITHUB_ENV volta install node@latest echo "NODE_LATEST=$(volta which node)" >> $env:GITHUB_ENV echo "NODE_LATEST_VERSION=$(node --version)" >> $env:GITHUB_ENV @@ -67,14 +56,26 @@ jobs: npm init --yes npm install eslint@latest cd .. + - name: Install dependencies (Windows) + if: runner.os == 'Windows' + run: | + ppm install + npm install + npx atom-package-deps ./windows-deps - name: Install dependencies + if: runner.os != 'Windows' + run: | + pulsar --package install + pulsar --package install linter-eslint + npx atom-package-deps . + - name: List dependencies run: | - apm install - apm install linter-eslint - # ./node_modules/.bin/atom-package-deps . + pulsar --package list --enabled --packages - name: Run tests 👩🏾‍💻 - run: npm run test + uses: coactions/setup-xvfb@v1 + with: + run: pulsar --test spec Lint: runs-on: ubuntu-latest @@ -105,7 +106,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: UziTech/action-setup-atom@v3 + - uses: pulsar-edit/action-pulsar-dependency@v3.3 - uses: actions/setup-node@v3 with: node-version: "lts/*" diff --git a/package-lock.json b/package-lock.json index 916691f..a69d671 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "devDependencies": { "atom-jasmine3-test-runner": "^5.2.11", "eslint-plugin-import": "^2.25.4", + "patch-package": "^7.0.0", "rimraf": "^3.0.2" }, "engines": { @@ -101,6 +102,12 @@ "dev": true, "optional": true }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, "node_modules/acorn": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", @@ -204,6 +211,15 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/atom-jasmine3-test-runner": { "version": "5.2.11", "resolved": "https://registry.npmjs.org/atom-jasmine3-test-runner/-/atom-jasmine3-test-runner-5.2.11.tgz", @@ -265,6 +281,18 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -301,6 +329,21 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -734,6 +777,18 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/find-parent-dir": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.1.tgz", @@ -752,6 +807,15 @@ "node": ">=4" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -769,6 +833,21 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fs-plus": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.1.1.tgz", @@ -883,6 +962,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "node_modules/grim": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/grim/-/grim-2.0.3.tgz", @@ -1074,6 +1159,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1105,6 +1205,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-number-object": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", @@ -1187,6 +1296,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1331,6 +1452,27 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -1371,6 +1513,19 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1383,9 +1538,12 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mkdirp": { "version": "0.5.5", @@ -1493,6 +1651,22 @@ "wrappy": "1" } }, + "node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -1561,6 +1735,47 @@ "node": ">=6" } }, + "node_modules/patch-package": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-7.0.0.tgz", + "integrity": "sha512-eYunHbnnB2ghjTNc5iL1Uo7TsGMuXk0vibX3RFcE/CdVdXzmdbMsG/4K4IgoSuIkLTI5oHrMQk4+NkFqSed0BQ==", + "dev": true, + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^5.6.0", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1592,6 +1807,18 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -1723,6 +1950,15 @@ "resolved": "https://registry.npmjs.org/sb-promisify/-/sb-promisify-2.0.2.tgz", "integrity": "sha1-QnelR1RIiqlnXYhuNU24lMm9yYE=" }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1756,6 +1992,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/split2": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", @@ -1901,6 +2146,18 @@ "node": ">=0.6.0" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", @@ -1965,6 +2222,15 @@ "underscore": "^1.9.1" } }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -2025,6 +2291,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/yaml": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "dev": true, + "engines": { + "node": ">= 14" + } } }, "dependencies": { @@ -2096,6 +2371,12 @@ "dev": true, "optional": true }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, "acorn": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", @@ -2166,6 +2447,12 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "atom-jasmine3-test-runner": { "version": "5.2.11", "resolved": "https://registry.npmjs.org/atom-jasmine3-test-runner/-/atom-jasmine3-test-runner-5.2.11.tgz", @@ -2222,6 +2509,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -2246,6 +2542,12 @@ "supports-color": "^7.1.0" } }, + "ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2592,6 +2894,15 @@ "flat-cache": "^3.0.4" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-parent-dir": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.1.tgz", @@ -2607,6 +2918,15 @@ "locate-path": "^2.0.0" } }, + "find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "requires": { + "micromatch": "^4.0.2" + } + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -2621,6 +2941,18 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" }, + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, "fs-plus": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.1.1.tgz", @@ -2710,6 +3042,12 @@ "type-fest": "^0.20.2" } }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "grim": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/grim/-/grim-2.0.3.tgz", @@ -2841,6 +3179,12 @@ "has-tostringtag": "^1.0.0" } }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2860,6 +3204,12 @@ "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-number-object": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", @@ -2912,6 +3262,15 @@ "call-bind": "^1.0.2" } }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3030,6 +3389,25 @@ "minimist": "^1.2.0" } }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11" + } + }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -3064,6 +3442,16 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3073,9 +3461,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, "mkdirp": { "version": "0.5.5", @@ -3156,6 +3544,16 @@ "wrappy": "1" } }, + "open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -3206,6 +3604,39 @@ "callsites": "^3.0.0" } }, + "patch-package": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-7.0.0.tgz", + "integrity": "sha512-eYunHbnnB2ghjTNc5iL1Uo7TsGMuXk0vibX3RFcE/CdVdXzmdbMsG/4K4IgoSuIkLTI5oHrMQk4+NkFqSed0BQ==", + "dev": true, + "requires": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^5.6.0", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -3228,6 +3659,12 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -3311,6 +3748,12 @@ "resolved": "https://registry.npmjs.org/sb-promisify/-/sb-promisify-2.0.2.tgz", "integrity": "sha1-QnelR1RIiqlnXYhuNU24lMm9yYE=" }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3335,6 +3778,12 @@ "object-inspect": "^1.9.0" } }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, "split2": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", @@ -3446,6 +3895,15 @@ "os-tmpdir": "~1.0.2" } }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tsconfig-paths": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", @@ -3498,6 +3956,12 @@ "underscore": "^1.9.1" } }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3546,6 +4010,12 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "yaml": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "dev": true } } } diff --git a/package.json b/package.json index bcd83d5..afbc156 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "devDependencies": { "atom-jasmine3-test-runner": "^5.2.11", "eslint-plugin-import": "^2.25.4", + "patch-package": "^7.0.0", "rimraf": "^3.0.2" }, "package-deps": [ @@ -158,6 +159,7 @@ }, "scripts": { "lint": "eslint . --fix", + "postinstall": "patch-package", "test.lint": "eslint .", "test": "atom --test spec" }, diff --git a/patches/atom-package-deps+8.0.0.patch b/patches/atom-package-deps+8.0.0.patch new file mode 100644 index 0000000..a87ab1e --- /dev/null +++ b/patches/atom-package-deps+8.0.0.patch @@ -0,0 +1,8 @@ +diff --git a/node_modules/atom-package-deps/lib/bin.js b/node_modules/atom-package-deps/lib/bin.js +index 4924c49..eb0295f 100755 +--- a/node_modules/atom-package-deps/lib/bin.js ++++ b/node_modules/atom-package-deps/lib/bin.js +@@ -1,2 +1,2 @@ + #!/usr/bin/env node +-"use strict";var e=require("path"),r=require("os"),t=require("child_process"),n=require("fs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(e),s=o(r),i=o(n);const c=s.default,l=/\s+at.*(?:\(|\s)(.*)\)?/,u=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,d=void 0===c.homedir?"":c.homedir();const p=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof r)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if("string"!=typeof t.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(0===r)return e;const n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))},f=(e,r)=>(r=Object.assign({pretty:!1},r),e.replace(/\\/g,"/").split("\n").filter((e=>{const r=e.match(l);if(null===r||!r[1])return!0;const t=r[1];return!t.includes(".app/Contents/Resources/electron.asar")&&!t.includes(".app/Contents/Resources/default_app.asar")&&!u.test(t)})).filter((e=>""!==e.trim())).map((e=>r.pretty?e.replace(l,((e,r)=>e.replace(r,r.replace(d,"~")))):e)).join("\n"));class y extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let r=(e=[...e].map((e=>e instanceof Error?e:null!==e&&"object"==typeof e?Object.assign(new Error(e.message),e):new Error(e)))).map((e=>"string"==typeof e.stack?f(e.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(e))).join("\n");r="\n"+p(r,4),super(r),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}const m=y;var g={exports:{}},h={exports:{}};const w=(e,r,t)=>new Promise(((n,o)=>{if(t=Object.assign({concurrency:1/0},t),"function"!=typeof r)throw new TypeError("Mapper function is required");const{concurrency:a}=t;if(!("number"==typeof a&&a>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${a}\` (${typeof a})`);const s=[],i=e[Symbol.iterator]();let c=!1,l=!1,u=0,d=0;const p=()=>{if(c)return;const e=i.next(),t=d;if(d++,e.done)return l=!0,void(0===u&&n(s));u++,Promise.resolve(e.value).then((e=>r(e,t))).then((e=>{s[t]=e,u--,p()}),(e=>{c=!0,o(e)}))};for(let e=0;e(await v(e,((e,t)=>Promise.all([r(e,t),e])),t)).filter((e=>Boolean(e[0]))).map((e=>e[1]));g.exports=E,g.exports.default=E;var b=g.exports;function k(e,r,n){let o;const a=async function(e,r,n){const o=t.spawn(e,r,n),a=new Promise(((e,r)=>{const t={stdout:o.stdout?[]:null,stderr:o.stderr?[]:null};o.on("error",r),o.stdout&&o.stdout.on("data",(function(e){t.stdout.push(e),n.handleStdout&&n.handleStdout(e)})),o.stderr&&o.stderr.on("data",(function(e){t.stderr.push(e),n.handleStderr&&n.handleStderr(e)})),o.on("close",(r=>{let o=null;null!=t.stdout&&(o=null===n.encoding||"buffer"===n.encoding?Buffer.concat(t.stdout):t.stdout.join(""));let a=null;null!=t.stderr&&(a=null===n.encoding||"buffer"===n.encoding?Buffer.concat(t.stderr):t.stderr.join("")),e({exitCode:r,stdout:o,stderr:a})}))}));return n.handleChildProcess(o),a}(e,r,{...n,handleChildProcess(e){o=e}});return a.kill=function(e){return o.kill(e)},a}async function x(e){return async function(e){var r;const{directory:t}=e;if(null==t)return null;let n=null;try{n=JSON.parse(await i.default.promises.readFile(a.default.join(t,"package.json"),"utf8"))}catch(e){return null}return null!==(r=null==n?void 0:n.version)&&void 0!==r?r:null}(e)}const j=async function(e){var r;const t=a.default.join(null!==(r=process.env.ATOM_HOME)&&void 0!==r?r:a.default.join(s.default.homedir(),".atom"),"packages",e);try{return await i.default.promises.access(t,i.default.constants.R_OK),t}catch(e){return null}};async function N(e){return await async function(e){let r=null;try{r=await i.default.promises.stat(e)}catch(e){}if(null==r||!r.isDirectory())throw new Error("[Package-Deps] Expected packageName to be a readable directory in Node.js invocation");let t=null;try{const r=await i.default.promises.readFile(a.default.join(e,"package.json"),"utf8");t=JSON.parse(r)}catch(e){}const n=null==t||"object"!=typeof t?[]:t["package-deps"];return Array.isArray(n)?n:[]}(e)}async function A(e){if(null==e.directory)return!0;if(null==e.minimumVersion)return!1;const r=await x(e);return null==r||1===function(e,r){for(var t=e.split("."),n=r.split("."),o=0;o<3;o++){var a=Number(t[o]),s=Number(n[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}(e.minimumVersion,r)}const P=new Set(["✓","done"]),S=/(?:Installing|Moving) (.*?) to .* (.*)/;async function T(e){if("string"==typeof e)return{name:e,directory:await j(e)};if("name"in e)return{...e,directory:await j(e.name)};throw console.error("This package-deps entry is not valid. Please see https://github.com/steelbrain/package-deps#how-it-works",{entry:e}),Error("The package-deps entry is not valid. Please see https://github.com/steelbrain/package-deps#how-it-works")}const $=function({dependencies:e}){let r=!1;return console.log(`Installing dependencies:\n${e.map((e=>` - ${e.name}`)).join("\n")}`),{handleFailure({dependency:e,error:t}){var n;r=!0,console.error(`Unable to install ${e.name}, Error:`,null!==(n=null==t?void 0:t.stack)&&void 0!==n?n:t)},handleDependencyInstalled(e){console.log("Successfully installed",e.name)},handleComplete(){console.log("Installation complete"),r&&(process.exitCode=1)}}},O=async function({dependencies:e}){return e.map((e=>Array.isArray(e)?e[0]:e))};async function I(e,r=!1){!function(e,r){if(!e)throw new Error(null!=r?r:"Invariant violation")}("string"==typeof e&&e.length>0,"[Package-Deps] Package name is required");const t=await N(e);if(0===t.length)return;const n=await Promise.all(t.map((async e=>Array.isArray(e)?Promise.all(e.map(T)):T(e)))),o=await b(n,(async function(e){return Array.isArray(e)?(await Promise.all(e.map((e=>A(e))))).every(Boolean):A(e)}));if(0===o.length)return;let a;if(a=r?o.map((e=>Array.isArray(e)?e[0]:e)):await O({packageName:e,dependencies:o}),0===a.length)return;const s=$({packageName:e,dependencies:a});await(async(e,r,{concurrency:t=1/0,stopOnError:n=!0}={})=>new Promise(((o,a)=>{if("function"!=typeof r)throw new TypeError("Mapper function is required");if(!Number.isSafeInteger(t)&&t!==1/0||!(t>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);const s=[],i=[],c=e[Symbol.iterator]();let l=!1,u=!1,d=0,p=0;const f=()=>{if(l)return;const e=c.next(),t=p;if(p++,e.done)return u=!0,void(0===d&&(n||0===i.length?o(s):a(new m(i))));d++,(async()=>{try{const n=await e.value;s[t]=await r(n,t),d--,f()}catch(e){n?(l=!0,a(e)):(i.push(e),d--,f())}})()};for(let e=0;e"),process.exit(1));const[,,C,_]=process.argv,q="true"===_;(async function(){const e=a.default.resolve(process.cwd(),C);await I(e,q),console.log("All Done!")})().catch((e=>{var r;process.env.STEELBRAIN_DEBUG?console.error("Error:",null!==(r=null==e?void 0:e.stack)&&void 0!==r?r:e):(console.error("Error:",e.message),process.exit(1))})); ++"use strict";var e=require("path"),r=require("os"),t=require("child_process"),n=require("fs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(e),s=o(r),i=o(n);const c=s.default,l=/\s+at.*(?:\(|\s)(.*)\)?/,u=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,d=void 0===c.homedir?"":c.homedir();const p=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof r)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if("string"!=typeof t.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(0===r)return e;const n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))},f=(e,r)=>(r=Object.assign({pretty:!1},r),e.replace(/\\/g,"/").split("\n").filter((e=>{const r=e.match(l);if(null===r||!r[1])return!0;const t=r[1];return!t.includes(".app/Contents/Resources/electron.asar")&&!t.includes(".app/Contents/Resources/default_app.asar")&&!u.test(t)})).filter((e=>""!==e.trim())).map((e=>r.pretty?e.replace(l,((e,r)=>e.replace(r,r.replace(d,"~")))):e)).join("\n"));class y extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let r=(e=[...e].map((e=>e instanceof Error?e:null!==e&&"object"==typeof e?Object.assign(new Error(e.message),e):new Error(e)))).map((e=>"string"==typeof e.stack?f(e.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(e))).join("\n");r="\n"+p(r,4),super(r),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}const m=y;var g={exports:{}},h={exports:{}};const w=(e,r,t)=>new Promise(((n,o)=>{if(t=Object.assign({concurrency:1/0},t),"function"!=typeof r)throw new TypeError("Mapper function is required");const{concurrency:a}=t;if(!("number"==typeof a&&a>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${a}\` (${typeof a})`);const s=[],i=e[Symbol.iterator]();let c=!1,l=!1,u=0,d=0;const p=()=>{if(c)return;const e=i.next(),t=d;if(d++,e.done)return l=!0,void(0===u&&n(s));u++,Promise.resolve(e.value).then((e=>r(e,t))).then((e=>{s[t]=e,u--,p()}),(e=>{c=!0,o(e)}))};for(let e=0;e(await v(e,((e,t)=>Promise.all([r(e,t),e])),t)).filter((e=>Boolean(e[0]))).map((e=>e[1]));g.exports=E,g.exports.default=E;var b=g.exports;function k(e,r,n){let o;const a=async function(e,r,n){const o=t.spawn(e,r,n),a=new Promise(((e,r)=>{const t={stdout:o.stdout?[]:null,stderr:o.stderr?[]:null};o.on("error",r),o.stdout&&o.stdout.on("data",(function(e){t.stdout.push(e),n.handleStdout&&n.handleStdout(e)})),o.stderr&&o.stderr.on("data",(function(e){t.stderr.push(e),n.handleStderr&&n.handleStderr(e)})),o.on("close",(r=>{let o=null;null!=t.stdout&&(o=null===n.encoding||"buffer"===n.encoding?Buffer.concat(t.stdout):t.stdout.join(""));let a=null;null!=t.stderr&&(a=null===n.encoding||"buffer"===n.encoding?Buffer.concat(t.stderr):t.stderr.join("")),e({exitCode:r,stdout:o,stderr:a})}))}));return n.handleChildProcess(o),a}(e,r,{...n,handleChildProcess(e){o=e}});return a.kill=function(e){return o.kill(e)},a}async function x(e){return async function(e){var r;const{directory:t}=e;if(null==t)return null;let n=null;try{n=JSON.parse(await i.default.promises.readFile(a.default.join(t,"package.json"),"utf8"))}catch(e){return null}return null!==(r=null==n?void 0:n.version)&&void 0!==r?r:null}(e)}const j=async function(e){var r;const t=a.default.join(null!==(r=process.env.ATOM_HOME)&&void 0!==r?r:a.default.join(s.default.homedir(),".pulsar"),"packages",e);try{return await i.default.promises.access(t,i.default.constants.R_OK),t}catch(e){return null}};async function N(e){return await async function(e){let r=null;try{r=await i.default.promises.stat(e)}catch(e){}if(null==r||!r.isDirectory())throw new Error("[Package-Deps] Expected packageName to be a readable directory in Node.js invocation");let t=null;try{const r=await i.default.promises.readFile(a.default.join(e,"package.json"),"utf8");t=JSON.parse(r)}catch(e){}const n=null==t||"object"!=typeof t?[]:t["package-deps"];return Array.isArray(n)?n:[]}(e)}async function A(e){if(null==e.directory)return!0;if(null==e.minimumVersion)return!1;const r=await x(e);return null==r||1===function(e,r){for(var t=e.split("."),n=r.split("."),o=0;o<3;o++){var a=Number(t[o]),s=Number(n[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}(e.minimumVersion,r)}const P=new Set(["✓","done"]),S=/(?:Installing|Moving) (.*?) to .* (.*)/;async function T(e){if("string"==typeof e)return{name:e,directory:await j(e)};if("name"in e)return{...e,directory:await j(e.name)};throw console.error("This package-deps entry is not valid. Please see https://github.com/steelbrain/package-deps#how-it-works",{entry:e}),Error("The package-deps entry is not valid. Please see https://github.com/steelbrain/package-deps#how-it-works")}const $=function({dependencies:e}){let r=!1;return console.log(`Installing dependencies:\n${e.map((e=>` - ${e.name}`)).join("\n")}`),{handleFailure({dependency:e,error:t}){var n;r=!0,console.error(`Unable to install ${e.name}, Error:`,null!==(n=null==t?void 0:t.stack)&&void 0!==n?n:t)},handleDependencyInstalled(e){console.log("Successfully installed",e.name)},handleComplete(){console.log("Installation complete"),r&&(process.exitCode=1)}}},O=async function({dependencies:e}){return e.map((e=>Array.isArray(e)?e[0]:e))};async function I(e,r=!1){!function(e,r){if(!e)throw new Error(null!=r?r:"Invariant violation")}("string"==typeof e&&e.length>0,"[Package-Deps] Package name is required");const t=await N(e);if(0===t.length)return;const n=await Promise.all(t.map((async e=>Array.isArray(e)?Promise.all(e.map(T)):T(e)))),o=await b(n,(async function(e){return Array.isArray(e)?(await Promise.all(e.map((e=>A(e))))).every(Boolean):A(e)}));if(0===o.length)return;let a;if(a=r?o.map((e=>Array.isArray(e)?e[0]:e)):await O({packageName:e,dependencies:o}),0===a.length)return;const s=$({packageName:e,dependencies:a});await(async(e,r,{concurrency:t=1/0,stopOnError:n=!0}={})=>new Promise(((o,a)=>{if("function"!=typeof r)throw new TypeError("Mapper function is required");if(!Number.isSafeInteger(t)&&t!==1/0||!(t>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);const s=[],i=[],c=e[Symbol.iterator]();let l=!1,u=!1,d=0,p=0;const f=()=>{if(l)return;const e=c.next(),t=p;if(p++,e.done)return u=!0,void(0===d&&(n||0===i.length?o(s):a(new m(i))));d++,(async()=>{try{const n=await e.value;s[t]=await r(n,t),d--,f()}catch(e){n?(l=!0,a(e)):(i.push(e),d--,f())}})()};for(let e=0;e"),process.exit(1));const[,,C,_]=process.argv,q="true"===_;(async function(){const e=a.default.resolve(process.cwd(),C);await I(e,q),console.log("All Done!")})().catch((e=>{var r;process.env.STEELBRAIN_DEBUG?console.error("Error:",null!==(r=null==e?void 0:e.stack)&&void 0!==r?r:e):(console.error("Error:",e.message),process.exit(1))})); diff --git a/spec/node-bin-spec.js b/spec/node-bin-spec.js index 908faf5..f8d43eb 100644 --- a/spec/node-bin-spec.js +++ b/spec/node-bin-spec.js @@ -1,4 +1,5 @@ 'use babel'; +import { homedir } from 'os'; import * as Path from 'path'; import * as FS from 'fs'; import { @@ -9,7 +10,7 @@ import { import rimraf from 'rimraf'; import linterEslintNode from '../lib/main'; -const root = Path.normalize(process.env.HOME); +const root = Path.normalize(homedir()); const paths = { eslint6: Path.join(root, 'with-eslint-6'), eslint7: Path.join(root, 'with-eslint-7'), diff --git a/spec/package-interaction-spec.js b/spec/package-interaction-spec.js index 2a78438..496ed42 100644 --- a/spec/package-interaction-spec.js +++ b/spec/package-interaction-spec.js @@ -1,4 +1,5 @@ 'use babel'; +import { homedir } from 'os'; import * as Path from 'path'; import * as FS from 'fs'; import { @@ -10,14 +11,14 @@ import { import rimraf from 'rimraf'; import linterEslintNode from '../lib/main'; -const root = Path.normalize(process.env.HOME); +const root = Path.normalize(homedir()); const paths = { eslint6: Path.join(root, 'with-eslint-6'), eslint7: Path.join(root, 'with-eslint-7'), eslintLatest: Path.join(root, 'with-eslint-latest') }; -const packagesRoot = Path.join(root, '.atom', 'packages'); +const packagesRoot = Path.join(root, '.pulsar', 'packages'); const fixtureRoot = Path.join(__dirname, 'fixtures', 'ci', 'package-interaction'); async function expectNoNotification (fn) { diff --git a/windows-deps/package.json b/windows-deps/package.json new file mode 100644 index 0000000..5e08992 --- /dev/null +++ b/windows-deps/package.json @@ -0,0 +1 @@ +{ "package-deps": [ "linter", "linter-eslint" ] }