-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: drop CJS and use VueUse v13 #254
Conversation
I just marked it as breaking with |
I think we can skip straight to vueuse v13 https://github.com/vueuse/vueuse/releases/tag/v13.0.0 |
commit: |
@userquin |
ok, I'll check it later in the afternoon. |
package.json
Outdated
@@ -22,15 +22,12 @@ | |||
"sideEffects": false, | |||
"exports": { | |||
".": { | |||
"import": "./dist/index.mjs", | |||
"require": "./dist/index.cjs" | |||
"import": "./dist/index.mjs" | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ".": "./dist/index.mjs"
package.json
Outdated
}, | ||
"./nuxt": { | ||
"import": "./dist/nuxt/module.mjs", | ||
"require": "./dist/nuxt/module.cjs" | ||
"import": "./dist/nuxt/module.mjs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "./nuxt": "./dist/module.mjs"
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"typesVersions": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we're not using .js
in the file extensions in the package, we need to add the d.mts
for nuxt , "./*"
isn't effective:
"typesVersions": {
"*": {
"nuxt": [
"./dist/nuxt/module.d.mts"
]
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we have the following?
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./*"
],
"nuxt": [
"./dist/nuxt/module.d.mts"
]
}
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just use .js
instead .mjs
and keep current "typesVersions"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we have the following?
"typesVersions": { "*": { "*": [ "./dist/*", "./*" ], "nuxt": [ "./dist/nuxt/module.d.mts" ] } },
no, just nuxt entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact Nuxt will drop support for node10 module resolution (if not yet removed), we can remove "typesVersions" entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nuxt still supports node 10 , so it is fine
build.config.ts
Outdated
@@ -2,7 +2,7 @@ import { defineBuildConfig } from 'unbuild' | |||
|
|||
export default defineBuildConfig({ | |||
rollup: { | |||
emitCJS: true, | |||
emitCJS: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove rollup entry, and change declaration to node16
package.json
Outdated
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "types": "./dist/index.d.mts",
package.json
Outdated
@@ -106,7 +103,6 @@ | |||
"lint-staged": "^15.2.5", | |||
"nuxt": "^3.13.0", | |||
"pkg-pr-new": "^0.0.20", | |||
"prettier": "^3.2.5", | |||
"typescript": "^5.4.5", | |||
"unbuild": "^2.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also update typescript and unbuild versions
}, | ||
"main": "./dist/index.cjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the main entry using "main": "./dist/index.mjs",
update tsconfig.json file removing "moduleDetection": "force",
"module": "preserve", |
We should switch tests to use Vitest Browser Mode and test the library in the browser. |
β Type of change
π Description