tinyglobby icon indicating copy to clipboard operation
tinyglobby copied to clipboard

feat: add new `compileGlobs` helper function

Open userquin opened this issue 3 months ago • 9 comments

I haven't found the docs repo, included a jsdoc to the new compileGlobs helper function and so we can just move the content to the docs.

Right now the jsdoc using /** but should use /**/*.js in the globs, adding the *.js breaks the module.

resolves #166

userquin avatar Sep 26 '25 16:09 userquin

I need to add some more logic since we cannot use picomatch directly...

userquin avatar Sep 26 '25 19:09 userquin

Open in StackBlitz

npm i https://pkg.pr.new/tinyglobby@168

commit: 4a7c505

pkg-pr-new[bot] avatar Sep 26 '25 19:09 pkg-pr-new[bot]

I also need to add some tests (?).

Here PR sent to unplugin-vue-components https://github.com/unplugin/unplugin-vue-components/pull/885 : a working test using tinyglobby from local tgz from this PR can be found here https://github.com/unplugin/unplugin-vue-components/pull/885/files#diff-27fde5a56873e061c181b82af6cb092f8134719ba3eef739bfec2a3adc6f5bc8R27 (check also the test here https://github.com/unplugin/unplugin-vue-components/pull/885/files#diff-1df2465f0c401374a25cd07bf46305c86a09f87c96621c3a65660cddf226a523R36-R51 and the snap here https://github.com/unplugin/unplugin-vue-components/pull/885/files#diff-9780bc82cdbec33c105d9201f20c5c09342355082701a080dc07a890cbfb4e8fR33-R65).

(ohhhh, pkg-pr-new there, I'm going to use it at unplugin-vue-components ✔️ done)

userquin avatar Sep 26 '25 19:09 userquin

argggg, I'm new to biome, I run pnpm check and pnpm lint and it is fine on my local, you should add a CONTRIBUTING.md file.

biome scripts

userquin avatar Sep 26 '25 19:09 userquin

We should split some code to allow reuse it here, maybe with changes here https://github.com/SuperchupuDev/tinyglobby/pull/170

userquin avatar Sep 26 '25 23:09 userquin

@SuperchupuDev any hint if this will be added? I'm asking because I need to fix some repositories

userquin avatar Oct 11 '25 03:10 userquin

i haven't considered yet whether something like this will be added, plan is to get #170 merged first to avoid merge conflicts. if this wasn't added, would you have any other alternatives that solve your use case?

SuperchupuDev avatar Oct 11 '25 07:10 SuperchupuDev

Other than copy/pasting the code here and adding the dependency to unplugin vue components? No 😔

Just read the jsdocs, last paragraph.

userquin avatar Oct 11 '25 11:10 userquin

Another solution here is exporting the helper functions and so we can use them.

userquin avatar Oct 11 '25 11:10 userquin