diff --git a/package-lock.json b/package-lock.json index 41b7f56..b2aff97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,8 @@ "@dfinity/identity": "^1.0.1", "@dfinity/principal": "^1.0.1", "@junobuild/admin": "^0.0.46", - "@junobuild/cli-tools": "^0.0.3", - "@junobuild/config": "^0.0.2", + "@junobuild/cli-tools": "^0.0.5", + "@junobuild/config": "^0.0.4", "@junobuild/core-peer": "^0.0.11", "@junobuild/utils": "^0.0.19", "conf": "^12.0.0", @@ -1432,23 +1432,23 @@ } }, "node_modules/@junobuild/cli-tools": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.0.3.tgz", - "integrity": "sha512-qwibz7KYEiguCb5Frw2i0DMPmibcKrLnr0EMZJ1rQaPN7kucVrAsB2fQfyADoiTyXXst9vFE9lLLNbI0Fv6o0Q==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.0.5.tgz", + "integrity": "sha512-aCsjGezqaPlVP1ad5sM1Lvn7ASliwaiNVBK7TyL9S1HRaFo4S1Ss8RkxTqjpsvE+GaDwTSQYLPLq2dxwCCjpEQ==", "dependencies": { "@babel/core": "^7.23.9", "@babel/plugin-transform-modules-commonjs": "^7.23.3", "@babel/preset-typescript": "^7.23.3" }, "peerDependencies": { - "@junobuild/config": "^0.0.2", + "@junobuild/config": "^0.0.4", "@junobuild/utils": "^0.0.19" } }, "node_modules/@junobuild/config": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-0.0.2.tgz", - "integrity": "sha512-aJwbMCaAmU6T02euxrTVmF37Oq6xm1zBLBAEFvy/wkDG2Kz3vTujaDH1yXJ1iUnwrz9Ag3v+sj0BYuY8k1+3YQ==" + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-0.0.4.tgz", + "integrity": "sha512-q/3Nv76iDdCRC7Ks7FA1WJQFd6K3JDWQoE73qOWWnw2g5Vw7NFtY4FMptpEsY61orXrKhfGH0HyahS+Z8B1AVQ==" }, "node_modules/@junobuild/core-peer": { "version": "0.0.11", @@ -7569,9 +7569,9 @@ "requires": {} }, "@junobuild/cli-tools": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.0.3.tgz", - "integrity": "sha512-qwibz7KYEiguCb5Frw2i0DMPmibcKrLnr0EMZJ1rQaPN7kucVrAsB2fQfyADoiTyXXst9vFE9lLLNbI0Fv6o0Q==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@junobuild/cli-tools/-/cli-tools-0.0.5.tgz", + "integrity": "sha512-aCsjGezqaPlVP1ad5sM1Lvn7ASliwaiNVBK7TyL9S1HRaFo4S1Ss8RkxTqjpsvE+GaDwTSQYLPLq2dxwCCjpEQ==", "requires": { "@babel/core": "^7.23.9", "@babel/plugin-transform-modules-commonjs": "^7.23.3", @@ -7579,9 +7579,9 @@ } }, "@junobuild/config": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-0.0.2.tgz", - "integrity": "sha512-aJwbMCaAmU6T02euxrTVmF37Oq6xm1zBLBAEFvy/wkDG2Kz3vTujaDH1yXJ1iUnwrz9Ag3v+sj0BYuY8k1+3YQ==" + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@junobuild/config/-/config-0.0.4.tgz", + "integrity": "sha512-q/3Nv76iDdCRC7Ks7FA1WJQFd6K3JDWQoE73qOWWnw2g5Vw7NFtY4FMptpEsY61orXrKhfGH0HyahS+Z8B1AVQ==" }, "@junobuild/core-peer": { "version": "0.0.11", diff --git a/package.json b/package.json index 4558584..3573e6a 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "@dfinity/identity": "^1.0.1", "@dfinity/principal": "^1.0.1", "@junobuild/admin": "^0.0.46", - "@junobuild/cli-tools": "^0.0.3", - "@junobuild/config": "^0.0.2", + "@junobuild/cli-tools": "^0.0.5", + "@junobuild/config": "^0.0.4", "@junobuild/core-peer": "^0.0.11", "@junobuild/utils": "^0.0.19", "conf": "^12.0.0", diff --git a/src/commands/init.ts b/src/commands/init.ts index b0cb4a7..a2926d0 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -42,8 +42,8 @@ const initConfig = async () => { await writeJunoConfig({ config: { - satellite: {satelliteId, source}, - ...(nonNullish(orbiterId) && {orbiter: {orbiterId}}) + satellite: {id: satelliteId, source}, + ...(nonNullish(orbiterId) && {orbiter: {id: orbiterId}}) }, configType }); diff --git a/src/configs/juno.config.ts b/src/configs/juno.config.ts index 4e23ea8..299be00 100644 --- a/src/configs/juno.config.ts +++ b/src/configs/juno.config.ts @@ -37,7 +37,7 @@ export const writeJunoConfig = async ({ case 'js': { const { orbiter, - satellite: {satelliteId, source} + satellite: {id, source} } = config; const template = await readTemplateFile({ @@ -48,9 +48,9 @@ export const writeJunoConfig = async ({ }); const content = template - .replace('', satelliteId) + .replace('', id) .replace('', source ?? DEPLOY_DEFAULT_SOURCE) - .replace('', orbiter?.orbiterId ?? ''); + .replace('', orbiter?.id ?? ''); await writeFile(`${JUNO_CONFIG_FILENAME}.${configType}`, content, 'utf-8'); break; diff --git a/src/types/config.ts b/src/types/config.ts index be63a6a..fe2aa73 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -1,4 +1,4 @@ -import type {JunoConfig, JunoConfigEnv, SatelliteConfig} from '@junobuild/config'; +import type {JunoConfig, JunoConfigEnv, OrbiterConfig, SatelliteConfig} from '@junobuild/config'; export type ConfigType = 'ts' | 'js' | 'json'; @@ -7,7 +7,7 @@ export interface SatelliteConfigEnv { env: JunoConfigEnv; } -export type JunoConfigWithSatelliteId = Omit & { - satellite: Omit & - Required>; +export type JunoConfigWithSatelliteId = Omit & { + satellite: Omit & Required>; + orbiter?: Omit; }; diff --git a/src/utils/satellite.utils.ts b/src/utils/satellite.utils.ts index a7ec87e..8594d90 100644 --- a/src/utils/satellite.utils.ts +++ b/src/utils/satellite.utils.ts @@ -6,11 +6,11 @@ import type {SatelliteConfigEnv} from '../types/config'; import {actorParameters} from './actor.utils'; export const satelliteParameters = ({ - satellite: {satelliteId: satelliteIdUser, satellitesIds}, + satellite: {satelliteId: deprecatedSatelliteId, id, ids}, env: {mode} }: SatelliteConfigEnv): Omit & Required> => { - const satelliteId = satellitesIds?.[mode] ?? satelliteIdUser; + const satelliteId = ids?.[mode] ?? id ?? deprecatedSatelliteId; if (isNullish(satelliteId)) { console.log(`${red(`A satellite ID for ${mode} must be set in your configuration.`)}`); diff --git a/templates/init/juno.config.js b/templates/init/juno.config.js index 25a7da6..2489a5b 100644 --- a/templates/init/juno.config.js +++ b/templates/init/juno.config.js @@ -3,10 +3,10 @@ import {defineConfig} from '@junobuild/config'; /** @type {import('@junobuild/config').JunoConfig} */ export default defineConfig({ satellite: { - satelliteId: '', + id: '', source: '' }, orbiter: { - orbiterId: '' + id: '' } }); diff --git a/templates/init/juno.config.ts b/templates/init/juno.config.ts index 2d6141f..ee3b0b0 100644 --- a/templates/init/juno.config.ts +++ b/templates/init/juno.config.ts @@ -2,10 +2,10 @@ import {defineConfig} from '@junobuild/config'; export default defineConfig({ satellite: { - satelliteId: '', + id: '', source: '' }, orbiter: { - orbiterId: '' + id: '' } }); diff --git a/templates/init/juno.satellite.config.js b/templates/init/juno.satellite.config.js index 4b497dc..c6df828 100644 --- a/templates/init/juno.satellite.config.js +++ b/templates/init/juno.satellite.config.js @@ -3,7 +3,7 @@ import {defineConfig} from '@junobuild/config'; /** @type {import('@junobuild/config').JunoConfig} */ export default defineConfig({ satellite: { - satelliteId: '', + id: '', source: '' } }); diff --git a/templates/init/juno.satellite.config.ts b/templates/init/juno.satellite.config.ts index 82b0f87..9778f7b 100644 --- a/templates/init/juno.satellite.config.ts +++ b/templates/init/juno.satellite.config.ts @@ -2,7 +2,7 @@ import {defineConfig} from '@junobuild/config'; export default defineConfig({ satellite: { - satelliteId: '', + id: '', source: '' } });