Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ab58a59
refactor: reorganize pnpm-workspace.yaml and enhance dependency manag…
felixicaza Jun 2, 2026
3f07e27
chore(lint): migrate to `@felixicaza/eslint-config` and `@felixicaza/…
felixicaza Jun 2, 2026
f958c03
refactor: migrate from tsup to tsdown
felixicaza Jun 3, 2026
4ce102f
chore: update lint
felixicaza Jun 3, 2026
769388c
refactor: update tsconfig options
felixicaza Jun 3, 2026
906db63
chore: update deps
felixicaza Jun 3, 2026
a1ffd91
tests: add projects to vitest configuration and update tests location
felixicaza Jun 3, 2026
7c0541a
docs: update README.md and add assets
felixicaza Jun 6, 2026
9b96638
ci: update release workflow and update tests workflow name
felixicaza Jun 8, 2026
0730fd8
chore: update workflow VSCode settings
felixicaza Jun 8, 2026
04ad9b2
chore: add start and start:watch scripts to package.json
felixicaza Jun 9, 2026
db0156b
feat(pxtorem): add propList option and refactor plugin
felixicaza Jun 9, 2026
09f6b1f
chore: update dependencies
felixicaza Jun 20, 2026
fe680ae
ci: remove version for pnpm action and use packageManager key instead
felixicaza Jun 20, 2026
d2d003c
feat(pxtorem): add ignoreSelectors option
felixicaza Jun 22, 2026
aa127aa
feat(pxtorem): add mediaQuery option
felixicaza Jun 22, 2026
0e8f26a
fix: add release script for pxtorem plugin
felixicaza Jun 23, 2026
f8e4500
docs(pxtorem): update README with new options
felixicaza Jun 23, 2026
246bc8f
chore: install oxlint-tsgolint
felixicaza Jun 24, 2026
ab01fce
chore(tests): remove coverage configuration and related dependencies
felixicaza Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/assets/lightningcss-plugins.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/pxtorem.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 79 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,102 @@ permissions:
on:
push:
tags:
- "*@*"
- "**@**"

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Validate tag format
- name: Validate and parse tag
id: tag
shell: bash
run: |
if [[ ! $GITHUB_REF =~ ^refs/tags/[a-zA-Z0-9-]+@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid tag format. Expected 'name@x.y.z'."
TAG="${GITHUB_REF_NAME}"

# Format: @scope/name@x.y.z or name@x.y.z
if [[ ! "$TAG" =~ ^(@[a-zA-Z0-9-]+/)?[a-zA-Z0-9-]+@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid tag format. Expected '@scope/name@x.y.z' or 'name@x.y.z'. Got: $TAG"
exit 1
fi

TAG_NAME="${TAG%@*}"
TAG_VERSION="${TAG##*@}"

# folder = unscoped package name part
if [[ "$TAG_NAME" =~ ^@[a-zA-Z0-9-]+/(.+)$ ]]; then
PKG_FOLDER="${BASH_REMATCH[1]}"
else
PKG_FOLDER="$TAG_NAME"
fi

PKG_DIR="packages/${PKG_FOLDER}"

if [[ ! -f "${PKG_DIR}/package.json" ]]; then
echo "Package manifest not found: ${PKG_DIR}/package.json"
exit 1
fi

PKG_JSON_NAME="$(node -p "require('./${PKG_DIR}/package.json').name")"
if [[ "${PKG_JSON_NAME}" != "${TAG_NAME}" ]]; then
echo "Tag package name (${TAG_NAME}) does not match package.json name (${PKG_JSON_NAME})"
exit 1
fi

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
echo "pkg_name=${TAG_NAME}" >> "$GITHUB_OUTPUT"
echo "pkg_version=${TAG_VERSION}" >> "$GITHUB_OUTPUT"
echo "pkg_dir=${PKG_DIR}" >> "$GITHUB_OUTPUT"

- uses: actions/setup-node@v6
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/

- run: pnpx changelogithub
- uses: pnpm/action-setup@v6

- name: Install dependencies
run: pnpm ci

- name: Resolve changelog range
id: changelog_range
shell: bash
run: |
CURRENT_TAG="${{ github.ref_name }}"
PKG="${{ steps.tag.outputs.pkg_name }}"

PREV_TAG="$(
git tag --list "${PKG}@*" --sort=-v:refname \
| grep -Fxv "${CURRENT_TAG}" \
| head -n 1 || true
)"

if [[ -n "${PREV_TAG}" ]]; then
FROM_REF="${PREV_TAG}"
else
FROM_REF="$(git rev-list --max-parents=0 HEAD | tail -n 1)"
fi

echo "from_ref=${FROM_REF}" >> "$GITHUB_OUTPUT"
echo "to_ref=${CURRENT_TAG}" >> "$GITHUB_OUTPUT"

- name: Generate changelog/release notes
run: |
pnpx changelogithub@latest \
--from "${{ steps.changelog_range.outputs.from_ref }}" \
--to "${{ steps.changelog_range.outputs.to_ref }}"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build package
run: pnpm -C "${{ steps.tag.outputs.pkg_dir }}" build

- run: pnpm install
- run: pnpm publish -r --access public --no-git-checks
- name: Publish package
working-directory: ${{ steps.tag.outputs.pkg_dir }}
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
39 changes: 17 additions & 22 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set node
uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/

- uses: pnpm/action-setup@v6

- name: Install
run: pnpm install
run: pnpm ci

- name: Build
run: pnpm build
Expand All @@ -45,25 +46,19 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
node-version: lts/*
registry-url: https://registry.npmjs.org/

- uses: pnpm/action-setup@v6

- name: Install
run: pnpm install
run: pnpm ci

- name: Test
run: pnpm test

- name: Run coverage
run: pnpm coverage

- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ node_modules
temp
cache
.eslintcache
pnpm-lock.yaml
7 changes: 4 additions & 3 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ignore-workspace-root-check=true
shell-emulator=true
save-exact=true
save-exact = true
ignore-scripts = true
allow-git = none
min-release-age = 2
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"antfu.pnpm-catalog-lens"
]
}
28 changes: 10 additions & 18 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
{
"prettier.enable": false,
"editor.formatOnSave": false,

"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.oxc": "explicit",
"source.organizeImports": "never"
},
"eslint.runtime": "node",
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

"eslint.validate": [
"javascript",
"typescript",
"json",
"jsonc",
"yaml",
"github-actions-workflow"
]
"json5",
"yaml"
],

"[yaml]": {
"editor.tabSize": 3
}
}
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# ⚡ LightningCSS Plugins

[![CI](https://github.com/felixicaza/lightningcss-plugins/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/felixicaza/lightningcss-plugins/actions/workflows/test.yml)
[![Coveralls](https://img.shields.io/coverallsCoverage/github/felixicaza/lightningcss-plugins?logo=coveralls&link=https%3A%2F%2Fcoveralls.io%2Fgithub%2Ffelixicaza%2Flightningcss-plugins)](https://coveralls.io/github/felixicaza/lightningcss-plugins)
[![GitHub License](https://img.shields.io/github/license/felixicaza/lightningcss-plugins)](https://github.com/felixicaza/lightningcss-plugins/blob/main/LICENSE)

This repository is dedicated to housing a collection of plugins for [LightningCSS](https://lightningcss.dev), a powerful and efficient CSS processor.
[![lightningcss-plugins](https://raw.githubusercontent.com/felixicaza/lightningcss-plugins/HEAD/.github/assets/lightningcss-plugins.jpg)](https://github.com/felixicaza/lightningcss-plugins)

## 📖 Introduction
# ⚡ LightningCSS Plugins

[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.
A collection of plugins for [LightningCSS](https://lightningcss.dev).

## 📦 Packages

This repository currently includes the following packages:

- **[<img src="https://img.shields.io/badge/pxtorem-v0.0.8-4ea91d" alt="version" align="center">](packages/pxtorem)** - A plugin to convert pixel units to rem units in your CSS.

Each plugin is located in the [`packages`](packages) directory to follow a consistent structure for ease development and maintenance.
- [`lightningcss-plugin-pxtorem`](./packages/dts-minify-lite): A plugin to convert pixel units to rem units in your CSS.

## 🤝 Contributing

If you wish to contribute to this project, you can do so by reading the [contribution guide](CONTRIBUTING.md).
Contributions to this monorepo are welcome! If you have any ideas for improvements or new features, please feel free to open an issue or submit a pull request, I appreciate your help in making those plugins better for everyone. Please read the [CONTRIBUTING.md](https://github.com/felixicaza/lightningcss-plugins/blob/main/CONTRIBUTING.md) file for guidelines.

## 📄 License

This project is licensed under the MIT License. See the [license file](LICENSE) for more details.
This project is licensed under the MIT License. See the [LICENSE](https://github.com/felixicaza/lightningcss-plugins/blob/main/LICENSE) file for details.
49 changes: 2 additions & 47 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
import type { Linter } from 'eslint'
import { felixicaza } from '@felixicaza/eslint-config'

import { defineConfig, globalIgnores } from 'eslint/config'

import globals from 'globals'
import eslintPluginJs from '@eslint/js'
import eslintPluginYml from 'eslint-plugin-yml'
import eslintPluginJsonc from 'eslint-plugin-jsonc'
import eslintPluginPackageJson from 'eslint-plugin-package-json'
import neostandard, { plugins as eslintPlugins, resolveIgnoresFromGitignore } from 'neostandard'

export default defineConfig([
globalIgnores(resolveIgnoresFromGitignore()),
{ languageOptions: { globals: { ...globals.node } } },
eslintPluginJs.configs.recommended,
neostandard({
noJsx: true,
ts: true
}),
eslintPlugins.promise.configs['flat/recommended'],
eslintPlugins['@stylistic'].configs['recommended-flat'],
eslintPlugins.n.configs['flat/recommended'],
eslintPluginJsonc.configs['flat/recommended-with-json'],
eslintPluginPackageJson.configs.recommended,
eslintPluginYml.configs['flat/recommended'],
{
rules: {
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: false }],
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/quote-props': ['error', 'as-needed'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/operator-linebreak': [
'error',
'after',
{ overrides: { '?': 'before', ':': 'before' } }
],

// Disabled due this rule not support workspaces
// reference: https://github.com/eslint-community/eslint-plugin-n/issues/209
'n/no-extraneous-import': ['off'],
'n/no-missing-import': ['off'],

'yml/indent': ['error', 3, { indicatorValueIndent: 2 }],
'yml/quotes': ['error', { prefer: 'double' }]
}
}
]) as Linter.Config[]
export default felixicaza({ astro: false })
3 changes: 3 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { felixicaza } from '@felixicaza/oxlint-config'

export default felixicaza({ complexity: false })
Loading
Loading