Skip to content

Commit

Permalink
Update prettier dependency for JS renderers (#176)
Browse files Browse the repository at this point in the history
* Update prettier

* Add changeset

* Format Kinobi code itself
  • Loading branch information
lorisleiva authored Mar 19, 2024
1 parent 47207e9 commit 50b63f7
Show file tree
Hide file tree
Showing 107 changed files with 998 additions and 938 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-sheep-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@metaplex-foundation/kinobi": patch
---

Update prettier dependency for JS renderers
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.njk
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@
"vercel": "^28.16.2"
},
"dependencies": {
"@noble/hashes": "^1.1.5",
"@solana/codecs-strings": "2.0.0-experimental.a157265",
"@noble/hashes": "^1.4.0",
"@prettier/sync": "^0.5.1",
"@solana/codecs-strings": "2.0.0-preview.1",
"chalk": "^4.0.0",
"json-stable-stringify": "^1.1.0",
"nunjucks": "^3.2.3",
"prettier": "^2.8.1"
"json-stable-stringify": "^1.1.1",
"nunjucks": "^3.2.4",
"prettier": "^3.2.5"
},
"ava": {
"files": [
Expand Down
109 changes: 77 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/idl/IdlType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const IDL_TYPE_LEAVES = [
'f32',
'f64',
] as const;
export type IdlTypeLeaf = typeof IDL_TYPE_LEAVES[number];
export type IdlTypeLeaf = (typeof IDL_TYPE_LEAVES)[number];

export type IdlTypeUnsignedInteger = 'u8' | 'u16' | 'u32' | 'u64' | 'u128';
export type IdlTypeSignedInteger = 'i8' | 'i16' | 'i32' | 'i64' | 'i128';
Expand Down
8 changes: 4 additions & 4 deletions src/nodes/contextualValueNodes/ContextualValueNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS = getNodeKinds(
STANDALONE_CONTEXTUAL_VALUE_NODES
);
export type StandaloneContextualValueNodeKind =
typeof STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS[number];
(typeof STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS)[number];
export type StandaloneContextualValueNode =
typeof STANDALONE_CONTEXTUAL_VALUE_NODES[StandaloneContextualValueNodeKind];
(typeof STANDALONE_CONTEXTUAL_VALUE_NODES)[StandaloneContextualValueNodeKind];

// Contextual Value Node Registration.

Expand All @@ -47,9 +47,9 @@ export const REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS = getNodeKinds(
REGISTERED_CONTEXTUAL_VALUE_NODES
);
export type RegisteredContextualValueNodeKind =
typeof REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS[number];
(typeof REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS)[number];
export type RegisteredContextualValueNode =
typeof REGISTERED_CONTEXTUAL_VALUE_NODES[RegisteredContextualValueNodeKind];
(typeof REGISTERED_CONTEXTUAL_VALUE_NODES)[RegisteredContextualValueNodeKind];

// Contextual Value Node Helpers.

Expand Down
4 changes: 2 additions & 2 deletions src/nodes/discriminatorNodes/DiscriminatorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const REGISTERED_DISCRIMINATOR_NODE_KINDS = getNodeKinds(
REGISTERED_DISCRIMINATOR_NODES
);
export type RegisteredDiscriminatorNodeKind =
typeof REGISTERED_DISCRIMINATOR_NODE_KINDS[number];
(typeof REGISTERED_DISCRIMINATOR_NODE_KINDS)[number];
export type RegisteredDiscriminatorNode =
typeof REGISTERED_DISCRIMINATOR_NODES[RegisteredDiscriminatorNodeKind];
(typeof REGISTERED_DISCRIMINATOR_NODES)[RegisteredDiscriminatorNodeKind];

// Discriminator Node Helpers.

Expand Down
5 changes: 3 additions & 2 deletions src/nodes/linkNodes/LinkNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ export const REGISTERED_LINK_NODES = {
};

export const REGISTERED_LINK_NODE_KINDS = getNodeKinds(REGISTERED_LINK_NODES);
export type RegisteredLinkNodeKind = typeof REGISTERED_LINK_NODE_KINDS[number];
export type RegisteredLinkNodeKind =
(typeof REGISTERED_LINK_NODE_KINDS)[number];
export type RegisteredLinkNode =
typeof REGISTERED_LINK_NODES[RegisteredLinkNodeKind];
(typeof REGISTERED_LINK_NODES)[RegisteredLinkNodeKind];

// Link Node Helpers.

Expand Down
4 changes: 2 additions & 2 deletions src/nodes/pdaSeedNodes/PdaSeedNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const REGISTERED_PDA_SEED_NODE_KINDS = getNodeKinds(
REGISTERED_PDA_SEED_NODES
);
export type RegisteredPdaSeedNodeKind =
typeof REGISTERED_PDA_SEED_NODE_KINDS[number];
(typeof REGISTERED_PDA_SEED_NODE_KINDS)[number];
export type RegisteredPdaSeedNode =
typeof REGISTERED_PDA_SEED_NODES[RegisteredPdaSeedNodeKind];
(typeof REGISTERED_PDA_SEED_NODES)[RegisteredPdaSeedNodeKind];

// Pda Seed Node Helpers.

Expand Down
5 changes: 3 additions & 2 deletions src/nodes/sizeNodes/SizeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export const REGISTERED_SIZE_NODES = {
};

export const REGISTERED_SIZE_NODE_KINDS = getNodeKinds(REGISTERED_SIZE_NODES);
export type RegisteredSizeNodeKind = typeof REGISTERED_SIZE_NODE_KINDS[number];
export type RegisteredSizeNodeKind =
(typeof REGISTERED_SIZE_NODE_KINDS)[number];
export type RegisteredSizeNode =
typeof REGISTERED_SIZE_NODES[RegisteredSizeNodeKind];
(typeof REGISTERED_SIZE_NODES)[RegisteredSizeNodeKind];

// Size Node Helpers.

Expand Down
12 changes: 7 additions & 5 deletions src/nodes/typeNodes/TypeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ export const STANDALONE_TYPE_NODES = {
};

export const STANDALONE_TYPE_NODE_KINDS = getNodeKinds(STANDALONE_TYPE_NODES);
export type StandaloneTypeNodeKind = typeof STANDALONE_TYPE_NODE_KINDS[number];
export type StandaloneTypeNodeKind =
(typeof STANDALONE_TYPE_NODE_KINDS)[number];
export type StandaloneTypeNode =
typeof STANDALONE_TYPE_NODES[StandaloneTypeNodeKind];
(typeof STANDALONE_TYPE_NODES)[StandaloneTypeNodeKind];

// Type Node Registration.

Expand All @@ -63,9 +64,10 @@ export const REGISTERED_TYPE_NODES = {
};

export const REGISTERED_TYPE_NODE_KINDS = getNodeKinds(REGISTERED_TYPE_NODES);
export type RegisteredTypeNodeKind = typeof REGISTERED_TYPE_NODE_KINDS[number];
export type RegisteredTypeNodeKind =
(typeof REGISTERED_TYPE_NODE_KINDS)[number];
export type RegisteredTypeNode =
typeof REGISTERED_TYPE_NODES[RegisteredTypeNodeKind];
(typeof REGISTERED_TYPE_NODES)[RegisteredTypeNodeKind];

// Type Node Helpers.
// This only includes type nodes that can be used as standalone types.
Expand All @@ -76,7 +78,7 @@ export const TYPE_NODES = [
...STANDALONE_TYPE_NODE_KINDS,
'definedTypeLinkNode' as const,
];
export type TypeNodeKind = typeof TYPE_NODES[number];
export type TypeNodeKind = (typeof TYPE_NODES)[number];
export type TypeNode = StandaloneTypeNode | DefinedTypeLinkNode;

function isArrayOfSize(array: any, size: number): boolean {
Expand Down
8 changes: 4 additions & 4 deletions src/nodes/valueNodes/ValueNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const STANDALONE_VALUE_NODES = {

export const STANDALONE_VALUE_NODE_KINDS = getNodeKinds(STANDALONE_VALUE_NODES);
export type StandaloneValueNodeKind =
typeof STANDALONE_VALUE_NODE_KINDS[number];
(typeof STANDALONE_VALUE_NODE_KINDS)[number];
export type StandaloneValueNode =
typeof STANDALONE_VALUE_NODES[StandaloneValueNodeKind];
(typeof STANDALONE_VALUE_NODES)[StandaloneValueNodeKind];

// Value Node Registration.

Expand All @@ -49,9 +49,9 @@ export const REGISTERED_VALUE_NODES = {

export const REGISTERED_VALUE_NODE_KINDS = getNodeKinds(REGISTERED_VALUE_NODES);
export type RegisteredValueNodeKind =
typeof REGISTERED_VALUE_NODE_KINDS[number];
(typeof REGISTERED_VALUE_NODE_KINDS)[number];
export type RegisteredValueNode =
typeof REGISTERED_VALUE_NODES[RegisteredValueNodeKind];
(typeof REGISTERED_VALUE_NODES)[RegisteredValueNodeKind];

// Value Node Helpers.

Expand Down
Loading

0 comments on commit 50b63f7

Please sign in to comment.