Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions juno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: 'e2e/fixtures',
precompress: false,
hosting: {
source: 'e2e/fixtures',
precompress: false
},
collections: {
datastore: [
{
Expand Down
195 changes: 97 additions & 98 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"@dfinity/utils": "^4.2.1",
"@icp-sdk/canisters": "^3.5.2",
"@icp-sdk/core": "^5.2.1",
"@junobuild/admin": "^4.3.2",
"@junobuild/cdn": "^2.4.2",
"@junobuild/cli-tools": "^0.13.3",
"@junobuild/config": "^2.15.1",
"@junobuild/config-loader": "^0.4.10",
"@junobuild/core": "^5.3.1",
"@junobuild/functions-tools": "^0.6.3",
"@junobuild/ic-client": "^8.1.2",
"@junobuild/schema": "^1.2.1",
"@junobuild/storage": "^2.4.1",
"@junobuild/utils": "^1.0.2",
"@junobuild/admin": "^4.3.3",
"@junobuild/cdn": "^2.5.0",
"@junobuild/cli-tools": "^0.14.0",
"@junobuild/config": "^3.0.0",
"@junobuild/config-loader": "^0.4.11",
"@junobuild/core": "^5.4.0",
"@junobuild/functions-tools": "^0.6.4",
"@junobuild/ic-client": "^8.1.3",
"@junobuild/schema": "^1.2.2",
"@junobuild/storage": "^2.4.2",
"@junobuild/utils": "^1.0.3",
"chokidar": "^5.0.0",
"conf": "^15.1.0",
"open": "^11.0.0",
Expand All @@ -56,7 +56,7 @@
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@junobuild/emulator-playwright": "^0.1.1",
"@junobuild/functions": "^0.8.2",
"@junobuild/functions": "^0.8.3",
"@playwright/test": "^1.58.1",
"@types/node": "24.10.9",
"@types/prompts": "^2.4.9",
Expand Down
6 changes: 4 additions & 2 deletions src/configs/juno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const writeJunoConfigPlaceholder = async ({
case 'ts':
case 'js': {
const {
satellite: {source}
satellite: {
hosting: {source}
}
} = config;

const withPredeploy = nonNullish(pm);
Expand All @@ -74,7 +76,7 @@ export const writeJunoConfigPlaceholder = async ({
});

let content = template
.replace('<SOURCE>', source ?? DEPLOY_DEFAULT_SOURCE)
.replace('<SOURCE>', source)
.replace('<COMMAND>', pm === 'npm' ? 'npm run' : (pm ?? ''));

if (nonNullish(emulatorConfig)) {
Expand Down
9 changes: 5 additions & 4 deletions src/services/assets/_deploy/deploy.execute.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const executeDeploy = async <
const {satellite, satelliteConfig: satelliteConfigRead} =
await assertConfigAndLoadSatelliteContext();

/** @deprecated */
const precompress =
satelliteConfigRead.precompress ??
(nonNullish(deprecatedGzip)
Expand All @@ -77,7 +78,7 @@ const executeDeploy = async <
...(nonNullish(precompress) && {precompress})
};

await cliPreDeploy({config: satelliteConfig});
await cliPreDeploy({config: satelliteConfig.hosting ?? satelliteConfig});

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

await cliPostDeploy({config: satelliteConfig});
await cliPostDeploy({config: satelliteConfig.hosting ?? satelliteConfig});

return result;
};
Expand Down Expand Up @@ -121,7 +122,7 @@ const deployWithMethod = async <
});

const deployParams: DeployParams = {
config: satelliteConfig,
config: satelliteConfig.hosting ?? satelliteConfig,
listAssets: listExistingAssets,
assertSourceDirExists,
assertMemory,
Expand Down Expand Up @@ -170,7 +171,7 @@ const assertSourceDirExists = (source: string) => {
console.log(
`${red(
'Cannot proceed deployment.'
)}\nAre you sure the folder containing your built app (the "source" tag in the configuration file for Juno) files is correctly configured, or have you built your app?`
)}\nAre you sure the folder containing your built app files is correctly configured (in your juno.config "hosting > source"), or have you built your app?`
);
process.exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/assets/prune.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const executePrune = async (params: {dryRun?: boolean; batchSize?: number

const result = await pruneServices({
params: {
config: satelliteConfig,
config: satelliteConfig.hosting ?? satelliteConfig,
listAssets: listExistingAssets,
assertSourceDirExists,
...params
Expand Down
4 changes: 3 additions & 1 deletion src/services/config/init.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ export const initConfigNoneInteractive = async ({
await writeJunoConfigPlaceholder({
...rest,
config: {
satellite: {source}
satellite: {
hosting: {source}
}
},
emulatorConfig
});
Expand Down
6 changes: 4 additions & 2 deletions src/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import type {JunoConfig, OrbiterConfig, SatelliteConfig} from '@junobuild/config';
import type {HostingConfig, JunoConfig, OrbiterConfig, SatelliteConfig} from '@junobuild/config';

export type JunoConfigWithSatelliteId = Omit<JunoConfig, 'satellite' | 'orbiter'> & {
satellite: Omit<SatelliteConfig, 'id' | 'satellitesIds'> & Required<Pick<SatelliteConfig, 'id'>>;
orbiter?: Omit<OrbiterConfig, 'orbiterId'>;
};

export type JunoConfigWithPlaceholder = Omit<JunoConfig, 'satellite' | 'orbiter'> & {
satellite: Pick<SatelliteConfig, 'source'>;
satellite: {
hosting: Pick<HostingConfig, 'source'>;
};
};
1 change: 1 addition & 0 deletions src/types/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {OnUploadProgress} from '@junobuild/storage';
import type {SatelliteParametersWithId} from './satellite';

export interface DeployOptions {
/** @deprecated */
deprecatedGzip?: string;
uploadBatchSize: number | undefined;
}
Expand Down
4 changes: 3 additions & 1 deletion templates/init/juno.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>'
hosting: {
source: '<SOURCE>'
}
},
orbiter: {
id: '<ORBITER_ID>'
Expand Down
4 changes: 3 additions & 1 deletion templates/init/juno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>'
hosting: {
source: '<SOURCE>'
}
},
orbiter: {
id: '<ORBITER_ID>'
Expand Down
6 changes: 4 additions & 2 deletions templates/init/juno.predeploy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
hosting: {
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
}
},
orbiter: {
id: '<ORBITER_ID>'
Expand Down
6 changes: 4 additions & 2 deletions templates/init/juno.predeploy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
hosting: {
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
}
},
orbiter: {
id: '<ORBITER_ID>'
Expand Down
4 changes: 3 additions & 1 deletion templates/init/juno.runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>'
hosting: {
source: '<SOURCE>'
}
},
emulator: {
runner: {
Expand Down
4 changes: 3 additions & 1 deletion templates/init/juno.runner.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>'
hosting: {
source: '<SOURCE>'
}
},
emulator: {
runner: {
Expand Down
6 changes: 4 additions & 2 deletions templates/init/juno.runner.predeploy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
hosting: {
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
}
},
emulator: {
runner: {
Expand Down
6 changes: 4 additions & 2 deletions templates/init/juno.runner.predeploy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
hosting: {
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
}
},
emulator: {
runner: {
Expand Down
4 changes: 3 additions & 1 deletion templates/init/juno.skylab.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>'
hosting: {
source: '<SOURCE>'
}
}
});
4 changes: 3 additions & 1 deletion templates/init/juno.skylab.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>'
hosting: {
source: '<SOURCE>'
}
}
});
6 changes: 4 additions & 2 deletions templates/init/juno.skylab.predeploy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
hosting: {
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
}
}
});
6 changes: 4 additions & 2 deletions templates/init/juno.skylab.predeploy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export default defineConfig({
development: '<DEV_SATELLITE_ID>',
production: '<PROD_SATELLITE_ID>'
},
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
hosting: {
source: '<SOURCE>',
predeploy: ['<COMMAND> build']
}
}
});
Loading