From 2f7f708306db6dd0628c3482f90d3ba0875b3952 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:18:18 -0400 Subject: [PATCH 01/17] build(node): add `end `engines.node` property --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e74da486..193d91fb6 100644 --- a/package.json +++ b/package.json @@ -71,5 +71,8 @@ "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 || >= 20.7.0" + } } From a82b628e4f0584e7c7e4b08f2a20a14cd22449e2 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:52:09 -0400 Subject: [PATCH 02/17] refactor: build mode --- package-lock.json | 458 +++++++++++++++++++++++++------------------- package.json | 2 +- src/bld/build.js | 85 -------- src/bld/linuxCfg.js | 85 -------- src/bld/osxCfg.js | 94 --------- src/bld/winCfg.js | 81 -------- src/build.js | 290 ++++++++++++++++++++++++++++ 7 files changed, 547 insertions(+), 548 deletions(-) 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/package-lock.json b/package-lock.json index 69c6a200f..5bd417264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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/package.json b/package.json index 193d91fb6..cf2b5d76a 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,6 @@ }, "packageManager": "npm@9.8.1", "engines": { - "node": ">= v16.20.1 || >= v18.18.0 || >= 20.7.0" + "node": ">= v16.20.1 || >= v18.18.0 || >= v20.7.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..c83584795 --- /dev/null +++ b/src/build.js @@ -0,0 +1,290 @@ +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 { 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 + * + * @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 }); + } +}; From 2dcf9ea3020b2f0d45dd933c34f59e6ddee24ec1 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:55:35 -0400 Subject: [PATCH 03/17] fix: formatting and linting errors --- src/build.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/build.js b/src/build.js index c83584795..322bf2c7e 100644 --- a/src/build.js +++ b/src/build.js @@ -1,15 +1,24 @@ import { resolve } from "node:path"; import { platform as PLATFORM } from "node:process"; -import { cp, copyFile, rename, readFile, rm, writeFile } from "node:fs/promises"; +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 @@ -38,7 +47,7 @@ import { log } from "./log.js"; /** * 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. @@ -58,8 +67,8 @@ import { log } from "./log.js"; * 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 + * + * @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. @@ -240,7 +249,10 @@ export async function build(files, nwDir, outDir, platform, zip, app) { "en.lproj", "InfoPlist.strings", ); - const infoPlistStringsData = await readFile(infoPlistStringsPath, "utf-8"); + const infoPlistStringsData = await readFile( + infoPlistStringsPath, + "utf-8", + ); let infoPlistStringsDataArray = infoPlistStringsData.split("\n"); @@ -287,4 +299,4 @@ export async function build(files, nwDir, outDir, platform, zip, app) { await rm(outDir, { recursive: true, force: true }); } -}; +} From d3c5c823c69b198d6cb72551c256ba2fbfefe09f Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:03:13 -0400 Subject: [PATCH 04/17] docs(install): link to corepack docs --- doc/install.md | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) 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). From f19864686dec62543b96652462a447c6f268b30e Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:05:36 -0400 Subject: [PATCH 05/17] docs(migration): add note about incorrectness --- doc/migrate-v3-v4.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/migrate-v3-v4.md b/doc/migrate-v3-v4.md index 730a4c91e..db4e36e0a 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 discussion. + ## Update `nw-builder` With npm: From 3a41a5e7737c2569f6e2990443d13082ca683120 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:27:01 -0400 Subject: [PATCH 06/17] refactor: move `get_nwjs` and `get_ffmpeg` into one file --- src/{get_nwjs.js => get.js} | 170 +++++++++++++++++++++++++++++++++++- src/get_ffmpeg.js | 137 ----------------------------- src/index.js | 20 +---- 3 files changed, 170 insertions(+), 157 deletions(-) rename src/{get_nwjs.js => get.js} (51%) delete mode 100644 src/get_ffmpeg.js diff --git a/src/get_nwjs.js b/src/get.js similarity index 51% rename from src/get_nwjs.js rename to src/get.js index 0fc154347..5ea57b0e2 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,7 +10,7 @@ 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._ @@ -46,6 +47,14 @@ 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". @@ -54,9 +63,47 @@ 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, ffmpeg is not downloaded. Defaults to false. * @return {Promise} */ -export async function get_nwjs({ +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, + }); + } +} + +/** + * 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". + * @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. + * @return {Promise} + */ +async function get_nwjs({ version = "latest", flavor = "normal", platform = PLATFORM_KV[PLATFORM], @@ -144,7 +191,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 +229,118 @@ export async function get_nwjs({ }); } } + +/** + * 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..fb4b9f4eb 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"; @@ -110,7 +109,7 @@ const nwbuild = async (options) => { ); // Download NW.js binaries - await get_nwjs({ + 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; } From 5a380797da6d326d4fb73e48bb1d7e6fe3446c9c Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:32:26 -0400 Subject: [PATCH 07/17] fix(docs): update jsdoc for get mode --- cfg/jsdoc.config.cjs | 15 ++------------- doc/.vitepress/config.js | 3 +-- doc/mode-run.md | 28 +++++++++++++--------------- src/get.js | 7 ++++++- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/cfg/jsdoc.config.cjs b/cfg/jsdoc.config.cjs index 8ed31872c..5c6b01002 100644 --- a/cfg/jsdoc.config.cjs +++ b/cfg/jsdoc.config.cjs @@ -4,21 +4,10 @@ const jsdoc2md = require("jsdoc-to-markdown"); jsdoc2md .render({ - files: "src/get_nwjs.js", + files: "src/get.js", }) .then(async (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); + await writeFile("doc/mode-get.md", output); }) .catch((error) => { console.log(error); diff --git a/doc/.vitepress/config.js b/doc/.vitepress/config.js index 17bbef025..3961ae73c 100644 --- a/doc/.vitepress/config.js +++ b/doc/.vitepress/config.js @@ -27,8 +27,7 @@ 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" }, diff --git a/doc/mode-run.md b/doc/mode-run.md index dab151f06..075b3037b 100644 --- a/doc/mode-run.md +++ b/doc/mode-run.md @@ -1,27 +1,25 @@ ## 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. | +**Kind**: global function -**Example** +| 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({ diff --git a/src/get.js b/src/get.js index 5ea57b0e2..f9003d5a6 100644 --- a/src/get.js +++ b/src/get.js @@ -15,7 +15,7 @@ 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) @@ -91,6 +91,8 @@ export async function get({ } /** + * 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 @@ -231,6 +233,9 @@ 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 From c449c54901173b9425fdba5b209e31fda50b2830 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:29:46 -0400 Subject: [PATCH 08/17] docs: generate docs for build mode --- cfg/jsdoc.config.cjs | 11 +++ doc/mode-build.md | 208 ++++++++++++++++++++++++++++++------------- doc/mode-run.md | 28 +++--- src/build.js | 16 ++++ src/get.js | 6 +- 5 files changed, 189 insertions(+), 80 deletions(-) diff --git a/cfg/jsdoc.config.cjs b/cfg/jsdoc.config.cjs index 5c6b01002..563f8676e 100644 --- a/cfg/jsdoc.config.cjs +++ b/cfg/jsdoc.config.cjs @@ -2,6 +2,17 @@ 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", diff --git a/doc/mode-build.md b/doc/mode-build.md index 885815b90..0745e659b 100644 --- a/doc/mode-build.md +++ b/doc/mode-build.md @@ -1,77 +1,157 @@ -# 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. +## Functions + +
+
build(files, nwDir, outDir, platform, zip, app)Promise.<undefined>
+

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. To use rcedit on non-Windows platforms, you will have to install Wine.

+

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:

+

sudo xattr -r -d com.apple.quarantine nwjs.app

+
+
+ +## Typedefs + +
+
LinuxRc : object
+

References: +https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

+
+
OsxRc : object
+

References: +https://developer.apple.com/documentation/bundleresources/information_property_list

+
+
WinRc : object
+

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

+
+
+ + + +## build(files, nwDir, outDir, platform, zip, app) ⇒ Promise.<undefined> + +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. +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. -For example, if we have a project with file structure as below: +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): -`/project`: +`sudo xattr -r -d com.apple.quarantine nwjs.app` -```shell -/web/index.js -/web/package.json # Node manifest -/nw/package.json # NW.js manifest -/package.json # Monorepo Node manifest -``` +**Kind**: global function -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. +| Param | Type | Description | +| -------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------- | +| files | string \| Array.<string> | Array of NW app files | +| nwDir | string | Directory to hold NW binaries | +| outDir | string | Directory to store build artifacts | +| platform | "linux" \| "osx" \| "win" | Platform is the operating system type | +| zip | "zip" \| boolean | Specify if the build artifacts are to be zipped | +| app | [LinuxRc](#LinuxRc) \| [OsxRc](#OsxRc) \| [WinRc](#WinRc) | Multi platform configuration options | -Module usage: +**Example** -```javascript +```js +// Minimal Usage (uses default values) nwbuild({ - srcDir: "nw/package.json web/**/*", + mode: "build", }); ``` -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 -``` + + +## LinuxRc : object + +References: +https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html + +**Kind**: global typedef +**Properties** + +| Name | Type | Description | +| -------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| name | string | Name of the application | +| genericName | string | Generic name of the application | +| noDisplay | boolean | If true the application is not displayed | +| comment | string | Tooltip for the entry, for example "View sites on the Internet". | +| icon | string | Icon to display in file manager, menus, etc. | +| hidden | boolean | TBD | +| onlyShowIn | Array.<string> | A list of strings identifying the desktop environments that should (/not) display a given desktop entry | +| notShowIn | Array.<string> | A list of strings identifying the desktop environments that should (/not) display a given desktop entry | +| dBusActivatable | boolean | A boolean value specifying if D-Bus activation is supported for this application | +| tryExec | string | Path to an executable file on disk used to determine if the program is actually installed | +| exec | string | Program to execute, possibly with arguments. | +| path | string | If entry is of type Application, the working directory to run the program in. | +| terminal | boolean | Whether the program runs in a terminal window. | +| actions | Array.<string> | Identifiers for application actions. | +| mimeType | Array.<string> | The MIME type(s) supported by this application. | +| categories | Array.<string> | Categories in which the entry should be shown in a menu | +| implements | Array.<string> | A list of interfaces that this application implements. | +| keywords | Array.<string> | A list of strings which may be used in addition to other metadata to describe this entry. | +| startupNotify | boolean | 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. | +| startupWMClass | string | 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 | +| prefersNonDefaultGPU | boolean | If true, the application prefers to be run on a more powerful discrete GPU if available. | +| singleMainWindow | string | If true, the application has a single main window, and does not support having an additional one opened. | + + + +## OsxRc : object + +References: +https://developer.apple.com/documentation/bundleresources/information_property_list + +**Kind**: global typedef +**Properties** + +| Name | Type | Description | +| -------------------------- | ------------------- | -------------------------------------------------------------------- | +| name | string | The name of the application | +| icon | string | The path to the icon file. It should be a .icns file. | +| LSApplicationCategoryType | string | The category that best describes your app for the App Store. | +| CFBundleIdentifier | string | A unique identifier for a bundle usually in reverse DNS format. | +| CFBundleName | string | A user-visible short name for the bundle. | +| CFBundleDisplayName | string | The user-visible name for the bundle. | +| CFBundleSpokenName | string | A replacement for the app name in text-to-speech operations. | +| CFBundleVersion | string | The version of the build that identifies an iteration of the bundle. | +| CFBundleShortVersionString | string | The release or version number of the bundle. | +| NSHumanReadableCopyright | string | A human-readable copyright notice for the bundle. | + + + +## WinRc : object + +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 + +**Kind**: global typedef +**Properties** + +| Name | Type | Description | +| ---------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | string | The name of the application | +| version | string | The version of the application | +| comments | string | Additional information that should be displayed for diagnostic purposes. | +| company | string | Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. | +| fileDescription | 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. | +| fileVersion | string | Version number of the file. For example, 3.10 or 5.00.RC2. This string is required. | +| icon | string | The path to the icon file. It should be a .ico file. | +| internalName | 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. | +| legalCopyright | 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. | +| legalTrademark | 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. | +| originalFilename | 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. | +| privateBuild | 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. | +| productName | string | Name of the product with which the file is distributed. This string is required. | +| productVersion | string | Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2. This string is required. | +| specialBuild | 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. | diff --git a/doc/mode-run.md b/doc/mode-run.md index 075b3037b..dab151f06 100644 --- a/doc/mode-run.md +++ b/doc/mode-run.md @@ -1,25 +1,27 @@ ## 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 +**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. | -| 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** -**Example** ```js // Minimal Usage (uses default values) nwbuild({ diff --git a/src/build.js b/src/build.js index 322bf2c7e..e7a2c7c60 100644 --- a/src/build.js +++ b/src/build.js @@ -89,6 +89,22 @@ import { log } from "./log.js"; /** * 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 diff --git a/src/get.js b/src/get.js index f9003d5a6..d489bd3f1 100644 --- a/src/get.js +++ b/src/get.js @@ -92,7 +92,7 @@ export async function get({ /** * 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 @@ -233,9 +233,9 @@ 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 From 6e2cbe1b4e1508366debfbc6669ae589175de05d Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:31:24 -0400 Subject: [PATCH 09/17] docs: git ignore `mode-*.md` files --- .gitignore | 2 +- doc/mode-build.md | 157 ----------------------------------------- doc/mode-get-ffmpeg.md | 30 -------- doc/mode-get-nwjs.md | 63 ----------------- doc/mode-run.md | 30 -------- 5 files changed, 1 insertion(+), 281 deletions(-) delete mode 100644 doc/mode-build.md 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/.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/doc/mode-build.md b/doc/mode-build.md deleted file mode 100644 index 0745e659b..000000000 --- a/doc/mode-build.md +++ /dev/null @@ -1,157 +0,0 @@ -## Functions - -
-
build(files, nwDir, outDir, platform, zip, app)Promise.<undefined>
-

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. To use rcedit on non-Windows platforms, you will have to install Wine.

