eleventy-plugin-podcaster 2.2.1 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-podcaster",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "An Eleventy plugin that allows you to create a podcast and its accompanying website",
5
5
  "main": "eleventy.config.js",
6
6
  "exports": {
@@ -30,11 +30,10 @@
30
30
  "dependencies": {
31
31
  "@11ty/eleventy-plugin-rss": "^3.0.0",
32
32
  "@aws-sdk/client-s3": "^3.862.0",
33
- "@tsmx/human-readable": "^2.0.3",
34
33
  "dom-serializer": "^2.0.0",
35
34
  "htmlparser2": "^9.1.0",
36
35
  "markdown-it": "^14.1.0",
37
- "music-metadata": "^11.7.1"
36
+ "music-metadata": "^11.12.3"
38
37
  },
39
38
  "devDependencies": {
40
39
  "@11ty/eleventy": "^3.0.0",
@@ -1,4 +1,3 @@
1
- import hr from '@tsmx/human-readable'
2
1
  import readableDuration from './readableDuration.js'
3
2
 
4
3
  export default function (eleventyConfig, options = {}) {
@@ -21,7 +20,9 @@ export default function (eleventyConfig, options = {}) {
21
20
  return readableDuration.shortFormat(seconds)
22
21
  })
23
22
 
24
- eleventyConfig.addFilter('readableSize', (bytes, fixedPrecision = 1) =>
25
- hr.fromBytes(bytes, { fixedPrecision })
26
- )
23
+ eleventyConfig.addFilter('readableSize', (bytes, fixedPrecision = 1) => {
24
+ if (bytes < 1000 * 1000) return `${(bytes / 1000).toFixed(fixedPrecision)} kB`
25
+ if (bytes < 1000 * 1000 * 1000) return `${(bytes / 1000 / 1000).toFixed(fixedPrecision)} MB`
26
+ return `${(bytes / 1000 / 1000 / 1000).toFixed(fixedPrecision)} GB`
27
+ })
27
28
  }
@@ -1,7 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npx ava:*)"
5
- ]
6
- }
7
- }
package/CLAUDE.md DELETED
@@ -1,54 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Commands
6
-
7
- ```bash
8
- npm test # run all tests (AVA)
9
- npx ava test/someTestFile.js # run a single test file
10
- npx eslint src/ # lint source files
11
- ```
12
-
13
- There is no build step — the plugin is used directly from source.
14
-
15
- ## Architecture
16
-
17
- `eleventy.config.js` is the plugin entry point. It registers 8 sub-plugins and 3 optional features:
18
-
19
- **Core sub-plugins (always active):**
20
-
21
- - `podcastFeed.js` — RSS feed generation; creates `episodePost` and `episodePostWithChapters` collections via virtual templates
22
- - `podcastData.js` — Computes podcast-level `eleventyComputed` fields: `feedPath`, `imagePath`, `episodeUrlBase`, `copyrightNotice`
23
- - `episodeData.js` — Parses `seasonNumber`/`episodeNumber` from filenames; constructs episode `url` and `permalink`
24
- - `calculateEpisodeSizeAndDuration.js` — Reads audio metadata from local files or S3; caches results; uses `music-metadata`
25
- - `calculateEpisodeFilename.js` — Matches episode posts to audio files by season/episode number
26
- - `readableFilters.js` — Adds `readableDate`, `readableDuration`, `readableSize` filters
27
- - `chapters.js` — Filter for normalizing chapter data to JSON-LD; template in `src/chapters.njk`
28
-
29
- **Optional features (opt-in via plugin options):**
30
-
31
- - `drafts.js` — Filters draft posts; controlled by `INCLUDE_DRAFTS` env var or `ELEVENTY_RUN_MODE`
32
- - `excerpts.js` — Auto-generates episode excerpts from front matter, HTML comments, or first paragraph
33
- - `pageTitle.js` — Computes `pageTitle` with configurable separator
34
-
35
- **Options:** `handleDrafts`, `handleExcerpts`, `handlePageTitles` (individual flags), or `optionalFeatures: true` (enables all three). `episodePostsDirectory` and `episodeFilesDirectory` override the default directory names.
36
-
37
- ## Tests
38
-
39
- Tests use AVA and are configured in `ava.config.js`. Each test file typically builds a fixture site using Eleventy's programmatic API and asserts on the output.
40
-
41
- Fixture sites live in `fixtures/` — each is a minimal Eleventy site with `eleventy.config.js`, `_data/podcast.json`, episode markdown files in `episode-posts/`, and audio files in `episode-files/`.
42
-
43
- Key environment variables used in tests:
44
-
45
- - `SKIP_EPISODE_CALCULATIONS` — skip audio metadata calculation (speeds up tests that don't need it)
46
- - `INCLUDE_DRAFTS` — controls draft inclusion
47
- - `ELEVENTY_RUN_MODE` — `'build'` or `'serve'`
48
-
49
- ## Conventions
50
-
51
- - All source files are ES modules (`"type": "module"` in package.json)
52
- - Computed episode/podcast fields are set via Eleventy's `eleventyComputed` pattern
53
- - No Luxon — duration logic uses native `Intl` / `Date`; see `src/readableDuration.js`
54
- - Commit messages: short past-tense verb phrases, no body, no co-author lines (e.g. `Removed Luxon dependency`)
package/TODO.md DELETED
@@ -1,24 +0,0 @@
1
- # TODO
2
-
3
- ## Warnings and errors for missing data
4
-
5
- Add consistent warnings and errors when required data is missing. This should be opt-in via a plugin option to avoid a breaking change.
6
-
7
- Behaviour:
8
-
9
- - In development (`ELEVENTY_RUN_MODE === 'serve'`): log warnings but continue the build
10
- - In production: throw errors and stop the build
11
-
12
- Cases to handle:
13
-
14
- - Missing `podcast.json` or required fields within it
15
- - Episode post without a matching audio file
16
- - Malformed episode numbering in filenames
17
- - Incomplete S3 configuration (some keys but not others)
18
- - Missing audio file when calculating duration/size
19
-
20
- Implementation notes:
21
-
22
- - Use a consistent prefix like `[podcaster]` so messages are identifiable
23
- - New plugin option (e.g., `strictMode` or `validateData`) to enable this
24
- - The draft system may already cover some cases (e.g., incomplete episodes marked as drafts)
package/jsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "checkJs": false
4
- }
5
- }