Skip to content

Commit

Permalink
feat(package): migrate to Bun, TypeScript, Playwright and dart-sass
Browse files Browse the repository at this point in the history
release-npm
  • Loading branch information
tobua committed Mar 2, 2024
1 parent 24ba394 commit 8c4dfb0
Show file tree
Hide file tree
Showing 23 changed files with 148 additions and 682 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
- run: npm install
- name: 🧪 Test
run: npm test
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bunx playwright install chromium --with-deps
- name: 🚧 Build
run: npm run build
run: bun run build
- name: 🧪 Test
run: bun run test
- name: 📢 Release
uses: tobua/release-npm-action@v3
with:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
node_modules
package-lock.json
bun.lockb
test/manual/dist
jsconfig.json
test-results
docs/*/**/*.css
tsconfig.json
!test/tsconfig.json
dist
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
Create highly responsive and still pixel-perfect websites.

> [!TIP]
> A successor JavaScript-only library called [optica](https://github.com/tobua/optica) has been released. It requires the [`clamp()`](https://caniuse.com/css-math-functions) CSS math function but no longer needs any breakpoints.
## Use Cases

Best suited when you have a desktop and a mobile design of the site. Wasser will
Expand Down Expand Up @@ -53,7 +56,7 @@ render(
<Wrapper>
<Heading>Scalable Properties</Heading>
</Wrapper>,
document.body
document.body,
)
```

Expand Down
6 changes: 4 additions & 2 deletions _wasser.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'sass:math';

$wasser-viewport-min: 320 !default;
$wasser-viewport-max: 1500 !default;
$wasser-scaling-ratio: 1.5 !default;
Expand All @@ -13,7 +15,7 @@ $wasser-font-size-to-line-height-ratio: $wasser-scaling-ratio !default;
* @param {number} $max — The max value for the property
* @param {number|string} [$min] - The min value ot the property
*/
@mixin wasser($property, $max, $min: $max / $wasser-scaling-ratio) {
@mixin wasser($property, $max, $min: math.div($max, $wasser-scaling-ratio)) {
@if type-of($max) != number {
@error 'wasser: A number is expected as the second parameter.';
}
Expand All @@ -32,7 +34,7 @@ $wasser-font-size-to-line-height-ratio: $wasser-scaling-ratio !default;
*/
@mixin w-font(
$max,
$min: ($max / $wasser-scaling-ratio-font),
$min: math.div($max, $wasser-scaling-ratio-font),
$line-height-ratio: $wasser-font-size-to-line-height-ratio
) {
@if type-of($max) != number {
Expand Down
4 changes: 2 additions & 2 deletions demo/css-in-js/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"papua": "^5.9.6",
"papua": "^5.9.7",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
10 changes: 5 additions & 5 deletions demo/sass/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"css-loader": "^6.9.0",
"exmpl": "^3.0.0",
"node-sass": "^9.0.0",
"papua": "5.9.6",
"sass-loader": "^13.3.3",
"css-loader": "^6.10.0",
"exmpl": "^3.1.0",
"papua": "5.9.7",
"sass": "^1.71.1",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4"
},
"localDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion demo/stitches/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@stitches/react": "^1.2.8",
"papua": "^5.9.6",
"papua": "^5.9.7",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
31 changes: 0 additions & 31 deletions docs/basic/basic.css

This file was deleted.

43 changes: 0 additions & 43 deletions docs/basic/body-padding/body-padding.css

This file was deleted.

106 changes: 0 additions & 106 deletions docs/basic/font/font.css

This file was deleted.

104 changes: 0 additions & 104 deletions docs/less/less.css

This file was deleted.

Loading

0 comments on commit 8c4dfb0

Please sign in to comment.