Skip to content

Commit 89de9e3

Browse files
committed
chore: init project
0 parents  commit 89de9e3

File tree

13 files changed

+404
-0
lines changed

13 files changed

+404
-0
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
permissions:
4+
id-token: write
5+
contents: write
6+
7+
on:
8+
push:
9+
tags:
10+
- "v*"
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: pnpm/action-setup@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: lts/*
23+
registry-url: https://registry.npmjs.org/
24+
25+
- run: pnpx changelogithub
26+
env:
27+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
28+
29+
- run: pnpm install
30+
- run: pnpm publish -r --access public
31+
env:
32+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
33+
NPM_CONFIG_PROVENANCE: true

.github/workflows/test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Set node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: lts/*
25+
26+
- name: Install
27+
run: pnpm install
28+
29+
- name: Lint
30+
run: pnpm lint
31+
32+
- name: Typecheck
33+
run: pnpm typecheck
34+
35+
test:
36+
runs-on: ${{ matrix.os }}
37+
38+
strategy:
39+
matrix:
40+
node: [lts/*]
41+
os: [ubuntu-latest, windows-latest, macos-latest]
42+
fail-fast: false
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v4
49+
50+
- name: Set node ${{ matrix.node }}
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: ${{ matrix.node }}
54+
55+
- name: Install
56+
run: pnpm install
57+
58+
- name: Build
59+
run: pnpm build
60+
61+
- name: Test
62+
run: pnpm test
63+
64+
- name: Run coverage
65+
run: pnpm coverage
66+
67+
- uses: coverallsapp/github-action@master
68+
with:
69+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.cache
2+
.DS_Store
3+
.idea
4+
*.log
5+
*.tgz
6+
coverage
7+
dist
8+
lib-cov
9+
logs
10+
node_modules
11+
temp
12+
cache
13+
.eslintcache
14+
pnpm-lock.yaml

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ignore-workspace-root-check=true
2+
shell-emulator=true
3+
save-exact=true

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"prettier.enable": false,
3+
"editor.formatOnSave": false,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "always"
6+
},
7+
"eslint.validate": [
8+
"javascript",
9+
"typescript",
10+
"json",
11+
"jsonc",
12+
"yaml",
13+
"github-actions-workflow"
14+
]
15+
}

CONTRIBUTING.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing to LightningCSS Plugins Monorepo
2+
3+
I'm excited that you are interested in contributing to this repository! This guide will help you get started with your contributions.
4+
5+
## Table of Contents
6+
7+
- [How to Contribute](#how-to-contribute)
8+
- [Setting Up Your Development Environment](#setting-up-your-development-environment)
9+
- [Submitting Changes](#submitting-changes)
10+
- [Reporting Issues](#reporting-issues)
11+
- [Getting Help](#getting-help)
12+
13+
## How to Contribute
14+
15+
There are several ways you can contribute to this project:
16+
17+
1. **Reporting Bugs**: If you find a bug, please report it by [creating an issue](https://github.com/felixicaza/lightningcss-plugins/issues). Each package has a label to easily identify which package the issue corresponds to, so please use the appropriate labels.
18+
2. **Suggesting Features**: If you have an idea for a new feature, please open an [discussion](https://github.com/felixicaza/lightningcss-plugins/discussions).
19+
3. **Improving Documentation**: Help improve documentation by making it clearer and more comprehensive.
20+
4. **Submitting Code Changes**: If you want to fix a bug or implement a new feature, follow the steps below to submit your changes.
21+
22+
## Setting Up Your Development Environment
23+
24+
1. **Fork the repository**:
25+
Click the "Fork" button at the top right corner of the repository page to create a copy of the repository in your GitHub account.
26+
27+
2. **Clone your fork**:
28+
```sh
29+
git clone https://github.com/yourusername/lightningcss-plugins.git
30+
```
31+
32+
3. **Install dependencies**:
33+
Use `pnpm` as package manager. Install the project dependencies:
34+
```sh
35+
pnpm install
36+
```
37+
38+
4. **Create a new branch**:
39+
```sh
40+
git checkout -b your-branch-name
41+
```
42+
43+
## Submitting Changes
44+
45+
1. **Make your changes**:
46+
Ensure your code follows the project's coding standards and passes all tests.
47+
48+
2. **Commit your changes**:
49+
```sh
50+
git add .
51+
git commit -m "Description of your changes"
52+
```
53+
54+
3. **Push your changes to your fork**:
55+
```sh
56+
git push origin your-branch-name
57+
```
58+
59+
4. **Create a Pull Request**:
60+
Go to the original repository and click the "New Pull Request" button. Provide a clear and descriptive title and description for your pull request.
61+
62+
## Reporting Issues
63+
64+
If you encounter any issues while using the plugins, please report them by [creating an issue](https://github.com/felixicaza/lightningcss-plugins/issues) in the repository. Provide as much detail as possible to help us understand and resolve the issue quickly.
65+
66+
## Getting Help
67+
68+
If you need help or have any questions, feel free to open an issue or reach out to the maintainer. I'm here to help!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Felix Icaza
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.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ⚡ LightningCSS Plugins
2+
3+
This repository is dedicated to housing a collection of plugins for [LightningCSS](https://lightningcss.dev), a powerful and efficient CSS processor.
4+
5+
## 📖 Introduction
6+
7+
[LightningCSS](https://lightningcss.dev) is a modern CSS processor that offers a wide range of features for optimizing and transforming your CSS. This monorepo aims to provide a centralized location for various plugins that extend the functionality of LightningCSS.
8+
9+
## 📦 Packages
10+
11+
This repository currently includes the following packages:
12+
13+
- **[pxtorem](packages/pxtorem)**: A plugin to convert pixel units to rem units in your CSS.
14+
15+
Each package is located in the [`packages`](packages) directory and follows a consistent structure for ease of development and maintenance.
16+
17+
## 🤝 Contributing
18+
19+
If you wish to contribute to this project, you can do so by reading the [contribution guide](CONTRIBUTING.md).
20+
21+
## 📄 License
22+
23+
This project is licensed under the MIT License. See the [license file](LICENSE) for more details.

eslint.config.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// @ts-check
2+
3+
import type { Linter } from 'eslint'
4+
5+
import eslintPluginJs from '@eslint/js'
6+
import eslintPluginJsonc from 'eslint-plugin-jsonc'
7+
import eslintPluginPackageJson from 'eslint-plugin-package-json/configs/recommended'
8+
import eslintPluginYml from 'eslint-plugin-yml'
9+
import globals from 'globals'
10+
import neostandard, { plugins as eslintPlugins, resolveIgnoresFromGitignore } from 'neostandard'
11+
12+
export default [
13+
{ ignores: resolveIgnoresFromGitignore() },
14+
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
15+
eslintPluginJs.configs.recommended,
16+
...neostandard({
17+
noJsx: true,
18+
noStyle: true,
19+
ts: true
20+
}),
21+
eslintPlugins.promise.configs['flat/recommended'],
22+
eslintPlugins['@stylistic'].configs['recommended-flat'],
23+
eslintPlugins.n.configs['flat/recommended'],
24+
...eslintPluginJsonc.configs['flat/recommended-with-json'],
25+
eslintPluginPackageJson,
26+
...eslintPluginYml.configs['flat/recommended'],
27+
{
28+
rules: {
29+
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
30+
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: false }],
31+
'@stylistic/arrow-parens': ['error', 'always'],
32+
'@stylistic/quote-props': ['error', 'as-needed'],
33+
'@stylistic/comma-dangle': ['error', 'never'],
34+
'@stylistic/operator-linebreak': [
35+
'error',
36+
'after',
37+
{ overrides: { '?': 'before', ':': 'before' } }
38+
],
39+
40+
// disabled due this rule not support workspaces
41+
// reference: https://github.com/eslint-community/eslint-plugin-n/issues/209
42+
'n/no-extraneous-import': ['off'],
43+
44+
'yml/indent': ['error', 3, { indicatorValueIndent: 2 }],
45+
'yml/quotes': ['error', { prefer: 'double' }]
46+
}
47+
}
48+
] satisfies Linter.Config[]

package.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "lightningcss-plugins",
3+
"version": "0.0.0",
4+
"private": true,
5+
"keywords": [
6+
"lightningcss",
7+
"lightningcss-plugin",
8+
"css",
9+
"plugin"
10+
],
11+
"license": "MIT",
12+
"author": "Felix Icaza <[email protected]>",
13+
"type": "module",
14+
"scripts": {
15+
"build": "pnpm -r build",
16+
"coverage": "vitest run --coverage",
17+
"dev": "pnpm -r dev",
18+
"lint": "eslint --cache --fix .",
19+
"prepare": "simple-git-hooks",
20+
"prepublishOnly": "pnpm build",
21+
"release": "bumpp -r && pnpm -r publish",
22+
"test": "vitest",
23+
"test:update": "vitest --update",
24+
"typecheck": "tsc --noEmit"
25+
},
26+
"simple-git-hooks": {
27+
"pre-commit": "pnpm lint-staged"
28+
},
29+
"lint-staged": {
30+
"*": "pnpm lint"
31+
},
32+
"devDependencies": {
33+
"@eslint/js": "catalog:",
34+
"@types/node": "catalog:",
35+
"@vitest/coverage-v8": "catalog:",
36+
"bumpp": "catalog:",
37+
"eslint": "catalog:",
38+
"eslint-plugin-jsonc": "catalog:",
39+
"eslint-plugin-package-json": "catalog:",
40+
"eslint-plugin-yml": "catalog:",
41+
"globals": "catalog:",
42+
"jiti": "catalog:",
43+
"lightningcss": "catalog:",
44+
"lint-staged": "catalog:",
45+
"neostandard": "catalog:",
46+
"simple-git-hooks": "catalog:",
47+
"tsup": "catalog:",
48+
"tsx": "catalog:",
49+
"typescript": "catalog:",
50+
"vite": "catalog:",
51+
"vitest": "catalog:"
52+
},
53+
"peerDependencies": {
54+
"lightningcss": "catalog:"
55+
},
56+
"packageManager": "[email protected]"
57+
}

0 commit comments

Comments
 (0)