Skip to content

Commit

Permalink
moldy/vocs migration (#1)
Browse files Browse the repository at this point in the history
* docs: migrate to using vocs

* docs: migrate the alchemy signer docs over

* docs: update the signer guides to vocs

* docs: migrate over the using smart accounts guides to vocs

* docs: migrate react hook docs to vocs

* docs: migrate choosing a smart account to vocs

* docs: migrate 3rd party to vocs

* docs: migrate extending smart accounts to vocs

* docs: migrate resources to vocs

* docs: add socials to vocs

* docs: add aa-core vocs

* docs: add aa-alchemy to vocs

* docs: add aa-accounts to vocs

* docs: add aa-signers to vocs

* docs: migrate aa-ethers to vocs

* docs: update core head options

* docs: clean up the themes in vocs

* docs: update the build pipeline for vocs

* docs: update all of the header fields

* docs: make the site build

* docs: apply lint and fix github actions

* chore: enable publishing site via workflow_dispatch
  • Loading branch information
moldy530 authored May 30, 2024
1 parent accb23b commit 6432d86
Show file tree
Hide file tree
Showing 343 changed files with 7,079 additions and 7,962 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down Expand Up @@ -68,16 +69,21 @@ jobs:
- name: Install dependencies
run: yarn

- name: Build with VitePress
- name: Build with Vocs
working-directory: site
run: |
yarn build
touch .vitepress/dist/.nojekyll
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 2
retry_on: error
command: |
yarn build
touch dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: site/.vitepress/dist
path: site/dist

# Deployment job
deploy:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ jobs:
run: yarn install --frozen-lockfile

- name: Build
uses: nick-fields/retry@v3
env:
API_KEY: ${{ secrets.API_KEY }}
run: yarn build
with:
timeout_minutes: 5
max_attempts: 2
retry_on: error
command: yarn build

- name: Unit Test
run: yarn test
15 changes: 10 additions & 5 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,21 @@ jobs:
API_KEY: ${{ secrets.API_KEY }}
run: yarn lerna publish --conventional-commits --no-private --yes --no-verify-access

- name: Build with VitePress
- name: Build with Vocs
working-directory: site
run: |
yarn build
touch .vitepress/dist/.nojekyll
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 2
retry_on: error
command: |
yarn build
touch dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: site/.vitepress/dist
path: site/dist

publish_site:
name: Publish Docs Site
Expand Down
4 changes: 2 additions & 2 deletions packages/accounts/src/light-account/accounts/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type LightAccount<
getOwnerAddress: () => Promise<Address>;
};

//#region CreateLightAccountParams
// [!region CreateLightAccountParams]
export type CreateLightAccountParams<
TTransport extends Transport = Transport,
TSigner extends SmartAccountSigner = SmartAccountSigner,
Expand All @@ -75,7 +75,7 @@ export type CreateLightAccountParams<
version?: TLightAccountVersion;
entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;
};
//#endregion CreateLightAccountParams
// [!endregion CreateLightAccountParams]

export async function createLightAccount<
TTransport extends Transport = Transport,
Expand Down
4 changes: 2 additions & 2 deletions packages/accounts/src/msca/account/multiOwnerAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type MultiOwnerModularAccount<
"0.6.0"
>;

// #region CreateMultiOwnerModularAccountParams
// [!region CreateMultiOwnerModularAccountParams]
export type CreateMultiOwnerModularAccountParams<
TTransport extends Transport = Transport,
TSigner extends SmartAccountSigner = SmartAccountSigner,
Expand All @@ -53,7 +53,7 @@ export type CreateMultiOwnerModularAccountParams<
owners?: Address[];
accountAddress?: Address;
} & EntryPointParameter<TEntryPointVersion, Chain>;
// #endregion CreateMultiOwnerModularAccountParams
// [!endregion CreateMultiOwnerModularAccountParams]

export async function createMultiOwnerModularAccount<
TTransport extends Transport = Transport,
Expand Down
4 changes: 2 additions & 2 deletions packages/alchemy/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type AlchemyAccountsConfig = {
};
};

