From 8ab4798181d6499553c592cf66606e14c7358e33 Mon Sep 17 00:00:00 2001 From: Ayush C <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:47:10 -0400 Subject: [PATCH 01/22] docs: update badge link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4310f741a..f54783708 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # nw-builder -[![npm](https://img.shields.io/npm/v/nw-builder/latest)](https://www.npmjs.com/package/nw-builder) +[![npm](https://img.shields.io/npm/v/nw-builder/latest)](https://www.npmjs.com/package/nw-builder/v/latest) [![Join the chat at https://gitter.im/nwjs/nw-builder](https://badges.gitter.im/nwjs/nw-builder.svg)](https://app.gitter.im/#/room/#nwjs_nw-builder:gitter.im) Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and Linux. From b8cff8b26ab72404527e61f571d7f79e1131a6b4 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra Date: Thu, 24 Aug 2023 13:57:41 -0400 Subject: [PATCH 02/22] docs: update Gitter badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4310f741a..ffc283de1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # nw-builder [![npm](https://img.shields.io/npm/v/nw-builder/latest)](https://www.npmjs.com/package/nw-builder) -[![Join the chat at https://gitter.im/nwjs/nw-builder](https://badges.gitter.im/nwjs/nw-builder.svg)](https://app.gitter.im/#/room/#nwjs_nw-builder:gitter.im) +[![Join the chat at https://gitter.im/nwjs/nw-builder](https://badges.gitter.im/repo.svg)](https://app.gitter.im/#/room/#nwjs_nw-builder:gitter.im) Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and Linux. From efde4fa9b634053e9876e80f403dda1280a0aa2a Mon Sep 17 00:00:00 2001 From: Ayush C <14110965+ayushmanchhabra@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:32:46 -0400 Subject: [PATCH 03/22] ci: add Node 16, 18 and 20 (#935) Co-authored-by: Ayushman Chhabra --- .github/workflows/doc.yml | 6 +++--- .github/workflows/e2e.yml | 41 ++++++++++++++++++++++----------------- .github/workflows/npm.yml | 6 +++--- package.json | 4 ++-- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 96fbf5f2f..713f60f2c 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -8,10 +8,10 @@ jobs: doc: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3.3.0 - - uses: actions/setup-node@v3.6.0 + - uses: actions/checkout@v3.6.0 + - uses: actions/setup-node@v3.8.1 with: - node-version: "20.5.0" + node-version: "20.5.1" - name: Install Node modules run: npm ci - name: Convert JSDoc to Markdown diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 86adcfdeb..f3d32abed 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -4,36 +4,41 @@ on: pull_request: branches: [main] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: e2e: strategy: matrix: - include: - - { os: macos-12, shell: bash } - - { os: ubuntu-22.04, shell: bash } - - { os: windows-2022, shell: powershell } - # https://github.com/orgs/community/discussions/27143 + os: [macos-12, ubuntu-22.04, windows-2022] + node: [16, 18, 20] fail-fast: false runs-on: ${{ matrix.os }} - defaults: - run: - shell: ${{ matrix.shell }} steps: - name: Install packages uses: ConorMacBride/install-package@v1.1.0 with: brew: unzip - name: Checkout repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.6.0 - name: Setup Node - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: - node-version: "20.5.0" + node-version: ${{ matrix.node }} cache: "npm" - - run: corepack enable - - run: npm ci - - run: npm run ci:fmt - - run: npm run ci:lnt - - run: npm link nw-builder - - run: npm run test:unit - - run: npm run test:e2e + - name: Enable corepack + run: corepack enable + - name: Install dependencies + run: npm ci + - name: Check for formatting errors + run: npm run ci:fmt + - name: Check for linting errors + run: npm run ci:lnt + - name: Link module + run: npm link nw-builder + - name: Run unit tests + run: npm run test:unit + - name: Run Selenium tests + run: npm run test:e2e diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 10820d8a8..f424dea8f 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -8,10 +8,10 @@ jobs: npm: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3.3.0 - - uses: actions/setup-node@v3.6.0 + - uses: actions/checkout@v3.6.0 + - uses: actions/setup-node@v3.8.1 with: - node-version: "20.5.0" + node-version: "20.5.1" - run: npm ci - uses: JS-DevTools/npm-publish@v2.2.1 diff --git a/package.json b/package.json index 3482a30e2..73935f4a6 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "lnt": "eslint --config=cfg/eslint.config.cjs --fix cfg src test", "doc:dev": "concurrently --kill-others \"node cfg/fswatch.config.js\" \"vitepress dev doc\"", "doc:bld": "vitepress build doc", - "test:unit": "node --test-reporter=spec --test test/unit/index.js", - "test:e2e": "node --test-reporter=spec --test test/e2e/index.js", + "test:unit": "node --test test/unit/index.js", + "test:e2e": "node --test test/e2e/index.js", "test:mod": "cd test/fixture && node demo.js", "test:cli": "cd test/fixture && nwbuild --platform win --arch x64 --outDir out --no-glob app" }, From 75ad1fafb988628b2262d467b1133bb2de1080e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Aug 2023 23:34:30 +0000 Subject: [PATCH 04/22] chore(deps-dev): bump prettier from 3.0.2 to 3.0.3 (#941) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 62e466520..2e9631325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3690,9 +3690,9 @@ } }, "node_modules/prettier": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", - "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" From 5f783904212560b47d36d7c17853c168a12cea79 Mon Sep 17 00:00:00 2001 From: Ayush C <14110965+ayushmanchhabra@users.noreply.github.com> Date: Wed, 30 Aug 2023 23:58:49 -0400 Subject: [PATCH 05/22] build(dependabot): batch updates --- .github/dependabot.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1b0dc1ef1..6dff5c19d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,8 +3,18 @@ updates: - package-ecosystem: "npm" directory: "." schedule: - interval: "daily" + interval: "weekly" + day: "saturday" + groups: + npm: + patterns: + - "*" - package-ecosystem: "github-actions" directory: ".github/" schedule: - interval: "daily" + interval: "weekly" + day: "saturday" + groups: + gha: + patterns: + - "*" From d09b42530be7cd26106c33da9cbd52e8a6a3d2dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 04:19:24 +0000 Subject: [PATCH 06/22] chore(deps): bump the npm group with 5 updates (#942) --- package-lock.json | 371 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 178 insertions(+), 195 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e9631325..7548a3dff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "compressing": "^1.9.0", "glob": "^10.3.3", "plist": "^3.1.0", - "rcedit": "^3.0.1", + "rcedit": "^4.0.0", "winston": "^3.9.0", "yargs": "^17.7.2" }, @@ -258,36 +258,37 @@ } }, "node_modules/@docsearch/css": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.1.tgz", - "integrity": "sha512-2Pu9HDg/uP/IT10rbQ+4OrTQuxIWdKVUEdcw9/w7kZJv9NeHS6skJx1xuRiFyoGKwAzcHXnLp7csE99sj+O1YA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.2.tgz", + "integrity": "sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==", "dev": true }, "node_modules/@docsearch/js": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.5.1.tgz", - "integrity": "sha512-EXi8de5njxgP6TV3N9ytnGRLG9zmBNTEZjR4VzwPcpPLbZxxTLG2gaFyJyKiFVQxHW/DPlMrDJA3qoRRGEkgZw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.5.2.tgz", + "integrity": "sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==", "dev": true, "dependencies": { - "@docsearch/react": "3.5.1", + "@docsearch/react": "3.5.2", "preact": "^10.0.0" } }, "node_modules/@docsearch/react": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.5.1.tgz", - "integrity": "sha512-t5mEODdLzZq4PTFAm/dvqcvZFdPDMdfPE5rJS5SC8OUq9mPzxEy6b+9THIqNM9P0ocCb4UC5jqBrxKclnuIbzQ==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.5.2.tgz", + "integrity": "sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==", "dev": true, "dependencies": { "@algolia/autocomplete-core": "1.9.3", "@algolia/autocomplete-preset-algolia": "1.9.3", - "@docsearch/css": "3.5.1", - "algoliasearch": "^4.0.0" + "@docsearch/css": "3.5.2", + "algoliasearch": "^4.19.1" }, "peerDependencies": { "@types/react": ">= 16.8.0 < 19.0.0", "react": ">= 16.8.0 < 19.0.0", - "react-dom": ">= 16.8.0 < 19.0.0" + "react-dom": ">= 16.8.0 < 19.0.0", + "search-insights": ">= 1 < 3" }, "peerDependenciesMeta": { "@types/react": { @@ -298,6 +299,9 @@ }, "react-dom": { "optional": true + }, + "search-insights": { + "optional": true } } }, @@ -325,9 +329,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.16.tgz", - "integrity": "sha512-gCHjjQmA8L0soklKbLKA6pgsLk1byULuHe94lkZDzcO3/Ta+bbeewJioEn1Fr7kgy9NWNFy/C+MrBwC6I/WCug==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], @@ -341,9 +345,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.16.tgz", - "integrity": "sha512-wsCqSPqLz+6Ov+OM4EthU43DyYVVyfn15S4j1bJzylDpc1r1jZFFfJQNfDuT8SlgwuqpmpJXK4uPlHGw6ve7eA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], @@ -357,9 +361,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.16.tgz", - "integrity": "sha512-ldsTXolyA3eTQ1//4DS+E15xl0H/3DTRJaRL0/0PgkqDsI0fV/FlOtD+h0u/AUJr+eOTlZv4aC9gvfppo3C4sw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], @@ -373,9 +377,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.16.tgz", - "integrity": "sha512-aBxruWCII+OtluORR/KvisEw0ALuw/qDQWvkoosA+c/ngC/Kwk0lLaZ+B++LLS481/VdydB2u6tYpWxUfnLAIw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -389,9 +393,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.16.tgz", - "integrity": "sha512-6w4Dbue280+rp3LnkgmriS1icOUZDyPuZo/9VsuMUTns7SYEiOaJ7Ca1cbhu9KVObAWfmdjUl4gwy9TIgiO5eA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], @@ -405,9 +409,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.16.tgz", - "integrity": "sha512-x35fCebhe9s979DGKbVAwXUOcTmCIE32AIqB9CB1GralMIvxdnMLAw5CnID17ipEw9/3MvDsusj/cspYt2ZLNQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], @@ -421,9 +425,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.16.tgz", - "integrity": "sha512-YM98f+PeNXF3GbxIJlUsj+McUWG1irguBHkszCIwfr3BXtXZsXo0vqybjUDFfu9a8Wr7uUD/YSmHib+EeGAFlg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], @@ -437,9 +441,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.16.tgz", - "integrity": "sha512-b5ABb+5Ha2C9JkeZXV+b+OruR1tJ33ePmv9ZwMeETSEKlmu/WJ45XTTG+l6a2KDsQtJJ66qo/hbSGBtk0XVLHw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], @@ -453,9 +457,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.16.tgz", - "integrity": "sha512-XIqhNUxJiuy+zsR77+H5Z2f7s4YRlriSJKtvx99nJuG5ATuJPjmZ9n0ANgnGlPCpXGSReFpgcJ7O3SMtzIFeiQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], @@ -469,9 +473,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.16.tgz", - "integrity": "sha512-no+pfEpwnRvIyH+txbBAWtjxPU9grslmTBfsmDndj7bnBmr55rOo/PfQmRfz7Qg9isswt1FP5hBbWb23fRWnow==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], @@ -485,9 +489,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.16.tgz", - "integrity": "sha512-Zbnczs9ZXjmo0oZSS0zbNlJbcwKXa/fcNhYQjahDs4Xg18UumpXG/lwM2lcSvHS3mTrRyCYZvJbmzYc4laRI1g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], @@ -501,9 +505,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.16.tgz", - "integrity": "sha512-YMF7hih1HVR/hQVa/ot4UVffc5ZlrzEb3k2ip0nZr1w6fnYypll9td2qcoMLvd3o8j3y6EbJM3MyIcXIVzXvQQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], @@ -517,9 +521,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.16.tgz", - "integrity": "sha512-Wkz++LZ29lDwUyTSEnzDaaP5OveOgTU69q9IyIw9WqLRxM4BjTBjz9un4G6TOvehWpf/J3gYVFN96TjGHrbcNQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], @@ -533,9 +537,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.16.tgz", - "integrity": "sha512-LFMKZ30tk78/mUv1ygvIP+568bwf4oN6reG/uczXnz6SvFn4e2QUFpUpZY9iSJT6Qpgstrhef/nMykIXZtZWGQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], @@ -549,9 +553,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.16.tgz", - "integrity": "sha512-3ZC0BgyYHYKfZo3AV2/66TD/I9tlSBaW7eWTEIkrQQKfJIifKMMttXl9FrAg+UT0SGYsCRLI35Gwdmm96vlOjg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], @@ -565,9 +569,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.16.tgz", - "integrity": "sha512-xu86B3647DihHJHv/wx3NCz2Dg1gjQ8bbf9cVYZzWKY+gsvxYmn/lnVlqDRazObc3UMwoHpUhNYaZset4X8IPA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -581,9 +585,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.16.tgz", - "integrity": "sha512-uVAgpimx9Ffw3xowtg/7qQPwHFx94yCje+DoBx+LNm2ePDpQXHrzE+Sb0Si2VBObYz+LcRps15cq+95YM7gkUw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], @@ -597,9 +601,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.16.tgz", - "integrity": "sha512-6OjCQM9wf7z8/MBi6BOWaTL2AS/SZudsZtBziXMtNI8r/U41AxS9x7jn0ATOwVy08OotwkPqGRMkpPR2wcTJXA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], @@ -613,9 +617,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.16.tgz", - "integrity": "sha512-ZoNkruFYJp9d1LbUYCh8awgQDvB9uOMZqlQ+gGEZR7v6C+N6u7vPr86c+Chih8niBR81Q/bHOSKGBK3brJyvkQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], @@ -629,9 +633,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.16.tgz", - "integrity": "sha512-+j4anzQ9hrs+iqO+/wa8UE6TVkKua1pXUb0XWFOx0FiAj6R9INJ+WE//1/Xo6FG1vB5EpH3ko+XcgwiDXTxcdw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], @@ -645,9 +649,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.16.tgz", - "integrity": "sha512-5PFPmq3sSKTp9cT9dzvI67WNfRZGvEVctcZa1KGjDDu4n3H8k59Inbk0du1fz0KrAbKKNpJbdFXQMDUz7BG4rQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], @@ -661,9 +665,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.16.tgz", - "integrity": "sha512-sCIVrrtcWN5Ua7jYXNG1xD199IalrbfV2+0k/2Zf2OyV2FtnQnMgdzgpRAbi4AWlKJj1jkX+M+fEGPQj6BQB4w==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], @@ -724,9 +728,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -943,19 +947,6 @@ "integrity": "sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==", "dev": true }, - "node_modules/@vitejs/plugin-vue": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz", - "integrity": "sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==", - "dev": true, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.0.0", - "vue": "^3.2.25" - } - }, "node_modules/@vue/compiler-core": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", @@ -1075,14 +1066,14 @@ "dev": true }, "node_modules/@vueuse/core": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.3.0.tgz", - "integrity": "sha512-BEM5yxcFKb5btFjTSAFjTu5jmwoW66fyV9uJIP4wUXXU8aR5Hl44gndaaXp7dC5HSObmgbnR2RN+Un1p68Mf5Q==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.4.1.tgz", + "integrity": "sha512-DkHIfMIoSIBjMgRRvdIvxsyboRZQmImofLyOHADqiVbQVilP8VVHDhBX2ZqoItOgu7dWa8oXiNnScOdPLhdEXg==", "dev": true, "dependencies": { "@types/web-bluetooth": "^0.0.17", - "@vueuse/metadata": "10.3.0", - "@vueuse/shared": "10.3.0", + "@vueuse/metadata": "10.4.1", + "@vueuse/shared": "10.4.1", "vue-demi": ">=0.14.5" }, "funding": { @@ -1090,9 +1081,9 @@ } }, "node_modules/@vueuse/core/node_modules/vue-demi": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", - "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", + "version": "0.14.6", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", + "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { @@ -1116,13 +1107,13 @@ } }, "node_modules/@vueuse/integrations": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/integrations/-/integrations-10.3.0.tgz", - "integrity": "sha512-Jgiv7oFyIgC6BxmDtiyG/fxyGysIds00YaY7sefwbhCZ2/tjEx1W/1WcsISSJPNI30in28+HC2J4uuU8184ekg==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@vueuse/integrations/-/integrations-10.4.1.tgz", + "integrity": "sha512-uRBPyG5Lxoh1A/J+boiioPT3ELEAPEo4t8W6Mr4yTKIQBeW/FcbsotZNPr4k9uz+3QEksMmflWloS9wCnypM7g==", "dev": true, "dependencies": { - "@vueuse/core": "10.3.0", - "@vueuse/shared": "10.3.0", + "@vueuse/core": "10.4.1", + "@vueuse/shared": "10.4.1", "vue-demi": ">=0.14.5" }, "funding": { @@ -1182,9 +1173,9 @@ } }, "node_modules/@vueuse/integrations/node_modules/vue-demi": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", - "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", + "version": "0.14.6", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", + "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { @@ -1208,18 +1199,18 @@ } }, "node_modules/@vueuse/metadata": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.3.0.tgz", - "integrity": "sha512-Ema3YhNOa4swDsV0V7CEY5JXvK19JI/o1szFO1iWxdFg3vhdFtCtSTP26PCvbUpnUtNHBY2wx5y3WDXND5Pvnw==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.4.1.tgz", + "integrity": "sha512-2Sc8X+iVzeuMGHr6O2j4gv/zxvQGGOYETYXEc41h0iZXIRnRbJZGmY/QP8dvzqUelf8vg0p/yEA5VpCEu+WpZg==", "dev": true, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@vueuse/shared": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.3.0.tgz", - "integrity": "sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.4.1.tgz", + "integrity": "sha512-vz5hbAM4qA0lDKmcr2y3pPdU+2EVw/yzfRsBdu+6+USGa4PxqSQRYIUC9/NcT06y+ZgaTsyURw2I9qOFaaXHAg==", "dev": true, "dependencies": { "vue-demi": ">=0.14.5" @@ -1229,9 +1220,9 @@ } }, "node_modules/@vueuse/shared/node_modules/vue-demi": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", - "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", + "version": "0.14.6", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", + "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { @@ -1450,12 +1441,6 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, - "node_modules/body-scroll-lock": { - "version": "4.0.0-beta.0", - "resolved": "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-4.0.0-beta.0.tgz", - "integrity": "sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==", - "dev": true - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1784,9 +1769,9 @@ "dev": true }, "node_modules/compressing": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/compressing/-/compressing-1.9.1.tgz", - "integrity": "sha512-5fyyxjvFRbY7/FEzmqUTSXQdyUA+ETsBEjLHqsYnWbZrZbE7aqyiHCGWHWYD1Xpq83O2b4geN0ctDccRyRjZwg==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/compressing/-/compressing-1.10.0.tgz", + "integrity": "sha512-k2vpbZLaJoHe9euyUZjYYE8vOrbR19aU3HcWIYw5EBXiUs34ygfDVnXU+ubI41JXMriHutnoiu0ZFdwCkH6jPA==", "dependencies": { "@eggjs/yauzl": "^2.11.0", "flushwritable": "^1.0.0", @@ -2037,9 +2022,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.16", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.16.tgz", - "integrity": "sha512-1xLsOXrDqwdHxyXb/x/SOyg59jpf/SH7YMvU5RNSU7z3TInaASNJWNFJ6iRvLvLETZMasF3d1DdZLg7sgRimRQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2049,28 +2034,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.16", - "@esbuild/android-arm64": "0.18.16", - "@esbuild/android-x64": "0.18.16", - "@esbuild/darwin-arm64": "0.18.16", - "@esbuild/darwin-x64": "0.18.16", - "@esbuild/freebsd-arm64": "0.18.16", - "@esbuild/freebsd-x64": "0.18.16", - "@esbuild/linux-arm": "0.18.16", - "@esbuild/linux-arm64": "0.18.16", - "@esbuild/linux-ia32": "0.18.16", - "@esbuild/linux-loong64": "0.18.16", - "@esbuild/linux-mips64el": "0.18.16", - "@esbuild/linux-ppc64": "0.18.16", - "@esbuild/linux-riscv64": "0.18.16", - "@esbuild/linux-s390x": "0.18.16", - "@esbuild/linux-x64": "0.18.16", - "@esbuild/netbsd-x64": "0.18.16", - "@esbuild/openbsd-x64": "0.18.16", - "@esbuild/sunos-x64": "0.18.16", - "@esbuild/win32-arm64": "0.18.16", - "@esbuild/win32-ia32": "0.18.16", - "@esbuild/win32-x64": "0.18.16" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/escalade": { @@ -2094,15 +2079,15 @@ } }, "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", + "@eslint/js": "8.48.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2532,9 +2517,9 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -2581,9 +2566,9 @@ } }, "node_modules/glob": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", - "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz", + "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", @@ -3198,9 +3183,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", - "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", + "version": "0.30.3", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", + "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -3643,9 +3628,9 @@ } }, "node_modules/postcss": { - "version": "8.4.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", - "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", + "version": "8.4.29", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", + "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", "dev": true, "funding": [ { @@ -3671,9 +3656,9 @@ } }, "node_modules/preact": { - "version": "10.16.0", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.16.0.tgz", - "integrity": "sha512-XTSj3dJ4roKIC93pald6rWuB2qQJO9gO2iLLyTe87MrjQN+HklueLsmskbywEWqCHlclgz3/M4YLL2iBr9UmMA==", + "version": "10.17.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.17.1.tgz", + "integrity": "sha512-X9BODrvQ4Ekwv9GURm9AKAGaomqXmip7NQTZgY7gcNmr7XE83adOMJvd3N42id1tMFU7ojiynRsYnY6/BRFxLA==", "dev": true, "funding": { "type": "opencollective", @@ -3748,14 +3733,14 @@ ] }, "node_modules/rcedit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-3.1.0.tgz", - "integrity": "sha512-WRlRdY1qZbu1L11DklT07KuHfRk42l0NFFJdaExELEu4fEQ982bP5Z6OWGPj/wLLIuKRQDCxZJGAwoFsxhZhNA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-4.0.0.tgz", + "integrity": "sha512-OIPwu2e0b2WF4urFMcdiYUZGjmwh5pa52Mt847MK7ovxHkjpiPaI4Ov2atjeKTNFo4Tas0G31Qm7K21t87hp+g==", "dependencies": { "cross-spawn-windows-exe": "^1.1.0" }, "engines": { - "node": ">= 10.0.0" + "node": ">= 14.0.0" } }, "node_modules/readable-stream": { @@ -3942,9 +3927,9 @@ } }, "node_modules/rollup": { - "version": "3.28.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", - "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", + "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -4008,13 +3993,13 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/search-insights": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.7.0.tgz", - "integrity": "sha512-GLbVaGgzYEKMvuJbHRhLi1qoBFnjXZGZ6l4LxOYPCp4lI2jDRB3jPU9/XNhMwv6kvnA9slTreq6pvK+b3o3aqg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.8.0.tgz", + "integrity": "sha512-VzI4PMktJbydkbrF3/n40vFfRxdwg+o3CkQt0F3mHRSXVuv0PsVxQvB6mQQq/e9MCXAemcmp/GP9CNHpayFoCw==", "dev": true, "peer": true, "engines": { - "node": ">=8.16.0" + "node": ">=16.0.0" } }, "node_modules/selenium-webdriver": { @@ -4640,18 +4625,16 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.4", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.4.tgz", - "integrity": "sha512-JCQ89Bm6ECUTnyzyas3JENo00UDJeK8q1SUQyJYou+4Yz5BKEc/F3O21cu++DnUT2zXc0kvQ2Aj4BZCc/nioXQ==", + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.10.tgz", + "integrity": "sha512-+MsahIWqq5WUEmj6MR4obcKYbT7im07jZPCQPdNJExkeOSbOAJ4xypSLx88x7rvtzWHhHc5aXbOhCRvGEGjFrw==", "dev": true, "dependencies": { - "@docsearch/css": "^3.5.1", - "@docsearch/js": "^3.5.1", - "@vitejs/plugin-vue": "^4.2.3", + "@docsearch/css": "^3.5.2", + "@docsearch/js": "^3.5.2", "@vue/devtools-api": "^6.5.0", - "@vueuse/core": "^10.3.0", - "@vueuse/integrations": "^10.3.0", - "body-scroll-lock": "4.0.0-beta.0", + "@vueuse/core": "^10.4.1", + "@vueuse/integrations": "^10.4.1", "focus-trap": "^7.5.2", "mark.js": "8.11.1", "minisearch": "^6.1.0", diff --git a/package.json b/package.json index 73935f4a6..0a3b92254 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "compressing": "^1.9.0", "glob": "^10.3.3", "plist": "^3.1.0", - "rcedit": "^3.0.1", + "rcedit": "^4.0.0", "winston": "^3.9.0", "yargs": "^17.7.2" }, From 1a03b6387b59e3069870ec417c36e1b9a686b3a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 20:44:30 +0000 Subject: [PATCH 07/22] chore(deps-dev): bump the npm group with 1 update (#943) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7548a3dff..51d4fc4e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4003,9 +4003,9 @@ } }, "node_modules/selenium-webdriver": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.11.1.tgz", - "integrity": "sha512-bvrnr3UZlLScErOmn8gV6cqc+1PYDHn0575CxUR2U14fMWt7OKxSy0lAThhZq4sq4d1HqP8ebz11oiHSlAQ2WA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.12.0.tgz", + "integrity": "sha512-zvPzmTsky6WfO6+BGMj2mCJsw7qKnfQONur2b+pGn8jeTiC+WAUOthZOnaK+HkX5wiU6L4uoMF+JIcOVstp25A==", "dev": true, "dependencies": { "jszip": "^3.10.1", From 51368bc3f533acba0ddb1be99c972011d4c2b9a1 Mon Sep 17 00:00:00 2001 From: Zayin Krige Date: Tue, 5 Sep 2023 18:12:04 +0200 Subject: [PATCH 08/22] fix(get): cache ffmpeg (#944) --- changelog.md | 7 ++ package.json | 2 +- src/get_ffmpeg.js | 134 ++++++++++++++++++++++++++++++++++++ src/{get.js => get_nwjs.js} | 57 +++------------ src/index.js | 10 ++- 5 files changed, 154 insertions(+), 56 deletions(-) create mode 100644 src/get_ffmpeg.js rename src/{get.js => get_nwjs.js} (73%) diff --git a/changelog.md b/changelog.md index e678e0916..69bd5c988 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.3.11] - 2023-09-04 + +### Changed + +- Split nwjs and ffmpeg fetch. +- cache ffmpeg + ## [4.3.10] - 2023-08-21 ### Removed diff --git a/package.json b/package.json index 0a3b92254..27bf126bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nw-builder", - "version": "4.3.10", + "version": "4.3.11", "description": "Build NW.js desktop applications for MacOS, Windows and Linux.", "keywords": [ "NW.js", diff --git a/src/get_ffmpeg.js b/src/get_ffmpeg.js new file mode 100644 index 000000000..21524291d --- /dev/null +++ b/src/get_ffmpeg.js @@ -0,0 +1,134 @@ +import { createWriteStream, existsSync } from "node:fs"; +import { rm } from "node:fs/promises"; +import { get as getRequest } from "node:https"; +import { resolve } from "node:path"; +import { arch as ARCH, platform as PLATFORM } from "node:process"; + +import progress from "cli-progress"; +import compressing from "compressing"; + +import { log } from "./log.js"; +import { PLATFORM_KV, ARCH_KV } from "./util.js"; +import { replaceFfmpeg } from "./util/ffmpeg.js"; + +/** + * _Note: This an internal function which is not called directly. Please see example usage below._ + * + * Get FFMPEG binaries. + * + * @example + * // FFMPEG (proprietary codecs) + * // Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community + * nwbuild({ + * mode: "get", + * ffmpeg: true, + * }); + * + * @param {object} options Get mode options + * @param {string} options.version NW.js runtime version. Defaults to "latest". + * @param {"normal" | "sdk"} options.flavor NW.js build flavor. Defaults to "normal". + * @param {"linux" | "osx" | "win"} options.platform Target platform. Defaults to host platform. + * @param {"ia32" | "x64" | "arm64"} options.arch Target architecture. Defaults to host architecture. + * @param {string} options.cacheDir Cache directory path. Defaults to "./cache" + * @param {boolean} options.cache If false, remove cache before download. Defaults to true. + * @return {Promise} + */ +export async function get_ffmpeg({ + version = "latest", + flavor = "normal", + platform = PLATFORM_KV[PLATFORM], + arch = ARCH_KV[ARCH], + cacheDir = "./cache", + cache = true, +}) { + log.debug(`Start getting binaries`); + const nwDir = resolve( + cacheDir, + `nwjs${flavor === "sdk" ? "-sdk" : ""}-v${version}-${platform}-${arch}`, + ); + const bar = new progress.SingleBar({}, progress.Presets.rect); + + // If options.ffmpeg is true, then download ffmpeg. + const downloadUrl = + "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download"; + let url = `${downloadUrl}/${version}/${version}-${platform}-${arch}.zip`; + const out = resolve(cacheDir, `ffmpeg-v${version}-${platform}-${arch}.zip`); + + // If options.cache is false, remove cache. + if (cache === false) { + log.debug(`Removing existing binaries`); + await rm(out, { + recursive: true, + force: true, + }); + } + + // Check if cache exists. + if (existsSync(out)) { + log.debug(`Found existing FFMPEG cache`); + return; + } + + log.debug(`Downloading FFMPEG`); + const stream = createWriteStream(out); + const request = new Promise((resolve, reject) => { + getRequest(url, (response) => { + log.debug(`Response from ${url}`); + // For GitHub releases and mirrors, we need to follow the redirect. + url = response.headers.location; + + getRequest(url, (response) => { + log.debug(`Response from ${url}`); + let chunks = 0; + bar.start(Number(response.headers["content-length"]), 0); + response.on("data", async (chunk) => { + chunks += chunk.length; + bar.increment(); + bar.update(chunks); + }); + + response.on("error", (error) => { + reject(error); + }); + + response.on("end", () => { + log.debug(`FFMPEG fully downloaded`); + bar.stop(); + if (platform === "linux") { + compressing.tgz.uncompress(out, nwDir).then(() => resolve()); + } else { + compressing.zip.uncompress(out, nwDir).then(() => resolve()); + } + }); + + response.pipe(stream); + }); + + response.on("error", (error) => { + reject(error); + }); + }); + }); + + // Remove compressed file after download and decompress. + return request.then(async () => { + let ffmpegFile; + if (platform === "linux") { + ffmpegFile = "libffmpeg.so"; + } else if (platform === "win") { + ffmpegFile = "ffmpeg.dll"; + } else if (platform === "osx") { + ffmpegFile = "libffmpeg.dylib"; + } + await replaceFfmpeg(platform, nwDir, ffmpegFile); + + if (cache === false) { + log.debug(`Removing FFMPEG zip cache`); + await rm(out, { + recursive: true, + force: true, + }); + log.debug(`FFMPEG zip cache removed`); + } + }); +} diff --git a/src/get.js b/src/get_nwjs.js similarity index 73% rename from src/get.js rename to src/get_nwjs.js index 893f49ea3..0fc154347 100644 --- a/src/get.js +++ b/src/get_nwjs.js @@ -2,14 +2,13 @@ import { createWriteStream } from "node:fs"; import { mkdir, readdir, rm, rmdir } from "node:fs/promises"; import { get as getRequest } from "node:https"; import { resolve } from "node:path"; -import { arch as ARCH, platform as PLATFORM } from "node:process"; +import { arch as ARCH, platform as PLATFORM, exit as EXIT } from "node:process"; import progress from "cli-progress"; import compressing from "compressing"; import { log } from "./log.js"; import { PLATFORM_KV, ARCH_KV } from "./util.js"; -import { replaceFfmpeg } from "./util/ffmpeg.js"; import child_process from "child_process"; /** @@ -24,7 +23,7 @@ import child_process from "child_process"; * }); * * @example - * // Unofficial MacOS builds (upto v0.75.0) + * // Unofficial macOS builds (upto v0.75.0) * nwbuild({ * mode: "get", * platform: "osx", @@ -47,14 +46,6 @@ import child_process from "child_process"; * downloadUrl: "https://cnpmjs.org/mirrors/nwjs/", * }); * - * @example - * // FFmpeg (proprietary codecs) - * // Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community - * nwbuild({ - * mode: "get", - * ffmpeg: true, - * }); - * * @param {object} options Get mode options * @param {string} options.version NW.js runtime version. Defaults to "latest". * @param {"normal" | "sdk"} options.flavor NW.js build flavor. Defaults to "normal". @@ -63,10 +54,9 @@ import child_process from "child_process"; * @param {string} options.downloadUrl File server to download from. Defaults to "https://dl.nwjs.io". Set "https://npm.taobao.org/mirrors/nwjs" for China mirror or "https://cnpmjs.org/mirrors/nwjs/" for Singapore mirror. * @param {string} options.cacheDir Cache directory path. Defaults to "./cache" * @param {boolean} options.cache If false, remove cache before download. Defaults to true. - * @param {boolean} options.ffmpeg If true, download ffmpeg. Defaults to false since it contains proprietary codecs. Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community * @return {Promise} */ -export async function get({ +export async function get_nwjs({ version = "latest", flavor = "normal", platform = PLATFORM_KV[PLATFORM], @@ -74,7 +64,6 @@ export async function get({ downloadUrl = "https://dl.nwjs.io", cacheDir = "./cache", cache = true, - ffmpeg = false, }) { log.debug(`Start getting binaries`); let nwCached = true; @@ -100,14 +89,6 @@ export async function get({ out = resolve(cacheDir, `nw.${platform === "linux" ? "tgz" : "zip"}`); } - // If options.ffmpeg is true, then download ffmpeg. - if (ffmpeg === true) { - downloadUrl = - "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download"; - url = `${downloadUrl}/${version}/${version}-${platform}-${arch}.zip`; - out = resolve(cacheDir, `ffmpeg.zip`); - } - // If options.cache is false, remove cache. if (cache === false) { log.debug(`Removing existing binaries`); @@ -124,7 +105,7 @@ export async function get({ } // If not cached, then download. - if (nwCached === false || ffmpeg === true) { + if (nwCached === false) { log.debug(`Downloading binaries`); await mkdir(nwDir, { recursive: true }); @@ -134,8 +115,6 @@ export async function get({ log.debug(`Response from ${url}`); // For GitHub releases and mirrors, we need to follow the redirect. if ( - downloadUrl === - "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download" || downloadUrl === "https://npm.taobao.org/mirrors/nwjs" || downloadUrl === "https://npmmirror.com/mirrors/nwjs" ) { @@ -160,9 +139,7 @@ export async function get({ log.debug(`Binary fully downloaded`); bar.stop(); if (platform === "linux") { - compressing.tgz - .uncompress(out, ffmpeg ? nwDir : cacheDir) - .then(() => resolve()); + compressing.tgz.uncompress(out, cacheDir).then(() => resolve()); } else if (platform === "osx") { //TODO: compressing package does not restore symlinks on some macOS (eg: circleCI) const exec = function (cmd) { @@ -174,15 +151,13 @@ export async function get({ if (result.status !== 0) { log.debug(`Command failed with status ${result.status}`); if (result.error) console.log(result.error); - process.exit(1); + EXIT(1); } return resolve(); }; - exec(`unzip -o "${out}" -d "${ffmpeg ? nwDir : cacheDir}"`); + exec(`unzip -o "${out}" -d "${cacheDir}"`); } else { - compressing.zip - .uncompress(out, ffmpeg ? nwDir : cacheDir) - .then(() => resolve()); + compressing.zip.uncompress(out, cacheDir).then(() => resolve()); } }); @@ -197,23 +172,7 @@ export async function get({ // Remove compressed file after download and decompress. return request.then(async () => { - if (ffmpeg === true) { - let ffmpegFile; - if (platform === "linux") { - ffmpegFile = "libffmpeg.so"; - } else if (platform === "win") { - ffmpegFile = "ffmpeg.dll"; - } else if (platform === "osx") { - ffmpegFile = "libffmpeg.dylib"; - } - await replaceFfmpeg(platform, nwDir, ffmpegFile); - } - log.debug(`Binary decompressed starting removal`); - await rm(resolve(cacheDir, "ffmpeg.zip"), { - recursive: true, - force: true, - }); await rm( resolve(cacheDir, `nw.${platform === "linux" ? "tgz" : "zip"}`), diff --git a/src/index.js b/src/index.js index 4b80940e6..5bb23ab3d 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,8 @@ import { getVersionManifest } from "./util/versionManifest.js"; import { parse } from "./util/parse.js"; import { validate } from "./util/validate.js"; -import { get } from "./get.js"; +import { get_nwjs } from "./get_nwjs.js"; +import { get_ffmpeg } from "./get_ffmpeg.js"; import { log, setLogLevel } from "./log.js"; import { getReleaseInfo } from "./util.js"; @@ -106,7 +107,7 @@ const nwbuild = async (options) => { ); // Download NW.js binaries - await get({ + await get_nwjs({ version: options.version, flavor: options.flavor, platform: options.platform, @@ -114,20 +115,17 @@ const nwbuild = async (options) => { downloadUrl: options.downloadUrl, cacheDir: options.cacheDir, cache: options.cache, - ffmpeg: false, }); // Download ffmpeg binaries and replace chromium ffmpeg if (options.ffmpeg === true) { - await get({ + await get_ffmpeg({ version: options.version, flavor: options.flavor, platform: options.platform, arch: options.arch, - downloadUrl: options.downloadUrl, cacheDir: options.cacheDir, cache: options.cache, - ffmpeg: true, }); } From 2b54f1854a87e4cc5360d5a3193091a697b05773 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra Date: Tue, 5 Sep 2023 13:33:01 -0400 Subject: [PATCH 09/22] fix(docs): changelog, docs, release * Fix docs * Update changelog * Fix release --- cfg/jsdoc.config.cjs | 15 ++++++++-- changelog.md | 11 +++++-- doc/.vitepress/config.js | 3 +- doc/mode-get-ffmpeg.md | 30 +++++++++++++++++++ doc/mode-get-nwjs.md | 63 ++++++++++++++++++++++++++++++++++++++++ package-lock.json | 4 +-- package.json | 2 +- 7 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 doc/mode-get-ffmpeg.md create mode 100644 doc/mode-get-nwjs.md diff --git a/cfg/jsdoc.config.cjs b/cfg/jsdoc.config.cjs index 5c6b01002..8ed31872c 100644 --- a/cfg/jsdoc.config.cjs +++ b/cfg/jsdoc.config.cjs @@ -4,10 +4,21 @@ const jsdoc2md = require("jsdoc-to-markdown"); jsdoc2md .render({ - files: "src/get.js", + files: "src/get_nwjs.js", }) .then(async (output) => { - await writeFile("doc/mode-get.md", output); + await writeFile("doc/mode-get-nwjs.md", output); + }) + .catch((error) => { + console.log(error); + }); + + jsdoc2md + .render({ + files: "src/get_ffmpeg.js", + }) + .then(async (output) => { + await writeFile("doc/mode-get-ffmpeg.md", output); }) .catch((error) => { console.log(error); diff --git a/changelog.md b/changelog.md index 69bd5c988..bd4645fc4 100644 --- a/changelog.md +++ b/changelog.md @@ -7,12 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [4.3.11] - 2023-09-04 +## [4.4.0] - 2023-09-05 + +## Added + +- Cache community FFmpeg. + +## [4.3.11] - 2023-09-05 ### Changed -- Split nwjs and ffmpeg fetch. -- cache ffmpeg +- Separate download logic for NW.js and FFmpeg. ## [4.3.10] - 2023-08-21 diff --git a/doc/.vitepress/config.js b/doc/.vitepress/config.js index 3961ae73c..17bbef025 100644 --- a/doc/.vitepress/config.js +++ b/doc/.vitepress/config.js @@ -27,7 +27,8 @@ export default defineConfig({ items: [ { text: "Installation Guide", link: "/install" }, { text: "Basic Usage", link: "/usage-basic" }, - { text: "Get mode", link: "/mode-get" }, + { text: "Get NW.js mode", link: "/mode-get-nwjs" }, + { text: "Get FFmpeg mode", link: "/mode-get-ffmpeg" }, { text: "Run mode", link: "/mode-run" }, { text: "Build mode", link: "/mode-build" }, { text: "API Reference", link: "/api" }, diff --git a/doc/mode-get-ffmpeg.md b/doc/mode-get-ffmpeg.md new file mode 100644 index 000000000..3b225018f --- /dev/null +++ b/doc/mode-get-ffmpeg.md @@ -0,0 +1,30 @@ + + +## get_ffmpeg(options) ⇒ Promise.<void> + +_Note: This an internal function which is not called directly. Please see example usage below._ + +Get FFMPEG binaries. + +**Kind**: global function + +| Param | Type | Description | +| ---------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------- | +| options | object | Get mode options | +| options.version | string | NW.js runtime version. Defaults to "latest". | +| options.flavor | "normal" \| "sdk" | NW.js build flavor. Defaults to "normal". | +| options.platform | "linux" \| "osx" \| "win" | Target platform. Defaults to host platform. | +| options.arch | "ia32" \| "x64" \| "arm64" | Target architecture. Defaults to host architecture. | +| options.cacheDir | string | Cache directory path. Defaults to "./cache" | +| options.cache | boolean | If false, remove cache before download. Defaults to true. | + +**Example** + +```js +// FFMPEG (proprietary codecs) +// Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community +nwbuild({ + mode: "get", + ffmpeg: true, +}); +``` diff --git a/doc/mode-get-nwjs.md b/doc/mode-get-nwjs.md new file mode 100644 index 000000000..9339dabfa --- /dev/null +++ b/doc/mode-get-nwjs.md @@ -0,0 +1,63 @@ + + +## get_nwjs(options) ⇒ Promise.<void> + +_Note: This an internal function which is not called directly. Please see example usage below._ + +Get NW.js binaries. + +**Kind**: global function + +| Param | Type | Description | +| ------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| options | object | Get mode options | +| options.version | string | NW.js runtime version. Defaults to "latest". | +| options.flavor | "normal" \| "sdk" | NW.js build flavor. Defaults to "normal". | +| options.platform | "linux" \| "osx" \| "win" | Target platform. Defaults to host platform. | +| options.arch | "ia32" \| "x64" \| "arm64" | Target architecture. Defaults to host architecture. | +| options.downloadUrl | string | File server to download from. Defaults to "https://dl.nwjs.io". Set "https://npm.taobao.org/mirrors/nwjs" for China mirror or "https://cnpmjs.org/mirrors/nwjs/" for Singapore mirror. | +| options.cacheDir | string | Cache directory path. Defaults to "./cache" | +| options.cache | boolean | If false, remove cache before download. Defaults to true. | + +**Example** + +```js +// Minimal Usage (uses default values) +nwbuild({ + mode: "get", +}); +``` + +**Example** + +```js +// Unofficial macOS builds (upto v0.75.0) +nwbuild({ + mode: "get", + platform: "osx", + arch: "arm64", + downloadUrl: "https://github.com/corwin-of-amber/nw.js/releases/download", + manifestUrl: + "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json", +}); +``` + +**Example** + +```js +// China mirror +nwbuild({ + mode: "get", + downloadUrl: "https://npm.taobao.org/mirrors/nwjs", +}); +``` + +**Example** + +```js +// Singapore mirror +nwbuild({ + mode: "get", + downloadUrl: "https://cnpmjs.org/mirrors/nwjs/", +}); +``` diff --git a/package-lock.json b/package-lock.json index 51d4fc4e3..caa66a210 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nw-builder", - "version": "4.3.10", + "version": "4.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nw-builder", - "version": "4.3.10", + "version": "4.4.0", "license": "MIT", "dependencies": { "cli-progress": "^3.12.0", diff --git a/package.json b/package.json index 27bf126bd..e3da9cc93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nw-builder", - "version": "4.3.11", + "version": "4.4.0", "description": "Build NW.js desktop applications for MacOS, Windows and Linux.", "keywords": [ "NW.js", From 60790fab4c760acdd84b4327a98802e298532deb Mon Sep 17 00:00:00 2001 From: Zayin Krige Date: Wed, 6 Sep 2023 18:54:17 +0200 Subject: [PATCH 10/22] fix(run): parse options.argv correctly (#946) --- changelog.md | 10 +++++++++ package.json | 2 +- src/get_ffmpeg.js | 53 +++++++++++++++++++++++++---------------------- src/index.js | 9 +++++--- src/run.js | 2 +- 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/changelog.md b/changelog.md index bd4645fc4..17baf686e 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.4.1] - 2023-09-06 + +## Changed + +- improve debug logging +- move ffmpeg decompress to relevant location +- fixed handling of argv + +- Cache community FFmpeg. + ## [4.4.0] - 2023-09-05 ## Added diff --git a/package.json b/package.json index e3da9cc93..5e74da486 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nw-builder", - "version": "4.4.0", + "version": "4.4.1", "description": "Build NW.js desktop applications for MacOS, Windows and Linux.", "keywords": [ "NW.js", diff --git a/src/get_ffmpeg.js b/src/get_ffmpeg.js index 21524291d..701558ee0 100644 --- a/src/get_ffmpeg.js +++ b/src/get_ffmpeg.js @@ -63,9 +63,35 @@ export async function get_ffmpeg({ }); } + const unzipFFMPeg = async () => { + if (platform === "linux") { + await compressing.tgz.uncompress(out, nwDir); + } else { + await compressing.zip.uncompress(out, nwDir); + } + let ffmpegFile; + if (platform === "linux") { + ffmpegFile = "libffmpeg.so"; + } else if (platform === "win") { + ffmpegFile = "ffmpeg.dll"; + } else if (platform === "osx") { + ffmpegFile = "libffmpeg.dylib"; + } + await replaceFfmpeg(platform, nwDir, ffmpegFile); + + if (cache === false) { + log.debug(`Removing FFMPEG zip cache`); + await rm(out, { + recursive: true, + force: true, + }); + log.debug(`FFMPEG zip cache removed`); + } + }; // Check if cache exists. if (existsSync(out)) { log.debug(`Found existing FFMPEG cache`); + await unzipFFMPeg(); return; } @@ -94,11 +120,7 @@ export async function get_ffmpeg({ response.on("end", () => { log.debug(`FFMPEG fully downloaded`); bar.stop(); - if (platform === "linux") { - compressing.tgz.uncompress(out, nwDir).then(() => resolve()); - } else { - compressing.zip.uncompress(out, nwDir).then(() => resolve()); - } + resolve(); }); response.pipe(stream); @@ -111,24 +133,5 @@ export async function get_ffmpeg({ }); // Remove compressed file after download and decompress. - return request.then(async () => { - let ffmpegFile; - if (platform === "linux") { - ffmpegFile = "libffmpeg.so"; - } else if (platform === "win") { - ffmpegFile = "ffmpeg.dll"; - } else if (platform === "osx") { - ffmpegFile = "libffmpeg.dylib"; - } - await replaceFfmpeg(platform, nwDir, ffmpegFile); - - if (cache === false) { - log.debug(`Removing FFMPEG zip cache`); - await rm(out, { - recursive: true, - force: true, - }); - log.debug(`FFMPEG zip cache removed`); - } - }); + return request.then(unzipFFMPeg); } diff --git a/src/index.js b/src/index.js index 5bb23ab3d..b7e586bab 100644 --- a/src/index.js +++ b/src/index.js @@ -93,10 +93,13 @@ const nwbuild = async (options) => { options.version = releaseInfo.version.slice(1); if (options.logLevel === "debug") { - log.debug(`Platform: ${platform}`); - log.debug(`Archicture: ${arch}`); + log.debug(`System Platform: ${platform}`); + log.debug(`System Architecture: ${arch}`); log.debug(`Node Version: ${version}`); - log.debug(`NW.js Version: ${options.version}\n`); + log.debug(`Build NW.js Version: ${options.version}`); + log.debug(`Build Flavor: ${options.flavor}`); + log.debug(`Build Platform: ${options.platform}`); + log.debug(`Build Architecture: ${options.arch}`); } nwDir = resolve( diff --git a/src/run.js b/src/run.js index 569575b21..3d2436ffd 100644 --- a/src/run.js +++ b/src/run.js @@ -54,7 +54,7 @@ export async function run({ // It is assumed that the package.json is located at srcDir/package.json const nwProcess = spawn( resolve(nwDir, EXE_NAME[platform]), - [srcDir.concat(argv)], + [...[srcDir], ...argv], { detached: true, windowsHide: true, From 1aaf8c6d38377b3ff85455424fd52face0d3f5fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 22:16:42 +0000 Subject: [PATCH 11/22] chore(deps-dev): bump the npm group with 1 update (#947) --- package-lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index caa66a210..1eb986a00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nw-builder", - "version": "4.4.0", + "version": "4.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nw-builder", - "version": "4.4.0", + "version": "4.4.1", "license": "MIT", "dependencies": { "cli-progress": "^3.12.0", @@ -728,18 +728,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.48.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", - "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", + "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -2079,16 +2079,16 @@ } }, "node_modules/eslint": { - "version": "8.48.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", - "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", + "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.48.0", - "@humanwhocodes/config-array": "^0.11.10", + "@eslint/js": "8.49.0", + "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.12.4", From 42b506fba2034fb4bbec501bb90ad33bd38ee181 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 01:43:09 +0000 Subject: [PATCH 12/22] chore(deps-dev): bump the npm group with 1 update (#948) --- package-lock.json | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1eb986a00..69c6a200f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1342,9 +1342,9 @@ } }, "node_modules/ansi-sequence-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", - "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", "dev": true }, "node_modules/ansi-styles": { @@ -4078,9 +4078,9 @@ } }, "node_modules/shiki": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.3.tgz", - "integrity": "sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.4.tgz", + "integrity": "sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ==", "dev": true, "dependencies": { "ansi-sequence-parser": "^1.1.0", @@ -4625,9 +4625,9 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.10", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.10.tgz", - "integrity": "sha512-+MsahIWqq5WUEmj6MR4obcKYbT7im07jZPCQPdNJExkeOSbOAJ4xypSLx88x7rvtzWHhHc5aXbOhCRvGEGjFrw==", + "version": "1.0.0-rc.14", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.14.tgz", + "integrity": "sha512-yChIeXOAcNvVnSVjhziH1vte0uhKb00PuZf7KdIMfx3ixTMAz73Nn+6gREvCv0SdH+anteGUKz5eljv0ygcgGQ==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", @@ -4638,12 +4638,20 @@ "focus-trap": "^7.5.2", "mark.js": "8.11.1", "minisearch": "^6.1.0", - "shiki": "^0.14.3", + "shiki": "^0.14.4", "vite": "^4.4.9", "vue": "^3.3.4" }, "bin": { "vitepress": "bin/vitepress.js" + }, + "peerDependencies": { + "markdown-it-mathjax3": "^4.3.2" + }, + "peerDependenciesMeta": { + "markdown-it-mathjax3": { + "optional": true + } } }, "node_modules/vscode-oniguruma": { From f785cae95eabb84949122d997646676ff5f062c8 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:01:04 -0400 Subject: [PATCH 13/22] docs: update --- doc/.vitepress/config.js | 20 ++----------- doc/install.md | 42 ++------------------------- doc/migrate-v3-v4.md | 2 ++ doc/mode-get-ffmpeg.md | 30 ------------------- doc/mode-get-nwjs.md | 63 ---------------------------------------- doc/mode-run.md | 30 ------------------- package.json | 13 +++++---- 7 files changed, 15 insertions(+), 185 deletions(-) delete mode 100644 doc/mode-get-ffmpeg.md delete mode 100644 doc/mode-get-nwjs.md delete mode 100644 doc/mode-run.md diff --git a/doc/.vitepress/config.js b/doc/.vitepress/config.js index 17bbef025..37348cc6f 100644 --- a/doc/.vitepress/config.js +++ b/doc/.vitepress/config.js @@ -10,14 +10,14 @@ export default defineConfig({ { text: "npm", link: "https://www.npmjs.com/package/nw-builder" }, { text: "Changelog", - link: "https://github.com/nwutils/nw-builder/blob/main/changelog.md", + link: "https://github.com/nwutils/nw-builder/blob/main/CHANGELOG.md", }, { text: "Contributing", link: "./contributing" }, { text: "Code of Conduct", link: "https://github.com/nwutils/.github/blob/main/CODE_OF_CONDUCT.md", }, - { text: "License", link: "./license" }, + { text: "License", link: "https://github.com/nwutils/nw-builder/blob/main/LICENSE" }, ], sidebar: [ @@ -27,23 +27,9 @@ export default defineConfig({ items: [ { text: "Installation Guide", link: "/install" }, { text: "Basic Usage", link: "/usage-basic" }, - { text: "Get NW.js mode", link: "/mode-get-nwjs" }, - { text: "Get FFmpeg mode", link: "/mode-get-ffmpeg" }, + { text: "Get mode", link: "/mode-get" }, { text: "Run mode", link: "/mode-run" }, { text: "Build mode", link: "/mode-build" }, - { text: "API Reference", link: "/api" }, - { - text: "Linux Specific Options", - link: "/api-nux.html#linuxrc-object", - }, - { - text: "Windows Specific Options", - link: "/api-win.md#winrc-object", - }, - { - text: "MacOS Specific Options", - link: "/api-osx.md#osxrc-object", - }, ], }, { diff --git a/doc/install.md b/doc/install.md index 91d9290c6..2c9b51398 100644 --- a/doc/install.md +++ b/doc/install.md @@ -10,44 +10,6 @@ Using npm: npm i -D nw-builder ``` -> Note: We install as a dev dependency to prevent it from being packaged with your application code. +> Note: We install as a development dependency to prevent it from being packaged with your application code. -You may use alternate package managers: - -Enable `corepack`: - -```shell -corepack enable -``` - -Or install it if your version does not include it: - -```shell -npm i -g corepack -``` - -Prepare yarn: - -``` -corepack prepare yarn@x.y.z --activate -``` - -Using yarn: - -```shell -yarn add -D nw-builder -``` - -Prepare yarn: - -``` -corepack prepare pnpm@x.y.z --activate -``` - -Using pnpm: - -```shell -pnpm add -D nw-builder -``` - -For more information, refer to the official [corepack documentation](https://nodejs.org/api/corepack.html). +You may use alternate package managers. The recommended metohd is via [corepack](https://nodejs.org/api/corepack.html). diff --git a/doc/migrate-v3-v4.md b/doc/migrate-v3-v4.md index 730a4c91e..89af030c5 100644 --- a/doc/migrate-v3-v4.md +++ b/doc/migrate-v3-v4.md @@ -1,5 +1,7 @@ # Migrate from v3 to v4 +> We are working on making the migration process smoother. If you encounter any issues with the current guide, please open an issue or start a discussion. + ## Update `nw-builder` With npm: diff --git a/doc/mode-get-ffmpeg.md b/doc/mode-get-ffmpeg.md deleted file mode 100644 index 3b225018f..000000000 --- a/doc/mode-get-ffmpeg.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## get_ffmpeg(options) ⇒ Promise.<void> - -_Note: This an internal function which is not called directly. Please see example usage below._ - -Get FFMPEG binaries. - -**Kind**: global function - -| Param | Type | Description | -| ---------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------- | -| options | object | Get mode options | -| options.version | string | NW.js runtime version. Defaults to "latest". | -| options.flavor | "normal" \| "sdk" | NW.js build flavor. Defaults to "normal". | -| options.platform | "linux" \| "osx" \| "win" | Target platform. Defaults to host platform. | -| options.arch | "ia32" \| "x64" \| "arm64" | Target architecture. Defaults to host architecture. | -| options.cacheDir | string | Cache directory path. Defaults to "./cache" | -| options.cache | boolean | If false, remove cache before download. Defaults to true. | - -**Example** - -```js -// FFMPEG (proprietary codecs) -// Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community -nwbuild({ - mode: "get", - ffmpeg: true, -}); -``` diff --git a/doc/mode-get-nwjs.md b/doc/mode-get-nwjs.md deleted file mode 100644 index 9339dabfa..000000000 --- a/doc/mode-get-nwjs.md +++ /dev/null @@ -1,63 +0,0 @@ - - -## get_nwjs(options) ⇒ Promise.<void> - -_Note: This an internal function which is not called directly. Please see example usage below._ - -Get NW.js binaries. - -**Kind**: global function - -| Param | Type | Description | -| ------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| options | object | Get mode options | -| options.version | string | NW.js runtime version. Defaults to "latest". | -| options.flavor | "normal" \| "sdk" | NW.js build flavor. Defaults to "normal". | -| options.platform | "linux" \| "osx" \| "win" | Target platform. Defaults to host platform. | -| options.arch | "ia32" \| "x64" \| "arm64" | Target architecture. Defaults to host architecture. | -| options.downloadUrl | string | File server to download from. Defaults to "https://dl.nwjs.io". Set "https://npm.taobao.org/mirrors/nwjs" for China mirror or "https://cnpmjs.org/mirrors/nwjs/" for Singapore mirror. | -| options.cacheDir | string | Cache directory path. Defaults to "./cache" | -| options.cache | boolean | If false, remove cache before download. Defaults to true. | - -**Example** - -```js -// Minimal Usage (uses default values) -nwbuild({ - mode: "get", -}); -``` - -**Example** - -```js -// Unofficial macOS builds (upto v0.75.0) -nwbuild({ - mode: "get", - platform: "osx", - arch: "arm64", - downloadUrl: "https://github.com/corwin-of-amber/nw.js/releases/download", - manifestUrl: - "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json", -}); -``` - -**Example** - -```js -// China mirror -nwbuild({ - mode: "get", - downloadUrl: "https://npm.taobao.org/mirrors/nwjs", -}); -``` - -**Example** - -```js -// Singapore mirror -nwbuild({ - mode: "get", - downloadUrl: "https://cnpmjs.org/mirrors/nwjs/", -}); -``` diff --git a/doc/mode-run.md b/doc/mode-run.md deleted file mode 100644 index dab151f06..000000000 --- a/doc/mode-run.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## run(options) ⇒ Promise.<void> - -_Note: This an internal function which is not called directly. Please see example usage below._ - -Run NW.js application. You can use get mode options in run mode too. - -**Kind**: global function - -| Param | Type | Description | -| ---------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| options | options | Run mode options | -| options.version | string | NW.js runtime version. Defaults to "latest". | -| options.flavor | "normal" \| "sdk" | NW.js build flavor. Defaults to "normal". | -| options.platform | "linux" \| "osx" \| "win" | Target platform. Defaults to host platform. | -| options.arch | "ia32" \| "x64" \| "arm64" | Target architecture. Defaults to host architecture. | -| options.srcDir | string | Source directory path. Defaults to "./src" | -| options.cacheDir | string | Cache directory path. Defaults to "./cache" | -| options.glob | boolean | If true, file globbing is enabled. Defaults to false. | -| options.argv | Array.<string> | Arguments to pass to NW.js. Defaults to []. See [NW.js CLI options](https://docs.nwjs.io/en/latest/References/Command%20Line%20Options/#command-line-options) for more information. | - -**Example** - -```js -// Minimal Usage (uses default values) -nwbuild({ - mode: "run", -}); -``` diff --git a/package.json b/package.json index 5e74da486..d190bc321 100644 --- a/package.json +++ b/package.json @@ -45,11 +45,11 @@ "fmt": "prettier --write \"./**/*.{css,html,js,json,md,yml}\"", "lnt": "eslint --config=cfg/eslint.config.cjs --fix cfg src test", "doc:dev": "concurrently --kill-others \"node cfg/fswatch.config.js\" \"vitepress dev doc\"", - "doc:bld": "vitepress build doc", + "doc:bld": "node cfg/jsdoc.config.cjs && vitepress build doc", "test:unit": "node --test test/unit/index.js", "test:e2e": "node --test test/e2e/index.js", - "test:mod": "cd test/fixture && node demo.js", - "test:cli": "cd test/fixture && nwbuild --platform win --arch x64 --outDir out --no-glob app" + "test:mod": "npm link nw-builder && cd test/fixture && node demo.js", + "test:cli": "npm link nw-builder && cd test/fixture && nwbuild --platform win --arch x64 --outDir out --no-glob app" }, "devDependencies": { "concurrently": "^8.2.0", @@ -64,12 +64,15 @@ }, "dependencies": { "cli-progress": "^3.12.0", - "compressing": "^1.9.0", + "compressing": "^1.10.0", "glob": "^10.3.3", "plist": "^3.1.0", "rcedit": "^4.0.0", "winston": "^3.9.0", "yargs": "^17.7.2" }, - "packageManager": "npm@9.8.1" + "packageManager": "npm@9.8.1", + "engines": { + "node": ">= v16.20.1 || >= v18.18.0 || >= v20.7.0" + } } From 74fb016372ce38661d85bf61ea44f8af88d2edb6 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:05:02 -0400 Subject: [PATCH 14/22] refactor: get mode --- src/{get_nwjs.js => get.js} | 177 +++++++++++++++++++++++++++++++++++- src/get_ffmpeg.js | 137 ---------------------------- src/index.js | 22 +---- test/e2e/mode.js | 2 +- test/fixture/demo.js | 4 +- 5 files changed, 180 insertions(+), 162 deletions(-) rename src/{get_nwjs.js => get.js} (50%) delete mode 100644 src/get_ffmpeg.js diff --git a/src/get_nwjs.js b/src/get.js similarity index 50% rename from src/get_nwjs.js rename to src/get.js index 0fc154347..d489bd3f1 100644 --- a/src/get_nwjs.js +++ b/src/get.js @@ -1,4 +1,5 @@ -import { createWriteStream } from "node:fs"; +import { spawnSync } from "node:child_process"; +import { createWriteStream, existsSync } from "node:fs"; import { mkdir, readdir, rm, rmdir } from "node:fs/promises"; import { get as getRequest } from "node:https"; import { resolve } from "node:path"; @@ -9,12 +10,12 @@ import compressing from "compressing"; import { log } from "./log.js"; import { PLATFORM_KV, ARCH_KV } from "./util.js"; -import child_process from "child_process"; +import { replaceFfmpeg } from "./util/ffmpeg.js"; /** * _Note: This an internal function which is not called directly. Please see example usage below._ * - * Get NW.js binaries. + * Get binaries. * * @example * // Minimal Usage (uses default values) @@ -46,6 +47,54 @@ import child_process from "child_process"; * downloadUrl: "https://cnpmjs.org/mirrors/nwjs/", * }); * + * @example + * // FFMPEG (proprietary codecs) + * // Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community + * nwbuild({ + * mode: "get", + * ffmpeg: true, + * }); + * + * @param {object} options Get mode options + * @param {string} options.version NW.js runtime version. Defaults to "latest". + * @param {"normal" | "sdk"} options.flavor NW.js build flavor. Defaults to "normal". + * @param {"linux" | "osx" | "win"} options.platform Target platform. Defaults to host platform. + * @param {"ia32" | "x64" | "arm64"} options.arch Target architecture. Defaults to host architecture. + * @param {string} options.downloadUrl File server to download from. Defaults to "https://dl.nwjs.io". Set "https://npm.taobao.org/mirrors/nwjs" for China mirror or "https://cnpmjs.org/mirrors/nwjs/" for Singapore mirror. + * @param {string} options.cacheDir Cache directory path. Defaults to "./cache" + * @param {boolean} options.cache If false, remove cache before download. Defaults to true. + * @param {boolean} options.ffmpeg If true, ffmpeg is not downloaded. Defaults to false. + * @return {Promise} + */ +export async function get({ + version = "latest", + flavor = "normal", + platform = PLATFORM_KV[PLATFORM], + arch = ARCH_KV[ARCH], + downloadUrl = "https://dl.nwjs.io", + cacheDir = "./cache", + cache = true, + ffmpeg = false, +}) { + await get_nwjs(version, flavor, platform, arch, downloadUrl, cacheDir, cache); + if (ffmpeg === true) { + await get_ffmpeg({ + version, + flavor, + platform, + arch, + downloadUrl, + cacheDir, + cache, + }); + } +} + +/** + * Note: This an internal function which is not called directly. Please see example usage below. + * + * Get NW.js binaries + * * @param {object} options Get mode options * @param {string} options.version NW.js runtime version. Defaults to "latest". * @param {"normal" | "sdk"} options.flavor NW.js build flavor. Defaults to "normal". @@ -56,7 +105,7 @@ import child_process from "child_process"; * @param {boolean} options.cache If false, remove cache before download. Defaults to true. * @return {Promise} */ -export async function get_nwjs({ +async function get_nwjs({ version = "latest", flavor = "normal", platform = PLATFORM_KV[PLATFORM], @@ -144,7 +193,7 @@ export async function get_nwjs({ //TODO: compressing package does not restore symlinks on some macOS (eg: circleCI) const exec = function (cmd) { log.debug(cmd); - const result = child_process.spawnSync(cmd, { + const result = spawnSync(cmd, { shell: true, stdio: "inherit", }); @@ -182,3 +231,121 @@ export async function get_nwjs({ }); } } + +/** + * + * Note: This an internal function which is not called directly. Please see example usage below. + * + * Get FFmpeg binary. + * + * @param {object} options Get mode options + * @param {string} options.version NW.js runtime version. Defaults to "latest". + * @param {"normal" | "sdk"} options.flavor NW.js build flavor. Defaults to "normal". + * @param {"linux" | "osx" | "win"} options.platform Target platform. Defaults to host platform. + * @param {"ia32" | "x64" | "arm64"} options.arch Target architecture. Defaults to host architecture. + * @param {string} options.cacheDir Cache directory path. Defaults to "./cache" + * @param {boolean} options.cache If false, remove cache before download. Defaults to true. + * @return {Promise} + */ +async function get_ffmpeg({ + version = "latest", + flavor = "normal", + platform = PLATFORM_KV[PLATFORM], + arch = ARCH_KV[ARCH], + cacheDir = "./cache", + cache = true, +}) { + log.debug(`Start getting binaries`); + const nwDir = resolve( + cacheDir, + `nwjs${flavor === "sdk" ? "-sdk" : ""}-v${version}-${platform}-${arch}`, + ); + const bar = new progress.SingleBar({}, progress.Presets.rect); + + // If options.ffmpeg is true, then download ffmpeg. + const downloadUrl = + "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download"; + let url = `${downloadUrl}/${version}/${version}-${platform}-${arch}.zip`; + const out = resolve(cacheDir, `ffmpeg-v${version}-${platform}-${arch}.zip`); + + // If options.cache is false, remove cache. + if (cache === false) { + log.debug(`Removing existing binaries`); + await rm(out, { + recursive: true, + force: true, + }); + } + + const unzipFFMPeg = async () => { + if (platform === "linux") { + await compressing.tgz.uncompress(out, nwDir); + } else { + await compressing.zip.uncompress(out, nwDir); + } + let ffmpegFile; + if (platform === "linux") { + ffmpegFile = "libffmpeg.so"; + } else if (platform === "win") { + ffmpegFile = "ffmpeg.dll"; + } else if (platform === "osx") { + ffmpegFile = "libffmpeg.dylib"; + } + await replaceFfmpeg(platform, nwDir, ffmpegFile); + + if (cache === false) { + log.debug(`Removing FFMPEG zip cache`); + await rm(out, { + recursive: true, + force: true, + }); + log.debug(`FFMPEG zip cache removed`); + } + }; + // Check if cache exists. + if (existsSync(out)) { + log.debug(`Found existing FFMPEG cache`); + await unzipFFMPeg(); + return; + } + + log.debug(`Downloading FFMPEG`); + const stream = createWriteStream(out); + const request = new Promise((resolve, reject) => { + getRequest(url, (response) => { + log.debug(`Response from ${url}`); + // For GitHub releases and mirrors, we need to follow the redirect. + url = response.headers.location; + + getRequest(url, (response) => { + log.debug(`Response from ${url}`); + let chunks = 0; + bar.start(Number(response.headers["content-length"]), 0); + response.on("data", async (chunk) => { + chunks += chunk.length; + bar.increment(); + bar.update(chunks); + }); + + response.on("error", (error) => { + reject(error); + }); + + response.on("end", () => { + log.debug(`FFMPEG fully downloaded`); + bar.stop(); + resolve(); + }); + + response.pipe(stream); + }); + + response.on("error", (error) => { + reject(error); + }); + }); + }); + + // Remove compressed file after download and decompress. + return request.then(unzipFFMPeg); +} diff --git a/src/get_ffmpeg.js b/src/get_ffmpeg.js deleted file mode 100644 index 701558ee0..000000000 --- a/src/get_ffmpeg.js +++ /dev/null @@ -1,137 +0,0 @@ -import { createWriteStream, existsSync } from "node:fs"; -import { rm } from "node:fs/promises"; -import { get as getRequest } from "node:https"; -import { resolve } from "node:path"; -import { arch as ARCH, platform as PLATFORM } from "node:process"; - -import progress from "cli-progress"; -import compressing from "compressing"; - -import { log } from "./log.js"; -import { PLATFORM_KV, ARCH_KV } from "./util.js"; -import { replaceFfmpeg } from "./util/ffmpeg.js"; - -/** - * _Note: This an internal function which is not called directly. Please see example usage below._ - * - * Get FFMPEG binaries. - * - * @example - * // FFMPEG (proprietary codecs) - * // Please read the license's constraints: https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/#get-ffmpeg-binaries-from-the-community - * nwbuild({ - * mode: "get", - * ffmpeg: true, - * }); - * - * @param {object} options Get mode options - * @param {string} options.version NW.js runtime version. Defaults to "latest". - * @param {"normal" | "sdk"} options.flavor NW.js build flavor. Defaults to "normal". - * @param {"linux" | "osx" | "win"} options.platform Target platform. Defaults to host platform. - * @param {"ia32" | "x64" | "arm64"} options.arch Target architecture. Defaults to host architecture. - * @param {string} options.cacheDir Cache directory path. Defaults to "./cache" - * @param {boolean} options.cache If false, remove cache before download. Defaults to true. - * @return {Promise} - */ -export async function get_ffmpeg({ - version = "latest", - flavor = "normal", - platform = PLATFORM_KV[PLATFORM], - arch = ARCH_KV[ARCH], - cacheDir = "./cache", - cache = true, -}) { - log.debug(`Start getting binaries`); - const nwDir = resolve( - cacheDir, - `nwjs${flavor === "sdk" ? "-sdk" : ""}-v${version}-${platform}-${arch}`, - ); - const bar = new progress.SingleBar({}, progress.Presets.rect); - - // If options.ffmpeg is true, then download ffmpeg. - const downloadUrl = - "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download"; - let url = `${downloadUrl}/${version}/${version}-${platform}-${arch}.zip`; - const out = resolve(cacheDir, `ffmpeg-v${version}-${platform}-${arch}.zip`); - - // If options.cache is false, remove cache. - if (cache === false) { - log.debug(`Removing existing binaries`); - await rm(out, { - recursive: true, - force: true, - }); - } - - const unzipFFMPeg = async () => { - if (platform === "linux") { - await compressing.tgz.uncompress(out, nwDir); - } else { - await compressing.zip.uncompress(out, nwDir); - } - let ffmpegFile; - if (platform === "linux") { - ffmpegFile = "libffmpeg.so"; - } else if (platform === "win") { - ffmpegFile = "ffmpeg.dll"; - } else if (platform === "osx") { - ffmpegFile = "libffmpeg.dylib"; - } - await replaceFfmpeg(platform, nwDir, ffmpegFile); - - if (cache === false) { - log.debug(`Removing FFMPEG zip cache`); - await rm(out, { - recursive: true, - force: true, - }); - log.debug(`FFMPEG zip cache removed`); - } - }; - // Check if cache exists. - if (existsSync(out)) { - log.debug(`Found existing FFMPEG cache`); - await unzipFFMPeg(); - return; - } - - log.debug(`Downloading FFMPEG`); - const stream = createWriteStream(out); - const request = new Promise((resolve, reject) => { - getRequest(url, (response) => { - log.debug(`Response from ${url}`); - // For GitHub releases and mirrors, we need to follow the redirect. - url = response.headers.location; - - getRequest(url, (response) => { - log.debug(`Response from ${url}`); - let chunks = 0; - bar.start(Number(response.headers["content-length"]), 0); - response.on("data", async (chunk) => { - chunks += chunk.length; - bar.increment(); - bar.update(chunks); - }); - - response.on("error", (error) => { - reject(error); - }); - - response.on("end", () => { - log.debug(`FFMPEG fully downloaded`); - bar.stop(); - resolve(); - }); - - response.pipe(stream); - }); - - response.on("error", (error) => { - reject(error); - }); - }); - }); - - // Remove compressed file after download and decompress. - return request.then(unzipFFMPeg); -} diff --git a/src/index.js b/src/index.js index b7e586bab..dadc64bbc 100644 --- a/src/index.js +++ b/src/index.js @@ -10,8 +10,7 @@ import { getVersionManifest } from "./util/versionManifest.js"; import { parse } from "./util/parse.js"; import { validate } from "./util/validate.js"; -import { get_nwjs } from "./get_nwjs.js"; -import { get_ffmpeg } from "./get_ffmpeg.js"; +import { get } from "./get.js"; import { log, setLogLevel } from "./log.js"; import { getReleaseInfo } from "./util.js"; @@ -109,8 +108,8 @@ const nwbuild = async (options) => { }-${options.arch}`, ); - // Download NW.js binaries - await get_nwjs({ + // Download binaries + await get({ version: options.version, flavor: options.flavor, platform: options.platform, @@ -118,22 +117,11 @@ const nwbuild = async (options) => { downloadUrl: options.downloadUrl, cacheDir: options.cacheDir, cache: options.cache, + ffmpeg: options.ffmpeg, }); - // Download ffmpeg binaries and replace chromium ffmpeg - if (options.ffmpeg === true) { - await get_ffmpeg({ - version: options.version, - flavor: options.flavor, - platform: options.platform, - arch: options.arch, - cacheDir: options.cacheDir, - cache: options.cache, - }); - } - if (options.mode === "get") { - // Do nothing since we have already downloaded the binaries + // Do nothing else since we have already downloaded the binaries return; } diff --git a/test/e2e/mode.js b/test/e2e/mode.js index 5b3727fe4..c6e7c91b2 100644 --- a/test/e2e/mode.js +++ b/test/e2e/mode.js @@ -18,7 +18,7 @@ describe("test modes", async () => { let nwOptions = { srcDir: "test/fixture/app", mode: "build", - version: "0.78.1", + version: "0.80.0", flavor: "sdk", platform: getPlatform(platform), arch: getArch(arch), diff --git a/test/fixture/demo.js b/test/fixture/demo.js index a3ba52649..b2fa72b99 100644 --- a/test/fixture/demo.js +++ b/test/fixture/demo.js @@ -1,8 +1,8 @@ import nwbuild from "nw-builder"; await nwbuild({ - mode: "run", - version: "0.78.1", + mode: "build", + version: "0.80.0", srcDir: "app", outDir: "out", glob: false, From 90272d3753ac4bf2dadc503a2c3734bbf0be1985 Mon Sep 17 00:00:00 2001 From: Ayush C <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:55:36 -0400 Subject: [PATCH 15/22] refactor: build mode (#951) --- .gitignore | 2 +- cfg/jsdoc.config.cjs | 43 +--- changelog.md | 17 +- doc/.vitepress/config.js | 5 +- doc/mode-build.md | 77 ------- package-lock.json | 460 ++++++++++++++++++++++----------------- src/bld/build.js | 85 -------- src/bld/linuxCfg.js | 85 -------- src/bld/osxCfg.js | 94 -------- src/bld/winCfg.js | 81 ------- src/build.js | 318 +++++++++++++++++++++++++++ src/index.js | 6 +- 12 files changed, 598 insertions(+), 675 deletions(-) delete mode 100644 doc/mode-build.md delete mode 100644 src/bld/build.js delete mode 100644 src/bld/linuxCfg.js delete mode 100644 src/bld/osxCfg.js delete mode 100644 src/bld/winCfg.js create mode 100644 src/build.js diff --git a/.gitignore b/.gitignore index 32721f6e3..09d7b6a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,5 @@ cache build dist doc/api*.md -doc/mode-get.md +doc/mode-*.md out diff --git a/cfg/jsdoc.config.cjs b/cfg/jsdoc.config.cjs index 8ed31872c..27265b65c 100644 --- a/cfg/jsdoc.config.cjs +++ b/cfg/jsdoc.config.cjs @@ -4,21 +4,21 @@ const jsdoc2md = require("jsdoc-to-markdown"); jsdoc2md .render({ - files: "src/get_nwjs.js", + files: "src/build.js", }) .then(async (output) => { - await writeFile("doc/mode-get-nwjs.md", output); + await writeFile("doc/mode-build.md", output); }) .catch((error) => { console.log(error); }); - jsdoc2md +jsdoc2md .render({ - files: "src/get_ffmpeg.js", + files: "src/get.js", }) .then(async (output) => { - await writeFile("doc/mode-get-ffmpeg.md", output); + await writeFile("doc/mode-get.md", output); }) .catch((error) => { console.log(error); @@ -45,36 +45,3 @@ jsdoc2md .catch((error) => { console.log(error); }); - -jsdoc2md - .render({ - files: "src/bld/linuxCfg.js", - }) - .then(async (output) => { - await writeFile("doc/api-nux.md", output); - }) - .catch((error) => { - console.log(error); - }); - -jsdoc2md - .render({ - files: "src/bld/winCfg.js", - }) - .then(async (output) => { - await writeFile("doc/api-win.md", output); - }) - .catch((error) => { - console.log(error); - }); - -jsdoc2md - .render({ - files: "src/bld/osxCfg.js", - }) - .then(async (output) => { - await writeFile("doc/api-osx.md", output); - }) - .catch((error) => { - console.log(error); - }); \ No newline at end of file diff --git a/changelog.md b/changelog.md index 17baf686e..3ff244f6a 100644 --- a/changelog.md +++ b/changelog.md @@ -7,21 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [4.4.1] - 2023-09-06 +### Changed -## Changed +- Refactor build mode. +- Generate markdown docs from JSDocs. -- improve debug logging -- move ffmpeg decompress to relevant location -- fixed handling of argv +## [4.4.1] - 2023-09-06 -- Cache community FFmpeg. +### Changed + +- Improve debug logging. +- Fixed handling of argv. ## [4.4.0] - 2023-09-05 -## Added +### Added - Cache community FFmpeg. +- Move FFmpeg decompress function to relevant location ## [4.3.11] - 2023-09-05 diff --git a/doc/.vitepress/config.js b/doc/.vitepress/config.js index 37348cc6f..c1312df47 100644 --- a/doc/.vitepress/config.js +++ b/doc/.vitepress/config.js @@ -17,7 +17,10 @@ export default defineConfig({ text: "Code of Conduct", link: "https://github.com/nwutils/.github/blob/main/CODE_OF_CONDUCT.md", }, - { text: "License", link: "https://github.com/nwutils/nw-builder/blob/main/LICENSE" }, + { + text: "License", + link: "https://github.com/nwutils/nw-builder/blob/main/LICENSE", + }, ], sidebar: [ diff --git a/doc/mode-build.md b/doc/mode-build.md deleted file mode 100644 index 885815b90..000000000 --- a/doc/mode-build.md +++ /dev/null @@ -1,77 +0,0 @@ -# Build NW.js applications - -Module usage: - -```javascript -nwbuild({ - mode: "build", -}); -``` - -This is equivalent to: - -```javascript -nwbuild({ - mode: "get", - version: "latest", - flavor: "normal", - platform: "linux", - arch: "x64", - downloadUrl: "https://dl.nwjs.io", - manifestUrl: "https://nwjs.io/versions", - cacheDir: "./cache", - outDir: "./out" - srcDir: ".", - cache: true, - ffmpeg: false -}); -``` - -CLI usage: - -```shell -nwbuild --mode=build --glob=false -``` - -This is equivalent to: - -```shell -nwbuild --mode=build --version=latest --flavor=normal --platform=linux --arch=x64 --downloadUrl=https://dl.nwjs.io --manifestUrl=https://nwjs.io/versions --cacheDir=./cache --outDir=./out --cache=true --ffmpeg=false --glob=false . -``` - -Note: File permissions are incorrectly set for Linux or MacOS apps built on Windows platform. - -> [The Windows platform only supports the changing of the write permission. It also does not support the distinction between the permissions of user, group, or others.](https://www.geeksforgeeks.org/node-js-fs-chmod-method/) - -When the `platform` and `arch` are not specified, they default to the host platform and arch. For this guide, we are assumed to be using Linux x64. - -Note: To edit Windows executable resources, we use [`rcedit`](https://github.com/electron/node-rcedit). To use rcedit on non-Windows platforms, you will have to install [Wine](https://www.winehq.org/). - -Note: We recursively glob the file patterns given by the user. The first `package.json` parsed is taken to be the NW.js manifest file. If you have multiple manifest files, the first glob pattern should be the path to the NW.js manifest. - -For example, if we have a project with file structure as below: - -`/project`: - -```shell -/web/index.js -/web/package.json # Node manifest -/nw/package.json # NW.js manifest -/package.json # Monorepo Node manifest -``` - -We can specify `nw/package.json` as the first glob pattern so that all [NW.js manifest properties](https://nwjs.readthedocs.io/en/latest/References/Manifest%20Format/) are taken from this file and applied to the application. - -Module usage: - -```javascript -nwbuild({ - srcDir: "nw/package.json web/**/*", -}); -``` - -Note: If you are using the MacOS ARM unofficial builds, you will need to [remove the `com.apple.qurantine` flag](https://github.com/corwin-of-amber/nw.js/releases/tag/nw-v0.75.0): - -```shell -sudo xattr -r -d com.apple.quarantine nwjs.app -``` diff --git a/package-lock.json b/package-lock.json index 69c6a200f..d32a9b821 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "cli-progress": "^3.12.0", - "compressing": "^1.9.0", + "compressing": "^1.10.0", "glob": "^10.3.3", "plist": "^3.1.0", "rcedit": "^4.0.0", @@ -30,6 +30,9 @@ "prettier": "^3.0.1", "selenium-webdriver": "^4.10.0", "vitepress": "^1.0.0-beta.5" + }, + "engines": { + "node": ">= v16.20.1 || >= v18.18.0 || >= v20.7.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -87,138 +90,138 @@ } }, "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.19.1.tgz", - "integrity": "sha512-FYAZWcGsFTTaSAwj9Std8UML3Bu8dyWDncM7Ls8g+58UOe4XYdlgzXWbrIgjaguP63pCCbMoExKr61B+ztK3tw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.20.0.tgz", + "integrity": "sha512-uujahcBt4DxduBTvYdwO3sBfHuJvJokiC3BP1+O70fglmE1ShkH8lpXqZBac1rrU3FnNYSUs4pL9lBdTKeRPOQ==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.19.1" + "@algolia/cache-common": "4.20.0" } }, "node_modules/@algolia/cache-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.19.1.tgz", - "integrity": "sha512-XGghi3l0qA38HiqdoUY+wvGyBsGvKZ6U3vTiMBT4hArhP3fOGLXpIINgMiiGjTe4FVlTa5a/7Zf2bwlIHfRqqg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.20.0.tgz", + "integrity": "sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==", "dev": true }, "node_modules/@algolia/cache-in-memory": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.19.1.tgz", - "integrity": "sha512-+PDWL+XALGvIginigzu8oU6eWw+o76Z8zHbBovWYcrtWOEtinbl7a7UTt3x3lthv+wNuFr/YD1Gf+B+A9V8n5w==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.20.0.tgz", + "integrity": "sha512-Wm9ak/IaacAZXS4mB3+qF/KCoVSBV6aLgIGFEtQtJwjv64g4ePMapORGmCyulCFwfePaRAtcaTbMcJF+voc/bg==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.19.1" + "@algolia/cache-common": "4.20.0" } }, "node_modules/@algolia/client-account": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.19.1.tgz", - "integrity": "sha512-Oy0ritA2k7AMxQ2JwNpfaEcgXEDgeyKu0V7E7xt/ZJRdXfEpZcwp9TOg4TJHC7Ia62gIeT2Y/ynzsxccPw92GA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.20.0.tgz", + "integrity": "sha512-GGToLQvrwo7am4zVkZTnKa72pheQeez/16sURDWm7Seyz+HUxKi3BM6fthVVPUEBhtJ0reyVtuK9ArmnaKl10Q==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/client-search": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/client-search": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-analytics": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.19.1.tgz", - "integrity": "sha512-5QCq2zmgdZLIQhHqwl55ZvKVpLM3DNWjFI4T+bHr3rGu23ew2bLO4YtyxaZeChmDb85jUdPDouDlCumGfk6wOg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.20.0.tgz", + "integrity": "sha512-EIr+PdFMOallRdBTHHdKI3CstslgLORQG7844Mq84ib5oVFRVASuuPmG4bXBgiDbcsMLUeOC6zRVJhv1KWI0ug==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/client-search": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/client-search": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.19.1.tgz", - "integrity": "sha512-3kAIVqTcPrjfS389KQvKzliC559x+BDRxtWamVJt8IVp7LGnjq+aVAXg4Xogkur1MUrScTZ59/AaUd5EdpyXgA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.20.0.tgz", + "integrity": "sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-personalization": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.19.1.tgz", - "integrity": "sha512-8CWz4/H5FA+krm9HMw2HUQenizC/DxUtsI5oYC0Jxxyce1vsr8cb1aEiSJArQT6IzMynrERif1RVWLac1m36xw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.20.0.tgz", + "integrity": "sha512-N9+zx0tWOQsLc3K4PVRDV8GUeOLAY0i445En79Pr3zWB+m67V+n/8w4Kw1C5LlbHDDJcyhMMIlqezh6BEk7xAQ==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-search": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.19.1.tgz", - "integrity": "sha512-mBecfMFS4N+yK/p0ZbK53vrZbL6OtWMk8YmnOv1i0LXx4pelY8TFhqKoTit3NPVPwoSNN0vdSN9dTu1xr1XOVw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.20.0.tgz", + "integrity": "sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/logger-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.19.1.tgz", - "integrity": "sha512-i6pLPZW/+/YXKis8gpmSiNk1lOmYCmRI6+x6d2Qk1OdfvX051nRVdalRbEcVTpSQX6FQAoyeaui0cUfLYW5Elw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.20.0.tgz", + "integrity": "sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==", "dev": true }, "node_modules/@algolia/logger-console": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.19.1.tgz", - "integrity": "sha512-jj72k9GKb9W0c7TyC3cuZtTr0CngLBLmc8trzZlXdfvQiigpUdvTi1KoWIb2ZMcRBG7Tl8hSb81zEY3zI2RlXg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.20.0.tgz", + "integrity": "sha512-THlIGG1g/FS63z0StQqDhT6bprUczBI8wnLT3JWvfAQDZX5P6fCg7dG+pIrUBpDIHGszgkqYEqECaKKsdNKOUA==", "dev": true, "dependencies": { - "@algolia/logger-common": "4.19.1" + "@algolia/logger-common": "4.20.0" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.19.1.tgz", - "integrity": "sha512-09K/+t7lptsweRTueHnSnmPqIxbHMowejAkn9XIcJMLdseS3zl8ObnS5GWea86mu3vy4+8H+ZBKkUN82Zsq/zg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.20.0.tgz", + "integrity": "sha512-HbzoSjcjuUmYOkcHECkVTwAelmvTlgs48N6Owt4FnTOQdwn0b8pdht9eMgishvk8+F8bal354nhx/xOoTfwiAw==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.19.1" + "@algolia/requester-common": "4.20.0" } }, "node_modules/@algolia/requester-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.19.1.tgz", - "integrity": "sha512-BisRkcWVxrDzF1YPhAckmi2CFYK+jdMT60q10d7z3PX+w6fPPukxHRnZwooiTUrzFe50UBmLItGizWHP5bDzVQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.20.0.tgz", + "integrity": "sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==", "dev": true }, "node_modules/@algolia/requester-node-http": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.19.1.tgz", - "integrity": "sha512-6DK52DHviBHTG2BK/Vv2GIlEw7i+vxm7ypZW0Z7vybGCNDeWzADx+/TmxjkES2h15+FZOqVf/Ja677gePsVItA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.20.0.tgz", + "integrity": "sha512-ocJ66L60ABSSTRFnCHIEZpNHv6qTxsBwJEPfYaSBsLQodm0F9ptvalFkHMpvj5DfE22oZrcrLbOYM2bdPJRHng==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.19.1" + "@algolia/requester-common": "4.20.0" } }, "node_modules/@algolia/transporter": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.19.1.tgz", - "integrity": "sha512-nkpvPWbpuzxo1flEYqNIbGz7xhfhGOKGAZS7tzC+TELgEmi7z99qRyTfNSUlW7LZmB3ACdnqAo+9A9KFBENviQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.20.0.tgz", + "integrity": "sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.19.1", - "@algolia/logger-common": "4.19.1", - "@algolia/requester-common": "4.19.1" + "@algolia/cache-common": "4.20.0", + "@algolia/logger-common": "4.20.0", + "@algolia/requester-common": "4.20.0" } }, "node_modules/@babel/parser": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", - "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", + "version": "7.22.16", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", + "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -228,12 +231,12 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", - "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "dev": true, "dependencies": { - "regenerator-runtime": "^0.13.11" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" @@ -315,17 +318,17 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.36.1.tgz", - "integrity": "sha512-922xqFsTpHs6D0BUiG4toiyPOMc8/jafnWKxz1KWgS4XzKPy2qXf1Pe6UFuNSCQqt6tOuhAWXBNuuyUhJmw9Vg==", + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.40.1.tgz", + "integrity": "sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==", "dev": true, "dependencies": { - "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~3.1.0" + "comment-parser": "1.4.0", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" }, "engines": { - "node": "^14 || ^16 || ^17 || ^18 || ^19" + "node": ">=16" } }, "node_modules/@esbuild/android-arm": { @@ -696,9 +699,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.1.tgz", - "integrity": "sha512-O7x6dMstWLn2ktjcoiNLDkAGG2EjveHL+Vvc+n0fXumkJYAcSqcVYKtwDU+hDZ0uDUsnUagSYaZrOLAYE8un1A==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", + "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -915,9 +918,9 @@ } }, "node_modules/@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==", "dev": true }, "node_modules/@types/markdown-it": { @@ -937,9 +940,9 @@ "dev": true }, "node_modules/@types/triple-beam": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", - "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.3.tgz", + "integrity": "sha512-6tOUG+nVHn0cJbVp25JFayS5UE6+xlbcNF9Lo9mU7U0zk3zeUShZied4YEQZjy1JBF043FSkdXw8YkUJuVtB5g==" }, "node_modules/@types/web-bluetooth": { "version": "0.0.17", @@ -1291,25 +1294,25 @@ } }, "node_modules/algoliasearch": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.19.1.tgz", - "integrity": "sha512-IJF5b93b2MgAzcE/tuzW0yOPnuUyRgGAtaPv5UUywXM8kzqfdwZTO4sPJBzoGz1eOy6H9uEchsJsBFTELZSu+g==", - "dev": true, - "dependencies": { - "@algolia/cache-browser-local-storage": "4.19.1", - "@algolia/cache-common": "4.19.1", - "@algolia/cache-in-memory": "4.19.1", - "@algolia/client-account": "4.19.1", - "@algolia/client-analytics": "4.19.1", - "@algolia/client-common": "4.19.1", - "@algolia/client-personalization": "4.19.1", - "@algolia/client-search": "4.19.1", - "@algolia/logger-common": "4.19.1", - "@algolia/logger-console": "4.19.1", - "@algolia/requester-browser-xhr": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/requester-node-http": "4.19.1", - "@algolia/transporter": "4.19.1" + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.20.0.tgz", + "integrity": "sha512-y+UHEjnOItoNy0bYO+WWmLWBlPwDjKHW6mNHrPi0NkuhpQOOEbrkwQH/wgKFDLh7qlKjzoKeiRtlpewDPDG23g==", + "dev": true, + "dependencies": { + "@algolia/cache-browser-local-storage": "4.20.0", + "@algolia/cache-common": "4.20.0", + "@algolia/cache-in-memory": "4.20.0", + "@algolia/client-account": "4.20.0", + "@algolia/client-analytics": "4.20.0", + "@algolia/client-common": "4.20.0", + "@algolia/client-personalization": "4.20.0", + "@algolia/client-search": "4.20.0", + "@algolia/logger-common": "4.20.0", + "@algolia/logger-console": "4.20.0", + "@algolia/requester-browser-xhr": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/requester-node-http": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/ansi-escape-sequences": { @@ -1361,6 +1364,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1478,6 +1490,18 @@ "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==" }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cache-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", @@ -1538,6 +1562,18 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cli-progress": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", @@ -1745,9 +1781,9 @@ } }, "node_modules/comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.0.tgz", + "integrity": "sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==", "dev": true, "engines": { "node": ">= 12.0.0" @@ -1820,21 +1856,6 @@ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, - "node_modules/concurrently/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/config-master": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", @@ -2133,30 +2154,32 @@ } }, "node_modules/eslint-config-tjw-jsdoc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-tjw-jsdoc/-/eslint-config-tjw-jsdoc-1.0.3.tgz", - "integrity": "sha512-DbOg2alLnIfbC3iPdyePYGvlaU/mh0uPF0aQ26LMC0LM7MssHUI++YcaDG7FzAnDpN8tqOXJSNQ1CycS7rAM5w==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/eslint-config-tjw-jsdoc/-/eslint-config-tjw-jsdoc-1.0.4.tgz", + "integrity": "sha512-EzlFlBiVyr/GfEzMeTHeJvRF3RukrjSFU/CtxZAqVM6r1OFwotkVu+qpVGSe2WhwzBuukLIfYGjk8Vrn2mpu3w==", "dev": true, "dependencies": { - "eslint-plugin-jsdoc": "^39.3.3" + "eslint-plugin-jsdoc": "^46.8.1" } }, "node_modules/eslint-plugin-jsdoc": { - "version": "39.9.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.9.1.tgz", - "integrity": "sha512-Rq2QY6BZP2meNIs48aZ3GlIlJgBqFCmR55+UBvaDkA3ZNQ0SvQXOs2QKkubakEijV8UbIVbVZKsOVN8G3MuqZw==", + "version": "46.8.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz", + "integrity": "sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.36.1", - "comment-parser": "1.3.1", + "@es-joy/jsdoccomment": "~0.40.1", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.0", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.8", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1" }, "engines": { - "node": "^14 || ^16 || ^17 || ^18 || ^19" + "node": ">=16" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" @@ -2430,22 +2453,23 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.7", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=12.0.0" } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "node_modules/flushwritable": { @@ -2566,9 +2590,9 @@ } }, "node_modules/glob": { - "version": "10.3.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz", - "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==", + "version": "10.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.5.tgz", + "integrity": "sha512-bYUpUD7XDEHI4Q2O5a7PXGvyw4deKR70kHiDxzQbe925wbZknhOzUt2xBgTkYL6RBcVeXYuD9iNYeqoWbBZQnA==", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", @@ -2621,9 +2645,9 @@ } }, "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "version": "13.22.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", + "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2684,13 +2708,13 @@ "dev": true }, "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "dependencies": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "wordwrap": "^1.0.0" }, @@ -2784,6 +2808,21 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -2869,9 +2908,9 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/jackspeak": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.2.tgz", - "integrity": "sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.3.tgz", + "integrity": "sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -2994,9 +3033,9 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz", - "integrity": "sha512-MgtD0ZiCDk9B+eI73BextfRrVQl0oyzRG8B2BjORts6jbunj4ScKPcyXGTbB6eXL4y9TzxCm6hyeLq/2ASzNdw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", "dev": true, "engines": { "node": ">=12.0.0" @@ -3023,6 +3062,12 @@ "node": ">=10" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3065,6 +3110,15 @@ "setimmediate": "^1.0.5" } }, + "node_modules/keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/klaw": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", @@ -3175,9 +3229,9 @@ } }, "node_modules/lru-cache": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", - "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", "engines": { "node": "14 || >=16.14" } @@ -3289,9 +3343,9 @@ } }, "node_modules/minipass": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.2.tgz", - "integrity": "sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", + "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", "engines": { "node": ">=16 || 14 >=14.17" } @@ -3628,9 +3682,9 @@ } }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", + "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", "dev": true, "funding": [ { @@ -3850,9 +3904,9 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", "dev": true }, "node_modules/require-directory": { @@ -3927,9 +3981,9 @@ } }, "node_modules/rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.2.tgz", + "integrity": "sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -3993,14 +4047,11 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/search-insights": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.8.0.tgz", - "integrity": "sha512-VzI4PMktJbydkbrF3/n40vFfRxdwg+o3CkQt0F3mHRSXVuv0PsVxQvB6mQQq/e9MCXAemcmp/GP9CNHpayFoCw==", + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.8.2.tgz", + "integrity": "sha512-PxA9M5Q2bpBelVvJ3oDZR8nuY00Z6qwOxL53wNpgzV28M/D6u9WUbImDckjLSILBF8F1hn/mgyuUaOPtjow4Qw==", "dev": true, - "peer": true, - "engines": { - "node": ">=16.0.0" - } + "peer": true }, "node_modules/selenium-webdriver": { "version": "4.12.0", @@ -4090,9 +4141,9 @@ } }, "node_modules/signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "engines": { "node": ">=14" }, @@ -4180,9 +4231,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", + "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", "dev": true }, "node_modules/stack-trace": { @@ -4326,15 +4377,18 @@ } }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/tabbable": { @@ -4486,9 +4540,9 @@ } }, "node_modules/tslib": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", - "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, "node_modules/type-check": { @@ -4625,9 +4679,9 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.14", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.14.tgz", - "integrity": "sha512-yChIeXOAcNvVnSVjhziH1vte0uhKb00PuZf7KdIMfx3ixTMAz73Nn+6gREvCv0SdH+anteGUKz5eljv0ygcgGQ==", + "version": "1.0.0-rc.15", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.15.tgz", + "integrity": "sha512-5criiHoEibkT/du7t6wQ2xQVsuTNuirQZbMAi0M9Hp0YzJoJvEX68Ej9p2PtNC84bYb/CxAh5QkMtMutk03lHw==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", @@ -4886,9 +4940,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "dev": true, "engines": { "node": ">=10.0.0" diff --git a/src/bld/build.js b/src/bld/build.js deleted file mode 100644 index ff4b3d80c..000000000 --- a/src/bld/build.js +++ /dev/null @@ -1,85 +0,0 @@ -import { resolve } from "node:path"; -import { cp, rm } from "node:fs/promises"; - -import compressing from "compressing"; - -import { log } from "../log.js"; - -import { setLinuxConfig } from "./linuxCfg.js"; -import { setOsxConfig } from "./osxCfg.js"; -import { setWinConfig } from "./winCfg.js"; - -/** - * Generate NW build artifacts - * - * @param {string | string[]} files Array of NW app files - * @param {string} nwDir Directory to hold NW binaries - * @param {string} outDir Directory to store build artifacts - * @param {"linux" | "osx" | "win"} platform Platform is the operating system type - * @param {"zip" | boolean} zip Specify if the build artifacts are to be zipped - * @param {object} app Multi platform configuration options - * @return {Promise} - */ -export const build = async (files, nwDir, outDir, platform, zip, app) => { - log.debug(`Remove any files at ${outDir} directory`); - await rm(outDir, { force: true, recursive: true }); - log.debug(`Copy ${nwDir} files to ${outDir} directory`); - await cp(nwDir, outDir, { recursive: true, verbatimSymlinks: true }); - - log.debug(`Copy files in srcDir to ${outDir} directory`); - - if (typeof files === "string") { - await cp( - files, - resolve( - outDir, - platform !== "osx" - ? "package.nw" - : "nwjs.app/Contents/Resources/app.nw", - ), - { recursive: true, verbatimSymlinks: true }, - ); - } else { - for (let file of files) { - log.debug(`Copy ${file} file to ${outDir} directory`); - await cp( - file, - resolve( - outDir, - platform !== "osx" - ? "package.nw" - : "nwjs.app/Contents/Resources/app.nw", - file, - ), - { recursive: true, verbatimSymlinks: true }, - ); - } - } - - log.debug(`Starting platform specific config steps for ${platform}`); - switch (platform) { - case "linux": - await setLinuxConfig(app, outDir); - break; - case "win": - await setWinConfig(app, outDir); - break; - case "osx": - await setOsxConfig(app, outDir); - break; - default: - break; - } - - if (zip !== false) { - if (zip === true || zip === "zip") { - await compressing.zip.compressDir(outDir, `${outDir}.zip`); - } else if (zip === "tar") { - await compressing.tar.compressDir(outDir, `${outDir}.tar`); - } else if (zip === "tgz") { - await compressing.tgz.compressDir(outDir, `${outDir}.tgz`); - } - - await rm(outDir, { recursive: true, force: true }); - } -}; diff --git a/src/bld/linuxCfg.js b/src/bld/linuxCfg.js deleted file mode 100644 index 43d4f8d23..000000000 --- a/src/bld/linuxCfg.js +++ /dev/null @@ -1,85 +0,0 @@ -import { platform } from "node:process"; -import { rename, writeFile } from "node:fs/promises"; - -import { log } from "../log.js"; - -/** - * @typedef {object} LinuxRc Linux configuration options - * @typedef {string} name Name of the application - * @property {string} genericName Generic name of the application - * @property {boolean} noDisplay If true the application is not displayed - * @property {string} comment Tooltip for the entry, for example "View sites on the Internet". - * @property {string} icon Icon to display in file manager, menus, etc. - * @property {boolean} hidden TBD - * @property {string[]} onlyShowIn A list of strings identifying the desktop environments that should (/not) display a given desktop entry - * @property {string[]} notShowIn A list of strings identifying the desktop environments that should (/not) display a given desktop entry - * @property {boolean} dBusActivatable A boolean value specifying if D-Bus activation is supported for this application - * @property {string} tryExec Path to an executable file on disk used to determine if the program is actually installed - * @property {string} exec Program to execute, possibly with arguments. - * @property {string} path If entry is of type Application, the working directory to run the program in. - * @property {boolean} terminal Whether the program runs in a terminal window. - * @property {string[]} actions Identifiers for application actions. - * @property {string[]} mimeType The MIME type(s) supported by this application. - * @property {string[]} categories Categories in which the entry should be shown in a menu - * @property {string[]} implements A list of interfaces that this application implements. - * @property {string[]} keywords A list of strings which may be used in addition to other metadata to describe this entry. - * @property {boolean} startupNotify If true, it is KNOWN that the application will send a "remove" message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all. - * @property {string} startupWMClass If specified, it is known that the application will map at least one window with the given string as its WM class or WM name hin - * @property {boolean} prefersNonDefaultGPU If true, the application prefers to be run on a more powerful discrete GPU if available. - * @property {string} singleMainWindow If true, the application has a single main window, and does not support having an additional one opened. - */ - -/** - * Generates a Desktop Entry file for Linux - * https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html - * - * @param {LinuxRc} app Resource configuration options for Linux - * @param {string} outDir Directory which stores build artifacts - * @return {Promise} - */ -export const setLinuxConfig = async (app, outDir) => { - if (platform === "win32") { - log.warn( - "Linux apps built on Windows platform do not preserve all file permissions. See #716", - ); - } - let desktopEntryFile = { - Type: "Application", - Version: "1.5", - Name: app.name, - GenericName: app.genericName, - NoDisplay: app.noDisplay, - Comment: app.comment, - Icon: app.icon, - Hidden: app.hidden, - OnlyShowIn: app.onlyShowIn, - NotShowIn: app.notShowIn, - DBusActivatable: app.dBusActivatable, - TryExec: app.tryExec, - Exec: app.name, - Path: app.path, - Terminal: app.terminal, - Actions: app.actions, - MimeType: app.mimeType, - Categories: app.categories, - Implements: app.implements, - Keywords: app.keywords, - StartupNotify: app.startupNotify, - StartupWMClass: app.startupWMClass, - PrefersNonDefaultGPU: app.prefersNonDefaultGPU, - SingleMainWindow: app.singleMainWindow, - }; - - await rename(`${outDir}/nw`, `${outDir}/${app.name}`); - - let fileContent = `[Desktop Entry]\n`; - Object.keys(desktopEntryFile).forEach((key) => { - if (desktopEntryFile[key] !== undefined) { - fileContent += `${key}=${desktopEntryFile[key]}\n`; - log.debug(`Add ${key}=${desktopEntryFile[key]} to Desktop Entry File`); - } - }); - let filePath = `${outDir}/${app.name}.desktop`; - await writeFile(filePath, fileContent); - log.debug("Desktop Entry file generated"); -}; diff --git a/src/bld/osxCfg.js b/src/bld/osxCfg.js deleted file mode 100644 index b41d5812f..000000000 --- a/src/bld/osxCfg.js +++ /dev/null @@ -1,94 +0,0 @@ -import { platform } from "node:process"; -import { copyFile, rename, readFile, writeFile } from "node:fs/promises"; -import { resolve } from "node:path"; - -import plist from "plist"; - -import { log } from "../log.js"; - -/** - * @typedef {object} OsxRc OSX resource configuration options - * @property {string} name The name of the application - * @property {string} icon The path to the icon file. It should be a .icns file. - * @property {string} LSApplicationCategoryType The category that best describes your app for the App Store. - * @property {string} CFBundleIdentifier A unique identifier for a bundle usually in reverse DNS format. - * @property {string} CFBundleName A user-visible short name for the bundle. - * @property {string} CFBundleDisplayName The user-visible name for the bundle. - * @property {string} CFBundleSpokenName A replacement for the app name in text-to-speech operations. - * @property {string} CFBundleVersion The version of the build that identifies an iteration of the bundle. - * @property {string} CFBundleShortVersionString The release or version number of the bundle. - * @property {string} NSHumanReadableCopyright A human-readable copyright notice for the bundle. - */ - -/** - * OSX specific configuration steps - * https://developer.apple.com/documentation/bundleresources/information_property_list - * - * @param {object} app Resource configuration options for MacOS - * @param {string} outDir The directory to hold build artifacts - * @return {Promise} - */ -const setOsxConfig = async (app, outDir) => { - if (platform === "win32") { - log.warn( - "MacOS apps built on Windows platform do not preserve all file permissions. See #716", - ); - } - - try { - const outApp = resolve(outDir, `${app.name}.app`); - await rename(resolve(outDir, "nwjs.app"), outApp); - if (app.icon !== undefined) { - await copyFile( - resolve(app.icon), - resolve(outApp, "Contents", "Resources", "app.icns"), - ); - } - - const infoPlistPath = resolve(outApp, "Contents", "Info.plist"); - const infoPlistJson = plist.parse(await readFile(infoPlistPath, "utf-8")); - - const infoPlistStringsPath = resolve( - outApp, - "Contents", - "Resources", - "en.lproj", - "InfoPlist.strings", - ); - const infoPlistStringsData = await readFile(infoPlistStringsPath, "utf-8"); - - let infoPlistStringsDataArray = infoPlistStringsData.split("\n"); - - infoPlistStringsDataArray.forEach((line, idx, arr) => { - if (line.includes("NSHumanReadableCopyright")) { - arr[ - idx - ] = `NSHumanReadableCopyright = "${app.NSHumanReadableCopyright}";`; - } - }); - - infoPlistJson.LSApplicationCategoryType = app.LSApplicationCategoryType; - infoPlistJson.CFBundleIdentifier = app.CFBundleIdentifier; - infoPlistJson.CFBundleName = app.CFBundleName; - infoPlistJson.CFBundleDisplayName = app.CFBundleDisplayName; - infoPlistJson.CFBundleSpokenName = app.CFBundleSpokenName; - infoPlistJson.CFBundleVersion = app.CFBundleVersion; - infoPlistJson.CFBundleShortVersionString = app.CFBundleShortVersionString; - - Object.keys(infoPlistJson).forEach((option) => { - if (infoPlistJson[option] === undefined) { - delete infoPlistJson[option]; - } - }); - - await writeFile(infoPlistPath, plist.build(infoPlistJson)); - await writeFile( - infoPlistStringsPath, - infoPlistStringsDataArray.toString().replace(/,/g, "\n"), - ); - } catch (error) { - log.error(error); - } -}; - -export { setOsxConfig }; diff --git a/src/bld/winCfg.js b/src/bld/winCfg.js deleted file mode 100644 index 88c6823df..000000000 --- a/src/bld/winCfg.js +++ /dev/null @@ -1,81 +0,0 @@ -import { rename } from "node:fs/promises"; -import { resolve } from "node:path"; - -import rcedit from "rcedit"; - -import { log } from "../log.js"; - -/** - * @typedef {object} WinRc Windows configuration options - * @property {string} name The name of the application - * @property {string} version The version of the application - * @property {string} comments Additional information that should be displayed for diagnostic purposes. - * @property {string} company Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. - * @property {string} fileDescription File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required. - * @property {string} fileVersion Version number of the file. For example, 3.10 or 5.00.RC2. This string is required. - * @property {string} icon The path to the icon file. It should be a .ico file. - * @property {string} internalName Internal name of the file, if one exists—for example, a module name if the file is a dynamic-link library. If the file has no internal name, this string should be the original filename, without extension. This string is required. - * @property {string} legalCopyright Copyright notices that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, and so on. This string is optional. - * @property {string} legalTrademark Trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. This string is optional. - * @property {string} originalFilename Original name of the file, not including a path. This information enables an application to determine whether a file has been renamed by a user. The format of the name depends on the file system for which the file was created. This string is required. - * @property {string} privateBuild Information about a private version of the file—for example, Built by TESTER1 on \\TESTBED. This string should be present only if VS_FF_PRIVATEBUILD is specified in the fileflags parameter of the root block. - * @property {string} productName Name of the product with which the file is distributed. This string is required. - * @property {string} productVersion Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2. This string is required. - * @property {string} specialBuild Text that specifies how this version of the file differs from the standard version—for example, Private build for TESTER1 solving mouse problems on M250 and M250E computers. This string should be present only if VS_FF_SPECIALBUILD is specified in the fileflags parameter of the root block. - */ - -/** - * Windows specific configuration steps - * https://learn.microsoft.com/en-us/windows/win32/msi/version - * https://learn.microsoft.com/en-gb/windows/win32/sbscs/application-manifests - * https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/deployment/trustinfo-element-clickonce-application?view=vs-2015#requestedexecutionlevel - * https://learn.microsoft.com/en-gb/windows/win32/menurc/versioninfo-resource - * - * @param {WinRc} app Resource configuration options for Windows - * @param {string} outDir The directory to hold build artifacts - */ -const setWinConfig = async (app, outDir) => { - let versionString = { - Comments: app.comments, - CompanyName: app.author, - FileDescription: app.fileDescription, - FileVersion: app.fileVersion, - InternalName: app.name, - LegalCopyright: app.legalCopyright, - LegalTrademarks: app.legalTrademark, - OriginalFilename: app.name, - PrivateBuild: app.name, - ProductName: app.name, - ProductVersion: app.version, - SpecialBuild: app.name, - }; - - Object.keys(versionString).forEach((option) => { - if (versionString[option] === undefined) { - delete versionString[option]; - } - }); - - const rcEditOptions = { - "file-version": app.version, - "product-version": app.version, - "version-string": versionString, - }; - - if (app.icon) { - rcEditOptions.icon = app.icon; - } - - try { - const outDirAppExe = resolve(outDir, `${app.name}.exe`); - await rename(resolve(outDir, "nw.exe"), outDirAppExe); - await rcedit(outDirAppExe, rcEditOptions); - } catch (error) { - log.warn( - "Renaming EXE failed or unable to modify EXE. If it's the latter, ensure WINE is installed or build your application Windows platform", - ); - log.error(error); - } -}; - -export { setWinConfig }; diff --git a/src/build.js b/src/build.js new file mode 100644 index 000000000..e7a2c7c60 --- /dev/null +++ b/src/build.js @@ -0,0 +1,318 @@ +import { resolve } from "node:path"; +import { platform as PLATFORM } from "node:process"; +import { + cp, + copyFile, + rename, + readFile, + rm, + writeFile, +} from "node:fs/promises"; + +import compressing from "compressing"; +import rcedit from "rcedit"; +import plist from "plist"; + +import { log } from "./log.js"; + +/** + * References: + * https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html + * + * @typedef {object} LinuxRc Linux configuration options + * @property {string} name Name of the application + * @property {string} genericName Generic name of the application + * @property {boolean} noDisplay If true the application is not displayed + * @property {string} comment Tooltip for the entry, for example "View sites on the Internet". + * @property {string} icon Icon to display in file manager, menus, etc. + * @property {boolean} hidden TBD + * @property {string[]} onlyShowIn A list of strings identifying the desktop environments that should (/not) display a given desktop entry + * @property {string[]} notShowIn A list of strings identifying the desktop environments that should (/not) display a given desktop entry + * @property {boolean} dBusActivatable A boolean value specifying if D-Bus activation is supported for this application + * @property {string} tryExec Path to an executable file on disk used to determine if the program is actually installed + * @property {string} exec Program to execute, possibly with arguments. + * @property {string} path If entry is of type Application, the working directory to run the program in. + * @property {boolean} terminal Whether the program runs in a terminal window. + * @property {string[]} actions Identifiers for application actions. + * @property {string[]} mimeType The MIME type(s) supported by this application. + * @property {string[]} categories Categories in which the entry should be shown in a menu + * @property {string[]} implements A list of interfaces that this application implements. + * @property {string[]} keywords A list of strings which may be used in addition to other metadata to describe this entry. + * @property {boolean} startupNotify If true, it is KNOWN that the application will send a "remove" message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all. + * @property {string} startupWMClass If specified, it is known that the application will map at least one window with the given string as its WM class or WM name hin + * @property {boolean} prefersNonDefaultGPU If true, the application prefers to be run on a more powerful discrete GPU if available. + * @property {string} singleMainWindow If true, the application has a single main window, and does not support having an additional one opened. + */ + +/** + * References: + * https://developer.apple.com/documentation/bundleresources/information_property_list + * + * @typedef {object} OsxRc OSX resource configuration options + * @property {string} name The name of the application + * @property {string} icon The path to the icon file. It should be a .icns file. + * @property {string} LSApplicationCategoryType The category that best describes your app for the App Store. + * @property {string} CFBundleIdentifier A unique identifier for a bundle usually in reverse DNS format. + * @property {string} CFBundleName A user-visible short name for the bundle. + * @property {string} CFBundleDisplayName The user-visible name for the bundle. + * @property {string} CFBundleSpokenName A replacement for the app name in text-to-speech operations. + * @property {string} CFBundleVersion The version of the build that identifies an iteration of the bundle. + * @property {string} CFBundleShortVersionString The release or version number of the bundle. + * @property {string} NSHumanReadableCopyright A human-readable copyright notice for the bundle. + */ + +/** + * References: + * https://learn.microsoft.com/en-us/windows/win32/msi/version + * https://learn.microsoft.com/en-gb/windows/win32/sbscs/application-manifests + * https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/deployment/trustinfo-element-clickonce-application?view=vs-2015#requestedexecutionlevel + * https://learn.microsoft.com/en-gb/windows/win32/menurc/versioninfo-resource + * + * @typedef {object} WinRc Windows configuration options. More info + * @property {string} name The name of the application + * @property {string} version The version of the application + * @property {string} comments Additional information that should be displayed for diagnostic purposes. + * @property {string} company Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. + * @property {string} fileDescription File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required. + * @property {string} fileVersion Version number of the file. For example, 3.10 or 5.00.RC2. This string is required. + * @property {string} icon The path to the icon file. It should be a .ico file. + * @property {string} internalName Internal name of the file, if one exists—for example, a module name if the file is a dynamic-link library. If the file has no internal name, this string should be the original filename, without extension. This string is required. + * @property {string} legalCopyright Copyright notices that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, and so on. This string is optional. + * @property {string} legalTrademark Trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. This string is optional. + * @property {string} originalFilename Original name of the file, not including a path. This information enables an application to determine whether a file has been renamed by a user. The format of the name depends on the file system for which the file was created. This string is required. + * @property {string} privateBuild Information about a private version of the file—for example, Built by TESTER1 on \\TESTBED. This string should be present only if VS_FF_PRIVATEBUILD is specified in the fileflags parameter of the root block. + * @property {string} productName Name of the product with which the file is distributed. This string is required. + * @property {string} productVersion Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2. This string is required. + * @property {string} specialBuild Text that specifies how this version of the file differs from the standard version—for example, Private build for TESTER1 solving mouse problems on M250 and M250E computers. This string should be present only if VS_FF_SPECIALBUILD is specified in the fileflags parameter of the root block. + */ + +/** + * Generate NW build artifacts + * + * Note: File permissions are incorrectly set for Linux or MacOS apps built on Windows platform. For more info: https://www.geeksforgeeks.org/node-js-fs-chmod-method + * + * Note: To edit Windows executable resources, we use [`rcedit`](https://github.com/electron/node-rcedit). To use rcedit on non-Windows platforms, you will have to install [Wine](https://www.winehq.org/). + * + * Note: We recursively glob the file patterns given by the user. The first `package.json` parsed is taken to be the NW.js manifest file. If you have multiple manifest files, the first glob pattern should be the path to the NW.js manifest. Choosing a Node manifest at `./package.json` is the most convenient option. + * + * Note: If you are using the MacOS ARM unofficial builds, you will need to [remove the `com.apple.qurantine` flag](https://github.com/corwin-of-amber/nw.js/releases/tag/nw-v0.75.0): + * + * `sudo xattr -r -d com.apple.quarantine nwjs.app` + * + * @example + * // Minimal Usage (uses default values) + * nwbuild({ + * mode: "build", + * }); + * + * @param {string | string[]} files Array of NW app files + * @param {string} nwDir Directory to hold NW binaries + * @param {string} outDir Directory to store build artifacts + * @param {"linux" | "osx" | "win"} platform Platform is the operating system type + * @param {"zip" | boolean} zip Specify if the build artifacts are to be zipped + * @param {LinuxRc | OsxRc | WinRc} app Multi platform configuration options + * @return {Promise} + */ +export async function build(files, nwDir, outDir, platform, zip, app) { + log.debug(`Remove any files at ${outDir} directory`); + await rm(outDir, { force: true, recursive: true }); + log.debug(`Copy ${nwDir} files to ${outDir} directory`); + await cp(nwDir, outDir, { recursive: true, verbatimSymlinks: true }); + + log.debug(`Copy files in srcDir to ${outDir} directory`); + + if (typeof files === "string") { + await cp( + files, + resolve( + outDir, + platform !== "osx" + ? "package.nw" + : "nwjs.app/Contents/Resources/app.nw", + ), + { recursive: true, verbatimSymlinks: true }, + ); + } else { + for (let file of files) { + log.debug(`Copy ${file} file to ${outDir} directory`); + await cp( + file, + resolve( + outDir, + platform !== "osx" + ? "package.nw" + : "nwjs.app/Contents/Resources/app.nw", + file, + ), + { recursive: true, verbatimSymlinks: true }, + ); + } + } + + log.debug(`Starting platform specific config steps for ${platform}`); + + if (platform === "linux") { + if (PLATFORM === "win32") { + log.warn( + "Linux apps built on Windows platform do not preserve all file permissions. See #716", + ); + } + let desktopEntryFile = { + Type: "Application", + Version: "1.5", + Name: app.name, + GenericName: app.genericName, + NoDisplay: app.noDisplay, + Comment: app.comment, + Icon: app.icon, + Hidden: app.hidden, + OnlyShowIn: app.onlyShowIn, + NotShowIn: app.notShowIn, + DBusActivatable: app.dBusActivatable, + TryExec: app.tryExec, + Exec: app.name, + Path: app.path, + Terminal: app.terminal, + Actions: app.actions, + MimeType: app.mimeType, + Categories: app.categories, + Implements: app.implements, + Keywords: app.keywords, + StartupNotify: app.startupNotify, + StartupWMClass: app.startupWMClass, + PrefersNonDefaultGPU: app.prefersNonDefaultGPU, + SingleMainWindow: app.singleMainWindow, + }; + + await rename(`${outDir}/nw`, `${outDir}/${app.name}`); + + let fileContent = `[Desktop Entry]\n`; + Object.keys(desktopEntryFile).forEach((key) => { + if (desktopEntryFile[key] !== undefined) { + fileContent += `${key}=${desktopEntryFile[key]}\n`; + log.debug(`Add ${key}=${desktopEntryFile[key]} to Desktop Entry File`); + } + }); + let filePath = `${outDir}/${app.name}.desktop`; + await writeFile(filePath, fileContent); + log.debug("Desktop Entry file generated"); + } else if (platform === "win") { + let versionString = { + Comments: app.comments, + CompanyName: app.author, + FileDescription: app.fileDescription, + FileVersion: app.fileVersion, + InternalName: app.name, + LegalCopyright: app.legalCopyright, + LegalTrademarks: app.legalTrademark, + OriginalFilename: app.name, + PrivateBuild: app.name, + ProductName: app.name, + ProductVersion: app.version, + SpecialBuild: app.name, + }; + + Object.keys(versionString).forEach((option) => { + if (versionString[option] === undefined) { + delete versionString[option]; + } + }); + + const rcEditOptions = { + "file-version": app.version, + "product-version": app.version, + "version-string": versionString, + }; + + if (app.icon) { + rcEditOptions.icon = app.icon; + } + + try { + const outDirAppExe = resolve(outDir, `${app.name}.exe`); + await rename(resolve(outDir, "nw.exe"), outDirAppExe); + await rcedit(outDirAppExe, rcEditOptions); + } catch (error) { + log.warn( + "Renaming EXE failed or unable to modify EXE. If it's the latter, ensure WINE is installed or build your application Windows platform", + ); + log.error(error); + } + } else if (platform === "osx") { + if (PLATFORM === "win32") { + log.warn( + "MacOS apps built on Windows platform do not preserve all file permissions. See #716", + ); + } + + try { + const outApp = resolve(outDir, `${app.name}.app`); + await rename(resolve(outDir, "nwjs.app"), outApp); + if (app.icon !== undefined) { + await copyFile( + resolve(app.icon), + resolve(outApp, "Contents", "Resources", "app.icns"), + ); + } + + const infoPlistPath = resolve(outApp, "Contents", "Info.plist"); + const infoPlistJson = plist.parse(await readFile(infoPlistPath, "utf-8")); + + const infoPlistStringsPath = resolve( + outApp, + "Contents", + "Resources", + "en.lproj", + "InfoPlist.strings", + ); + const infoPlistStringsData = await readFile( + infoPlistStringsPath, + "utf-8", + ); + + let infoPlistStringsDataArray = infoPlistStringsData.split("\n"); + + infoPlistStringsDataArray.forEach((line, idx, arr) => { + if (line.includes("NSHumanReadableCopyright")) { + arr[ + idx + ] = `NSHumanReadableCopyright = "${app.NSHumanReadableCopyright}";`; + } + }); + + infoPlistJson.LSApplicationCategoryType = app.LSApplicationCategoryType; + infoPlistJson.CFBundleIdentifier = app.CFBundleIdentifier; + infoPlistJson.CFBundleName = app.CFBundleName; + infoPlistJson.CFBundleDisplayName = app.CFBundleDisplayName; + infoPlistJson.CFBundleSpokenName = app.CFBundleSpokenName; + infoPlistJson.CFBundleVersion = app.CFBundleVersion; + infoPlistJson.CFBundleShortVersionString = app.CFBundleShortVersionString; + + Object.keys(infoPlistJson).forEach((option) => { + if (infoPlistJson[option] === undefined) { + delete infoPlistJson[option]; + } + }); + + await writeFile(infoPlistPath, plist.build(infoPlistJson)); + await writeFile( + infoPlistStringsPath, + infoPlistStringsDataArray.toString().replace(/,/g, "\n"), + ); + } catch (error) { + log.error(error); + } + } + + if (zip !== false) { + if (zip === true || zip === "zip") { + await compressing.zip.compressDir(outDir, `${outDir}.zip`); + } else if (zip === "tar") { + await compressing.tar.compressDir(outDir, `${outDir}.tar`); + } else if (zip === "tgz") { + await compressing.tgz.compressDir(outDir, `${outDir}.tgz`); + } + + await rm(outDir, { recursive: true, force: true }); + } +} diff --git a/src/index.js b/src/index.js index dadc64bbc..149bc8c4a 100644 --- a/src/index.js +++ b/src/index.js @@ -2,15 +2,15 @@ import { mkdir } from "node:fs/promises"; import { resolve } from "node:path"; import { arch, platform, version } from "node:process"; -import { build } from "./bld/build.js"; -import { run } from "./run.js"; import { isCached } from "./util/cache.js"; import { getFiles } from "./util/files.js"; import { getVersionManifest } from "./util/versionManifest.js"; import { parse } from "./util/parse.js"; import { validate } from "./util/validate.js"; +import { build } from "./build.js"; import { get } from "./get.js"; +import { run } from "./run.js"; import { log, setLogLevel } from "./log.js"; import { getReleaseInfo } from "./util.js"; @@ -121,7 +121,7 @@ const nwbuild = async (options) => { }); if (options.mode === "get") { - // Do nothing else since we have already downloaded the binaries + // Do nothing else since we have already downloaded the binaries. return; } From a817aa8baf8c2b78bb9de26a220abf13cb62e5cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:41:46 +0000 Subject: [PATCH 16/22] chore(deps): bump the npm group with 3 updates (#952) --- package-lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index d32a9b821..a01b36ce3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -731,9 +731,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", - "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", + "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2100,15 +2100,15 @@ } }, "node_modules/eslint": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", - "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", + "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.49.0", + "@eslint/js": "8.50.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2590,9 +2590,9 @@ } }, "node_modules/glob": { - "version": "10.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.5.tgz", - "integrity": "sha512-bYUpUD7XDEHI4Q2O5a7PXGvyw4deKR70kHiDxzQbe925wbZknhOzUt2xBgTkYL6RBcVeXYuD9iNYeqoWbBZQnA==", + "version": "10.3.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.6.tgz", + "integrity": "sha512-mEfImdc/fiYHEcF6pHFfD2b/KrdFB1qH9mRe5vI5HROF8G51SWxQJ2V56Ezl6ZL9y86gsxQ1Lgo2S746KGUPSQ==", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", @@ -4679,9 +4679,9 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.15.tgz", - "integrity": "sha512-5criiHoEibkT/du7t6wQ2xQVsuTNuirQZbMAi0M9Hp0YzJoJvEX68Ej9p2PtNC84bYb/CxAh5QkMtMutk03lHw==", + "version": "1.0.0-rc.17", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.17.tgz", + "integrity": "sha512-OPyP/VExNUk1aiErOgLE7Vv9Tgr9i9DZHDlDzqBcLfvDpXq33CDfn42JSzpsKGA020HOFOnV+t3/S1i/T5n7bg==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", From 1ed0ac21f8d3e42a79ef5b5c5b397c5cfa2c3c5f Mon Sep 17 00:00:00 2001 From: Ayush C <14110965+ayushmanchhabra@users.noreply.github.com> Date: Wed, 27 Sep 2023 23:58:59 -0400 Subject: [PATCH 17/22] fix(get): correctly pass options to function (#953) --- .github/dependabot.yml | 3 ++- changelog.md | 1 + package-lock.json | 51 +++++++++++++++++++++++++++--------------- package.json | 6 ++--- src/get.js | 10 ++++++++- 5 files changed, 48 insertions(+), 23 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6dff5c19d..3c044ec6a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,12 +5,13 @@ updates: schedule: interval: "weekly" day: "saturday" + versioning-strategy: increase groups: npm: patterns: - "*" - package-ecosystem: "github-actions" - directory: ".github/" + directory: ".github/workflows" schedule: interval: "weekly" day: "saturday" diff --git a/changelog.md b/changelog.md index 3ff244f6a..921a76a9f 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed +- Fix get mode. - Refactor build mode. - Generate markdown docs from JSDocs. diff --git a/package-lock.json b/package-lock.json index a01b36ce3..500df8e26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "cli-progress": "^3.12.0", "compressing": "^1.10.0", - "glob": "^10.3.3", + "glob": "^10.3.10", "plist": "^3.1.0", "rcedit": "^4.0.0", "winston": "^3.9.0", @@ -28,8 +28,8 @@ "jsdoc": "^4.0.2", "jsdoc-to-markdown": "^8.0.0", "prettier": "^3.0.1", - "selenium-webdriver": "^4.10.0", - "vitepress": "^1.0.0-beta.5" + "selenium-webdriver": "^4.13.0", + "vitepress": "^1.0.0-rc.20" }, "engines": { "node": ">= v16.20.1 || >= v18.18.0 || >= v20.7.0" @@ -2590,18 +2590,18 @@ } }, "node_modules/glob": { - "version": "10.3.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.6.tgz", - "integrity": "sha512-mEfImdc/fiYHEcF6pHFfD2b/KrdFB1qH9mRe5vI5HROF8G51SWxQJ2V56Ezl6ZL9y86gsxQ1Lgo2S746KGUPSQ==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.5", "minimatch": "^9.0.1", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", "path-scurry": "^1.10.1" }, "bin": { - "glob": "dist/cjs/src/bin.js" + "glob": "dist/esm/bin.mjs" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -2908,9 +2908,9 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/jackspeak": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.3.tgz", - "integrity": "sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -4054,9 +4054,9 @@ "peer": true }, "node_modules/selenium-webdriver": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.12.0.tgz", - "integrity": "sha512-zvPzmTsky6WfO6+BGMj2mCJsw7qKnfQONur2b+pGn8jeTiC+WAUOthZOnaK+HkX5wiU6L4uoMF+JIcOVstp25A==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.13.0.tgz", + "integrity": "sha512-8JS0h5E0Sq7gNfbGg8LVaQ+Eqek97tvOONn3Jmy+NiWfb12WYpftz4VTC4D2JT4wakdG6VUzGKpA8cFGg0IjkA==", "dev": true, "dependencies": { "jszip": "^3.10.1", @@ -4679,13 +4679,14 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.17", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.17.tgz", - "integrity": "sha512-OPyP/VExNUk1aiErOgLE7Vv9Tgr9i9DZHDlDzqBcLfvDpXq33CDfn42JSzpsKGA020HOFOnV+t3/S1i/T5n7bg==", + "version": "1.0.0-rc.20", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.20.tgz", + "integrity": "sha512-CykMUJ8JLxLcGWek0ew3wln4RYbsOd1+0YzXITTpajggpynm2S331TNkJVOkHrMRc6GYe3y4pS40GfgcW0ZwAw==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", "@docsearch/js": "^3.5.2", + "@types/markdown-it": "^13.0.1", "@vue/devtools-api": "^6.5.0", "@vueuse/core": "^10.4.1", "@vueuse/integrations": "^10.4.1", @@ -4700,14 +4701,28 @@ "vitepress": "bin/vitepress.js" }, "peerDependencies": { - "markdown-it-mathjax3": "^4.3.2" + "markdown-it-mathjax3": "^4.3.2", + "postcss": "^8.4.30" }, "peerDependenciesMeta": { "markdown-it-mathjax3": { "optional": true + }, + "postcss": { + "optional": true } } }, + "node_modules/vitepress/node_modules/@types/markdown-it": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-13.0.2.tgz", + "integrity": "sha512-Tla7hH9oeXHOlJyBFdoqV61xWE9FZf/y2g+gFVwQ2vE1/eBzjUno5JCd3Hdb5oATve5OF6xNjZ/4VIZhVVx+hA==", + "dev": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, "node_modules/vscode-oniguruma": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", diff --git a/package.json b/package.json index d190bc321..fdbf525d3 100644 --- a/package.json +++ b/package.json @@ -59,13 +59,13 @@ "jsdoc": "^4.0.2", "jsdoc-to-markdown": "^8.0.0", "prettier": "^3.0.1", - "selenium-webdriver": "^4.10.0", - "vitepress": "^1.0.0-beta.5" + "selenium-webdriver": "^4.13.0", + "vitepress": "^1.0.0-rc.20" }, "dependencies": { "cli-progress": "^3.12.0", "compressing": "^1.10.0", - "glob": "^10.3.3", + "glob": "^10.3.10", "plist": "^3.1.0", "rcedit": "^4.0.0", "winston": "^3.9.0", diff --git a/src/get.js b/src/get.js index d489bd3f1..a6c3f9302 100644 --- a/src/get.js +++ b/src/get.js @@ -76,7 +76,15 @@ export async function get({ cache = true, ffmpeg = false, }) { - await get_nwjs(version, flavor, platform, arch, downloadUrl, cacheDir, cache); + await get_nwjs({ + version, + flavor, + platform, + arch, + downloadUrl, + cacheDir, + cache, + }); if (ffmpeg === true) { await get_ffmpeg({ version, From ef4e9a6a4fb77c8632bae4f90350e045648e51e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 04:30:11 +0000 Subject: [PATCH 18/22] chore(deps): bump the gha group in /.github/workflows with 2 updates (#954) --- .github/workflows/doc.yml | 2 +- .github/workflows/e2e.yml | 2 +- .github/workflows/npm.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 713f60f2c..18ad47535 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -8,7 +8,7 @@ jobs: doc: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3.6.0 + - uses: actions/checkout@v4.1.0 - uses: actions/setup-node@v3.8.1 with: node-version: "20.5.1" diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f3d32abed..a23d37b7e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -22,7 +22,7 @@ jobs: with: brew: unzip - name: Checkout repository - uses: actions/checkout@v3.6.0 + uses: actions/checkout@v4.1.0 - name: Setup Node uses: actions/setup-node@v3.8.1 with: diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index f424dea8f..65c189412 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -8,12 +8,12 @@ jobs: npm: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3.6.0 + - uses: actions/checkout@v4.1.0 - uses: actions/setup-node@v3.8.1 with: node-version: "20.5.1" - run: npm ci - - uses: JS-DevTools/npm-publish@v2.2.1 + - uses: JS-DevTools/npm-publish@v2.2.2 with: token: ${{ secrets.NPM_TOKEN }} From 3b3ac2743e9f47df02fb5f69cbacb30819839c96 Mon Sep 17 00:00:00 2001 From: Eduardo Pinho Date: Tue, 3 Oct 2023 21:12:55 +0100 Subject: [PATCH 19/22] fix(types): align type definitions with docs (#956) --- src/index.d.ts | 194 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 173 insertions(+), 21 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 303992f31..98753263a 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,23 +1,175 @@ -type Options = { - srcDir: string, - mode: "get" | "run" | "build", - version: string | "latest" | "stable", - flavor: "normal" | "sdk", - platform: "linux" | "osx" | "win", - arch: "ia32" | "x64" | "arm64", - outDir: string, - cacheDir: string, - downloadUrl: string, - manifestUrl: string, - app: object, - cache: boolean, - zip: boolean | "zip", - cli: boolean, - ffmpeg: boolean, - glob: boolean, - logLevel: "error" | "warn" | "info" | "debug" -}; - -declare function nwbuild(options: Options): Promise; + +/** NW supported platform */ +export type SupportedPlatform = "linux" | "osx" | "win"; + +/** Configuration options + */ +export interface Options

