diff --git a/.gitignore b/.gitignore index 657842b..ef88793 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ node_modules/ .pnp.js # Build output -dist/ build/ *.tsbuildinfo diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..6818ee9 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,6 @@ +import { QuartzFilterPlugin } from '@quartz-community/types'; +export { QuartzFilterPlugin } from '@quartz-community/types'; + +declare const RemoveDrafts: QuartzFilterPlugin; + +export { RemoveDrafts }; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..5705e69 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,13 @@ +// src/filter.ts +var RemoveDrafts = () => ({ + name: "RemoveDrafts", + shouldPublish(_ctx, [_tree, vfile]) { + const frontmatter = vfile.data?.frontmatter; + const draftFlag = frontmatter?.draft === true || frontmatter?.draft === "true"; + return !draftFlag; + } +}); + +export { RemoveDrafts }; +//# sourceMappingURL=index.js.map +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..434fbfd --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/filter.ts"],"names":[],"mappings":";AAEO,IAAM,eAA2C,OAAO;AAAA,EAC7D,IAAA,EAAM,cAAA;AAAA,EACN,aAAA,CAAc,IAAA,EAAM,CAAC,KAAA,EAAO,KAAK,CAAA,EAAG;AAClC,IAAA,MAAM,WAAA,GAAc,MAAM,IAAA,EAAM,WAAA;AAChC,IAAA,MAAM,SAAA,GAAqB,WAAA,EAAa,KAAA,KAAU,IAAA,IAAQ,aAAa,KAAA,KAAU,MAAA;AACjF,IAAA,OAAO,CAAC,SAAA;AAAA,EACV;AACF,CAAA","file":"index.js","sourcesContent":["import type { QuartzFilterPlugin } from \"@quartz-community/types\";\n\nexport const RemoveDrafts: QuartzFilterPlugin = () => ({\n name: \"RemoveDrafts\",\n shouldPublish(_ctx, [_tree, vfile]) {\n const frontmatter = vfile.data?.frontmatter as Record | undefined;\n const draftFlag: boolean = frontmatter?.draft === true || frontmatter?.draft === \"true\";\n return !draftFlag;\n },\n});\n"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4490eb0..f48ee30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,7 @@ "version": "0.1.0", "license": "MIT", "dependencies": { - "@quartz-community/types": "github:quartz-community/types", - "tsup": "^8.5.0", - "typescript": "^5.9.3" + "@quartz-community/types": "github:quartz-community/types" }, "devDependencies": { "@types/node": "^24.10.0", @@ -20,6 +18,8 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "prettier": "^3.6.2", + "tsup": "^8.5.0", + "typescript": "^5.9.3", "vitest": "^2.1.9" }, "engines": { @@ -2855,7 +2855,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", diff --git a/package.json b/package.json index 7324a0e..9140aba 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "sideEffects": false, "scripts": { "build": "tsup", - "prepare": "npm run build", "dev": "tsup --watch", "lint": "eslint . --max-warnings=0", "format": "prettier . --check",