// #region CreateConfigProps
// [!region CreateConfigProps]
export type Connection = ConnectionConfig & {
chain: Chain;
gasManagerConfig?: AlchemyGasManagerConfig;
Expand Down Expand Up @@ -86,6 +86,6 @@ export type CreateConfigProps = RpcConnectionConfig & {
>,
"connection"
>;
// #endregion CreateConfigProps
// [!endregion CreateConfigProps]

export type AlchemyClientState = StoredState;
4 changes: 2 additions & 2 deletions packages/alchemy/src/signer/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export type CredentialCreationOptionOverrides = {
publicKey?: Partial<CredentialCreationOptions["publicKey"]>;
} & Pick<CredentialCreationOptions, "signal">;

//#region User
// [!region User]
export type User = {
email?: string;
orgId: string;
userId: string;
address: Address;
credentialId?: string;
};
//#endregion User
// [!endregion User]

export type ExportWalletParams = {
iframeContainerId: string;
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/account/smartContractAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const isSmartAccountWithSigner = (
return "getSigner" in account;
};

//#region SmartContractAccount
// [!region SmartContractAccount]
export type SmartContractAccount<
Name extends string = string,
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
Expand All @@ -106,7 +106,7 @@ export type SmartContractAccount<
getEntryPoint: () => EntryPointDef<TEntryPointVersion>;
getImplementationAddress: () => Promise<NullAddress | Address>;
};
//#endregion SmartContractAccount
// [!endregion SmartContractAccount]

export interface AccountEntryPointRegistry<Name extends string = string>
extends EntryPointRegistryBase<
Expand All @@ -116,7 +116,7 @@ export interface AccountEntryPointRegistry<Name extends string = string>
"0.7.0": SmartContractAccount<Name, "0.7.0">;
}

//#region ToSmartContractAccountParams
// [!region ToSmartContractAccountParams]
export type ToSmartContractAccountParams<
Name extends string = string,
TTransport extends Transport = Transport,
Expand All @@ -136,7 +136,7 @@ export type ToSmartContractAccountParams<
signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;
encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;
} & Omit<CustomSource, "signTransaction" | "address">;
//#endregion ToSmartContractAccountParams
// [!endregion ToSmartContractAccountParams]

export const parseFactoryAddressFromAccountInitCode = (
initCode: Hex
Expand Down Expand Up @@ -192,7 +192,7 @@ export const getAccountAddress = async ({
throw new GetCounterFactualAddressError();
};

//#region toSmartContractAccount
// [!region toSmartContractAccount]
export async function toSmartContractAccount<
Name extends string = string,
TTransport extends Transport = Transport,
Expand All @@ -218,7 +218,7 @@ export async function toSmartContractAccount<
TChain,
TEntryPointVersion
>): Promise<SmartContractAccount<Name, TEntryPointVersion>>;
//#endregion toSmartContractAccount
// [!endregion toSmartContractAccount]

export async function toSmartContractAccount({
transport,
Expand Down
44 changes: 22 additions & 22 deletions packages/core/src/actions/smartAccount/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
} from "../../types";
import type { IsUndefined } from "../../utils";

//#region UpgradeAccountParams
// [!region UpgradeAccountParams]
export type UpgradeAccountParams<
TAccount extends SmartContractAccount | undefined,
TContext extends UserOperationContext | undefined =
Expand All @@ -28,9 +28,9 @@ export type UpgradeAccountParams<
} & GetAccountParameter<TAccount> &
GetContextParameter<TContext> &
UserOperationOverridesParameter<TEntryPointVersion>;
//#endregion UpgradeAccountParams
// [!endregion UpgradeAccountParams]

//#region SendUserOperationParameters
// [!region SendUserOperationParameters]
export type SendUserOperationParameters<
TAccount extends SmartContractAccount | undefined,
TContext extends UserOperationContext | undefined =
Expand All @@ -42,19 +42,19 @@ export type SendUserOperationParameters<
} & GetAccountParameter<TAccount> &
GetContextParameter<TContext> &
UserOperationOverridesParameter<TEntryPointVersion>;
//#endregion SendUserOperationParameters
// [!endregion SendUserOperationParameters]

//#region BuildUserOperationParameters
// [!region BuildUserOperationParameters]
export type BuildUserOperationParameters<
TAccount extends SmartContractAccount | undefined,
TContext extends UserOperationContext | undefined =
| UserOperationContext
| undefined,
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
> = SendUserOperationParameters<TAccount, TContext, TEntryPointVersion>;
//#endregion BuildUserOperationParameters
// [!endregion BuildUserOperationParameters]

//#region SignUserOperationParameters
// [!region SignUserOperationParameters]
export type SignUserOperationParameters<
TAccount extends SmartContractAccount | undefined =
| SmartContractAccount
Expand All @@ -67,9 +67,9 @@ export type SignUserOperationParameters<
uoStruct: UserOperationStruct<TEntryPointVersion>;
} & GetAccountParameter<TAccount> &
GetContextParameter<TContext>;
//#endregion SignUserOperationParameters
// [!endregion SignUserOperationParameters]

