diff --git a/.github/workflows/publish-demo.yml b/.github/workflows/publish-demo.yml new file mode 100644 index 0000000..a8d025e --- /dev/null +++ b/.github/workflows/publish-demo.yml @@ -0,0 +1,31 @@ +name: Publish thd demo to Github Pages + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Get the latest code 🚚 + uses: actions/checkout@v3 + + - name: Setup node Env 🧩 + uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + + - name: Install Packages 🚢 + run: yarn + + - name: Build the package 📦 + run: yarn build:demo + + - name: Publish to Github Pages 🚀 + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./demo/dist diff --git a/README.md b/README.md index 50cb457..6c534a5 100644 --- a/README.md +++ b/README.md @@ -71,3 +71,7 @@ To see all of the options available, please see the [types file](@types/index.ts - `pauseAtEndOfWord()` - A function used to pause once the typewriter has finished typing out the word - `play()` - Function to continue the typewriter from where it was paused - `safeUpdateStrings()` - Used to update the strings array safely once the typewriter has deleted the current string. + +### Known Issues + +1 known issue is that the reactive strings array can be changed without warning. This can sometimes cause the current word to change when the typewriter is in the middle of typing a word. I've handled any errors where the strings array is too short or the current word is too short by resetting the typewriter to the start of the word. To avoid this issue, I recommend using the `safeUpdateStrings()` function to update the strings array. I'm hoping to find a lean way of using the `safeUpdateStrings()` as the default update function in the future. diff --git a/demo/src/App.vue b/demo/src/App.vue index 0591192..e6d26f5 100644 --- a/demo/src/App.vue +++ b/demo/src/App.vue @@ -45,9 +45,13 @@ const {