Skip to content

Commit 3946d06

Browse files
authored
build: update dependencies (#1755)
* build: update dependencies * refactor: use vitest instead of ava
1 parent c246bbf commit 3946d06

File tree

13 files changed

+143
-258
lines changed

13 files changed

+143
-258
lines changed

package.json

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -102,44 +102,44 @@
102102
],
103103
"dependencies": {
104104
"@kikobeats/use-query-state": "1.2.2",
105-
"@microlink/mql": "~0.13.8",
105+
"@microlink/mql": "~0.13.11",
106106
"@microlink/react": "5.5.22",
107107
"@microlink/recipes": "~1.8.1",
108-
"@react-spring/web": "~9.7.4",
108+
"@react-spring/web": "~9.7.5",
109109
"@stripe/react-stripe-js": "~2.8.0",
110-
"@stripe/stripe-js": "~4.9.0",
110+
"@stripe/stripe-js": "~5.2.0",
111111
"@styled-system/prop-types": "~5.1.5",
112-
"@techstack/styled-system": "~1.0.490",
112+
"@techstack/styled-system": "~1.0.494",
113113
"@tippyjs/react": "~4.2.6",
114-
"@vercel/analytics": "~1.3.1",
114+
"@vercel/analytics": "~1.4.1",
115115
"babel-plugin-styled-components": "~2.1.4",
116116
"beauty-error": "~1.2.18",
117117
"cssnano": "~7.0.6",
118118
"cssnano-preset-advanced": "~7.0.6",
119119
"dlv": "~1.1.3",
120-
"gatsby": "~5.13.7",
120+
"gatsby": "~5.14.0",
121121
"gatsby-plugin-advanced-sitemap": "~2.1.0",
122-
"gatsby-plugin-canonical-urls": "~5.13.1",
123-
"gatsby-plugin-catch-links": "~5.13.1",
124-
"gatsby-plugin-sass": "~6.13.1",
125-
"gatsby-plugin-styled-components": "~6.13.1",
126-
"gatsby-source-filesystem": "~5.13.1",
127-
"gatsby-transformer-javascript-frontmatter": "~5.13.1",
128-
"gatsby-transformer-json": "~5.13.1",
129-
"gatsby-transformer-remark": "~6.13.1",
130-
"gatsby-transformer-yaml": "~5.13.1",
122+
"gatsby-plugin-canonical-urls": "~5.14.0",
123+
"gatsby-plugin-catch-links": "~5.14.0",
124+
"gatsby-plugin-sass": "~6.14.0",
125+
"gatsby-plugin-styled-components": "~6.14.0",
126+
"gatsby-source-filesystem": "~5.14.0",
127+
"gatsby-transformer-javascript-frontmatter": "~5.14.0",
128+
"gatsby-transformer-json": "~5.14.0",
129+
"gatsby-transformer-remark": "~6.14.0",
130+
"gatsby-transformer-yaml": "~5.14.0",
131131
"github-slugger": "~2.0.0",
132132
"humanize-url": "~3.0.0",
133133
"is-color": "~1.0.2",
134-
"is-url-http": "~2.3.8",
134+
"is-url-http": "~2.3.9",
135135
"json-future": "~2.2.21",
136136
"lodash": "~4.17.21",
137137
"mdx-scoped-runtime": "~0.8.0",
138138
"microsoft-capitalize": "~1.0.5",
139139
"normalize.css": "~8.0.1",
140140
"path-browserify": "~1.0.1",
141141
"polished": "~4.3.1",
142-
"postcss": "~8.4.47",
142+
"postcss": "~8.4.49",
143143
"postcss-focus": "~7.0.0",
144144
"prepend-http": "~4.0.0",
145145
"prettier": "2",
@@ -152,14 +152,14 @@
152152
"react-timeago": "~7.2.0",
153153
"react-twitter-widgets": "~1.11.0",
154154
"remark-slug": "~7.0.1",
155-
"sass": "~1.80.5",
155+
"sass": "~1.81.0",
156156
"styled-components": "~6.1.13",
157157
"styled-is": "~1.3.0",
158158
"styled-system": "~5.1.5",
159159
"swr": "~2.2.5",
160-
"tldts": "~6.1.48",
160+
"tldts": "~6.1.65",
161161
"top-crawler-agents": "~1.0.27",
162-
"top-user-agents": "~2.1.23",
162+
"top-user-agents": "~2.1.24",
163163
"unique-random-array": "~3.0.0"
164164
},
165165
"devDependencies": {
@@ -172,12 +172,10 @@
172172
"@storybook/builder-webpack5": "~6.5.16",
173173
"@storybook/manager-webpack5": "~6.5.16",
174174
"@storybook/react": "~6.5.16",
175-
"ava": "3",
176175
"contrast": "latest",
177176
"debug-logfmt": "latest",
178177
"esbuild": "latest",
179178
"eslint-config-next": "latest",
180-
"esm": "latest",
181179
"finepack": "latest",
182180
"git-authors-cli": "latest",
183181
"github-generate-release": "latest",
@@ -189,7 +187,8 @@
189187
"standard": "latest",
190188
"standard-markdown": "latest",
191189
"standard-version": "latest",
192-
"tinyspawn": "latest"
190+
"tinyspawn": "latest",
191+
"vitest": "latest"
193192
},
194193
"engines": {
195194
"node": ">= 18"
@@ -222,20 +221,12 @@
222221
"release:github": "github-generate-release",
223222
"release:tags": "git push --follow-tags origin HEAD:master",
224223
"storybook": "start-storybook -p 6006",
225-
"test": "ava",
224+
"test": "vitest",
226225
"transpile": "echo \"export { getApiUrl } from '@microlink/mql'\" | esbuild --bundle --target=ES2019 --format=esm --minify-whitespace --minify-identifiers > src/helpers/get-api-url.js",
227226
"update": "ncu -i"
228227
},
229228
"private": true,
230229
"license": "MIT",
231-
"ava": {
232-
"files": [
233-
"test/**/*.js"
234-
],
235-
"require": [
236-
"esm"
237-
]
238-
},
239230
"commitlint": {
240231
"extends": [
241232
"@commitlint/config-conventional"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`JavaScript with inline code 1`] = `
4+
"
5+
const mql = require('@microlink/mql')
6+
7+
const { status, data } = await mql('https://myproxy:[email protected]:8001', { function: '({ page }) => page.evaluate('jQuery.fn.jquery')', number: 3000, boolean: true, string: 'MyApiToken', url: 'https://myproxy:[email protected]:8001', scripts: ['https://code.jquery.com/jquery-3.5.0.min.js'], multipleScripts: ['https://code.jquery.com/jquery-3.5.0.min.js','https://code.jquery.com/jquery-3.5.0.min.js'] })
8+
9+
mql.render(data)"
10+
`;
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`js 1`] = `
4+
"const mql = require('@microlink/mql')
5+
const { status, data } = await mql('https://geolocation.microlink.io', {
6+
apiKey: MyApiToken,
7+
proxy: 'https://myproxy:[email protected]:8001'
8+
})
9+
console.log(data)
10+
"
11+
`;
12+
13+
exports[`json 1`] = `
14+
"{
15+
"title": "Wormholes Explained – Breaking Spacetime",
16+
"description": "To support Kurzgesagt and learn more about Brilliant, go to https://www.brilliant.org/nutshell and sign up for free. The first 688 people that go to that lin...",
17+
"lang": "en",
18+
"author": "Kurzgesagt – In a Nutshell",
19+
"publisher": "YouTube",
20+
"image": {
21+
"url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/img.youtube.com!vi!9P6rdqiybaw!maxresdefault.jpg.jpg",
22+
"type": "jpg",
23+
"size": 120116,
24+
"height": 720,
25+
"width": 1280,
26+
"size_pretty": "120 kB",
27+
"palette": [
28+
"#C004F9",
29+
"#EEEEA7",
30+
"#25047C",
31+
"#740296",
32+
"#808018",
33+
"#2C0494"
34+
],
35+
"background_color": "#EEEEA7",
36+
"color": "#AC04DF",
37+
"alternative_color": "#2C0494"
38+
},
39+
"audio": {
40+
"url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/r3---sn-ab5sznly.googlevideo.com!videoplayback!c=WEB&clen=8935291&dur=552.054&ei=6gpAXv-3POHM8gTqtrm",
41+
"type": "mp4",
42+
"duration": 552.054422,
43+
"size": 8935291,
44+
"duration_pretty": "9m",
45+
"size_pretty": "8.94 MB"
46+
},
47+
"url": "https://www.youtube.com/watch?v=9P6rdqiybaw",
48+
"iframe": {
49+
"html": "<iframe width=\\"480\\" height=\\"270\\" src=\\"https://www.youtube.com/embed/9P6rdqiybaw?feature=oembed\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>",
50+
"scripts": []
51+
},
52+
"date": "2020-02-09T13:36:39.000Z",
53+
"logo": {
54+
"url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/logo.clearbit.com!youtube.com.png",
55+
"type": "png",
56+
"size": 2421,
57+
"height": 128,
58+
"width": 128,
59+
"size_pretty": "2.42 kB",
60+
"palette": [
61+
"#FC0404",
62+
"#FC8484",
63+
"#830101",
64+
"#970101",
65+
"#950303",
66+
"#970101"
67+
],
68+
"background_color": "#FC0404",
69+
"color": "#320000",
70+
"alternative_color": "#320101"
71+
},
72+
"video": {
73+
"url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/r3---sn-ab5sznly.googlevideo.com!videoplayback!c=WEB&dur=552.054&ei=6gpAXv-3POHM8gTqtrmwBA&expire=15",
74+
"type": "mp4",
75+
"duration": 552.007943,
76+
"size": 54633895,
77+
"height": 720,
78+
"width": 1280,
79+
"duration_pretty": "9m",
80+
"size_pretty": "54.6 MB"
81+
}
82+
}
83+
"
84+
`;
85+
86+
exports[`serializeFmt 1`] = `"type='email' id='input' placeholder='[email protected]' suggestions={[{ value: '[email protected]' }, { value: '[email protected]' }]} width='9rem' fontSize={1} required "`;

