├── .changeset ├── README.md └── config.json ├── .editorconfig ├── .eslintrc.json ├── .gitattributes ├── .github ├── CODEOWNERS ├── FUNDING.yml └── workflows │ ├── ci.yml │ └── publish.yml ├── .gitignore ├── .npmrc ├── .vscode └── settings.json ├── CHANGELOG.md ├── CONTRIBUTORS ├── FULL_CHANGELOG.md ├── LICENSE ├── README.md ├── code-of-conduct.md ├── package-lock.json ├── package.json ├── src ├── benchmarks │ ├── html-fragment-sync.bench.ts │ ├── html-fragment.bench.ts │ ├── html-sync.bench.ts │ └── html.bench.ts ├── index.ts ├── parse-literals-sync.ts ├── parse-literals.ts ├── process-literals-sync.ts ├── process-literals.ts └── tests │ ├── constants.ts │ ├── html-fragment-sync.test.ts │ ├── html-fragment.test.ts │ ├── html-sync.test.ts │ └── html.test.ts ├── tsconfig.json └── vite.config.ts /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", 3 | "changelog": [ 4 | "@changesets/changelog-github", 5 | { 6 | "repo": "motss/lit-ntml" 7 | } 8 | ], 9 | "commit": false, 10 | "fixed": [], 11 | "linked": [], 12 | "access": "restricted", 13 | "baseBranch": "main", 14 | "updateInternalDependencies": "patch", 15 | "ignore": [] 16 | } 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # https://editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | # Change these settings to your own preference 9 | indent_size = 2 10 | indent_style = space 11 | 12 | # We recommend you to keep these unchanged 13 | charset = utf-8 14 | end_of_line = lf 15 | insert_final_newline = true 16 | trim_trailing_whitespace = true 17 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "./node_modules/@reallyland/tools/.eslintrc.json" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # https://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | 5 | # For the following file types, normalize line endings to LF on 6 | # checkin and prevent conversion to CRLF when they are checked out 7 | # (this is required in order to prevent newline related issues like, 8 | # for example, after the build script is run) 9 | .* text eol=lf 10 | *.css text eol=lf 11 | *.dart text eol=lf 12 | *.html text eol=lf 13 | *.js text eol=lf 14 | *.json text eol=lf 15 | *.jsx text eol=lf 16 | *.md text eol=lf 17 | *.rs text eol=lf 18 | *.scss text eol=lf 19 | *.sh text eol=lf 20 | *.ts text eol=lf 21 | *.tsx text eol=lf 22 | *.txt text eol=lf 23 | *.xml text eol=lf 24 | *.yaml text eol=lf 25 | *.yml text eol=lf 26 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @motss 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # My Github Sponsors profile is live at 2022-04-03 14:33 SGT! 🚀 🎉 2 | github: [motss] 3 | 4 | # Buy me a matcha to support my passion! 5 | custom: ['https://www.buymeacoffee.com/RLmMhgXFb'] 6 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - '**' 7 | paths-ignore: 8 | - '**/*.md' 9 | push: # run ci workflow so thats status badges can always point to main branch. 10 | branches: 11 | - main 12 | 13 | concurrency: 14 | group: ${{ github.workflow }}-${{ github.ref || github.run_id }} 15 | cancel-in-progress: true 16 | 17 | defaults: 18 | run: 19 | shell: bash 20 | 21 | env: 22 | IS_UBUNTU: false 23 | NODE_VERSION: v0.0.0 24 | NPM_CACHE_DIR: ~/.npm 25 | NPM_VERSION: 0.0.0 26 | 27 | jobs: 28 | lint: 29 | if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'chore(release)')" 30 | env: 31 | IS_UBUNTU: ${{ contains(matrix.os, 'ubuntu') }} 32 | name: lint - ${{ matrix.os }} ${{ matrix.target }} 33 | runs-on: ${{ matrix.os }} 34 | timeout-minutes: 120 35 | strategy: 36 | matrix: 37 | os: [ubuntu-latest] 38 | target: [18.x] 39 | 40 | steps: 41 | - name: Checkout 42 | uses: actions/checkout@v3 43 | 44 | - name: List versions 45 | run: | 46 | echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV 47 | echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV 48 | echo "NPM_VERSION=$(npm -v)" >> $GITHUB_ENV 49 | 50 | echo "${{ github.workflow }}-${{ github.ref || github.run_id }}" 51 | pwd 52 | ls -la 53 | which npm 54 | # npm x -y -- envinfo@latest 55 | 56 | - name: Cache dependencies 57 | id: npm-cache 58 | uses: actions/cache@v3 59 | with: 60 | # See this glob workaround at https://github.com/actions/toolkit/issues/713. 61 | path: | 62 | ${{ env.NPM_CACHE_DIR }}/* 63 | !${{ env.NPM_CACHE_DIR }}/_npx 64 | key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }}-${{ hashFiles('**/package-lock.json') }} 65 | restore-keys: | 66 | ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} 67 | 68 | - name: Debugging 69 | run: | 70 | echo "Debugging `github` payload:" 71 | 72 | echo "::group::$JSON" 73 | echo "::endgroup::" 74 | env: 75 | JSON: ${{ toJSON(github) }} 76 | 77 | - name: Install dependencies 78 | run: | 79 | npm pkg delete scripts.postinstall 80 | npm ci 81 | sh $(npm root)/@reallyland/tools/list-npx-cache.sh 82 | 83 | - name: Lint 84 | run: | 85 | npm run lint:build 86 | 87 | test: 88 | if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:') && !contains(github.event.head_commit.message, 'chore(release)')" 89 | env: 90 | IS_UBUNTU: ${{ contains(matrix.os, 'ubuntu') }} 91 | name: test - ${{ matrix.os }} ${{ matrix.target }} 92 | runs-on: ${{ matrix.os }} 93 | timeout-minutes: 120 94 | strategy: 95 | matrix: 96 | os: [ubuntu-latest] 97 | target: [18.x] 98 | 99 | steps: 100 | - name: Checkout 101 | uses: actions/checkout@v3 102 | 103 | # - name: Setup node@${{ matrix.target }} 104 | # uses: actions/setup-node@v3 105 | # with: 106 | # node-version: ${{ matrix.target }} 107 | 108 | - name: List versions 109 | run: | 110 | echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV 111 | echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV 112 | echo "NPM_VERSION=$(npm -v)" >> $GITHUB_ENV 113 | 114 | echo "${{ github.workflow }}-${{ github.ref || github.run_id }}" 115 | pwd 116 | ls -la 117 | which npm 118 | # npm x -y -- envinfo@latest 119 | 120 | - name: Cache dependencies 121 | id: npm-cache 122 | uses: actions/cache@v3 123 | with: 124 | # See this glob workaround at https://github.com/actions/toolkit/issues/713. 125 | path: | 126 | ${{ env.NPM_CACHE_DIR }}/* 127 | !${{ env.NPM_CACHE_DIR }}/_npx 128 | key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }}-${{ hashFiles('**/package-lock.json') }} 129 | restore-keys: | 130 | ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} 131 | 132 | - name: Install dependencies 133 | run: | 134 | npm pkg delete scripts.postinstall 135 | npm ci 136 | sh $(npm root)/@reallyland/tools/list-npx-cache.sh 137 | 138 | - name: Test 139 | if: env.IS_UBUNTU == 'false' 140 | run: | 141 | npm t -- --no-coverage --no-watch 142 | 143 | - name: Test with coverage 144 | if: env.IS_UBUNTU != 'false' 145 | run: | 146 | npm t -- --color --no-watch 147 | 148 | - name: Upload coverage to codecov 149 | if: env.IS_UBUNTU != 'false' && success() 150 | uses: codecov/codecov-action@v3 151 | with: 152 | token: ${{ secrets.CODECOV_TOKEN }} 153 | file: ./coverage/lcov.info 154 | flags: unit_tests 155 | 156 | bench: 157 | if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:') && !contains(github.event.head_commit.message, 'chore(release)')" 158 | env: 159 | IS_UBUNTU: ${{ contains(matrix.os, 'ubuntu') }} 160 | name: bench - ${{ matrix.os }} ${{ matrix.target }} 161 | runs-on: ${{ matrix.os }} 162 | timeout-minutes: 120 163 | strategy: 164 | matrix: 165 | os: [ubuntu-latest] 166 | target: [18.x] 167 | 168 | steps: 169 | - name: Checkout 170 | uses: actions/checkout@v3 171 | 172 | - name: List versions 173 | run: | 174 | echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV 175 | echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV 176 | echo "NPM_VERSION=$(npm -v)" >> $GITHUB_ENV 177 | 178 | echo "${{ github.workflow }}-${{ github.ref || github.run_id }}" 179 | pwd 180 | ls -la 181 | which npm 182 | # npm x -y -- envinfo@latest 183 | 184 | - name: Cache dependencies 185 | id: npm-cache 186 | uses: actions/cache@v3 187 | with: 188 | # See this glob workaround at https://github.com/actions/toolkit/issues/713. 189 | path: | 190 | ${{ env.NPM_CACHE_DIR }}/* 191 | !${{ env.NPM_CACHE_DIR }}/_npx 192 | key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }}-${{ hashFiles('**/package-lock.json') }} 193 | restore-keys: | 194 | ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} 195 | 196 | - name: Install dependencies 197 | run: | 198 | npm pkg delete scripts.postinstall 199 | npm ci 200 | sh $(npm root)/@reallyland/tools/list-npx-cache.sh 201 | 202 | - name: Benchmark 203 | run: | 204 | npm run bench -- --no-watch 205 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | defaults: 9 | run: 10 | shell: bash 11 | 12 | env: 13 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 14 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 15 | NODE_VERSION: v0.0.0 16 | NPM_CACHE_DIR: ~/.npm 17 | NPM_VERSION: 0.0.0 18 | 19 | jobs: 20 | build: 21 | name: ${{ matrix.os }} ${{ matrix.target }} 22 | runs-on: ${{ matrix.os }} 23 | timeout-minutes: 120 24 | strategy: 25 | matrix: 26 | os: [ubuntu-latest] 27 | target: [18.x] 28 | 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v3 32 | 33 | # - name: Setup node@${{ matrix.target }} 34 | # uses: actions/setup-node@v3 35 | # with: 36 | # node-version: ${{ matrix.target }} 37 | # registry-url: 'https://registry.npmjs.org' 38 | 39 | - name: List versions 40 | run: | 41 | echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV 42 | echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV 43 | echo "NPM_VERSION=$(npm -v)" >> $GITHUB_ENV 44 | echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc 45 | 46 | pwd 47 | ls -la 48 | which npm 49 | npm config ls -l 50 | 51 | - name: Cache dependencies 52 | id: npm-cache 53 | uses: actions/cache@v3 54 | with: 55 | # See this glob workaround at https://github.com/actions/toolkit/issues/713. 56 | path: | 57 | ${{ env.NPM_CACHE_DIR }}/* 58 | !${{ env.NPM_CACHE_DIR }}/_npx 59 | key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }}-${{ hashFiles('**/package-lock.json') }} 60 | restore-keys: | 61 | ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} 62 | 63 | - name: Install dependencies 64 | run: | 65 | npm pkg delete scripts.postinstall 66 | npm ci 67 | 68 | - name: Lint 69 | run: | 70 | npm run lint:build 71 | 72 | - name: Build 73 | run: | 74 | npm run build 75 | 76 | - name: Cleanup package.json 77 | run: | 78 | npm pkg delete devDependencies nano-staged scripts 79 | 80 | - name: Create release pull request or publish to npm 81 | id: changesets 82 | uses: changesets/action@v1 83 | with: 84 | commit: 'chore: release package' 85 | publish: npm x -y -- changeset publish 86 | title: 'chore: release package' 87 | version: npm x -y -- changeset version 88 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # .gitignore 101 - https://www.quora.com/Does-gitignore-file-only-work-on-current-folder 2 | 3 | # dot files/ folders 4 | .*cache 5 | .build/ 6 | .DS_Store 7 | .firebase/ 8 | .nyc_output 9 | .tmp/ 10 | *.env 11 | *.idea 12 | *.local 13 | *.log* 14 | *.tsbuildinfo 15 | 16 | # folders 17 | coverage*/ 18 | dist*/ 19 | log*/ 20 | node_modules/ 21 | web_modules/ 22 | 23 | # Do not ignore 24 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # User config 2 | foreground-scripts=true 3 | message="chore(release): %s :tada:" 4 | package-lock=true 5 | preid=rc 6 | progress=true 7 | quiet=true 8 | sign-git-tag=true 9 | update-binary=true 10 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.insertFinalNewline": false, 3 | "typescript.preferences.importModuleSpecifierEnding": "js", 4 | "typescript.tsdk": "node_modules/typescript/lib" 5 | } 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 4.0.2 4 | 5 | ### Patch Changes 6 | 7 | - [#74](https://github.com/motss/lit-ntml/pull/74) [`63472f4`](https://github.com/motss/lit-ntml/commit/63472f4538322bbab0fda9b03e5b832aa719d9a8) Thanks [@motss](https://github.com/motss)! - chore: standardize test params for tests and benchmarks 8 | 9 | - [#71](https://github.com/motss/lit-ntml/pull/71) [`4ea239a`](https://github.com/motss/lit-ntml/commit/4ea239ae9c9991f8e70430506f79d03b287f52af) Thanks [@motss](https://github.com/motss)! - feat: integrate changeset 10 | 11 | ## 4.0.2-rc.0 12 | 13 | ### Patch Changes 14 | 15 | - [#74](https://github.com/motss/lit-ntml/pull/74) [`63472f4`](https://github.com/motss/lit-ntml/commit/63472f4538322bbab0fda9b03e5b832aa719d9a8) Thanks [@motss](https://github.com/motss)! - chore: standardize test params for tests and benchmarks 16 | 17 | - [#71](https://github.com/motss/lit-ntml/pull/71) [`4ea239a`](https://github.com/motss/lit-ntml/commit/4ea239ae9c9991f8e70430506f79d03b287f52af) Thanks [@motss](https://github.com/motss)! - feat: integrate changeset 18 | 19 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 20 | 21 | ## [4.0.1](https://github.com/motss/lit-ntml/compare/v4.0.1-rc.0...v4.0.1) (2023-02-12) 22 | 23 | ## [4.0.1-rc.0](https://github.com/motss/lit-ntml/compare/v4.0.0...v4.0.1-rc.0) (2023-02-12) 24 | 25 | ### build 26 | 27 | - ignore bench\* folder when publishing ([4cf38a3](https://github.com/motss/lit-ntml/commit/4cf38a3c4920256c423d298eba9084847733b045)) 28 | 29 | ### fix 30 | 31 | - fix #68 by removing unnecessary fields before publishing (#69) ([c39ffda](https://github.com/motss/lit-ntml/commit/c39ffda35783cc3a27f7db370bf2eed31aa87ea6)), closes [#68](https://github.com/motss/lit-ntml/issues/68) [#69](https://github.com/motss/lit-ntml/issues/69) 32 | 33 | # [4.0.0](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.4...v4.0.0) (2022-10-24) 34 | 35 | ### chore 36 | 37 | - update dependencies ([b086ad5](https://github.com/motss/lit-ntml/commit/b086ad54a94d1abf8620208bdde5d9e76adccec5)) 38 | 39 | ## [3.0.1-rc.4](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.3...v3.0.1-rc.4) (2022-10-24) 40 | 41 | ### chore 42 | 43 | - always upload .vscode folder ([0241b23](https://github.com/motss/lit-ntml/commit/0241b2381405a6d14a00c8bc7ee90dbc00676a17)) 44 | 45 | ## [3.0.1-rc.3](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.2...v3.0.1-rc.3) (2022-10-24) 46 | 47 | ### build 48 | 49 | - update package.json for improved exports map ([5591b90](https://github.com/motss/lit-ntml/commit/5591b90a0d6517951798066621f7bcbc4688e691)) 50 | 51 | ### chore 52 | 53 | - add funding details and CODEOWNERS ([3eeb0b3](https://github.com/motss/lit-ntml/commit/3eeb0b3de827bd56fc63d5defd9395accce7e24c)) 54 | 55 | ## [3.0.1-rc.2](https://github.com/motss/lit-ntml/compare/v3.0.6...v3.0.1-rc.2) (2022-06-26) 56 | 57 | ### build 58 | 59 | - convert all bash scripts to shell scripts ([b4c0e0d](https://github.com/motss/lit-ntml/commit/b4c0e0d8f751f95e89956c03f191212977c0a34d)) 60 | 61 | ### refactor 62 | 63 | - Migrate to Vitest (#60) ([3a8d099](https://github.com/motss/lit-ntml/commit/3a8d0993d9cd363ad6ee3ced3af31962df77c2be)), closes [#60](https://github.com/motss/lit-ntml/issues/60) 64 | 65 | ## [3.0.6](https://github.com/motss/lit-ntml/compare/v3.0.6-rc.1...v3.0.6) (2022-02-06) 66 | 67 | ### chore 68 | 69 | - update dependencies ([a3383dd](https://github.com/motss/lit-ntml/commit/a3383dd557794926557390a77bc8b59ee01e1b4c)) 70 | 71 | ## [3.0.6-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.6-rc.0...v3.0.6-rc.1) (2022-02-06) 72 | 73 | ### ci 74 | 75 | - minor update ([ea5165f](https://github.com/motss/lit-ntml/commit/ea5165f14076099febee1c79f450c88990548cee)) 76 | 77 | ## [3.0.6-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.5...v3.0.6-rc.0) (2022-02-06) 78 | 79 | ## [3.0.5](https://github.com/motss/lit-ntml/compare/v3.0.5-rc.2...v3.0.5) (2022-02-06) 80 | 81 | ### build 82 | 83 | - add foreground-scripts=true ([9415ce6](https://github.com/motss/lit-ntml/commit/9415ce6b2de9af746dc7076ebbc2c46d32b76d6b)) 84 | 85 | ## [3.0.5-rc.2](https://github.com/motss/lit-ntml/compare/v3.0.5-rc.1...v3.0.5-rc.2) (2022-02-06) 86 | 87 | ### build 88 | 89 | - add postinstall.\* [ci skip] ([6a04dcb](https://github.com/motss/lit-ntml/commit/6a04dcb2a21b6de05cc23eb922455dec6c2b08e4)) 90 | 91 | ## [3.0.5-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.5-rc.0...v3.0.5-rc.1) (2022-02-06) 92 | 93 | ### build 94 | 95 | - minor update [ci skip] ([66c1f78](https://github.com/motss/lit-ntml/commit/66c1f7884fdd7a88c4e84ee414d9fed5bdb9d841)) 96 | 97 | ### chore 98 | 99 | - update dependencies [ci skip] ([e495e52](https://github.com/motss/lit-ntml/commit/e495e520f52e38fda336ad5181717bcaf23fcfa6)) 100 | 101 | ### ci 102 | 103 | - run postinstall script with bash ([63a5b83](https://github.com/motss/lit-ntml/commit/63a5b83eef87d70b1dcf100a662eb6b2f0285f43)) 104 | 105 | ## [3.0.5-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.4...v3.0.5-rc.0) (2022-02-05) 106 | 107 | ### ci 108 | 109 | - improve CI due to npx cache ([7dfef43](https://github.com/motss/lit-ntml/commit/7dfef43f83110260c15df38a1d5a1e9711e53071)) 110 | - minor cleanup ([b3da335](https://github.com/motss/lit-ntml/commit/b3da3356d71f4269fbc1853e5f4d9e918fda685f)) 111 | - use local cache for npx ([3e668be](https://github.com/motss/lit-ntml/commit/3e668bea504bc44d49408976e4b6ed2cbe712442)) 112 | 113 | ## [3.0.4](https://github.com/motss/lit-ntml/compare/v3.0.4-rc.1...v3.0.4) (2022-02-04) 114 | 115 | ## [3.0.4-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.3...v3.0.4-rc.1) (2022-02-04) 116 | 117 | ### ci 118 | 119 | - skip check step in CI ([828174d](https://github.com/motss/lit-ntml/commit/828174d3481e808e42cd22f5ad2ac237aba8d05f)) 120 | 121 | ## [3.0.3](https://github.com/motss/lit-ntml/compare/v3.0.3-rc.2...v3.0.3) (2022-02-04) 122 | 123 | ## [3.0.3-rc.2](https://github.com/motss/lit-ntml/compare/v3.0.3-rc.1...v3.0.3-rc.2) (2022-02-04) 124 | 125 | ### ci 126 | 127 | - update CI ([9b50aca](https://github.com/motss/lit-ntml/commit/9b50aca1aaa280798ed1604516137593b321c1b9)) 128 | - update CI ([f462e51](https://github.com/motss/lit-ntml/commit/f462e514235f9723ebac496adb07047e0a7f2371)) 129 | 130 | ## [3.0.3-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.3-rc.0...v3.0.3-rc.1) (2022-02-04) 131 | 132 | ### ci 133 | 134 | - run test with coverage for ubuntu only ([292122e](https://github.com/motss/lit-ntml/commit/292122e5bd2df6e4afb7900943e90155eaa4e9dc)) 135 | - skip cache step ([616312d](https://github.com/motss/lit-ntml/commit/616312de561209e54e13b8a09dff03e3384e61da)) 136 | 137 | ## [3.0.3-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.2...v3.0.3-rc.0) (2022-02-04) 138 | 139 | ### chore 140 | 141 | - minor cleanup ([518091c](https://github.com/motss/lit-ntml/commit/518091c0af4fc0b177ccbcd036da3031c9a8defa)) 142 | 143 | ### ci 144 | 145 | - drop zx in favor of simple Node script ([e932524](https://github.com/motss/lit-ntml/commit/e932524774b78bc78730b8786f959c125e4193f4)) 146 | - minor update ([ca43a38](https://github.com/motss/lit-ntml/commit/ca43a38a5442db39817d93ecf49d0461c04eb51e)) 147 | - trying to fix broken npm x ([72dee4c](https://github.com/motss/lit-ntml/commit/72dee4cc09fd971175784cfa3669053fa1e42c8f)) 148 | - trying to use zx ([944a1a9](https://github.com/motss/lit-ntml/commit/944a1a9fbb796876bc8675dc4e59b69f9d68e1de)) 149 | 150 | ## [3.0.2](https://github.com/motss/lit-ntml/compare/v3.0.2-rc.0...v3.0.2) (2022-02-03) 151 | 152 | ## [3.0.2-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.1...v3.0.2-rc.0) (2022-02-03) 153 | 154 | ### build 155 | 156 | - add postinstall.mjs ([4ec4bd5](https://github.com/motss/lit-ntml/commit/4ec4bd518a0d70bb1267d223815e78e15503290f)) 157 | 158 | ## [3.0.1](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.1...v3.0.1) (2022-02-03) 159 | 160 | ## [3.0.1-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.0...v3.0.1-rc.1) (2022-02-03) 161 | 162 | ### build 163 | 164 | - update build config ([c471e17](https://github.com/motss/lit-ntml/commit/c471e17dd1c63f24172e3a7593eb9b54a4cca92f)) 165 | 166 | ### chore 167 | 168 | - update config ([d23d90a](https://github.com/motss/lit-ntml/commit/d23d90a48dd6198bfc3a54babc676d59dc9dd7f6)) 169 | - update dependencies ([461c252](https://github.com/motss/lit-ntml/commit/461c2525d710d6950cf0f1deddb0f3e51863d051)) 170 | - update workflow ([bfcce2b](https://github.com/motss/lit-ntml/commit/bfcce2bd7fc2eb7d1095fa75345b61bd04f0f99a)) 171 | 172 | ### ci 173 | 174 | - minor cleanup ([c350859](https://github.com/motss/lit-ntml/commit/c35085900dd0070647d8bf3519ebbb58592411e1)) 175 | - trying to fix CI ([c5fade7](https://github.com/motss/lit-ntml/commit/c5fade7e168bfa7e02a3342656905eecef444e17)) 176 | - trying to fix CI ([2a4190d](https://github.com/motss/lit-ntml/commit/2a4190d15e6458ad42f253189de43f78aa31b771)) 177 | - trying to fix CI ([23ef6af](https://github.com/motss/lit-ntml/commit/23ef6afd8c2f7ffd67bdd2101e20e5ac88529474)) 178 | - trying to fix CI ([17b5c57](https://github.com/motss/lit-ntml/commit/17b5c57bea94afe29cf7024eda5dc5f1c6bb5aa1)) 179 | 180 | ### fix 181 | 182 | - update typings ([8ff4ad7](https://github.com/motss/lit-ntml/commit/8ff4ad7a30c367993d9377c7f8b3f3eec45d5afb)) 183 | 184 | # [3.0.0](https://github.com/motss/lit-ntml/compare/v3.0.0-rc.1...v3.0.0) (2021-08-29) 185 | 186 | ### chore 187 | 188 | - update dependencies ([4f6723a](https://github.com/motss/lit-ntml/commit/4f6723a810c5f6be1481a1966c3dd8fd1feb19dd)) 189 | - update dependencies ([5f52c23](https://github.com/motss/lit-ntml/commit/5f52c2340054f3f55b93a95d2e9d878632fc776e)) 190 | - update dependencies ([c554646](https://github.com/motss/lit-ntml/commit/c554646ec4d7a9f979443bc070ce1c42de833769)) 191 | - update dependencies ([717c690](https://github.com/motss/lit-ntml/commit/717c6900d238d51ffc7f6c9211dd40a0d834fa14)) 192 | - update dependencies ([8557c18](https://github.com/motss/lit-ntml/commit/8557c1863cb202895c4da35d4f576d345dc9b430)) 193 | 194 | # [3.0.0-rc.1](https://github.com/motss/lit-ntml/compare/v2.20.0...v3.0.0-rc.1) (2021-07-28) 195 | 196 | # [2.20.0](https://github.com/motss/lit-ntml/compare/v2.20.0-rc.0...v2.20.0) (2021-07-07) 197 | 198 | # [2.20.0-rc.0](https://github.com/motss/lit-ntml/compare/v2.19.0...v2.20.0-rc.0) (2021-07-01) 199 | 200 | ### chore 201 | 202 | - add commitlint ([ae4f465](https://github.com/motss/lit-ntml/commit/ae4f4651985651a0e1c8f3ce2fd6b6a84f774654)) 203 | - add simple-import-sort ([dfe795d](https://github.com/motss/lit-ntml/commit/dfe795d29fabd2e3c86c9328fa3ae77385001d48)) 204 | - revert husky command ([b960e43](https://github.com/motss/lit-ntml/commit/b960e43386d2f183335d78bbb9d1bc54e2c827e1)) 205 | - trying new husky command ([af729fa](https://github.com/motss/lit-ntml/commit/af729fae2fa372a2e56e87dd9c8cd85c7c26adaa)) 206 | - update build with @reallyland/esm ([ef73f59](https://github.com/motss/lit-ntml/commit/ef73f5943fc2f86a88cadafe0da99aac09c9484a)) 207 | - update dependencies ([fd50ece](https://github.com/motss/lit-ntml/commit/fd50ece7767cf3259a298b4e183fb5834bbf7599)) 208 | - update husky hook commands ([9429a90](https://github.com/motss/lit-ntml/commit/9429a9050cebb3d30f00b8f8321d0e13542741dc)) 209 | 210 | # [2.19.0](https://github.com/motss/lit-ntml/compare/v2.18.2...v2.19.0) (2021-06-28) 211 | 212 | ### refactor 213 | 214 | - migrate to uvu + c8, improve rollup build for deno (#55) ([e980b20](https://github.com/motss/lit-ntml/commit/e980b20bdf8fa9a0eaefce7797a2f34b2bc0a0a4)), closes [#55](https://github.com/motss/lit-ntml/issues/55) 215 | 216 | ## [2.18.2](https://github.com/motss/lit-ntml/compare/v2.18.1...v2.18.2) (2021-02-08) 217 | 218 | ### fix 219 | 220 | - Fix incorrect CJS exports for node@14 ([4d9daa6](https://github.com/motss/lit-ntml/commit/4d9daa6dc3eaf74853f74f206cad1e2f4faebfd4)) 221 | 222 | ## [2.18.1](https://github.com/motss/lit-ntml/compare/v2.18.0...v2.18.1) (2021-01-17) 223 | 224 | ### chore 225 | 226 | - Improve exports in package.json ([74262f1](https://github.com/motss/lit-ntml/commit/74262f12a551aa6fe16047f2b122744b9214ac14)) 227 | 228 | ### ci 229 | 230 | - Update if expression ([8ee9bf4](https://github.com/motss/lit-ntml/commit/8ee9bf44f3f52c1b41a4c4a6275fc116e09ad5c2)) 231 | 232 | # [2.18.0](https://github.com/motss/lit-ntml/compare/v2.18.1-rc.0...v2.18.0) (2021-01-12) 233 | 234 | ## [2.18.1-rc.0](https://github.com/motss/lit-ntml/compare/v2.18.0-rc.0...v2.18.1-rc.0) (2021-01-12) 235 | 236 | ### ci 237 | 238 | - Skip CI on condition met ([4ad972e](https://github.com/motss/lit-ntml/commit/4ad972e3c8e2abd9bb5a2c7dadfd2b12a314af54)) 239 | 240 | # [2.18.0-rc.0](https://github.com/motss/lit-ntml/compare/v2.17.0...v2.18.0-rc.0) (2021-01-12) 241 | 242 | ### chore 243 | 244 | - Explicitly include source files for coverage ([163a31f](https://github.com/motss/lit-ntml/commit/163a31f174d0774c8ec64b73d93d94b56d37cf23)) 245 | - Update NPM scripts ([0d6e4c5](https://github.com/motss/lit-ntml/commit/0d6e4c53c921efc3accf6d69ca701a285c227d1b)) 246 | - Update packages ([395e8db](https://github.com/motss/lit-ntml/commit/395e8db42bd284d65386e7168e2c49c6bf027741)) 247 | - Update packages ([af8254e](https://github.com/motss/lit-ntml/commit/af8254ed26b08e0671c443b85b935cbcd4e9b656)) 248 | 249 | ### ci 250 | 251 | - Update CI scripts ([5d4d862](https://github.com/motss/lit-ntml/commit/5d4d86249fcfe317cae7f846cb0f8d0945f8f506)) 252 | 253 | ### refactor 254 | 255 | - Migrate to ESLint ([13c7c8e](https://github.com/motss/lit-ntml/commit/13c7c8e0cb20d5dd37b67bb71a873e776bfb4fee)) 256 | 257 | # [2.17.0](https://github.com/motss/lit-ntml/compare/v2.16.1...v2.17.0) (2020-10-09) 258 | 259 | ### chore 260 | 261 | - Update dependencies ([3e127ba](https://github.com/motss/lit-ntml/commit/3e127ba5c7cf9f514d7f514f722e7438d78983e0)) 262 | 263 | ## [2.16.1](https://github.com/motss/lit-ntml/compare/v2.16.0...v2.16.1) (2020-04-18) 264 | 265 | ### doc 266 | 267 | - Update example ([1835a64](https://github.com/motss/lit-ntml/commit/1835a644ccf11162bc76dc50022af229a6f8d11e)) 268 | 269 | # [2.16.0](https://github.com/motss/lit-ntml/compare/v2.16.0-rc.0...v2.16.0) (2020-04-18) 270 | 271 | # [2.16.0-rc.0](https://github.com/motss/lit-ntml/compare/v2.15.1...v2.16.0-rc.0) (2020-04-18) 272 | 273 | ## [2.15.1](https://github.com/motss/lit-ntml/compare/v2.15.0...v2.15.1) (2020-04-18) 274 | 275 | ### chore 276 | 277 | - Upgrade dependencies ([7cf5ad2](https://github.com/motss/lit-ntml/commit/7cf5ad22e0ff3161cdfa96a319815d51c69a14e9)) 278 | 279 | ### ci 280 | 281 | - Remove CircleCI ([720dc16](https://github.com/motss/lit-ntml/commit/720dc16b7d48287622291f64718bfb932b890eb3)) 282 | 283 | ### doc 284 | 285 | - Fix example ([5fb789e](https://github.com/motss/lit-ntml/commit/5fb789e4c409368935dfc46bc84f5f027b873df9)) 286 | - Update badges ([6193e78](https://github.com/motss/lit-ntml/commit/6193e7887cfe8b6a4d2ae63e65d72fbd60d4b0e1)) 287 | 288 | # [2.15.0](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.5...v2.15.0) (2020-03-22) 289 | 290 | ### chore 291 | 292 | - Add husky ([c50b695](https://github.com/motss/lit-ntml/commit/c50b6953498678a3c01acf01f63c9caf0cf631be)) 293 | 294 | ### ci 295 | 296 | - Remove publish to GPR ([f964d9e](https://github.com/motss/lit-ntml/commit/f964d9e5ef6081876f63886395459c79f6791c9a)) 297 | 298 | ## [2.14.2-rc.5](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.4...v2.14.2-rc.5) (2020-03-22) 299 | 300 | ### ci 301 | 302 | - Trying to publish to GPR ([db474e8](https://github.com/motss/lit-ntml/commit/db474e835d757069a96234c4c77ef1da5094e41c)) 303 | 304 | ## [2.14.2-rc.4](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.3...v2.14.2-rc.4) (2020-03-22) 305 | 306 | ### ci 307 | 308 | - Trying to publish to GPR ([c1a091b](https://github.com/motss/lit-ntml/commit/c1a091b2d0035c9b343d8be0a4d3c223b6c27781)) 309 | 310 | ## [2.14.2-rc.3](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.2...v2.14.2-rc.3) (2020-03-22) 311 | 312 | ### ci 313 | 314 | - Trying to publish to GPR ([dfd9655](https://github.com/motss/lit-ntml/commit/dfd9655af259628ba5695ef9c555f48b9c94fa3d)) 315 | 316 | ## [2.14.2-rc.2](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.1...v2.14.2-rc.2) (2020-03-22) 317 | 318 | ### ci 319 | 320 | - Trying to add scope for publishing to GPR ([eeee726](https://github.com/motss/lit-ntml/commit/eeee72691389e137098b1b8b261ef7f46d708736)) 321 | 322 | ## [2.14.2-rc.1](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.0...v2.14.2-rc.1) (2020-03-22) 323 | 324 | ### ci 325 | 326 | - Update CI scripts ([39ef66a](https://github.com/motss/lit-ntml/commit/39ef66a52889b0cf8a434586d7bf1d8e7bc192b2)) 327 | 328 | ## [2.14.2-rc.0](https://github.com/motss/lit-ntml/compare/v2.14.1...v2.14.2-rc.0) (2020-03-22) 329 | 330 | ### ci 331 | 332 | - Add yml file for publishing to npm and GPR ([29b1801](https://github.com/motss/lit-ntml/commit/29b180118acae2240bcc30bceaad2c6887c17579)) 333 | - Trying to use Github Actions ([01d1c41](https://github.com/motss/lit-ntml/commit/01d1c415544b622b252c339bb1b6a847b5226156)) 334 | 335 | ## [2.14.1](https://github.com/motss/lit-ntml/compare/v2.14.0...v2.14.1) (2020-03-16) 336 | 337 | ### doc 338 | 339 | - Minor update ([a6cb8f2](https://github.com/motss/lit-ntml/commit/a6cb8f23c77c241d308782c18692173014283a63)) 340 | 341 | # [2.14.0](https://github.com/motss/lit-ntml/compare/v2.13.0...v2.14.0) (2020-03-16) 342 | 343 | ### feat 344 | 345 | - Add synchronous tags: htmlSync(), htmlFragmentSync(), close #50 ([ccf2e0f](https://github.com/motss/lit-ntml/commit/ccf2e0f702f9e22e6b10437c7316a9720ebba7c8)), closes [#50](https://github.com/motss/lit-ntml/issues/50) 346 | 347 | # [2.13.0](https://github.com/motss/lit-ntml/compare/v2.12.1-rc.0...v2.13.0) (2020-02-23) 348 | 349 | ## [2.12.1-rc.0](https://github.com/motss/lit-ntml/compare/v2.12.0...v2.12.1-rc.0) (2020-02-23) 350 | 351 | ### feat 352 | 353 | - Remove rollup for build and use ESM build ([bf4c8f5](https://github.com/motss/lit-ntml/commit/bf4c8f5c18669e2083c4471b30a50725fc1145e1)) 354 | 355 | ### fix 356 | 357 | - Fix browser build ([9ce94f0](https://github.com/motss/lit-ntml/commit/9ce94f02fdb90b14151d1ef7acdbc1ee11c3e649)) 358 | 359 | ### test 360 | 361 | - Fix tests ([c2cd8ce](https://github.com/motss/lit-ntml/commit/c2cd8ced7bfca7511732ef7076b81b05c25231eb)) 362 | 363 | # [2.12.0](https://github.com/motss/lit-ntml/compare/v2.11.0...v2.12.0) (2020-02-23) 364 | 365 | ### chore 366 | 367 | - Upgrade dependencies ([7cc603d](https://github.com/motss/lit-ntml/commit/7cc603dd7e750febfce06cc814b31dce3de2716c)) 368 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # Contributors in no specific order 2 | -------------------------------------------------------------------------------- /FULL_CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | 7 | ## [4.0.1](https://github.com/motss/lit-ntml/compare/v4.0.1-rc.0...v4.0.1) (2023-02-12) 8 | 9 | 10 | 11 | 12 | ## [4.0.1-rc.0](https://github.com/motss/lit-ntml/compare/v4.0.0...v4.0.1-rc.0) (2023-02-12) 13 | 14 | 15 | ### build 16 | 17 | * ignore bench* folder when publishing ([4cf38a3](https://github.com/motss/lit-ntml/commit/4cf38a3c4920256c423d298eba9084847733b045)) 18 | 19 | ### fix 20 | 21 | * fix #68 by removing unnecessary fields before publishing (#69) ([c39ffda](https://github.com/motss/lit-ntml/commit/c39ffda35783cc3a27f7db370bf2eed31aa87ea6)), closes [#68](https://github.com/motss/lit-ntml/issues/68) [#69](https://github.com/motss/lit-ntml/issues/69) 22 | 23 | 24 | 25 | # [4.0.0](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.4...v4.0.0) (2022-10-24) 26 | 27 | 28 | ### chore 29 | 30 | * update dependencies ([b086ad5](https://github.com/motss/lit-ntml/commit/b086ad54a94d1abf8620208bdde5d9e76adccec5)) 31 | 32 | 33 | 34 | ## [3.0.1-rc.4](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.3...v3.0.1-rc.4) (2022-10-24) 35 | 36 | 37 | ### chore 38 | 39 | * always upload .vscode folder ([0241b23](https://github.com/motss/lit-ntml/commit/0241b2381405a6d14a00c8bc7ee90dbc00676a17)) 40 | 41 | 42 | 43 | ## [3.0.1-rc.3](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.2...v3.0.1-rc.3) (2022-10-24) 44 | 45 | 46 | ### build 47 | 48 | * update package.json for improved exports map ([5591b90](https://github.com/motss/lit-ntml/commit/5591b90a0d6517951798066621f7bcbc4688e691)) 49 | 50 | ### chore 51 | 52 | * add funding details and CODEOWNERS ([3eeb0b3](https://github.com/motss/lit-ntml/commit/3eeb0b3de827bd56fc63d5defd9395accce7e24c)) 53 | 54 | 55 | 56 | ## [3.0.1-rc.2](https://github.com/motss/lit-ntml/compare/v3.0.6...v3.0.1-rc.2) (2022-06-26) 57 | 58 | 59 | ### build 60 | 61 | * convert all bash scripts to shell scripts ([b4c0e0d](https://github.com/motss/lit-ntml/commit/b4c0e0d8f751f95e89956c03f191212977c0a34d)) 62 | 63 | ### refactor 64 | 65 | * Migrate to Vitest (#60) ([3a8d099](https://github.com/motss/lit-ntml/commit/3a8d0993d9cd363ad6ee3ced3af31962df77c2be)), closes [#60](https://github.com/motss/lit-ntml/issues/60) 66 | 67 | 68 | 69 | ## [3.0.6](https://github.com/motss/lit-ntml/compare/v3.0.6-rc.1...v3.0.6) (2022-02-06) 70 | 71 | 72 | ### chore 73 | 74 | * update dependencies ([a3383dd](https://github.com/motss/lit-ntml/commit/a3383dd557794926557390a77bc8b59ee01e1b4c)) 75 | 76 | 77 | 78 | ## [3.0.6-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.6-rc.0...v3.0.6-rc.1) (2022-02-06) 79 | 80 | 81 | ### ci 82 | 83 | * minor update ([ea5165f](https://github.com/motss/lit-ntml/commit/ea5165f14076099febee1c79f450c88990548cee)) 84 | 85 | 86 | 87 | ## [3.0.6-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.5...v3.0.6-rc.0) (2022-02-06) 88 | 89 | 90 | 91 | 92 | ## [3.0.5](https://github.com/motss/lit-ntml/compare/v3.0.5-rc.2...v3.0.5) (2022-02-06) 93 | 94 | 95 | ### build 96 | 97 | * add foreground-scripts=true ([9415ce6](https://github.com/motss/lit-ntml/commit/9415ce6b2de9af746dc7076ebbc2c46d32b76d6b)) 98 | 99 | 100 | 101 | ## [3.0.5-rc.2](https://github.com/motss/lit-ntml/compare/v3.0.5-rc.1...v3.0.5-rc.2) (2022-02-06) 102 | 103 | 104 | ### build 105 | 106 | * add postinstall.* [ci skip] ([6a04dcb](https://github.com/motss/lit-ntml/commit/6a04dcb2a21b6de05cc23eb922455dec6c2b08e4)) 107 | 108 | 109 | 110 | ## [3.0.5-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.5-rc.0...v3.0.5-rc.1) (2022-02-06) 111 | 112 | 113 | ### build 114 | 115 | * minor update [ci skip] ([66c1f78](https://github.com/motss/lit-ntml/commit/66c1f7884fdd7a88c4e84ee414d9fed5bdb9d841)) 116 | 117 | ### chore 118 | 119 | * update dependencies [ci skip] ([e495e52](https://github.com/motss/lit-ntml/commit/e495e520f52e38fda336ad5181717bcaf23fcfa6)) 120 | 121 | ### ci 122 | 123 | * run postinstall script with bash ([63a5b83](https://github.com/motss/lit-ntml/commit/63a5b83eef87d70b1dcf100a662eb6b2f0285f43)) 124 | 125 | 126 | 127 | ## [3.0.5-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.4...v3.0.5-rc.0) (2022-02-05) 128 | 129 | 130 | ### ci 131 | 132 | * improve CI due to npx cache ([7dfef43](https://github.com/motss/lit-ntml/commit/7dfef43f83110260c15df38a1d5a1e9711e53071)) 133 | * minor cleanup ([b3da335](https://github.com/motss/lit-ntml/commit/b3da3356d71f4269fbc1853e5f4d9e918fda685f)) 134 | * use local cache for npx ([3e668be](https://github.com/motss/lit-ntml/commit/3e668bea504bc44d49408976e4b6ed2cbe712442)) 135 | 136 | 137 | 138 | ## [3.0.4](https://github.com/motss/lit-ntml/compare/v3.0.4-rc.1...v3.0.4) (2022-02-04) 139 | 140 | 141 | 142 | 143 | ## [3.0.4-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.3...v3.0.4-rc.1) (2022-02-04) 144 | 145 | 146 | ### ci 147 | 148 | * skip check step in CI ([828174d](https://github.com/motss/lit-ntml/commit/828174d3481e808e42cd22f5ad2ac237aba8d05f)) 149 | 150 | 151 | 152 | ## [3.0.3](https://github.com/motss/lit-ntml/compare/v3.0.3-rc.2...v3.0.3) (2022-02-04) 153 | 154 | 155 | 156 | 157 | ## [3.0.3-rc.2](https://github.com/motss/lit-ntml/compare/v3.0.3-rc.1...v3.0.3-rc.2) (2022-02-04) 158 | 159 | 160 | ### ci 161 | 162 | * update CI ([9b50aca](https://github.com/motss/lit-ntml/commit/9b50aca1aaa280798ed1604516137593b321c1b9)) 163 | * update CI ([f462e51](https://github.com/motss/lit-ntml/commit/f462e514235f9723ebac496adb07047e0a7f2371)) 164 | 165 | 166 | 167 | ## [3.0.3-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.3-rc.0...v3.0.3-rc.1) (2022-02-04) 168 | 169 | 170 | ### ci 171 | 172 | * run test with coverage for ubuntu only ([292122e](https://github.com/motss/lit-ntml/commit/292122e5bd2df6e4afb7900943e90155eaa4e9dc)) 173 | * skip cache step ([616312d](https://github.com/motss/lit-ntml/commit/616312de561209e54e13b8a09dff03e3384e61da)) 174 | 175 | 176 | 177 | ## [3.0.3-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.2...v3.0.3-rc.0) (2022-02-04) 178 | 179 | 180 | ### chore 181 | 182 | * minor cleanup ([518091c](https://github.com/motss/lit-ntml/commit/518091c0af4fc0b177ccbcd036da3031c9a8defa)) 183 | 184 | ### ci 185 | 186 | * drop zx in favor of simple Node script ([e932524](https://github.com/motss/lit-ntml/commit/e932524774b78bc78730b8786f959c125e4193f4)) 187 | * minor update ([ca43a38](https://github.com/motss/lit-ntml/commit/ca43a38a5442db39817d93ecf49d0461c04eb51e)) 188 | * trying to fix broken npm x ([72dee4c](https://github.com/motss/lit-ntml/commit/72dee4cc09fd971175784cfa3669053fa1e42c8f)) 189 | * trying to use zx ([944a1a9](https://github.com/motss/lit-ntml/commit/944a1a9fbb796876bc8675dc4e59b69f9d68e1de)) 190 | 191 | 192 | 193 | ## [3.0.2](https://github.com/motss/lit-ntml/compare/v3.0.2-rc.0...v3.0.2) (2022-02-03) 194 | 195 | 196 | 197 | 198 | ## [3.0.2-rc.0](https://github.com/motss/lit-ntml/compare/v3.0.1...v3.0.2-rc.0) (2022-02-03) 199 | 200 | 201 | ### build 202 | 203 | * add postinstall.mjs ([4ec4bd5](https://github.com/motss/lit-ntml/commit/4ec4bd518a0d70bb1267d223815e78e15503290f)) 204 | 205 | 206 | 207 | ## [3.0.1](https://github.com/motss/lit-ntml/compare/v3.0.1-rc.1...v3.0.1) (2022-02-03) 208 | 209 | 210 | 211 | 212 | ## [3.0.1-rc.1](https://github.com/motss/lit-ntml/compare/v3.0.0...v3.0.1-rc.1) (2022-02-03) 213 | 214 | 215 | ### build 216 | 217 | * update build config ([c471e17](https://github.com/motss/lit-ntml/commit/c471e17dd1c63f24172e3a7593eb9b54a4cca92f)) 218 | 219 | ### chore 220 | 221 | * update config ([d23d90a](https://github.com/motss/lit-ntml/commit/d23d90a48dd6198bfc3a54babc676d59dc9dd7f6)) 222 | * update dependencies ([461c252](https://github.com/motss/lit-ntml/commit/461c2525d710d6950cf0f1deddb0f3e51863d051)) 223 | * update workflow ([bfcce2b](https://github.com/motss/lit-ntml/commit/bfcce2bd7fc2eb7d1095fa75345b61bd04f0f99a)) 224 | 225 | ### ci 226 | 227 | * minor cleanup ([c350859](https://github.com/motss/lit-ntml/commit/c35085900dd0070647d8bf3519ebbb58592411e1)) 228 | * trying to fix CI ([c5fade7](https://github.com/motss/lit-ntml/commit/c5fade7e168bfa7e02a3342656905eecef444e17)) 229 | * trying to fix CI ([2a4190d](https://github.com/motss/lit-ntml/commit/2a4190d15e6458ad42f253189de43f78aa31b771)) 230 | * trying to fix CI ([23ef6af](https://github.com/motss/lit-ntml/commit/23ef6afd8c2f7ffd67bdd2101e20e5ac88529474)) 231 | * trying to fix CI ([17b5c57](https://github.com/motss/lit-ntml/commit/17b5c57bea94afe29cf7024eda5dc5f1c6bb5aa1)) 232 | 233 | ### fix 234 | 235 | * update typings ([8ff4ad7](https://github.com/motss/lit-ntml/commit/8ff4ad7a30c367993d9377c7f8b3f3eec45d5afb)) 236 | 237 | 238 | 239 | # [3.0.0](https://github.com/motss/lit-ntml/compare/v3.0.0-rc.1...v3.0.0) (2021-08-29) 240 | 241 | 242 | ### chore 243 | 244 | * update dependencies ([4f6723a](https://github.com/motss/lit-ntml/commit/4f6723a810c5f6be1481a1966c3dd8fd1feb19dd)) 245 | * update dependencies ([5f52c23](https://github.com/motss/lit-ntml/commit/5f52c2340054f3f55b93a95d2e9d878632fc776e)) 246 | * update dependencies ([c554646](https://github.com/motss/lit-ntml/commit/c554646ec4d7a9f979443bc070ce1c42de833769)) 247 | * update dependencies ([717c690](https://github.com/motss/lit-ntml/commit/717c6900d238d51ffc7f6c9211dd40a0d834fa14)) 248 | * update dependencies ([8557c18](https://github.com/motss/lit-ntml/commit/8557c1863cb202895c4da35d4f576d345dc9b430)) 249 | 250 | 251 | 252 | # [3.0.0-rc.1](https://github.com/motss/lit-ntml/compare/v2.20.0...v3.0.0-rc.1) (2021-07-28) 253 | 254 | 255 | 256 | 257 | # [2.20.0](https://github.com/motss/lit-ntml/compare/v2.20.0-rc.0...v2.20.0) (2021-07-07) 258 | 259 | 260 | 261 | 262 | # [2.20.0-rc.0](https://github.com/motss/lit-ntml/compare/v2.19.0...v2.20.0-rc.0) (2021-07-01) 263 | 264 | 265 | ### chore 266 | 267 | * add commitlint ([ae4f465](https://github.com/motss/lit-ntml/commit/ae4f4651985651a0e1c8f3ce2fd6b6a84f774654)) 268 | * add simple-import-sort ([dfe795d](https://github.com/motss/lit-ntml/commit/dfe795d29fabd2e3c86c9328fa3ae77385001d48)) 269 | * revert husky command ([b960e43](https://github.com/motss/lit-ntml/commit/b960e43386d2f183335d78bbb9d1bc54e2c827e1)) 270 | * trying new husky command ([af729fa](https://github.com/motss/lit-ntml/commit/af729fae2fa372a2e56e87dd9c8cd85c7c26adaa)) 271 | * update build with @reallyland/esm ([ef73f59](https://github.com/motss/lit-ntml/commit/ef73f5943fc2f86a88cadafe0da99aac09c9484a)) 272 | * update dependencies ([fd50ece](https://github.com/motss/lit-ntml/commit/fd50ece7767cf3259a298b4e183fb5834bbf7599)) 273 | * update husky hook commands ([9429a90](https://github.com/motss/lit-ntml/commit/9429a9050cebb3d30f00b8f8321d0e13542741dc)) 274 | 275 | 276 | 277 | # [2.19.0](https://github.com/motss/lit-ntml/compare/v2.18.2...v2.19.0) (2021-06-28) 278 | 279 | 280 | ### refactor 281 | 282 | * migrate to uvu + c8, improve rollup build for deno (#55) ([e980b20](https://github.com/motss/lit-ntml/commit/e980b20bdf8fa9a0eaefce7797a2f34b2bc0a0a4)), closes [#55](https://github.com/motss/lit-ntml/issues/55) 283 | 284 | 285 | 286 | ## [2.18.2](https://github.com/motss/lit-ntml/compare/v2.18.1...v2.18.2) (2021-02-08) 287 | 288 | 289 | ### fix 290 | 291 | * Fix incorrect CJS exports for node@14 ([4d9daa6](https://github.com/motss/lit-ntml/commit/4d9daa6dc3eaf74853f74f206cad1e2f4faebfd4)) 292 | 293 | 294 | 295 | ## [2.18.1](https://github.com/motss/lit-ntml/compare/v2.18.0...v2.18.1) (2021-01-17) 296 | 297 | 298 | ### chore 299 | 300 | * Improve exports in package.json ([74262f1](https://github.com/motss/lit-ntml/commit/74262f12a551aa6fe16047f2b122744b9214ac14)) 301 | 302 | ### ci 303 | 304 | * Update if expression ([8ee9bf4](https://github.com/motss/lit-ntml/commit/8ee9bf44f3f52c1b41a4c4a6275fc116e09ad5c2)) 305 | 306 | 307 | 308 | # [2.18.0](https://github.com/motss/lit-ntml/compare/v2.18.1-rc.0...v2.18.0) (2021-01-12) 309 | 310 | 311 | 312 | 313 | ## [2.18.1-rc.0](https://github.com/motss/lit-ntml/compare/v2.18.0-rc.0...v2.18.1-rc.0) (2021-01-12) 314 | 315 | 316 | ### ci 317 | 318 | * Skip CI on condition met ([4ad972e](https://github.com/motss/lit-ntml/commit/4ad972e3c8e2abd9bb5a2c7dadfd2b12a314af54)) 319 | 320 | 321 | 322 | # [2.18.0-rc.0](https://github.com/motss/lit-ntml/compare/v2.17.0...v2.18.0-rc.0) (2021-01-12) 323 | 324 | 325 | ### chore 326 | 327 | * Explicitly include source files for coverage ([163a31f](https://github.com/motss/lit-ntml/commit/163a31f174d0774c8ec64b73d93d94b56d37cf23)) 328 | * Update NPM scripts ([0d6e4c5](https://github.com/motss/lit-ntml/commit/0d6e4c53c921efc3accf6d69ca701a285c227d1b)) 329 | * Update packages ([395e8db](https://github.com/motss/lit-ntml/commit/395e8db42bd284d65386e7168e2c49c6bf027741)) 330 | * Update packages ([af8254e](https://github.com/motss/lit-ntml/commit/af8254ed26b08e0671c443b85b935cbcd4e9b656)) 331 | 332 | ### ci 333 | 334 | * Update CI scripts ([5d4d862](https://github.com/motss/lit-ntml/commit/5d4d86249fcfe317cae7f846cb0f8d0945f8f506)) 335 | 336 | ### refactor 337 | 338 | * Migrate to ESLint ([13c7c8e](https://github.com/motss/lit-ntml/commit/13c7c8e0cb20d5dd37b67bb71a873e776bfb4fee)) 339 | 340 | 341 | 342 | # [2.17.0](https://github.com/motss/lit-ntml/compare/v2.16.1...v2.17.0) (2020-10-09) 343 | 344 | 345 | ### chore 346 | 347 | * Update dependencies ([3e127ba](https://github.com/motss/lit-ntml/commit/3e127ba5c7cf9f514d7f514f722e7438d78983e0)) 348 | 349 | 350 | 351 | ## [2.16.1](https://github.com/motss/lit-ntml/compare/v2.16.0...v2.16.1) (2020-04-18) 352 | 353 | 354 | ### doc 355 | 356 | * Update example ([1835a64](https://github.com/motss/lit-ntml/commit/1835a644ccf11162bc76dc50022af229a6f8d11e)) 357 | 358 | 359 | 360 | # [2.16.0](https://github.com/motss/lit-ntml/compare/v2.16.0-rc.0...v2.16.0) (2020-04-18) 361 | 362 | 363 | 364 | 365 | # [2.16.0-rc.0](https://github.com/motss/lit-ntml/compare/v2.15.1...v2.16.0-rc.0) (2020-04-18) 366 | 367 | 368 | 369 | 370 | ## [2.15.1](https://github.com/motss/lit-ntml/compare/v2.15.0...v2.15.1) (2020-04-18) 371 | 372 | 373 | ### chore 374 | 375 | * Upgrade dependencies ([7cf5ad2](https://github.com/motss/lit-ntml/commit/7cf5ad22e0ff3161cdfa96a319815d51c69a14e9)) 376 | 377 | ### ci 378 | 379 | * Remove CircleCI ([720dc16](https://github.com/motss/lit-ntml/commit/720dc16b7d48287622291f64718bfb932b890eb3)) 380 | 381 | ### doc 382 | 383 | * Fix example ([5fb789e](https://github.com/motss/lit-ntml/commit/5fb789e4c409368935dfc46bc84f5f027b873df9)) 384 | * Update badges ([6193e78](https://github.com/motss/lit-ntml/commit/6193e7887cfe8b6a4d2ae63e65d72fbd60d4b0e1)) 385 | 386 | 387 | 388 | # [2.15.0](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.5...v2.15.0) (2020-03-22) 389 | 390 | 391 | ### chore 392 | 393 | * Add husky ([c50b695](https://github.com/motss/lit-ntml/commit/c50b6953498678a3c01acf01f63c9caf0cf631be)) 394 | 395 | ### ci 396 | 397 | * Remove publish to GPR ([f964d9e](https://github.com/motss/lit-ntml/commit/f964d9e5ef6081876f63886395459c79f6791c9a)) 398 | 399 | 400 | 401 | ## [2.14.2-rc.5](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.4...v2.14.2-rc.5) (2020-03-22) 402 | 403 | 404 | ### ci 405 | 406 | * Trying to publish to GPR ([db474e8](https://github.com/motss/lit-ntml/commit/db474e835d757069a96234c4c77ef1da5094e41c)) 407 | 408 | 409 | 410 | ## [2.14.2-rc.4](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.3...v2.14.2-rc.4) (2020-03-22) 411 | 412 | 413 | ### ci 414 | 415 | * Trying to publish to GPR ([c1a091b](https://github.com/motss/lit-ntml/commit/c1a091b2d0035c9b343d8be0a4d3c223b6c27781)) 416 | 417 | 418 | 419 | ## [2.14.2-rc.3](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.2...v2.14.2-rc.3) (2020-03-22) 420 | 421 | 422 | ### ci 423 | 424 | * Trying to publish to GPR ([dfd9655](https://github.com/motss/lit-ntml/commit/dfd9655af259628ba5695ef9c555f48b9c94fa3d)) 425 | 426 | 427 | 428 | ## [2.14.2-rc.2](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.1...v2.14.2-rc.2) (2020-03-22) 429 | 430 | 431 | ### ci 432 | 433 | * Trying to add scope for publishing to GPR ([eeee726](https://github.com/motss/lit-ntml/commit/eeee72691389e137098b1b8b261ef7f46d708736)) 434 | 435 | 436 | 437 | ## [2.14.2-rc.1](https://github.com/motss/lit-ntml/compare/v2.14.2-rc.0...v2.14.2-rc.1) (2020-03-22) 438 | 439 | 440 | ### ci 441 | 442 | * Update CI scripts ([39ef66a](https://github.com/motss/lit-ntml/commit/39ef66a52889b0cf8a434586d7bf1d8e7bc192b2)) 443 | 444 | 445 | 446 | ## [2.14.2-rc.0](https://github.com/motss/lit-ntml/compare/v2.14.1...v2.14.2-rc.0) (2020-03-22) 447 | 448 | 449 | ### ci 450 | 451 | * Add yml file for publishing to npm and GPR ([29b1801](https://github.com/motss/lit-ntml/commit/29b180118acae2240bcc30bceaad2c6887c17579)) 452 | * Trying to use Github Actions ([01d1c41](https://github.com/motss/lit-ntml/commit/01d1c415544b622b252c339bb1b6a847b5226156)) 453 | 454 | 455 | 456 | ## [2.14.1](https://github.com/motss/lit-ntml/compare/v2.14.0...v2.14.1) (2020-03-16) 457 | 458 | 459 | ### doc 460 | 461 | * Minor update ([a6cb8f2](https://github.com/motss/lit-ntml/commit/a6cb8f23c77c241d308782c18692173014283a63)) 462 | 463 | 464 | 465 | # [2.14.0](https://github.com/motss/lit-ntml/compare/v2.13.0...v2.14.0) (2020-03-16) 466 | 467 | 468 | ### feat 469 | 470 | * Add synchronous tags: htmlSync(), htmlFragmentSync(), close #50 ([ccf2e0f](https://github.com/motss/lit-ntml/commit/ccf2e0f702f9e22e6b10437c7316a9720ebba7c8)), closes [#50](https://github.com/motss/lit-ntml/issues/50) 471 | 472 | 473 | 474 | # [2.13.0](https://github.com/motss/lit-ntml/compare/v2.12.1-rc.0...v2.13.0) (2020-02-23) 475 | 476 | 477 | 478 | 479 | ## [2.12.1-rc.0](https://github.com/motss/lit-ntml/compare/v2.12.0...v2.12.1-rc.0) (2020-02-23) 480 | 481 | 482 | ### feat 483 | 484 | * Remove rollup for build and use ESM build ([bf4c8f5](https://github.com/motss/lit-ntml/commit/bf4c8f5c18669e2083c4471b30a50725fc1145e1)) 485 | 486 | ### fix 487 | 488 | * Fix browser build ([9ce94f0](https://github.com/motss/lit-ntml/commit/9ce94f02fdb90b14151d1ef7acdbc1ee11c3e649)) 489 | 490 | ### test 491 | 492 | * Fix tests ([c2cd8ce](https://github.com/motss/lit-ntml/commit/c2cd8ced7bfca7511732ef7076b81b05c25231eb)) 493 | 494 | 495 | 496 | # [2.12.0](https://github.com/motss/lit-ntml/compare/v2.11.0...v2.12.0) (2020-02-23) 497 | 498 | 499 | ### chore 500 | 501 | * Upgrade dependencies ([7cc603d](https://github.com/motss/lit-ntml/commit/7cc603dd7e750febfce06cc814b31dce3de2716c)) 502 | 503 | 504 | 505 | # [2.11.0](https://github.com/motss/lit-ntml/compare/v2.10.0...v2.11.0) (2020-01-12) 506 | 507 | 508 | ### chore 509 | 510 | * Use ESM-ify parse5 and minor update to use node@10 ([1f88bd8](https://github.com/motss/lit-ntml/commit/1f88bd85ef11cf1b6238a479bd44e96e2a6a6133)) 511 | 512 | ### test 513 | 514 | * Revert to use parse5 due to CJS ([c6faa88](https://github.com/motss/lit-ntml/commit/c6faa882169546b24803279d16469fedc67fb12a)) 515 | 516 | 517 | 518 | # [2.10.0](https://github.com/motss/lit-ntml/compare/v2.9.0...v2.10.0) (2019-11-07) 519 | 520 | 521 | ### chore 522 | 523 | * Upgrade deps ([ed54fa8](https://github.com/motss/lit-ntml/commit/ed54fa8ea56b82bc13db0e48b60e0691cb3aba02)) 524 | 525 | ### test 526 | 527 | * Drop node@8 and add node@13 ([9618aca](https://github.com/motss/lit-ntml/commit/9618acade07fe0a836a553cd1373a84c0b2c4dc8)) 528 | 529 | 530 | 531 | # [2.9.0](https://github.com/motss/lit-ntml/compare/v2.8.0...v2.9.0) (2019-09-06) 532 | 533 | 534 | 535 | 536 | # [2.8.0](https://github.com/motss/lit-ntml/compare/v2.7.0...v2.8.0) (2019-06-27) 537 | 538 | 539 | 540 | 541 | # [2.7.0](https://github.com/motss/lit-ntml/compare/v2.6.0...v2.7.0) (2019-05-24) 542 | 543 | 544 | 545 | 546 | # [2.6.0](https://github.com/motss/lit-ntml/compare/v2.6.0-beta.0...v2.6.0) (2019-05-18) 547 | 548 | 549 | 550 | 551 | # [2.6.0-beta.0](https://github.com/motss/lit-ntml/compare/v2.5.0...v2.6.0-beta.0) (2019-05-18) 552 | 553 | 554 | 555 | 556 | # [2.5.0](https://github.com/motss/lit-ntml/compare/v1.0.0...v2.5.0) (2019-05-18) 557 | 558 | 559 | 560 | 561 | # [1.0.0](https://github.com/motss/lit-ntml/compare/v0.5.0...v1.0.0) (2018-04-29) 562 | 563 | 564 | 565 | 566 | # [0.5.0](https://github.com/motss/lit-ntml/compare/v0.4.4...v0.5.0) (2018-04-28) 567 | 568 | 569 | 570 | 571 | ## [0.4.4](https://github.com/motss/lit-ntml/compare/v0.4.3...v0.4.4) (2018-04-01) 572 | 573 | 574 | 575 | 576 | ## [0.4.3](https://github.com/motss/lit-ntml/compare/v0.4.2...v0.4.3) (2018-03-23) 577 | 578 | 579 | 580 | 581 | ## [0.4.2](https://github.com/motss/lit-ntml/compare/v0.4.1...v0.4.2) (2018-03-19) 582 | 583 | 584 | 585 | 586 | ## [0.4.1](https://github.com/motss/lit-ntml/compare/v0.4.0...v0.4.1) (2018-03-15) 587 | 588 | 589 | 590 | 591 | # [0.4.0](https://github.com/motss/lit-ntml/compare/v0.3.7...v0.4.0) (2018-03-09) 592 | 593 | 594 | 595 | 596 | ## [0.3.7](https://github.com/motss/lit-ntml/compare/v0.3.6...v0.3.7) (2018-02-08) 597 | 598 | 599 | 600 | 601 | ## [0.3.6](https://github.com/motss/lit-ntml/compare/v0.3.5...v0.3.6) (2017-12-23) 602 | 603 | 604 | 605 | 606 | ## [0.3.5](https://github.com/motss/lit-ntml/compare/v0.3.4...v0.3.5) (2017-12-20) 607 | 608 | 609 | 610 | 611 | ## [0.3.4](https://github.com/motss/lit-ntml/compare/v0.3.3...v0.3.4) (2017-12-17) 612 | 613 | 614 | 615 | 616 | ## [0.3.3](https://github.com/motss/lit-ntml/compare/v0.3.1...v0.3.3) (2017-12-16) 617 | 618 | 619 | 620 | 621 | ## [0.3.1](https://github.com/motss/lit-ntml/compare/v0.3.0...v0.3.1) (2017-12-13) 622 | 623 | 624 | 625 | 626 | # [0.3.0](https://github.com/motss/lit-ntml/compare/v0.2.6...v0.3.0) (2017-12-07) 627 | 628 | 629 | 630 | 631 | ## [0.2.6](https://github.com/motss/lit-ntml/compare/v0.2.5...v0.2.6) (2017-12-06) 632 | 633 | 634 | 635 | 636 | ## [0.2.5](https://github.com/motss/lit-ntml/compare/v0.2.3...v0.2.5) (2017-12-05) 637 | 638 | 639 | 640 | 641 | ## [0.2.3](https://github.com/motss/lit-ntml/compare/v0.2.2...v0.2.3) (2017-12-01) 642 | 643 | 644 | 645 | 646 | ## [0.2.2](https://github.com/motss/lit-ntml/compare/v0.2.1...v0.2.2) (2017-11-25) 647 | 648 | 649 | 650 | 651 | ## [0.2.1](https://github.com/motss/lit-ntml/compare/v0.2.0...v0.2.1) (2017-11-25) 652 | 653 | 654 | 655 | 656 | # 0.2.0 (2017-11-25) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2023 Rong Sen Ng 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

