Skip to content

Commit d6dcf8f

Browse files
TahulBobbieGoede
andauthored
feat!: drop CJS and use VueUse v13 (#254)
* fix drop unused ts-expect-error * feat add type hint in index * feat update vueuse useMediaQuery usage * feat useMotionControls.ts ; add typehint * feat useMotionVariants.ts ; add type hint * feat drop prettier * feat drop cjs in build.config & package.json * feat global * fix: linting errors * chore(deps): update `vueuse` dependencies * ci: fix corepack * chore: remove unused script * build: configure unbuild declaration node16 * fix: package exports and types * fix: update typescript and unbuild and fix build * fix: linting errors * fix: disable ssg prettify to prevent prettier failure * fix: add back main entry * test: wait for duration of variant transition * chore: update pnpm and node versions * chore: add contributors to package --------- Co-authored-by: Bobbie Goede <[email protected]>
1 parent 3c86bf8 commit d6dcf8f

18 files changed

+11572
-12842
lines changed

.github/workflows/ci.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,22 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: ${{ matrix.os }}
14-
1513
strategy:
1614
matrix:
1715
os: [ubuntu-latest] # macos-latest, windows-latest
18-
node: [18]
16+
node: [20]
17+
18+
runs-on: ${{ matrix.os }}
1919

2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@master
22+
uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
2525
fetch-depth: 0
2626

27-
- name: Install PNPM
28-
uses: pnpm/[email protected]
29-
with:
30-
version: 8.7.0
27+
- name: Enable corepack
28+
run: npm i -fg corepack && corepack enable
3129

3230
- name: Use Node.js ${{ matrix.node }}
3331
uses: actions/setup-node@v2
@@ -57,15 +55,16 @@ jobs:
5755
nightly-release:
5856
needs:
5957
- test
60-
runs-on: ${{ matrix.os }}
6158
strategy:
6259
matrix:
63-
node: [18]
60+
node: [20]
6461
os: [ubuntu-latest]
62+
63+
runs-on: ${{ matrix.os }}
64+
6565
steps:
6666
- uses: actions/checkout@v4
67-
68-
- run: corepack enable
67+
- run: npm i -fg corepack && corepack enable
6968

7069
- uses: actions/setup-node@v4
7170
with:

.github/workflows/nightly-release.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,25 @@ on:
1515
jobs:
1616
release:
1717
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') }}
18-
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
node: [20]
22+
os: [ubuntu-latest]
23+
24+
runs-on: ${{ matrix.os }}
1925

2026
steps:
2127
- name: Checkout code
2228
uses: actions/checkout@v4
2329

2430
- name: Enable corepack
25-
run: corepack enable
31+
run: npm i -fg corepack && corepack enable
2632

2733
- name: Setup node
2834
uses: actions/setup-node@v4
2935
with:
30-
node-version: 18.18
36+
node-version: ${{ matrix.node }}
3137
cache: pnpm
3238

3339
- name: Install dependencies

.github/workflows/release.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,26 @@ on:
1010

1111
jobs:
1212
release:
13-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node: [20]
16+
os: [ubuntu-latest]
17+
18+
runs-on: ${{ matrix.os }}
19+
1420
steps:
1521
- name: Checkout codes
1622
uses: actions/checkout@v4
1723
with:
1824
fetch-depth: 0
1925

2026
- name: Enable corepack
21-
run: corepack enable
27+
run: npm i -fg corepack && corepack enable
2228

2329
- name: Setup node.js
2430
uses: actions/setup-node@v4
2531
with:
26-
node-version: 18
32+
node-version: ${{ matrix.os }}
2733
cache: pnpm
2834

2935
- name: Install dependencies

.github/workflows/targets.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,22 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest] # macos-latest, windows-latest
18-
node: [18]
18+
node: [20]
1919

2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@master
22+
uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
2525
fetch-depth: 0
2626

27-
- name: Install PNPM
28-
uses: pnpm/[email protected]
29-
with:
30-
version: 8.7.0
27+
- name: Enable corepack
28+
run: npm i -fg corepack && corepack enable
3129

