typings / registry

The registry of type definitions for TypeScript
238 stars 176 forks source link

Create heracles.json #828

Closed tpluscode closed 8 years ago

tpluscode commented 8 years ago

Typings URL: https://github.com/wikibus/heracles

Questions (for new typings):

tpluscode commented 8 years ago

Hm, heracles is not a global module. Why does the build think it is?

felixfbecker commented 8 years ago

https://github.com/wikibus/heracles/blob/master/typings.json ambientDependencies is deprecated

Hm, heracles is not a global module. Why does the build think it is?

because it doesn't have a top-level import or export

blakeembrey commented 8 years ago

Also, as the package author it'd probably be cleaner to publish the definition directly to NPM for your users. See https://github.com/typings/registry#as-package-author. It'll still need to be in external format for that to work, which means you need top-level imports and exports to be used.

felixfbecker commented 8 years ago

@blakeembrey It has dependencies though

blakeembrey commented 8 years ago

@felixfbecker That's fine. It can still be published to NPM. See https://github.com/blakeembrey/popsicle#typescript.

tpluscode commented 8 years ago

I was considering NPM but my main target is JSPM. How will JSPM consumers install my typings?

blakeembrey commented 8 years ago

Ah, I see - I think that relies on https://github.com/typings/core/pull/140 /cc @unional

tpluscode commented 8 years ago

I'm thinking about publishing directly with JSPM/NPM package and I one thing I'm concerned about is keeping versions of code and typings in sync.

Say I want to update my typings to an existing release. Would I have to push new version to NPM or move the tag? For that reason keeping the typings in separate registry seems more appealing to me

felixfbecker commented 8 years ago

@tpluscode If you include it with NPM, you will need to publish a new version on NPM.

unional commented 8 years ago

Sorry, didn't have time to work on the test part for the PR. I ran tests on jspm-config and it is working fine, but definitely want to test it with typings itself.

As for versioning, typings in NPM is just a part of the package. As you make changes to your package, just update the typings accordingly and publish as normal.

tpluscode commented 8 years ago

I'd like to publish to registry. Keeping the two in sync won't be such a problem.

Please help me out here though. Why is Travis failing with msg

TypingsError: Unable to read "src/JsonLdUtil.d.ts" from "heracles"

where I import like import {JsonLdUtil} from "./JsonLdUtil";

blakeembrey commented 8 years ago

@tpluscode I think it fell back to index.d.ts which it's following, but it doesn't support .ts files (only naive .d.ts files, sorry). You can add a main to typings.json so it knows where to look.

tpluscode commented 8 years ago

Oopsies, actually I did miss imports in the d.ts. Travis now passes. Please review

tpluscode commented 8 years ago

Also, I'd like to tick the checkboxes above with clear conscience. I don't have an index.js but index.d.ts works fine. Or should I my built output next to the typings?

And what about the READMEs? I'm assuming it applies to dedicated typings repositories but I'm serving directly from my project, correct?

blakeembrey commented 8 years ago

The built output seems fine, it's more relevant to bigger projects where it can be important to support deep requires like x/y. If you explicitly don't support that, it's not a big deal where the definition is and I'd make it easier on yourself as a maintainer.

For the README, it's fine too. That's for people who may come across the project on GitHub, it helps those users understand what they're looking at when they might be searching for a definition. It also helps us when we review to find the original project through the links.