//#region SendTransactionsParameters
// [!region SendTransactionsParameters]
export type SendTransactionsParameters<
TAccount extends SmartContractAccount | undefined,
TContext extends UserOperationContext | undefined =
Expand All @@ -81,19 +81,19 @@ export type SendTransactionsParameters<
} & GetAccountParameter<TAccount> &
GetContextParameter<TContext> &
UserOperationOverridesParameter<TEntryPointVersion>;
//#endregion SendTransactionsParameters
// [!endregion SendTransactionsParameters]

//#region BuildTransactionParameters
// [!region BuildTransactionParameters]
export type BuildTransactionParameters<
TAccount extends SmartContractAccount | undefined,
TContext extends UserOperationContext | undefined =
| UserOperationContext
| undefined,
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
> = SendTransactionsParameters<TAccount, TContext, TEntryPointVersion>;
//#endregion BuildTransactionParameters
// [!endregion BuildTransactionParameters]

//#region DropAndReplaceUserOperationParameters
// [!region DropAndReplaceUserOperationParameters]
export type DropAndReplaceUserOperationParameters<
TAccount extends SmartContractAccount | undefined,
TContext extends UserOperationContext | undefined =
Expand All @@ -105,9 +105,9 @@ export type DropAndReplaceUserOperationParameters<
} & GetAccountParameter<TAccount> &
GetContextParameter<TContext> &
UserOperationOverridesParameter<TEntryPointVersion>;
//#endregion DropAndReplaceUserOperationParameters
// [!endregion DropAndReplaceUserOperationParameters]

//#region WaitForUserOperationTxParameters
// [!region WaitForUserOperationTxParameters]
export type WaitForUserOperationTxParameters = {
hash: Hex;
/**
Expand All @@ -130,22 +130,22 @@ export type WaitForUserOperationTxParameters = {
maxRetries: number;
};
};
//#endregion WaitForUserOperationTxParameters
// [!endregion WaitForUserOperationTxParameters]

//#region BuildUserOperationFromTransactionsResult
// [!region BuildUserOperationFromTransactionsResult]
export type BuildUserOperationFromTransactionsResult<
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
> = {
uoStruct: UserOperationStruct<TEntryPointVersion>;
batch: BatchUserOperationCallData;
} & UserOperationOverridesParameter<TEntryPointVersion, true>;
//#endregion BuildUserOperationFromTransactionsResult
// [!endregion BuildUserOperationFromTransactionsResult]

//#region UserOperationContext
// [!region UserOperationContext]
export type UserOperationContext = Record<string, any>;
//#endregion UserOperationContext
// [!endregion UserOperationContext]

//#region GetContextParameter
// [!region GetContextParameter]
export type GetContextParameter<
TContext extends UserOperationContext | undefined =
| UserOperationContext
Expand All @@ -155,4 +155,4 @@ export type GetContextParameter<
context?: TContext;
}
: { context: TContext };
//#endregion GetContextParameter
// [!endregion GetContextParameter]
4 changes: 2 additions & 2 deletions packages/core/src/client/bundlerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
type BundlerRpcSchema,
} from "./decorators/bundlerClient.js";

//#region BundlerClient
// [!region BundlerClient]
export type BundlerClient<T extends Transport = Transport> = Client<
T,
Chain,
Expand All @@ -38,7 +38,7 @@ export const createBundlerClientFromExisting: <
): BundlerClient<T> => {
return client.extend(bundlerActions);
};
//#endregion BundlerClient
// [!endregion BundlerClient]

/**
* Creates a PublicClient with methods for calling Bundler RPC methods
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/client/decorators/bundlerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type BundlerRpcSchema = [
}
];

//#region BundlerActions
// [!region BundlerActions]
export type BundlerActions = {
/**
* calls `eth_estimateUserOperationGas` and returns the result
Expand Down Expand Up @@ -104,7 +104,7 @@ export type BundlerActions = {
*/
getSupportedEntryPoints(): Promise<Address[]>;
};
//#endregion BundlerActions
// [!endregion BundlerActions]

export const bundlerActions: <
TClient extends Client<
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/client/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const createPublicErc4337ClientSchema = <
);
});

// #region ConnectionConfigSchema
// [!region ConnectionConfigSchema]
export const ConnectionConfigSchema = z.union([
z.object({
rpcUrl: z.never().optional(),
Expand All @@ -41,7 +41,7 @@ export const ConnectionConfigSchema = z.union([
jwt: z.string(),
}),
]);
// #endregion ConnectionConfigSchema
// [!endregion ConnectionConfigSchema]

export const UserOperationFeeOptionsFieldSchema =
BigNumberishRangeSchema.merge(MultiplierSchema).partial();
Expand Down
Loading

0 comments on commit 6432d86

Please sign in to comment.