test/helpers/get-lines.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import test from 'ava'
1+
import { describe, it, expect } from 'vitest'
22

33
import getLines from '../../src/helpers/get-lines.js'
44

@@ -12,8 +12,10 @@ const values = [
1212
['language-json{33,55}', [33, 55]]
1313
]
1414

15-
values.forEach(([str, result]) => {
16-
test(`${str}${result}`, t => {
17-
t.deepEqual(getLines(str), result)
15+
describe('getLines', () => {
16+
values.forEach(([str, result]) => {
17+
it(`${str}${result}`, () => {
18+
expect(getLines(str)).toEqual(result)
19+
})
1820
})
1921
})

test/helpers/mql-code.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import test from 'ava'
1+
import { test, expect } from 'vitest'
22

33
import mqlCode from '../../src/helpers/mql-code'
44

5-
test('JavaScript with inline code', t => {
5+
test('JavaScript with inline code', () => {
66
const output = mqlCode('https://microlink.io', {
77
function: "({ page }) => page.evaluate('jQuery.fn.jquery')",
88
number: 3000,
@@ -16,5 +16,5 @@ test('JavaScript with inline code', t => {
1616
]
1717
})
1818

19-
t.snapshot(output.JavaScript())
19+
expect(output.JavaScript()).toMatchSnapshot()
2020
})

test/helpers/prettier.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import test from 'ava'
1+
import { test, expect } from 'vitest'
22

33
import prettier, { serializeFmt } from '../../src/helpers/prettier'
44

5-
test('js', t => {
5+
test('js', () => {
66
const code = `const mql = require('@microlink/mql')
77
const { status, data } = await mql('https://geolocation.microlink.io', { apiKey: MyApiToken, proxy: 'https://myproxy:[email protected]:8001' })
88
console.log(data)`
99

1010
const output = prettier.js(code)
1111

12-
t.snapshot(output)
12+
expect(output).toMatchSnapshot()
1313
})
1414

15-
test('json', t => {
15+
test('json', () => {
1616
const code =
1717
'{"title":"Wormholes Explained – Breaking Spacetime","description":"To support Kurzgesagt and learn more about Brilliant, go to https://www.brilliant.org/nutshell and sign up for free. The first 688 people that go to that lin...","lang":"en","author":"Kurzgesagt – In a Nutshell","publisher":"YouTube","image":{"url":"https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/img.youtube.com!vi!9P6rdqiybaw!maxresdefault.jpg.jpg","type":"jpg","size":120116,"height":720,"width":1280,"size_pretty":"120 kB","palette":["#C004F9","#EEEEA7","#25047C","#740296","#808018","#2C0494"],"background_color":"#EEEEA7","color":"#AC04DF","alternative_color":"#2C0494"},"audio":{"url":"https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/r3---sn-ab5sznly.googlevideo.com!videoplayback!c=WEB&clen=8935291&dur=552.054&ei=6gpAXv-3POHM8gTqtrm","type":"mp4","duration":552.054422,"size":8935291,"duration_pretty":"9m","size_pretty":"8.94 MB"},"url":"https://www.youtube.com/watch?v=9P6rdqiybaw","iframe":{"html":"<iframe width=\\"480\\" height=\\"270\\" src=\\"https://www.youtube.com/embed/9P6rdqiybaw?feature=oembed\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>","scripts":[]},"date":"2020-02-09T13:36:39.000Z","logo":{"url":"https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/logo.clearbit.com!youtube.com.png","type":"png","size":2421,"height":128,"width":128,"size_pretty":"2.42 kB","palette":["#FC0404","#FC8484","#830101","#970101","#950303","#970101"],"background_color":"#FC0404","color":"#320000","alternative_color":"#320101"},"video":{"url":"https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/r3---sn-ab5sznly.googlevideo.com!videoplayback!c=WEB&dur=552.054&ei=6gpAXv-3POHM8gTqtrmwBA&expire=15","type":"mp4","duration":552.007943,"size":54633895,"height":720,"width":1280,"duration_pretty":"9m","size_pretty":"54.6 MB"}}'
1818

1919
const output = prettier.json(code)
2020

21-
t.snapshot(output)
21+
expect(output).toMatchSnapshot()
2222
})
2323

24-
test('serializeFmt', t => {
24+
test('serializeFmt', () => {
2525
const output = serializeFmt({
2626
type: 'email',
2727
id: 'input',
@@ -32,5 +32,5 @@ test('serializeFmt', t => {
3232
required: true
3333
})
3434

35-
t.snapshot(output)
35+
expect(output).toMatchSnapshot()
3636
})

test/helpers/snapshots/mql-code.js.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
-367 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)