lit-ntml

3 | 4 |

Inspired by lit-html but for Node.js.

5 |
6 | 7 |
8 | 9 | [![Buy me a coffee][buy-me-a-coffee-badge]][buy-me-a-coffee-url] 10 | [![Follow me][follow-me-badge]][follow-me-url] 11 | 12 | [![npm-latest][npm-latest-badge]][npm-latest-url] 13 | [![MIT License][mit-license-badge]][mit-license-url] 14 | 15 | [![Downloads][downloads-badge]][downloads-url] 16 | [![Total downloads][total-downloads-badge]][downloads-url] 17 | 18 | [![Dependencies][dependencies-badge]][dependencies-url] 19 | [![ci][ga-ci-badge]][ga-ci-url] 20 | [![publish][ga-publish-badge]][ga-publish-url] 21 | [![codecov][codecov-badge]][codecov-url] 22 | 23 | [![Code of Conduct][coc-badge]][coc-url] 24 | 25 | > Lightweight and modern templating for SSR in [Node.js][nodejs-url], inspired by [lit-html][lit-html-url]. 26 | 27 | This module also gets featured in [web-padawan/awesome-lit-html][web-padawan-awesome-lit-html-url]. Make sure to check the repo out for awesome things inspired by [lit-html][lit-html-url]. 👍💯 28 | 29 | ## Table of contents 30 | 31 | - [Features](#features) 32 | - [Pre-requisite](#pre-requisite) 33 | - [Enable syntax highlighting when writing HTML with template literal](#enable-syntax-highlighting-when-writing-html-with-template-literal) 34 | - [Visual Studio Code](#visual-studio-code) 35 | - [Install](#install) 36 | - [Usage](#usage) 37 | - [html()](#html) 38 | - [htmlSync()](#htmlsync) 39 | - [htmlFragment()](#htmlfragment) 40 | - [htmlFragmentSync()](#htmlfragmentsync) 41 | - [SSR with Express (Node.js)](#ssr-with-express-nodejs) 42 | - [Browser support](#browser-support) 43 | - [API Reference](#api-reference) 44 | - [html()](#html-1) 45 | - [htmlSync()](#htmlsync-1) 46 | - [htmlFragment()](#htmlfragment-1) 47 | - [htmlFragmentSync()](#htmlfragmentsync-1) 48 | - [deno](#deno) 49 | - [License](#license) 50 | 51 | ## Features 52 | 53 | | Support | Feature | 54 | | --- | --- | 55 | | ✅ | `await` all tasks including Functions, Promises, and whatnot. | 56 | | ✅ | Parse `PromiseList` or `List` by default, without explicit joining. | 57 | | ✅ | Support HTML syntax highlighting + autocompletion with [vscode-lit-html][vscode-lit-html-url] in JavaScript's template string. | 58 | 59 | ## Pre-requisite 60 | 61 | - [Node.js][nodejs-url] >= 16.x 62 | - [ES Modules] 63 | 64 | ## Enable syntax highlighting when writing HTML with template literal 65 | 66 | ### Visual Studio Code 67 | 68 | 1. Install [vscode-lit-html][vscode-lit-html-url] extension. 69 | 2. If the extension does not provide that syntax highlighting and autocompletion, try writing your templates in `.jsx` file (or `.tsx` file if you're [TypeScript][typescript-url] user) . That should work. 70 | 71 | ## Install 72 | 73 | ```sh 74 | # Install via NPM 75 | $ npm install lit-ntml 76 | ``` 77 | 78 | ## Usage 79 | 80 | ### html() 81 | 82 | ```ts 83 | import { html } from 'lit-ntml'; 84 | 85 | const peopleList = ['Cash Black', 'Vict Fisherman']; 86 | const syncTask = () => `

