Skip to content

Commit

Permalink
Merge pull request #66 from prismicio/dani/repeatable-links
Browse files Browse the repository at this point in the history
feat: support repeatable links
  • Loading branch information
dani-mp authored Dec 5, 2024
2 parents f4395ed + bed71b8 commit 1c682dd
Show file tree
Hide file tree
Showing 6 changed files with 1,646 additions and 1,566 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.1.23-alpha.3](https://github.com/prismicio/prismic-ts-codegen/compare/v0.1.23-alpha.2...v0.1.23-alpha.3) (2024-11-29)

### [0.1.23-alpha.2](https://github.com/prismicio/prismic-ts-codegen/compare/v0.1.23-alpha.1...v0.1.23-alpha.2) (2024-11-28)

### [0.1.23-alpha.1](https://github.com/prismicio/prismic-ts-codegen/compare/v0.1.22...v0.1.23-alpha.1) (2024-11-28)


### Chore

* **release:** 0.1.23-alpha.0 ([f93b65e](https://github.com/prismicio/prismic-ts-codegen/commit/f93b65ea34067466010566eddc59642007033825))

### [0.1.23-alpha.0](https://github.com/prismicio/prismic-ts-codegen/compare/v0.1.22...v0.1.23-alpha.0) (2024-11-11)

### [0.1.22](https://github.com/prismicio/prismic-ts-codegen/compare/v0.1.21...v0.1.22) (2024-09-24)


Expand Down
33 changes: 17 additions & 16 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prismic-ts-codegen",
"version": "0.1.22",
"version": "0.1.23-alpha.3",
"description": "An experimental Prismic model-to-TypeScript-type generator",
"keywords": [
"typescript",
Expand Down Expand Up @@ -60,8 +60,8 @@
"quick-lru": "^6.1.1"
},
"devDependencies": {
"@prismicio/client": "^7.10.1",
"@prismicio/mock": "^0.3.7",
"@prismicio/client": "7.13.0",
"@prismicio/mock": "0.5.0",
"@size-limit/preset-small-lib": "^8.2.6",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/common-tags": "^1.8.1",
Expand Down
7 changes: 5 additions & 2 deletions src/lib/buildFieldProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,15 @@ function buildFieldProperty(

case "media": {
code = addLine(`${name}: prismic.LinkToMediaField;`, code);

break;
}

default: {
code = addLine(`${name}: prismic.LinkField;`, code);
const type = args.field.config?.repeat
? "prismic.Repeatable<prismic.LinkField>"
: "prismic.LinkField";
code = addLine(`${name}: ${type};`, code);
break;
}
}

Expand Down
Loading

0 comments on commit 1c682dd

Please sign in to comment.