Skip to content

Commit

Permalink
Updated prettier formatting in all packages, and formatted code (#360)
Browse files Browse the repository at this point in the history
fixed prettier checks in all projects.
formatted incorrectly formatted code
  • Loading branch information
oveddan authored Nov 15, 2023
1 parent ee86171 commit 8bf7356
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 19 deletions.
1 change: 1 addition & 0 deletions packages/protocol-deployments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build": "yarn wagmi && yarn bundle-configs && tsup",
"bundle-configs": "node script/bundle-chainConfigs.mjs && yarn prettier",
"prettier": "prettier --write 'package/**/*.ts' 'script/**/*.ts' 'wagmi.config.ts'",
"lint": "prettier --check 'package/**/*.ts' 'script/**/*.ts' 'wagmi.config.ts'",
"update-new-deployment-addresses": "node script/copy-deployed-contracts.mjs deploy",
"wagmi": "wagmi generate",
"unlink-protocol-rewards": "rm -rf ./node_modules/@zoralabs/protocol-rewards && cp -r ../protocol-rewards ./node_modules/@zoralabs/protocol-rewards",
Expand Down
1 change: 1 addition & 0 deletions packages/protocol-rewards/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/lib
2 changes: 1 addition & 1 deletion packages/protocol-rewards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:contracts": "forge build",
"prettier:check": "prettier --check 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'",
"prettier": "prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'",
"lint": "yarn run prettier"
"lint": "prettier --check 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'"
},
"dependencies": {
"ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b",
Expand Down
4 changes: 3 additions & 1 deletion packages/protocol-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"build": "tsup",
"prepack": "yarn build",
"test:js": "vitest src",
"generate-types": "npx openapi-typescript https://api.zora.co/premint/openapi.json -o src/generated/premint-api-types.ts && npx openapi-typescript https://api.zora.co/discover/openapi.json -o src/generated/discover-api-types.ts"
"generate-types": "npx openapi-typescript https://api.zora.co/premint/openapi.json -o src/generated/premint-api-types.ts && npx openapi-typescript https://api.zora.co/discover/openapi.json -o src/generated/discover-api-types.ts",
"prettier": "prettier --write 'src/**/*.ts'",
"lint": "prettier --check 'src/**/*.ts'"
},
"dependencies": {
"@zoralabs/protocol-deployments": "*",
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol-sdk/src/anvil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ async function waitForAnvilInit(anvil: any) {
}

export const anvilTest = test.extend<AnvilViemClientsTest>({
viemClients: async ({task}, use) => {
console.log('setting up clients for ', task.name);
viemClients: async ({ task }, use) => {
console.log("setting up clients for ", task.name);
const port = Math.floor(Math.random() * 2000) + 4000;
const anvil = spawn(
"anvil",
Expand Down
60 changes: 51 additions & 9 deletions packages/protocol-sdk/src/apis/generated/discover-api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Do not make direct changes to the file.
*/


export interface paths {
"/": {
/** Root */
Expand Down Expand Up @@ -148,7 +147,19 @@ export interface components {
* @description An enumeration.
* @enum {string}
*/
ChainName: "ETHEREUM-MAINNET" | "ETHEREUM-ROPSTEN" | "ETHEREUM-RINKEBY" | "ETHEREUM-GOERLI" | "ETHEREUM-SEPOLIA" | "OPTIMISM-MAINNET" | "OPTIMISM-GOERLI" | "ZORA-GOERLI" | "ZORA-MAINNET" | "BASE-MAINNET" | "BASE-GOERLI" | "PGN-MAINNET";
ChainName:
| "ETHEREUM-MAINNET"
| "ETHEREUM-ROPSTEN"
| "ETHEREUM-RINKEBY"
| "ETHEREUM-GOERLI"
| "ETHEREUM-SEPOLIA"
| "OPTIMISM-MAINNET"
| "OPTIMISM-GOERLI"
| "ZORA-GOERLI"
| "ZORA-MAINNET"
| "BASE-MAINNET"
| "BASE-GOERLI"
| "PGN-MAINNET";
/** Collection */
Collection: {
/** Address */
Expand Down Expand Up @@ -395,7 +406,12 @@ export interface components {
* @description An enumeration.
* @enum {string}
*/
FeedType: "curated" | "most_recent" | "heuristic" | "trending" | "recommendations";
FeedType:
| "curated"
| "most_recent"
| "heuristic"
| "trending"
| "recommendations";
/**
* FixedPrice
* @description ObjectBase extends Pydantic's BaseModel class to support extra functionality
Expand Down Expand Up @@ -691,7 +707,13 @@ export interface components {
/** Token Name */
token_name?: string;
/** Mint Context */
mint_context?: components["schemas"]["ManifoldMintContext"] | components["schemas"]["ZoraCreateMintContext"] | components["schemas"]["FoundationMintContext"] | components["schemas"]["ZoraCreate1155MintContext"] | components["schemas"]["ZoraCreatePremintContext"] | components["schemas"]["InferredMintContext"];
mint_context?:
| components["schemas"]["ManifoldMintContext"]
| components["schemas"]["ZoraCreateMintContext"]
| components["schemas"]["FoundationMintContext"]
| components["schemas"]["ZoraCreate1155MintContext"]
| components["schemas"]["ZoraCreatePremintContext"]
| components["schemas"]["InferredMintContext"];
/** Is Active */
is_active: boolean;
cost: components["schemas"]["zora__collect__feed__models__price_at_time__PriceAtTime"];
Expand Down Expand Up @@ -729,21 +751,40 @@ export interface components {
* @description An enumeration.
* @enum {string}
*/
MintableStatus: "ACTIVE" | "BLOCKED" | "EXPIRED" | "INVALID_MEDIA" | "MINTED_OUT" | "DELETED";
MintableStatus:
| "ACTIVE"
| "BLOCKED"
| "EXPIRED"
| "INVALID_MEDIA"
| "MINTED_OUT"
| "DELETED";
/**
* MintableType
* @description An enumeration.
* @enum {string}
*/
MintableType: "FOUNDATION_DROP_COLLECTION" | "FOUNDATION_TIMED_EDITION" | "MANIFOLD_ERC1155" | "MANIFOLD_ERC721" | "ZORA_CREATE" | "ZORA_CREATE_1155" | "ZORA_CREATE_1155_B2R_REDEEM_TOKEN" | "ZORA_CREATE_1155_PREMINT_TOKEN" | "ZORA_EDITION" | "ZORA_DROP" | "INFERRED";
MintableType:
| "FOUNDATION_DROP_COLLECTION"
| "FOUNDATION_TIMED_EDITION"
| "MANIFOLD_ERC1155"
| "MANIFOLD_ERC721"
| "ZORA_CREATE"
| "ZORA_CREATE_1155"
| "ZORA_CREATE_1155_B2R_REDEEM_TOKEN"
| "ZORA_CREATE_1155_PREMINT_TOKEN"
| "ZORA_EDITION"
| "ZORA_DROP"
| "INFERRED";
/**
* Network
* @description An enumeration.
* @enum {string}
*/
Network: "MAINNET" | "GOERLI";
/** Notification */
Notification: components["schemas"]["MintNotification"] | components["schemas"]["MintCommentNotification"];
Notification:
| components["schemas"]["MintNotification"]
| components["schemas"]["MintCommentNotification"];
/**
* NotificationsResponse
* @description This is a generic model for pagination in an infitite scrolling context.
Expand Down Expand Up @@ -911,7 +952,9 @@ export interface components {
description?: string;
entity_type: components["schemas"]["EntityType"];
/** Entity */
entity: components["schemas"]["SearchCollection"] | components["schemas"]["SearchToken"];
entity:
| components["schemas"]["SearchCollection"]
| components["schemas"]["SearchToken"];
media?: components["schemas"]["Media"];
/**
* Rank
Expand Down Expand Up @@ -1377,7 +1420,6 @@ export type $defs = Record<string, never>;
export type external = Record<string, never>;

export interface operations {

/** Root */
root__get: {
responses: {
Expand Down
16 changes: 13 additions & 3 deletions packages/protocol-sdk/src/apis/generated/premint-api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Do not make direct changes to the file.
*/


export interface paths {
"/signature": {
/** Upsert Premint Signature */
Expand Down Expand Up @@ -36,7 +35,19 @@ export interface components {
* @description An enumeration.
* @enum {string}
*/
ChainName: "ETHEREUM-MAINNET" | "ETHEREUM-ROPSTEN" | "ETHEREUM-RINKEBY" | "ETHEREUM-GOERLI" | "ETHEREUM-SEPOLIA" | "OPTIMISM-MAINNET" | "OPTIMISM-GOERLI" | "ZORA-GOERLI" | "ZORA-MAINNET" | "BASE-MAINNET" | "BASE-GOERLI" | "PGN-MAINNET";
ChainName:
| "ETHEREUM-MAINNET"
| "ETHEREUM-ROPSTEN"
| "ETHEREUM-RINKEBY"
| "ETHEREUM-GOERLI"
| "ETHEREUM-SEPOLIA"
| "OPTIMISM-MAINNET"
| "OPTIMISM-GOERLI"
| "ZORA-GOERLI"
| "ZORA-MAINNET"
| "BASE-MAINNET"
| "BASE-GOERLI"
| "PGN-MAINNET";
/**
* CollectionCreationConfig
* @description ObjectBase extends Pydantic's BaseModel class to support extra functionality
Expand Down Expand Up @@ -244,7 +255,6 @@ export type $defs = Record<string, never>;
export type external = Record<string, never>;

export interface operations {

/** Upsert Premint Signature */
upsert_premint_signature_signature_post: {
requestBody: {
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol-sdk/src/premint/premint-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class PremintClient extends ClientBase {
quantityToMint: number;
mintComment?: string;
};
}): Promise<{request: SimulateContractParameters}> {
}): Promise<{ request: SimulateContractParameters }> {
if (mintArguments && mintArguments?.quantityToMint < 1) {
throw new Error("Quantity to mint cannot be below 1");
}
Expand Down
9 changes: 8 additions & 1 deletion packages/protocol-sdk/src/premint/preminter.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { keccak256, Hex, concat, recoverAddress, hashDomain, Address } from "viem";
import {
keccak256,
Hex,
concat,
recoverAddress,
hashDomain,
Address,
} from "viem";
import { foundry } from "viem/chains";
import { describe, expect } from "vitest";
import { parseEther } from "viem";
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:fork": {
"dependsOn": ["^test:fork"]
},
"format": {
"prettier": {
"dependsOn": ["^prettier"]
},
"storage-inspect:check": {
Expand Down

0 comments on commit 8bf7356

Please sign in to comment.