Skip to content

Commit 0d2df16

Browse files
authored
Merge pull request #69 from 01-binary/[email protected]
[email protected]
2 parents c4c0cc2 + c4f4545 commit 0d2df16

File tree

12 files changed

+16
-401
lines changed

12 files changed

+16
-401
lines changed

.changeset/big-words-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"notion-to-utils": minor
3+
---
4+
5+
refactor: Remove makePreviewImage and formatNotionImageUrl functionality

packages/notion-to-utils/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"devDependencies": {
4444
"@repo/eslint-config": "workspace:*",
4545
"@repo/typescript-config": "workspace:*",
46-
"@types/lqip-modern": "^1.1.7",
4746
"@types/probe-image-size": "^7.2.5",
4847
"@vitest/coverage-v8": "2.1.2",
4948
"jsdom": "^26.0.0",
@@ -52,7 +51,6 @@
5251
},
5352
"dependencies": {
5453
"@notionhq/client": "^2.2.15",
55-
"lqip-modern": "^2.2.1",
5654
"open-graph-scraper": "^6.9.0",
5755
"probe-image-size": "^7.2.3"
5856
}

packages/notion-to-utils/src/client/getPageBlocks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Client } from '@notionhq/client';
2+
import ogs from 'open-graph-scraper';
23
import {
34
ListBlockChildrenResponse,
45
BlockObjectResponse,
56
PartialBlockObjectResponse,
67
} from '@notionhq/client/build/src/api-endpoints';
7-
import { formatNotionImageUrl } from './formatNotionImageUrl';
8-
import { addMetadataToImageBlock } from '../utils';
9-
import ogs from 'open-graph-scraper';
8+
import { formatNotionImageUrl } from '../utils/formatNotionImageUrl';
9+
import { addMetadataToImageBlock } from './utils/getImageMetadata';
1010

1111
// 블록 타입 정의
1212
export type NotionBlock = BlockObjectResponse | PartialBlockObjectResponse;

packages/notion-to-utils/src/client/getPageProperties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Client } from '@notionhq/client';
22
import { isPageObjectResponse } from './utils/isPageObjectResponse';
33
import { extractValuesFromProperties } from './utils/extractValuesFromProperties';
4-
import { formatNotionImageUrl } from './formatNotionImageUrl';
4+
import { formatNotionImageUrl } from '../utils/formatNotionImageUrl';
55

66
/**
77
* Retrieves properties of a Notion page.

packages/notion-to-utils/src/client/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { ClientOptions } from '@notionhq/client/build/src/Client';
33
import { getPageProperties as getPagePropertiesFunc } from './getPageProperties';
44
import { getFileUrl as getFileUrlFunc } from './getFileUrl';
55
import { getPageBlocks as getPageBlocksFunc } from './getPageBlocks';
6-
import { formatNotionImageUrl as formatNotionImageUrlFunc } from './formatNotionImageUrl';
76

87
export class Client extends NotionClient {
98
constructor(options: ClientOptions = {}) {
@@ -15,13 +14,11 @@ export class Client extends NotionClient {
1514
keys: string[] = [],
1615
extractValues = true
1716
) => getPagePropertiesFunc(this, pageId, keys, extractValues);
17+
1818
getPageBlocks = (pageId: string) => getPageBlocksFunc(this, pageId);
1919

2020
getFileUrl = (pageId: string, propertyKey: string) =>
2121
getFileUrlFunc(this, pageId, propertyKey);
22-
//? 25.4.7 formatNotionImageUrl 외부에서 미사용
23-
formatNotionImageUrl = (url: string, blockId?: string) =>
24-
formatNotionImageUrlFunc(url, blockId);
2522
}
2623

2724
export default Client;

packages/notion-to-utils/src/utils/getImageMetadata.ts renamed to packages/notion-to-utils/src/client/utils/getImageMetadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import probe from 'probe-image-size';
55
* @param url 이미지 URL
66
* @returns 이미지 메타데이터 (너비, 높이, 종횡비) 또는 null (추출 실패 시)
77
*/
8-
export async function getImageMetadata(url: string): Promise<{
8+
async function getImageMetadata(url: string): Promise<{
99
width: number;
1010
height: number;
1111
aspectRatio: number;
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * from './makePreviewImage';
2-
export * from './getImageMetadata';
1+
export * from './formatNotionImageUrl';

packages/notion-to-utils/src/utils/makePreviewImage.spec.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)