GithubHelp home page GithubHelp logo

typings / core Goto Github PK

View Code? Open in Web Editor NEW
13.0 6.0 11.0 320 KB

*DEPRECATED* The core logic for Typings

License: MIT License

TypeScript 99.26% JavaScript 0.74%
typings typescript definitions package-manager

core's Introduction

Typings

NPM version NPM downloads Build status Gitter

The TypeScript Definition Manager.

Deprecation Notice: Regarding [email protected]

For users doing typings install dt~<package> --global and receiving errors.

Starting from TypeScript 2.0, users can install typings using npm install @types/<package>. These typings are coming from DefinitelyTyped. In the future, we hope redirects will be enabled to support existing maintainers to contribute effectively to NPM's @types as they did to typings/registry.

Typings on DefinitelyTyped have also moved to the external module format supported by TypeScript. This finally solved the real problem that Typings was trying to solve! It also means it will cause errors such as:

> typings install dt~angular --global 

typings ERR! message Attempted to compile "angular" as a global module,
but it looks like an external module. You'll need to remove the global option to continue.

To resolve this, we recommend moving to TypeScript 2.0's official aquisition method (npm install @types/angular). You can also drop the --global flag from typings, though some definitions on DefinitelyTyped may not work with the Typings approach because of new TypeScript features (namely UMD namespaces).

This project will remain operational for the foreseeable future, but is effectively deprecated. New projects should use @types from NPM.

Quick Start

# Install Typings CLI utility.
npm install typings --global

# Search for definitions.
typings search tape

# Find a definition by name.
typings search --name react

# If you use the package as a module:
# Install non-global typings (defaults to "npm" source, configurable through `defaultSource` in `.typingsrc`).
typings install debug --save

# If you use the package through `<script>`, it is part of the environment, or
# the module typings are not yet available, try searching and installing with `--global`:
typings install dt~mocha --global --save

# If you need a specific commit from github.
typings install d3=github:DefinitelyTyped/DefinitelyTyped/d3/d3.d.ts#1c05872e7811235f43780b8b596bfd26fe8e7760 --global --save

# Search and install by version.
typings info env~node --versions
typings install [email protected] --global --save

# Install typings from a particular source (use `<source>~<name>` or `--source <source>`).
typings install env~atom --global --save
typings install bluebird --source npm --save

# Use `typings/index.d.ts` (in `tsconfig.json` or as a `///` reference).
cat typings/index.d.ts

Usage

Typings is the simple way to manage and install TypeScript definitions. It uses typings.json, which can resolve to the Typings Registry, GitHub, NPM, Bower, HTTP and local files. Packages can use type definitions from various sources and different versions, knowing they will never conflict for users.

typings install debug --save

The public registry is maintained by the community, and is used to resolve official type definitions for JavaScript packages.

Read More

Sources

  • npm - dependencies from NPM
  • github - dependencies directly from GitHub (E.g. Duo, JSPM)
  • bitbucket - dependencies directly from Bitbucket
  • jspm: - dependencies from installed JSPM packages with typings distributed. Requires [email protected]+.
  • bower - dependencies from Bower
  • common - "standard" libraries without a known "source"
  • shared - shared library functionality
  • lib - shared environment functionality (mirror of shared) (--global)
  • env - environments (E.g. atom, electron) (--global)
  • global - global (window.<var>) libraries (--global)
  • dt - typings from DefinitelyTyped (usually --global)

Contributing

# Installation
# Fork this repo (https://github.com/typings/typings)
# Clone the fork (E.g. `https://github.com/<your_username>/typings.git`)
cd typings

# Install modules
npm install

# Build
npm run build

# Test
npm run test

License

MIT

core's People

Contributors

blakeembrey avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hiroppy avatar johnnyreilly avatar lbovet avatar sonofnun15 avatar unional avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

An in-range update of lockfile is breaking the build 🚨

Version 1.0.3 of lockfile just got published.

Branch Build failing 🚨
Dependency lockfile
Current Version 1.0.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As lockfile is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Break `npm test` into two

One for development: npm run build && npm run test-cov.
One for CI: (current one).

