mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 02:44:45 +00:00
build(packages/platform): setup test suit, add build config
This commit is contained in:
@@ -1,7 +1,14 @@
|
|||||||
import { defineBuildConfig } from 'unbuild';
|
import { defineBuildConfig } from 'unbuild';
|
||||||
|
|
||||||
export default defineBuildConfig({
|
export default defineBuildConfig({
|
||||||
|
entries: [
|
||||||
|
'src/browsers',
|
||||||
|
'src/multi',
|
||||||
|
],
|
||||||
|
clean: true,
|
||||||
|
declaration: true,
|
||||||
rollup: {
|
rollup: {
|
||||||
|
emitCJS: true,
|
||||||
esbuild: {
|
esbuild: {
|
||||||
// minify: true,
|
// minify: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@robonen/platform",
|
"name": "@robonen/platform",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"description": "Platform dependent utilities for javascript development",
|
"description": "Platform dependent utilities for javascript development",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -26,21 +26,27 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"main": "./dist/index.cjs",
|
|
||||||
"module": "./dist/index.mjs",
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
"./browsers": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/browsers.mjs",
|
||||||
"require": "./dist/index.cjs",
|
"require": "./dist/browsers.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/browsers.d.ts"
|
||||||
|
},
|
||||||
|
"./multi": {
|
||||||
|
"import": "./dist/multi.mjs",
|
||||||
|
"require": "./dist/multi.cjs",
|
||||||
|
"types": "./dist/multi.d.ts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
|
"dev": "vitest dev",
|
||||||
"build": "unbuild"
|
"build": "unbuild"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@robonen/tsconfig": "workspace:*",
|
"@robonen/tsconfig": "workspace:*",
|
||||||
"unbuild": "catalog:"
|
"jsdom": "catalog:",
|
||||||
|
"unbuild": "catalog:",
|
||||||
|
"vitest": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export * from './multi';
|
|
||||||
7
packages/platform/vitest.config.ts
Normal file
7
packages/platform/vitest.config.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
environment: 'jsdom',
|
||||||
|
},
|
||||||
|
});
|
||||||
76
pnpm-lock.yaml
generated
76
pnpm-lock.yaml
generated
@@ -65,9 +65,15 @@ importers:
|
|||||||
'@robonen/tsconfig':
|
'@robonen/tsconfig':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../tsconfig
|
version: link:../tsconfig
|
||||||
|
jsdom:
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 25.0.1
|
||||||
unbuild:
|
unbuild:
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 3.0.0-rc.11(typescript@5.4.4)
|
version: 3.0.0-rc.11(typescript@5.4.4)
|
||||||
|
vitest:
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 2.1.4(@types/node@22.8.6)(jsdom@25.0.1)
|
||||||
|
|
||||||
packages/renovate:
|
packages/renovate:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
@@ -2593,9 +2599,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
get-func-name@2.0.2:
|
|
||||||
resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==}
|
|
||||||
|
|
||||||
get-intrinsic@1.2.4:
|
get-intrinsic@1.2.4:
|
||||||
resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}
|
resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -3158,9 +3161,6 @@ packages:
|
|||||||
longest-streak@2.0.4:
|
longest-streak@2.0.4:
|
||||||
resolution: {integrity: sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==}
|
resolution: {integrity: sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==}
|
||||||
|
|
||||||
loupe@3.1.1:
|
|
||||||
resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==}
|
|
||||||
|
|
||||||
loupe@3.1.2:
|
loupe@3.1.2:
|
||||||
resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==}
|
resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==}
|
||||||
|
|
||||||
@@ -4591,37 +4591,6 @@ packages:
|
|||||||
terser:
|
terser:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
vite@5.4.9:
|
|
||||||
resolution: {integrity: sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==}
|
|
||||||
engines: {node: ^18.0.0 || >=20.0.0}
|
|
||||||
hasBin: true
|
|
||||||
peerDependencies:
|
|
||||||
'@types/node': ^18.0.0 || >=20.0.0
|
|
||||||
less: '*'
|
|
||||||
lightningcss: ^1.21.0
|
|
||||||
sass: '*'
|
|
||||||
sass-embedded: '*'
|
|
||||||
stylus: '*'
|
|
||||||
sugarss: '*'
|
|
||||||
terser: ^5.4.0
|
|
||||||
peerDependenciesMeta:
|
|
||||||
'@types/node':
|
|
||||||
optional: true
|
|
||||||
less:
|
|
||||||
optional: true
|
|
||||||
lightningcss:
|
|
||||||
optional: true
|
|
||||||
sass:
|
|
||||||
optional: true
|
|
||||||
sass-embedded:
|
|
||||||
optional: true
|
|
||||||
stylus:
|
|
||||||
optional: true
|
|
||||||
sugarss:
|
|
||||||
optional: true
|
|
||||||
terser:
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
vitepress@1.4.3:
|
vitepress@1.4.3:
|
||||||
resolution: {integrity: sha512-956c2K2Mr0ubY9bTc2lCJD3g0mgo0mARB1iJC/BqUt4s0AM8Wl60wSU4zbFnzV7X2miFK1XJDKzGZnuEN90umw==}
|
resolution: {integrity: sha512-956c2K2Mr0ubY9bTc2lCJD3g0mgo0mARB1iJC/BqUt4s0AM8Wl60wSU4zbFnzV7X2miFK1XJDKzGZnuEN90umw==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -6450,7 +6419,7 @@ snapshots:
|
|||||||
estree-walker: 2.0.2
|
estree-walker: 2.0.2
|
||||||
fdir: 6.3.0(picomatch@2.3.1)
|
fdir: 6.3.0(picomatch@2.3.1)
|
||||||
is-reference: 1.2.1
|
is-reference: 1.2.1
|
||||||
magic-string: 0.30.11
|
magic-string: 0.30.12
|
||||||
picomatch: 2.3.1
|
picomatch: 2.3.1
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.24.0
|
rollup: 4.24.0
|
||||||
@@ -6474,7 +6443,7 @@ snapshots:
|
|||||||
'@rollup/plugin-replace@6.0.1(rollup@4.24.0)':
|
'@rollup/plugin-replace@6.0.1(rollup@4.24.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rollup/pluginutils': 5.1.2(rollup@4.24.0)
|
'@rollup/pluginutils': 5.1.2(rollup@4.24.0)
|
||||||
magic-string: 0.30.11
|
magic-string: 0.30.12
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
rollup: 4.24.0
|
rollup: 4.24.0
|
||||||
|
|
||||||
@@ -7068,13 +7037,13 @@ snapshots:
|
|||||||
chai: 5.1.2
|
chai: 5.1.2
|
||||||
tinyrainbow: 1.2.0
|
tinyrainbow: 1.2.0
|
||||||
|
|
||||||
'@vitest/mocker@2.1.4(vite@5.4.9(@types/node@22.8.6))':
|
'@vitest/mocker@2.1.4(vite@5.4.10(@types/node@22.8.6))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vitest/spy': 2.1.4
|
'@vitest/spy': 2.1.4
|
||||||
estree-walker: 3.0.3
|
estree-walker: 3.0.3
|
||||||
magic-string: 0.30.12
|
magic-string: 0.30.12
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
vite: 5.4.9(@types/node@22.8.6)
|
vite: 5.4.10(@types/node@22.8.6)
|
||||||
|
|
||||||
'@vitest/pretty-format@2.1.4':
|
'@vitest/pretty-format@2.1.4':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -7527,7 +7496,7 @@ snapshots:
|
|||||||
assertion-error: 2.0.1
|
assertion-error: 2.0.1
|
||||||
check-error: 2.1.1
|
check-error: 2.1.1
|
||||||
deep-eql: 5.0.2
|
deep-eql: 5.0.2
|
||||||
loupe: 3.1.1
|
loupe: 3.1.2
|
||||||
pathval: 2.0.0
|
pathval: 2.0.0
|
||||||
|
|
||||||
chalk@2.4.2:
|
chalk@2.4.2:
|
||||||
@@ -8146,8 +8115,6 @@ snapshots:
|
|||||||
|
|
||||||
gensync@1.0.0-beta.2: {}
|
gensync@1.0.0-beta.2: {}
|
||||||
|
|
||||||
get-func-name@2.0.2: {}
|
|
||||||
|
|
||||||
get-intrinsic@1.2.4:
|
get-intrinsic@1.2.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
es-errors: 1.3.0
|
es-errors: 1.3.0
|
||||||
@@ -8750,10 +8717,6 @@ snapshots:
|
|||||||
|
|
||||||
longest-streak@2.0.4: {}
|
longest-streak@2.0.4: {}
|
||||||
|
|
||||||
loupe@3.1.1:
|
|
||||||
dependencies:
|
|
||||||
get-func-name: 2.0.2
|
|
||||||
|
|
||||||
loupe@3.1.2: {}
|
loupe@3.1.2: {}
|
||||||
|
|
||||||
lowercase-keys@2.0.0: {}
|
lowercase-keys@2.0.0: {}
|
||||||
@@ -9825,7 +9788,7 @@ snapshots:
|
|||||||
|
|
||||||
rollup-plugin-dts@6.1.1(rollup@4.24.0)(typescript@5.4.4):
|
rollup-plugin-dts@6.1.1(rollup@4.24.0)(typescript@5.4.4):
|
||||||
dependencies:
|
dependencies:
|
||||||
magic-string: 0.30.11
|
magic-string: 0.30.12
|
||||||
rollup: 4.24.0
|
rollup: 4.24.0
|
||||||
typescript: 5.4.4
|
typescript: 5.4.4
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
@@ -10434,7 +10397,7 @@ snapshots:
|
|||||||
cac: 6.7.14
|
cac: 6.7.14
|
||||||
debug: 4.3.7
|
debug: 4.3.7
|
||||||
pathe: 1.1.2
|
pathe: 1.1.2
|
||||||
vite: 5.4.9(@types/node@22.8.6)
|
vite: 5.4.10(@types/node@22.8.6)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@types/node'
|
- '@types/node'
|
||||||
- less
|
- less
|
||||||
@@ -10455,15 +10418,6 @@ snapshots:
|
|||||||
'@types/node': 22.8.6
|
'@types/node': 22.8.6
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
vite@5.4.9(@types/node@22.8.6):
|
|
||||||
dependencies:
|
|
||||||
esbuild: 0.21.5
|
|
||||||
postcss: 8.4.47
|
|
||||||
rollup: 4.24.0
|
|
||||||
optionalDependencies:
|
|
||||||
'@types/node': 22.8.6
|
|
||||||
fsevents: 2.3.3
|
|
||||||
|
|
||||||
vitepress@1.4.3(@algolia/client-search@4.23.2)(@types/node@22.8.6)(postcss@8.4.47)(search-insights@2.13.0)(typescript@5.4.4):
|
vitepress@1.4.3(@algolia/client-search@4.23.2)(@types/node@22.8.6)(postcss@8.4.47)(search-insights@2.13.0)(typescript@5.4.4):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@docsearch/css': 3.6.2
|
'@docsearch/css': 3.6.2
|
||||||
@@ -10516,7 +10470,7 @@ snapshots:
|
|||||||
vitest@2.1.4(@types/node@22.8.6)(jsdom@25.0.1):
|
vitest@2.1.4(@types/node@22.8.6)(jsdom@25.0.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vitest/expect': 2.1.4
|
'@vitest/expect': 2.1.4
|
||||||
'@vitest/mocker': 2.1.4(vite@5.4.9(@types/node@22.8.6))
|
'@vitest/mocker': 2.1.4(vite@5.4.10(@types/node@22.8.6))
|
||||||
'@vitest/pretty-format': 2.1.4
|
'@vitest/pretty-format': 2.1.4
|
||||||
'@vitest/runner': 2.1.4
|
'@vitest/runner': 2.1.4
|
||||||
'@vitest/snapshot': 2.1.4
|
'@vitest/snapshot': 2.1.4
|
||||||
@@ -10532,7 +10486,7 @@ snapshots:
|
|||||||
tinyexec: 0.3.1
|
tinyexec: 0.3.1
|
||||||
tinypool: 1.0.1
|
tinypool: 1.0.1
|
||||||
tinyrainbow: 1.2.0
|
tinyrainbow: 1.2.0
|
||||||
vite: 5.4.9(@types/node@22.8.6)
|
vite: 5.4.10(@types/node@22.8.6)
|
||||||
vite-node: 2.1.4(@types/node@22.8.6)
|
vite-node: 2.1.4(@types/node@22.8.6)
|
||||||
why-is-node-running: 2.3.0
|
why-is-node-running: 2.3.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user