Skip to content

Commit 0e29a4f

Browse files
feat: support for hosting config
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
1 parent 567cd19 commit 0e29a4f

18 files changed

Lines changed: 245 additions & 174 deletions

juno.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ export default defineConfig({
66
development: '<DEV_SATELLITE_ID>',
77
production: '<PROD_SATELLITE_ID>'
88
},
9-
source: 'e2e/fixtures',
10-
precompress: false,
9+
hosting: {
10+
source: 'e2e/fixtures',
11+
precompress: false
12+
},
1113
collections: {
1214
datastore: [
1315
{

package-lock.json

Lines changed: 175 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
"@dfinity/utils": "^4.2.1",
3333
"@icp-sdk/canisters": "^3.5.2",
3434
"@icp-sdk/core": "^5.2.1",
35-
"@junobuild/admin": "^4.3.2",
36-
"@junobuild/cdn": "^2.4.2",
37-
"@junobuild/cli-tools": "^0.13.3",
38-
"@junobuild/config": "^2.15.1",
39-
"@junobuild/config-loader": "^0.4.10",
40-
"@junobuild/core": "^5.3.1",
41-
"@junobuild/functions-tools": "^0.6.3",
42-
"@junobuild/ic-client": "^8.1.2",
43-
"@junobuild/schema": "^1.2.1",
44-
"@junobuild/storage": "^2.4.1",
45-
"@junobuild/utils": "^1.0.2",
35+
"@junobuild/admin": "^4.3.2-next-2026-04-11",
36+
"@junobuild/cdn": "^2.4.2-next-2026-04-11",
37+
"@junobuild/cli-tools": "0.13.3-next-2026-04-11.3",
38+
"@junobuild/config": "2.15.1-next-2026-04-11.1",
39+
"@junobuild/config-loader": "^0.4.10-next-2026-04-11",
40+
"@junobuild/core": "^5.3.1-next-2026-04-11",
41+
"@junobuild/functions-tools": "0.6.3-next-2026-04-11",
42+
"@junobuild/ic-client": "^8.1.2-next-2026-04-11",
43+
"@junobuild/schema": "1.2.1-next-2026-04-11",
44+
"@junobuild/storage": "^2.4.1-next-2026-04-11",
45+
"@junobuild/utils": "1.0.2-next-2026-04-11",
4646
"chokidar": "^5.0.0",
4747
"conf": "^15.1.0",
4848
"open": "^11.0.0",
@@ -56,7 +56,6 @@
5656
"@eslint/eslintrc": "^3.3.3",
5757
"@eslint/js": "^9.39.2",
5858
"@junobuild/emulator-playwright": "^0.0.5",
59-
"@junobuild/functions": "^0.8.2",
6059
"@playwright/test": "^1.58.1",
6160
"@types/node": "24.10.9",
6261
"@types/prompts": "^2.4.9",
@@ -90,5 +89,12 @@
9089
"homepage": "https://juno.build",
9190
"engines": {
9291
"node": ">=20"
92+
},
93+
"overrides": {
94+
"@junobuild/config": "2.15.1-next-2026-04-11.1",
95+
"@junobuild/schema": "1.2.1-next-2026-04-11",
96+
"@junobuild/utils": "1.0.2-next-2026-04-11",
97+
"@junobuild/cli-tools": "0.13.3-next-2026-04-11.3",
98+
"@junobuild/functions-tools": "0.6.3-next-2026-04-11"
9399
}
94100
}

src/services/assets/_deploy/deploy.execute.services.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const executeDeploy = async <
6464
const {satellite, satelliteConfig: satelliteConfigRead} =
6565
await assertConfigAndLoadSatelliteContext();
6666

67+
/** @deprecated */
6768
const precompress =
6869
satelliteConfigRead.precompress ??
6970
(nonNullish(deprecatedGzip)
@@ -77,7 +78,7 @@ const executeDeploy = async <
7778
...(nonNullish(precompress) && {precompress})
7879
};
7980

80-
await cliPreDeploy({config: satelliteConfig});
81+
await cliPreDeploy({config: satelliteConfig.hosting ?? satelliteConfig});
8182

8283
const result = await deployWithMethod<P, R>({
8384
...rest,
@@ -90,7 +91,7 @@ const executeDeploy = async <
9091
process.exit(0);
9192
}
9293

93-
await cliPostDeploy({config: satelliteConfig});
94+
await cliPostDeploy({config: satelliteConfig.hosting ?? satelliteConfig});
9495

9596
return result;
9697
};
@@ -121,7 +122,7 @@ const deployWithMethod = async <
121122
});
122123

123124
const deployParams: DeployParams = {
124-
config: satelliteConfig,
125+
config: satelliteConfig.hosting ?? satelliteConfig,
125126
listAssets: listExistingAssets,
126127
assertSourceDirExists,
127128
assertMemory,

src/services/assets/prune.services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const executePrune = async (params: {dryRun?: boolean; batchSize?: number
4242

4343
const result = await pruneServices({
4444
params: {
45-
config: satelliteConfig,
45+
config: satelliteConfig.hosting ?? satelliteConfig,
4646
listAssets: listExistingAssets,
4747
assertSourceDirExists,
4848
...params

src/types/deploy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {OnUploadProgress} from '@junobuild/storage';
99
import type {SatelliteParametersWithId} from './satellite';
1010

1111
export interface DeployOptions {
12+
/** @deprecated */
1213
deprecatedGzip?: string;
1314
uploadBatchSize: number | undefined;
1415
}

templates/init/juno.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export default defineConfig({
77
development: '<DEV_SATELLITE_ID>',
88
production: '<PROD_SATELLITE_ID>'
99
},
10-
source: '<SOURCE>'
10+
hosting: {
11+
source: '<SOURCE>'
12+
}
1113
},
1214
orbiter: {
1315
id: '<ORBITER_ID>'

templates/init/juno.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export default defineConfig({
66
development: '<DEV_SATELLITE_ID>',
77
production: '<PROD_SATELLITE_ID>'
88
},
9-
source: '<SOURCE>'
9+
hosting: {
10+
source: '<SOURCE>'
11+
}
1012
},
1113
orbiter: {
1214
id: '<ORBITER_ID>'

templates/init/juno.predeploy.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ export default defineConfig({
77
development: '<DEV_SATELLITE_ID>',
88
production: '<PROD_SATELLITE_ID>'
99
},
10-
source: '<SOURCE>',
11-
predeploy: ['<COMMAND> build']
10+
hosting: {
11+
source: '<SOURCE>',
12+
predeploy: ['<COMMAND> build']
13+
}
1214
},
1315
orbiter: {
1416
id: '<ORBITER_ID>'

templates/init/juno.predeploy.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ export default defineConfig({
66
development: '<DEV_SATELLITE_ID>',
77
production: '<PROD_SATELLITE_ID>'
88
},
9-
source: '<SOURCE>',
10-
predeploy: ['<COMMAND> build']
9+
hosting: {
10+
source: '<SOURCE>',
11+
predeploy: ['<COMMAND> build']
12+
}
1113
},
1214
orbiter: {
1315
id: '<ORBITER_ID>'

0 commit comments

Comments
 (0)