From dc4bc1ae48e9267156b74b358ad3d950a359b1b8 Mon Sep 17 00:00:00 2001 From: Opender Singh Date: Thu, 16 Dec 2021 13:08:45 +1300 Subject: [PATCH] Remove NPM build dependency for lerna packages (#4306) --- .github/workflows/test.yml | 10 +-- lerna.json | 3 +- package.json | 1 + packages/insomnia-app/scripts/build.ts | 10 +-- .../insomnia-send-request/package-lock.json | 69 ++++++++++--------- packages/insomnia-smoke-test/core/app.test.ts | 2 +- .../fixtures/inso-nedb/insomnia.Request.db | 2 +- 7 files changed, 52 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 254578332..bb14fe214 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -133,12 +133,12 @@ jobs: - name: Run Inso CLI smoke tests run: npm run test:smoke:cli - # - name: Build app for smoke tests - # run: npm run app-build:smoke + - name: Build app for smoke tests + run: npm run app-build:smoke - # - name: Run app smoke tests - # timeout-minutes: 10 # sometimes jest fails to exit - https://github.com/facebook/jest/issues/6423#issuecomment-620407580 - # run: npm run test:smoke:build + - name: Run app smoke tests + timeout-minutes: 10 # sometimes jest fails to exit - https://github.com/facebook/jest/issues/6423#issuecomment-620407580 + run: npm run test:smoke:build - name: Upload smoke test screenshots uses: actions/upload-artifact@v2 diff --git a/lerna.json b/lerna.json index dc969b80b..ac0b14de4 100644 --- a/lerna.json +++ b/lerna.json @@ -9,6 +9,7 @@ }, "packages": [ "packages/*", - "plugins/*" + "plugins/*", + "packages/insomnia-app/build" ] } diff --git a/package.json b/package.json index 57dca7b54..baa1ff4f5 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "lint:markdown": "markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"", "lint:fix": "lerna run lint:fix --stream --no-bail", "bootstrap": "npm install && lerna bootstrap && lerna run --stream bootstrap", + "bootstrap:electron-builder": "lerna bootstrap --no-ci -- --production --no-optional", "version": "lerna version --exact --preid beta", "version:all": "npm run version -- --force-publish", "version:dry": "npm run version -- --no-git-tag-version", diff --git a/packages/insomnia-app/scripts/build.ts b/packages/insomnia-app/scripts/build.ts index ff04dea64..8d6b849ab 100644 --- a/packages/insomnia-app/scripts/build.ts +++ b/packages/insomnia-app/scripts/build.ts @@ -115,11 +115,11 @@ const buildLicenseList = (relSource: string, relDest: string) => new Promise new Promise((resolve, reject) => { - const prefix = path.resolve(__dirname, relDir); +const install = () => new Promise((resolve, reject) => { + const root = path.resolve(__dirname, '../../../'); - const p = childProcess.spawn('npm', ['install', '--production', '--no-optional'], { - cwd: prefix, + const p = childProcess.spawn('npm', ['run', 'bootstrap:electron-builder'], { + cwd: root, shell: true, }); @@ -250,7 +250,7 @@ export const start = async ({ forceFromGitRef }: { forceFromGitRef: boolean }) = // Install Node modules console.log('[build] Installing dependencies'); - await install(buildFolder); + await install(); console.log('[build] Complete!'); return buildContext; diff --git a/packages/insomnia-send-request/package-lock.json b/packages/insomnia-send-request/package-lock.json index b3863ee1e..7c8fc91df 100644 --- a/packages/insomnia-send-request/package-lock.json +++ b/packages/insomnia-send-request/package-lock.json @@ -446,9 +446,9 @@ "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" }, "async-lock": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.2.4.tgz", - "integrity": "sha512-UBQJC2pbeyGutIfYmErGc9RaJYnpZ1FHaxuKwb0ahvGiiCkPUf3p67Io+YLPmmv3RHY+mF6JEtNW8FlHsraAaA==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.3.0.tgz", + "integrity": "sha512-8A7SkiisnEgME2zEedtDYPxUPzdv3x//E7n5IFktPAtMYSEAV7eNJF0rMwrVyUFj6d/8rgajLantbjcNRQYXIg==" }, "asynckit": { "version": "0.4.0", @@ -1066,14 +1066,14 @@ "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" }, "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "requires": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", - "universalify": "^1.0.0" + "universalify": "^2.0.0" } }, "fs-minipass": { @@ -1400,9 +1400,9 @@ } }, "httpsnippet": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/httpsnippet/-/httpsnippet-1.22.0.tgz", - "integrity": "sha512-umtG+usjz5JCtevTX2EgmSfwNnJOhMKF9HzF4rHecUY+CLoLZzZwOwyxUsvcAtB4l+VWjTbWMCIVZkprUBkPMw==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/httpsnippet/-/httpsnippet-1.25.0.tgz", + "integrity": "sha512-jobE6S923cLuf5BPG6Jf+oLBRkPzv2RPp0dwOHcWwj/t9FwV/t9hyZ46kpT3Q5DHn9iFNmGhrcmmFUBqyjoTQg==", "requires": { "chalk": "^1.1.1", "commander": "^2.9.0", @@ -1475,9 +1475,9 @@ } }, "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", + "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==" }, "ignore-walk": { "version": "3.0.4", @@ -1594,9 +1594,9 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isomorphic-git": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.7.4.tgz", - "integrity": "sha512-gzVg61bZLmfojR287p+nT9bbuFhSH0Us9f6pRVp4J9CA/1A/mghBEvcsCgRxalv+XKJ1sQMxWTc90tzn8WnYVA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.10.2.tgz", + "integrity": "sha512-7xOTzip9zUihf+enjUDfCJbyr0MHhnOWuE/xgbAktt86nZi4VLc/FORpnv2aBVBF2idgqichGG8DHYJ9PPPChA==", "requires": { "async-lock": "^1.1.0", "clean-git-ref": "^2.0.1", @@ -1692,12 +1692,12 @@ "integrity": "sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w==" }, "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "requires": { "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "universalify": "^2.0.0" } }, "jsonlint": { @@ -1802,9 +1802,9 @@ "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" }, "marked": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-1.1.1.tgz", - "integrity": "sha512-mJzT8D2yPxoPh7h0UXkB+dBj4FykPJ2OIfxAWeIHrvoHDkFxukV/29QxoFQoPM6RLEwhIFdJpmKBlqVM3s2ZIw==" + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.9.tgz", + "integrity": "sha512-H8lIX2SvyitGX+TRdtS06m1jHMijKN/XjfH6Ooii9fvxMlh8QdqBfBDkGUpMWH2kQNrtixjzYUa3SH8ROTgRRw==" }, "md5": { "version": "2.3.0", @@ -2861,6 +2861,11 @@ "yallist": "^4.0.0" }, "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -2961,9 +2966,9 @@ "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" }, "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "unpipe": { "version": "1.0.0", @@ -2999,9 +3004,9 @@ "integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==" }, "uuid": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.2.0.tgz", - "integrity": "sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q==" + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "verror": { "version": "1.10.0", @@ -3014,9 +3019,9 @@ } }, "whatwg-fetch": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.2.0.tgz", - "integrity": "sha512-SdGPoQMMnzVYThUbSrEvqTlkvC1Ux27NehaJ/GUHBfNrh5Mjg+1/uRyFMwVnxO2MrikMWvWAqUGgQOfVU4hT7w==" + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", + "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" }, "which": { "version": "2.0.2", diff --git a/packages/insomnia-smoke-test/core/app.test.ts b/packages/insomnia-smoke-test/core/app.test.ts index 132842776..a69909e8c 100644 --- a/packages/insomnia-smoke-test/core/app.test.ts +++ b/packages/insomnia-smoke-test/core/app.test.ts @@ -29,7 +29,7 @@ describe('Application launch', function() { }); it('sends JSON request', async () => { - const url = 'http://127.0.0.1:4010/pets/1'; + const url = 'http://127.0.0.1:4010/pets/{% now \'millis\', \'\' %}'; await client.correctlyLaunched(app); await onboarding.skipOnboardingFlow(app); diff --git a/packages/insomnia-smoke-test/fixtures/inso-nedb/insomnia.Request.db b/packages/insomnia-smoke-test/fixtures/inso-nedb/insomnia.Request.db index fb61098d1..ea39bb40e 100644 --- a/packages/insomnia-smoke-test/fixtures/inso-nedb/insomnia.Request.db +++ b/packages/insomnia-smoke-test/fixtures/inso-nedb/insomnia.Request.db @@ -1,4 +1,4 @@ -{"_id":"req_f2cd394aad83485c8f7bee1b612165d5","type":"Request","parentId":"wrk_6bd09cdcf3c543829315b479f359ae48","modified":1632964798467,"created":1632964791930,"url":"{{ base_url }}/pets/1234","name":"Echo ID 1234","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1632964774178,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"} +{"_id":"req_f2cd394aad83485c8f7bee1b612165d5","type":"Request","parentId":"wrk_6bd09cdcf3c543829315b479f359ae48","modified":1639463687416,"created":1632964791930,"url":"{{ base_url }}/pets/{% now 'millis', '' %}","name":"Echo ID 1234","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1632964774178,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"} {"_id":"req_wrk_6bd09cdcf3c543829315b479f359ae480ce31489","type":"Request","parentId":"fld_wrk_6bd09cdcf3c543829315b479f359ae4835d0f5fb","modified":1632964774223,"created":1632964774223,"url":"{{ base_url }}/auth/basic","name":"Make basic auth request","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{"type":"basic","username":"{{ httpUsername }}","password":"{{ httpPassword }}"},"metaSortKey":-1632964774223,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"} {"_id":"req_wrk_6bd09cdcf3c543829315b479f359ae4845608a40","type":"Request","parentId":"fld_wrk_6bd09cdcf3c543829315b479f359ae482c3cafa4","modified":1632964774225,"created":1632964774225,"url":"{{ base_url }}/file/dummy.csv","name":"Get dummy CSV file","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1632964774225,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"} {"_id":"req_wrk_6bd09cdcf3c543829315b479f359ae48773f3890","type":"Request","parentId":"fld_wrk_6bd09cdcf3c543829315b479f359ae480a893ece","modified":1632964774220,"created":1632964774220,"url":"{{ base_url }}/delay/seconds/{{ duration }}","name":"Delay by seconds","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1632964774220,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"}