diff --git a/cli/commands/install-local.ts b/cli/commands/install-local.ts index 7b4a8629..49575711 100644 --- a/cli/commands/install-local.ts +++ b/cli/commands/install-local.ts @@ -5,11 +5,12 @@ import {installFromGithub} from '../vessel.js'; import {install} from './install.js'; // skip install and just find non-local dependencies to install -// pkgPath should be relative to the current root dir +// pkgPath should be relative to the current root dir or absolute export async function installLocal(pkg: string, pkgPath = '', {verbose = false, silent = false} = {}): Promise | false> { if (!checkConfigFile()) { return false; } + console.log(pkg, pkgPath) let logUpdate = createLogUpdate(process.stdout, {showCursor: true}); @@ -24,7 +25,8 @@ export async function installLocal(pkg: string, pkgPath = '', {verbose = false, // install dependencies let ok = true; - let dir = path.resolve(getRootDir(), pkgPath); + let rootDir = getRootDir(); + let dir = path.resolve(rootDir, pkgPath); let config = readConfig(path.join(dir, 'mops.toml')); let deps = Object.values(config.dependencies || {}); let installedDeps = {}; @@ -33,7 +35,7 @@ export async function installLocal(pkg: string, pkgPath = '', {verbose = false, await installFromGithub(name, repo, {silent, verbose}); } else { - let res = await (depPath ? installLocal(name, depPath, {silent, verbose}) : install(name, version, {silent, verbose})); + let res = await (depPath ? installLocal(name, path.resolve(pkgPath, depPath), {silent, verbose}) : install(name, version, {silent, verbose})); if (res) { installedDeps = {...installedDeps, ...res}; } diff --git a/cli/declarations/main/main.did b/cli/declarations/main/main.did index d4af9224..5eadac22 100644 --- a/cli/declarations/main/main.did +++ b/cli/declarations/main/main.did @@ -24,11 +24,6 @@ type User = twitter: text; twitterVerified: bool; }; -type TransformArg = - record { - context: vec nat8; - response: HttpResponse; - }; type Time = int; type Text = text; type TestsChanges = @@ -344,14 +339,19 @@ type Main = startFileUpload: (PublishingId, Text, nat, blob) -> (Result_3); startPublish: (PackageConfigV2) -> (Result_2); transferOwnership: (PackageName, principal) -> (Result_1); - transformRequest: (TransformArg) -> (HttpResponse) query; + transformRequest: (HttpTransformArg) -> (HttpResponse) query; uploadFileChunk: (PublishingId, FileId, nat, blob) -> (Result); uploadNotes: (PublishingId, text) -> (Result); uploadTestStats: (PublishingId, TestStats) -> (Result); }; +type HttpTransformArg = + record { + context: blob; + response: HttpResponse; + }; type HttpResponse = record { - body: vec nat8; + body: blob; headers: vec HttpHeader; status: nat; }; diff --git a/cli/declarations/main/main.did.d.ts b/cli/declarations/main/main.did.d.ts index 231bcb8f..04f6e426 100644 --- a/cli/declarations/main/main.did.d.ts +++ b/cli/declarations/main/main.did.d.ts @@ -33,6 +33,10 @@ export interface HttpResponse { 'body' : Uint8Array | number[], 'headers' : Array, } +export interface HttpTransformArg { + 'context' : Uint8Array | number[], + 'response' : HttpResponse, +} export interface Main { 'backup' : ActorMethod<[], undefined>, 'computeHashesForExistingFiles' : ActorMethod<[], undefined>, @@ -96,7 +100,7 @@ export interface Main { >, 'startPublish' : ActorMethod<[PackageConfigV2], Result_2>, 'transferOwnership' : ActorMethod<[PackageName, Principal], Result_1>, - 'transformRequest' : ActorMethod<[TransformArg], HttpResponse>, + 'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>, 'uploadFileChunk' : ActorMethod< [PublishingId, FileId, bigint, Uint8Array | number[]], Result @@ -296,10 +300,6 @@ export interface TestsChanges { } export type Text = string; export type Time = bigint; -export interface TransformArg { - 'context' : Uint8Array | number[], - 'response' : HttpResponse, -} export interface User { 'id' : Principal, 'emailVerified' : boolean, diff --git a/cli/declarations/main/main.did.js b/cli/declarations/main/main.did.js index 7b91276b..c1577558 100644 --- a/cli/declarations/main/main.did.js +++ b/cli/declarations/main/main.did.js @@ -251,7 +251,7 @@ export const idlFactory = ({ IDL }) => { 'body' : IDL.Vec(IDL.Nat8), 'headers' : IDL.Vec(HttpHeader), }); - const TransformArg = IDL.Record({ + const HttpTransformArg = IDL.Record({ 'context' : IDL.Vec(IDL.Nat8), 'response' : HttpResponse, }); @@ -360,7 +360,11 @@ export const idlFactory = ({ IDL }) => { [Result_1], [], ), - 'transformRequest' : IDL.Func([TransformArg], [HttpResponse], ['query']), + 'transformRequest' : IDL.Func( + [HttpTransformArg], + [HttpResponse], + ['query'], + ), 'uploadFileChunk' : IDL.Func( [PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)], [Result], diff --git a/frontend/declarations/main/main.did b/frontend/declarations/main/main.did index d4af9224..5eadac22 100644 --- a/frontend/declarations/main/main.did +++ b/frontend/declarations/main/main.did @@ -24,11 +24,6 @@ type User = twitter: text; twitterVerified: bool; }; -type TransformArg = - record { - context: vec nat8; - response: HttpResponse; - }; type Time = int; type Text = text; type TestsChanges = @@ -344,14 +339,19 @@ type Main = startFileUpload: (PublishingId, Text, nat, blob) -> (Result_3); startPublish: (PackageConfigV2) -> (Result_2); transferOwnership: (PackageName, principal) -> (Result_1); - transformRequest: (TransformArg) -> (HttpResponse) query; + transformRequest: (HttpTransformArg) -> (HttpResponse) query; uploadFileChunk: (PublishingId, FileId, nat, blob) -> (Result); uploadNotes: (PublishingId, text) -> (Result); uploadTestStats: (PublishingId, TestStats) -> (Result); }; +type HttpTransformArg = + record { + context: blob; + response: HttpResponse; + }; type HttpResponse = record { - body: vec nat8; + body: blob; headers: vec HttpHeader; status: nat; }; diff --git a/frontend/declarations/main/main.did.d.ts b/frontend/declarations/main/main.did.d.ts index 231bcb8f..04f6e426 100644 --- a/frontend/declarations/main/main.did.d.ts +++ b/frontend/declarations/main/main.did.d.ts @@ -33,6 +33,10 @@ export interface HttpResponse { 'body' : Uint8Array | number[], 'headers' : Array, } +export interface HttpTransformArg { + 'context' : Uint8Array | number[], + 'response' : HttpResponse, +} export interface Main { 'backup' : ActorMethod<[], undefined>, 'computeHashesForExistingFiles' : ActorMethod<[], undefined>, @@ -96,7 +100,7 @@ export interface Main { >, 'startPublish' : ActorMethod<[PackageConfigV2], Result_2>, 'transferOwnership' : ActorMethod<[PackageName, Principal], Result_1>, - 'transformRequest' : ActorMethod<[TransformArg], HttpResponse>, + 'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>, 'uploadFileChunk' : ActorMethod< [PublishingId, FileId, bigint, Uint8Array | number[]], Result @@ -296,10 +300,6 @@ export interface TestsChanges { } export type Text = string; export type Time = bigint; -export interface TransformArg { - 'context' : Uint8Array | number[], - 'response' : HttpResponse, -} export interface User { 'id' : Principal, 'emailVerified' : boolean, diff --git a/frontend/declarations/main/main.did.js b/frontend/declarations/main/main.did.js index 7b91276b..c1577558 100644 --- a/frontend/declarations/main/main.did.js +++ b/frontend/declarations/main/main.did.js @@ -251,7 +251,7 @@ export const idlFactory = ({ IDL }) => { 'body' : IDL.Vec(IDL.Nat8), 'headers' : IDL.Vec(HttpHeader), }); - const TransformArg = IDL.Record({ + const HttpTransformArg = IDL.Record({ 'context' : IDL.Vec(IDL.Nat8), 'response' : HttpResponse, }); @@ -360,7 +360,11 @@ export const idlFactory = ({ IDL }) => { [Result_1], [], ), - 'transformRequest' : IDL.Func([TransformArg], [HttpResponse], ['query']), + 'transformRequest' : IDL.Func( + [HttpTransformArg], + [HttpResponse], + ['query'], + ), 'uploadFileChunk' : IDL.Func( [PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)], [Result], diff --git a/test/.flat/aaa/mops.toml b/test/.flat/aaa/mops.toml index dd6cabec..cbb949bd 100644 --- a/test/.flat/aaa/mops.toml +++ b/test/.flat/aaa/mops.toml @@ -2,6 +2,5 @@ name = "aaa" version = "0.1.0" description = "asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd " -repository = "repo aaa" keywords = [ "test", "cli", "data" ] files = [ "test.mo" ] \ No newline at end of file