Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: "pnpm"

- name: 📥 Download deps
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: "pnpm"

- name: 📥 Download deps
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: "pnpm"

- name: 🏄 Copy example env vars to nextjs app
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: "pnpm"

# - name: 🏄 Copy test env vars
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: ⎔ Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: "pnpm"

- name: 📥 Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion apps/ghost-blog-buster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@ts-ghost/tsconfig": "workspace:*",
"@types/configstore": "^6.0.2",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.12.7",
"@types/node": "^22.0.0",
"@types/yargs": "^17.0.32",
"eslint": "^8.57.0",
"jiti": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/ghost-blog-buster/src/utils/markdown-converter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("frontMatterGenerator", () => {
canonical_url: "https://codingdodo.com/odoo-15-javascript-reference",
authors: [
{
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "Philippe L'ATTENTION",
slug: "coding-dodo",
profile_image: "https://codingdodo.com/content/images/2021/04/small-logo-1.png",
Expand Down Expand Up @@ -131,7 +131,7 @@ describe("frontMatterGenerator", () => {
},
],
primary_author: {
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "Philippe L'ATTENTION",
slug: "coding-dodo",
profile_image: "https://codingdodo.com/content/images/2021/04/small-logo-1.png",
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/node": "^20.12.7",
"@types/node": "^22.0.0",
"@types/react": "18.3.8",
"@types/react-dom": "18.3.0",
"autoprefixer": "^10.4.19",
Expand Down
2 changes: 1 addition & 1 deletion examples/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"typescript": "^5.4.5"
},
"engines": {
"node": ">=14"
"node": "22"
}
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"typescript": "^5.4.5"
},
"engines": {
"node": ">=16.15.0",
"pnpm": ">=9"
"node": "22"
},
"packageManager": "pnpm@9.11.0"
"packageManager": "pnpm@10.18.3"
}
2 changes: 1 addition & 1 deletion packages/ts-ghost-admin-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@faker-js/faker": "^9.0.0",
"@ts-ghost/core-api": "workspace:*",
"@ts-ghost/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"@types/node": "^22.0.0",
"@types/validator": "^13.11.9",
"@vitest/coverage-v8": "^1.5.0",
"eslint": "^8.57.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const stubPage = {
tags: [],
authors: [
{
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "PhilDL",
slug: "phildl",
email: "[email protected]",
Expand Down Expand Up @@ -129,7 +129,7 @@ const stubPage = {
negative_feedback: 0,
},
primary_author: {
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "PhilDL",
slug: "phildl",
email: "[email protected]",
Expand Down Expand Up @@ -474,7 +474,7 @@ describe("pages integration tests browse", () => {
const api = new TSGhostAdminAPI(
process.env.VITE_GHOST_URL!,
"1efedd9db174adee2d23d982:4b74dca0219bad629852191af326a45037346c2231240e0f7aec1f9371cc14e8",
"v5.0"
"v5.0",
);
expect(api.pages).toBeDefined();
const result = await api.pages
Expand All @@ -499,7 +499,7 @@ describe("pages integration tests browse", () => {
const api = new TSGhostAdminAPI(
"https://codingdodoes.com",
"1efedd9db174adee2d23d982:4b74dca0219bad629852191af326a45037346c2231240e0f7aec1f9371cc14e8",
"v5.0"
"v5.0",
);
expect(api.pages).toBeDefined();
const result = await api.pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const stub = {
],
authors: [
{
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "PhilDL",
slug: "phildl",
email: "[email protected]",
Expand Down Expand Up @@ -128,7 +128,7 @@ const stub = {
],
count: { clicks: 0, positive_feedback: 0, negative_feedback: 0 },
primary_author: {
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "PhilDL",
slug: "phildl",
email: "[email protected]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("members integration tests browse", () => {
expect(site.title).toBe(stubSite.title);
expect(site.description).toBe(stubSite.description);
expect(site.logo).toBe(stubSite.logo);
expect(site.version).toContain("5.");
expect(site.version).toContain("6.");
expect(site.url).toBe(stubSite.url);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const stubResult = {
},
data: [
{
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "PhilDL",
slug: "phildl",
email: "[email protected]",
Expand Down Expand Up @@ -80,10 +80,10 @@ describe("users integration tests browse", () => {
expect(user.comment_notifications).toBe(stubUser.comment_notifications);
expect(user.free_member_signup_notification).toBe(stubUser.free_member_signup_notification);
expect(user.paid_subscription_started_notification).toBe(
stubUser.paid_subscription_started_notification
stubUser.paid_subscription_started_notification,
);
expect(user.paid_subscription_canceled_notification).toBe(
stubUser.paid_subscription_canceled_notification
stubUser.paid_subscription_canceled_notification,
);
expect(user.created_at).toBe(stubUser.created_at);
expect(user.updated_at).toBeDefined();
Expand All @@ -93,7 +93,7 @@ describe("users integration tests browse", () => {
expect(api.users).toBeDefined();
const result = await api.users
.read({
id: "1",
id: "68f8bdb4c2a74e000108c75d",
})
.fetch();
assert(result.success);
Expand All @@ -119,10 +119,10 @@ describe("users integration tests browse", () => {
expect(user.comment_notifications).toBe(stubUser.comment_notifications);
expect(user.free_member_signup_notification).toBe(stubUser.free_member_signup_notification);
expect(user.paid_subscription_started_notification).toBe(
stubUser.paid_subscription_started_notification
stubUser.paid_subscription_started_notification,
);
expect(user.paid_subscription_canceled_notification).toBe(
stubUser.paid_subscription_canceled_notification
stubUser.paid_subscription_canceled_notification,
);
expect(user.created_at).toBe(stubUser.created_at);
expect(user.updated_at).toBeDefined();
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-ghost-content-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"devDependencies": {
"@ts-ghost/core-api": "workspace:*",
"@ts-ghost/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"@types/node": "^22.0.0",
"@vitest/coverage-v8": "^1.5.0",
"eslint": "^8.57.0",
"jiti": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const url = process.env.VITE_GHOST_URL || "https://my-ghost-blog.com";
const key = process.env.VITE_GHOST_CONTENT_API_KEY || "59d4bf56c73c04a18c867dc3ba";

const stub = {
id: "1",
id: "68f8bdb4c2a74e000108c75d",
name: "PhilDL",
slug: "phildl",
profile_image: "https://www.gravatar.com/avatar/c2baf8feb52fc654cc40c731207c677d?s=250&r=x&d=mp",
Expand Down Expand Up @@ -106,20 +106,20 @@ describe("authors integration tests read", () => {
const api = new TSGhostContentAPI(url, key, "v5.0");

test("should fetch one author correctly by id", async () => {
const readQuery = api.authors.read({ id: "1" });
const readQuery = api.authors.read({ id: "68f8bdb4c2a74e000108c75d" });
expect(readQuery).not.toBeUndefined();
expect(readQuery.getParams().fields).toBeUndefined();
const result = await readQuery.fetch();
expect(result).not.toBeUndefined();
if (result.success) {
expect(result.data.id).toBe("1");
expect(result.data.id).toBe(stub.id);
expect(result.data.slug).toBe("phildl");
expect(result.data.name).toBe("PhilDL");
expect(result.data.website).toBe("https://github.com/PhilDL");
expect(result.data.facebook).toBeNull();
expect(result.data.url).toBe("https://astro-starter.digitalpress.blog/author/phildl/");
expect(result.data.profile_image).toBe(
"https://www.gravatar.com/avatar/c2baf8feb52fc654cc40c731207c677d?s=250&r=x&d=mp"
"https://www.gravatar.com/avatar/c2baf8feb52fc654cc40c731207c677d?s=250&r=x&d=mp",
);
}
});
Expand All @@ -131,20 +131,20 @@ describe("authors integration tests read", () => {
const result = await readQuery.fetch();
expect(result).not.toBeUndefined();
if (result.success) {
expect(result.data.id).toBe("1");
expect(result.data.id).toBe(stub.id);
expect(result.data.slug).toBe("phildl");
expect(result.data.name).toBe("PhilDL");
expect(result.data.website).toBe("https://github.com/PhilDL");
expect(result.data.facebook).toBeNull();
expect(result.data.url).toBe("https://astro-starter.digitalpress.blog/author/phildl/");
expect(result.data.profile_image).toBe(
"https://www.gravatar.com/avatar/c2baf8feb52fc654cc40c731207c677d?s=250&r=x&d=mp"
"https://www.gravatar.com/avatar/c2baf8feb52fc654cc40c731207c677d?s=250&r=x&d=mp",
);
}
});

test("should fetch author correctly and accept specific field", async () => {
const readQuery = api.authors.read({ id: "1" }).fields({ name: true });
const readQuery = api.authors.read({ id: "68f8bdb4c2a74e000108c75d" }).fields({ name: true });
expect(readQuery).not.toBeUndefined();
expect(readQuery.getOutputFields()).toStrictEqual(["name"]);
const result = await readQuery.fetch();
Expand All @@ -159,7 +159,7 @@ describe("authors integration tests read", () => {
});

test("should fetch author correctly and accept include", async () => {
const readQuery = api.authors.read({ id: "1" }).include({ "count.posts": true });
const readQuery = api.authors.read({ id: "68f8bdb4c2a74e000108c75d" }).include({ "count.posts": true });
expect(readQuery).not.toBeUndefined();
expect(readQuery.getParams()?.fields).toBeUndefined();
expect(readQuery.getParams()?.include).toStrictEqual(["count.posts"]);
Expand Down
7 changes: 2 additions & 5 deletions packages/ts-ghost-core-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,7 @@
});

// the "identity" schema is used to validate the inputs of the `read`method of the QueryBuilder
const identitySchema = z.union([
z.object({ slug: z.string() }),
z.object({ id: z.string() }),
]);
const identitySchema = z.union([z.object({ slug: z.string() }), z.object({ id: z.string() })]);

const simplifiedIncludeSchema = z.object({
count: z.literal(true).optional(),
Expand Down Expand Up @@ -621,7 +618,7 @@

```ts
const exampleQuery = api.users
.read({ id: "1" })
.read({ id: "68f8bdb4c2a74e000108c75d" })
.fields({ id: true, name: true, email: true });
export type ExampleQueryOutput = InferFetcherDataShape<typeof exampleQuery>;
```
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-ghost-core-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@ts-ghost/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"@types/node": "^22.0.0",
"@vitest/coverage-v8": "^1.5.0",
"eslint": "^8.57.0",
"tsup": "^8.0.2",
Expand Down
Loading