So that test can be run much faster during development.

commonjs/ES6 interop

This is not a feature proposal

Need to identify if this is really a problem. Original message:


That means we are missing the whole point here: It is not about the environment that the user wants to run in. It is about the environment that the definition writer expect the d.ts to run with

I write some projects in my company and expose them as pure TS files through jspm-p4. I can do that and it works fine for me is because I unify the whole module chain to run under module: system as I'm using JSPM.

For typings, since the users can run their application/module in any module mode, we are trying to compile the d.ts in that mode. But it will not work if there is a mode mismatch.

One solution is to add a directive (is that what it called?) at the top of each d.ts file to indicate the intent:

"module system"
...

or something similar so that import * as dr from 'domready' would resolve correctly according to the intent of the typed definition writer.

Don't know will that be possible because it means that tsc need to be able to run in different module for different files.

Decisions to make

Package Discovery

  • Distribution channels
    • (committed) npm
    • bower
    • github
    • jspm
    • nuget
    • apm
    • atmosphere (meteor)
  • (deferred) Package name alias
    • Alias for different distribution channels vs name in registry
  • Versioning
    • Semver ranges in the registry and do intersection
    • Some distribution channels are not following semver
  • Server side API
    • e.g.: /versions/:source/:package/:version/latest

Typings Delivery

  • Delivery System
    • npm or typings/registry
      #3 typings.json

.typingsrc

  • per project
  • per user
{
  "defaultSource": "{npm,bower,etc}"
}

Typings content

typings CLI

  • typings install <identifier>
    • Default distribution channel by:
      • .typingsrc
      • implicit determine
      • typings sync

Terminology

  • source vs distribution channel
  • package vs module
  • source as source module vs target module/package
  • TypeScript terms vs Typings current terms

Inferred naming / enable renaming for `declare module "x" {`?

