From 919654c4aa4f29287b09b914cdb7b75f88d0ac47 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 14:42:33 -0800 Subject: [PATCH 1/8] chpre: agent index linting fixes --- packages/agent/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 5d195a5e1..98608f635 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -15,6 +15,8 @@ export * from './utils/bls'; export * from './utils/buffer'; export * from './utils/random'; export * as polling from './polling'; +import * as CanisterStatus from './canisterStatus'; +export * as CanisterStatus from './canisterStatus'; /** * The CanisterStatus utility is used to request structured data directly from the IC public API. This data can be accessed using agent.readState, but CanisterStatus provides a helpful abstraction with some known paths. * @@ -22,7 +24,6 @@ export * as polling from './polling'; * * The primary method for this namespace is {@link CanisterStatus.request} */ -export * as CanisterStatus from './canisterStatus'; import { Agent, HttpAgent } from './agent'; import { IDL } from '@dfinity/candid'; @@ -37,7 +38,7 @@ export interface GlobalInternetComputer { /** * Simple advertisement of features in whoever is managing this `globalThis.ic`. * Use Case - * * Scripts that know they need an ic feature can detect using this and, if not present + * - Scripts that know they need an ic feature can detect using this and, if not present * (e.g. old bootstrap version), they can dynamically include their own and continue * operating (e.g. polyfill). * This is useful when adding features to bootstrap. You can still deploy your canister to From 353d986e0f09572aaea2098598e5eef55f37ea75 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 14:43:54 -0800 Subject: [PATCH 2/8] cypres acctor linting --- e2e/browser/cypress/utils/actor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/browser/cypress/utils/actor.js b/e2e/browser/cypress/utils/actor.js index 4de16925c..21a56a487 100644 --- a/e2e/browser/cypress/utils/actor.js +++ b/e2e/browser/cypress/utils/actor.js @@ -8,8 +8,8 @@ export { idlFactory } from '../../src/declarations/whoami/whoami.did.js'; /** * * @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent - * @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options] - * @return {import("@dfinity/agent").ActorSubclass} + * @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options] - Options for creating the actor + * @returns {import("@dfinity/agent").ActorSubclass} - Actor */ export const createActor = (canisterId, options) => { const agent = new HttpAgent({ ...options?.agentOptions }); From ba1726ee07c098b69a280a3d86e927f3cc1bf230 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 15:36:27 -0800 Subject: [PATCH 3/8] chore: db linting --- packages/auth-client/src/db.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/auth-client/src/db.ts b/packages/auth-client/src/db.ts index 1d258afce..a090ff86a 100644 --- a/packages/auth-client/src/db.ts +++ b/packages/auth-client/src/db.ts @@ -60,8 +60,7 @@ export type DBCreateOptions = { */ export class IdbKeyVal { /** - * - * @param {DBCreateOptions} options {@link DbCreateOptions} + * @param {DBCreateOptions} options - DBCreateOptions * @param {DBCreateOptions['dbName']} options.dbName name for the indexeddb database * @default * @param {DBCreateOptions['storeName']} options.storeName name for the indexeddb Data Store From 7c522fb58c3ee4c326ee5454124cd04006545fc9 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 15:47:17 -0800 Subject: [PATCH 4/8] chore: auth-client jsdoc lint --- packages/auth-client/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/auth-client/src/index.ts b/packages/auth-client/src/index.ts index d9fbff5b8..c285e4017 100644 --- a/packages/auth-client/src/index.ts +++ b/packages/auth-client/src/index.ts @@ -168,8 +168,8 @@ type AuthResponse = AuthResponseSuccess | AuthResponseFailure; export class AuthClient { /** * Create an AuthClient to manage authentication and identity - * @constructs {@link AuthClient} - * @param {AuthClientCreateOptions} options + * @constructs + * @param {AuthClientCreateOptions} options - Options for creating an {@link AuthClient} * @see {@link AuthClientCreateOptions} * @param options.identity Optional Identity to use as the base * @see {@link SignIdentity} @@ -418,7 +418,7 @@ export class AuthClient { /** * AuthClient Login - * Opens up a new window to authenticate with Internet Identity - * @param {AuthClientLoginOptions} options + * @param {AuthClientLoginOptions} options - Options for logging in * @param options.identityProvider Identity provider * @param options.maxTimeToLive Expiration of the authentication in nanoseconds * @param options.derivationOrigin Origin for Identity Provider to use while generating the delegated identity From eda6a46c252c3bcf4eb0886c6837632c4713a50f Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 15:54:11 -0800 Subject: [PATCH 5/8] eslintignore --- e2e/node/.eslintignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 e2e/node/.eslintignore diff --git a/e2e/node/.eslintignore b/e2e/node/.eslintignore new file mode 100644 index 000000000..cbca8a5a4 --- /dev/null +++ b/e2e/node/.eslintignore @@ -0,0 +1,2 @@ +**/*.d.ts +**/*.js From 7bb8bfb26cb9f18994bb87ee69aeebc90c37f10d Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 15:55:07 -0800 Subject: [PATCH 6/8] chore: ecdsa undefined types --- packages/identity/src/identity/ecdsa.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/identity/src/identity/ecdsa.ts b/packages/identity/src/identity/ecdsa.ts index 42d386474..7eab21a0f 100644 --- a/packages/identity/src/identity/ecdsa.ts +++ b/packages/identity/src/identity/ecdsa.ts @@ -74,8 +74,8 @@ export class ECDSAKeyIdentity extends SignIdentity { /** * generates an identity from a public and private key. Please ensure that you are generating these keys securely and protect the user's private key - * @param keyPair a {@link CryptoKeyPair} - * @param subtleCrypto a {@link SubtleCrypto} interface in case one is not available globally + * @param keyPair a CryptoKeyPair + * @param subtleCrypto - a SubtleCrypto interface in case one is not available globally * @returns an {@link ECDSAKeyIdentity} */ public static async fromKeyPair( @@ -108,7 +108,7 @@ export class ECDSAKeyIdentity extends SignIdentity { /** * Return the internally-used key pair. - * @returns a {@link CryptoKeyPair} + * @returns a CryptoKeyPair */ public getKeyPair(): CryptoKeyPair { return this._keyPair; From 6d7275a7a429a216203afb732d2d267a7cf7ae44 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 16:00:54 -0800 Subject: [PATCH 7/8] stricter enforcement for lint CI --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cedd6d0c5..023e7168a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,4 +26,4 @@ jobs: node-version: ${{ matrix.node }} - run: npm install -g npm - run: npm install - - run: npm run lint --workspaces --if-present + - run: npm run lint --workspaces --if-present -- --max-warnings=0 From a179a085b3e001bbd9f02bd80ab53cdef4c67502 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 12 Jan 2024 16:01:12 -0800 Subject: [PATCH 8/8] changelog --- docs/generated/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/generated/changelog.html b/docs/generated/changelog.html index b60a5bfec..cc0ec2cfd 100644 --- a/docs/generated/changelog.html +++ b/docs/generated/changelog.html @@ -12,6 +12,7 @@

Agent-JS Changelog

Version x.x.x

    +
  • chore: cleaning up lint warnings
  • chore: cleans up github actions linting warnings
  • feat: replaces `secp256k1` npm package with `@noble/curves`
  • feat: enhances `.from` methods on public key classes to support unknown types, including PublicKey instances, ArrayBuffer-like objects, DER encoded public keys, and hex strings. Also introduces a new `bufFromBufLike` util