@junobuild/cli-tools 0.2.0-next-2025-06-01 → 0.2.0-next-2025-06-02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/index.mjs +22 -22
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/commands/deploy.d.ts +1 -1
- package/dist/types/commands/upgrade.d.ts +28 -0
- package/dist/types/constants/deploy.constants.d.ts +2 -1
- package/dist/types/services/deploy.proposal.services.d.ts +10 -0
- package/dist/types/services/upload.services.d.ts +7 -0
- package/dist/types/types/deploy.d.ts +8 -1
- package/dist/types/types/upgrade.d.ts +2 -0
- package/package.json +1 -1
- package/dist/types/services/deploy.upload.services.d.ts +0 -6
|
@@ -70,7 +70,7 @@ export declare const deploy: ({ uploadFile, ...rest }: DeployParams) => Promise<
|
|
|
70
70
|
* - `{result: 'submitted', files, proposalId}` if the upload and proposal submission succeeded.
|
|
71
71
|
* - `{result: 'deployed', files, proposalId}` if the upload and proposal was applied automatically committed.
|
|
72
72
|
*/
|
|
73
|
-
export declare const deployWithProposal: ({ deploy: { uploadFile, ...rest }, proposal: { clearAssets,
|
|
73
|
+
export declare const deployWithProposal: ({ deploy: { uploadFile, ...rest }, proposal: { clearAssets, ...restProposal } }: {
|
|
74
74
|
deploy: DeployParams<UploadFileWithProposal>;
|
|
75
75
|
proposal: Pick<ProposeChangesParams, "cdn" | "autoCommit"> & {
|
|
76
76
|
clearAssets?: boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DeployResultWithProposal } from '../types/deploy';
|
|
2
|
+
import type { ProposeChangesParams } from '../types/proposal';
|
|
3
|
+
import type { DeploySatelliteWasmParams } from '../types/upgrade';
|
|
4
|
+
/**
|
|
5
|
+
* Uploads a Satellite WASM file to the CDN as part of a proposal-based deployment.
|
|
6
|
+
*
|
|
7
|
+
* This function performs a memory check (if provided), packages the WASM file,
|
|
8
|
+
* uploads it to the CDN, and submits a proposal for deployment.
|
|
9
|
+
* Optionally, the proposal can be auto-committed if `autoCommit` is true.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} options - The deployment and proposal configuration.
|
|
12
|
+
* @param {DeploySatelliteWasmParams} options.deploy - Deployment parameters including the upload function, memory assertion, and file paths.
|
|
13
|
+
* @param {Object} options.proposal - Proposal options.
|
|
14
|
+
* @param {CdnParameters} options.proposal.cdn - CDN and governance configuration.
|
|
15
|
+
* @param {boolean} options.proposal.autoCommit - If `true`, the proposal is automatically committed after submission.
|
|
16
|
+
* @param {string} options.proposal.version - The Satellite version to include in the proposal.
|
|
17
|
+
*
|
|
18
|
+
* @returns {Promise<DeployResultWithProposal>} A result object describing the outcome:
|
|
19
|
+
* - `{ result: 'skipped' }` – No files were found to upload.
|
|
20
|
+
* - `{ result: 'submitted', files, proposalId }` – Upload and proposal submission succeeded.
|
|
21
|
+
* - `{ result: 'deployed', files, proposalId }` – Upload succeeded and proposal was auto-committed.
|
|
22
|
+
*/
|
|
23
|
+
export declare const deploySatelliteWasmWithProposal: ({ deploy: { uploadFile, assertMemory, filePath, fullPath, token }, proposal: { version, ...restProposal } }: {
|
|
24
|
+
deploy: DeploySatelliteWasmParams;
|
|
25
|
+
proposal: Pick<ProposeChangesParams, "cdn" | "autoCommit"> & {
|
|
26
|
+
version: string;
|
|
27
|
+
};
|
|
28
|
+
}) => Promise<DeployResultWithProposal>;
|
|
@@ -3,5 +3,6 @@ export declare const DEPLOY_DEFAULT_IGNORE: never[];
|
|
|
3
3
|
export declare const DEPLOY_DEFAULT_ENCODING: never[];
|
|
4
4
|
export declare const DEPLOY_DEFAULT_GZIP = "**/*.+(css|js|mjs|html)";
|
|
5
5
|
export declare const IGNORE_OS_FILES: string[];
|
|
6
|
-
export declare const COLLECTION_DAPP = "#dapp";
|
|
7
6
|
export declare const UPLOAD_BATCH_SIZE = 20;
|
|
7
|
+
export declare const COLLECTION_DAPP = "#dapp";
|
|
8
|
+
export declare const COLLECTION_CDN = "#_juno";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { COLLECTION_CDN, COLLECTION_DAPP } from '../constants/deploy.constants';
|
|
2
|
+
import type { DeployParams, DeployResultWithProposal, FileAndPaths, UploadFileWithProposal } from '../types/deploy';
|
|
3
|
+
import type { ProposeChangesParams } from '../types/proposal';
|
|
4
|
+
export declare const deployAndProposeChanges: ({ deploy: { uploadFile, files, collection }, proposal: { proposalType, autoCommit, ...proposalRest } }: {
|
|
5
|
+
deploy: Pick<DeployParams<UploadFileWithProposal>, "uploadFile"> & {
|
|
6
|
+
files: FileAndPaths[];
|
|
7
|
+
collection: typeof COLLECTION_DAPP | typeof COLLECTION_CDN;
|
|
8
|
+
};
|
|
9
|
+
proposal: Omit<ProposeChangesParams, "executeChanges">;
|
|
10
|
+
}) => Promise<DeployResultWithProposal>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type COLLECTION_CDN, type COLLECTION_DAPP } from '../constants/deploy.constants';
|
|
2
|
+
import type { FileAndPaths, UploadFile } from '../types/deploy';
|
|
3
|
+
export declare const uploadFiles: ({ files: sourceFiles, uploadFile, collection }: {
|
|
4
|
+
files: FileAndPaths[];
|
|
5
|
+
uploadFile: UploadFile;
|
|
6
|
+
collection: typeof COLLECTION_DAPP | typeof COLLECTION_CDN;
|
|
7
|
+
}) => Promise<void>;
|
|
@@ -2,11 +2,18 @@ import type { CliConfig, ENCODING_TYPE } from '@junobuild/config';
|
|
|
2
2
|
import type { Blob } from 'buffer';
|
|
3
3
|
export type MimeType = string;
|
|
4
4
|
export type FileExtension = string;
|
|
5
|
-
export
|
|
5
|
+
export type FileDetails = Pick<UploadFileStorage, 'token'> & {
|
|
6
6
|
file: string;
|
|
7
7
|
alternateFile?: string;
|
|
8
8
|
encoding?: ENCODING_TYPE;
|
|
9
9
|
mime?: MimeType;
|
|
10
|
+
};
|
|
11
|
+
export type FilePaths = Required<Pick<UploadFileStorage, 'fullPath'>> & {
|
|
12
|
+
filePath: string;
|
|
13
|
+
};
|
|
14
|
+
export interface FileAndPaths {
|
|
15
|
+
file: FileDetails;
|
|
16
|
+
paths: FilePaths;
|
|
10
17
|
}
|
|
11
18
|
export interface AssetEncoding {
|
|
12
19
|
sha256: string;
|
package/package.json
CHANGED