32-
- name: Use Node.js ${{ matrix.node }}
33-
uses: actions/setup-node@v2
30+
- name: Setup node
31+
uses: actions/setup-node@v4
3432
with:
3533
node-version: ${{ matrix.node }}
36-
registry-url: https://registry.npmjs.org/
3734
cache: pnpm
3835

3936
- name: Install dependencies

.prettierrc

-6
This file was deleted.

build.config.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { defineBuildConfig } from 'unbuild'
22

33
export default defineBuildConfig({
4-
rollup: {
5-
emitCJS: true,
6-
},
7-
declaration: true,
4+
declaration: 'node16',
85
// warnings triggered by nuxt exports not being built - happens in separate script
96
failOnWarn: false,
107
entries: [
@@ -16,13 +13,6 @@ export default defineBuildConfig({
1613
format: 'esm',
1714
ext: 'mjs',
1815
},
19-
{
20-
input: 'src/index.ts',
21-
outDir: 'dist',
22-
name: 'index',
23-
format: 'cjs',
24-
ext: 'cjs',
25-
},
2616
],
2717
externals: [
2818
'@nuxt/kit',

package.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
"name": "@vueuse/motion",
33
"type": "module",
44
"version": "2.2.6",
5-
"packageManager": "pnpm@8.15.5+sha512.b051a32c7e695833b84926d3b29b8cca57254b589f0649d899c6e9d0edb670b91ec7e2a43459bae73759bb5ce619c3266f116bf931ce22d1ef1759a7e45aa96f",
5+
"packageManager": "pnpm@10.6.2",
66
"description": "🤹 Vue Composables putting your components in motion",
77
"author": "Yaël GUILLOUX <[email protected]>",
8+
"contributors": [
9+
{
10+
"name": "Yaël Guilloux (@Tahul)"
11+
},
12+
{
13+
"name": "Bobbie Goede (@BobbieGoede)"
14+
}
15+
],
816
"license": "MIT",
917
"homepage": "https://github.com/vueuse/motion#readme",
1018
"repository": "https://github.com/vueuse/motion",
@@ -21,23 +29,16 @@
2129
],
2230
"sideEffects": false,
2331
"exports": {
24-
".": {
25-
"import": "./dist/index.mjs",
26-
"require": "./dist/index.cjs"
27-
},
28-
"./nuxt": {
29-
"import": "./dist/nuxt/module.mjs",
30-
"require": "./dist/nuxt/module.cjs"
31-
}
32+
".": "./dist/index.mjs",
33+
"./nuxt": "./dist/nuxt/module.mjs"
3234
},
33-
"main": "./dist/index.cjs",
35+
"main": "./dist/index.mjs",
3436
"module": "./dist/index.mjs",
35-
"types": "./dist/index.d.ts",
37+
"types": "./dist/index.d.mts",
3638
"typesVersions": {
3739
"*": {
38-
"*": [
39-
"./dist/*",
40-
"./*"
40+
"nuxt": [
41+
"./dist/nuxt/module.d.mts"
4142
]
4243
}
4344
},
@@ -79,8 +80,8 @@
7980
"vue": ">=3.0.0"
8081
},
8182
"dependencies": {
82-
"@vueuse/core": "^10.10.0",
83-
"@vueuse/shared": "^10.10.0",
83+
"@vueuse/core": "^13.0.0",
84+
"@vueuse/shared": "^13.0.0",
8485
"csstype": "^3.1.3",
8586
"framesync": "^6.1.2",
8687
"popmotion": "^11.0.5",
@@ -106,9 +107,8 @@
106107
"lint-staged": "^15.2.5",
107108
"nuxt": "^3.13.0",
108109
"pkg-pr-new": "^0.0.20",
109-
"prettier": "^3.2.5",
110-
"typescript": "^5.4.5",
111-
"unbuild": "^2.0.0",
110+
"typescript": "^5.8.2",
111+
"unbuild": "^3.5.0",
112112
"vite": "5.2.12",
113113
"vitest": "^1.6.0",
114114
"vue": "^3.4.38",

playgrounds/vite-ssg/vite.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default defineConfig({
1010
],
1111
ssgOptions: {
1212
script: 'async',
13-
formatting: 'prettify',
1413
},
1514
resolve: {
1615
alias: [

0 commit comments

Comments
 (0)