Skip to content

Commit

Permalink
prep pacakges for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoMoretti committed Aug 10, 2024
1 parent 9411be6 commit 02af4d8
Show file tree
Hide file tree
Showing 207 changed files with 17 additions and 17 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cli",
"name": "download-notion",
"version": "0.0.1",
"description": "A variant of the official notion client that uses a cache.",
"description": "A CLI to download notion pages.",
"publishConfig": {
"access": "public"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { exit } from "process"

import { ImageSet } from "./images"
import { error } from "./log"
import { DocuNotionOptions } from "./notionPull"
import { NotionPullOptions } from "./notionPull"

export function makeImagePersistencePlan(
options: DocuNotionOptions,
options: NotionPullOptions,
imageSet: ImageSet,
imageBlockId: string,
imageOutputRootPath: string,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Client } from "@notionhq/client"
import { FilesMap } from "./FilesMap"
import { LayoutStrategy } from "./LayoutStrategy"
import { NotionPageConfig, getPageContentInfo } from "./NotionPage"
import { getNotionDatabase, getNotionPage2 } from "./notionPull"
import { getNotionDatabase, getNotionPage } from "./notionPull"

export async function getFileTreeMap(
incomingContext: string,
Expand Down Expand Up @@ -40,7 +40,7 @@ export async function getFileTreeMap(
)
}
} else if (currentType === "page") {
const page = await getNotionPage2(client, currentID, pageConfig)
const page = await getNotionPage(client, currentID, pageConfig)
filesMap.page[currentID] = layoutStrategy.getPathForPage2(
page,
incomingContext
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
makeImagePersistencePlan,
} from "./MakeImagePersistencePlan"
import { ImageSet } from "./images"
import { DocuNotionOptions } from "./notionPull"
import { NotionPullOptions } from "./notionPull"

const optionsUsingDefaultNaming: DocuNotionOptions = {
const optionsUsingDefaultNaming: NotionPullOptions = {
notionToken: "",
rootPage: "",
locales: [],
Expand Down Expand Up @@ -99,7 +99,7 @@ test("handles encoded characters", () => {
expect(imageSet.filePathToUseInMarkdown).toBe(`./my-page%281%29.ABC-123.png`)
})

const optionsUsingHashNaming: DocuNotionOptions = {
const optionsUsingHashNaming: NotionPullOptions = {
...optionsUsingDefaultNaming,
imageFileNameFormat: "content-hash",
}
Expand All @@ -115,7 +115,7 @@ test("hash naming", () => {
expect(testImageSet.outputFileName).toBe(`${expectedFileName}`)
})

const optionsUsingLegacyNaming: DocuNotionOptions = {
const optionsUsingLegacyNaming: NotionPullOptions = {
...optionsUsingDefaultNaming,
imageFileNameFormat: "legacy",
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { convertToUUID, saveDataToJson } from "./utils"
import { configSchema } from "./utils/get-config"
import { writePage } from "./writePage"

export type DocuNotionOptions = z.infer<typeof pullOptionsSchema>
export type NotionPullOptions = z.infer<typeof pullOptionsSchema>

export interface OutputCounts {
output_normally: number
Expand All @@ -55,7 +55,7 @@ export const counts: OutputCounts = {
error_because_no_slug: 0,
}

export async function getNotionPage2(
export async function getNotionPage(
client: Client,
currentID: string,
pageConfig: NotionPageConfig
Expand Down Expand Up @@ -83,7 +83,7 @@ function sanitizeMarkdownOutputPath(path: string) {
return path.replace(/\/+$/, "")
}

export async function notionPull(options: DocuNotionOptions): Promise<void> {
export async function notionPull(options: NotionPullOptions): Promise<void> {
// It's helpful when troubleshooting CI secrets and environment variables to see what options actually made it to docu-notion.
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const optionsForLogging = { ...options }
Expand Down Expand Up @@ -248,7 +248,7 @@ export async function notionPull(options: DocuNotionOptions): Promise<void> {
}

async function outputPages(
options: DocuNotionOptions,
options: NotionPullOptions,
config: IDocuNotionConfig,
pages: Array<NotionPage>,
client: Client,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ListBlockChildrenResponseResult } from "notion-to-md/build/types"
import { FilesMap } from "../FilesMap"
import { NotionPage } from "../NotionPage"
import { ICounts, NotionBlock } from "../index"
import { DocuNotionOptions } from "../notionPull"
import { NotionPullOptions } from "../notionPull"

type linkConversionFunction = (
context: IDocuNotionContext,
Expand Down Expand Up @@ -68,7 +68,7 @@ export type ICustomNotionToMarkdownConversion = (
export type IGetBlockChildrenFn = (id: string) => Promise<NotionBlock[]>

export type IDocuNotionContext = {
options: DocuNotionOptions
options: NotionPullOptions
getBlockChildren: IGetBlockChildrenFn
notionToMarkdown: NotionToMarkdown
pageInfo: IDocuNotionContextPageInfo
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/notion-cache-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"repository": {
"type": "git",
"url": "https://github.com/franciscomoretti/notion-downloader.git",
"directory": "packages/notion-cache-client"
"directory": "packages/notion-downloader"
},
"files": [
"dist"
Expand Down

0 comments on commit 02af4d8

Please sign in to comment.