Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendargelos committed Sep 30, 2023
0 parents commit 63336bf
Show file tree
Hide file tree
Showing 29 changed files with 7,493 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
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
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"extends": ["@nuxt/eslint-config"]
}
56 changes: 56 additions & 0 deletions .gitignore
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
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
2 changes: 2 additions & 0 deletions .nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports.autoImport=false
typescript.includeWorkspace=true
61 changes: 61 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "nuxt-lightningcss",
"version": "1.5.2",
"description": "Lightningcss for Nuxt",
"repository": "https://github.com/juliendargelos/nuxt-lightningcss",
"keywords": [
"lightningcss",
"nuxt",
"css",
"postcss",
"vue"
],
"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"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"scripts": {
"prepack": "nuxt-module-build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"release": "yarn lint && yarn test && yarn prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"@nuxt/kit": "^3.7.3",
"browserslist": "^4.21.11",
"lightningcss": "^1.22.0"
},
"devDependencies": {
"@nuxt/devtools": "^0.8.5",
"@nuxt/eslint-config": "^0.1.1",
"@nuxt/module-builder": "^0.4.0",
"@nuxt/schema": "^3.6.5",
"@nuxt/test-utils": "^3.6.5",
"@types/node": "^18.17.1",
"changelogen": "^0.5.4",
"eslint": "^8.46.0",
"nuxt": "^3.7.3",
"vitest": "^0.34.5"
},
"peerDependencies": {
"nuxt": "^3.7.3"
}
}
24 changes: 24 additions & 0 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div>basic</div>
<hmr-test />
</template>

<script setup>
</script>

<style lang="postcss">
.a {
color: blue;
.b {
color: black;
}
}
@media (--desktop) {
.a {
color: yellow;
}
}
</style>
17 changes: 17 additions & 0 deletions playground/components/HmrTest.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<div class="hey">
hey
</div>
</template>

<style scoped lang="postcss">
.hey {
background: green;
width: 100px;
height: 100px;
@media (--desktop) {
background: blue;
}
}
</style>
22 changes: 22 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Features } from 'lightningcss'
import MyModule from '../src/module'

export default defineNuxtConfig({
modules: [
MyModule
],

css: [
'~/stylesheets/index.css'
],

lightningcss: {
globals: [
'~/stylesheets/media-queries.css'
],
include: Features.CustomMediaQueries | Features.Nesting,
drafts: {
customMedia: true
}
}
})
13 changes: 13 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"private": true,
"name": "nuxt-lightningcss-playground",
"type": "module",
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate"
},
"devDependencies": {
"nuxt": "latest"
}
}
3 changes: 3 additions & 0 deletions playground/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
8 changes: 8 additions & 0 deletions playground/stylesheets/colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:root {
--black: #000;
--white: #fff;

@media (--desktop) {
--black: #111;
}
}
7 changes: 7 additions & 0 deletions playground/stylesheets/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import 'colors.css';

@media (--desktop) {
body {
background: red;
}
}
1 change: 1 addition & 0 deletions playground/stylesheets/media-queries.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@custom-media --desktop screen and (min-width: 1200px);
3 changes: 3 additions & 0 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./.nuxt/tsconfig.json"
}
Loading

0 comments on commit 63336bf

Please sign in to comment.