Skip to content

Commit

Permalink
feat(package): update dependencies and migrate changes
Browse files Browse the repository at this point in the history
release-npm
  • Loading branch information
tobua committed Feb 9, 2023
1 parent f766b73 commit 500319f
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 58 deletions.
7 changes: 3 additions & 4 deletions demo/css-in-js/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createRoot } from 'react-dom/client'
import { Global, css } from '@emotion/react'
import styled from '@emotion/styled'
import { wasser, font, configure, head } from 'wasser'
Expand All @@ -17,10 +17,9 @@ const Heading: any = styled('h1')`
${font(50)}
`

render(
createRoot(document.body as HTMLElement).render(
<Wrapper>
<Global styles={css(head())} />
<Heading>Scalable Properties</Heading>
</Wrapper>,
document.body
</Wrapper>
)
10 changes: 5 additions & 5 deletions demo/css-in-js/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"@emotion/react": "^11.8.1",
"@emotion/styled": "^11.8.1",
"papua": "^0.1.39",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"papua": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"localDependencies": {
"wasser": "../.."
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.7.0",
"exmpl": "^2.2.1",
"node-sass": "^7.0.1",
"papua": "0.1.39",
"sass-loader": "^12.6.0",
"css-loader": "^6.7.3",
"exmpl": "^3.0.0",
"node-sass": "^8.0.0",
"papua": "3.0.1",
"sass-loader": "^13.2.0",
"style-loader": "^3.3.1"
},
"localDependencies": {
Expand Down
7 changes: 3 additions & 4 deletions demo/stitches/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createRoot } from 'react-dom/client'
import { createStitches } from '@stitches/react'
import { wasser, fontObject, configure, globalVariables } from 'wasser'

Expand All @@ -20,9 +20,8 @@ const Heading = styled('h1', {
...fontObject(50),
})

render(
createRoot(document.body as HTMLElement).render(
<Wrapper>
<Heading>Scalable Properties</Heading>
</Wrapper>,
document.body
</Wrapper>
)
8 changes: 4 additions & 4 deletions demo/stitches/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"@stitches/react": "^1.2.7",
"papua": "^0.1.39",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@stitches/react": "^1.2.8",
"papua": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"localDependencies": {
"wasser": "../.."
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
"frontend"
],
"devDependencies": {
"async": "^3.2.3",
"jest-puppeteer": "^6.1.0",
"less": "^4.1.2",
"node-sass": "^7.0.1",
"padua": "0.5.3",
"puppeteer": "^13.4.1"
"async": "^3.2.4",
"jest-puppeteer": "^7.0.0",
"less": "^4.1.3",
"node-sass": "^8.0.0",
"padua": "1.1.0",
"puppeteer": "^19.6.3"
},
"prettier": "padua/configuration/.prettierrc.json",
"eslintConfig": {
Expand All @@ -76,6 +76,6 @@
}
},
"engines": {
"node": ">= 14"
"node": ">= 16"
}
}
18 changes: 5 additions & 13 deletions test/css-in-js.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('Has possible values on viewport somewhre between min and max.', async () =
body: twoElementBody,
widths: [1000],
// Executed inside puppeteer, will only return results.
selector: () => {
selector: function Selector() {
const regularText = document.querySelector('#regular-text')
const regularTextStyle = window.getComputedStyle(regularText)
const divElement = document.querySelector('#div-element')
Expand Down Expand Up @@ -72,12 +72,8 @@ test('Max and min values reached on maximum viewport.', async () => {
widths: [defaults.viewportMin, defaults.viewportMax],
// Executed inside puppeteer, will only return results.
selector: () => {
const regularTextStyle = window.getComputedStyle(
document.querySelector('#regular-text')
)
const divElementStyle = window.getComputedStyle(
document.querySelector('#div-element')
)
const regularTextStyle = window.getComputedStyle(document.querySelector('#regular-text'))
const divElementStyle = window.getComputedStyle(document.querySelector('#div-element'))
return {
regularTextFontSize: parseFloat(regularTextStyle.fontSize, 10),
divElementHeight: parseFloat(divElementStyle.height, 10),
Expand Down Expand Up @@ -116,12 +112,8 @@ test('Ratios can be configured.', async () => {
widths: [defaults.viewportMin, 910, defaults.viewportMax],
// Executed inside puppeteer, will only return results.
selector: () => {
const regularTextStyle = window.getComputedStyle(
document.querySelector('#regular-text')
)
const divElementStyle = window.getComputedStyle(
document.querySelector('#div-element')
)
const regularTextStyle = window.getComputedStyle(document.querySelector('#regular-text'))
const divElementStyle = window.getComputedStyle(document.querySelector('#div-element'))
return {
regularTextFontSize: parseFloat(regularTextStyle.fontSize, 10),
divElementHeight: parseFloat(divElementStyle.height, 10),
Expand Down
26 changes: 10 additions & 16 deletions test/utility/evaluate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/extensions
import mapSeries from 'async/mapSeries'
import sass from 'node-sass'
import less from 'less'
Expand All @@ -20,21 +19,16 @@ export const evaluate = async ({ styles, body, widths, selector }) => {

page.setContent(html)

const results = await new Promise((done) =>
// Have to be run in series as browser instance is shared.
mapSeries(
widths,
async (width) => {
page.setViewport({
width,
height: 1000,
})

return page.evaluate(selector)
},
(_, result) => done(result)
)
)
const results = await mapSeries(widths, async (width) => {
page.setViewport({
width,
height: 1000,
})

const document = await page.$('document')

return page.evaluate(selector, document)
})

const result = {}

Expand Down

0 comments on commit 500319f

Please sign in to comment.