{ + /** String of space separated glob patterns which correspond to NW app code */ + srcDir?: "./" | string, + /** Run or build application */ + mode?: "build" | "get" | "run", + /** NW runtime version */ + version?: "latest" | "stable" | string, + /** NW runtime flavor */ + flavor?: "normal" | "sdk", + /** NW supported platforms */ + platform?: P, + /** NW supported architectures */ + arch?: "ia32" | "x64" | "arm64", + /** Directory to store build artifacts */ + outDir?: "./out" | string, + /** Directry to store NW binaries */ + cacheDir?: "./cache" | string, + /** URI to download NW binaries from */ + downloadUrl?: "https://dl.nwjs.io" | string, + /** URI to download manifest */ + manifestUrl?: "https://nwjs.io/versions" | string, + /** Refer to Linux/Windows/Osx specific options */ + app: AppOptions

, + /** If true the existing cache is used. Otherwise it removes and redownloads it. */ + cache?: boolean, + /** If true, "zip", "tar" or "tgz" the outDir directory is compressed. */ + zip?: boolean | "zip" | "tar" | "tgz", + /** If true the CLI is used to glob srcDir and parse other options */ + cli?: boolean, + /** If true the chromium ffmpeg is replaced by community version */ + ffmpeg?: boolean, + /** If true globbing is enabled */ + glob?: boolean, + /** Specified log level. */ + logLevel?: "error" | "warn" | "info" | "debug", +} + +/** Platform-specific application options */ +export type AppOptions