-

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:

-

sudo xattr -r -d com.apple.quarantine nwjs.app

-
-
- -## Typedefs - -
-
LinuxRc : object
-

References: -https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

-
-
OsxRc : object
-

References: -https://developer.apple.com/documentation/bundleresources/information_property_list

-
-
WinRc : object
-

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

-
-
- - - -## build(files, nwDir, outDir, platform, zip, app) ⇒ Promise.<undefined> - -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` - -**Kind**: global function - -| Param | Type | Description | -| -------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------- | -| files | string \| Array.<string> | Array of NW app files | -| nwDir | string | Directory to hold NW binaries | -| outDir | string | Directory to store build artifacts | -| platform | "linux" \| "osx" \| "win" | Platform is the operating system type | -| zip | "zip" \| boolean | Specify if the build artifacts are to be zipped | -| app | [LinuxRc](#LinuxRc) \| [OsxRc](#OsxRc) \| [WinRc](#WinRc) | Multi platform configuration options | - -**Example** - -```js -// Minimal Usage (uses default values) -nwbuild({ - mode: "build", -}); -``` - - - -## LinuxRc : object - -References: -https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| -------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| name | string | Name of the application | -| genericName | string | Generic name of the application | -| noDisplay | boolean | If true the application is not displayed | -| comment | string | Tooltip for the entry, for example "View sites on the Internet". | -| icon | string | Icon to display in file manager, menus, etc. | -| hidden | boolean | TBD | -| onlyShowIn | Array.<string> | A list of strings identifying the desktop environments that should (/not) display a given desktop entry | -| notShowIn | Array.<string> | A list of strings identifying the desktop environments that should (/not) display a given desktop entry | -| dBusActivatable | boolean | A boolean value specifying if D-Bus activation is supported for this application | -| tryExec | string | Path to an executable file on disk used to determine if the program is actually installed | -| exec | string | Program to execute, possibly with arguments. | -| path | string | If entry is of type Application, the working directory to run the program in. | -| terminal | boolean | Whether the program runs in a terminal window. | -| actions | Array.<string> | Identifiers for application actions. | -| mimeType | Array.<string> | The MIME type(s) supported by this application. | -| categories | Array.<string> | Categories in which the entry should be shown in a menu | -| implements | Array.<string> | A list of interfaces that this application implements. | -| keywords | Array.<string> | A list of strings which may be used in addition to other metadata to describe this entry. | -| startupNotify | boolean | 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. | -| startupWMClass | string | 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 | -| prefersNonDefaultGPU | boolean | If true, the application prefers to be run on a more powerful discrete GPU if available. | -| singleMainWindow | string | If true, the application has a single main window, and does not support having an additional one opened. | - - - -## OsxRc : object - -References: -https://developer.apple.com/documentation/bundleresources/information_property_list - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| -------------------------- | ------------------- | -------------------------------------------------------------------- | -| name | string | The name of the application | -| icon | string | The path to the icon file. It should be a .icns file. | -| LSApplicationCategoryType | string | The category that best describes your app for the App Store. | -| CFBundleIdentifier | string | A unique identifier for a bundle usually in reverse DNS format. | -| CFBundleName | string | A user-visible short name for the bundle. | -| CFBundleDisplayName | string | The user-visible name for the bundle. | -| CFBundleSpokenName | string | A replacement for the app name in text-to-speech operations. | -| CFBundleVersion | string | The version of the build that identifies an iteration of the bundle. | -| CFBundleShortVersionString | string | The release or version number of the bundle. | -| NSHumanReadableCopyright | string | A human-readable copyright notice for the bundle. | - - - -## WinRc : object - -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 - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| ---------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | string | The name of the application | -| version | string | The version of the application | -| comments | string | Additional information that should be displayed for diagnostic purposes. | -| company | string | Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. | -| fileDescription | 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. | -| fileVersion | string | Version number of the file. For example, 3.10 or 5.00.RC2. This string is required. | -| icon | string | The path to the icon file. It should be a .ico file. | -| internalName | 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. | -| legalCopyright | 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. | -| legalTrademark | 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. | -| originalFilename | 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. | -| privateBuild | 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. | -| productName | string | Name of the product with which the file is distributed. This string is required. | -| productVersion | string | Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2. This string is required. | -| specialBuild | 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. | 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", -}); -``` From 575500121fc2110b0af8645d9fffec0303083c95 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:37:59 -0400 Subject: [PATCH 10/17] fix(docs): remove redundant transform commands --- cfg/jsdoc.config.cjs | 33 --------------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/cfg/jsdoc.config.cjs b/cfg/jsdoc.config.cjs index 563f8676e..27265b65c 100644 --- a/cfg/jsdoc.config.cjs +++ b/cfg/jsdoc.config.cjs @@ -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/package.json b/package.json index cf2b5d76a..29a45a45f 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "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", From 4b993444df5ff62031325d6ad7ecbfb56861b408 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:42:51 -0400 Subject: [PATCH 11/17] fix(docs): remove redundant links --- doc/.vitepress/config.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/doc/.vitepress/config.js b/doc/.vitepress/config.js index 3961ae73c..8fe0e177f 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: [ @@ -29,20 +29,7 @@ export default defineConfig({ { text: "Basic Usage", link: "/usage-basic" }, { 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", - }, + { text: "Build mode", link: "/mode-build" } ], }, { From fd026b04e290e4e9843b30d9e84ac2fa9f3d39af Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:47:34 -0400 Subject: [PATCH 12/17] fix: format --- changelog.md | 17 ++++++++++------- doc/.vitepress/config.js | 7 +++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index 17baf686e..81e395205 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 docs from -- 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 8fe0e177f..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: [ @@ -29,7 +32,7 @@ export default defineConfig({ { text: "Basic Usage", link: "/usage-basic" }, { text: "Get mode", link: "/mode-get" }, { text: "Run mode", link: "/mode-run" }, - { text: "Build mode", link: "/mode-build" } + { text: "Build mode", link: "/mode-build" }, ], }, { From b1c249915cfe5538126aa948a0adc23985e32280 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:35:10 -0400 Subject: [PATCH 13/17] test: link package before running demo --- package.json | 4 ++-- test/fixture/demo.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 29a45a45f..016e9356e 100644 --- a/package.json +++ b/package.json @@ -48,8 +48,8 @@ "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", 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 f53cc016d48b23f39cba975fe47e418a1c0c3005 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:36:41 -0400 Subject: [PATCH 14/17] test: always test the latest NW.js version --- test/e2e/mode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/mode.js b/test/e2e/mode.js index 5b3727fe4..a8f79f4ff 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: "latest", flavor: "sdk", platform: getPlatform(platform), arch: getArch(arch), From 28b332c5b5fdbe54929d044d789d9bb44756d30a Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:44:20 -0400 Subject: [PATCH 15/17] fix: incorrect import --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fb4b9f4eb..9efcbf687 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ 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 { build } from "./build.js"; import { run } from "./run.js"; import { isCached } from "./util/cache.js"; import { getFiles } from "./util/files.js"; From c0f502c1d030efd31c2bdb4b3a7c02b541c5efa8 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:54:13 -0400 Subject: [PATCH 16/17] build(compressing): bump to v1.10.0 --- package-lock.json | 2 +- package.json | 2 +- src/index.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5bd417264..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", diff --git a/package.json b/package.json index 016e9356e..d190bc321 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ }, "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", diff --git a/src/index.js b/src/index.js index 9efcbf687..6320a76ec 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 "./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"; From 0094ef995d1d7ff9933e6bdfdf3e4f69b3081963 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:29:37 -0400 Subject: [PATCH 17/17] docs: rename to `CHANGELOG` --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 81e395205..3ff244f6a 100644 --- a/changelog.md +++ b/changelog.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Refactor build mode. -- Generate docs from +- Generate markdown docs from JSDocs. ## [4.4.1] - 2023-09-06