itsfrank / vue-typescript

Typescript decorators to make vue feel more typescripty
MIT License
357 stars 25 forks source link

Doesn't seem to be published to npm correctly #1

Closed DanielRosenwasser closed 8 years ago

DanielRosenwasser commented 8 years ago

Hey there!

I noticed a few things that looked like issues in terms of publishing TypeScript to npm.

  1. You're publishing .ts files instead of .js and .d.ts, so your users are being forced to compile in node_modules (which isn't great for .js users).
  2. Your 'main' is index.ts, but TypeScript only automatically looks at typings (and in 2.0, types).
  3. You're publishing your typings folder (and have it committed in git too). This can cause issues if other users have their own versions of node.d.ts

Here's a page with a little bit of detail, though it should be getting fleshed out more: https://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html

Let me know if you need any help!

itsfrank commented 8 years ago

Thanks, this is the first time i'm publishing a module. I did do some reading, but i figured it would be better to leave it in typescript so that if users want to modify some behavior or read the source they could so so with non-generated code (maybe im better pointing package.json to js and leaving the ts in src?). Also, i published typings simply to include the vue typings, but i guess i should leave that up to the user.

I was planning on working on it today, so ill make fixing these issues my first priority, if you wouldn't mind, once i get them fixed in a few hours, could you check it over a second time and let me know if it makes more sense? Thanks!

itsfrank commented 8 years ago

So I've followed your advice and changed a few things:

the module folder will now look like this:

vue-typescript      /lib - precompiled js, definitons and sourcemaps      /src - source typescript files, so user can inspect the code      .npmignore      LICENSE      package.json      README.md

I'm debating leaving typings.json and my tsconfig file so that if users want to make quick fixes, they can run typings install and npm run build to apply the fixes they made to the source files.

If i forgot anything or you still see issues with the package let me know. I'll probably be working on adding @Watch tonight and writing better tests for @Props

Thanks again for pointing this out

itsfrank commented 8 years ago

I'll be closing this for now, feel free to open it up again if you spot anything

DanielRosenwasser commented 8 years ago

Looks right as far as I can tell, and it looks like people have been having a great experience so far. Thanks for the work here!