Hello, World!

`; 87 | const asyncLiteral = Promise.resolve('

John Doe

'); 88 | const asyncListTask = async () => ``; 89 | 90 | /** Assuming top-level await is enabled... */ 91 | await html`${syncTask}${asyncLiteral}${asyncListTask}`; /**

Hello, World!

John Doe

*/ 92 | ``` 93 | 94 | ### htmlSync() 95 | 96 | ```ts 97 | import { htmlSync as html } from 'lit-ntml'; 98 | 99 | const peopleList = ['Cash Black', 'Vict Fisherman']; 100 | const syncTask = () => `

Hello, World!

`; 101 | 102 | html`${syncTask}${peopleList}`; 103 | /**

Hello, World!

Cash BlackVictFisherman[object Promise] */ 104 | ``` 105 | 106 | ### htmlFragment() 107 | 108 | ```ts 109 | import { htmlFragment as html } from 'lit-ntml'; 110 | 111 | const syncTask = () => `

Hello, World!

`; 112 | const externalStyleLiteral = ``; 113 | 114 | /** Assuming top-level await is enabled... */ 115 | await html`${externalStyleLiteral}${syncTask}`; /**

Hello, World!

*/ 116 | ``` 117 | 118 | ### htmlFragmentSync() 119 | 120 | ```ts 121 | import { htmlFragmentSync as html } from 'lit-ntml'; 122 | 123 | const peopleList = ['Cash Black', 'Vict Fisherman']; 124 | const syncTask = () => `

