-
Notifications
You must be signed in to change notification settings - Fork 342
feat!: move package to ESM only #1078
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
Open
userquin
wants to merge
15
commits into
Akryum:main
Choose a base branch
from
userquin:fix-package-exports
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
988967b
feat!: move package to ESM only
userquin edb07a4
chore: fix types
userquin 6c6c831
chore: copy vue files to dist/components and add some jsdocs
userquin f69dcb0
chore: remove deprecated directives
userquin aed7f91
chore: add `.idea` to `.gitignore`
userquin 7bd44b3
chore: remove components and directives from index.t module
userquin fd1c924
chore: export components and types
userquin 14ab05a
chore: add missing components imports to index.ts module
userquin a161641
chore: remove `vClosePopper` export from index.ts module
userquin be6d967
chore: add some more jsdoc to the patch script
userquin 779a6a9
chore: fix docs build
userquin 5c6d957
chore: add `unplugin-vue-components-resolvers`
userquin 757ff79
chore: fix directives and component names types
userquin e8e2237
chore: prepare unimport preset for nuxt integration
userquin 824e294
chore: add nuxt types and include unimport preset logic
userquin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<script lang="ts"> | ||
// | ||
</script> | ||
<template> | ||
<h1>VTooltip Demo 1</h1> | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "@vue/tsconfig/tsconfig.dom.json", | ||
"compilerOptions": { | ||
"composite": true, | ||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", | ||
|
||
"baseUrl": ".", | ||
"paths": { | ||
"floating-vue/directives": ["../packages/floating-vue/src/directives.ts"], | ||
"floating-vue": ["../packages/floating-vue/src/index.ts"] | ||
} | ||
}, | ||
"include": ["*.d.ts", "src/**/*", "src/**/*.vue"], | ||
"exclude": ["src/**/__tests__/*"] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.node.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.app.json" | ||
} | ||
], | ||
"files": [] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"extends": "@tsconfig/node22/tsconfig.json", | ||
"compilerOptions": { | ||
"composite": true, | ||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", | ||
|
||
"baseUrl": ".", | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"types": ["node"], | ||
"paths": { | ||
"floating-vue/directives": ["../packages/floating-vue/src/directives.ts"], | ||
"floating-vue": ["../packages/floating-vue/src/index.ts"] | ||
}, | ||
"noEmit": true | ||
}, | ||
"include": [ | ||
"vite.config.*", | ||
"vitest.config.*", | ||
"cypress.config.*", | ||
"nightwatch.conf.*", | ||
"playwright.config.*" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
import AutoImport from 'unplugin-auto-import/vite' | ||
import { FloatingVueDirectives } from 'floating-vue/unimport-presets' | ||
import { resolve } from 'node:path' | ||
|
||
export default defineConfig({ | ||
resolve: { | ||
alias: { | ||
'floating-vue/style.css': resolve('./node_modules/floating-vue/dist/style.css'), | ||
'floating-vue/dist/style.css': resolve('./node_modules/floating-vue/dist/style.css'), | ||
'floating-vue/components': resolve('./node_modules/floating-vue/components.mjs'), | ||
'floating-vue/directives': resolve('./node_modules/floating-vue/directives.mjs'), | ||
'floating-vue': resolve('./node_modules/floating-vue/dist/index.mjs'), | ||
userquin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}, | ||
define: { | ||
'VERSION': JSON.stringify('0.0.0'), | ||
}, | ||
plugins: [ | ||
vue(), | ||
AutoImport({ | ||
imports: [ | ||
FloatingVueDirectives(), | ||
], | ||
dts: true, | ||
vueDirectives: true, | ||
}) | ||
], | ||
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export { VDropdown, VMenu, VTooltip } from './dist/components.mjs'; | ||
|
||
export { default as Popper } from './dist/components/Popper.vue.mjs'; | ||
export type * from './dist/components/Popper.vue.d.mts'; | ||
|
||
export { default as PopperContent } from './dist/components/PopperContent.vue.mjs' | ||
export type * from './dist/components/PopperContent.vue.d.mts' | ||
|
||
export { default as PopperWrapper } from './dist/components/PopperWrapper.vue.mjs' | ||
export type * from './dist/components/PopperWrapper.vue.d.mts' | ||
|
||
export { default as TooltipDirective } from './dist/components/TooltipDirective.vue.mjs' | ||
export type * from './dist/components/TooltipDirective.vue.d.mts' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export { VDropdown, VMenu, VTooltip } from './dist/components'; | ||
|
||
export { default as Popper } from './dist/components/Popper.vue.js'; | ||
export type * from './dist/components/Popper.vue.d.ts'; | ||
|
||
export { default as PopperContent } from './dist/components/PopperContent.vue.js' | ||
export type * from './dist/components/PopperContent.vue.d.ts' | ||
|
||
export { default as PopperWrapper } from './dist/components/PopperWrapper.vue.js' | ||
export type * from './dist/components/PopperWrapper.vue.d.ts' | ||
|
||
export { default as TooltipDirective } from './dist/components/TooltipDirective.vue.js' | ||
export type * from './dist/components/TooltipDirective.vue.d.ts' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { VDropdown, VMenu, VTooltip } from './dist/components.js' | ||
|
||
export { default as Popper } from './dist/components/Popper.vue' | ||
export { default as PopperContent } from './dist/components/PopperContent.vue' | ||
export { default as PopperWrapper } from './dist/components/PopperWrapper.vue' | ||
export { default as TooltipDirective } from './dist/components/TooltipDirective.vue' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { VDropdown, VMenu, VTooltip } from './dist/components.mjs' | ||
|
||
export { default as Popper } from './dist/components/Popper.vue' | ||
export { default as PopperContent } from './dist/components/PopperContent.vue' | ||
export { default as PopperWrapper } from './dist/components/PopperWrapper.vue' | ||
export { default as TooltipDirective } from './dist/components/TooltipDirective.vue' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './dist/directives'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,39 +5,66 @@ | |
"author": "Guillaume Chau <[email protected]>", | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=development vite build --watch", | ||
"build": "cross-env NODE_ENV=production vite build && vue-tsc -d --emitDeclarationOnly", | ||
"build": "cross-env NODE_ENV=production vite build && vue-tsc -d --emitDeclarationOnly && node ./scripts/patch-build.mjs", | ||
"prepublishOnly": "pnpm run test && pnpm run build", | ||
"test": "pnpm run test:unit", | ||
"test:unit": "peeky run" | ||
}, | ||
"main": "dist/floating-vue.umd.js", | ||
"module": "dist/floating-vue.mjs", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/floating-vue.umd.js", | ||
"import": "./dist/floating-vue.mjs", | ||
"types": "./dist/index.d.ts" | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"./components": { | ||
"types": "./components.d.mts", | ||
"default": "./components.mjs" | ||
}, | ||
"./directives": { | ||
"types": "./dist/directives.d.mts", | ||
"default": "./dist/directives.mjs" | ||
}, | ||
"./utils": { | ||
"types": "./dist/utils.d.mts", | ||
"default": "./dist/utils.mjs" | ||
}, | ||
"./unimport-presets": { | ||
"types": "./dist/unimport-presets.d.mts", | ||
"default": "./dist/unimport-presets.mjs" | ||
}, | ||
"./nuxt": "./nuxt.mjs", | ||
"./style.css": "./dist/style.css", | ||
"./dist/style.css": "./dist/style.css" | ||
}, | ||
"files": [ | ||
"dist", | ||
"components.*", | ||
"directives.d.ts", | ||
"utils.d.ts", | ||
"unimport-presets.d.ts", | ||
"*.mjs" | ||
], | ||
"dependencies": { | ||
"@floating-ui/dom": "~1.1.1", | ||
"vue-resize": "^2.0.0-alpha.1" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^3.2.0", | ||
"@nuxt/kit": "^3.2.0" | ||
"@nuxt/kit": "^3.2.0", | ||
"unimport": "^4.0.0 || ^5.0.0", | ||
"unplugin-vue-components": "^28.5.0", | ||
"vue": "^3.2.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@nuxt/kit": { | ||
"optional": true | ||
}, | ||
"unimport": { | ||
"optional": true | ||
}, | ||
"unplugin-vue-components": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
|
@@ -50,6 +77,8 @@ | |
"babel-jest": "^29.5.0", | ||
"cross-env": "^7.0.3", | ||
"fs-extra": "^11.1.1", | ||
"unimport": "^5.0.1", | ||
"unplugin-vue-components": "^28.5.0", | ||
"vite": "^4.3.9", | ||
"vue": "^3.3.4", | ||
"vue-tsc": "^1.6.5", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 need to add
tsc-alias
as dev dependency,unbuild
ortsdown
will resolve these entries, vite requires resolve.aliasThere 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.
tsdown
doesn't support stubbing yet...