Skip to content

Commit

Permalink
Merge branch 'feature/v2' into all-contributors/add-florian-lefebvre
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoTomeES authored Jun 20, 2024
2 parents 8fbcebe + e671a0f commit 04d5e16
Show file tree
Hide file tree
Showing 24 changed files with 12,789 additions and 9,154 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
"contributions": [
"bug"
]
},
{
"login": "gabrielperales",
"name": "Gabriel",
"avatar_url": "https://avatars.githubusercontent.com/u/1859128?v=4",
"profile": "http://gabriel.perales.me",
"contributions": [
"code"
]
}
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.yarn
node_modules
dist
Target
yarn.lock
4 changes: 2 additions & 2 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
- run: yarn
- run: yarn build
- run: npm i
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PUBLISH_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: npm i
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test on push
on:
workflow_dispatch:
pull_request:

jobs:
test:
name: 'Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
strategy:
matrix:
OS: [ubuntu-latest, macos-latest, windows-latest]
NODE_VERSION: [18, 20]
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.NODE_VERSION }}
cache: 'npm'

- name: Install dependencies
run: npm i

- name: Test
run: npm run test:ci
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# build output
dist/

Target/

# generated types
.astro/

Expand Down
3 changes: 1 addition & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn commitlint --edit $1
npx commitlint --edit $1
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn lint-staged
npx lint-staged
npm run test:ci
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.9.0
v20.11.1
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.yarn
node_modules
dist
Target
yarn.lock
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
11 changes: 0 additions & 11 deletions .yarnrc.yml

This file was deleted.

14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.2] - 2023-10-21
### Added

- Support for compressing CSS variables.

### Changed

- Regular expresion to match class names now is more strict, avoiding matches with incomplete class names.

### Fixed

- Config types are now correctly exported, so now the plugin has suggestion in options.

## [1.1.2] - 2023-11-04

### Changed

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Astro-Rename is an Astro integration that brings [postcss-rename](https://github

- [x] Compress CSS classes
- [ ] Compress CSS IDs
- [ ] Compress CSS Variables
- [x] Compress CSS Variables
- [x] Replace CSS classes in HTML, JS, and other files

## Installation
Expand Down Expand Up @@ -94,7 +94,7 @@ type RenameOptions = {
* The default is to match the name with word boundaries on either side, but you can change this to match only the start or end of the name, or to match more or less than a whole word.
*
* @default ```js
* (key: string) => `(:^|[^-&;:_])(${key})(?![a-zA-Z0-9_-])(:$|[^-&;:_\./])`
* (key: string) => `(:^|[^&;:_/\[\\]a-zA-Z0-9_.-])(${key})(?=$|[^&;:_/\[\\]a-zA-Z0-9_.-])`
* ```
*/
matchClasses?: (key: string) => string;
Expand Down Expand Up @@ -204,11 +204,11 @@ Here's an example of the plugin in action in my [awa-db](https://github.com/Rodr

Here's a list of tasks I plan to work on:

- [ ] Fix error types
- [ ] Add test coverage
- [x] Fix error types
- [x] Add test coverage
- [ ] Add support for IDs
- [ ] Enable handling of multiple CSS files
- [ ] Implement support for CSS variables
- [x] Implement support for CSS variables
- [ ] Include server-side rendering support
- [ ] Move temporal files to a temporary directory instead of the root of the project
- [ ] Improve stadistics of file size reduction
Expand Down Expand Up @@ -242,6 +242,7 @@ Special thanks to the following individuals and projects:
<td align="center" valign="top" width="14.28%"><a href="https://jakebolam.com"><img src="https://avatars.githubusercontent.com/u/3534236?v=4?s=100" width="100px;" alt="Jake Bolam"/><br /><sub><b>Jake Bolam</b></sub></a><br /><a href="#bug-jakebolam" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://kenchandev.com"><img src="https://avatars.githubusercontent.com/u/4991363?v=4?s=100" width="100px;" alt="Ken Chan"/><br /><sub><b>Ken Chan</b></sub></a><br /><a href="#bug-kenchandev" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://florian-lefebvre.dev"><img src="https://avatars.githubusercontent.com/u/69633530?v=4?s=100" width="100px;" alt="Florian Lefebvre"/><br /><sub><b>Florian Lefebvre</b></sub></a><br /><a href="#bug-florian-lefebvre" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://gabriel.perales.me"><img src="https://avatars.githubusercontent.com/u/1859128?v=4?s=100" width="100px;" alt="Gabriel"/><br /><sub><b>Gabriel</b></sub></a><br /><a href="#code-gabrielperales" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
8 changes: 4 additions & 4 deletions lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const config = {
'**/*.(ts|js|cjs|mjs)': (filenames) => [
'yarn tsc',
`yarn lint --fix ${filenames.join(' ')}`,
`yarn prettier --write ${filenames.join(' ')}`,
'npm run tsc',
`npm run lint --fix ${filenames.join(' ')}`,
`npx prettier --write ${filenames.join(' ')}`,
],

'**/*.(md|json)': (filenames) =>
`yarn prettier --write ${filenames.join(' ')}`,
`npx prettier --write ${filenames.join(' ')}`,
};

module.exports = config;
Loading

0 comments on commit 04d5e16

Please sign in to comment.