Hello, World!

`; 125 | const asyncTask = Promise.resolve(1); 126 | 127 | html`${syncTask}${peopleList}${asyncTask}`; 128 | /**

Hello, World!

Cash BlackVictFisherman[object Promise] */ 129 | ``` 130 | 131 | ### SSR with Express (Node.js) 132 | 133 | [![Edit SSR with Express and LitNtml](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ssr-with-express-and-litntml-4tbv9?fontsize=14) 134 | 135 | ### Browser support 136 | 137 | Only modern browsers with native [ES Modules] support requires no polyfills and transpilation needed. 138 | 139 | ```html 140 | 141 | 142 | 143 | 148 | 149 | 150 | ``` 151 | 152 | ## API Reference 153 | 154 | ### html() 155 | 156 | - returns: <[Promise][promise-mdn-url]<[string][string-mdn-url]>> Promise which resolves with rendered HTML document string. 157 | 158 | ### htmlSync() 159 | 160 | This method works the same as [html()] except that this is the synchronous version. 161 | 162 | ### htmlFragment() 163 | 164 | - returns: <[Promise][promise-mdn-url]<[string][string-mdn-url]>> Promise which resolves with rendered HTML document fragment string. 165 | 166 | ### htmlFragmentSync() 167 | 168 | This method works the same as [htmlFragment()] except that this is the synchronous version. 169 | 170 | ## deno 171 | 172 | 👉 Check out the [deno] module at [deno_mod/lit_ntml]. 173 | 174 | ## License 175 | 176 | [MIT License](https://motss.mit-license.org) © Rong Sen Ng 177 | 178 | 179 | 180 | 181 | [deno_mod/lit_ntml]: https://github.com/motss/deno_mod/tree/master/lit_ntml 182 | [deno]: https://github.com/denoland/deno 183 | [ES Modules]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules 184 | [html()]: #html-1 185 | [htmlFragment()]: #htmlfragment-1 186 | [lit-html-url]: https://github.com/PolymerLabs/lit-html 187 | [nodejs-url]: https://nodejs.org 188 | [typescript-url]: https://github.com/Microsoft/TypeScript 189 | [vscode-lit-html-url]: https://github.com/mjbvz/vscode-lit-html 190 | [web-padawan-awesome-lit-html-url]: https://github.com/web-padawan/awesome-lit-html 191 | 192 | 193 | [boolean-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean 194 | [html-style-element-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement 195 | [map-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map 196 | [number-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number 197 | [object-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object 198 | [promise-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise 199 | [string-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String 200 | 201 | 202 | [buy-me-a-coffee-badge]: https://img.shields.io/badge/buy%20me%20a-coffee-ff813f?logo=buymeacoffee&style=flat-square 203 | [follow-me-badge]: https://img.shields.io/badge/follow-@igarshmyb-1d9bf0?logo=twitter&style=flat-square 204 | 205 | [npm-latest-badge]: https://img.shields.io/npm/v/lit-ntml?color=blue&logo=npm&style=flat-square 206 | [mit-license-badge]: https://img.shields.io/npm/l/lit-ntml?color=blue&style=flat-square 207 | 208 | [downloads-badge]: https://img.shields.io/npm/dm/lit-ntml?style=flat-square 209 | [total-downloads-badge]: https://img.shields.io/npm/dt/lit-ntml?label=total%20downloads&style=flat-square 210 | 211 | [dependencies-badge]: https://img.shields.io/librariesio/release/npm/lit-ntml/latest?style=flat-square 212 | [ga-ci-badge]: https://img.shields.io/github/actions/workflow/status/motss/lit-ntml/ci.yml?branch=main&label=ci&logo=githubactions&logoColor=white&style=flat-square 213 | [ga-publish-badge]: https://img.shields.io/github/actions/workflow/status/motss/lit-ntml/publish.yml?branch=main&label=publish&logo=githubactions&logoColor=white&style=flat-square 214 | [codecov-badge]: https://img.shields.io/codecov/c/github/motss/lit-ntml/main?label=codecov&logo=codecov&style=flat-square 215 | 216 | [coc-badge]: https://img.shields.io/badge/code%20of-conduct-ed55bb?style=flat-square 217 | 218 | 219 | [buy-me-a-coffee-url]: https://www.buymeacoffee.com/RLmMhgXFb 220 | [follow-me-url]: https://twitter.com/igarshmyb?utm_source=github.com&utm_medium=referral&utm_content=motss/lit-ntml 221 | 222 | [npm-latest-url]: https://www.npmjs.com/package/lit-ntml/v/latest 223 | [mit-license-url]: https://github.com/motss/lit-ntml/blob/main/LICENSE 224 | 225 | [downloads-url]: http://www.npmtrends.com/lit-ntml 226 | 227 | [dependencies-url]: https://libraries.io/npm/lit-ntml 228 | [ga-ci-url]: https://github.com/motss/lit-ntml/actions/workflows/ci.yml?query=branch%3Amain 229 | [ga-publish-url]: https://github.com/motss/lit-ntml/actions/workflows/publish.yml?query=branch%3Amain 230 | [codecov-url]: https://app.codecov.io/gh/motss/lit-ntml/tree/main 231 | 232 | [coc-url]: https://github.com/motss/lit-ntml/blob/main/code-of-conduct.md 233 | -------------------------------------------------------------------------------- /code-of-conduct.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at wes.ngrongsen@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lit-ntml", 3 | "version": "4.0.2", 4 | "description": "Inspired by lit-html but for Node.js", 5 | "keywords": [ 6 | "html", 7 | "lit-ntml", 8 | "minify", 9 | "npm", 10 | "ntml", 11 | "parse-html", 12 | "prettify", 13 | "tagged-template-literals", 14 | "template", 15 | "templating" 16 | ], 17 | "homepage": "https://github.com/motss/lit-ntml", 18 | "bugs": { 19 | "url": "https://github.com/motss/lit-ntml/issues" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git@github.com:motss/lit-ntml.git" 24 | }, 25 | "funding": "https://github.com/motss/lit-ntml?sponsor=1", 26 | "license": "MIT", 27 | "author": { 28 | "name": "Rong Sen Ng (motss)", 29 | "email": "wes.ngrongsen@gmail.com", 30 | "url": "https://github.com/motss" 31 | }, 32 | "type": "module", 33 | "exports": { 34 | ".": { 35 | "types": "./dist/index.d.ts", 36 | "import": "./dist/index.js", 37 | "default": "./dist/index.js" 38 | }, 39 | "./dist/*": "./dist/*" 40 | }, 41 | "main": "./dist/index.js", 42 | "module": "./dist/index.js", 43 | "typings": "./dist/index.d.ts", 44 | "files": [ 45 | "dist/*.*js.map", 46 | "dist/*.*js", 47 | "dist/*.d.ts.map", 48 | "dist/*.d.ts", 49 | "!**/*bench*/**/*.*", 50 | "!**/*test*/**/*.*" 51 | ], 52 | "scripts": { 53 | "bench": "vitest bench", 54 | "build": "npm run clean && tsc", 55 | "clean": "sh $(npm root)/@reallyland/tools/cleanup.sh", 56 | "postinstall": "FILE=\"$(npm root)/@reallyland/tools/postinstall.sh\"; if [ -f \"$FILE\" ]; then sh \"$FILE\"; fi", 57 | "lint": "sh $(npm root)/@reallyland/tools/lint-build.sh -c $(npm root)/@reallyland/tools/.eslintrc.json -s 'src/**/*.ts'", 58 | "lint-commit": "sh $(npm root)/@reallyland/tools/lint-commit.sh", 59 | "lint:build": "sh $(npm root)/@reallyland/tools/lint-build.sh -c $(npm root)/@reallyland/tools/browser/.build.eslintrc.json", 60 | "pre-commit": "sh $(npm root)/@reallyland/tools/pre-commit.sh", 61 | "test": "vitest --coverage", 62 | "version": "sh $(npm root)/@reallyland/tools/generate-changelogs.sh && git add *CHANGELOG.md" 63 | }, 64 | "dependencies": { 65 | "parse5": "^7.1.2", 66 | "tslib": "^2.5.0" 67 | }, 68 | "devDependencies": { 69 | "@reallyland/tools": "^0.3.5", 70 | "@vitest/coverage-c8": "^0.28.5", 71 | "vitest": "^0.28.5" 72 | }, 73 | "engines": { 74 | "node": ">= 16.x", 75 | "npm": ">= 8.x" 76 | }, 77 | "publishConfig": { 78 | "access": "public" 79 | }, 80 | "readme": "https://github.com/motss/lit-ntml/blob/main/README.md" 81 | } 82 | -------------------------------------------------------------------------------- /src/benchmarks/html-fragment-sync.bench.ts: -------------------------------------------------------------------------------- 1 | import { bench } from 'vitest'; 2 | 3 | import { htmlFragmentSync } from '../index.js'; 4 | import { testParamsForHtmlFragmentSync } from '../tests/constants.js'; 5 | 6 | testParamsForHtmlFragmentSync 7 | .map(({ inputFn, message }) => ({ inputFn, message })) 8 | .forEach(({ 9 | inputFn, 10 | message, 11 | }) => { 12 | bench(message, () => { 13 | try { 14 | inputFn(htmlFragmentSync); 15 | } catch { 16 | // no-op 17 | } 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /src/benchmarks/html-fragment.bench.ts: -------------------------------------------------------------------------------- 1 | import { bench } from 'vitest'; 2 | 3 | import { htmlFragment } from '../index.js'; 4 | import { testParamsForHtmlFragment } from '../tests/constants.js'; 5 | 6 | testParamsForHtmlFragment 7 | .map(({ inputFn, message }) => ({ inputFn, message })) 8 | .forEach(({ 9 | inputFn, 10 | message, 11 | }) => { 12 | bench(message, async () => { 13 | try { 14 | await inputFn(htmlFragment); 15 | } catch { 16 | // no-op 17 | } 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /src/benchmarks/html-sync.bench.ts: -------------------------------------------------------------------------------- 1 | import { bench } from 'vitest'; 2 | 3 | import { htmlSync } from '../index.js'; 4 | import { testParamsForHtmlSync } from '../tests/constants.js'; 5 | 6 | testParamsForHtmlSync 7 | .map(({ inputFn, message }) => ({ inputFn, message })) 8 | .forEach(({ 9 | inputFn, 10 | message, 11 | }) => { 12 | bench(message, () => { 13 | try { 14 | inputFn(htmlSync); 15 | } catch { 16 | // no-op 17 | } 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /src/benchmarks/html.bench.ts: -------------------------------------------------------------------------------- 1 | import { bench } from 'vitest'; 2 | 3 | import { html } from '../index.js'; 4 | import { testParamsForHtml } from '../tests/constants.js'; 5 | 6 | testParamsForHtml 7 | .map(({ inputFn, message }) => ({ inputFn, message })) 8 | .forEach(({ 9 | inputFn, 10 | message, 11 | }) => { 12 | bench(message, async () => { 13 | try { 14 | await inputFn(html); 15 | } catch { 16 | // no-op 17 | } 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | parse, 3 | parseFragment, 4 | serialize, 5 | } from 'parse5'; 6 | 7 | import { parseLiterals } from './parse-literals.js'; 8 | import { parseLiteralsSync } from './parse-literals-sync.js'; 9 | 10 | // export const DEFAULT_MINIFY_OPTIONS: htmlMinifier.Options = { 11 | // collapseBooleanAttributes: true, 12 | // collapseWhitespace: true, 13 | // minifyCSS: true, 14 | // minifyJS: true, 15 | // processConditionalComments: true, 16 | // quoteCharacter: '"', 17 | // removeComments: true, 18 | // removeOptionalTags: true, 19 | // removeRedundantAttributes: true, 20 | // removeScriptTypeAttributes: true, 21 | // removeStyleLinkTypeAttributes: true, 22 | // sortAttributes: true, 23 | // sortClassName: true, 24 | // trimCustomFragments: true, 25 | // }; 26 | 27 | const parser = parseLiterals(serialize); 28 | const parserSync = parseLiteralsSync(serialize); 29 | 30 | export const html = async (s: TemplateStringsArray, ...e: unknown[]): Promise => 31 | parser((c) => parse(`${c}`), s, ...e); 32 | export const htmlFragment = async (s: TemplateStringsArray, ...e: unknown[]): Promise => 33 | parser(parseFragment, s, ...e); 34 | 35 | export const htmlSync = (s: TemplateStringsArray, ...e: unknown[]): string => 36 | parserSync((c: string) => parse(`${c}`), s, ...e); 37 | export const htmlFragmentSync = (s: TemplateStringsArray, ...e: unknown[]): string => 38 | parserSync(parseFragment, s, ...e); 39 | 40 | // eslint-disable-next-line import/no-anonymous-default-export, import/no-default-export 41 | export default { 42 | html, 43 | htmlFragment, 44 | htmlFragmentSync, 45 | htmlSync, 46 | }; 47 | -------------------------------------------------------------------------------- /src/parse-literals-sync.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | parse, 3 | serialize, 4 | } from 'parse5'; 5 | 6 | import { processLiteralsSync } from './process-literals-sync.js'; 7 | 8 | export function parseLiteralsSync(serializeFn: typeof serialize) { 9 | return ( 10 | fn: typeof parse, 11 | strings: TemplateStringsArray, 12 | ...exps: unknown[] 13 | ): string => { 14 | const content = processLiteralsSync(strings, ...exps); 15 | return serializeFn((fn as typeof parse)(content)); 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/parse-literals.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | parse, 3 | serialize, 4 | } from 'parse5'; 5 | 6 | import { processLiterals } from './process-literals.js'; 7 | 8 | export function parseLiterals(serializeFn: typeof serialize) { 9 | return async ( 10 | fn: typeof parse, 11 | strings: TemplateStringsArray, 12 | ...exps: unknown[] 13 | ): Promise => { 14 | const content = await processLiterals(strings, ...exps); 15 | 16 | return serializeFn((fn as typeof parse)(content)); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/process-literals-sync.ts: -------------------------------------------------------------------------------- 1 | export function processLiteralsSync( 2 | strings: TemplateStringsArray, 3 | ...exps: unknown[] 4 | ): string { 5 | const done = exps.map((n) => { 6 | return (Array.isArray(n) ? n : [n]).map(o => 'function' === typeof(o) ? o() : o); 7 | }); 8 | const doneLen = done.length; 9 | 10 | return strings.reduce((p, n, i) => { 11 | const nTask = done[i] ; 12 | const joined = Array.isArray(nTask) ? nTask.join('') : nTask; 13 | return `${p}${i >= doneLen ? n : `${n}${joined}`}`; 14 | }, ''); 15 | } 16 | -------------------------------------------------------------------------------- /src/process-literals.ts: -------------------------------------------------------------------------------- 1 | export async function processLiterals( 2 | strings: TemplateStringsArray, 3 | ...exps: unknown[] 4 | ): Promise { 5 | const listTask = exps.map(async (n) => { 6 | const tasks = (Array.isArray(n) ? n : [n]) 7 | .map(async o => 'function' === typeof(o) ? o() : o); 8 | 9 | return Promise.all(tasks); 10 | }); 11 | const done = await Promise.all(listTask); 12 | const doneLen = done.length; 13 | 14 | return strings.reduce((p, n, i) => { 15 | const nTask = done[i] ; 16 | const joined = Array.isArray(nTask) ? nTask.join('') : nTask; 17 | return `${p}${i >= doneLen ? n : `${n}${joined}`}`; 18 | }, ''); 19 | } 20 | -------------------------------------------------------------------------------- /src/tests/constants.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | html as baseHtml, 3 | htmlFragment as baseHtmlFragment, 4 | htmlFragmentSync as baseHtmlFragmentSync, 5 | htmlSync as baseHtmlSync, 6 | } from '../index.js'; 7 | 8 | interface TestParamsForHtml { 9 | error?: Error; 10 | expected: string; 11 | inputFn(htmlFn: typeof baseHtml): Promise; 12 | message: string; 13 | } 14 | 15 | interface TestParamsForHtmlFragment extends Omit { 16 | inputFn(htmlFragmentFn: typeof baseHtmlFragment): Promise; 17 | } 18 | 19 | interface TestParamsForHtmlFragmentSync extends Omit { 20 | inputFn(htmlFragmentFn: typeof baseHtmlFragmentSync): string; 21 | } 22 | 23 | interface TestParamsForHtmlSync extends Omit { 24 | inputFn(htmlFn: typeof baseHtmlSync): string; 25 | } 26 | 27 | export const helloWorld = `

Hello, World!

` as const; 28 | export const peopleList = [ 29 | 'John Doe', 30 | 'Michael CEO', 31 | 'Vict Fisherman', 32 | 'Cash Black', 33 | ] as const; 34 | export const removeFullHtmlTags = (input: string): string => { 35 | return input 36 | .replaceAll('', '') 37 | .replaceAll('', '') 38 | .replaceAll('', ''); 39 | }; 40 | 41 | export const defaultTestParamsForHtml: TestParamsForHtml[] = [ 42 | { 43 | expected: `

Hello, World!

`, 44 | inputFn(html) { 45 | return html`${helloWorld}`; 46 | }, 47 | message: 'renders', 48 | }, 49 | { 50 | expected: `

Hello, World!

John Doe

`, 51 | inputFn(html) { 52 | const syncTask = () => helloWorld; 53 | const syncLiteral = 'John Doe'; 54 | 55 | return html`
${syncTask}

${syncLiteral}

`; 56 | }, 57 | message: 'renders with sync tasks', 58 | }, 59 | { 60 | expected: `

Hello, World!

  • John Doe
  • Michael CEO
  • Vict Fisherman
  • Cash Black
`, 61 | inputFn(html) { 62 | return html`${helloWorld}
    ${peopleList.map(n => `
  • ${n}
  • `)}
`; 63 | }, 64 | message: 'renders a list of sync tasks', 65 | }, 66 | { 67 | expected: `

Hello, World!

`, 68 | inputFn(html) { 69 | const asyncExternalStyleTask = () => html`body { margin: 0; padding: 0; box-sizing: border-box; }`; 70 | 71 | return html`${helloWorld}`; 72 | }, 73 | message: 'renders external style', 74 | }, 75 | ]; 76 | const testParamForError: TestParamsForHtml = { 77 | expected: '', 78 | error: new Error('error'), 79 | inputFn(html) { 80 | const errorContent = async () => { 81 | throw new Error('error'); 82 | }; 83 | 84 | return html`${errorContent}`; 85 | }, 86 | message: 'throws when error happens', 87 | }; 88 | const testParamForRenderWithAMixtureOfSyncPlusSyncTasks: TestParamsForHtml = { 89 | expected: `

Hello, World!

John Doe

`, 90 | async inputFn(html) { 91 | const asyncTask = async () => helloWorld; 92 | const syncLiteral = await 'John Doe'; 93 | return html`
${asyncTask}

${syncLiteral}

`; 94 | }, 95 | message: 'renders with a mixture of sync + async tasks', 96 | }; 97 | const testParamForRenderWithAsyncTasks: TestParamsForHtml = { 98 | expected: `

Hello, World!

John Doe

`, 99 | inputFn(html) { 100 | const asyncTask = async () => helloWorld; 101 | const asyncLiteral = Promise.resolve('John Doe'); 102 | 103 | return html`
${asyncTask}

${asyncLiteral}

`; 104 | }, 105 | message: 'renders with async tasks', 106 | }; 107 | 108 | export const testParamsForHtml: TestParamsForHtml[] = [ 109 | ...defaultTestParamsForHtml, 110 | testParamForError, 111 | testParamForRenderWithAMixtureOfSyncPlusSyncTasks, 112 | testParamForRenderWithAsyncTasks, 113 | ]; 114 | 115 | export const testParamsForHtmlFragment: TestParamsForHtmlFragment[] = testParamsForHtml.map(({ 116 | expected, 117 | ...rest 118 | }) => { 119 | return { 120 | ...rest, 121 | expected: removeFullHtmlTags(expected), 122 | }; 123 | }); 124 | 125 | export const testParamsForHtmlSync: TestParamsForHtmlSync[] = [ 126 | ...defaultTestParamsForHtml as unknown as TestParamsForHtmlSync[], 127 | { 128 | ...testParamForError, 129 | inputFn(html) { 130 | return html`${() => { throw new Error('error'); }}`; 131 | }, 132 | }, 133 | { 134 | ...testParamForRenderWithAMixtureOfSyncPlusSyncTasks, 135 | expected: `
[object Promise]

[object Promise]

`, 136 | inputFn(html) { 137 | const asyncTask = async () => helloWorld; 138 | const syncLiteral = Promise.resolve('John Doe'); 139 | return html`
${asyncTask}

${syncLiteral}

`; 140 | }, 141 | }, 142 | { 143 | ...testParamForRenderWithAsyncTasks as unknown as TestParamsForHtmlSync, 144 | expected: `
[object Promise]

[object Promise]

`, 145 | }, 146 | ]; 147 | 148 | export const testParamsForHtmlFragmentSync: TestParamsForHtmlFragmentSync[] = testParamsForHtmlSync.map(({ 149 | expected, 150 | ...rest 151 | }) => { 152 | return { 153 | ...rest, 154 | expected: removeFullHtmlTags(expected), 155 | }; 156 | }); 157 | -------------------------------------------------------------------------------- /src/tests/html-fragment-sync.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, it } from 'vitest'; 2 | 3 | import { htmlFragmentSync } from '../index.js'; 4 | import { testParamsForHtmlFragmentSync } from './constants.js'; 5 | 6 | testParamsForHtmlFragmentSync.forEach(({ 7 | error, 8 | expected, 9 | inputFn, 10 | message, 11 | }) => { 12 | it(message, () => { 13 | try { 14 | const result = inputFn(htmlFragmentSync); 15 | 16 | if (error) { 17 | expect.fail('it should not throw an error'); 18 | } else { 19 | expect(result).toBe(expected); 20 | } 21 | } catch (e) { 22 | if (error) { 23 | expect(e).toEqual(error); 24 | } else if (e && error == null) { 25 | console.error(e); 26 | expect.fail('it should not throw any error'); 27 | } 28 | } 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /src/tests/html-fragment.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, it } from 'vitest'; 2 | 3 | import { htmlFragment } from '../index.js'; 4 | import { testParamsForHtmlFragment } from './constants.js'; 5 | 6 | testParamsForHtmlFragment.forEach(({ 7 | error, 8 | expected, 9 | inputFn, 10 | message, 11 | }) => { 12 | it(message, async () => { 13 | try { 14 | const result = await inputFn(htmlFragment); 15 | 16 | if (error) { 17 | expect.fail('it should throw an error'); 18 | } else { 19 | expect(result).toBe(expected); 20 | } 21 | } catch (e) { 22 | if (error) { 23 | expect(e).toEqual(error); 24 | } else if (e && error == null) { 25 | console.error(e); 26 | expect.fail('it should not throw any error'); 27 | } 28 | } 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /src/tests/html-sync.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, it } from 'vitest'; 2 | 3 | import { htmlSync } from '..'; 4 | import { testParamsForHtmlSync } from './constants.js'; 5 | 6 | testParamsForHtmlSync.forEach(({ 7 | error, 8 | expected, 9 | inputFn, 10 | message, 11 | }) => { 12 | it(message, () => { 13 | try { 14 | const result = inputFn(htmlSync); 15 | 16 | if (error) { 17 | expect.fail('it should throw an error'); 18 | } else { 19 | expect(result).toBe(expected); 20 | } 21 | } catch (e) { 22 | if (error) { 23 | expect(e).toEqual(error); 24 | } else if (e && error == null) { 25 | console.error(e, { cause: message }); 26 | expect.fail('it should not throw any error'); 27 | } 28 | } 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /src/tests/html.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, it } from 'vitest'; 2 | 3 | import { html } from '../index.js'; 4 | import { testParamsForHtml } from './constants.js'; 5 | 6 | testParamsForHtml.forEach(({ 7 | error, 8 | expected, 9 | inputFn, 10 | message, 11 | }) => { 12 | it(message, async () => { 13 | try { 14 | const result = await inputFn(html); 15 | 16 | if (error) { 17 | expect.fail('it should throw an error'); 18 | } else { 19 | expect(result).toBe(expected); 20 | } 21 | } catch (e) { 22 | if (error) { 23 | expect(e).toEqual(error); 24 | } else if (e && error == null) { 25 | console.error(e, { cause: message }); 26 | expect.fail('it should not throw any error'); 27 | } 28 | } 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./node_modules/@reallyland/tools/browser/tsconfig.json", 3 | "compilerOptions": { 4 | "declarationDir": "dist", 5 | "outDir": "dist", 6 | "rootDir": "src" 7 | }, 8 | "include": ["src/**/*.ts"], 9 | "exclude": ["dist", "node_modules"] 10 | } 11 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { defineConfig } from 'vite'; 4 | 5 | export default defineConfig({ 6 | test: { 7 | coverage: { 8 | exclude: [ 9 | '**/{benchmarks,tests}/**', 10 | ], 11 | reporter: ['lcov', 'text'], 12 | }, 13 | }, 14 | }) 15 | --------------------------------------------------------------------------------