Pure brainstorming. Might not worth the effort, buggy, or align with vision
While I understand the typings in DT is messy, would it be possible to do:

  • typings install dr=dt:domready
    • lookup declare module "domready" { and rename to declare module "dr" {

Duplicated build steps?

Saw logs like these repeated many times in Travis CI:

[email protected] prepublish /home/travis/build/typings/core
node scripts/prepublish.js

[email protected] build /home/travis/build/typings/core
rimraf dist && tsc

I thought my PR causes it but actually it is not. Something wrong?

Version mapping between distribution channels and registry

I believe the registry entry (e.g. domready.json) should be tied to the source code (the repo) instead of the distribution channel (npm, bower, jspm, Duo, even github (as distribution channel)).

So here is an attempt to describe how will it look like in that scenario.

For versioning (draft):

{
  "versions": {
    "npm": {
      "0.1.2": "..."
    },
    "bower": {
      "x.y.z": "..."
    }
  }
}

jspm may need to resolve to local or endpoint to get the right source + version. Duplicating it here could be a lot of maintenance work.

All of 0 tests passed!

Heya,

I just noticed that this is the output for running test-cov on Windows:

> [email protected] test-cov C:\source\core
> ts-node node_modules/istanbul/lib/cli.js cover -e .ts --print none -x '*.d.ts' -x '*.spec.ts' node_modules/blue-tape/b
in/blue-tape.js -- 'src/**/*.spec.ts' | tap-diff

No coverage information was collected, exit without writing coverage information

passed: 0  failed: 0  of 0 tests  (793ms)

All of 0 tests passed!

That's not desirable I guess?

This looks to be the result of the test-spec task: ts-node node_modules/blue-tape/bin/blue-tape.js 'src/**/*.spec.ts' | tap-diff

This was working on my Windows machine only a couple of days ago...

An in-range update of typescript is breaking the build 🚨

Version 2.1.4 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.1.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As typescript is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 745 commits .

  • 409311f Update LKG
  • e15166a Merge pull request #12670 from Microsoft/mergeMaster1205
  • ae3b6e7 Merge branch 'master' into release-2.1
  • 5c71de1 Merge pull request #12652 from Microsoft/fixIndexedAccessWithAny
  • ee172cf Accept new baselines
  • 95aed3f Add regression test
  • c52eb6c Indexed access any[K] has type any
  • b7e8a6d Merge pull request #12643 from Microsoft/keyofUnionIntersection
  • 23992ba Merge pull request #12640 from Microsoft/mappedTypesSecondaryInferences
  • 3aa05b2 Accept new baselines
  • b4836e3 Add tests
  • b876211 Property handle union/intersection types in type variable checks
  • f61a224 Merge pull request #12639 from MattiasBuelens/fixElideFallthrough
  • 970c4aa Accept new baselines
  • 773c9a7 Add tests

There are 250 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of tslint is breaking the build 🚨

Version 5.4.3 of tslint just got published.

Branch Build failing 🚨
Dependency tslint
Current Version 5.4.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v5.4.3

πŸ›  Bugfixes

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Allow setting the github token by environment variable

Hi there,

Currently it's possible to set the github token within the .typingsrc. Unfortunately it's not encrypted there and thus not really suited for public CI providers like TravisCI or AppVeyor. Could you please allow typings to pick up the github token from an environment variable like TYPINGS_GITHUB_AUTH_TOKEN. Having the token without encryption there would be fine because at least Travis and AppVeyor support the ecryption of environment variables (see https://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travis.yml and https://www.appveyor.com/docs/build-configuration/#secure-variables). JSPM does a similar thing and it works pretty well.

Regards

Implement jspm: discussion

This issue is create to discuss any issue related to this feature.

syntax

# simplest for the user
# require `parse.ts` to read `package.json`, then read either `config.js` or `jspm.config.js`
jspm:foobar

# base of folder structure, map to `jspm_packages/npm/[email protected]/`
# still require to read `package.json` because `jspm_packages` is configurable.
# require less parsing of `package.json` and `config.js`
jspm:npm/[email protected]
jspm:git/org/[email protected]

Will try to do the first syntax, which depends on...

jspm module metadata discovery

...in discussion...

dependency discovery

...in discussion...

suggestion: use `exclude` for root `tsconfig.json`

While files works for tsc, it doesn't work well for language service. Currently *.spec.ts does not get typings info because src/typings.ts does not resolve to those files.

Can rename current tsconfig.json to tsconfig.build.json and package.json/scripts/build: rimraf dist && tsc -p tsconfig.build.json

I don't know which files should be excluded, but I guess it would be this:

{
  "compilerOptions": {
    "noLib": false
  },
  "excludes": [
    "node_modules",
    "typings/browser",
    "typings/browser.d.ts",
    "dist"
  ]
}

If you are ok with that, I can create a PR. πŸ˜„

An in-range update of ts-node is breaking the build 🚨

Version 3.2.0 of ts-node just got published.

Branch Build failing 🚨
Dependency ts-node
Current Version 3.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ts-node is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes Boolean Env Flags

Changed

  • Inherit boolean flags from environment
  • Remove preferGlobal warning from package.json

Added

  • Export printError utility
  • Enable debug flag for hacking
Commits

The new version differs by 7 commits.

  • d90ffba 3.2.0
  • 2e03f54 fix(package): update chalk to version 2.0.0 (#372)
  • c60d3a7 Export printError utility (#376)
  • 3f0d975 Enable debug flag for method call tracking (#377)
  • 394ddb8 Boolean flags inherit from env (#375)
  • 82effb2 Handle possibly undefined diagnostic "start"
  • 9bc3dd8 Remove preferGlobal from package.json

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of throat is breaking the build 🚨

Version 4.1.0 of throat just got published.

Branch Build failing 🚨
Dependency throat
Current Version 4.0.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

throat is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 3 commits.

  • 185faa1 perf(Queue#shift): minor opt (#26)
  • 49c6812 chore(package): update flow-bin to version 0.49.1 (#25)
  • b558d94 Release 4.0.0

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

Version 2.4.0 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.3.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 7 commits .

  • b82d4e6 release 2.4.0
  • 41002f1 Update bower.json (#342)
  • e58d54b Node: configurable util.inspect() options (#327)
  • 00f3046 Node: %O (big O) pretty-prints the object (#322)
  • bd9faa1 allow colours in workers (#335)
  • 501521f Use same color for same namespace. (#338)
  • e2a1955 Revert "handle regex special characters"

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Improve project bootstrapping

Current the error I saw still persist when I download the project and follow the first step (npm run bootstrap):

> [email protected] build /Users/hwong/github/typings/core
> rm -rf dist/ && tsc

src/bundle.ts(1,26): error TS2307: Cannot find module 'any-promise'.
src/bundle.ts(2,31): error TS2307: Cannot find module 'path'.
src/bundle.ts(28,11): error TS7006: Parameter 'tree' implicitly has an 'any' type.
...

If I run typings install and then npm run bootstrap:

> [email protected] build /Users/hwong/github/typings/core
> rm -rf dist/ && tsc

typings/main/definitions/any-promise/index.d.ts(9,14): error TS2300: Duplicate identifier 'Promise'.
typings/main/definitions/any-promise/index.d.ts(88,1): error TS2300: Duplicate identifier 'export='.
...

....which is interim (as you just changed logic from main/definitions/<package>/<package>.d.ts to main/definitions/<package>/index.d.ts).

I just want to work on a PR that will print out warning about ambient dependencies during install... 😭

An in-range update of tslint is breaking the build 🚨

Version 5.5.0 of tslint just got published.

Branch Build failing 🚨
Dependency tslint
Current Version 5.4.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v5.5.0

Editor's note: This release features an important bugfix for overlapping fixes when using --project and --fix (#2864).

πŸŽ‰ New rules and options

πŸ›  Bugfixes & enhancements

Thanks to our contributors!

  • Klaus Meinhardt
  • Josh Goldberg
  • Petr Kosikhin
  • Pablo NΓΊΓ±ez
  • Benny Neugebauer
  • Radon Rosborough
  • reduckted
  • Chris Barr
  • Julian Verdurmen
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of jspm-config is breaking the build 🚨

Version 0.3.3 of jspm-config just got published.

Branch Build failing 🚨
Dependency jspm-config
Current Version 0.3.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As jspm-config is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ coverage/coveralls Coverage pending from Coveralls.io Details

  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 6 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of typescript is breaking the build 🚨

Version 2.3.4 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.3.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

typescript is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • βœ… continuous-integration/appveyor/branch AppVeyor build succeeded Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
  • βœ… coverage/coveralls First build on greenkeeper/typescript-2.3.4 at 85.516% Details

Release Notes TypeScript 2.3.4

This release includes a new flag for tsserver to specify location of npm for nvm users.

Download:

Commits

The new version differs by 12 commits.

  • 1a579d9 Update LKG
  • e023dc3 Merge pull request #16113 from Microsoft/fixNpmLocationWithSpaces
  • d7555ed Fix equals
  • 47a0a7c Wrap npmLocation if needed
  • 47bd5af Allow configurable npmLocation for typingsInstaller (#16084) (#16102)
  • d333378 Merge branch 'release-2.3' of https://github.com/Microsoft/TypeScript into release-2.3
  • f80ca90 Add project telemetry (#16085)
  • fc4d109 Fix build breaks with the instrumenter
  • 196aba6 Merge pull request #16051 from Microsoft/PortRulesProviderFixToRelease-2.3
  • 9919b58 Updating compiler release version to 2.3.4
  • 3b9ef4e Changes from CR feedback
  • dcab328 RulesProvider performance improvements

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Install typings without having to specify them on typings.json

Correct me if I am wrong, but it seems typings install command mandates one to have a typings.json file which I want to avoid. I used to do the following using tsd in my gulp task which let me avoid a json file and allow me to dynamically install typings by reading the dependencies from package.json (aliased as config.extenalLibs). This process worked well for me and I am trying to do the same with typings but having difficulty.

gulp.task('tsd:install', function () {
      var dependencies = config.externalLibs;

      var query = new tsd.Query();
      dependencies.forEach(function (dependency) {
         query.addNamePattern(dependency);
      });

      var options = new tsd.Options();
      options.resolveDependencies = true;
      options.overwriteFiles = true;
      options.saveBundle = true;

      return tsdApi.readConfig()
         // Query tsd database for dependencies
         .then(function () {
            return tsdApi.select(query, options);
         })
         // Install found definition files
         .then(function (selection) {
            return tsdApi.install(selection, options);
         })
         // Report on result
         .then(function (installResult) {
            var written = Object.keys(installResult.written.dict);
            var removed = Object.keys(installResult.removed.dict);
            var skipped = Object.keys(installResult.skipped.dict);

            written.forEach(function (dts) {
               gutil.log('Definition file written: ' + dts);
            });

            removed.forEach(function (dts) {
               gutil.log('Definition file removed: ' + dts);
            });

            skipped.forEach(function (dts) {
               gutil.log('Definition file skipped: ' + dts);
            });
         });
   });

Paths inside index.d.ts when using cwd option

I am programmatically calling typings (using [email protected]), something like:

    const typings = require("typings-core");
    typings.install({production: false, cwd: "src/ts"});

I end up with index.d.ts inside src/ts/typings looking like:

/// <reference path="src/ts/typings/globals/jquery/index.d.ts" />

I did a search and came across an issue that is fixed in the CLI: typings/typings#392

If I do then run at the command line:

typings install --cwd src/ts

I get an index.d.ts looking like I want:

/// <reference path="globals/jquery/index.d.ts" />

Should these two behave differently? I might be misunderstanding the relationship of "core".

An in-range update of typescript is breaking the build 🚨

Version 2.0.10 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.1.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As typescript is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 100 commits (ahead by 100, behind by 1572).

  • 790a5c7 Update LKG
  • a8a5ea6 Update file with version string for nightly release
  • 17e1e15 Make sure version is public
  • d64c98c Update version
  • 3a094e7 switch to execSync to ensure that no install orders are interleaved (#12259)
  • 6846ea3 added extra check to prevent multiple installation of the same typing, added version field to telemetry event (#12258)
  • 0a3afb5 treat failures to resolve module name as missing packages (#12237)
  • dcaad61 Update LKG
  • 2dbbcc8 Update version
  • 09f29ad add 'installSuccess' flag to telemetry, cache misses if npm install fails (#12163)
  • cc81fa7 Update LKG
  • 1a698df Update version
  • df65cc3 Update LKG
  • 435270e reduce set of files being watched, increase polling interval (#12054)
  • 7c92057 enable sending telemetry events to tsserver client (#12035)

There are 100 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Install hangs for a long time when no Internet connection available

Run script with no Internet connection:

var typings = require('typings-core'),
    path = require('path');

typings.install({production: false, cwd: path.resolve('.')})
  .catch((err) => {
    console.log('Failed to install typings because of error:', err);
  });

typings-core 0.3.1
almost immediately logs error and exits

typings-core 1.0.1
hangs for ~1 minute then logs error
then hangs for up to 10 minutes and only then exits

OSX 10.11.5
Node 4.4.5

An in-range update of ts-node is breaking the build 🚨

Version 3.0.5 of ts-node just got published.

Branch Build failing 🚨
Dependency ts-node
Current Version 3.0.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ts-node is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 7 commits.

  • c18331a 3.0.5
  • 5cf97b1 Add --inspect-brk to known flags (#343)
  • 7dfb3e3 Pin node tests at 6.x (#340)
  • 633d537 chore(package): update chai to version 4.0.1 (#337)
  • b751a56 Define exports and improve getTypeInfo help (#332)
  • d018300 Update yn default option
  • cc3bf22 Expose _ bin file for consumers to use

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of tslint is breaking the build 🚨

Version 5.4.2 of tslint just got published.

Branch Build failing 🚨
Dependency tslint
Current Version 5.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • βœ… continuous-integration/appveyor/branch AppVeyor build succeeded Details
  • ❌ coverage/coveralls Coverage pending from Coveralls.io Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v5.4.2

πŸ›  Bugfixes

  • [bugfix] Restored support for multiple --exclude options in the CLI (#2855)
  • [bugfix] Restored support for --version CLI option (#2857)
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of tslint is breaking the build 🚨

Version 5.4.0 of tslint just got published.

Branch Build failing 🚨
Dependency tslint
Current Version 5.3.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • βœ… continuous-integration/appveyor/branch AppVeyor build succeeded Details
  • βœ… coverage/coveralls First build on greenkeeper/tslint-5.4.0 at 85.516% Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v5.4.0

πŸŽ‰ New rules, options, and fixers

πŸ”¨ Bugfixes & enhancements

Thanks to our contributors!

  • Klaus Meinhardt
  • Manuel Lopez
  • Andy Hanson
  • Piotr Tomiak
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of invariant is breaking the build 🚨

Version 2.2.2 of invariant just got published.

Branch Build failing 🚨
Dependency invariant
Current Version 2.2.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As invariant is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 10 commits .

  • 49ae54d 2.2.2
  • bd8ee45 Add flow test
  • eb8380a Add flow types
  • 3c83301 Add full repository url
  • 7800300 Remove iojs and add node 7 to travis
  • 94c75fb Added travis ci support for modern node versions (#17)
  • 6453edc Create LICENSE (#16)
  • efed76b Add succinct explanation (#14)
  • 6a139d3 Merge pull request #13 from WickyNilliams/patch-1
  • 5133c29 add "invariant" tag to package.json

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of is-absolute is breaking the build 🚨

Version 0.2.6 of is-absolute just got published.

Branch Build failing 🚨
Dependency is-absolute
Current Version 0.2.5
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

is-absolute is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 5 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of typescript is breaking the build 🚨

Version 2.4.1 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.4.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

typescript is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes TypeScript 2.4

For release notes, check out the release announcement

For new features, check out the What's new in TypeScript 2.4.

For breaking changes, check out the Breaking changes in TypeScript 2.4 page.

For the complete list of fixed issues, check out the fixed issues query for Typescript 2.4.

Download:

Commits

The new version differs by 141 commits.

  • 8b2fe13 Update LKG.
  • 14d95ed Test:Block-scoped definition of Promise works
  • a8846bf Skip block scope check with no error location
  • 44f2336 Merge pull request #16633 from Microsoft/release-2.4_fixIncrementalParsing
  • 4875a27 Add tests
  • 15ef20d Set the structureReused to be safemoudles when dynamic import change
  • 6d33083 Add tests
  • 11b9f6e Wip-fix incremental parsing
  • 2721fd4 In TypeScript code, never bind JSDoc normally, just set parent pointers (#16555) (#16561)
  • 0968ed9 Revert string enum changes (#16569)
  • 096f8cc Update LKG
  • 9241175 Allow running in strict mode (#16557)
  • f49b007 Update LKG
  • f1b0f59 Update version to 2.4.1
  • ed9cde9 Update LKG

There are 141 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Standardize Terminologies

How to write typings

When you write typed definitions for DefinitelyTyped, you create a pull request on DefinitelyTyped with the corresponding .d.ts file and you are done. In the .d.ts file you write either an ambient internal module or ambient external module as in the handbook.

Things are a little bit different when you write a definition with Typings.

While it is definitely not harder than writing typed definitions for DefinitelyTyped, there isn't a clear term of reference on how to write a definition with Typings.

First things first...terminology

Going through the handbook and spec to understand everything you need to write typings is a great thing to do, but it isn't fun. Also, since TypeScript is rapidly improving, some information in the handbook is out of date.

Here are a list of terms that are relevant in writing typings so you can cut the chase.

If you like to learn by example, you can skim through this section and read the next one. Things will become more clear as you move along.

Typescript terminologies

ambient (declaration)

http://www.typescriptlang.org/Handbook#modules-working-with-other-javascript-libraries

We call declarations that don't define an implementation "ambient". Typically these are defined in .d.ts files. If you're familiar with C/C++, you can think of these as .h files or 'extern'.

  • Declaration that don't define an implementation
  • all .d.ts files
  • I think it is named so to describe "These files describe the target JS in ambient to the TS world"

ambient modules

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Modules.md

  • modules === external modules
    • i.e. ambient modules === ambient external module

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Modules.md#ambient-modules

We could define each module in its own .d.ts file with top-level export declarations, but it's more convenient to write them as one larger .d.ts file. To do so, we use a construct similar to ambient namespaces, but we use the module keyword and the quoted name of the module which will be available to a later import.

  • Refers to both top-level export declaration and declare module "name" {.

ambient namespaces

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces.md#introduction

  • namespaces === internal modules
    • i.e. ambient namespaces === ambient internal module

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces.md#ambient-namespaces

  • declare namespace D3 + declare var d3: D3.Base to declare global object.
    • declare var d3 is needed because in the example D3 is a non-instantiated namespace.

external module

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Modules.md

  • external modules are now modules

export = and import = require()

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Modules.md#export--and-import--require

  • When importing a module using export =, TypeScript-specific import X = require("module") must be used to import the module.

https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#support-for-default-import-interop-with-systemjs

  • In TypeScript 1.8, you can import X from 'module'; or import * as X from 'module';. The exact behavior depends on module: system|commonjs and allowSyntheticDefaultImports: true|false.

internal module

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces.md#introduction

  • internal modules are now namespaces

module

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#111-modules

  • ES2015 module
  • module === external module
  • Contain top-level export and import directives

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#16-classes

  • Not module pattern. module pattern === namespace === internal module

module keyword

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces%20and%20Modules.md

  • module X { is equivalent to the now-preferred namespace X {
    • When you write declare module X {, you are actually writing declare namespace X {.
    • i.e. you are writing namespace === internal module

microsoft/TypeScript#6808

  • The module keyword will be gradually deprecated.

module pattern

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#110-namespaces

  • JavaScript module pattern: encapsulate private fields and methods using closure variables

namespace

https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces.md#namespacing

Instead of putting lots of different names into the global namespace, let's wrap up our objects into a namespace.

  • Top-level namespace will be global (if the file is not a top-level declaration, see below)

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#10-namespaces

  • Formalization of the IIFE pattern

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#110-namespaces

  • Namespace is module pattern

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#101-namespace-declarations

Namespaces are either instantiated or non-instantiated. A non-instantiated namespace is a namespace containing only interface types, type aliases, and other non-instantiated namespace. An instantiated namespace is a namespace that doesn't meet this definition. In intuitive terms, an instantiated namespace is one for which a namespace instance is created, whereas a non-instantiated namespace is one for which no code is generated.

  • No code is generated for non-instantiated namespace
    • i.e. it can only be used as type
  • A namespace instance is created for instantiated namespace
    • i.e. at top-level, it creates a global namespace object

top-level declaration

https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#23-declarations (need to scroll down a bit)

  • Top-level declarations in a source file with no top-level import or export declarations belong to the global namespace
    • This applies to both module and namespace
    • i.e. declare namespace X { creates a global namespace X.
  • Top-level declarations in a source file with one or more top-level import or export declarations belong to the module represented by that source file.
    • i.e. declare namespace X { in such file does not create global namespace X.

References

Create DT scheme

Talked about it in some of the threads. Couldn't find it.

Making this the "official" discussion for this topic.

Currently using --ambient flag also for DT is confusing.
As not all DT typings are "ambient". The have declare module "xxx", but not necessary declare namespace xxx or declare module xxx.

Content Addressable Hashes

I'm making this issue here because things may change and I don't want to notify a lot of people ahead of time with my thoughts.

Goals:

  • De-dupe typings
  • Manifest files
  • Fix module typings conflicts

The idea:

Content addressable hashes. For the next version I'd really like to fix de-duping and re-writing of dependencies which causes issues on import still. I realised one way to solve all of the above is to use content hashes as the file names and just write wrappers to the content hashed .d.ts files. The structure will look more like:

typings/.store/klou3f3u34u982r04jdf.d.ts
typings/main/popsicle.d.ts
typings/main.d.ts
...

The stored content hashed files will be per-typed file and the nature of hashes will avoid duplicated dependencies. No more rewriting typings other than import/export still, and writing a wrapper separately. This is a pretty big architectural change though, so I'll be working on it in core first.

...

declare module 'popsicle' {
  export * from '../.store/klou3f3u34u982r04jdf.d.ts'
}

removing the need of `typings/registry/global`

I'm doing this locally and it seems to work well:

// get a package with module typings
npm i my-module-with-typing
typing i npm~some-module
// custom-typings/my-module-with-typing.d.ts
export * from 'my-module-with-typings'
export as namespace MyModuleWithTypings

// custom-typings/some-module
export * from 'some-module'
export as namespace SomeModule

Maybe typings can create those custom typings files directly?
In this case, we can reduce the registry by half.

Of course, one issue is how to determine the module's namespace.
How will DT do it for @types?

Lately, I'm working on globalify and released my own @unional/globalify which I can define my own global namespace variable.
It can help but still need to deal with libraries that already release global umd build with special namespace variable.

Consider providing an option to omit the ambient declaration wrapper

Greetings.

If this has been raised before, I apologize.

I realize that the a significant aspect of the design of Typings is based around install-name-customizable ambient declarations. Providing this behavior is valuable.

However, for those of us who wish to use "paths" instead, explicitly mapping each module in a tsconfig file, and not introducing any ambient module names, it would be great if Typings would allow an install time option that would simply not inject the declare module "m" wrapper.

Typings has many great features, such as being able to install declarations directly from sources other than DefinitelyTyped, that I find highly valuable. I am also not completely soled on @types as there are issues, such as the /// <reference types="path" /> construct, which I think are ill considered as well as a number of use cases that it does not cover.

Unfortunately I tend to avoid using Typings simply because of the automatically generated wrapper.

Thank you and keep up the awesome work!

Update version detection

Spawn from #8 (comment)

Objective

  • Determine if the installed typings need to be updated or not

Variables

  • semver range
  • semver and non-semver
  • npm registry or typings/registry

Scenario 1: current

  1. User installed npm:[email protected]
  2. Look for "a.b.c": "http://...#SHA1"
  3. Install typed-domready@SHA1 // Can't help to use name typed-domready instead of npm-domready 😏
  4. User update npm:[email protected]
  5. Look for "p.q.r": "http://...#SHA2"
  6. Install typed-domready@SHA2

Scenario 2: with semver range + typings/registry

  1. User installed npm:[email protected]
  2. Look at npm/domready.json // TODO: Need better example than A-D
{
  "versions": {
    "A": "...SHA1",
    "B-C": "...SHA2"
    "^D": "...SHA3"
  }
}

a. Read versions in reverse order, assuming later version is newer.
b. Get and use first matched version
3. Same
4. Same
5. Same
6. Same

Known problems to solve

  • semver range intersection

Empty proxy variables are not handled properly

I'm used to unset my proxy settings like this: env http_proxy='' https_proxy='' cmd. It works with i.e.: npm or brew, but it does not with typings install. The output is: message an HTTP(S) proxy serverhostandportmust be specified!
If i delete the variables from the shell environment, the installation runs fine.
Any ideas how to solve it?

Major Release

Goals:

Feel free to add things in, but I'll be trying to develop some features for the current iteration while this batch works well as a major release together because it's a pretty big refactoring (and some breaking changes in architecture).

About testing

Just a thought:
If the source package contains test code, is it possible to get the test code as .ts and compile against them to catch any signature mismatch?

typings-core ^1.4.0 does n't work on Node 0.10 which breaks folks relying on semver

typings-core ^1.6.0 worked on node 0.10 with strip-bom:"^2.0.0" and detect-indent:"^4.0.0"

with typings-core ^1.7.0 release, bumped strip-bom:"^3.0.0" and detect-indent:"^5.0.0" that uses ES6 features and dropped node 0.10 support

By doing this, libraries like typings which have a dependency chain on typings-core(strip-bom and detect-indent) break when run on node 0.10.
This previously worked.

I'm all for moving forward :), but I think the version should be changed to a new major version when dropping support for old node and ES.

I propose that typings-core <1.7.0 published with node 0 support should continue to support and any version that dropping support should be bumped to new Major version

Future ... when we move to a new major version when dropping node support.

What do you think?

cc @kodypeterson

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.