Skip to content

Commit

Permalink
refactor(eleventy-plugin-text-to-speech): big changes
Browse files Browse the repository at this point in the history
Now the plugin accepts any text-to-speech client and any hosting client.

BREAKING CHANGE: removed a lot of options and move some of them in each
rule.
  • Loading branch information
jackdbd committed Jan 29, 2024
1 parent 066a006 commit 1191784
Show file tree
Hide file tree
Showing 171 changed files with 7,951 additions and 5,179 deletions.
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export CLOUDFLARE_ACCOUNT_ID=43f9884041661b778e95a26992850715
# export DEBUG="Eleventy:EleventyErrorHandler,11ty-test-utils"
export DEBUG="Eleventy:EleventyErrorHandler,11ty-test-utils,11ty-plugin*"
# export DEBUG="DevEleventy:*,Eleventy*"
Expand All @@ -6,6 +7,9 @@ export NODE_ENV=production
export SKIP_TELEGRAM_MESSAGES=1

# secrets exposed as environment variables
export CLOUDFLARE_R2=$(cat /run/secrets/cloudflare_r2/personal)
export ELEVENLABS_API_KEY=$(cat /run/secrets/elevenlabs/api_key)
# export GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/prj-kitchen-sink/sa-storage-uploader
export PLAUSIBLE=$(cat /run/secrets/plausible/test_site)
# export SKIP_VALIDATION=1
export TELEGRAM=$(cat /run/secrets/telegram/personal_bot)
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:

- name: 🔍 Test @jackdbd/eleventy-plugin-text-to-speech
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_R2: ${{ secrets.CLOUDFLARE_R2 }}
SA_JSON_KEY_STORAGE_UPLOADER: ${{ secrets.SA_JSON_KEY_STORAGE_UPLOADER }}
SA_JSON_KEY_TEXT_TO_SPEECH: ${{ secrets.SA_JSON_KEY_TEXT_TO_SPEECH }}
run: npm run test:ci -w packages/eleventy-plugin-text-to-speech
Expand Down
20 changes: 18 additions & 2 deletions custom-types/11ty__eleventy/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,32 @@ declare module '@11ty/eleventy' {

type EventHandler = (arg: EventArguments) => void | Promise<void>

type TransformHandler = (
export interface EleventyTemplate {
outputPath: string
}

// https://www.11ty.dev/docs/collections/#collection-api-methods
export interface CollectionApi {
getAll: () => EleventyTemplate[]
getAllSorted: () => EleventyTemplate[]
getFilteredByTag: (tagName: string) => EleventyTemplate[]
getFilteredByTags: (...args: string[]) => EleventyTemplate[]
getFilteredByGlob: (glob: any) => EleventyTemplate[]
}

type CollectionFn = (collectionApi: CollectionApi) => void

type TransformFn = (
content: string,
outputPath: string
) => string | Promise<string>

export interface EleventyConfig {
userConfig: any
verbose: boolean
addCollection(collectionName: string, fn: CollectionFn): Promise<void>
addPlugin(pluginFn: () => void, pluginOptions: Object): Promise<void>
addTransform(transformName: string, fn: TransformHandler): Promise<void>
addTransform(transformName: string, fn: TransformFn): Promise<void>
on(eventName: EventName, fn: EventHandler): Promise<void>
}

Expand Down
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ The **API docs** are generated by [api-extractor](https://api-extractor.com/) +
- [eleventy-plugin-plausible](./eleventy-plugin-plausible/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/eleventy-plugin-plausible/api-docs/index.md))
- [eleventy-plugin-telegram](./eleventy-plugin-telegram/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/eleventy-plugin-telegram/api-docs/index.md))
- [eleventy-plugin-text-to-speech](./eleventy-plugin-text-to-speech/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/eleventy-plugin-text-to-speech/api-docs/index.md))
- [eleventy-test-utils](./eleventy-test-utils/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/eleventy-test-utils/api-docs/index.md))
- [eleventy-test-utils](./eleventy-test-utils/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/eleventy-test-utils/api-docs/index.md))
- [text-to-audio-asset](./text-to-audio-asset/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/text-to-audio-asset/api-docs/index.md))
- [zod-schemas](./zod-schemas/index.html) (and [API docs](https://github.com/jackdbd/undici/tree/main/packages/zod-schemas/api-docs/index.md))
2 changes: 1 addition & 1 deletion docs/eleventy-plugin-ensure-env-vars/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/eleventy-plugin-ensure-env-vars/interfaces/Options.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/eleventy-plugin-telegram/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/eleventy-plugin-telegram/functions/telegramPlugin.html

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/eleventy-plugin-telegram/interfaces/EleventyConfig.html

Large diffs are not rendered by default.

Loading

0 comments on commit 1191784

Please sign in to comment.