Comments (5)
Do you have a tsconfig.json
file? Can you share that? Two files are always generated, I wouldn't delete it manually. But you can just reference/exclude the one you want. I'll add this to the Typings FAQ and the note about --ambient
is good, I've been trying to think about how to support that effectively and you're comment made me realised search should be returning based on it only.
If you use files
in tsconfig.json
, try:
"files": ["typings/main.d.ts"]
If you are compiling everything, use exclude
:
"exclude": ["typings/browser"]
The reason the folders are like that is literally to support the browser
exclude use-case, which is kind of disappointing but it's the only way this'll work for you right now - so yay!
from discussions.
Thanks @blakeembrey
I didn't even think of excluding one. I found it weird to get two copies. What do you mean by browser exclude use case? If it's about node vs browser scenarios, then maybe having some configuration flag in the config file would help?
I indeed have a tsconfig.json, here it is just in case (fileGlob is there while waiting for actual glob support in tsconfig.json although I do not use Atom ^^):
{
"version": "1.7.3",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"removeComments": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitOnError": false,
"preserveConstEnums": true,
"inlineSources": false,
"sourceMap": false,
"outDir": "./.tmp",
"project": "./app",
"moduleResolution": "node",
"listFiles": false
},
"formatCodeOptions": {
...
},
"filesGlob": [
"./typings/*.d.ts",
"./app/**/*.ts",
"./test/**/*.ts"
],
"exclude": [
"node_modules",
"jspm_packages"
]
}
from discussions.
Adding the following seem to have made tsc happier:
"exclude": [
"node_modules",
"jspm_packages",
"typings/browser",
"typings/browser.d.ts"
]
from discussions.
@dsebastien Yep, that's what you needed. Also, from your configuration, I don't believe you should be using fileGlob
- the project will resolve everything without excludes anyway.
The browser/main versions are to support the browser
field in package.json
. For instance, https://github.com/blakeembrey/popsicle/blob/master/package.json#L12-L18. TypeScript can't actually support node resolution on the browser properly, so I supported it in Typings.
from discussions.
Also, it works in typings.json
too - https://github.com/typings/typed-debug/blob/master/typings.json. There's a few cases where the browser API is just different to the node API and it's useful to have the correct typings in your environment.
from discussions.
Related Issues (20)
- typings file structure best practices HOT 14
- Exposing API docs HOT 7
- Are multiple versions for a given typing planned? HOT 5
- What is "env" source? HOT 4
- Preparing a set of independent typings HOT 8
- Improve/change logging HOT 3
- Best practices for npm module typing? HOT 2
- Adding a new repository under the typed-typings organization HOT 4
- Many modules are not found after updating to 1.0.4 HOT 1
- Global Typings - can / should I add them to npm package? HOT 7
- Example Typings : Multi-Module NPM with RequireJS HOT 4
- Configuring Aurelia HOT 18
- Where are the docs for writing a typings.json file? HOT 4
- Typing badges HOT 10
- Don't understand globals, dt~css must be installed as global but shouldn't according to FAQ HOT 1
- Declaring a global variable HOT 2
- firmata.js typings HOT 2
- Namespace hack HOT 2
- Project and eco-system migration to a post Typescript 2.0 world HOT 1
- Typings install gives 502 HOT 2
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 discussions.