= + P extends 'win' ? WindowsAppOptions : + P extends 'osx' ? OsxAppOptions : + P extends 'linux' ? LinuxAppOptions + : (WindowsAppOptions | OsxAppOptions | LinuxAppOptions); + +/** Windows configuration options + * + * References: + * - https://learn.microsoft.com/en-us/windows/win32/msi/version + * - https://learn.microsoft.com/en-gb/windows/win32/sbscs/application-manifests + * - https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/deployment/trustinfo-element-clickonce-application?view=vs-2015#requestedexecutionlevel + * - https://learn.microsoft.com/en-gb/windows/win32/menurc/versioninfo-resource + */ +export interface WindowsAppOptions { + /** The name of the application */ + name?: string, + /** The version of the application */ + version?: string, + /** Additional information that should be displayed for diagnostic purposes. */ + comments?: string, + /** Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. */ + company: string, + /** File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required. */ + fileDescription: string, + /** Version number of the file. For example, 3.10 or 5.00.RC2. This string is required. */ + fileVersion: string, + /** The path to the icon file. It should be a .ico file. */ + icon?: string, + /** Internal name of the file, if one exists—for example, a module name if the file is a dynamic-link library. If the file has no internal name, this string should be the original filename, without extension. This string is required. */ + internalName: string, + /** Copyright notices that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, and so on. This string is optional. */ + legalCopyright?: string, + /** Trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. This string is optional. */ + legalTrademark?: string, + /** Original name of the file, not including a path. This information enables an application to determine whether a file has been renamed by a user. The format of the name depends on the file system for which the file was created. This string is required. */ + originalFilename: string, + /** Information about a private version of the file—for example, Built by TESTER1 on \\TESTBED. This string should be present only if VS_FF_PRIVATEBUILD is specified in the fileflags parameter of the root block. */ + privateBuild?: string, + /** Name of the product with which the file is distributed. This string is required. */ + productName: string, + /** Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2. This string is required. */ + productVersion: string, + /** Text that specifies how this version of the file differs from the standard version—for example, Private build for TESTER1 solving mouse problems on M250 and M250E computers. This string should be present only if VS_FF_SPECIALBUILD is specified in the fileflags parameter of the root block. */ + specialBuild?: string, +} + +/** Linux configuration options + * + * References: + * https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html + */ +export interface LinuxAppOptions { + /** Name of the application */ + name?: string, + /** Generic name of the application */ + genericName?: string, + /** If true the application is not displayed */ + noDisplay?: boolean, + /** Tooltip for the entry, for example "View sites on the Internet". */ + comment?: string, + /** Icon to display in file manager, menus, etc. */ + icon?: string, + /** A list of strings identifying the desktop environments that should (/not) display a given desktop entry */ + onlyShowIn?: string[], + /** A list of strings identifying the desktop environments that should (/not) display a given desktop entry */ + notShowIn?: string[], + /** A boolean value specifying if D-Bus activation is supported for this application */ + dBusActivatable?: boolean, + /** Path to an executable file on disk used to determine if the program is actually installed */ + tryExec?: string, + /** Program to execute, possibly with arguments. */ + exec?: string, + /** If entry is of type Application, the working directory to run the program in. */ + path?: string, + /** Whether the program runs in a terminal window. */ + terminal?: boolean, + /** Identifiers for application actions. */ + actions?: string[], + /** The MIME type(s) supported by this application. */ + mimeType?: string[], + /** Categories in which the entry should be shown in a menu */ + categories?: string[], + /** A list of interfaces that this application implements. */ + implements?: string[], + /** A list of strings which may be used in addition to other metadata to describe this entry. */ + keywords?: string[], + /** If true, it is KNOWN that the application will send a "remove" message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all. */ + startupNotify?: boolean, + /** If specified, it is known that the application will map at least one window with the given string as its WM class or WM name hin */ + startupWMClass?: string, + /** If true, the application prefers to be run on a more powerful discrete GPU if available. */ + prefersNonDefaultGPU?: boolean, + /** If true, the application has a single main window, and does not support having an additional one opened. */ + singleMainWindow?: string, +} + +/** OSX resource configuration options + * + * References: + * https://developer.apple.com/documentation/bundleresources/information_property_list + */ +export interface OsxAppOptions { + /** The name of the application */ + name?: string, + /** The path to the icon file. It should be a .icns file. */ + icon?: string, + /** The category that best describes your app for the App Store. */ + LSApplicationCategoryType?: string, + /** A unique identifier for a bundle usually in reverse DNS format. */ + CFBundleIdentifier?: string, + /** A user-visible short name for the bundle. */ + CFBundleName?: string, + /** The user-visible name for the bundle. */ + CFBundleDisplayName?: string, + /** A replacement for the app name in text-to-speech operations. */ + CFBundleSpokenName?: string, + /** The version of the build that identifies an iteration of the bundle. */ + CFBundleVersion?: string, + /** The release or version number of the bundle. */ + CFBundleShortVersionString?: string, + /** A human-readable copyright notice for the bundle. */ + NSHumanReadableCopyright?: string, +} + +/** + * Automates building an NW.js application. + */ +declare function nwbuild

