-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 46974c5
Showing
23 changed files
with
6,051 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"root": true, | ||
"extends": ["@nuxt/eslint-config"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
node: [14, 16] | ||
|
||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn | ||
|
||
- name: Prepare environment | ||
run: yarn dev:prepare | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Test | ||
run: yarn test | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Dependencies | ||
node_modules | ||
|
||
# Logs | ||
*.log* | ||
|
||
# Temp directories | ||
.temp | ||
.tmp | ||
.cache | ||
|
||
# Yarn | ||
**/.yarn/cache | ||
**/.yarn/*state* | ||
|
||
# Generated dirs | ||
dist | ||
|
||
# Nuxt | ||
.nuxt | ||
.output | ||
.vercel_build_output | ||
.build-* | ||
.env | ||
.netlify | ||
|
||
# Env | ||
.env | ||
|
||
# Testing | ||
reports | ||
coverage | ||
*.lcov | ||
.nyc_output | ||
|
||
# VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Intellij idea | ||
*.iml | ||
.idea | ||
|
||
# OSX | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
shamefully-hoist=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
imports.autoImport=false | ||
typescript.includeWorkspace=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
|
||
|
||
## v0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Gabriele Baldi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<!-- | ||
Get your module up and running quickly. | ||
Find and replace all on all files (CMD+SHIFT+F): | ||
- Name: Nuxt Beastcss | ||
- Package name: nuxt-beastcss | ||
- Description: Fast Critical CSS for Nuxt | ||
--> | ||
|
||
# Nuxt Beastcss | ||
|
||
[![npm version][npm-version-src]][npm-version-href] | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![License][license-src]][license-href] | ||
|
||
> Fast Critical CSS for Nuxt | ||
- [✨ Release Notes](/CHANGELOG.md) | ||
<!-- - [📖 Documentation](https://example.com) --> | ||
|
||
## Features | ||
|
||
<!-- Highlight some of the features your module provide here --> | ||
- 🧙 Zero-configuration required | ||
- 🧬 Auto Enables Nuxt CSS Extraction | ||
- 📝 Inject critical CSS automatically to page html | ||
- 🧼 Removes injected CSS from main files | ||
- 👯♀️ Working both in ssr and generate mode | ||
|
||
## Quick Setup | ||
|
||
1. Add `nuxt-beastcss` dependency to your project | ||
|
||
```bash | ||
# Using pnpm | ||
pnpm add -D nuxt-beastcss | ||
|
||
# Using yarn | ||
yarn add --dev nuxt-beastcss | ||
|
||
# Using npm | ||
npm install --save-dev nuxt-beastcss | ||
``` | ||
|
||
2. Add `nuxt-beastcss` to the `modules` section of `nuxt.config.ts` | ||
|
||
```js | ||
export default defineNuxtConfig({ | ||
modules: [ | ||
'nuxt-beastcss' | ||
] | ||
}) | ||
``` | ||
|
||
That's it! You can now use Nuxt Beastcss in your Nuxt app ✨ | ||
|
||
## Options | ||
|
||
You can write the `nuxt-beastcss` config like this: | ||
|
||
```js | ||
// nuxt.config.js | ||
import { defineNuxtConfig } from 'nuxt' | ||
export default defineNuxtConfig({ | ||
modules: ['nuxt-beastcss'], | ||
beastcss: { | ||
// Options passed directly to beastcss: https://github.com/freddy38510/beastcss/tree/master/packages/beastcss#options | ||
config: { | ||
// Default: false | ||
fontFace: true, | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
In the `config` object you can pass all [beastcss-official-options](https://github.com/freddy38510/beastcss/tree/master/packages/beastcss#options). | ||
|
||
## Development | ||
|
||
```bash | ||
# Install dependencies | ||
npm install | ||
|
||
# Generate type stubs | ||
npm run dev:prepare | ||
|
||
# Develop with the playground | ||
npm run dev | ||
|
||
# Build the playground | ||
npm run dev:build | ||
|
||
# Run ESLint | ||
npm run lint | ||
|
||
# Run Vitest | ||
npm run test | ||
npm run test:watch | ||
|
||
# Release new version | ||
npm run release | ||
``` | ||
|
||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/v/nuxt-beastcss/latest.svg?style=flat&colorA=18181B&colorB=28CF8D | ||
[npm-version-href]: https://npmjs.com/package/nuxt-beastcss | ||
|
||
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-beastcss.svg?style=flat&colorA=18181B&colorB=28CF8D | ||
[npm-downloads-href]: https://npmjs.com/package/nuxt-beastcss | ||
|
||
[license-src]: https://img.shields.io/npm/l/nuxt-beastcss.svg?style=flat&colorA=18181B&colorB=28CF8D | ||
[license-href]: https://npmjs.com/package/nuxt-beastcss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "nuxt-beastcss", | ||
"version": "1.0.0", | ||
"description": "Fast Critical CSS for Nuxt", | ||
"keywords": [ | ||
"performance", | ||
"nuxt", | ||
"module", | ||
"nuxt-module" | ||
], | ||
"license": "MIT", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/types.d.ts", | ||
"import": "./dist/module.mjs", | ||
"require": "./dist/module.cjs" | ||
} | ||
}, | ||
"main": "./dist/module.cjs", | ||
"types": "./dist/types.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"prepack": "nuxt-module-build", | ||
"dev": "nuxi dev playground", | ||
"dev:build": "nuxi build playground", | ||
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground", | ||
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags", | ||
"lint": "eslint .", | ||
"test": "vitest run", | ||
"test:watch": "vitest watch" | ||
}, | ||
"dependencies": { | ||
"@nuxt/kit": "^3.2.2", | ||
"beastcss": "https://github.com/bnznamco/beastcss/releases/download/bnznamco-2.1.2/beastcss-2.1.2.tgz", | ||
"consola": "^2.15.3", | ||
"pathe": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"@nuxt/eslint-config": "^0.1.1", | ||
"@nuxt/module-builder": "^0.2.1", | ||
"@nuxt/schema": "^3.2.2", | ||
"@nuxt/test-utils": "^3.2.2", | ||
"changelogen": "^0.4.1", | ||
"eslint": "^8.34.0", | ||
"nuxt": "^3.2.2", | ||
"nuxt-beastcss": "link:./", | ||
"vitest": "^0.28.5" | ||
} | ||
} |
Oops, something went wrong.