Skip to content

Update formatting rules and improve validation #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/.gitignore → .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
.DS_Store

17 changes: 12 additions & 5 deletions app/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ export const Header: FC<{ frontmatter: Frontmatter }> = ({ frontmatter }) => {
</div>
<div>
<b>Status</b>
<div>{frontmatter.ensip.status}</div>
<div>{frontmatter.status}</div>
</div>
<div>
<b>Created</b>
<div>{frontmatter.ensip.created}</div>
<div>
{frontmatter.created.toLocaleDateString('UTC', {
timeZone: 'UTC',
year: 'numeric',
month: 'long',
day: 'numeric',
})}
</div>
</div>
<div>
<b>
Author
{frontmatter.contributors.length > 1 ? 's' : ''}
{frontmatter.authors.length > 1 ? 's' : ''}
</b>
<ul>
{frontmatter.contributors.map((contributor, index) => {
return <li key={index}>{contributor}</li>;
{frontmatter.authors.map((author, index) => {
return <li key={index}>{author}</li>;
})}
</ul>
</div>
Expand Down
23 changes: 7 additions & 16 deletions app/src/specs/validateFrontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,11 @@ export type UnparsedFrontmatter = {
};
};

export type Frontmatter = {
description: string;
contributors: string[];
ensip: {
status: string;
created: string;
};
ignoredRules?: string[];
};
export type Frontmatter = z.infer<typeof FrontMatterZod>;

export const FrontMatterZod = z.object({
description: z.string().min(5).max(160),
contributors: z
authors: z
.array(
z
.string()
Expand All @@ -36,10 +28,8 @@ export const FrontMatterZod = z.object({
)
.min(1)
.max(10),
ensip: z.object({
status: z.enum(['draft', 'obsolete', 'final']),
created: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
}),
status: z.enum(['Draft', 'Obsolete', 'Final']),
created: z.date(),
ignoredRules: z.array(z.string()).optional(),
});

Expand All @@ -48,8 +38,9 @@ export const validateFrontmatter = (
directPath: string
): Frontmatter => {
try {
// @ts-ignore
const parsed = parseYaml(frontmatter.value as string) as Frontmatter;
const parsed = parseYaml(frontmatter.value as string, {
customTags: ['timestamp'],
}) as Frontmatter;

return FrontMatterZod.parse(parsed);
} catch (error) {
Expand Down
7 changes: 3 additions & 4 deletions ensips/1.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: Documentation of the basic ENS protocol (formerly EIP-137)
contributors:
authors:
- nick.eth
ensip:
created: '2016-04-04'
status: final
created: 2016-04-04
status: Final
ignoredRules: ["missing:copyright"]
---

Expand Down
11 changes: 5 additions & 6 deletions ensips/10.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: Provides a mechanism to support wildcard resolution of ENS names (formerly EIP-2544).
contributors:
authors:
- nick.eth
- 0age
ensip:
created: 2020-02-28
status: draft
created: 2020-02-28
status: Draft
---

# ENSIP-10: Wildcard Resolution
Expand Down Expand Up @@ -43,7 +42,7 @@ Let:

ENSIP-10-compliant ENS resolvers MAY implement the following function interface:

```
```solidity
interface ExtendedResolver {
function resolve(bytes calldata name, bytes calldata data) external view returns(bytes);
}
Expand Down Expand Up @@ -76,7 +75,7 @@ Also note that when wildcard resolution is in use (eg, `name != currentname`), c

### Pseudocode

```
```solidity
function getResolver(name) {
for(let currentname = name; currentname !== ''; currentname = parent(currentname)) {
const node = namehash(currentname);
Expand Down
7 changes: 3 additions & 4 deletions ensips/11.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: Introduces coinType for EVM compatible chains (amending ENSIP9).
contributors:
authors:
- matoken.eth
ensip:
status: draft
created: 2022-01-13
status: Draft
created: 2022-01-13
---

# ENSIP-11: EVM compatible Chain Address Resolution
Expand Down
7 changes: 3 additions & 4 deletions ensips/12.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: A standard for storage of the avatar text record in ENS.
contributors:
authors:
- nick.eth
- matoken.eth
ensip:
status: draft
created: 2022-01-18
status: Draft
created: 2022-01-18
---

# ENSIP-12: Avatar Text Records
Expand Down
7 changes: 3 additions & 4 deletions ensips/13.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
description: Using ENS Text Records to facilitate safer and more convenient signing operations.
contributors:
authors:
- wwhchung
- jwahdatehagh
- crydoteth
- sillytuna
- cyberpnkwin
ensip:
created: 2021-08-03
status: draft
created: 2021-08-03
status: Draft
ignoredRules: ["missing:specification"]
---

Expand Down
7 changes: 3 additions & 4 deletions ensips/14.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: Using the reveal secret as a way to have on chain information about the source of the registration
contributors:
authors:
- aslobodnik
- alexvandesande
ensip:
status: draft
created: 2021-02-07
status: Draft
created: 2021-02-07
ignoredRules: ["missing:motivation", "missing:copyright", "heading:user-referral-data", "heading:privacy-concerns", "heading:a-reverse-code-registry"]
---

Expand Down
7 changes: 3 additions & 4 deletions ensips/15.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: A standard for storage of the avatar text record in ENS.
contributors:
authors:
- adraffy
ensip:
status: draft
created: 2023-04-03
status: Draft
created: 2023-04-03
ignoredRules: ["heading:description-of-", "heading:derivation", "heading:appendix:-reference-specifications", "heading:appendix:-additional-resources", "heading:appendix:-validation-tests", "heading:annex:-beautification"]
---

Expand Down
7 changes: 3 additions & 4 deletions ensips/16.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: Allows metadata to be queried on EIP-3668 enabled names
contributors:
authors:
- jefflau
- makoto
ensip:
status: draft
created: 2022-09-22
status: Draft
created: 2022-09-22
ignoredRules: ["heading:implementation", "heading:open-items"]
---

Expand Down
7 changes: 3 additions & 4 deletions ensips/17.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: A standard for gasless DNS resolution in ENS.
contributors:
authors:
- nick.eth
ensip:
status: draft
created: 2024-02-09
status: Draft
created: 2024-02-09
---

# ENSIP-17: Gasless DNS Resolution
Expand Down
7 changes: 3 additions & 4 deletions ensips/18.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
description: A standard for profile information as text records in ENS
contributors:
authors:
- TateB
- adraffy
- galligan
ensip:
status: draft
created: 2023-08-02
status: Draft
created: 2023-08-02
---

# ENSIP-18: Profile Text Records
Expand Down
7 changes: 3 additions & 4 deletions ensips/19.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: Specifies reverse resolution in a cross-chain context
contributors:
authors:
- jefflau.eth
ensip:
status: draft
created: 2023-03-14
status: Draft
created: 2023-03-14
---

# ENSIP-19: EVM-chain Reverse Resolution
Expand Down
7 changes: 3 additions & 4 deletions ensips/2.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
description: Describes the hash registrar initially used to register ENS .eth domains (formerly EIP-162).
contributors:
authors:
- nick.eth
- avsa.eth
- maurelian
ensip:
created: '2016-10-25'
status: obsolete
created: 2016-10-25
status: Obsolete
ignoredRules: ["heading:prior-work"]
---

Expand Down
13 changes: 6 additions & 7 deletions ensips/3.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: Specifies a TLD, registrar, and resolver interface for reverse resolution of Ethereum addresses using ENS (formerly EIP-181).
contributors:
authors:
- nick.eth
ensip:
created: '2016-12-01'
status: final
created: 2016-12-01
status: Final
---

# ENSIP-3: Reverse Resolution
Expand Down Expand Up @@ -39,7 +38,7 @@ When called by account `x`, instructs the ENS registry to transfer ownership of

Allowing the caller to specify an owner other than themselves for the relevant node facilitates contracts that need accurate reverse ENS entries delegating this to their creators with a minimum of code inside their constructor:

```
```solidity
reverseRegistrar.claim(msg.sender)
```

Expand All @@ -55,7 +54,7 @@ When called by account `x`, sets the resolver for the name `hex(x) + '.addr.reve

A new resolver interface is defined, consisting of the following method:

```
```solidity
function name(bytes32 node) constant returns (string);
```

Expand All @@ -69,7 +68,7 @@ Future ENSIPs may specify more record types appropriate to reverse ENS records.

This registrar, written in Solidity, implements the specifications outlined above.

```
```solidity
pragma solidity ^0.4.10;

import "./AbstractENS.sol";
Expand Down
9 changes: 4 additions & 5 deletions ensips/4.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: A mechanism for storing ABI definitions in ENS, for easy lookup of contract interfaces by callers (formerly EIP-205).
contributors:
authors:
- nick.eth
ensip:
created: '2017-02-06'
status: final
created: 2017-02-06
status: Final
ignoredRules: ["missing:motivation"]
---

Expand Down Expand Up @@ -49,7 +48,7 @@ Encoding type 8 indicates that the ABI can be found elsewhere, at the specified

A new resolver interface is defined, consisting of the following method:

```
```solidity
function ABI(bytes32 node, uint256 contentType) constant returns (uint256, bytes);
```

Expand Down
7 changes: 3 additions & 4 deletions ensips/5.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: A standard for storage of text records in ENS (formerly EIP-634).
contributors:
authors:
- ricmoo.eth
ensip:
created: '2017-05-17'
status: final
created: 2017-05-17
status: Final
---

# ENSIP-5: Text Records
Expand Down
7 changes: 3 additions & 4 deletions ensips/6.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: Defines a resolver profile for ENS that provides features for storage and lookup of DNS records (formerly EIP-1185).
contributors:
authors:
- mcdee
ensip:
created: '2018-06-26'
status: obsolete
created: 2018-06-26
status: Obsolete
ignoredRules: ["heading:implementation", "heading:test-cases"]
---

Expand Down
7 changes: 3 additions & 4 deletions ensips/7.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: Introduces a field for storing content addresses and hashes in ENS (formerly EIP-1577).
contributors:
authors:
- nick.eth
- decanus
ensip:
created: '2018-11-13'
status: final
created: 2018-11-13
status: Final
---

# ENSIP-7: Contenthash field
Expand Down
Loading
Loading