Comments (7)
It looks like vue-property-decorator
is only used in tests in that PR. Would it be possibly to write the tests to just test vuelidate
? Note that tests just need to typecheck, not run, so you could add declare const
to represent other libraries if necessary.
from types-publisher.
vue
itself is already in the whitelist. I would recommend using that instead of making your own copy of vue types.
from types-publisher.
@andy-ms thanks for the quick answer.
point is that vuelidate is nested in the @component annotation, which need to be either imported from vue-class-component or vue-property-decorator, which ships it indirectly.
In my opinion test-case should be close to real usage scenario. For now including vue-property-decorator sounds like the way to get there.
Do i miss some alternative?
from types-publisher.
I don't think it's worth it to whitelist a new external dependency (which would get added as a dependency of the @types
package) just for tests -- it should be possible to write a simple shim for vue-property-decorator
. It doesn't have to actually work at runtime, just have the right type.
from types-publisher.
Thanks for your advice,
regarding the parts from vue-property-declarator i have been able to create some "shims" that fullfil the job nicely. I noticed that "// $ExpectType CustomRule" will not work with type aliases, well fine.
But there is yet another issue with @types/vue which clearly deprecated, see https://www.npmjs.com/package/@types/vue.
It comes handy to be still availble in the whitelist even, although it feels wrong using deprecated things.
I tried to create shims for this one as well, but the module augmentation does not work with w<hat i tried.
@andy-ms
You could do me a big favour in pointing me to an example of "module augmentation" working with shims, is there something like that?
Regards
from types-publisher.
@types/vue
was deprecated because vue
has its own types now, so you should probably be using that instead.
Not sure what you mean by module augmentation of a shim -- if you're not using a module and using a shim instead you presumably don't need to augment it? Or if that module had included an augmentation of something else, you could just copy that to your tests file.
from types-publisher.
@andy-ms it is about augmentation of "vue/types/vue" with @types/vue as dependency it works fine.
depending on original typing of vue, would probably require another whitelisting, that's why i tried to declare the parts of "vue/types/vue" in the test, but the augmentation from vue.d.ts does not apply.
from types-publisher.
Related Issues (20)
- Please make `checkTypeScriptVersions` aggregate version mismatches
- Scoped & versioned packages can't pass path mappings checks
- Resurrect crawl-npm.ts
- Improve notNeededPackages.json testing HOT 1
- Update outdated packages HOT 1
- testDependencies should include only top-level package names HOT 1
- publish-registry validation fails when new packages are out but we won't publish them for a week
- Changes published from DefinitelyTyped are not marked as 'latest' HOT 1
- 'download' is not allowed in new npm package names
- Can't unpublish fastify-static HOT 2
- Deprecated packages often fail to publish correctly
- types-publisher is crashing during indexing HOT 3
- Optional catch binding in util.ts is failing PRs on DefinitelyTyped
- Error running tests (Error: Unexpected path .DS_Store) HOT 1
- index.d.ts should be the only d.ts file allowed in tsconfig.json HOT 10
- Tests do not run reliably on Windows
- getLatestMatch throws "Could not find version [object Object]"
- Dependencies information in NPM registry saved with "^[object Object]" value HOT 1
- typesVersions gets mangled in the published package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from types-publisher.