From d01a797e00d3c4340b3de0064bf760644d03875a Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Thu, 14 Aug 2025 12:09:58 +0200 Subject: [PATCH] feat: precompress replaces gzip --- package-lock.json | 133 +++++++++--------- package.json | 12 +- .../assets/_deploy/deploy.execute.services.ts | 10 +- 3 files changed, 81 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index d63b62b5..4cbedaf4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,14 +17,14 @@ "@dfinity/principal": "^2.3.0", "@dfinity/zod-schemas": "^1.0.0", "@junobuild/admin": "^2.0.0-next-2025-08-13", - "@junobuild/cdn": "^1.0.0-next-2025-08-13", - "@junobuild/cli-tools": "^0.5.0-next-2025-08-13.3", - "@junobuild/config": "^1.1.2", + "@junobuild/cdn": "^1.0.0-next-2025-08-14.2", + "@junobuild/cli-tools": "^0.5.0-next-2025-08-14.2", + "@junobuild/config": "^1.1.3-next-2025-08-14.2", "@junobuild/config-loader": "^0.4.1", - "@junobuild/core": "^1.1.0-next-2025-08-13", + "@junobuild/core": "^1.1.0-next-2025-08-14.2", "@junobuild/did-tools": "^0.2.4", - "@junobuild/ic-client": "^1.0.0-next-2025-08-13", - "@junobuild/storage": "^1.0.0-next-2025-08-13", + "@junobuild/ic-client": "^1.0.0-next-2025-08-14.2", + "@junobuild/storage": "^1.0.0-next-2025-08-14.2", "@junobuild/utils": "^0.1.4", "chokidar": "^4.0.3", "conf": "^14.0.0", @@ -572,6 +572,16 @@ "node": ">=6.9.0" } }, + "node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@dfinity/agent": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-2.3.0.tgz", @@ -1444,9 +1454,9 @@ } }, "node_modules/@junobuild/cdn": { - "version": "1.0.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/cdn/-/cdn-1.0.0-next-2025-08-13.tgz", - "integrity": "sha512-FM7YwOYaI8sWbEgGjI96pw5VRCsFMTx4UEq1+AnhD+L61sr8AzQUK/yZ2MHxrrKmzlIHd6eD8CTVvT/qVhITvQ==", + "version": "1.0.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/cdn/-/cdn-1.0.0-next-2025-08-14.2.tgz", + "integrity": "sha512-dBqJ562OFrGstysh+GWJkCwxpbcZ+PAEtseiLayvcLkQ6hV1Omv0S9oRhawwsXS4zGWARCrdIisKBBKgcn2Z3w==", "license": "MIT", "peerDependencies": { "@dfinity/agent": "*", @@ -1462,9 +1472,9 @@ } }, "node_modules/@junobuild/cli-tools": { - "version": "0.5.0-next-2025-08-13.3", - "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.5.0-next-2025-08-13.3.tgz", - "integrity": "sha512-KCwIjY8OYSUDBbPEQeBpa/0tMedpuzgxXCw/FXpUD1jQRItXnDEay5OGkuT729iTNFzWA9qy0LIKNKWOh9b7pw==", + "version": "0.5.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.5.0-next-2025-08-14.2.tgz", + "integrity": "sha512-KqwJEeegLS7D+PzwO0oQHk8bMJcUKol1rvNjY3wr1u6AhA/3gAdrPfDaTtAxvuXYDVpKNL+8jaqeHt1BabFIhQ==", "license": "MIT", "dependencies": { "file-type": "^21.0.0", @@ -1482,13 +1492,13 @@ } }, "node_modules/@junobuild/config": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-1.1.2.tgz", - "integrity": "sha512-eRnJ4QL9UDDEb68kgn0U2ukus/zXLmRnX6xlnWvXsFcnQlBV9BFXWIh0/g11XAlnTRO8CDh1KYQrXs3AyLWWqQ==", + "version": "1.1.3-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-1.1.3-next-2025-08-14.2.tgz", + "integrity": "sha512-geDUENQobz/E1IZg+DIcddoysczC0tfqX6ZHrNhOL9XkjDfsONKGIEE8r64bKGmXzlm3z49KjAuu7fM8GF3nJQ==", "license": "MIT", "peerDependencies": { - "@dfinity/zod-schemas": "1.0.0", - "zod": "^3.25" + "@dfinity/zod-schemas": "*", + "zod": "*" } }, "node_modules/@junobuild/config-loader": { @@ -1504,9 +1514,9 @@ } }, "node_modules/@junobuild/core": { - "version": "1.1.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/core/-/core-1.1.0-next-2025-08-13.tgz", - "integrity": "sha512-GGPWJd0N5zz49h0khZwiNwbc6N4Ios7vrSGFjj3bsopMagt46P5sXr+9jKkR47k4cWSTb26jWS3OYJ3li5qRwg==", + "version": "1.1.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/core/-/core-1.1.0-next-2025-08-14.2.tgz", + "integrity": "sha512-aeG6WcOqbhSPRgTsi2yNSI3J/RhLR1/dHNkSasSMjHOktTEtXVigmZyfJmekMSLwJ5i9LONW1ubZImbSEfApEw==", "license": "MIT", "dependencies": { "@junobuild/errors": "*", @@ -1587,9 +1597,9 @@ } }, "node_modules/@junobuild/ic-client": { - "version": "1.0.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/ic-client/-/ic-client-1.0.0-next-2025-08-13.tgz", - "integrity": "sha512-I7JeBzAavThVMHKu+mNMGH70d0F30GQg2lLKk4H48eEbs3ax2HrWKX1r7SoZH94qNxHndqAwOFGCppAsLl7nkg==", + "version": "1.0.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/ic-client/-/ic-client-1.0.0-next-2025-08-14.2.tgz", + "integrity": "sha512-+nCq65SnMydOTomMn2TqXAYvOQcIbVQpE6535SBLjzA+vuWvl2L53zRTC4gicebVHmFW06CGcGLDueJaX0oSCw==", "license": "MIT", "peerDependencies": { "@dfinity/agent": "*", @@ -1599,9 +1609,9 @@ } }, "node_modules/@junobuild/storage": { - "version": "1.0.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/storage/-/storage-1.0.0-next-2025-08-13.tgz", - "integrity": "sha512-P1r3iTqxWQB5gsbTdB+72pP7fUybupXnA482Pkba3oLCFGvS+PFM5YCcYczffcxTze3re4djVGFfScqwu+Fw7A==", + "version": "1.0.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/storage/-/storage-1.0.0-next-2025-08-14.2.tgz", + "integrity": "sha512-hVHlHWUPPZsVaTez8hvD3yE87tHLp0cw6GuNCXz6ytly/RibX16Ts8AmgJloN2g3+RWSZFXdm9xDp7pOEdxVlw==", "license": "MIT", "peerDependencies": { "@dfinity/agent": "*", @@ -1622,15 +1632,6 @@ "@dfinity/utils": "^2" } }, - "node_modules/@kayahr/text-encoding": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@kayahr/text-encoding/-/text-encoding-2.0.1.tgz", - "integrity": "sha512-OUsJJVn85VrfNiiT6CSbHK2Jr9YS6tVsgQhly+EkcbYTT2SXeibU4nQNO2IzCRttKJt4zw4W60KtLifRRJBIng==", - "license": "MIT", - "funding": { - "url": "https://github.com/kayahr/text-encoding?sponsor=1" - } - }, "node_modules/@noble/curves": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", @@ -6247,12 +6248,12 @@ } }, "node_modules/token-types": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.0.tgz", - "integrity": "sha512-IwovPojr3nD6KBpwSdWq7zL4D9xDLMSqZm/mFweaFFXiS7mtD1qea2WKcth6lyErwZZjsavZk4AnwPJzT9/wVA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", "license": "MIT", "dependencies": { - "@kayahr/text-encoding": "^2.0.1", + "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" }, @@ -7034,6 +7035,11 @@ "@babel/helper-validator-identifier": "^7.27.1" } }, + "@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==" + }, "@dfinity/agent": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-2.3.0.tgz", @@ -7488,15 +7494,15 @@ "requires": {} }, "@junobuild/cdn": { - "version": "1.0.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/cdn/-/cdn-1.0.0-next-2025-08-13.tgz", - "integrity": "sha512-FM7YwOYaI8sWbEgGjI96pw5VRCsFMTx4UEq1+AnhD+L61sr8AzQUK/yZ2MHxrrKmzlIHd6eD8CTVvT/qVhITvQ==", + "version": "1.0.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/cdn/-/cdn-1.0.0-next-2025-08-14.2.tgz", + "integrity": "sha512-dBqJ562OFrGstysh+GWJkCwxpbcZ+PAEtseiLayvcLkQ6hV1Omv0S9oRhawwsXS4zGWARCrdIisKBBKgcn2Z3w==", "requires": {} }, "@junobuild/cli-tools": { - "version": "0.5.0-next-2025-08-13.3", - "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.5.0-next-2025-08-13.3.tgz", - "integrity": "sha512-KCwIjY8OYSUDBbPEQeBpa/0tMedpuzgxXCw/FXpUD1jQRItXnDEay5OGkuT729iTNFzWA9qy0LIKNKWOh9b7pw==", + "version": "0.5.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.5.0-next-2025-08-14.2.tgz", + "integrity": "sha512-KqwJEeegLS7D+PzwO0oQHk8bMJcUKol1rvNjY3wr1u6AhA/3gAdrPfDaTtAxvuXYDVpKNL+8jaqeHt1BabFIhQ==", "requires": { "file-type": "^21.0.0", "listr2": "^9.0.1", @@ -7505,9 +7511,9 @@ } }, "@junobuild/config": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-1.1.2.tgz", - "integrity": "sha512-eRnJ4QL9UDDEb68kgn0U2ukus/zXLmRnX6xlnWvXsFcnQlBV9BFXWIh0/g11XAlnTRO8CDh1KYQrXs3AyLWWqQ==", + "version": "1.1.3-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-1.1.3-next-2025-08-14.2.tgz", + "integrity": "sha512-geDUENQobz/E1IZg+DIcddoysczC0tfqX6ZHrNhOL9XkjDfsONKGIEE8r64bKGmXzlm3z49KjAuu7fM8GF3nJQ==", "requires": {} }, "@junobuild/config-loader": { @@ -7517,9 +7523,9 @@ "requires": {} }, "@junobuild/core": { - "version": "1.1.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/core/-/core-1.1.0-next-2025-08-13.tgz", - "integrity": "sha512-GGPWJd0N5zz49h0khZwiNwbc6N4Ios7vrSGFjj3bsopMagt46P5sXr+9jKkR47k4cWSTb26jWS3OYJ3li5qRwg==", + "version": "1.1.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/core/-/core-1.1.0-next-2025-08-14.2.tgz", + "integrity": "sha512-aeG6WcOqbhSPRgTsi2yNSI3J/RhLR1/dHNkSasSMjHOktTEtXVigmZyfJmekMSLwJ5i9LONW1ubZImbSEfApEw==", "requires": { "@junobuild/errors": "*", "@junobuild/ic-client": "^1", @@ -7560,15 +7566,15 @@ "requires": {} }, "@junobuild/ic-client": { - "version": "1.0.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/ic-client/-/ic-client-1.0.0-next-2025-08-13.tgz", - "integrity": "sha512-I7JeBzAavThVMHKu+mNMGH70d0F30GQg2lLKk4H48eEbs3ax2HrWKX1r7SoZH94qNxHndqAwOFGCppAsLl7nkg==", + "version": "1.0.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/ic-client/-/ic-client-1.0.0-next-2025-08-14.2.tgz", + "integrity": "sha512-+nCq65SnMydOTomMn2TqXAYvOQcIbVQpE6535SBLjzA+vuWvl2L53zRTC4gicebVHmFW06CGcGLDueJaX0oSCw==", "requires": {} }, "@junobuild/storage": { - "version": "1.0.0-next-2025-08-13", - "resolved": "https://registry.npmjs.org/@junobuild/storage/-/storage-1.0.0-next-2025-08-13.tgz", - "integrity": "sha512-P1r3iTqxWQB5gsbTdB+72pP7fUybupXnA482Pkba3oLCFGvS+PFM5YCcYczffcxTze3re4djVGFfScqwu+Fw7A==", + "version": "1.0.0-next-2025-08-14.2", + "resolved": "https://registry.npmjs.org/@junobuild/storage/-/storage-1.0.0-next-2025-08-14.2.tgz", + "integrity": "sha512-hVHlHWUPPZsVaTez8hvD3yE87tHLp0cw6GuNCXz6ytly/RibX16Ts8AmgJloN2g3+RWSZFXdm9xDp7pOEdxVlw==", "requires": {} }, "@junobuild/utils": { @@ -7577,11 +7583,6 @@ "integrity": "sha512-Mzr6KKT/0Twy/dz7nGwUvIABJXOP3vct7X7dMnQZR8mafJNh0vpLpfGZ3UnKuB8aKnU2KS0LIDPghHcw9qnpmQ==", "requires": {} }, - "@kayahr/text-encoding": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@kayahr/text-encoding/-/text-encoding-2.0.1.tgz", - "integrity": "sha512-OUsJJVn85VrfNiiT6CSbHK2Jr9YS6tVsgQhly+EkcbYTT2SXeibU4nQNO2IzCRttKJt4zw4W60KtLifRRJBIng==" - }, "@noble/curves": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", @@ -10471,11 +10472,11 @@ } }, "token-types": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.0.tgz", - "integrity": "sha512-IwovPojr3nD6KBpwSdWq7zL4D9xDLMSqZm/mFweaFFXiS7mtD1qea2WKcth6lyErwZZjsavZk4AnwPJzT9/wVA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", "requires": { - "@kayahr/text-encoding": "^2.0.1", + "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } diff --git a/package.json b/package.json index 5752e6c9..5053d867 100644 --- a/package.json +++ b/package.json @@ -31,14 +31,14 @@ "@dfinity/principal": "^2.3.0", "@dfinity/zod-schemas": "^1.0.0", "@junobuild/admin": "^2.0.0-next-2025-08-13", - "@junobuild/cdn": "^1.0.0-next-2025-08-13", - "@junobuild/cli-tools": "^0.5.0-next-2025-08-13.3", - "@junobuild/config": "^1.1.2", + "@junobuild/cdn": "^1.0.0-next-2025-08-14.2", + "@junobuild/cli-tools": "^0.5.0-next-2025-08-14.2", + "@junobuild/config": "^1.1.3-next-2025-08-14.2", "@junobuild/config-loader": "^0.4.1", - "@junobuild/core": "^1.1.0-next-2025-08-13", + "@junobuild/core": "^1.1.0-next-2025-08-14.2", "@junobuild/did-tools": "^0.2.4", - "@junobuild/ic-client": "^1.0.0-next-2025-08-13", - "@junobuild/storage": "^1.0.0-next-2025-08-13", + "@junobuild/ic-client": "^1.0.0-next-2025-08-14.2", + "@junobuild/storage": "^1.0.0-next-2025-08-14.2", "@junobuild/utils": "^0.1.4", "chokidar": "^4.0.3", "conf": "^14.0.0", diff --git a/src/services/assets/_deploy/deploy.execute.services.ts b/src/services/assets/_deploy/deploy.execute.services.ts index 5d79c849..fd0a6f39 100644 --- a/src/services/assets/_deploy/deploy.execute.services.ts +++ b/src/services/assets/_deploy/deploy.execute.services.ts @@ -63,11 +63,17 @@ const executeDeploy = async < const {satellite, satelliteConfig: satelliteConfigRead} = await assertConfigAndLoadSatelliteContext(); - const gzip = satelliteConfigRead.gzip ?? options.deprecatedGzip; + const precompress = + satelliteConfigRead.precompress ?? + (nonNullish(options.deprecatedGzip) + ? { + pattern: options.deprecatedGzip + } + : undefined); const satelliteConfig: SatelliteConfig = { ...satelliteConfigRead, - ...(nonNullish(gzip) && {gzip}) + ...(nonNullish(precompress) && {precompress}) }; await cliPreDeploy({config: satelliteConfig});