From 3ad143228d544ff1d6a0645284a63a444ae1d537 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:20:13 +1100 Subject: [PATCH 1/5] Use relative paths for build (#1094) --- vite.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/vite.config.js b/vite.config.js index 7ca1baff..f4f588e5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -28,6 +28,7 @@ const copyFiles = { export default defineConfig({ appType: 'spa', publicDir: false, + base: "", server: { port: 8080, host: true, From 374d2d1962c92cb75c747c7cfa1d86f2fd7ef736 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:20:53 +1100 Subject: [PATCH 2/5] Add node polyfills (#1093) * Add node polyfills * remove unused polyfill * enable fs in node polyfill * remove polyfill aliases and crypto * Fix build error * Fix buffer injection --- package-lock.json | 138 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 + vite.config.js | 21 +++++++ 3 files changed, 162 insertions(+) diff --git a/package-lock.json b/package-lock.json index ffea90a9..80aea6cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,8 @@ "twemoji": "14.0.2" }, "devDependencies": { + "@esbuild-plugins/node-globals-polyfill": "0.2.3", + "@rollup/plugin-inject": "5.0.3", "@rollup/plugin-wasm": "6.1.1", "@types/node": "18.11.18", "@types/react": "18.0.26", @@ -47,6 +49,7 @@ "@typescript-eslint/eslint-plugin": "5.46.1", "@typescript-eslint/parser": "5.46.1", "@vitejs/plugin-react": "3.0.0", + "buffer": "6.0.3", "eslint": "8.29.0", "eslint-config-airbnb": "19.0.4", "eslint-config-prettier": "8.5.0", @@ -454,6 +457,15 @@ "node": ">=6.9.0" } }, + "node_modules/@esbuild-plugins/node-globals-polyfill": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz", + "integrity": "sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==", + "dev": true, + "peerDependencies": { + "esbuild": "*" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.16.9", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.9.tgz", @@ -1010,6 +1022,34 @@ "resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-3.0.1.tgz", "integrity": "sha512-XjDVbs3ZU16CO1h5Q3Ew2RPJqmZBDE/EVf1LYp6ePEffs3V/MX9ZbL5bJr8qiK5SbGmUMuDoaFgyKacYz8prRA==" }, + "node_modules/@rollup/plugin-inject": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.3.tgz", + "integrity": "sha512-411QlbL+z2yXpRWFXSmw/teQRMkXcAAC8aYTemc15gwJRpvEVDQwoe+N/HTFD8RFG8+88Bme9DK2V9CVm7hJdA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "estree-walker": "^2.0.2", + "magic-string": "^0.27.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-inject/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/@rollup/plugin-wasm": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-wasm/-/plugin-wasm-6.1.1.tgz", @@ -1027,6 +1067,34 @@ } } }, + "node_modules/@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/@tippyjs/react": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/@tippyjs/react/-/react-4.2.6.tgz", @@ -1039,6 +1107,12 @@ "react-dom": ">=16.8" } }, + "node_modules/@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "dev": true + }, "node_modules/@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -1594,6 +1668,26 @@ "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -1671,6 +1765,30 @@ "base-x": "^4.0.0" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -3174,6 +3292,26 @@ "entities": "^4.3.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", diff --git a/package.json b/package.json index 4082853c..a0e7bace 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,8 @@ "twemoji": "14.0.2" }, "devDependencies": { + "@esbuild-plugins/node-globals-polyfill": "0.2.3", + "@rollup/plugin-inject": "5.0.3", "@rollup/plugin-wasm": "6.1.1", "@types/node": "18.11.18", "@types/react": "18.0.26", @@ -57,6 +59,7 @@ "@typescript-eslint/eslint-plugin": "5.46.1", "@typescript-eslint/parser": "5.46.1", "@vitejs/plugin-react": "3.0.0", + "buffer": "6.0.3", "eslint": "8.29.0", "eslint-config-airbnb": "19.0.4", "eslint-config-prettier": "8.5.0", diff --git a/vite.config.js b/vite.config.js index f4f588e5..979e9aa0 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,6 +2,8 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { wasm } from '@rollup/plugin-wasm'; import { viteStaticCopy } from 'vite-plugin-static-copy'; +import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'; +import inject from '@rollup/plugin-inject'; import { svgLoader } from './viteSvgLoader'; const copyFiles = { @@ -39,9 +41,28 @@ export default defineConfig({ wasm(), react(), ], + optimizeDeps: { + esbuildOptions: { + define: { + global: 'globalThis' + }, + plugins: [ + // Enable esbuild polyfill plugins + NodeGlobalsPolyfillPlugin({ + process: false, + buffer: true, + }), + ] + } + }, build: { outDir: 'dist', sourcemap: true, copyPublicDir: false, + rollupOptions: { + plugins: [ + inject({ Buffer: ['buffer', 'Buffer'] }) + ] + } }, }); From a6fb44e1abe9ad48136dee8e7d053e639f37bedc Mon Sep 17 00:00:00 2001 From: Krishan <33421343+kfiven@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:27:17 +1100 Subject: [PATCH 3/5] Release v2.2.4 --- package-lock.json | 4 ++-- package.json | 2 +- src/client/state/cons.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80aea6cb..bef7acdd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cinny", - "version": "2.2.3", + "version": "2.2.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cinny", - "version": "2.2.3", + "version": "2.2.4", "license": "MIT", "dependencies": { "@fontsource/inter": "4.5.14", diff --git a/package.json b/package.json index a0e7bace..7e026b7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cinny", - "version": "2.2.3", + "version": "2.2.4", "description": "Yet another matrix client", "main": "index.js", "engines": { diff --git a/src/client/state/cons.js b/src/client/state/cons.js index 584eaba4..86ddab98 100644 --- a/src/client/state/cons.js +++ b/src/client/state/cons.js @@ -1,5 +1,5 @@ const cons = { - version: '2.2.3', + version: '2.2.4', secretKey: { ACCESS_TOKEN: 'cinny_access_token', DEVICE_ID: 'cinny_device_id', From 44318d1ecd19700f010079d0836db7955fc23005 Mon Sep 17 00:00:00 2001 From: Krishan <33421343+kfiven@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:46:56 +1100 Subject: [PATCH 4/5] Replace deprecated 'set-output' with '$GITHUB_OUTPUT' --- .github/workflows/prod-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml index fa09008a..5f8a77cf 100644 --- a/.github/workflows/prod-deploy.yml +++ b/.github/workflows/prod-deploy.yml @@ -36,7 +36,7 @@ jobs: timeout-minutes: 1 - name: Get version from tag id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Create tar.gz run: tar -czvf cinny-${{ steps.vars.outputs.tag }}.tar.gz dist - name: Sign tar.gz From 78951a3bc4fe499e68b2d709cdfb46e23b187e01 Mon Sep 17 00:00:00 2001 From: Krishan <33421343+kfiven@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:13:05 +1100 Subject: [PATCH 5/5] Rename LICENSE to LICENSE.md --- LICENSE => LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename LICENSE => LICENSE.md (99%) diff --git a/LICENSE b/LICENSE.md similarity index 99% rename from LICENSE rename to LICENSE.md index 1f7a2841..7d151b3c 100644 --- a/LICENSE +++ b/LICENSE.md @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE.