├── .branchlintrc ├── .browserslistrc ├── .devcontainer └── devcontainer.json ├── .editorconfig ├── .env.example ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── budgets │ ├── lighthouse.json │ └── sitespeed.json ├── pull_request_template.md └── workflows │ ├── codeql-analysis.yml │ ├── main.yml │ ├── next.yml │ ├── pull-request.yml │ ├── sonar-cloud.yml │ └── test.yml ├── .gitignore ├── .husky ├── commit-msg ├── pre-commit └── pre-push ├── .lintstagedrc ├── .mailmap ├── .npmignore ├── .nvmrc ├── .prettierrc.js ├── .releaserc ├── .stylelintignore ├── .stylelintrc ├── .svgorc.yml ├── .vscode └── launch.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── build.config.js ├── commitlint.config.mjs ├── docs ├── .vitepress │ ├── config.ts │ ├── navigation.ts │ └── theme │ │ ├── custom.css │ │ ├── index.ts │ │ └── style.css ├── components │ ├── Logo.vue │ ├── VPNavBarMenu.vue │ ├── VPNavBarTitle.vue │ └── VPNavScreenMenu.vue ├── composables │ └── version.ts ├── src │ ├── components │ │ ├── booster-iframe.md │ │ ├── booster-image.md │ │ ├── booster-layer.md │ │ ├── booster-picture.md │ │ ├── booster-vimeo.md │ │ ├── booster-youtube.md │ │ └── weak-hardware-overlay.md │ ├── composables │ │ ├── useBoosterComponentObserver.md │ │ ├── useBoosterConfig.md │ │ ├── useBoosterCritical.md │ │ ├── useBoosterFont.md │ │ ├── useBoosterHead.md │ │ ├── useBoosterHydrate.md │ │ └── useBoosterProvide.md │ ├── concept.md │ ├── directives │ │ └── v-font.md │ ├── guide │ │ ├── caveats.md │ │ ├── definitions.md │ │ ├── options.md │ │ ├── setup.md │ │ └── usage.md │ ├── index.md │ ├── migration │ │ ├── v2-0-13.md │ │ ├── v2-2-0.md │ │ ├── v2.md │ │ ├── v3.1.0.md │ │ └── v3.md │ ├── public │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── icon.png │ │ ├── logo-dark.svg │ │ ├── logo-light.svg │ │ ├── logo-small-dark.svg │ │ ├── logo-small-light.svg │ │ ├── poster-dark.jpg │ │ ├── poster-light.jpg │ │ └── site.webmanifest │ └── v2 │ │ ├── classes │ │ └── loading-spinner.md │ │ ├── components │ │ ├── booster-iframe.md │ │ ├── booster-image.md │ │ ├── booster-layer.md │ │ ├── booster-picture.md │ │ ├── booster-vimeo.md │ │ └── booster-youtube.md │ │ ├── concept.md │ │ ├── directives │ │ └── v-font.md │ │ ├── guide │ │ ├── caveats.md │ │ ├── options.md │ │ ├── setup.md │ │ └── usage.md │ │ ├── index.md │ │ └── public │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── icon.png │ │ ├── logo-dark.svg │ │ ├── logo-light.svg │ │ ├── logo-small-dark.svg │ │ ├── logo-small-light.svg │ │ ├── poster-dark.jpg │ │ ├── poster-light.jpg │ │ └── site.webmanifest └── types.d.ts ├── eslint.config.js ├── eslint.ignores.js ├── jsconfig.json ├── nuxt-booster.code-workspace ├── package-lock.json ├── package.json ├── playground ├── .nuxtignore ├── app.vue ├── assets │ ├── fonts │ │ ├── merriweather-v22-latin │ │ │ ├── merriweather-v22-latin-300.eot │ │ │ ├── merriweather-v22-latin-300.svg │ │ │ ├── merriweather-v22-latin-300.ttf │ │ │ ├── merriweather-v22-latin-300.woff │ │ │ ├── merriweather-v22-latin-300.woff2 │ │ │ ├── merriweather-v22-latin-300italic.eot │ │ │ ├── merriweather-v22-latin-300italic.svg │ │ │ ├── merriweather-v22-latin-300italic.ttf │ │ │ ├── merriweather-v22-latin-300italic.woff │ │ │ ├── merriweather-v22-latin-300italic.woff2 │ │ │ ├── merriweather-v22-latin-700.eot │ │ │ ├── merriweather-v22-latin-700.svg │ │ │ ├── merriweather-v22-latin-700.ttf │ │ │ ├── merriweather-v22-latin-700.woff │ │ │ ├── merriweather-v22-latin-700.woff2 │ │ │ ├── merriweather-v22-latin-700italic.eot │ │ │ ├── merriweather-v22-latin-700italic.svg │ │ │ ├── merriweather-v22-latin-700italic.ttf │ │ │ ├── merriweather-v22-latin-700italic.woff │ │ │ ├── merriweather-v22-latin-700italic.woff2 │ │ │ ├── merriweather-v22-latin-italic.eot │ │ │ ├── merriweather-v22-latin-italic.svg │ │ │ ├── merriweather-v22-latin-italic.ttf │ │ │ ├── merriweather-v22-latin-italic.woff │ │ │ ├── merriweather-v22-latin-italic.woff2 │ │ │ ├── merriweather-v22-latin-regular.eot │ │ │ ├── merriweather-v22-latin-regular.svg │ │ │ ├── merriweather-v22-latin-regular.ttf │ │ │ ├── merriweather-v22-latin-regular.woff │ │ │ └── merriweather-v22-latin-regular.woff2 │ │ ├── montserrat-alternates-v12-latin │ │ │ ├── montserrat-alternates-v12-latin-100.woff │ │ │ ├── montserrat-alternates-v12-latin-100.woff2 │ │ │ ├── montserrat-alternates-v12-latin-100italic.woff │ │ │ ├── montserrat-alternates-v12-latin-100italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-200.woff │ │ │ ├── montserrat-alternates-v12-latin-200.woff2 │ │ │ ├── montserrat-alternates-v12-latin-200italic.woff │ │ │ ├── montserrat-alternates-v12-latin-200italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-300.woff │ │ │ ├── montserrat-alternates-v12-latin-300.woff2 │ │ │ ├── montserrat-alternates-v12-latin-300italic.woff │ │ │ ├── montserrat-alternates-v12-latin-300italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-500.woff │ │ │ ├── montserrat-alternates-v12-latin-500.woff2 │ │ │ ├── montserrat-alternates-v12-latin-500italic.woff │ │ │ ├── montserrat-alternates-v12-latin-500italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-600.woff │ │ │ ├── montserrat-alternates-v12-latin-600.woff2 │ │ │ ├── montserrat-alternates-v12-latin-600italic.woff │ │ │ ├── montserrat-alternates-v12-latin-600italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-700.woff │ │ │ ├── montserrat-alternates-v12-latin-700.woff2 │ │ │ ├── montserrat-alternates-v12-latin-700italic.woff │ │ │ ├── montserrat-alternates-v12-latin-700italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-800.woff │ │ │ ├── montserrat-alternates-v12-latin-800.woff2 │ │ │ ├── montserrat-alternates-v12-latin-800italic.woff │ │ │ ├── montserrat-alternates-v12-latin-800italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-900.woff │ │ │ ├── montserrat-alternates-v12-latin-900.woff2 │ │ │ ├── montserrat-alternates-v12-latin-900italic.woff │ │ │ ├── montserrat-alternates-v12-latin-900italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-italic.woff │ │ │ ├── montserrat-alternates-v12-latin-italic.woff2 │ │ │ ├── montserrat-alternates-v12-latin-regular.woff │ │ │ └── montserrat-alternates-v12-latin-regular.woff2 │ │ └── quicksand-v21-latin │ │ │ ├── quicksand-v21-latin-300.woff │ │ │ ├── quicksand-v21-latin-300.woff2 │ │ │ ├── quicksand-v21-latin-500.woff │ │ │ ├── quicksand-v21-latin-500.woff2 │ │ │ ├── quicksand-v21-latin-600.woff │ │ │ ├── quicksand-v21-latin-600.woff2 │ │ │ ├── quicksand-v21-latin-700.woff │ │ │ ├── quicksand-v21-latin-700.woff2 │ │ │ ├── quicksand-v21-latin-regular.woff │ │ │ └── quicksand-v21-latin-regular.woff2 │ ├── img │ │ ├── critical-2400.jpg │ │ └── lazy-2400.jpg │ ├── spinner │ │ └── three-circles.svg │ └── svg │ │ └── chevron-down.svg ├── components │ ├── InfoLayer.vue │ ├── PageHeader.vue │ ├── PreviewContainer.vue │ ├── WeakHardwareOverlay.vue │ ├── base │ │ ├── Button.vue │ │ ├── Headline.vue │ │ └── LinkList.vue │ ├── elements │ │ ├── GithubCorner.vue │ │ ├── LoaderTest.vue │ │ └── ScrollItem.vue │ ├── fragments │ │ ├── PageHeaderMenu.vue │ │ └── ScrollContainer.vue │ └── modules │ │ ├── ImageText.vue │ │ ├── Stage.vue │ │ ├── TextFontA.vue │ │ ├── TextFontB.vue │ │ ├── VideoVimeo.vue │ │ └── VideoYoutube.vue ├── layouts │ ├── blank.vue │ └── default.vue ├── nuxt.config.ts ├── pages │ ├── index.vue │ └── tests │ │ ├── booster-hydrate │ │ ├── components │ │ │ ├── Critical.vue │ │ │ ├── Custom.vue │ │ │ ├── Lazy.vue │ │ │ └── Media.vue │ │ └── index.vue │ │ ├── booster-layer │ │ └── index.vue │ │ ├── booster-loader │ │ ├── components │ │ │ ├── Critical.vue │ │ │ └── Lazy.vue │ │ └── index.vue │ │ ├── iframe │ │ ├── components │ │ │ ├── Critical.vue │ │ │ └── Lazy.vue │ │ └── index.vue │ │ ├── image │ │ ├── components │ │ │ ├── Critical.vue │ │ │ └── Lazy.vue │ │ └── index.vue │ │ ├── index.vue │ │ ├── picture │ │ ├── components │ │ │ ├── Critical.vue │ │ │ └── Lazy.vue │ │ └── index.vue │ │ ├── useBoosterHead.vue │ │ ├── useBoosterHead │ │ ├── 1.vue │ │ ├── 2.vue │ │ ├── empty-1.vue │ │ ├── empty-2.vue │ │ └── index.vue │ │ ├── v-font-media │ │ ├── components │ │ │ ├── Critical.vue │ │ │ └── Lazy.vue │ │ └── index.vue │ │ ├── v-font-scroll │ │ ├── components │ │ │ ├── Horizontal.vue │ │ │ └── Vertical.vue │ │ └── index.vue │ │ ├── v-font │ │ ├── components │ │ │ ├── Critical.vue │ │ │ └── Lazy.vue │ │ └── index.vue │ │ ├── vimeo │ │ ├── components │ │ │ └── Default.vue │ │ └── index.vue │ │ ├── weak-hardware-overlay │ │ └── index.vue │ │ └── youtube │ │ ├── components │ │ └── Default.vue │ │ └── index.vue ├── postcss │ └── functions.ts ├── public │ ├── favicon.ico │ ├── icon.png │ └── img │ │ ├── critical.jpg │ │ ├── image-text-a.jpg │ │ ├── image-text-b.jpg │ │ ├── lazy.jpg │ │ ├── stage-landscape.jpg │ │ └── stage-portrait.jpg └── types.d.ts ├── renovate.json ├── src ├── assets │ └── media │ │ └── video.mp4 ├── classes │ └── FontConfig.ts ├── hookFunctions │ ├── nitro │ │ └── init.ts │ ├── vite.ts │ └── webpack.ts ├── module.ts ├── runtime │ ├── classes │ │ ├── Cache.ts │ │ ├── CallbackObserver.ts │ │ ├── Deferred.ts │ │ ├── Font.ts │ │ ├── FontCollection.ts │ │ ├── FontList.ts │ │ ├── FontsCollection.ts │ │ ├── intersection │ │ │ ├── ElementObserver.ts │ │ │ ├── Observable.ts │ │ │ └── index.ts │ │ └── lighthouse │ │ │ ├── Error.ts │ │ │ └── Stats.ts │ ├── components │ │ ├── BoosterIframe.vue │ │ ├── BoosterImage.vue │ │ ├── BoosterImage │ │ │ ├── Base.vue │ │ │ ├── classes │ │ │ │ └── Source.ts │ │ │ ├── props.ts │ │ │ └── utils │ │ │ │ └── image.ts │ │ ├── BoosterLayer.vue │ │ ├── BoosterPicture.vue │ │ ├── BoosterPicture │ │ │ ├── Base.vue │ │ │ ├── Source.vue │ │ │ ├── classes │ │ │ │ └── SourceList.ts │ │ │ └── props.ts │ │ ├── BoosterVimeo.vue │ │ ├── BoosterVimeo │ │ │ ├── Base.vue │ │ │ ├── classes │ │ │ │ └── Vimeo.ts │ │ │ ├── props.ts │ │ │ └── utils │ │ │ │ └── loader.ts │ │ ├── BoosterYoutube.vue │ │ ├── BoosterYoutube │ │ │ ├── Base.vue │ │ │ ├── classes │ │ │ │ └── Youtube.ts │ │ │ ├── props.ts │ │ │ └── utils │ │ │ │ └── loader.ts │ │ ├── Button.vue │ │ ├── HydrateWrapper.ts │ │ └── WeakHardwareOverlay.vue │ ├── composables │ │ ├── useBoosterComponentObserver.ts │ │ ├── useBoosterConfig.ts │ │ ├── useBoosterCritical.ts │ │ ├── useBoosterFonts.ts │ │ ├── useBoosterHead.ts │ │ ├── useBoosterHydrate.ts │ │ └── useBoosterProvide.ts │ ├── directives │ │ └── vFont.ts │ ├── hydrate.ts │ └── utils │ │ ├── base64.ts │ │ ├── browser.ts │ │ ├── deprecation.ts │ │ ├── description.ts │ │ ├── entry.ts │ │ ├── lighthouse.ts │ │ ├── log.ts │ │ ├── performance.ts │ │ ├── plugin.client.ts │ │ ├── plugin.server.ts │ │ ├── string.ts │ │ ├── support.ts │ │ └── validators.ts ├── tmpl │ ├── entry.tmpl.ts │ └── plugin.tmpl.ts ├── types │ ├── directive.ts │ ├── font.ts │ ├── head.ts │ ├── index.ts │ ├── module.ts │ └── observable.ts ├── utils.ts └── utils │ ├── blob.ts │ ├── browser.ts │ ├── optimization.ts │ ├── options.ts │ ├── template.ts │ └── types.ts ├── test ├── default.test.ts ├── module.test.ts ├── nuxt.config.ts ├── tests │ ├── browser.ts │ ├── html.ts │ └── utils │ │ └── getTypesContent.test.ts ├── types.ts └── utils.ts ├── tsconfig.json ├── vetur.config.json └── vitest.config.ts /.branchlintrc: -------------------------------------------------------------------------------- 1 | { 2 | "branchNameLinter": { 3 | "prefixes": [ 4 | "feature", 5 | "hotfix", 6 | "release", 7 | "renovate", 8 | "beta", 9 | "next" 10 | ], 11 | "suggestions": { 12 | "features": "feature", 13 | "feat": "feature", 14 | "fix": "hotfix", 15 | "releases": "release" 16 | }, 17 | "banned": [ 18 | "wip" 19 | ], 20 | "skip": [ 21 | "skip-ci" 22 | ], 23 | "disallowed": [ 24 | "main", 25 | "master", 26 | "next", 27 | "staging" 28 | ], 29 | "seperator": "/", 30 | "msgBranchBanned": "Branches with the name \"%s\" are not allowed.", 31 | "msgBranchDisallowed": "Pushing to \"%s\" is not allowed, use git-flow.", 32 | "msgPrefixNotAllowed": "Branch prefix \"%s\" is not allowed.", 33 | "msgPrefixSuggestion": "Instead of \"%s\" try \"%s\".", 34 | "msgSeperatorRequired": "Branch \"%s\" must contain a seperator \"%s\"." 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | not IE 11 3 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node 3 | { 4 | "name": "Node.js", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "mcr.microsoft.com/devcontainers/javascript-node:22" 7 | 8 | // Features to add to the dev container. More info: https://containers.dev/features. 9 | // "features": {}, 10 | 11 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 12 | // "forwardPorts": [], 13 | 14 | // Use 'postCreateCommand' to run commands after the container is created. 15 | // "postCreateCommand": "yarn install", 16 | 17 | // Configure tool-specific properties. 18 | // "customizations": {}, 19 | 20 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 21 | // "remoteUser": "root" 22 | } 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # BUILDER= # webpack | vite 2 | # BASE_URL= 3 | # HOST= 4 | # PORT= 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: nuxt-booster 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/budgets/lighthouse.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /.github/budgets/sitespeed.json: -------------------------------------------------------------------------------- 1 | { 2 | "budget": { 3 | "score": { 4 | "performance": 50 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | * **Please check if the PR fulfills these requirements** 2 | - [ ] The commit message follows our guidelines 3 | - [ ] Tests for the changes have been added (for bug fixes / features) 4 | - [ ] Docs have been added / updated (for bug fixes / features) 5 | 6 | 7 | * **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) 8 | 9 | 10 | 11 | * **What is the current behavior?** (You can also link to an open issue here) 12 | 13 | 14 | 15 | * **What is the new behavior (if this is a feature change)?** 16 | 17 | 18 | 19 | * **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) 20 | 21 | 22 | 23 | * **Other information**: 24 | -------------------------------------------------------------------------------- /.github/workflows/next.yml: -------------------------------------------------------------------------------- 1 | name: Next 2 | 3 | on: 4 | push: 5 | branches: 6 | - next 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | install: 14 | if: "!contains(github.event.head_commit.message, 'skip ci')" 15 | name: Install 16 | runs-on: ${{ matrix.os }} 17 | 18 | strategy: 19 | matrix: 20 | os: [ubuntu-latest] 21 | node: [22] 22 | 23 | steps: 24 | - uses: actions/setup-node@v4 25 | with: 26 | node-version: ${{ matrix.node }} 27 | - name: Checkout Repo 28 | uses: actions/checkout@v4 29 | - name: cache node_modules 30 | uses: actions/cache@v4 31 | id: cache 32 | with: 33 | path: | 34 | node_modules 35 | key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} 36 | 37 | - name: Install Dependencies 38 | if: steps.cache.outputs.cache-hit != 'true' 39 | run: npm ci 40 | 41 | - name: Install Playwright 42 | run: npx playwright install --with-deps 43 | 44 | - name: Lint 45 | run: npm run lint 46 | 47 | - name: Test 48 | run: npm run test 49 | 50 | semantic-version: 51 | name: Semantic Release 52 | needs: install 53 | runs-on: ${{ matrix.os }} 54 | 55 | strategy: 56 | matrix: 57 | os: [ubuntu-latest] 58 | node: [22] 59 | 60 | steps: 61 | - uses: actions/setup-node@v4 62 | with: 63 | node-version: ${{ matrix.node }} 64 | - name: Checkout Repo 65 | uses: actions/checkout@v4 66 | - name: cache node_modules 67 | uses: actions/cache@v4 68 | id: cache 69 | with: 70 | path: node_modules 71 | key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} 72 | - name: Versioning 73 | env: 74 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 75 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 76 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 77 | run: | 78 | npx -p @nuxt/module-builder -p semantic-release -p @semantic-release/git -p @semantic-release/changelog -p @semantic-release/exec -p @semantic-release/github semantic-release 79 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Pull-Request 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - "**" 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | install: 14 | name: Install 15 | runs-on: ${{ matrix.os }} 16 | 17 | strategy: 18 | matrix: 19 | os: [ubuntu-latest] 20 | node: [22] 21 | 22 | steps: 23 | - uses: actions/setup-node@v4 24 | with: 25 | node-version: ${{ matrix.node }} 26 | - name: Checkout Repo 27 | uses: actions/checkout@v4 28 | - name: cache node_modules 29 | uses: actions/cache@v4 30 | id: cache 31 | with: 32 | path: | 33 | node_modules 34 | key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} 35 | 36 | - name: Install Dependencies 37 | if: steps.cache.outputs.cache-hit != 'true' 38 | run: npm ci 39 | 40 | - name: Lint 41 | run: npm run lint 42 | 43 | publish: 44 | name: Publish Preview 45 | needs: install 46 | runs-on: ${{ matrix.os }} 47 | 48 | strategy: 49 | matrix: 50 | os: [ubuntu-latest] 51 | node: [22] 52 | 53 | steps: 54 | - uses: actions/setup-node@v4 55 | with: 56 | node-version: ${{ matrix.node }} 57 | - name: Checkout Repo 58 | uses: actions/checkout@v4 59 | - name: cache node_modules 60 | uses: actions/cache@v4 61 | id: cache 62 | with: 63 | path: node_modules 64 | key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} 65 | - name: Build 66 | run: | 67 | npx pkg-pr-new publish 68 | -------------------------------------------------------------------------------- /.github/workflows/sonar-cloud.yml: -------------------------------------------------------------------------------- 1 | name: Sonar 2 | on: 3 | push: 4 | branches: 5 | - "main" 6 | pull_request: 7 | types: [opened, synchronize, reopened] 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | analyze: 15 | name: Analyze 16 | runs-on: ${{ matrix.os }} 17 | 18 | strategy: 19 | matrix: 20 | os: [ubuntu-latest] 21 | node: [22] 22 | 23 | steps: 24 | - uses: actions/setup-node@v4 25 | with: 26 | node-version: ${{ matrix.node }} 27 | 28 | - name: Checkout Repo 29 | uses: actions/checkout@v4 30 | with: 31 | # Disabling shallow clone is recommended for improving relevancy of reporting 32 | fetch-depth: 0 33 | 34 | - name: cache node_modules 35 | uses: actions/cache@v4 36 | id: cache 37 | with: 38 | path: | 39 | node_modules 40 | key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} 41 | 42 | - name: Install Dependencies 43 | if: steps.cache.outputs.cache-hit != 'true' 44 | run: npm ci 45 | 46 | - name: Lint (Report Generate) 47 | run: npm run lint:report 48 | 49 | - name: get-npm-version 50 | id: package-version 51 | uses: martinbeentjes/npm-get-version-action@main 52 | 53 | - name: SonarQube Scan 54 | uses: SonarSource/sonarqube-scan-action@master 55 | with: 56 | args: > 57 | -Dsonar.organization=basics 58 | -Dsonar.projectKey=basics_nuxt-booster 59 | -Dsonar.eslint.reportPaths=eslint-report.json 60 | -Dsonar.projectVersion=${{ steps.package-version.outputs.current-version}} 61 | env: 62 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 63 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 64 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, reopened] 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | build: 13 | name: Test & Build 14 | runs-on: ${{ matrix.os }} 15 | 16 | strategy: 17 | matrix: 18 | os: [ubuntu-latest] 19 | #os: [ubuntu-latest, macos-latest, windows-latest] 20 | node: [22] 21 | 22 | steps: 23 | - uses: actions/setup-node@v4 24 | with: 25 | node-version: ${{ matrix.node }} 26 | 27 | - name: Checkout Repo 28 | uses: actions/checkout@v4 29 | 30 | - name: cache node_modules 31 | uses: actions/cache@v4 32 | id: cache 33 | with: 34 | path: | 35 | node_modules 36 | ~/.cache/ms-playwright/ 37 | ~\AppData\Local\ms-playwright\ 38 | key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} 39 | 40 | - name: Install Dependencies 41 | if: steps.cache.outputs.cache-hit != 'true' 42 | run: npm ci 43 | 44 | - name: Install Playwright 45 | run: npx playwright install --with-deps 46 | 47 | - name: Lint 48 | run: npm run lint 49 | 50 | - name: Test 51 | run: npm run test 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.iml 3 | .idea 4 | .history 5 | *.log* 6 | .nuxt 7 | .vscode/settings.json 8 | !.vscode/launch.json 9 | .DS_Store 10 | .eslintcache 11 | coverage 12 | dist 13 | .reports 14 | test/.* 15 | sw.* 16 | .output 17 | eslint-report.json 18 | .env 19 | 20 | # docs 21 | docs/.vitepress/dist 22 | docs/.vitepress/cache 23 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | export NVM_DIR="$HOME/.nvm" 5 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 6 | 7 | npx --no-install commitlint --edit $1 8 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | export NVM_DIR="$HOME/.nvm" 5 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 6 | 7 | npx --no-install lint-staged 8 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | export NVM_DIR="$HOME/.nvm" 5 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 6 | 7 | npx branch-name-lint .branchlintrc 8 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.(js|vue)": [ 3 | "npm run lint:es" 4 | ] 5 | } -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Renovate Bot 2 | StephanGerbeth 3 | Thorn Walli 4 | semantic-release-bot 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .* 3 | ._* 4 | .DS_Store 5 | .git 6 | .hg 7 | .npmrc 8 | .lock-wscript 9 | .svn 10 | npm-debug.log 11 | 12 | *.iml 13 | .idea 14 | *.log* 15 | .nuxt 16 | .history 17 | .reports 18 | .vscode/* 19 | !.vscode/launch.json 20 | .DS_Store 21 | coverage 22 | .husky 23 | *.code-workspace 24 | jsconfig.json 25 | vitest.config.js 26 | CODE_OF_CONDUCT.md 27 | CONTRIBUTING.md 28 | CHANGELOG.md 29 | README.md 30 | commitlint.config.js 31 | renovate.json 32 | vetur.config.json 33 | sandbox.config.json 34 | build.config.js 35 | .output 36 | 37 | /docs 38 | /src 39 | /playground 40 | /test 41 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 22.14.0 2 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | export default { 2 | arrowParens: 'avoid', 3 | bracketSameLine: false, 4 | trailingComma: 'none', 5 | singleQuote: true, 6 | semi: true, 7 | printWidth: 80 8 | }; 9 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "branches": [ 3 | { 4 | "name": "main", 5 | "channel": "latest", 6 | "prerelease": false 7 | }, 8 | { 9 | "name": "beta", 10 | "prerelease": true 11 | }, 12 | { 13 | "name": "next", 14 | "prerelease": true 15 | } 16 | ], 17 | "plugins": [ 18 | "@semantic-release/commit-analyzer", 19 | "@semantic-release/release-notes-generator", 20 | [ 21 | "@semantic-release/changelog", 22 | { 23 | "changelogFile": "CHANGELOG.md", 24 | "changelogTitle": "# Project Changelog" 25 | } 26 | ], 27 | [ 28 | "@semantic-release/npm" 29 | ], 30 | [ 31 | "@semantic-release/git", 32 | { 33 | "assets": [ 34 | "CHANGELOG.md", 35 | "CHANGELOG_PROJECT.md", 36 | "package.json", 37 | "package-lock.json", 38 | "npm-shrinkwrap.json" 39 | ] 40 | } 41 | ], 42 | [ 43 | "@semantic-release/github" 44 | ] 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | # Common 2 | node_modules 3 | dist 4 | .nuxt 5 | coverage 6 | .reports 7 | 8 | # Files 9 | **/*.js 10 | src/runtime/tmpl/fonts.css 11 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "stylelint-config-standard", 4 | "stylelint-config-recess-order" 5 | ], 6 | "customSyntax": "postcss-html", 7 | "ignoreFiles": [ 8 | "./**/*.js" 9 | ], 10 | "rules": { 11 | "no-descending-specificity": null, 12 | "value-keyword-case": [ 13 | "lower", 14 | { 15 | "camelCaseSvgKeywords": true 16 | } 17 | ], 18 | "declaration-property-value-no-unknown": [ 19 | true, 20 | { 21 | "ignoreProperties": { 22 | "/.+/": "/(vw|em)+/" 23 | } 24 | } 25 | ], 26 | "function-no-unknown": [ 27 | true, 28 | { 29 | "ignoreFunctions": [ 30 | "lost-vars", 31 | "em", 32 | "vw" 33 | ] 34 | } 35 | ], 36 | "selector-pseudo-class-no-unknown": [ 37 | true, 38 | { 39 | "ignorePseudoClasses": [ 40 | "global", 41 | "deep" 42 | ] 43 | } 44 | ], 45 | "selector-pseudo-element-no-unknown": [ 46 | true, 47 | { 48 | "ignorePseudoElements": [ 49 | "v-deep" 50 | ] 51 | } 52 | ] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /.svgorc.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | - cleanupAttrs: true 3 | - removeDoctype: true 4 | - removeXMLProcInst: true 5 | - removeComments: true 6 | - removeMetadata: true 7 | - removeTitle: true 8 | - removeDesc: true 9 | - removeUselessDefs: true 10 | - removeXMLNS: true 11 | - removeEditorsNSData: true 12 | - removeEmptyAttrs: true 13 | - removeHiddenElems: false 14 | - removeEmptyText: true 15 | - removeEmptyContainers: true 16 | - removeViewBox: false 17 | - cleanupEnableBackground: true 18 | - minifyStyles: true 19 | - convertStyleToAttrs: true 20 | - convertColors: true 21 | - convertPathData: true 22 | - convertTransform: true 23 | - removeUnknownsAndDefaults: true 24 | - removeNonInheritableGroupAttrs: true 25 | - removeUselessStrokeAndFill: true 26 | - removeUnusedNS: true 27 | - cleanupIDs: true 28 | - cleanupNumericValues: true 29 | - cleanupListOfValues: true 30 | - moveElemsAttrsToGroup: true 31 | - moveGroupAttrsToElems: true 32 | - collapseGroups: false 33 | - mergePaths: true 34 | - convertShapeToPath: true 35 | # WARNING DANGER DANGER 36 | - sortAttrs: false 37 | - removeDimensions: false 38 | - removeAttrs: false 39 | - removeElementsByAttr: false 40 | - addClassesToSVGElement: false 41 | - addAttributesToSVGElement: false 42 | - removeStyleElement: false 43 | - removeScriptElement: false 44 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "envFile": "${workspaceFolder}/.env", 6 | "presentation": { 7 | "group": "nuxt" 8 | }, 9 | "command": "npm run dev", 10 | "name": "Debug: dev", 11 | "request": "launch", 12 | "type": "node-terminal" 13 | }, 14 | { 15 | "envFile": "${workspaceFolder}/.env", 16 | "presentation": { 17 | "group": "nuxt" 18 | }, 19 | "command": "npm run build", 20 | "name": "Debug: build", 21 | "request": "launch", 22 | "type": "node-terminal" 23 | }, 24 | { 25 | "envFile": "${workspaceFolder}/.env", 26 | "presentation": { 27 | "group": "nuxt" 28 | }, 29 | "command": "npm run generate", 30 | "name": "Debug: generate", 31 | "request": "launch", 32 | "type": "node-terminal" 33 | }, 34 | { 35 | "envFile": "${workspaceFolder}/.env", 36 | "presentation": { 37 | "group": "others" 38 | }, 39 | "command": "npm run start", 40 | "name": "Serve (dist)", 41 | "request": "launch", 42 | "type": "node-terminal" 43 | }, 44 | { 45 | "presentation": { 46 | "group": "tests" 47 | }, 48 | "command": "npm run vitest:dev", 49 | "name": "Debug: vitest:dev", 50 | "request": "launch", 51 | "type": "node-terminal" 52 | } 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Nuxt-Booster 2 | 3 | We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: 4 | 5 | - Reporting a bug 6 | - Discussing the current state of the code 7 | - Submitting a fix 8 | - Proposing new features 9 | - Becoming a maintainer 10 | 11 | ## We Develop with Github 12 | 13 | We use github to host code, to track issues and feature requests, as well as accept pull requests. 14 | 15 | ## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests 16 | 17 | Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests: 18 | 19 | 1. Fork the repo and create your branch from `main`. 20 | 2. If you've added code that should be tested, add tests. 21 | 3. If you've changed APIs, update the documentation. 22 | 4. Ensure the test suite passes. 23 | 5. Make sure your code lints. 24 | 6. Issue that pull request! 25 | 26 | ## Any contributions you make will be under the MIT Software License 27 | 28 | In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. 29 | 30 | ## Report bugs using Github's [issues](https://github.com/basics/nuxt-booster/issues) 31 | 32 | We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/basics/nuxt-booster/issues/new/choose); it's that easy! 33 | 34 | ## Write bug reports with detail, background, and sample code 35 | 36 | **Great Bug Reports** tend to have: 37 | 38 | - A quick summary and/or background 39 | - Steps to reproduce 40 | - Be specific! 41 | - Give sample code if you can. 42 | - What you expected would happen 43 | - What actually happens 44 | - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) 45 | 46 | People *love* thorough bug reports. I'm not even kidding. 47 | 48 | ## License 49 | 50 | By contributing, you agree that your contributions will be licensed under its MIT License. 51 | 52 | ## References 53 | 54 | This document was adapted from the open-source contribution guidelines from [Brian A. Danielak](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62) 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 basics 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.config.js: -------------------------------------------------------------------------------- 1 | import { defineBuildConfig } from 'unbuild'; 2 | 3 | export default defineBuildConfig({ 4 | failOnWarn: false, 5 | externals: [ 6 | 'vue-bundle-renderer', 7 | '@nuxt/image', 8 | 'browserslist-useragent-regexp', 9 | 'cheerio', 10 | 'defu', 11 | 'dom-serializer', 12 | 'dynamic-class-list', 13 | 'htmlparser2', 14 | 'image-meta', 15 | 'pathe', 16 | 'mime-types', 17 | 'mime-db', 18 | '#build/types/booster', 19 | 'sort-css-media-queries' 20 | ], 21 | hooks: { 22 | 'build:done': async () => { 23 | // copy all things under src/assets to dist/assets 24 | const { copy } = await import('fs-extra'); 25 | await copy('src/assets', 'dist/assets'); 26 | } 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /commitlint.config.mjs: -------------------------------------------------------------------------------- 1 | const config = { extends: ['@commitlint/config-conventional'] }; 2 | export default config; 3 | -------------------------------------------------------------------------------- /docs/.vitepress/config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'url'; 2 | // import type { DefaultTheme, UserConfig } from 'vitepress'; 3 | import { defineConfigWithTheme } from 'vitepress'; 4 | import markdownItInlineComments from 'markdown-it-inline-comments'; 5 | import navigation from './navigation'; 6 | 7 | // 'UserConfig 8 | 9 | // https://vitepress.dev/reference/site-config 10 | export default defineConfigWithTheme({ 11 | markdown: { 12 | config: md => { 13 | md.use(markdownItInlineComments); 14 | } 15 | }, 16 | 17 | base: getBaseUrl(), 18 | 19 | vite: { 20 | resolve: { 21 | alias: [ 22 | { 23 | find: /^.*\/VPNavBarTitle\.vue$/, 24 | replacement: fileURLToPath( 25 | new URL('../components/VPNavBarTitle.vue', import.meta.url) 26 | ) 27 | }, 28 | { 29 | find: /^.*\/VPNavBarMenu\.vue$/, 30 | replacement: fileURLToPath( 31 | new URL('../components/VPNavBarMenu.vue', import.meta.url) 32 | ) 33 | }, 34 | { 35 | find: /^.*\/VPNavScreenMenu\.vue$/, 36 | replacement: fileURLToPath( 37 | new URL('../components/VPNavScreenMenu.vue', import.meta.url) 38 | ) 39 | } 40 | ] 41 | } 42 | }, 43 | 44 | srcDir: 'src', 45 | 46 | title: 'Nuxt Booster', 47 | description: 48 | 'Nuxt Booster takes over the Lighthouse performance optimization of your generated website.', 49 | themeConfig: { 50 | // https://vitepress.dev/reference/default-theme-config 51 | 52 | logoComponent: true, 53 | 54 | ...navigation, 55 | 56 | socialLinks: [ 57 | { icon: 'github', link: 'https://github.com/basics/nuxt-booster' } 58 | ] 59 | }, 60 | 61 | sitemap: { 62 | hostname: 'https://basics.github.io/nuxt-booster/' 63 | } 64 | }); 65 | 66 | function getBaseUrl() { 67 | return process.env.npm_config_base_url || process.env.BASE_URL || '/'; 68 | } 69 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/custom.css: -------------------------------------------------------------------------------- 1 | iframe.embed-sandbox, 2 | iframe.embed-stackblitz { 3 | width: 100%; 4 | height: 480px; 5 | border: none; 6 | } 7 | 8 | :root { 9 | --vp-c-brand-1: #DC143C; 10 | --vp-c-brand-2: #DC143C; 11 | } 12 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | // https://vitepress.dev/guide/custom-theme 2 | import { h } from 'vue'; 3 | import DefaultTheme from 'vitepress/theme'; 4 | import './style.css'; 5 | import './custom.css'; 6 | 7 | /** @type {import('vitepress').Theme} */ 8 | export default { 9 | extends: DefaultTheme, 10 | Layout: () => { 11 | return h(DefaultTheme.Layout, null, { 12 | // https://vitepress.dev/guide/extending-default-theme#layout-slots 13 | }); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /docs/components/VPNavBarMenu.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 42 | 43 | 55 | -------------------------------------------------------------------------------- /docs/components/VPNavBarTitle.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 28 | 29 | 58 | -------------------------------------------------------------------------------- /docs/components/VPNavScreenMenu.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 43 | -------------------------------------------------------------------------------- /docs/composables/version.ts: -------------------------------------------------------------------------------- 1 | import { useData } from 'vitepress'; 2 | import { computed } from 'vue'; 3 | 4 | export default function useVersion() { 5 | const { theme, page } = useData(); 6 | 7 | const defaultVersion = computed( 8 | () => 9 | theme.value.version.find( 10 | ({ isDefault }: { isDefault: boolean }) => isDefault 11 | )?.version 12 | ); 13 | 14 | const currentVersion = computed(() => 15 | Number( 16 | (/v(\d+)\/.*/.test(page.value.relativePath) && 17 | page.value.relativePath.replace(/v(\d+)\/.*/, '$1')) || 18 | defaultVersion.value 19 | ) 20 | ); 21 | 22 | const nav = computed(() => { 23 | return ( 24 | theme.value.version?.length && [ 25 | { 26 | text: `v${currentVersion.value}`, 27 | items: theme.value.version 28 | .filter( 29 | ({ version }: { version: number }) => 30 | version !== currentVersion.value 31 | ) 32 | .map( 33 | ({ 34 | version, 35 | isDefault 36 | }: { 37 | version: number; 38 | isDefault: boolean; 39 | }) => { 40 | return { 41 | text: `v${version}`, 42 | link: isDefault ? '/' : `/v${version}/` 43 | }; 44 | } 45 | ) 46 | } 47 | ] 48 | ); 49 | }); 50 | 51 | return { 52 | defaultVersion, 53 | currentVersion, 54 | nav 55 | }; 56 | } 57 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterComponentObserver.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: useBoosterComponentObserver 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | ## Types 8 | 9 | ```ts 10 | declare function useBoosterComponentObserver(options?: ObservableOptions): { 11 | el: Ref; 12 | inView: Ref; 13 | }; 14 | 15 | declare interface ObservableOptions = { 16 | root?: HTMLElement; 17 | rootMargin?: string; 18 | threshold?: number | number[]; 19 | trackVisibility?: boolean; 20 | delay?: number; 21 | }; 22 | ``` 23 | 24 | ## Options 25 | 26 | | Property | Description | Default Value | 27 | | ----------------- | ------------------------------------------------------------------------------------------------------------------- | ------------- | 28 | | `root` | [MDN `root`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#root) | `undefined` | 29 | | `rootMargin` | [MDN `rootMargin`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootMargin) | `'0px'` | 30 | | `threshold` | [MDN `threshold`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#threshold) | `[0]` | 31 | | `trackVisibility` | [MDN `trackVisibility`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#trackVisibility) | `false` | 32 | | `delay` | [MDN `delay`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#delay) | `0` | 33 | 34 | ## Return 35 | 36 | | Property | Description | 37 | | -------- | --------------------------------------------------------------- | 38 | | `el` | Component ref for tag referencing. | 39 | | `inView` | Reference that indicates whether referenced element is visible. | 40 | 41 | ## Example 42 | 43 | ```html 44 | 49 | 50 | 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: useBoosterConfig 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | ## Types 8 | 9 | ```ts 10 | declare function useBoosterConfig(): ModulePublicRuntimeConfig; 11 | ``` 12 | 13 | ## Return 14 | 15 | Returns booster public runtime options. 16 | 17 | ## Example 18 | 19 | ```ts 20 | const $boosterConfig: ModulePublicRuntimeConfig = useBoosterConfig(); 21 | 22 | console.log($boosterConfig.lazyOffsetComponent); 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterCritical.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: useBoosterCritical 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | ## Types 8 | 9 | ```ts 10 | declare function useBoosterCritical(options?: { 11 | critical?: boolean; 12 | }): { 13 | isCritical: ComputedRef; 14 | }; 15 | ``` 16 | 17 | ## Options 18 | 19 | | Property | Description | Default Value | 20 | | ---------- | --------------------------------- | ---------------------- | 21 | | `critical` | Override critical from component. | inherit from component | 22 | 23 | ```js 24 | const { isCritical } = useBoosterCritical({critical: true}); 25 | ``` 26 | 27 | ## Return 28 | 29 | | Property | Description | 30 | | ------------ | ------------------------------------- | 31 | | `isCritical` | Indicates whether critical is active. | 32 | 33 | ## Example 34 | 35 | ```vue 36 | 39 | 40 | 43 | ``` 44 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterFont.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: useBoosterFont 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | ## Types 8 | 9 | ```ts 10 | 11 | declare default function useBoosterFonts(options?: { 12 | critical?: boolean; 13 | }): { 14 | isCritical: Ref; 15 | $getFont: (family: FontFamily | DirectiveGetFontArguments, weight?: FontWeight, style?: FontStyle, options?: DirectiveGetFontOptions) => DirectiveGetFontResult; 16 | }; 17 | 18 | ``` 19 | 20 | ## Options 21 | 22 | | Property | Description | Default Value | 23 | | ---------- | --------------------------------- | ---------------------- | 24 | | `critical` | Override critical from component. | inherit from component | 25 | 26 | ```js 27 | const { $getFont } = useBoosterFonts({critical: true}); 28 | ``` 29 | 30 | ## Return 31 | 32 | | Property | Description | 33 | | ------------ | ------------------------------------------------------------------------------------------ | 34 | | `isCritical` | Indicates whether critical is active. | 35 | | `$getFont` | [Learn more about `$getFont`](/directives/v-font.html#getfont-family-weight-style-options) | 36 | 37 | ## Example 38 | 39 | ```html 40 | 43 | 44 | 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterHead.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ⚠️ useBoosterHead 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | ::: warning 8 | 9 | `useBoosterhead` is an internally used composable that is called once in the plugin. 10 | 11 | Is required to create and manage a head entry. 12 | 13 | ::: 14 | 15 | ## Types 16 | 17 | ```ts 18 | declare function useBoosterHead(): HeadFontCollector; 19 | ``` 20 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterHydrate.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: useBoosterHydrate 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | Compasable provides a function for wrapping components in order to control hydration. 8 | 9 | [Learn more about component import](/guide/usage#import-components). 10 | 11 | ## Types 12 | 13 | ```ts 14 | import type { AsyncComponentLoader, Component, HydrationStrategy } from 'vue'; 15 | 16 | declare function useBoosterHydrate(): (component: AsyncComponentLoader, hydrate?: HydrationStrategy) => T; 17 | ``` 18 | 19 | ## Arguments 20 | 21 | | name | Description | Default | 22 | | ----------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------- | 23 | | `component` | Component import function | | 24 | | `hydrateOverride` | Hydrate override function.
Learn more about [Lazy Hydration](https://vuejs.org/guide/components/async#lazy-hydration). | `hydrateOnVisible(…)` | 25 | 26 | ## Return 27 | 28 | Returns import wrapper function. 29 | 30 | ## Example 31 | 32 | ```js 33 | const hydrate = useBoosterHydrate(); 34 | 35 | const component = hydrate( 36 | () => import('@/components/MyComponent.vue'), 37 | hydrateOnVisibleSpezificRoute({ rootMargin: '100px' }) 38 | ); 39 | ``` 40 | 41 | ### Useful 42 | 43 | With a custom hydrate function, you can control the hydration of components. 44 | 45 | It is possible to create a custom hydrate function that will hydrate only on a specific route. 46 | 47 | #### Example 48 | 49 | ```js 50 | 51 | const $router = useRouter(); 52 | 53 | const hydrateOnVisibleSpezificRoute = options => (hydrate, forEach) => { 54 | if ($router.currentRoute.value === 'specific-route') { 55 | return hydrateOnVisible(options)(hydrate, forEach); 56 | } else { 57 | hydrate(); 58 | } 59 | }; 60 | 61 | ``` 62 | -------------------------------------------------------------------------------- /docs/src/composables/useBoosterProvide.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: useBoosterProvide 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | Provides an alternative for Provide call via `nuxtApp`. 8 | 9 | **Example:** 10 | 11 | ```html 12 | 22 | ``` 23 | 24 | ## Types 25 | 26 | ```ts 27 | declare function useBoosterProvide(): BoosterProvide; 28 | ``` 29 | 30 | ## Return 31 | 32 | Returns booster provide instance. 33 | 34 | ## Example 35 | 36 | ```ts 37 | const $boosterConfig: BoosterProvide = useBoosterProvide(); 38 | 39 | console.log($boosterConfig.getImageSize('/image.jpg')); 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/src/migration/v2-0-13.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Migrate from v2.0.x to v2.0.13' 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | With the change to version `2.0.13` there are the following changes: 8 | 9 | ## BoosterLayer 10 | 11 | ### Hardware performance check removed 12 | 13 | The hardware check for showing the `BoosterLayer` has been removed. 14 | 15 | The option `device` from module and the use of the message (`#nuxt-booster-message-outdated-device`) in the BoosterLayer, are no longer valid and must be removed. 16 | 17 | Alternatively, it now waits for a free `idle` slot when initializing the JS, 18 | 19 | - if a free slot is available, the JS is initialized 20 | - if no free slot is available, the message `#nuxt-booster-message-weak-hardware` is showed in the BoosterLayer. 21 | 22 | The old message `#nuxt-booster-message-outdated-device` must be replaced by the new `#nuxt-booster-message-weak-hardware`. ([See Messages](#messages)) 23 | 24 | ### Messages 25 | 26 | 1. `outdated-device` to `weak-hardware` 27 | 28 | ```html 29 |
  • 30 | outdated device 31 |
  • 32 | ``` 33 | 34 | replaced with 35 | 36 | ```html 37 |
  • 38 | weak hardware 39 |
  • 40 | ``` 41 | 42 | 2. `slow-connection` to `reduced-bandwidth` 43 | 44 | ```html 45 |
  • 46 | slow-connection 47 |
  • 48 | ``` 49 | 50 | replaced with 51 | 52 | ```html 53 |
  • 54 | reduced-bandwidth 55 |
  • 56 | ``` 57 | 58 | ### Button Interactions 59 | 60 | Button `#nuxt-booster-button-init-font` has been replaced by `#nuxt-booster-button-init-reduced-view`. 61 | 62 | `#nuxt-booster-button-init-reduced-view` does the following when clicked: 63 | 64 | 1. Sets the CSS class `nuxt-booster-reduced-view` on the `html` tag. 65 | 2. Activates all fonts by setting the class `font-active` on all elements with the attribute `data-font`. 66 | 3. Converts all not activated pictures (`:hydrate="false"`) from `noscript` to `picture`. 67 | 68 | ::: info 69 | The CSS class `nuxt-booster-reduced-view` is removed again at app initialization. 70 | ::: 71 | -------------------------------------------------------------------------------- /docs/src/migration/v3.1.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Migrate from v3 to v3.1.0' 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | With the change to version `3.1.0` there are the following changes: 8 | 9 | ## Module option `optimizePreloads` 10 | 11 | The `optimizePreloads` property has been replaced by `optimizeSSR`. 12 | 13 | Learn more about [`optimizeSSR`](/guide/options.html#optimizessr), 14 | 15 | ## Poster `BoosterYoutube` and `BoosterVimeo` 16 | 17 | There is a new property `posterSources` to configure the posters in `BoosterYoutube` and `BoosterVimeo`. 18 | 19 | The following property has been removed: 20 | 21 | - `posterDensities` 22 | - `posterSizes` 23 | - `posterSrc` 24 | 25 | **Before:** 26 | 27 | ```vue 28 | 40 | 41 | ``` 42 | 43 | **After:** 44 | 45 | ```vue 46 | 72 | 73 | ``` 74 | -------------------------------------------------------------------------------- /docs/src/migration/v3.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Migrate from v2 to v3' 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | With `v3` the documentation was changed. You can find the previous version [here](/v2/). 8 | 9 | ## Deprecations 10 | 11 | ### Components 12 | 13 | | Component | | 14 | | ----------------------------- | ------------------------------------------------------------------------------------ | 15 | | `abstracts/ComponentObserver` | replaced with composable [`useBoosterComponentObserver`](/composables/useBoosterComponentObserver) | 16 | | `abstracts/AbstractOnlySsr` | removed | 17 | 18 | ### options 19 | 20 | | Option | | 21 | | --------------------- | ------- | 22 | | `loader` | removed | 23 | | `componentAutoImport` | removed | 24 | | `componentPrefix` | removed | 25 | 26 | ## Components 27 | 28 | Componenten wurden umbenannt. 29 | 30 | | Old | New | 31 | | ----------------- | ---------------- | 32 | | `BoosterPicture` | `BoosterPicture` | 33 | | `BoosterImage` | `BoosterImage` | 34 | | `BoosterLayer` | `BoosterLayer` | 35 | | `BoosterIframe` | `BoosterIframe` | 36 | | `BoosterYoutube` | `BoosterYoutube` | 37 | | `BoosterVimeo` | `BoosterVimeo` | 38 | 39 | ### `BoosterPicture` & `BoosterImage` 40 | 41 | The property `loader` has been removed. 42 | 43 | ## Directives 44 | 45 | ### `v-font` 46 | 47 | If the directive `v-font` is used, the composable `useBoosterFont` must be used. 48 | So that the `$getFont` function can be provided in the template. 49 | 50 | ```html 51 | 54 | 55 | 58 | ``` 59 | 60 | Note that when sub-components are used, the top-level component is given a `useCritical`. 61 | This is necessary so that the `critical` property is inherited. 62 | 63 | ```html 64 | 67 | ``` 68 | 69 | for the use of critical components. 70 | 71 | ```html 72 | 75 | -------------------------------------------------------------------------------- /docs/src/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/src/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/src/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/src/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/favicon-16x16.png -------------------------------------------------------------------------------- /docs/src/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/favicon-32x32.png -------------------------------------------------------------------------------- /docs/src/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/favicon.ico -------------------------------------------------------------------------------- /docs/src/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/icon.png -------------------------------------------------------------------------------- /docs/src/public/logo-small-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/public/logo-small-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/public/poster-dark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/poster-dark.jpg -------------------------------------------------------------------------------- /docs/src/public/poster-light.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/public/poster-light.jpg -------------------------------------------------------------------------------- /docs/src/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-booster", 3 | "short_name": "nuxt-booster", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#DC143C", 17 | "background_color": "#333333", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /docs/src/v2/classes/loading-spinner.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: LoadingSpinner 3 | --- 4 | 5 | # {{$frontmatter.title}} 6 | 7 | Path: `#booster/components/BoosterImage/classes/LoadingSpinner.js` 8 | 9 | The LoadingSpinner instance describes the visual appearance of the loading state in the [`BoosterImage`](/v2/components/booster-image). This can be defined globally via the module settings or at the specific components. 10 | 11 | ````js 12 | new LoadingSpinner({dataUri, size, backgroundColor}); 13 | ```` 14 | 15 | ### dataUri 16 | 17 | - Type: `String` 18 | 19 | Defines the source of the loader. (e.g. `@/assets/spinner/three-circles.svg`) 20 | 21 | ### size 22 | 23 | - Type: `String` 24 | 25 | Defines the size of the loader. Use css `background-size` definition. (e.g. `100px`) 26 | 27 | ### backgroundColor 28 | 29 | - Type: `String` 30 | 31 | Defines the background color of the loader. Use css `color` definition. (e.g. `#fff`) 32 | -------------------------------------------------------------------------------- /docs/src/v2/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/src/v2/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/src/v2/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/src/v2/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/favicon-16x16.png -------------------------------------------------------------------------------- /docs/src/v2/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/favicon-32x32.png -------------------------------------------------------------------------------- /docs/src/v2/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/favicon.ico -------------------------------------------------------------------------------- /docs/src/v2/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/icon.png -------------------------------------------------------------------------------- /docs/src/v2/public/logo-small-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/v2/public/logo-small-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/v2/public/poster-dark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/poster-dark.jpg -------------------------------------------------------------------------------- /docs/src/v2/public/poster-light.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/docs/src/v2/public/poster-light.jpg -------------------------------------------------------------------------------- /docs/src/v2/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-booster", 3 | "short_name": "nuxt-booster", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#DC143C", 17 | "background_color": "#333333", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /docs/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'vitepress/dist/client/theme-default/composables/langs.js'; 2 | declare module 'vitepress/dist/client/theme-default/support/utils.js'; 3 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import { withNuxt } from './playground/.nuxt/eslint.config.mjs'; 2 | import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; 3 | import eslintIgnores from './eslint.ignores.js'; 4 | import pluginSecurity from 'eslint-plugin-security'; 5 | import tseslint from 'typescript-eslint'; 6 | 7 | export default withNuxt({ 8 | files: ['**/*.js', '**/*.ts', '**/*.d.ts', '**/*.vue'], 9 | rules: { 10 | 'prettier/prettier': 'error', 11 | classPrivateMethods: 'off', 12 | 'block-spacing': 'error', 13 | 'no-debugger': 'off', 14 | 'no-console': 'off', 15 | 'vue/no-v-html': 'off', 16 | 'vue/no-mutating-props': 'off', 17 | 'security/detect-non-literal-fs-filename': 'off', 18 | complexity: [ 19 | 'error', 20 | { 21 | max: 10 22 | } 23 | ], 24 | 'no-multiple-empty-lines': [ 25 | 'error', 26 | { 27 | max: 1, 28 | maxEOF: 1 29 | } 30 | ], 31 | 'vue/component-name-in-template-casing': [ 32 | 'error', 33 | 'kebab-case', 34 | { 35 | registeredComponentsOnly: true, 36 | ignores: [] 37 | } 38 | ], 39 | 'vue/multi-word-component-names': 'off', 40 | 'vue/html-self-closing': 'off' // prettier conflict 41 | } 42 | }).prepend( 43 | eslintIgnores, 44 | tseslint.configs.recommended, 45 | pluginSecurity.configs.recommended, 46 | eslintPluginPrettierRecommended 47 | ); 48 | -------------------------------------------------------------------------------- /eslint.ignores.js: -------------------------------------------------------------------------------- 1 | export default { 2 | ignores: ['.history', '**/.vitepress/cache/*', '**/dist/*'] 3 | }; 4 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./playground/.nuxt/tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "nuxt-booster/*": [ 7 | "src/*" 8 | ], 9 | "#booster/*": [ 10 | "src/runtime/*" 11 | ], 12 | "@/*": [ 13 | "playground/*" 14 | ], 15 | "@@/*": [ 16 | "./*" 17 | ] 18 | } 19 | }, 20 | "exclude": [ 21 | "node_modules" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /playground/.nuxtignore: -------------------------------------------------------------------------------- 1 | pages/**/components/**/*.vue 2 | # pages/**/*.vue 3 | # !pages/index.vue 4 | -------------------------------------------------------------------------------- /playground/app.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.eot -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.ttf -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.woff -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.eot -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.ttf -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-300italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.eot -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.ttf -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.woff -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.eot -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.ttf -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-700italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.eot -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.ttf -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.eot -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.ttf -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.woff -------------------------------------------------------------------------------- /playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/merriweather-v22-latin/merriweather-v22-latin-regular.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-100italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-200italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-300italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-500italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-600italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-700italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-800italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-900italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-italic.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-italic.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-regular.woff -------------------------------------------------------------------------------- /playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/montserrat-alternates-v12-latin/montserrat-alternates-v12-latin-regular.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-300.woff -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-300.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-500.woff -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-500.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-600.woff -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-600.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-700.woff -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-700.woff2 -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-regular.woff -------------------------------------------------------------------------------- /playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/fonts/quicksand-v21-latin/quicksand-v21-latin-regular.woff2 -------------------------------------------------------------------------------- /playground/assets/img/critical-2400.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/img/critical-2400.jpg -------------------------------------------------------------------------------- /playground/assets/img/lazy-2400.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/assets/img/lazy-2400.jpg -------------------------------------------------------------------------------- /playground/assets/spinner/three-circles.svg: -------------------------------------------------------------------------------- 1 | 3 | 5 | 13 | 14 | 16 | 24 | 25 | 27 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /playground/assets/svg/chevron-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /playground/components/PageHeader.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | 23 | -------------------------------------------------------------------------------- /playground/components/WeakHardwareOverlay.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 30 | 31 | 51 | -------------------------------------------------------------------------------- /playground/components/base/Button.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 42 | 43 | 68 | -------------------------------------------------------------------------------- /playground/components/base/Headline.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 32 | -------------------------------------------------------------------------------- /playground/components/base/LinkList.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 36 | 37 | 72 | -------------------------------------------------------------------------------- /playground/components/elements/LoaderTest.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 32 | -------------------------------------------------------------------------------- /playground/components/elements/ScrollItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 31 | 32 | 56 | -------------------------------------------------------------------------------- /playground/components/fragments/ScrollContainer.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | 31 | 56 | -------------------------------------------------------------------------------- /playground/components/modules/TextFontA.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 39 | 40 | 49 | -------------------------------------------------------------------------------- /playground/components/modules/TextFontB.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 37 | 38 | 47 | -------------------------------------------------------------------------------- /playground/components/modules/VideoVimeo.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 28 | 29 | 38 | -------------------------------------------------------------------------------- /playground/components/modules/VideoYoutube.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 26 | 27 | 32 | -------------------------------------------------------------------------------- /playground/layouts/blank.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-hydrate/components/Critical.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-hydrate/components/Custom.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-hydrate/components/Lazy.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-hydrate/components/Media.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-hydrate/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 49 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-layer/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 52 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-loader/components/Critical.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-loader/components/Lazy.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | -------------------------------------------------------------------------------- /playground/pages/tests/booster-loader/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 20 | -------------------------------------------------------------------------------- /playground/pages/tests/iframe/components/Critical.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /playground/pages/tests/iframe/components/Lazy.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | -------------------------------------------------------------------------------- /playground/pages/tests/iframe/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /playground/pages/tests/image/components/Critical.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 36 | -------------------------------------------------------------------------------- /playground/pages/tests/image/components/Lazy.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 35 | -------------------------------------------------------------------------------- /playground/pages/tests/image/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /playground/pages/tests/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /playground/pages/tests/picture/components/Critical.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 37 | -------------------------------------------------------------------------------- /playground/pages/tests/picture/components/Lazy.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 37 | -------------------------------------------------------------------------------- /playground/pages/tests/picture/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /playground/pages/tests/useBoosterHead.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 56 | 57 | 63 | -------------------------------------------------------------------------------- /playground/pages/tests/useBoosterHead/1.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /playground/pages/tests/useBoosterHead/2.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /playground/pages/tests/useBoosterHead/empty-1.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /playground/pages/tests/useBoosterHead/empty-2.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /playground/pages/tests/useBoosterHead/index.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 56 | 57 | 68 | -------------------------------------------------------------------------------- /playground/pages/tests/v-font-media/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /playground/pages/tests/v-font-scroll/components/Horizontal.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 31 | -------------------------------------------------------------------------------- /playground/pages/tests/v-font-scroll/components/Vertical.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | -------------------------------------------------------------------------------- /playground/pages/tests/v-font-scroll/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /playground/pages/tests/v-font/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /playground/pages/tests/vimeo/components/Default.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 47 | -------------------------------------------------------------------------------- /playground/pages/tests/vimeo/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 31 | -------------------------------------------------------------------------------- /playground/pages/tests/weak-hardware-overlay/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 28 | -------------------------------------------------------------------------------- /playground/pages/tests/youtube/components/Default.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 48 | -------------------------------------------------------------------------------- /playground/pages/tests/youtube/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 31 | -------------------------------------------------------------------------------- /playground/postcss/functions.ts: -------------------------------------------------------------------------------- 1 | export function rem(value: string, base = 16) { 2 | return `${parseInt(resolveValue(value)) / base}rem`; 3 | } 4 | 5 | export function em(value: string, base = 16) { 6 | return `calc(${resolveValue(value)} / ${base} * 1em)`; 7 | } 8 | 9 | export function vw(value: number, viewport: number = 375) { 10 | return `${(value / viewport) * 100}vw`; 11 | } 12 | 13 | const resolveValue = (value: string | number) => { 14 | value = String(value); 15 | if (value.endsWith('value')) { 16 | return String(parseInt(value)); 17 | } else { 18 | return String(value).replace('calc', '').replace('px', ''); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /playground/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/favicon.ico -------------------------------------------------------------------------------- /playground/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/icon.png -------------------------------------------------------------------------------- /playground/public/img/critical.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/img/critical.jpg -------------------------------------------------------------------------------- /playground/public/img/image-text-a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/img/image-text-a.jpg -------------------------------------------------------------------------------- /playground/public/img/image-text-b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/img/image-text-b.jpg -------------------------------------------------------------------------------- /playground/public/img/lazy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/img/lazy.jpg -------------------------------------------------------------------------------- /playground/public/img/stage-landscape.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/img/stage-landscape.jpg -------------------------------------------------------------------------------- /playground/public/img/stage-portrait.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/playground/public/img/stage-portrait.jpg -------------------------------------------------------------------------------- /playground/types.d.ts: -------------------------------------------------------------------------------- 1 | import type { NuxtLinkProps } from '#app/components'; 2 | import type { DefineComponent } from 'vue'; 3 | 4 | declare module '*.svg?component' { 5 | const component: DefineComponent; 6 | export default component; 7 | } 8 | 9 | export interface LinkProps extends NuxtLinkProps { 10 | title: string; 11 | } 12 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@nuxtjs", 4 | ":semanticCommits" 5 | ], 6 | "packageRules": [ 7 | { 8 | "matchPackagePatterns": [ 9 | "nuxt" 10 | ], 11 | "groupName": "nuxt" 12 | }, 13 | { 14 | "packageNames": [ 15 | "node" 16 | ], 17 | "major": { 18 | "enabled": true 19 | }, 20 | "separateMultipleMajor": true, 21 | "allowedVersions": "^20" 22 | } 23 | ], 24 | "baseBranches": [ 25 | "main" 26 | ], 27 | "rangeStrategy": "pin" 28 | } 29 | -------------------------------------------------------------------------------- /src/assets/media/video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basics/nuxt-booster/442df06ce8a940b55086e4ca164683ad1740c11a/src/assets/media/video.mp4 -------------------------------------------------------------------------------- /src/hookFunctions/vite.ts: -------------------------------------------------------------------------------- 1 | import type { ViteBuildContext, ViteBuildContextExtend } from '../module'; 2 | 3 | export function registerAppEntry(filePath: string) { 4 | return (context: ViteBuildContext) => { 5 | const config = context.config; 6 | if (!('ssr' in config) && config.build?.rollupOptions) { 7 | config.build.rollupOptions.input = filePath; 8 | } 9 | (context as ViteBuildContextExtend).entry = filePath; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /src/hookFunctions/webpack.ts: -------------------------------------------------------------------------------- 1 | import type { Configuration } from 'webpack'; 2 | 3 | export const registerAppEntry = (filePath: string) => { 4 | return (configs: Configuration[]) => { 5 | return configs 6 | .filter(({ name }) => name && ['client'].includes(name)) 7 | .forEach(config => { 8 | const entry = config.entry as Record; 9 | if (entry?.app) { 10 | entry.app = entry.app.map(file => { 11 | if (file.endsWith('entry')) { 12 | return filePath; 13 | } 14 | return file; 15 | }); 16 | } 17 | }); 18 | }; 19 | }; 20 | -------------------------------------------------------------------------------- /src/runtime/classes/Cache.ts: -------------------------------------------------------------------------------- 1 | import Deferred from './Deferred'; 2 | 3 | export default class Cache { 4 | map: Map>; 5 | 6 | constructor() { 7 | this.map = new Map(); 8 | } 9 | 10 | getPromise(hash: string, fn: CallableFunction) { 11 | if (!this.map.has(hash)) { 12 | const deferred = new Deferred(); 13 | this.map.set(hash, deferred.promise); 14 | fn(deferred.resolve, deferred.reject); 15 | } 16 | return this.map.get(hash); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/runtime/classes/CallbackObserver.ts: -------------------------------------------------------------------------------- 1 | export class CallbackObserver { 2 | #listeners: CallableFunction[] = []; 3 | #destroyed = false; 4 | 5 | constructor(fn: CallableFunction) { 6 | fn((value: CallableFunction) => { 7 | if (this.#destroyed) { 8 | return false; 9 | } 10 | this.#listeners.forEach(listener => listener(value)); 11 | return true; 12 | }); 13 | } 14 | 15 | subscribe(listener: CallableFunction) { 16 | this.#listeners.push(listener); 17 | return { 18 | unsubscribe: () => { 19 | this.#listeners = this.#listeners.filter(v => v === listener); 20 | } 21 | }; 22 | } 23 | 24 | destroy() { 25 | this.#destroyed = true; 26 | } 27 | } 28 | 29 | export const combineCallbackObserver = ( 30 | callback: CallableFunction, 31 | observers: CallbackObserver[] 32 | ) => { 33 | let values: CallbackObserver[] = []; 34 | const observerCallback = (index: number) => (value: CallbackObserver) => { 35 | values[Number(index)] = value; 36 | if (values.filter(Boolean).length >= observers.length) { 37 | callback(values); 38 | values = []; 39 | } 40 | }; 41 | observers.forEach((observer, index) => { 42 | observer.subscribe(observerCallback(index)); 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /src/runtime/classes/Deferred.ts: -------------------------------------------------------------------------------- 1 | export const PENDING = Symbol('pending'); 2 | export const FULFILLED = Symbol('fulfilled'); 3 | export const REJECTED = Symbol('rejected'); 4 | 5 | export enum DeferredState { 6 | PENDING, 7 | FULFILLED, 8 | REJECTED 9 | } 10 | export default class Deferred { 11 | promise: Promise; 12 | resolve: (value?: T | PromiseLike) => void = () => {}; 13 | reject: (value?: T | PromiseLike) => void = () => {}; 14 | state?: DeferredState; 15 | 16 | constructor() { 17 | this.promise = new Promise((resolve, reject) => { 18 | this.resolve = resolve as (value?: T | PromiseLike) => void; 19 | this.reject = reject as (value?: T | PromiseLike) => void; 20 | this.state = DeferredState.PENDING; 21 | }) 22 | .then(e => { 23 | this.state = DeferredState.FULFILLED; 24 | return e; 25 | }) 26 | .catch(e => { 27 | this.state = DeferredState.REJECTED; 28 | throw new Error(e); 29 | }); 30 | } 31 | 32 | static create() { 33 | return new Deferred(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/runtime/classes/FontList.ts: -------------------------------------------------------------------------------- 1 | import Font from './Font'; 2 | import type { FontFamily, FontStyle, FontWeight } from '#build/types/booster'; 3 | import type { 4 | FontOptionVariance, 5 | DirectiveGetFontOptions, 6 | PreparedFontOption 7 | } from './../../module'; 8 | 9 | export default class FontList { 10 | list: PreparedFontOption[]; 11 | constructor(list: PreparedFontOption[] = []) { 12 | this.list = list.map(item => { 13 | item.variances = item.variances.map(variance => { 14 | return { 15 | ...({ 16 | style: 'normal', 17 | weight: 400 18 | } as FontOptionVariance), 19 | ...variance 20 | }; 21 | }); 22 | return item; 23 | }); 24 | } 25 | 26 | getFont( 27 | family: FontFamily, 28 | weight?: FontWeight, 29 | style?: FontStyle, 30 | options?: DirectiveGetFontOptions 31 | ) { 32 | weight = weight || 400; 33 | style = style || 'normal'; 34 | options = options || { selector: undefined, media: undefined }; 35 | const config = this.list.find(definition => definition.family === family); 36 | if (!config) { 37 | throw new Error( 38 | `font family ${family} not found, please define in module options` 39 | ); 40 | } 41 | return getFontVariance(config, weight, style, options); 42 | } 43 | } 44 | 45 | function getFontVariance( 46 | config: PreparedFontOption, 47 | weight?: string | number, 48 | style?: string, 49 | options: { selector?: string; media?: string } = { 50 | selector: undefined, 51 | media: undefined 52 | } 53 | ) { 54 | const variance = config.variances.find( 55 | variance => variance.weight === weight && variance.style === style 56 | ); 57 | if (!variance) { 58 | throw new Error( 59 | `font variance with ${weight} and ${style} for font-family ${config.family} not found` 60 | ); 61 | } 62 | const { src, type } = variance; 63 | return new Font( 64 | config.family, 65 | { src, type, fallbackFamily: config.fallback }, 66 | options, 67 | weight, 68 | style 69 | ); 70 | } 71 | -------------------------------------------------------------------------------- /src/runtime/classes/FontsCollection.ts: -------------------------------------------------------------------------------- 1 | import type { HeadFontCollectorDescription } from '../../module'; 2 | 3 | export class FontsCollection { 4 | list: HeadFontCollectorDescription[] = []; 5 | 6 | constructor(list: HeadFontCollectorDescription[] = []) { 7 | this.list = list; 8 | } 9 | 10 | get size() { 11 | return this.list.length; 12 | } 13 | 14 | toJSON() { 15 | return { 16 | list: this.list.map(item => ({ 17 | ...item, 18 | fontCollection: item.fontCollection.toJSON() 19 | })) 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/runtime/classes/intersection/ElementObserver.ts: -------------------------------------------------------------------------------- 1 | import Deferred from '../Deferred'; 2 | import type { IIntersectionObservable } from './Observable'; 3 | 4 | export default class ElementObserver { 5 | #observer; 6 | #unregister; 7 | #inView = false; 8 | 9 | #inViewListeners: CallableFunction[] = []; 10 | #outViewListeners: CallableFunction[] = []; 11 | #inViewDeferrer = new Deferred(); 12 | #outViewDeferrer = new Deferred(); 13 | 14 | constructor(observable: IIntersectionObservable, el: HTMLElement) { 15 | this.#observer = observable.register(el, this.onIntersecting.bind(this)); 16 | this.#unregister = () => observable.unregister(el); 17 | } 18 | 19 | get observer() { 20 | return this.#observer; 21 | } 22 | 23 | get inView() { 24 | return this.#inView; 25 | } 26 | 27 | onIntersecting(isIntersecting: boolean) { 28 | if (isIntersecting) { 29 | this.#inViewDeferrer.resolve(); 30 | this.#inView = true; 31 | this.#inViewListeners.forEach(listener => listener()); 32 | } else if (this.#inView) { 33 | this.#outViewDeferrer.resolve(); 34 | this.#inView = false; 35 | this.#outViewListeners.forEach(listener => listener()); 36 | } 37 | } 38 | 39 | enterViewOnce() { 40 | return this.#inViewDeferrer.promise; 41 | } 42 | 43 | enterView(fn: CallableFunction) { 44 | this.#inViewListeners.push(fn); 45 | } 46 | 47 | leaveViewOnce() { 48 | return this.#outViewDeferrer.promise; 49 | } 50 | 51 | leaveView(fn: CallableFunction) { 52 | this.#outViewListeners.push(fn); 53 | } 54 | 55 | destroy() { 56 | this.#unregister(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/runtime/classes/intersection/Observable.ts: -------------------------------------------------------------------------------- 1 | import type { ObservableHTMLElement, ObservableOptions } from '../../../module'; 2 | 3 | export default class IntersectionObservable { 4 | #intersectionObserver; 5 | #listeners = new Map(); 6 | 7 | constructor(options: ObservableOptions) { 8 | this.#intersectionObserver = new window.IntersectionObserver( 9 | entries => this.next(entries), 10 | options 11 | ); 12 | } 13 | 14 | next(entries: IntersectionObserverEntry[]) { 15 | entries.forEach(({ target, isIntersecting }) => { 16 | if (this.#listeners.has(target)) { 17 | this.#listeners.get(target)(isIntersecting); 18 | } 19 | }); 20 | } 21 | 22 | register(el: HTMLElement, callback: CallableFunction) { 23 | this.#listeners.set(el, callback); 24 | this.#intersectionObserver.observe(el); 25 | } 26 | 27 | unregister(el: HTMLElement) { 28 | this.#listeners.delete(el); 29 | this.#intersectionObserver.unobserve(el); 30 | } 31 | } 32 | 33 | export interface IIntersectionObservable { 34 | register: (el: HTMLElement, callback: CallableFunction) => void; 35 | unregister: (el: HTMLElement) => void; 36 | } 37 | 38 | export const getIntersectionObservable = ( 39 | options: ObservableOptions 40 | ): IIntersectionObservable => { 41 | const { node, key } = getNodeAndKey(options); 42 | 43 | if (!node.observables.has(key)) { 44 | node.observables.set(key, new IntersectionObservable(options)); 45 | } 46 | 47 | const observable = node.observables.get(key) as IntersectionObservable; 48 | 49 | return { 50 | register: (el: HTMLElement, callback: CallableFunction) => 51 | observable.register(el, callback), 52 | unregister: (el: HTMLElement) => observable.unregister(el) 53 | }; 54 | }; 55 | 56 | const getNodeAndKey = ({ root, ...options }: ObservableOptions) => { 57 | const node = (root || 58 | window.document.documentElement) as ObservableHTMLElement; 59 | if (!node.observables) { 60 | node.observables = new Map(); 61 | } 62 | return { key: JSON.stringify({ ...options }), node }; 63 | }; 64 | -------------------------------------------------------------------------------- /src/runtime/classes/lighthouse/Error.ts: -------------------------------------------------------------------------------- 1 | import { LighthouseStats } from './Stats'; 2 | 3 | export default class Error extends LighthouseStats {} 4 | -------------------------------------------------------------------------------- /src/runtime/classes/lighthouse/Stats.ts: -------------------------------------------------------------------------------- 1 | export enum State { 2 | READY, 3 | FAIL, 4 | PENDING 5 | } 6 | 7 | const STATE_COLORS = { 8 | [State.READY]: { 9 | pass: '#0CCE6B', 10 | average: '#FFA400', 11 | fail: '#FF4E42' 12 | }, 13 | [State.FAIL]: '#FF4E42', 14 | [State.PENDING]: '#BDBDBD' 15 | }; 16 | 17 | type Stats = { 18 | lhrSlim: { id: string; score: number }[]; 19 | }; 20 | export class LighthouseStats { 21 | state: State; 22 | data: Stats; 23 | constructor(state: State, data?: Stats) { 24 | this.state = state; 25 | this.data = data || { lhrSlim: [] }; 26 | } 27 | 28 | isPending() { 29 | return this.state === State.PENDING; 30 | } 31 | 32 | isFailed() { 33 | return this.state === State.FAIL; 34 | } 35 | 36 | isReady() { 37 | return this.state === State.READY; 38 | } 39 | 40 | getScoreOfMetric(metric: string) { 41 | return (this.data.lhrSlim.find(item => item.id === metric) || { score: -1 }) 42 | .score; 43 | } 44 | 45 | getStateColorByMetric(metric: string) { 46 | switch (this.state) { 47 | case State.READY: 48 | return getColorByScore(this.getScoreOfMetric(metric)); 49 | case State.FAIL: 50 | return STATE_COLORS[State.FAIL]; 51 | default: 52 | return STATE_COLORS[State.PENDING]; 53 | } 54 | } 55 | } 56 | 57 | function getColorByScore(score: number) { 58 | if (score >= 0.9) { 59 | return STATE_COLORS[State.READY].pass; 60 | } else if (score >= 0.5) { 61 | return STATE_COLORS[State.READY].average; 62 | } else { 63 | return STATE_COLORS[State.READY].fail; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/runtime/components/BoosterIframe.vue: -------------------------------------------------------------------------------- 1 |