Skip to content
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

feat: support repeatable links #66

Merged
merged 14 commits into from
Dec 5, 2024
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
Loading