(options: Options

): Promise; export default nwbuild; From 3e367f383d439b850500bdffae641f83032014e8 Mon Sep 17 00:00:00 2001 From: Ayush C <14110965+ayushmanchhabra@users.noreply.github.com> Date: Tue, 3 Oct 2023 18:12:43 -0400 Subject: [PATCH 20/22] build(jsdoc): autogenerate docs via JSDoc comments (#957) Co-authored-by: The Jared Wilcurt --- .eslintignore | 6 - {cfg => .github}/eslint.config.cjs | 1 + {cfg => .github}/fswatch.config.js | 2 +- {cfg => .github}/jsdoc.config.cjs | 94 ++++++------- .github/workflows/doc.yml | 2 +- .github/workflows/npm.yml | 2 +- .gitignore | 3 +- changelog.md => CHANGELOG.md | 2 + LICENSE | 3 +- README.md | 207 ++++++++++++++++++++++++++++- doc/.vitepress/config.js | 3 +- doc/contributing.md | 23 ---- doc/index.md | 12 -- doc/install.md | 15 --- doc/migrate-v3-v4.md | 207 ----------------------------- doc/usage-basic.md | 49 ------- package-lock.json | 10 +- package.json | 18 +-- src/index.js | 39 +++++- 19 files changed, 313 insertions(+), 385 deletions(-) delete mode 100644 .eslintignore rename {cfg => .github}/eslint.config.cjs (84%) rename {cfg => .github}/fswatch.config.js (86%) rename {cfg => .github}/jsdoc.config.cjs (90%) rename changelog.md => CHANGELOG.md (99%) delete mode 100644 doc/contributing.md delete mode 100644 doc/index.md delete mode 100644 doc/install.md delete mode 100644 doc/migrate-v3-v4.md delete mode 100644 doc/usage-basic.md diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index fc7ddb933..000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules - -cache -build -dist -out diff --git a/cfg/eslint.config.cjs b/.github/eslint.config.cjs similarity index 84% rename from cfg/eslint.config.cjs rename to .github/eslint.config.cjs index cca321a5c..d8c0d3fd6 100644 --- a/cfg/eslint.config.cjs +++ b/.github/eslint.config.cjs @@ -8,6 +8,7 @@ module.exports = { node: true, }, extends: ["eslint:recommended", "tjw-jsdoc"], + ignorePatterns: ["node_modules", "build", "cache", "dist", "out"], rules: { "jsdoc/require-file-overview": "off", "jsdoc/require-returns-description": "off", diff --git a/cfg/fswatch.config.js b/.github/fswatch.config.js similarity index 86% rename from cfg/fswatch.config.js rename to .github/fswatch.config.js index 38dd0028d..7b61df0e5 100644 --- a/cfg/fswatch.config.js +++ b/.github/fswatch.config.js @@ -8,7 +8,7 @@ try { for await (const event of watcher) { if (event) { - exec("node cfg/jsdoc.config.cjs"); + exec("node .github/jsdoc.config.cjs"); } } } catch (e) { diff --git a/cfg/jsdoc.config.cjs b/.github/jsdoc.config.cjs similarity index 90% rename from cfg/jsdoc.config.cjs rename to .github/jsdoc.config.cjs index 27265b65c..f71779d4b 100644 --- a/cfg/jsdoc.config.cjs +++ b/.github/jsdoc.config.cjs @@ -1,47 +1,47 @@ -const { writeFile } = require("node:fs/promises"); - -const jsdoc2md = require("jsdoc-to-markdown"); - -jsdoc2md - .render({ - files: "src/build.js", - }) - .then(async (output) => { - await writeFile("doc/mode-build.md", output); - }) - .catch((error) => { - console.log(error); - }); - -jsdoc2md - .render({ - files: "src/get.js", - }) - .then(async (output) => { - await writeFile("doc/mode-get.md", output); - }) - .catch((error) => { - console.log(error); - }); - -jsdoc2md - .render({ - files: "src/run.js", - }) - .then(async (output) => { - await writeFile("doc/mode-run.md", output); - }) - .catch((error) => { - console.log(error); - }); - -jsdoc2md - .render({ - files: "src/index.js", - }) - .then(async (output) => { - await writeFile("doc/api.md", output); - }) - .catch((error) => { - console.log(error); - }); +const { writeFile } = require("node:fs/promises"); + +const jsdoc2md = require("jsdoc-to-markdown"); + +jsdoc2md + .render({ + files: "src/index.js", + }) + .then(async (output) => { + await writeFile("doc/index.md", output); + }) + .catch((error) => { + console.log(error); + }); + +jsdoc2md + .render({ + files: "src/build.js", + }) + .then(async (output) => { + await writeFile("doc/mode-build.md", output); + }) + .catch((error) => { + console.log(error); + }); + +jsdoc2md + .render({ + files: "src/get.js", + }) + .then(async (output) => { + await writeFile("doc/mode-get.md", output); + }) + .catch((error) => { + console.log(error); + }); + +jsdoc2md + .render({ + files: "src/run.js", + }) + .then(async (output) => { + await writeFile("doc/mode-run.md", output); + }) + .catch((error) => { + console.log(error); + }); diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 18ad47535..1e679db12 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4.1.0 - uses: actions/setup-node@v3.8.1 with: - node-version: "20.5.1" + node-version: 18 - name: Install Node modules run: npm ci - name: Convert JSDoc to Markdown diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 65c189412..d7b266ffc 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4.1.0 - uses: actions/setup-node@v3.8.1 with: - node-version: "20.5.1" + node-version: 18 - run: npm ci - uses: JS-DevTools/npm-publish@v2.2.2 diff --git a/.gitignore b/.gitignore index 09d7b6a6a..d8c7f7711 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,5 @@ coverage cache build dist -doc/api*.md -doc/mode-*.md +doc/*.md out diff --git a/changelog.md b/CHANGELOG.md similarity index 99% rename from changelog.md rename to CHANGELOG.md index 921a76a9f..b5de8be5f 100644 --- a/changelog.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed +- Auto generate docs from JSDoc comments. +- Improve TypeScript type definitions. - Fix get mode. - Refactor build mode. - Generate markdown docs from JSDocs. diff --git a/LICENSE b/LICENSE index b0739d6b1..7e8f3af1e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ The MIT License (MIT) -Copyright (c) 2014 Steffen Müller +Copyright (c) 2021-2023 NW.js Utilities +Copyright (c) 2014-2021 Steffen Müller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index 7656ece58..dd361566e 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ For version 3, please go to the [corresponding branch](https://github.com/nwutil ## Major Features -- Build for Linux, MacOS, and Windows -- Support downloading [from](https://npm.taobao.org/mirrors/nwjs) [mirrors](https://npmmirror.com/mirrors/nwjs) -- Integrate [`nwjs-ffmpeg-prebuilt`](https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt) +- Get, run or build applications. +- Integrate [FFmpeg community builds](https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt) - Configure executable fields and icons +- Support downloading from mirrors Check out the [documentation](https://nwutils.io/nw-builder/) if you wish to give `nw-builder` a try. @@ -22,3 +22,204 @@ Check out the [documentation](https://nwutils.io/nw-builder/) if you wish to giv - [nw-builder-platforms](https://github.com/naviapps/nw-builder-platforms) - Fork of this repo with platform specific build options - [nwjs-builder-phoenix](https://github.com/evshiron/nwjs-builder-phoenix) - Previously the most used build tool, however it is no longer maintained + +## Migration Guide (v3 -> v4) + +> We are working on making the migration process smoother. If you encounter any issues with the current guide, please open an issue or start a discussion. + +### Update `nw-builder` + +With npm: + +```shell +npm update nw-builder@latest +``` + +With yarn: + +```shell +yarn upgrade nw-builder@latest +``` + +With pnpm: + +```shell +pnpm update nw-builder@latest +``` + +### Update options + +Let's take an example of v3 code and migrate it to v4. + +```javascript +const NwBuilder = require("nw-builder"); + +const nw = new NwBuilder({ + files: ["./nwapp/**/*", "./other/**/*.js"], + version: "latest", + flavor: "normal", + platforms: ["win32", "win64", "osx32", "osx64", "linux32", "linux64"], + cacheDir: "./cache", + buildDir: "./build", + buildType: "versioned", + forceDownload: true, + appName: "nwdemo", + appVersion: "0.1.0", + argv: "--nw-stderr-logging", + macCredits: "./nwapp/credits.html", + macIcns: "./nwapp/mac.icns", + macPlist: { ... }, + winVersionString: { ... }, + winIco: "./nwapp/win.ico", + zip: true, + macZip: false, + mergeZip: false, +}); + +nw.build(); +``` + +Update the import path + +```diff +-const NwBuilder = require("nw-builder"); ++const nwbuild = require("nw-builder"); +``` + +Replace the `NwBuilder` initialization with a function + +```diff +-const nw = new NwBuilder({ ++await nwbuild({ +``` + +The `files` property has been renamed to `srcDir`. + +```diff +- files: ["./nwapp/**/*", "./other/**/*.js"], ++ srcDir: "./nwapp/**/* ./other/**/*.js", +``` + +Add the `mode` option and remove the now redundant `nw.build` function call. The `build` call is made by `nwbuild` internally. + +```diff ++ mode: "build", + +-nw.build(); +``` + +The `platforms` option has been removed and replaced with `platform` and `arch`. Notice that one `nwbuild` function call now creates one build for one platform and one arch only. + +```diff +- platforms: ["win32", "win64", "osx32", "osx64", "linux32", "linux64"], ++ platform: "linux", // "osx" for MacOS "win", for Windows ++ arch: "x64", // "ia32" for 32 bit or "arm64" for arm based 65 bit architectures +``` + +The `buildDir` option has been rename to `outDir`. + +```diff +- buildDir: "./build", ++ outDir: "./build", +``` + +The `buildType` option has been removed. + +```diff +- buildType: "versioned", +``` + +The `forceDownload` option has been changed to `cache`. + +```diff +- forceDownload: true, ++ cache: false, +``` + +The `appName` option has been changed to `app.name`. + +```diff +- appName: "nwdemo", ++ app: { name: "nwdemo" }, +``` + +The `appVersion` option has been changed to `app.version`. + +```diff +- appVersion: "0.1.0", ++ app: { version: "0.1.0" }, +``` + +The `macCredit` option has been removed. + +```diff +- macCredits: "./nwapp/credits.html", +``` + +The `macIcns` option has been replaced with `icon`. + +```diff +- macIcns: "./nwapp/mac.icns", ++ icon: "./nwapp/mac.icns", +``` + +The `macPlist` option has been replaced by `app.*` options. Consult the [documentation](https://nwutils.io/nw-builder/mode-build.html#osxrc-object) for valid properties. + +```diff +- macPlist: { ... }, ++ app: { ... }, +``` + +The `winVersionString` option has been replaced with `app`. Consult the [documentation](https://nwutils.io/nw-builder/mode-build.html#winrc-object) for valid properties. + +```diff +- winVersionString: { +- 'CompanyName': 'Some Company', +- 'FileDescription': 'Process Name', +- 'ProductName': 'Some Product', +- 'LegalCopyright': 'Copyright 2017', +- } ++ app: { ++ company: "Some Company", ++ fileDescription: "Process Name", ++ productName: "Some Product", ++ legalCopyright: "Copyright (c) 2023", ++ } +``` + +The `winIco` option has been replaced by `app.icon`. + +```diff +- winIco: "./nwapp/win.ico", ++ app: { icon: "./nwapp/win.ico" }, +``` + +The `macZip` option has been removed. + +```diff +- macZip: false, +``` + +The `mergeZip` option has been removed. + +```diff +- mergeZip: false, +``` + +The final code should look like this. + +```javascript +const { nwbuild } = require("nw-builder"); + +await nwbuild({ + srcDir: "./nwapp/**/* ./other/**/*.js", + mode: "build", + version: "latest", + flavor: "normal", + platform: "linux", + arch: "x64", + outDir: "./build", + cache: false, + app: { ... }, +}); +``` diff --git a/doc/.vitepress/config.js b/doc/.vitepress/config.js index c1312df47..4fd6722b1 100644 --- a/doc/.vitepress/config.js +++ b/doc/.vitepress/config.js @@ -28,8 +28,7 @@ export default defineConfig({ text: "Getting Started", collapsible: true, items: [ - { text: "Installation Guide", link: "/install" }, - { text: "Basic Usage", link: "/usage-basic" }, + { text: "Intro", link: "/index" }, { text: "Get mode", link: "/mode-get" }, { text: "Run mode", link: "/mode-run" }, { text: "Build mode", link: "/mode-build" }, diff --git a/doc/contributing.md b/doc/contributing.md deleted file mode 100644 index 85edcaa1b..000000000 --- a/doc/contributing.md +++ /dev/null @@ -1,23 +0,0 @@ -# Contributing Guide - -Thank you for considering to contribute! - -## Prerequisites - -Install a [Node Version Manager](https://nodejs.org/en/download/package-manager). - -Install Node. Consult the [version manifest](https://nwjs.io/versions) before installing. `nw-builder` matches the Node version included in NW.js's latest release. For example, if 0.77.0 is the latest version, the Node version is 20.2.0. - -[Fork](https://github.com/nwutils/nw-builder/fork) the repo. - -Clone the fork. - -Create a new branch. If you are addressing a specific issue (for example #54), then name the branch `dev-54`. If you encounter a problem which has not been documented (even after searching all closed issues), either open a new issue or create a branch such as `fix/glob-nested-dirs`. - -## General Tips - -Add inline code comments if the change you make may not be obvious to others. Add tests that cover the behaviour change. We use Node's test runner for unit tests and Chromedriver for e2e tests. - -Our test coverage is not great. Do not assume the package works even if all tests pass. Dependency updates are handled by `dependabot` unless your code change requires a version bump. If certain behaviour can be implemented using Node's standard library, that is always preferred over a third party library. - -If you're unsure about any of the above, make the pull request anyway. A maintainer/community member will help you out. diff --git a/doc/index.md b/doc/index.md deleted file mode 100644 index 6d2130458..000000000 --- a/doc/index.md +++ /dev/null @@ -1,12 +0,0 @@ -# nw-builder - -Build for Linux, MacOS, and Windows platforms. - -## Major Features - -- Get, run or build applications. -- Integrate [`nwjs-ffmpeg-prebuilt`](https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt) -- Configure executable fields and icons -- Support downloading from mirrors - -Consult the Installation Guide if you want to give `nw-builder` a try. diff --git a/doc/install.md b/doc/install.md deleted file mode 100644 index 2c9b51398..000000000 --- a/doc/install.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation Guide - -Every NW.js release includes a modified Node.js at a specific version. It is recommended to [install](https://nodejs.org/en/download/package-manager) a version greater than or equal to NW.js's Node version. Consult the [version manifest](https://nwjs.io/versions) on the version to install. - -With the environment set up, install `nw-builder` using npm: - -Using npm: - -```shell -npm i -D nw-builder -``` - -> Note: We install as a development dependency to prevent it from being packaged with your application code. - -You may use alternate package managers. The recommended metohd is via [corepack](https://nodejs.org/api/corepack.html). diff --git a/doc/migrate-v3-v4.md b/doc/migrate-v3-v4.md deleted file mode 100644 index 89af030c5..000000000 --- a/doc/migrate-v3-v4.md +++ /dev/null @@ -1,207 +0,0 @@ -# Migrate from v3 to v4 - -> We are working on making the migration process smoother. If you encounter any issues with the current guide, please open an issue or start a discussion. - -## Update `nw-builder` - -With npm: - -```shell -npm update nw-builder@^4.2.3 -``` - -With yarn: - -```shell -yarn upgrade nw-builder@^4.2.3 -``` - -With pnpm: - -```shell -pnpm update nw-builder@^4.2.3 -``` - -## Update options - -Let's take an example of v3 code and migrate it to v4. - -```javascript -const NwBuilder = require("nw-builder"); - -const nw = new NwBuilder({ - files: ["./nwapp/**/*", "./other/**/*.js"], - version: "latest", - flavor: "normal", - platforms: ["win32", "win64", "osx32", "osx64", "linux32", "linux64"], - cacheDir: "./cache", - buildDir: "./build", - buildType: "versioned", - forceDownload: true, - appName: "nwdemo", - appVersion: "0.1.0", - argv: "--nw-stderr-logging", - macCredits: "./nwapp/credits.html", - macIcns: "./nwapp/mac.icns", - macPlist: { ... }, - winVersionString: { ... }, - winIco: "./nwapp/win.ico", - zip: true, - macZip: false, - mergeZip: false, -}); - -nw.build(); -``` - -Update the import path - -```diff --const NwBuilder = require("nw-builder"); -+const nwbuild = require("nw-builder"); -``` - -Replace the `NwBuilder` initialization with a function - -```diff --const nw = new NwBuilder({ -+await nwbuild({ -``` - -The `files` property has been renamed to `srcDir`.S - -```diff -- files: ["./nwapp/**/*", "./other/**/*.js"], -+ srcDir: "./nwapp/**/* ./other/**/*.js", -``` - -Add the `mode` option and remove the now redundant `nw.build` function call. - -```diff -+ mode: "build", - --nw.build(); -``` - -The `platforms` option has been removed and replaced with `platform` and `arch`. Notice that one `nwbuild` function call now creates one build only. Refer to the [documentation](./index.md) for valid `platform` and `arch` values. - -```diff -- platforms: ["win32", "win64", "osx32", "osx64", "linux32", "linux64"], -+ platform: "linux", -+ arch: "x64", -``` - -> If platform is Linux then even if Windows or MacOS specific `app.*` properties are defined, only the Linux `app.*` properties will be parsed. Multiple platform `app.*` properties have been shown in this guide to cater to all platforms. - -The `buildDir` option has been rename to `outDir`. - -```diff -- buildDir: "./build", -+ outDir: "./build", -``` - -The `buildType` option has been removed. - -```diff -- buildType: "versioned", -``` - -The `forceDownload` option has been changed to `cache`. - -```diff -- forceDownload: true, -+ cache: false, -``` - -The `appName` option has been changed to `app.name`. - -```diff -- appName: "nwdemo", -+ app: { name: "nwdemo" }, -``` - -The `appVersion` option has been removed. The `version` is automatically taken from `srcDir/package.json`. - -```diff -- appVersion: "0.1.0", -``` - -The `macCredit` option has been removed. - -```diff -- macCredits: "./nwapp/credits.html", -``` - -The `macIcns` option has been replaced with `icon`. - -```diff -- macIcns: "./nwapp/mac.icns", -+ icon: "./nwapp/mac.icns", -``` - -The `macPlist` option has been removed. - -```diff -- macPlist: { ... }, -``` - -The `winVersionString` option has been replaced with `app`. - -```diff -- winVersionString: { -- 'CompanyName': 'Some Company', -- 'FileDescription': 'Process Name', -- 'ProductName': 'Some Product', -- 'LegalCopyright': 'Copyright 2017', -- } -+ app: { -+ company: "Some Company", -+ fileDescription: "Process Name", -+ productName: "Some Product", -+ legalCopyright: "Copyright 2017", -+ } -``` - -The `winIco` option has been replaced by `app.icon`. - -```diff -- winIco: "./nwapp/win.ico", -+ app: { icon: "./nwapp/win.ico" }, -``` - -The `macZip` option has been removed. - -```diff -- macZip: false, -``` - -The `mergeZip` option has been removed. - -```diff -- mergeZip: false, -``` - -The final code should look like this. - -```javascript -const { nwbuild } = require("nw-builder"); - -await nwbuild({ - srcDir: "./nwapp/**/*", - mode: "build", - version: "latest", - flavor: "normal", - platform: "linux", - arch: "x64", - outDir: "./build", - cache: false, - app: { - name: "Some Product", - icon: "./nwapp/icon.png", - company: "Some Company", - fileDescription: "Process Name", - productName: "Some Product", - legalCopyright: "Copyright 2017", - }, -}); -``` diff --git a/doc/usage-basic.md b/doc/usage-basic.md deleted file mode 100644 index 9f954a751..000000000 --- a/doc/usage-basic.md +++ /dev/null @@ -1,49 +0,0 @@ -# Basic Usage - -Depending on your use case, `nw-builder` can be used via a JavaScript module, command line interface or `package.json`. Please note that if `package.json` is used, it will override the module or CLI configuration. - -## Import package - -ESM usage: - -```javascript -import nwbuild from "nw-builder"; -``` - -CJS usage: - -```javascript -let nwbuild = undefined; - -(() => { - try { - nwbuild = await import("nw-builder"); - } catch(error) { - console.error(error); - } -})(); -``` - -## Execute function - -Module usage: - -```javascript -nwbuild(); -``` - -CLI usage: - -```shell -npx nwbuild -``` - -`package.json` usage: - -```json -{ - "nwbuild": {} -} -``` - -By default, it performs a build using the latest version for the host platform and architecture. The next few guides will show you how to customize this behaviour. diff --git a/package-lock.json b/package-lock.json index 500df8e26..98fbb57f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,20 +14,20 @@ "glob": "^10.3.10", "plist": "^3.1.0", "rcedit": "^4.0.0", - "winston": "^3.9.0", + "winston": "^3.10.0", "yargs": "^17.7.2" }, "bin": { "nwbuild": "src/cli.js" }, "devDependencies": { - "concurrently": "^8.2.0", - "eslint": "^8.45.0", - "eslint-config-tjw-jsdoc": "^1.0.3", + "concurrently": "^8.2.1", + "eslint": "^8.50.0", + "eslint-config-tjw-jsdoc": "^1.0.4", "gh-pages": "^6.0.0", "jsdoc": "^4.0.2", "jsdoc-to-markdown": "^8.0.0", - "prettier": "^3.0.1", + "prettier": "^3.0.3", "selenium-webdriver": "^4.13.0", "vitepress": "^1.0.0-rc.20" }, diff --git a/package.json b/package.json index fdbf525d3..74d7c3040 100644 --- a/package.json +++ b/package.json @@ -41,24 +41,24 @@ }, "scripts": { "ci:fmt": "prettier --check \"./**/*.{css,html,js,json,md,yml}\"", - "ci:lnt": "eslint --config=cfg/eslint.config.cjs cfg src test", + "ci:lnt": "eslint --config=.github/eslint.config.cjs .github src test", "fmt": "prettier --write \"./**/*.{css,html,js,json,md,yml}\"", - "lnt": "eslint --config=cfg/eslint.config.cjs --fix cfg src test", - "doc:dev": "concurrently --kill-others \"node cfg/fswatch.config.js\" \"vitepress dev doc\"", - "doc:bld": "node cfg/jsdoc.config.cjs && vitepress build doc", + "lnt": "eslint --config=.github/eslint.config.cjs --fix src test", + "doc:dev": "concurrently --kill-others \"node .github/fswatch.config.js\" \"vitepress dev doc\"", + "doc:bld": "node .github/jsdoc.config.cjs && vitepress build doc", "test:unit": "node --test test/unit/index.js", "test:e2e": "node --test test/e2e/index.js", "test:mod": "npm link nw-builder && cd test/fixture && node demo.js", "test:cli": "npm link nw-builder && cd test/fixture && nwbuild --platform win --arch x64 --outDir out --no-glob app" }, "devDependencies": { - "concurrently": "^8.2.0", - "eslint": "^8.45.0", - "eslint-config-tjw-jsdoc": "^1.0.3", + "concurrently": "^8.2.1", + "eslint": "^8.50.0", + "eslint-config-tjw-jsdoc": "^1.0.4", "gh-pages": "^6.0.0", "jsdoc": "^4.0.2", "jsdoc-to-markdown": "^8.0.0", - "prettier": "^3.0.1", + "prettier": "^3.0.3", "selenium-webdriver": "^4.13.0", "vitepress": "^1.0.0-rc.20" }, @@ -68,7 +68,7 @@ "glob": "^10.3.10", "plist": "^3.1.0", "rcedit": "^4.0.0", - "winston": "^3.9.0", + "winston": "^3.10.0", "yargs": "^17.7.2" }, "packageManager": "npm@9.8.1", diff --git a/src/index.js b/src/index.js index 149bc8c4a..182fec031 100644 --- a/src/index.js +++ b/src/index.js @@ -36,7 +36,44 @@ import { getReleaseInfo } from "./util.js"; */ /** - * Automates building an NW.js application. + * Installation Guide + * + * Every NW.js release includes a modified Node.js binary at a specific version. It is recommended to [install](https://nodejs.org/en/download/package-manager) exactly that version on the host system. Not doing so may download ABI incompatible Node modules. Consult the NW.js [versions manifest](https://nwjs.io/versions) for what Node.js version to install. It is recommended to use a Node version manager (such as [volta](https://volta.sh), n, nvm, or nvm-windows) to be able to easily install and switch between Node versions. + * + * Please refer to the examples below for basic usage. + * + * @example + * // ESM usage: + * + * import nwbuild from "nw-builder"; + * + * @example + * // CJS usage + * + * let nwbuild = undefined; + * + * (() => { + * try { + * nwbuild = await import("nw-builder"); + * } catch(error) { + * console.error(error); + * } + * })(); + * + * @example + * // Module usage + * + * nwbuild(); + * + * @example + * // CLI usage + * + * npx nwbuild + * + * @example + * // Node manifest usage + * + * "nwbuild": {} * * @param {Options} options Options * @return {Promise} From 58369e3c1bf04f57531f27374c35edf3dd8bf3d7 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Tue, 3 Oct 2023 18:15:23 -0400 Subject: [PATCH 21/22] ci: fix doc gen command --- .github/workflows/doc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 1e679db12..0446e26fb 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -15,7 +15,7 @@ jobs: - name: Install Node modules run: npm ci - name: Convert JSDoc to Markdown - run: node cfg/jsdoc.config.cjs + run: node .github/jsdoc.config.cjs - name: Build documentation run: npm run doc:bld - name: Publish documentation to GitHub Pages From 78903c412bb64fcf750576d0f572a6873c842227 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 23:12:12 +0000 Subject: [PATCH 22/22] chore(deps-dev): bump postcss from 8.4.30 to 8.4.31 (#958) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 98fbb57f1..bc40208f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3682,9 +3682,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ {