initial commit
This commit is contained in:
70
node_modules/tsify-preprocess/CONTRIBUTING.md
generated
vendored
Normal file
70
node_modules/tsify-preprocess/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# Making a new release
|
||||
|
||||
Write release notes in `README.md`. Then,
|
||||
|
||||
```
|
||||
npm version <major|minor|patch>
|
||||
git push --follow-tags
|
||||
npm publish
|
||||
```
|
||||
|
||||
Enjoy life :heart: :rose:
|
||||
|
||||
|
||||
# Debugging
|
||||
|
||||
Debug logging is enabled using the built in node `util`. We setup the `log` function as
|
||||
|
||||
```
|
||||
var log = require('util').debuglog(require('./package').name);
|
||||
```
|
||||
|
||||
If you want this function to actually do something just set the environment variable `NODE_DEBUG=tsify` e.g.
|
||||
|
||||
```
|
||||
NODE_DEBUG=tsify browserify ... etc.
|
||||
```
|
||||
|
||||
|
||||
# Internals and processing flow
|
||||
|
||||
`tsify` is a implemented as a Browserify [plugin](https://github.com/substack/browserify-handbook#plugins) - not as a [transform](https://github.com/substack/browserify-handbook#writing-your-own) - because it needs access to the Browserify bundler - which is passed to plugins, but not to transforms. Access to the bundler is required so that `tsify` can include the TypeScript extensions in the `_extensions` array used by Browserify when resolving modules and so that `tsify` can listen to events associated with the Browserify pipeline. That's not possible with a transform, as a transform receives only a file path and a stream of content.
|
||||
|
||||
However, `tsify` does implement a transform that is wired up internally.
|
||||
|
||||
## `index.js` - the plugin
|
||||
|
||||
* It wires up internal transform.
|
||||
* It wires up the `file` and `reset` events. (Note that the `file` is [informational nicety](https://github.com/substack/node-browserify#events); it's not a core part of the Browserify process.)
|
||||
* It places `.ts(x)` extensions at the *head* of Browserify's extensions array.
|
||||
* It gathers the Browserify entry point files.
|
||||
|
||||
## `lib/Tsifier.js` - the transform
|
||||
|
||||
* The `Tsifer` is a Browserify transform.
|
||||
* It returns compiled content to Browserify.
|
||||
* It parses the `tsconfig.json` for options and files.
|
||||
* It configures the TypeScipt `rootDir` and `outDir` options to use an imaginary `/__tsify__` directory.
|
||||
* It creates the `Host`, passing it to the TypeScript Compiler API to compile the program and check the syntax, semantics and output.
|
||||
|
||||
## `lib/Host.js` - the TypeScript host
|
||||
|
||||
* The `Host` is a TypeScript Compiler API host.
|
||||
* It abstracts the reading and writing of files, etc.
|
||||
* It parses and caches the parsed source files, reading them from disk.
|
||||
* It caches the compiled files when the TypeScript Compiler API writes compiled content.
|
||||
|
||||
## Processing flow
|
||||
|
||||
* When Browserify's pipeline is prepared, the initial list of files to be compiled is obtained from the `tsconfig.json` and from the Browserify entry points.
|
||||
* With the pipeline prepared, Browserify starts processing its entry points, passing their content through the `Tsifier` transform.
|
||||
* To obtain the transformed content, the `Tsifier` transform looks in a cache for the compiled content.
|
||||
* If the cache look up results in a miss, the transformed file is added to the list of files (if it's missing from the list) and a compilation of the list of files is performed.
|
||||
* Note that with TypeScript using the same module resolution mechanism as Browserify (`"moduleResolution": "node"`) only a single compilation is required.
|
||||
* Browserify then locates any `require` calls in the transformed content and passes the content for these dependencies through the `Tsifier` transform.
|
||||
* This continues until all dependencies have been processed.
|
||||
|
||||
## Caveats
|
||||
|
||||
* The `Host` reads the source from disk; the content passed into the `Tsifier` transform is ignored. That means that any transforms added before the `tsify` plugin will be ineffectual.
|
||||
* If `grunt-browserify` is used, declarative configurations will see transforms will be loaded before plugins. To avoid that, an imperative configuration that uses the [configure](https://github.com/jmreidy/grunt-browserify#configure) function would be necessary.
|
||||
218
node_modules/tsify-preprocess/README.md
generated
vendored
Normal file
218
node_modules/tsify-preprocess/README.md
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
# tsify-preprocess
|
||||
|
||||
Fork of [**tsify**](https://github.com/TypeStrong/tsify) that adds support for [**preprocess**](https://github.com/jsoverson/preprocess).
|
||||
|
||||
[Browserify](http://browserify.org/) plugin for compiling [TypeScript](http://www.typescriptlang.org/)
|
||||
|
||||
[](https://www.npmjs.com/package/tsify-preprocess)
|
||||
[](https://npmjs.org/package/tsify-preprocess)
|
||||
[](http://travis-ci.org/jiborobot/tsify-preprocess)
|
||||
[](https://david-dm.org/jiborobot/tsify-preprocess)
|
||||
[](https://david-dm.org/jiborobot/tsify-preprocess#info=devDependencies)
|
||||
[](https://david-dm.org/jiborobot/tsify-preprocess#info=peerDependencies)
|
||||
|
||||
# Example Usage
|
||||
|
||||
### Browserify API:
|
||||
|
||||
``` js
|
||||
var browserify = require('browserify');
|
||||
var tsify = require('tsify-preprocess');
|
||||
|
||||
browserify()
|
||||
.add('main.ts')
|
||||
.plugin(tsify, { noImplicitAny: true })
|
||||
.bundle()
|
||||
.on('error', function (error) { console.error(error.toString()); })
|
||||
.pipe(process.stdout);
|
||||
```
|
||||
|
||||
### Command line:
|
||||
|
||||
``` sh
|
||||
$ browserify main.ts -p [ tsify --noImplicitAny ] > bundle.js
|
||||
```
|
||||
|
||||
Note that when using the Browserify CLI, compilation will always halt on the first error encountered, unlike the regular TypeScript CLI. This behavior can be overridden in the API, as shown in the API example.
|
||||
|
||||
Also note that the square brackets `[ ]` in the example above are *required* if you want to pass parameters to tsify; they don't denote an optional part of the command.
|
||||
|
||||
# Installation
|
||||
|
||||
Just plain ol' [npm](https://npmjs.org/) installation:
|
||||
|
||||
### 1. Install browserify
|
||||
```sh
|
||||
npm install browserify
|
||||
```
|
||||
|
||||
### 2. Install typescript
|
||||
|
||||
``` sh
|
||||
npm install typescript
|
||||
```
|
||||
|
||||
### 3. Install tsify
|
||||
``` sh
|
||||
npm install tsify-preprocess
|
||||
```
|
||||
|
||||
For use on the command line, use the flag `npm install -g`.
|
||||
|
||||
# Options
|
||||
|
||||
* **tsify** will generate sourcemaps if the `--debug` option is set on Browserify.
|
||||
* **tsify** supports almost all options from the TypeScript compiler. Notable exceptions:
|
||||
* `-d, --declaration` - See [tsify#15](https://github.com/TypeStrong/tsify/issues/15)
|
||||
* `--out, --outDir` - Use Browserify's file output options instead. These options are overridden because **tsify** writes to an internal memory store before bundling, instead of to the filesystem.
|
||||
* **tsify** supports the TypeScript compiler's `-p, --project` option which allows you to specify the path that will be used when searching for the `tsconfig.json` file. You can pass either the path to a directory or to the `tsconfig.json` file itself. (When using the API, the `project` option can specify either a path to a directory or file, or the JSON content of a `tsconfig.json` file.)
|
||||
* **tsify** supports the following extra options:
|
||||
* `--global` - This will set up **tsify** as a global transform. See the [Browserify docs](https://github.com/substack/node-browserify#btransformtr-opts) for the implications of this flag.
|
||||
* `--typescript` - By default we just do `require('typescript')` to pickup whichever version you installed. However, this option allows you to pass in a different TypeScript compiler, such as [NTypeScript](https://github.com/TypeStrong/ntypescript). Note that when using the API, you can pass either the name of the alternative compiler or a reference to it:
|
||||
* `{ typescript: 'ntypescript' }`
|
||||
* `{ typescript: require('ntypescript') }`
|
||||
|
||||
# Does this work with...
|
||||
|
||||
### tsconfig.json?
|
||||
|
||||
tsify will automatically read options from `tsconfig.json`. However, some options from this file will be ignored:
|
||||
|
||||
* `compilerOptions.declaration` - See [tsify#15](https://github.com/TypeStrong/tsify/issues/15)
|
||||
* `compilerOptions.out`, `compilerOptions.outDir`, and `compilerOptions.noEmit` - Use Browserify's file output options instead. These options are overridden because **tsify** writes its intermediate JavaScript output to an internal memory store instead of to the filesystem.
|
||||
* `files` - Use Browserify's file input options instead. This is necessary because Browserify needs to know which file(s) are the entry points to your program.
|
||||
|
||||
### Watchify?
|
||||
|
||||
Yes! **tsify** can do incremental compilation using [watchify](//github.com/substack/watchify), resulting in much faster incremental build times. Just follow the Watchify documentation, and add **tsify** as a plugin as indicated in the documentation above.
|
||||
|
||||
### Gulp?
|
||||
|
||||
No problem. See the Gulp recipes on using [browserify](https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-uglify-sourcemap.md) and [watchify](https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md), and add **tsify** as a plugin as indicated in the documentation above.
|
||||
|
||||
### Grunt?
|
||||
|
||||
Use [grunt-browserify](https://github.com/jmreidy/grunt-browserify) and you should be good! Just add **tsify** as a plugin in your Grunt configuration.
|
||||
|
||||
### IE 11?
|
||||
|
||||
The inlined sourcemaps that Browserify generates [may not be readable by IE 11](//github.com/TypeStrong/tsify/issues/19) for debugging purposes. This is easy to fix by adding [exorcist](//github.com/thlorenz/exorcist) to your build workflow after Browserify.
|
||||
|
||||
### ES2015? *(formerly known as ES6)*
|
||||
|
||||
TypeScript's ES2015 output mode should work without too much additional setup. Browserify does not support ES2015 modules, so if you want to use ES2015 you still need some transpilation step. Make sure to add [babelify](//github.com/babel/babelify) to your list of transforms. Note that if you are using the API, you need to set up **tsify** before babelify:
|
||||
|
||||
``` js
|
||||
browserify()
|
||||
.plugin(tsify, { target: 'es6' })
|
||||
.transform(babelify, { extensions: [ '.tsx', '.ts' ] })
|
||||
```
|
||||
|
||||
# FAQ / Common issues
|
||||
|
||||
### SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
|
||||
|
||||
This error occurs when a TypeScript file is not compiled to JavaScript before being run through the Browserify bundler. There are a couple known reasons you might run into this.
|
||||
|
||||
* If you are trying to output in ES6 mode, then you have to use an additional transpilation step such as [babelify](//github.com/babel/babelify) because Browserify does not support bundling ES6 modules.
|
||||
* Make sure that if you're using the API, your setup `.plugin('tsify-preprocess')` is done *before* any transforms such as `.transform('babelify')`. **tsify** needs to run first!
|
||||
* There is a known issue in Browserify regarding including files with `expose` set to the name of the included file. More details and a workaround are available in [#60](//github.com/TypeStrong/tsify/issues/60).
|
||||
|
||||
# Why a plugin?
|
||||
|
||||
There are several TypeScript compilation transforms available on npm, all with various issues. The TypeScript compiler automatically performs dependency resolution on module imports, much like Browserify itself. Browserify transforms are not flexible enough to deal with multiple file outputs given a single file input, which means that any working TypeScript compilation transform either skips the resolution step (which is necessary for complete type checking) or performs multiple compilations of source files further down the dependency graph.
|
||||
|
||||
**tsify** avoids this problem by using the power of plugins to perform a single compilation of the TypeScript source up-front, using Browserify to glue together the resulting files.
|
||||
|
||||
# License
|
||||
|
||||
MIT
|
||||
|
||||
# Changelog
|
||||
|
||||
* 2.0.2 - Added support for specifying the `project` option using the JSON content of a `tsconfig.json` file.
|
||||
* 2.0.1 - Fixed a bug in which the `include` option was broken if `tsconfig.json` was not in the current directory.
|
||||
* 2.0.0 - **Breaking**: updated to the latest `tsconfig`, so `filesGlob` is no longer supported. Use TypeScript 2's `exclude` and `include` options instead.
|
||||
* 1.0.9 - Implemented additional compiler host methods to support the default inclusion of visible `@types` modules.
|
||||
* 1.0.8 - Implemented file system case-sensitivity detection, fixing [#200](//github.com/TypeStrong/tsify/issues/200).
|
||||
* 1.0.7 - Replaced `Object.assign` with [`object-assign`](https://github.com/sindresorhus/object-assign) for Node 0.12 compatibility.
|
||||
* 1.0.6 - Fixed a bug in which TypeScript 2 libraries (specified using the `lib` option) were left out of the compilation when bundling on Windows.
|
||||
* 1.0.5 - Fixed a bug where empty output resulted in an error.
|
||||
* 1.0.4 - Fixed numerous bugs:
|
||||
* Refactored to use canonical file names, fixing [#122](//github.com/TypeStrong/tsify/issues/122), [#135](//github.com/TypeStrong/tsify/issues/135), [#148](//github.com/TypeStrong/tsify/issues/148), [#150](//github.com/TypeStrong/tsify/issues/150) and [#161](//github.com/TypeStrong/tsify/issues/161).
|
||||
* Refactored to avoid having to infer the TypeScript root, fixing [#152](//github.com/TypeStrong/tsify/issues/152).
|
||||
* Misconfiguration of `tsify` as a transform now results in an explicit error.
|
||||
* Internal errors that previously went unreported are now emitted to Browserify.
|
||||
* 1.0.3 - Fixed a bug introduced in 1.0.2 (that resulted in the `target` being set to `ES3`).
|
||||
* 1.0.2 - Added support for the TypeScript compiler's short-name, command-line options (e.g. `-p`).
|
||||
* 1.0.1 - On Windows, sometimes, the Browserify `basedir` contains backslashes that need normalization for findConfigFile to work correctly.
|
||||
* 1.0.0 - **Breaking**: TypeScript is now a `devDependency` so we don't install one for you. Please run `npm install typescript --save-dev` in your project to use whatever version you want.
|
||||
* 0.16.0 - Reinstated changes from 0.15.5.
|
||||
* 0.15.6 - Reverted 0.15.5 because of breaking changes.
|
||||
* 0.15.5 - Used `TypeStrong/tsconfig` for parsing `tsconfig.json` to add support for `exclude` and more.
|
||||
* 0.15.4 - Fixed some compilation failures introduced by v0.14.3.
|
||||
* 0.15.3 - Added support for the `--global` flag to use **tsify** as a global transform.
|
||||
* 0.15.2 - Added support for the `files` property of `tsconfig.json`.
|
||||
* 0.15.1 - Added support for `--project` flag to use a custom location for `tsconfig.json`.
|
||||
* 0.15.0 - Removed `debuglog` dependency.
|
||||
* 0.14.8 - Reverted removal of `debuglog` dependency for compatibility with old versions of Node 0.12.
|
||||
* 0.14.7 - Only generate sourcemap information in the compiler when `--debug` is set, for potential speed improvements when not using sourcemaps.
|
||||
* 0.14.6 - Fixed output when `--jsx=preserve` is set.
|
||||
* 0.14.5 - Removed `lodash` and `debuglog` dependencies.
|
||||
* 0.14.4 - Fixed sourcemap paths when using Browserify's `basedir` option.
|
||||
* 0.14.3 - Fixed `allowJs` option to enable transpiling ES6+ JS to ES5 or lower.
|
||||
* 0.14.2 - Fixed `findConfigFile` for TypeScript 1.9 dev.
|
||||
* 0.14.1 - Removed module mode override for ES6 mode (because CommonJS mode is now supported by TS 1.8).
|
||||
* 0.14.0 - Updated to TypeScript 1.8 (thanks @joelday!)
|
||||
* 0.13.2 - Fixed `findConfigFile` for use with the TypeScript 1.8 dev version.
|
||||
* 0.13.1 - Fixed bug where `*.tsx` was not included in Browserify's list of extensions if the `jsx` option was set via `tsconfig.json`.
|
||||
* 0.13.0 - Updated to TypeScript 1.7.
|
||||
* 0.12.2 - Fixed resolution of entries outside of `process.cwd()` (thanks @pnlybubbles!)
|
||||
* 0.12.1 - Updated `typescript` dependency to lock it down to version 1.6.x
|
||||
* 0.12.0 - Updated to TypeScript 1.6.
|
||||
* 0.11.16 - Updated `typescript` dependency to lock it down to version 1.5.x
|
||||
* 0.11.15 - Added `*.tsx` to Browserify's list of extensions if `--jsx` is set (with priority *.ts > *.tsx > *.js).
|
||||
* 0.11.14 - Override sourcemap settings with `--inlineSourceMap` and `--inlineSources` (because that's what Browserify expects).
|
||||
* 0.11.13 - Fixed bug introduced in last change where non-entry point files were erroneously being excluded from the build.
|
||||
* 0.11.12 - Fixed compilation when the current working directory is a symlink.
|
||||
* 0.11.11 - Updated compiler host to support current TypeScript nightly.
|
||||
* 0.11.10 - Updated resolution of `lib.d.ts` to support TypeScript 1.6 and to work with the `--typescript` option.
|
||||
* 0.11.9 - Fixed dumb error.
|
||||
* 0.11.8 - Handled JSX output from the TypeScript compiler to support `preserve`.
|
||||
* 0.11.7 - Added `*.tsx` to the regex determining whether to run a file through the TypeScript compiler.
|
||||
* 0.11.6 - Updated dependencies and devDependencies to latest.
|
||||
* 0.11.5 - Fixed emit of `file` event to trigger watchify even when there are fatal compilation errors.
|
||||
* 0.11.4 - Added `--typescript` option.
|
||||
* 0.11.3 - Updated to TypeScript 1.5.
|
||||
* 0.11.2 - Blacklisted `--out` and `--outDir` compiler options.
|
||||
* 0.11.1 - Added `tsconfig.json` support.
|
||||
* 0.11.0 - Altered behavior to pass through all compiler options to tsc by default.
|
||||
* 0.10.2 - Fixed output of global error messages. Fixed code generation in ES6 mode.
|
||||
* 0.10.1 - Fixed display of nested error messages, e.g. many typing errors.
|
||||
* 0.10.0 - Added `stopOnError` option and changed default behavior to continue building when there are typing errors.
|
||||
* 0.9.0 - Updated to use TypeScript from npm (thanks @hexaglow!)
|
||||
* 0.8.2 - Updated peerDependency for Browserify to allow any version >= 6.x.
|
||||
* 0.8.1 - Updated peerDependency for Browserify 9.x.
|
||||
* 0.8.0 - Updated to TypeScript 1.4.1.
|
||||
* 0.7.1 - Updated peerDependency for Browserify 8.x.
|
||||
* 0.7.0 - Updated error handling for compatibility with Watchify.
|
||||
* 0.6.5 - Updated peerDependency for Browserify 7.x.
|
||||
* 0.6.4 - Included richer file position information in syntax error messages.
|
||||
* 0.6.3 - Updated to TypeScript 1.3.
|
||||
* 0.6.2 - Included empty *.d.ts compiled files in bundle for Karma compatibility.
|
||||
* 0.6.1 - Fixed compilation cache miss when given absolute filenames.
|
||||
* 0.6.0 - Updated to TypeScript 1.1.
|
||||
* 0.5.2 - Bugfix for 0.5.1 for files not included with expose.
|
||||
* 0.5.1 - Handled *.d.ts files passed as entries. Fix for files included with expose.
|
||||
* 0.5.0 - Updated to Browserify 6.x.
|
||||
* 0.4.1 - Added npmignore to clean up published package.
|
||||
* 0.4.0 - Dropped Browserify 4.x support. Fixed race condition causing pathological performance with some usage patterns, e.g. when used with [karma-browserify](https://github.com/Nikku/karma-browserify).
|
||||
* 0.3.1 - Supported adding files with `bundler.add()`.
|
||||
* 0.3.0 - Added Browserify 5.x support.
|
||||
* 0.2.1 - Fixed paths for sources in sourcemaps.
|
||||
* 0.2.0 - Made Browserify prioritize *.ts files over *.js files in dependency resolution.
|
||||
* 0.1.4 - Handled case where the entry point is not a TypeScript file.
|
||||
* 0.1.3 - Automatically added *.ts to Browserify's list of file extensions to resolve.
|
||||
* 0.1.2 - Added sourcemap support.
|
||||
* 0.1.1 - Fixed issue where intermediate *.js files were being written to disk when using `watchify`.
|
||||
* 0.1.0 - Initial version.
|
||||
81
node_modules/tsify-preprocess/index.js
generated
vendored
Normal file
81
node_modules/tsify-preprocess/index.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
'use strict';
|
||||
|
||||
var realpath = require('fs.realpath');
|
||||
var log = require('util').debuglog(require('./package').name);
|
||||
var through = require('through2');
|
||||
var path = require('path');
|
||||
|
||||
function tsify(b, opts) {
|
||||
|
||||
if (typeof b === 'string') {
|
||||
throw new Error('tsify appears to have been configured as a transform; it must be configured as a plugin.');
|
||||
}
|
||||
var ts = opts.typescript || require('typescript');
|
||||
if (typeof ts === 'string' || ts instanceof String) {
|
||||
ts = require(ts);
|
||||
}
|
||||
|
||||
var Tsifier = require('./lib/Tsifier')(ts);
|
||||
var tsifier = new Tsifier(opts, b._options);
|
||||
|
||||
tsifier.on('error', function (error) {
|
||||
b.pipeline.emit('error', error);
|
||||
});
|
||||
tsifier.on('file', function (file, id) {
|
||||
b.emit('file', file, id);
|
||||
});
|
||||
|
||||
setupPipeline();
|
||||
|
||||
var transformOpts = {
|
||||
global: opts.global
|
||||
};
|
||||
b.transform(tsifier.transform.bind(tsifier), transformOpts);
|
||||
|
||||
b.on('reset', function () {
|
||||
setupPipeline();
|
||||
});
|
||||
|
||||
function setupPipeline() {
|
||||
if (tsifier.opts.jsx && b._extensions.indexOf('.tsx') === -1)
|
||||
b._extensions.unshift('.tsx');
|
||||
|
||||
if (b._extensions.indexOf('.ts') === -1)
|
||||
b._extensions.unshift('.ts');
|
||||
|
||||
b.pipeline.get('record').push(gatherEntryPoints());
|
||||
}
|
||||
|
||||
function gatherEntryPoints() {
|
||||
var rows = [];
|
||||
return through.obj(transform, flush);
|
||||
|
||||
function transform(row, enc, next) {
|
||||
rows.push(row);
|
||||
next();
|
||||
}
|
||||
|
||||
function flush(next) {
|
||||
var self = this;
|
||||
var entries = rows
|
||||
.map(function (row) {
|
||||
if (row.basedir && (row.file || row.id)) {
|
||||
return path.resolve(row.basedir, row.file || row.id);
|
||||
} else {
|
||||
return row.file || row.id;
|
||||
}
|
||||
})
|
||||
.filter(function (file) { return file; })
|
||||
.map(function (file) { return realpath.realpathSync(file); });
|
||||
log('Files from browserify entry points:');
|
||||
entries.forEach(function (file) { log(' %s', file); });
|
||||
tsifier.reset();
|
||||
tsifier.generateCache(entries);
|
||||
rows.forEach(function (row) { self.push(row); });
|
||||
self.push(null);
|
||||
next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = tsify;
|
||||
28
node_modules/tsify-preprocess/lib/CompileError.js
generated
vendored
Normal file
28
node_modules/tsify-preprocess/lib/CompileError.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
var os = require('os');
|
||||
|
||||
module.exports = function (ts) {
|
||||
function CompileError(diagnostic) {
|
||||
SyntaxError.call(this);
|
||||
|
||||
this.message = '';
|
||||
|
||||
if (diagnostic.file) {
|
||||
var loc = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
||||
this.fileName = diagnostic.file.fileName;
|
||||
this.line = loc.line + 1;
|
||||
this.column = loc.character + 1;
|
||||
this.message += this.fileName + '(' + this.line + ',' + this.column + '): ';
|
||||
}
|
||||
|
||||
var category = ts.DiagnosticCategory[diagnostic.category];
|
||||
this.name = 'TypeScript error';
|
||||
this.message += category + ' TS' + diagnostic.code + ': ' +
|
||||
ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL);
|
||||
}
|
||||
|
||||
CompileError.prototype = Object.create(SyntaxError.prototype);
|
||||
|
||||
return CompileError;
|
||||
};
|
||||
294
node_modules/tsify-preprocess/lib/Host.js
generated
vendored
Normal file
294
node_modules/tsify-preprocess/lib/Host.js
generated
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
'use strict';
|
||||
|
||||
var events = require('events');
|
||||
var fs = require('fs');
|
||||
var realpath = require('fs.realpath');
|
||||
var log = require('util').debuglog(require('../package').name);
|
||||
var trace = require('util').debuglog(require('../package').name + '-trace');
|
||||
var os = require('os');
|
||||
var path = require('path');
|
||||
var util = require('util');
|
||||
var semver = require('semver');
|
||||
var pp = require('preprocess');
|
||||
|
||||
module.exports = function (ts) {
|
||||
function Host(currentDirectory, opts) {
|
||||
|
||||
try {
|
||||
fs.accessSync(path.join(__dirname, path.basename(__filename).toUpperCase()), fs.constants.R_OK);
|
||||
this.caseSensitive = false;
|
||||
} catch (error) {
|
||||
this.caseSensitive = true;
|
||||
}
|
||||
|
||||
this.currentDirectory = this.getCanonicalFileName(path.resolve(currentDirectory));
|
||||
this.outputDirectory = this.getCanonicalFileName(path.resolve(opts.outDir));
|
||||
this.rootDirectory = this.getCanonicalFileName(path.resolve(opts.rootDir));
|
||||
this.languageVersion = opts.target;
|
||||
this.preprocess = opts.preprocess;
|
||||
this.files = {};
|
||||
this.previousFiles = {};
|
||||
this.output = {};
|
||||
this.version = 0;
|
||||
this.error = false;
|
||||
}
|
||||
|
||||
util.inherits(Host, events.EventEmitter);
|
||||
|
||||
Host.prototype._reset = function () {
|
||||
this.previousFiles = this.files;
|
||||
this.files = {};
|
||||
this.output = {};
|
||||
this.error = false;
|
||||
++this.version;
|
||||
|
||||
log('Resetting (version %d)', this.version);
|
||||
};
|
||||
|
||||
Host.prototype._addFile = function (filename, root) {
|
||||
|
||||
// Ensure that the relative, non-canonical file name is what's passed
|
||||
// to 'createSourceFile', as that's the name that will be used in error
|
||||
// messages, etc.
|
||||
|
||||
var relative = ts.normalizeSlashes(path.relative(
|
||||
this.currentDirectory,
|
||||
path.resolve(
|
||||
this.currentDirectory,
|
||||
filename
|
||||
)
|
||||
));
|
||||
var canonical = this._canonical(filename);
|
||||
trace('Parsing %s', canonical);
|
||||
|
||||
var text;
|
||||
try {
|
||||
text = fs.readFileSync(filename, 'utf-8');
|
||||
} catch (ex) {
|
||||
return;
|
||||
}
|
||||
|
||||
var file;
|
||||
var current = this.files[canonical];
|
||||
var previous = this.previousFiles[canonical];
|
||||
var version;
|
||||
|
||||
if (current && current.contents === text) {
|
||||
file = current.ts;
|
||||
version = current.version;
|
||||
trace('Reused current file %s (version %d)', canonical, version);
|
||||
} else if (previous && previous.contents === text) {
|
||||
file = previous.ts;
|
||||
version = previous.version;
|
||||
trace('Reused previous file %s (version %d)', canonical, version);
|
||||
} else {
|
||||
var ppText = text;
|
||||
if (this.preprocess) {
|
||||
ppText = pp.preprocess(text, this.preprocess, {type:'js'});
|
||||
}
|
||||
file = ts.createSourceFile(relative, ppText, this.languageVersion, true);
|
||||
version = this.version;
|
||||
trace('New version of source file %s (version %d)', canonical, version);
|
||||
}
|
||||
|
||||
this.files[canonical] = {
|
||||
filename: relative,
|
||||
contents: text,
|
||||
ts: file,
|
||||
root: root,
|
||||
version: version,
|
||||
nodeModule: /\/node_modules\/(?!typescript\/)/.test(canonical)
|
||||
};
|
||||
this.emit('file', canonical, relative);
|
||||
|
||||
return file;
|
||||
};
|
||||
|
||||
Host.prototype.getSourceFile = function (filename) {
|
||||
if (filename === '__lib.d.ts') {
|
||||
return this.libDefault;
|
||||
}
|
||||
var canonical = this._canonical(filename);
|
||||
if (this.files[canonical]) {
|
||||
return this.files[canonical].ts;
|
||||
}
|
||||
return this._addFile(filename, false);
|
||||
};
|
||||
|
||||
Host.prototype.getDefaultLibFileName = function () {
|
||||
var libPath = path.dirname(ts.sys.getExecutingFilePath());
|
||||
var libFile = ts.getDefaultLibFileName({ target: this.languageVersion });
|
||||
return ts.normalizeSlashes(path.join(libPath, libFile));
|
||||
};
|
||||
|
||||
Host.prototype.writeFile = function (filename, data) {
|
||||
|
||||
var outputCanonical = this._canonical(filename);
|
||||
log('Cache write %s', outputCanonical);
|
||||
this.output[outputCanonical] = data;
|
||||
|
||||
var sourceCanonical = this._inferSourceCanonical(outputCanonical);
|
||||
var sourceFollowed = this._follow(path.dirname(sourceCanonical)) + '/' + path.basename(sourceCanonical);
|
||||
|
||||
if (sourceFollowed !== sourceCanonical) {
|
||||
outputCanonical = this._inferOutputCanonical(sourceFollowed);
|
||||
log('Cache write (followed) %s', outputCanonical);
|
||||
this.output[outputCanonical] = data;
|
||||
}
|
||||
};
|
||||
|
||||
Host.prototype.getCurrentDirectory = function () {
|
||||
return this.currentDirectory;
|
||||
};
|
||||
|
||||
Host.prototype.getCanonicalFileName = function (filename) {
|
||||
return ts.normalizeSlashes(this.caseSensitive ? filename : filename.toLowerCase());
|
||||
};
|
||||
|
||||
Host.prototype.useCaseSensitiveFileNames = function () {
|
||||
return this.caseSensitive;
|
||||
};
|
||||
|
||||
Host.prototype.getNewLine = function () {
|
||||
return os.EOL;
|
||||
};
|
||||
|
||||
Host.prototype.fileExists = function (filename) {
|
||||
return ts.sys.fileExists(filename);
|
||||
};
|
||||
|
||||
Host.prototype.readFile = function (filename) {
|
||||
return ts.sys.readFile(filename);
|
||||
};
|
||||
|
||||
Host.prototype.directoryExists = function (dirname) {
|
||||
return ts.sys.directoryExists(dirname);
|
||||
};
|
||||
|
||||
Host.prototype.getDirectories = function (dirname) {
|
||||
return ts.sys.getDirectories(dirname);
|
||||
};
|
||||
|
||||
Host.prototype.getEnvironmentVariable = function (name) {
|
||||
return ts.sys.getEnvironmentVariable(name);
|
||||
};
|
||||
|
||||
Host.prototype.realpath = function (name) {
|
||||
return realpath.realpathSync(name);
|
||||
};
|
||||
|
||||
Host.prototype.trace = function (message) {
|
||||
ts.sys.write(message + this.getNewLine());
|
||||
};
|
||||
|
||||
Host.prototype._rootFilenames = function () {
|
||||
|
||||
var rootFilenames = [];
|
||||
|
||||
for (var filename in this.files) {
|
||||
if (!Object.hasOwnProperty.call(this.files, filename)) continue;
|
||||
if (!this.files[filename].root) continue;
|
||||
rootFilenames.push(filename);
|
||||
}
|
||||
return rootFilenames;
|
||||
}
|
||||
|
||||
Host.prototype._nodeModuleFilenames = function () {
|
||||
|
||||
var nodeModuleFilenames = [];
|
||||
|
||||
for (var filename in this.files) {
|
||||
if (!Object.hasOwnProperty.call(this.files, filename)) continue;
|
||||
if (!this.files[filename].nodeModule) continue;
|
||||
nodeModuleFilenames.push(filename);
|
||||
}
|
||||
return nodeModuleFilenames;
|
||||
}
|
||||
|
||||
Host.prototype._compile = function (opts) {
|
||||
|
||||
var rootFilenames = this._rootFilenames();
|
||||
var nodeModuleFilenames = [];
|
||||
|
||||
log('Compiling files:');
|
||||
rootFilenames.forEach(function (file) { log(' %s', file); });
|
||||
|
||||
if (semver.gte(ts.version, '2.0.0')) {
|
||||
ts.createProgram(rootFilenames, opts, this);
|
||||
nodeModuleFilenames = this._nodeModuleFilenames();
|
||||
log(' + %d file(s) found in node_modules', nodeModuleFilenames.length);
|
||||
}
|
||||
return ts.createProgram(rootFilenames.concat(nodeModuleFilenames), opts, this);
|
||||
}
|
||||
|
||||
Host.prototype._output = function (filename) {
|
||||
|
||||
var outputCanonical = this._inferOutputCanonical(filename);
|
||||
log('Cache read %s', outputCanonical);
|
||||
|
||||
var output = this.output[outputCanonical];
|
||||
if (!output) {
|
||||
log('Cache miss on %s', outputCanonical);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
Host.prototype._canonical = function (filename) {
|
||||
return this.getCanonicalFileName(path.resolve(
|
||||
this.currentDirectory,
|
||||
filename
|
||||
));
|
||||
}
|
||||
|
||||
Host.prototype._inferOutputCanonical = function (filename) {
|
||||
|
||||
var sourceCanonical = this._canonical(filename);
|
||||
var outputRelative = path.relative(
|
||||
this.rootDirectory,
|
||||
sourceCanonical
|
||||
);
|
||||
var outputCanonical = this.getCanonicalFileName(path.resolve(
|
||||
this.outputDirectory,
|
||||
outputRelative
|
||||
));
|
||||
return outputCanonical;
|
||||
}
|
||||
|
||||
Host.prototype._inferSourceCanonical = function (filename) {
|
||||
|
||||
var outputCanonical = this._canonical(filename);
|
||||
var outputRelative = path.relative(
|
||||
this.outputDirectory,
|
||||
outputCanonical
|
||||
);
|
||||
var sourceCanonical = this.getCanonicalFileName(path.resolve(
|
||||
this.rootDirectory,
|
||||
outputRelative
|
||||
));
|
||||
return sourceCanonical;
|
||||
}
|
||||
|
||||
Host.prototype._follow = function (filename) {
|
||||
|
||||
filename = this._canonical(filename);
|
||||
var basename;
|
||||
var parts = [];
|
||||
|
||||
do {
|
||||
var stats = fs.lstatSync(filename);
|
||||
if (stats.isSymbolicLink()) {
|
||||
filename = realpath.realpathSync(filename);
|
||||
} else {
|
||||
basename = path.basename(filename);
|
||||
if (basename) {
|
||||
parts.unshift(basename);
|
||||
filename = path.dirname(filename);
|
||||
}
|
||||
}
|
||||
} while (basename);
|
||||
|
||||
return ts.normalizeSlashes(filename + parts.join('/'));
|
||||
};
|
||||
|
||||
return Host;
|
||||
};
|
||||
323
node_modules/tsify-preprocess/lib/Tsifier.js
generated
vendored
Normal file
323
node_modules/tsify-preprocess/lib/Tsifier.js
generated
vendored
Normal file
@@ -0,0 +1,323 @@
|
||||
'use strict';
|
||||
|
||||
var convert = require('convert-source-map');
|
||||
var events = require('events');
|
||||
var extend = require('util')._extend;
|
||||
var fs = require('fs');
|
||||
var realpath = require('fs.realpath');
|
||||
var log = require('util').debuglog(require('../package').name);
|
||||
var trace = require('util').debuglog(require('../package').name + '-trace');
|
||||
var path = require('path');
|
||||
var through = require('through2');
|
||||
var time = require('./time');
|
||||
var tsconfig = require('tsconfig');
|
||||
var util = require('util');
|
||||
var assign = require('object-assign');
|
||||
|
||||
module.exports = function (ts) {
|
||||
var CompileError = require('./CompileError')(ts);
|
||||
var Host = require('./Host')(ts);
|
||||
var currentDirectory = realpath.realpathSync(process.cwd());
|
||||
|
||||
var parseJsonConfigFileContent = ts.parseJsonConfigFileContent || ts.parseConfigFile;
|
||||
|
||||
function isTypescript(file) {
|
||||
return (/\.tsx?$/i).test(file);
|
||||
}
|
||||
|
||||
function isTsx(file) {
|
||||
return (/\.tsx$/i).test(file);
|
||||
}
|
||||
|
||||
function isJavascript(file) {
|
||||
return (/\.jsx?$/i).test(file);
|
||||
}
|
||||
|
||||
function isTypescriptDeclaration(file) {
|
||||
return (/\.d\.ts$/i).test(file);
|
||||
}
|
||||
|
||||
function replaceFileExtension(file, extension) {
|
||||
return file.replace(/\.\w+$/i, extension);
|
||||
}
|
||||
|
||||
function fileExists(file) {
|
||||
try {
|
||||
var stats = fs.lstatSync(file);
|
||||
return stats.isFile();
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function parseOptions(opts, bopts) {
|
||||
|
||||
// Expand any short-name, command-line options
|
||||
var expanded = {};
|
||||
if (opts.m) { expanded.module = opts.m; }
|
||||
if (opts.p) { expanded.project = opts.p; }
|
||||
if (opts.t) { expanded.target = opts.t; }
|
||||
opts = assign(expanded, opts);
|
||||
|
||||
var config;
|
||||
var configFile;
|
||||
if (typeof opts.project === "object"){
|
||||
log('Using inline tsconfig');
|
||||
config = JSON.parse(JSON.stringify(opts.project));
|
||||
config.compilerOptions = config.compilerOptions || {};
|
||||
extend(config.compilerOptions, opts);
|
||||
} else {
|
||||
if (fileExists(opts.project)) {
|
||||
configFile = opts.project;
|
||||
} else {
|
||||
configFile = ts.findConfigFile(
|
||||
ts.normalizeSlashes(opts.project || bopts.basedir || currentDirectory),
|
||||
fileExists
|
||||
);
|
||||
}
|
||||
if (configFile) {
|
||||
log('Using tsconfig file at %s', configFile);
|
||||
config = tsconfig.readFileSync(configFile);
|
||||
config.compilerOptions = config.compilerOptions || {};
|
||||
extend(config.compilerOptions, opts);
|
||||
} else {
|
||||
config = {
|
||||
files: [],
|
||||
compilerOptions: opts
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var parsed = parseJsonConfigFileContent(
|
||||
config,
|
||||
ts.sys,
|
||||
configFile ? path.resolve(path.dirname(configFile)) : currentDirectory,
|
||||
null,
|
||||
configFile ? path.resolve(configFile) : undefined
|
||||
);
|
||||
|
||||
// Get the preprocess optoin
|
||||
parsed.options.preprocess = opts.preprocess || null;
|
||||
|
||||
// Generate inline sourcemaps if Browserify's --debug option is set
|
||||
parsed.options.sourceMap = false;
|
||||
parsed.options.inlineSourceMap = bopts.debug;
|
||||
parsed.options.inlineSources = bopts.debug;
|
||||
|
||||
// Default to CommonJS module mode
|
||||
parsed.options.module = parsed.options.module || ts.ModuleKind.CommonJS;
|
||||
|
||||
// Blacklist --out/--outFile/--noEmit; these should definitely not be set, since we are doing
|
||||
// concatenation with Browserify instead
|
||||
delete parsed.options.out;
|
||||
delete parsed.options.outFile;
|
||||
delete parsed.options.noEmit;
|
||||
|
||||
// Set rootDir and outDir so we know exactly where the TS compiler will be trying to
|
||||
// write files; the filenames will end up being the keys into our in-memory store.
|
||||
// The output directory needs to be distinct from the input directory to prevent the TS
|
||||
// compiler from thinking that it might accidentally overwrite source files, which would
|
||||
// prevent it from outputting e.g. the results of transpiling ES6 JS files with --allowJs.
|
||||
parsed.options.rootDir = path.relative('.', '/');
|
||||
parsed.options.outDir = path.resolve('/__tsify__');
|
||||
|
||||
log('Files from tsconfig parse:');
|
||||
parsed.fileNames.forEach(function (filename) { log(' %s', filename); });
|
||||
|
||||
var result = {
|
||||
options: parsed.options,
|
||||
fileNames: parsed.fileNames
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function Tsifier(opts, bopts) {
|
||||
var self = this;
|
||||
|
||||
var parsedOptions = parseOptions(opts, bopts);
|
||||
self.opts = parsedOptions.options;
|
||||
self.files = parsedOptions.fileNames;
|
||||
self.bopts = bopts;
|
||||
self.host = new Host(currentDirectory, self.opts);
|
||||
|
||||
self.host.on('file', function (file, id) {
|
||||
self.emit('file', file, id);
|
||||
});
|
||||
}
|
||||
|
||||
util.inherits(Tsifier, events.EventEmitter);
|
||||
|
||||
Tsifier.prototype.reset = function () {
|
||||
var self = this;
|
||||
self.host._reset();
|
||||
self.addFiles(self.files);
|
||||
};
|
||||
|
||||
Tsifier.prototype.generateCache = function (files) {
|
||||
this.addFiles(files);
|
||||
this.compile();
|
||||
};
|
||||
|
||||
Tsifier.prototype.addFiles = function (files) {
|
||||
var self = this;
|
||||
files.forEach(function (file) {
|
||||
self.host._addFile(file, true);
|
||||
});
|
||||
};
|
||||
|
||||
Tsifier.prototype.compile = function () {
|
||||
var self = this;
|
||||
|
||||
var createProgram_t0 = time.start();
|
||||
var program = self.host._compile(self.opts);
|
||||
time.stop(createProgram_t0, 'createProgram');
|
||||
|
||||
var syntaxDiagnostics = self.checkSyntax(program);
|
||||
if (syntaxDiagnostics.length) {
|
||||
log('Compilation encountered fatal syntax errors');
|
||||
return;
|
||||
}
|
||||
|
||||
var semanticDiagnostics = self.checkSemantics(program);
|
||||
if (semanticDiagnostics.length && self.opts.noEmitOnError) {
|
||||
log('Compilation encountered fatal semantic errors');
|
||||
return;
|
||||
}
|
||||
|
||||
var emit_t0 = time.start();
|
||||
var emitOutput = program.emit();
|
||||
time.stop(emit_t0, 'emit program');
|
||||
|
||||
var emittedDiagnostics = self.checkEmittedOutput(emitOutput);
|
||||
if (emittedDiagnostics.length && self.opts.noEmitOnError) {
|
||||
log('Compilation encountered fatal errors during emit');
|
||||
return;
|
||||
}
|
||||
|
||||
log('Compilation completed without errors');
|
||||
};
|
||||
|
||||
Tsifier.prototype.checkSyntax = function (program) {
|
||||
var self = this;
|
||||
|
||||
var syntaxCheck_t0 = time.start();
|
||||
var syntaxDiagnostics = program.getSyntacticDiagnostics();
|
||||
time.stop(syntaxCheck_t0, 'syntax checking');
|
||||
|
||||
syntaxDiagnostics.forEach(function (error) {
|
||||
self.emit('error', new CompileError(error));
|
||||
});
|
||||
|
||||
if (syntaxDiagnostics.length) {
|
||||
self.host.error = true;
|
||||
}
|
||||
return syntaxDiagnostics;
|
||||
};
|
||||
|
||||
Tsifier.prototype.checkSemantics = function (program) {
|
||||
var self = this;
|
||||
|
||||
var semanticDiagnostics_t0 = time.start();
|
||||
var semanticDiagnostics = program.getGlobalDiagnostics();
|
||||
if (semanticDiagnostics.length === 0) {
|
||||
semanticDiagnostics = program.getSemanticDiagnostics();
|
||||
}
|
||||
time.stop(semanticDiagnostics_t0, 'semantic checking');
|
||||
|
||||
semanticDiagnostics.forEach(function (error) {
|
||||
self.emit('error', new CompileError(error));
|
||||
});
|
||||
|
||||
if (semanticDiagnostics.length && self.opts.noEmitOnError) {
|
||||
self.host.error = true;
|
||||
}
|
||||
|
||||
return semanticDiagnostics;
|
||||
};
|
||||
|
||||
Tsifier.prototype.checkEmittedOutput = function (emitOutput) {
|
||||
var self = this;
|
||||
|
||||
var emittedDiagnostics = emitOutput.diagnostics;
|
||||
emittedDiagnostics.forEach(function (error) {
|
||||
self.emit('error', new CompileError(error));
|
||||
});
|
||||
|
||||
if (emittedDiagnostics.length && self.opts.noEmitOnError) {
|
||||
self.host.error = true;
|
||||
}
|
||||
|
||||
return emittedDiagnostics;
|
||||
};
|
||||
|
||||
Tsifier.prototype.transform = function (file) {
|
||||
var self = this;
|
||||
|
||||
trace('Transforming %s', file);
|
||||
|
||||
if (isTypescriptDeclaration(file)) {
|
||||
return through(transform);
|
||||
}
|
||||
|
||||
if (isTypescript(file) || (isJavascript(file) && self.opts.allowJs)) {
|
||||
return through(transform, flush);
|
||||
}
|
||||
|
||||
return through();
|
||||
|
||||
function transform(chunk, enc, next) {
|
||||
next();
|
||||
}
|
||||
function flush(next) {
|
||||
if (self.host.error)
|
||||
return;
|
||||
|
||||
var compiled = self.getCompiledFile(file);
|
||||
if (compiled) {
|
||||
this.push(compiled);
|
||||
}
|
||||
this.push(null);
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
Tsifier.prototype.getCompiledFile = function (inputFile, alreadyMissedCache) {
|
||||
var self = this;
|
||||
var outputExtension = (ts.JsxEmit && self.opts.jsx === ts.JsxEmit.Preserve && isTsx(inputFile)) ? '.jsx' : '.js';
|
||||
var output = self.host._output(replaceFileExtension(inputFile, outputExtension));
|
||||
|
||||
if (output === undefined) {
|
||||
if (alreadyMissedCache) {
|
||||
self.emit('error', new Error('tsify: no compiled file for ' + inputFile));
|
||||
return;
|
||||
}
|
||||
self.generateCache([inputFile]);
|
||||
if (self.host.error)
|
||||
return;
|
||||
return self.getCompiledFile(inputFile, true);
|
||||
}
|
||||
|
||||
if (self.opts.inlineSourceMap) {
|
||||
output = self.setSourcePathInSourcemap(output, inputFile);
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
Tsifier.prototype.setSourcePathInSourcemap = function (output, inputFile) {
|
||||
var self = this;
|
||||
var normalized = ts.normalizePath(path.relative(
|
||||
self.bopts.basedir || currentDirectory,
|
||||
inputFile
|
||||
));
|
||||
|
||||
var sourcemap = convert.fromComment(output);
|
||||
sourcemap.setProperty('sources', [normalized]);
|
||||
return output.replace(convert.commentRegex, sourcemap.toComment());
|
||||
}
|
||||
|
||||
var result = Tsifier;
|
||||
result.isTypescript = isTypescript;
|
||||
result.isTypescriptDeclaration = isTypescriptDeclaration;
|
||||
return result;
|
||||
};
|
||||
13
node_modules/tsify-preprocess/lib/time.js
generated
vendored
Normal file
13
node_modules/tsify-preprocess/lib/time.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var log = require('util').debuglog(require('../package').name);
|
||||
|
||||
function start() {
|
||||
return process.hrtime();
|
||||
}
|
||||
function stop(t0, message) {
|
||||
var tDiff = process.hrtime(t0);
|
||||
log('%d sec -- %s', (tDiff[0] + (tDiff[1] / 1000000000)).toFixed(4), message);
|
||||
}
|
||||
|
||||
module.exports = { start: start, stop: stop };
|
||||
1
node_modules/tsify-preprocess/node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/tsify-preprocess/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
||||
23
node_modules/tsify-preprocess/node_modules/convert-source-map/LICENSE
generated
vendored
Normal file
23
node_modules/tsify-preprocess/node_modules/convert-source-map/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
Copyright 2013 Thorsten Lorenz.
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
123
node_modules/tsify-preprocess/node_modules/convert-source-map/README.md
generated
vendored
Normal file
123
node_modules/tsify-preprocess/node_modules/convert-source-map/README.md
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
# convert-source-map [![Build Status][ci-image]][ci-url]
|
||||
|
||||
Converts a source-map from/to different formats and allows adding/changing properties.
|
||||
|
||||
```js
|
||||
var convert = require('convert-source-map');
|
||||
|
||||
var json = convert
|
||||
.fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
|
||||
.toJSON();
|
||||
|
||||
var modified = convert
|
||||
.fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
|
||||
.setProperty('sources', [ 'SRC/FOO.JS' ])
|
||||
.toJSON();
|
||||
|
||||
console.log(json);
|
||||
console.log(modified);
|
||||
```
|
||||
|
||||
```json
|
||||
{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
|
||||
{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### fromObject(obj)
|
||||
|
||||
Returns source map converter from given object.
|
||||
|
||||
### fromJSON(json)
|
||||
|
||||
Returns source map converter from given json string.
|
||||
|
||||
### fromBase64(base64)
|
||||
|
||||
Returns source map converter from given base64 encoded json string.
|
||||
|
||||
### fromComment(comment)
|
||||
|
||||
Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`.
|
||||
|
||||
### fromMapFileComment(comment, mapFileDir)
|
||||
|
||||
Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`.
|
||||
|
||||
`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the
|
||||
generated file, i.e. the one containing the source map.
|
||||
|
||||
### fromSource(source)
|
||||
|
||||
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
|
||||
|
||||
### fromMapFileSource(source, mapFileDir)
|
||||
|
||||
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was
|
||||
found.
|
||||
|
||||
The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see
|
||||
fromMapFileComment.
|
||||
|
||||
### toObject()
|
||||
|
||||
Returns a copy of the underlying source map.
|
||||
|
||||
### toJSON([space])
|
||||
|
||||
Converts source map to json string. If `space` is given (optional), this will be passed to
|
||||
[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the
|
||||
JSON string is generated.
|
||||
|
||||
### toBase64()
|
||||
|
||||
Converts source map to base64 encoded json string.
|
||||
|
||||
### toComment([options])
|
||||
|
||||
Converts source map to an inline comment that can be appended to the source-file.
|
||||
|
||||
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would
|
||||
normally see in a JS source file.
|
||||
|
||||
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file.
|
||||
|
||||
### addProperty(key, value)
|
||||
|
||||
Adds given property to the source map. Throws an error if property already exists.
|
||||
|
||||
### setProperty(key, value)
|
||||
|
||||
Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated.
|
||||
|
||||
### getProperty(key)
|
||||
|
||||
Gets given property of the source map.
|
||||
|
||||
### removeComments(src)
|
||||
|
||||
Returns `src` with all source map comments removed
|
||||
|
||||
### removeMapFileComments(src)
|
||||
|
||||
Returns `src` with all source map comments pointing to map files removed.
|
||||
|
||||
### commentRegex
|
||||
|
||||
Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments.
|
||||
|
||||
### mapFileCommentRegex
|
||||
|
||||
Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files.
|
||||
|
||||
### generateMapFileComment(file, [options])
|
||||
|
||||
Returns a comment that links to an external source map via `file`.
|
||||
|
||||
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file.
|
||||
|
||||
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file.
|
||||
|
||||
[ci-url]: https://github.com/thlorenz/convert-source-map/actions?query=workflow:ci
|
||||
[ci-image]: https://img.shields.io/github/workflow/status/thlorenz/convert-source-map/CI?style=flat-square
|
||||
179
node_modules/tsify-preprocess/node_modules/convert-source-map/index.js
generated
vendored
Normal file
179
node_modules/tsify-preprocess/node_modules/convert-source-map/index.js
generated
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
'use strict';
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
Object.defineProperty(exports, 'commentRegex', {
|
||||
get: function getCommentRegex () {
|
||||
return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(exports, 'mapFileCommentRegex', {
|
||||
get: function getMapFileCommentRegex () {
|
||||
// Matches sourceMappingURL in either // or /* comment styles.
|
||||
return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg;
|
||||
}
|
||||
});
|
||||
|
||||
var decodeBase64;
|
||||
if (typeof Buffer !== 'undefined') {
|
||||
if (typeof Buffer.from === 'function') {
|
||||
decodeBase64 = decodeBase64WithBufferFrom;
|
||||
} else {
|
||||
decodeBase64 = decodeBase64WithNewBuffer;
|
||||
}
|
||||
} else {
|
||||
decodeBase64 = decodeBase64WithAtob;
|
||||
}
|
||||
|
||||
function decodeBase64WithBufferFrom(base64) {
|
||||
return Buffer.from(base64, 'base64').toString();
|
||||
}
|
||||
|
||||
function decodeBase64WithNewBuffer(base64) {
|
||||
if (typeof value === 'number') {
|
||||
throw new TypeError('The value to decode must not be of type number.');
|
||||
}
|
||||
return new Buffer(base64, 'base64').toString();
|
||||
}
|
||||
|
||||
function decodeBase64WithAtob(base64) {
|
||||
return decodeURIComponent(escape(atob(base64)));
|
||||
}
|
||||
|
||||
function stripComment(sm) {
|
||||
return sm.split(',').pop();
|
||||
}
|
||||
|
||||
function readFromFileMap(sm, dir) {
|
||||
// NOTE: this will only work on the server since it attempts to read the map file
|
||||
|
||||
var r = exports.mapFileCommentRegex.exec(sm);
|
||||
|
||||
// for some odd reason //# .. captures in 1 and /* .. */ in 2
|
||||
var filename = r[1] || r[2];
|
||||
var filepath = path.resolve(dir, filename);
|
||||
|
||||
try {
|
||||
return fs.readFileSync(filepath, 'utf8');
|
||||
} catch (e) {
|
||||
throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e);
|
||||
}
|
||||
}
|
||||
|
||||
function Converter (sm, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
|
||||
if (opts.hasComment) sm = stripComment(sm);
|
||||
if (opts.isEncoded) sm = decodeBase64(sm);
|
||||
if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
|
||||
|
||||
this.sourcemap = sm;
|
||||
}
|
||||
|
||||
Converter.prototype.toJSON = function (space) {
|
||||
return JSON.stringify(this.sourcemap, null, space);
|
||||
};
|
||||
|
||||
if (typeof Buffer !== 'undefined') {
|
||||
if (typeof Buffer.from === 'function') {
|
||||
Converter.prototype.toBase64 = encodeBase64WithBufferFrom;
|
||||
} else {
|
||||
Converter.prototype.toBase64 = encodeBase64WithNewBuffer;
|
||||
}
|
||||
} else {
|
||||
Converter.prototype.toBase64 = encodeBase64WithBtoa;
|
||||
}
|
||||
|
||||
function encodeBase64WithBufferFrom() {
|
||||
var json = this.toJSON();
|
||||
return Buffer.from(json, 'utf8').toString('base64');
|
||||
}
|
||||
|
||||
function encodeBase64WithNewBuffer() {
|
||||
var json = this.toJSON();
|
||||
if (typeof json === 'number') {
|
||||
throw new TypeError('The json to encode must not be of type number.');
|
||||
}
|
||||
return new Buffer(json, 'utf8').toString('base64');
|
||||
}
|
||||
|
||||
function encodeBase64WithBtoa() {
|
||||
var json = this.toJSON();
|
||||
return btoa(unescape(encodeURIComponent(json)));
|
||||
}
|
||||
|
||||
Converter.prototype.toComment = function (options) {
|
||||
var base64 = this.toBase64();
|
||||
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
|
||||
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
|
||||
};
|
||||
|
||||
// returns copy instead of original
|
||||
Converter.prototype.toObject = function () {
|
||||
return JSON.parse(this.toJSON());
|
||||
};
|
||||
|
||||
Converter.prototype.addProperty = function (key, value) {
|
||||
if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
|
||||
return this.setProperty(key, value);
|
||||
};
|
||||
|
||||
Converter.prototype.setProperty = function (key, value) {
|
||||
this.sourcemap[key] = value;
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.getProperty = function (key) {
|
||||
return this.sourcemap[key];
|
||||
};
|
||||
|
||||
exports.fromObject = function (obj) {
|
||||
return new Converter(obj);
|
||||
};
|
||||
|
||||
exports.fromJSON = function (json) {
|
||||
return new Converter(json, { isJSON: true });
|
||||
};
|
||||
|
||||
exports.fromBase64 = function (base64) {
|
||||
return new Converter(base64, { isEncoded: true });
|
||||
};
|
||||
|
||||
exports.fromComment = function (comment) {
|
||||
comment = comment
|
||||
.replace(/^\/\*/g, '//')
|
||||
.replace(/\*\/$/g, '');
|
||||
|
||||
return new Converter(comment, { isEncoded: true, hasComment: true });
|
||||
};
|
||||
|
||||
exports.fromMapFileComment = function (comment, dir) {
|
||||
return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });
|
||||
};
|
||||
|
||||
// Finds last sourcemap comment in file or returns null if none was found
|
||||
exports.fromSource = function (content) {
|
||||
var m = content.match(exports.commentRegex);
|
||||
return m ? exports.fromComment(m.pop()) : null;
|
||||
};
|
||||
|
||||
// Finds last sourcemap comment in file or returns null if none was found
|
||||
exports.fromMapFileSource = function (content, dir) {
|
||||
var m = content.match(exports.mapFileCommentRegex);
|
||||
return m ? exports.fromMapFileComment(m.pop(), dir) : null;
|
||||
};
|
||||
|
||||
exports.removeComments = function (src) {
|
||||
return src.replace(exports.commentRegex, '');
|
||||
};
|
||||
|
||||
exports.removeMapFileComments = function (src) {
|
||||
return src.replace(exports.mapFileCommentRegex, '');
|
||||
};
|
||||
|
||||
exports.generateMapFileComment = function (file, options) {
|
||||
var data = 'sourceMappingURL=' + file;
|
||||
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
|
||||
};
|
||||
41
node_modules/tsify-preprocess/node_modules/convert-source-map/package.json
generated
vendored
Normal file
41
node_modules/tsify-preprocess/node_modules/convert-source-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "convert-source-map",
|
||||
"version": "1.9.0",
|
||||
"description": "Converts a source-map from/to different formats and allows adding/changing properties.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap test/*.js --color"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/thlorenz/convert-source-map.git"
|
||||
},
|
||||
"homepage": "https://github.com/thlorenz/convert-source-map",
|
||||
"devDependencies": {
|
||||
"inline-source-map": "~0.6.2",
|
||||
"tap": "~9.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"convert",
|
||||
"sourcemap",
|
||||
"source",
|
||||
"map",
|
||||
"browser",
|
||||
"debug"
|
||||
],
|
||||
"author": {
|
||||
"name": "Thorsten Lorenz",
|
||||
"email": "thlorenz@gmx.de",
|
||||
"url": "http://thlorenz.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"engine": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"browser": {
|
||||
"fs": false
|
||||
}
|
||||
}
|
||||
15
node_modules/tsify-preprocess/node_modules/semver/LICENSE
generated
vendored
Normal file
15
node_modules/tsify-preprocess/node_modules/semver/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
412
node_modules/tsify-preprocess/node_modules/semver/README.md
generated
vendored
Normal file
412
node_modules/tsify-preprocess/node_modules/semver/README.md
generated
vendored
Normal file
@@ -0,0 +1,412 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install --save semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero digit in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||
160
node_modules/tsify-preprocess/node_modules/semver/bin/semver
generated
vendored
Executable file
160
node_modules/tsify-preprocess/node_modules/semver/bin/semver
generated
vendored
Executable file
@@ -0,0 +1,160 @@
|
||||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
var argv = process.argv.slice(2)
|
||||
|
||||
var versions = []
|
||||
|
||||
var range = []
|
||||
|
||||
var inc = null
|
||||
|
||||
var version = require('../package.json').version
|
||||
|
||||
var loose = false
|
||||
|
||||
var includePrerelease = false
|
||||
|
||||
var coerce = false
|
||||
|
||||
var identifier
|
||||
|
||||
var semver = require('../semver')
|
||||
|
||||
var reverse = false
|
||||
|
||||
var options = {}
|
||||
|
||||
main()
|
||||
|
||||
function main () {
|
||||
if (!argv.length) return help()
|
||||
while (argv.length) {
|
||||
var a = argv.shift()
|
||||
var indexOfEqualSign = a.indexOf('=')
|
||||
if (indexOfEqualSign !== -1) {
|
||||
a = a.slice(0, indexOfEqualSign)
|
||||
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||
}
|
||||
switch (a) {
|
||||
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||
reverse = true
|
||||
break
|
||||
case '-l': case '--loose':
|
||||
loose = true
|
||||
break
|
||||
case '-p': case '--include-prerelease':
|
||||
includePrerelease = true
|
||||
break
|
||||
case '-v': case '--version':
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case '-i': case '--inc': case '--increment':
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = 'patch'
|
||||
break
|
||||
}
|
||||
break
|
||||
case '--preid':
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case '-r': case '--range':
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case '-c': case '--coerce':
|
||||
coerce = true
|
||||
break
|
||||
case '-h': case '--help': case '-?':
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var options = { loose: loose, includePrerelease: includePrerelease }
|
||||
|
||||
versions = versions.map(function (v) {
|
||||
return coerce ? (semver.coerce(v) || { version: v }).version : v
|
||||
}).filter(function (v) {
|
||||
return semver.valid(v)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||
|
||||
for (var i = 0, l = range.length; i < l; i++) {
|
||||
versions = versions.filter(function (v) {
|
||||
return semver.satisfies(v, range[i], options)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
}
|
||||
return success(versions)
|
||||
}
|
||||
|
||||
function failInc () {
|
||||
console.error('--inc can only be used on a single version with no range')
|
||||
fail()
|
||||
}
|
||||
|
||||
function fail () { process.exit(1) }
|
||||
|
||||
function success () {
|
||||
var compare = reverse ? 'rcompare' : 'compare'
|
||||
versions.sort(function (a, b) {
|
||||
return semver[compare](a, b, options)
|
||||
}).map(function (v) {
|
||||
return semver.clean(v, options)
|
||||
}).map(function (v) {
|
||||
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||
}).forEach(function (v, i, _) { console.log(v) })
|
||||
}
|
||||
|
||||
function help () {
|
||||
console.log(['SemVer ' + version,
|
||||
'',
|
||||
'A JavaScript implementation of the https://semver.org/ specification',
|
||||
'Copyright Isaac Z. Schlueter',
|
||||
'',
|
||||
'Usage: semver [options] <version> [<version> [...]]',
|
||||
'Prints valid versions sorted by SemVer precedence',
|
||||
'',
|
||||
'Options:',
|
||||
'-r --range <range>',
|
||||
' Print versions that match the specified range.',
|
||||
'',
|
||||
'-i --increment [<level>]',
|
||||
' Increment a version by the specified level. Level can',
|
||||
' be one of: major, minor, patch, premajor, preminor,',
|
||||
" prepatch, or prerelease. Default level is 'patch'.",
|
||||
' Only one version may be specified.',
|
||||
'',
|
||||
'--preid <identifier>',
|
||||
' Identifier to be used to prefix premajor, preminor,',
|
||||
' prepatch or prerelease version increments.',
|
||||
'',
|
||||
'-l --loose',
|
||||
' Interpret versions and ranges loosely',
|
||||
'',
|
||||
'-p --include-prerelease',
|
||||
' Always include prerelease versions in range matching',
|
||||
'',
|
||||
'-c --coerce',
|
||||
' Coerce a string into SemVer if possible',
|
||||
' (does not imply --loose)',
|
||||
'',
|
||||
'Program exits successfully if any valid version satisfies',
|
||||
'all supplied ranges, and prints all satisfying versions.',
|
||||
'',
|
||||
'If no satisfying versions are found, then exits failure.',
|
||||
'',
|
||||
'Versions are printed in ascending order, so supplying',
|
||||
'multiple versions to the utility will just sort them.'
|
||||
].join('\n'))
|
||||
}
|
||||
38
node_modules/tsify-preprocess/node_modules/semver/package.json
generated
vendored
Normal file
38
node_modules/tsify-preprocess/node_modules/semver/package.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "semver",
|
||||
"version": "5.7.2",
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"main": "semver.js",
|
||||
"scripts": {
|
||||
"test": "tap test/ --100 --timeout=30",
|
||||
"lint": "echo linting disabled",
|
||||
"postlint": "template-oss-check",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"snap": "tap test/ --100 --timeout=30",
|
||||
"posttest": "npm run lint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/template-oss": "4.17.0",
|
||||
"tap": "^12.7.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "./bin/semver"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"range.bnf",
|
||||
"semver.js"
|
||||
],
|
||||
"author": "GitHub Inc.",
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"content": "./scripts/template-oss",
|
||||
"version": "4.17.0"
|
||||
}
|
||||
}
|
||||
16
node_modules/tsify-preprocess/node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/tsify-preprocess/node_modules/semver/range.bnf
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
1525
node_modules/tsify-preprocess/node_modules/semver/semver.js
generated
vendored
Normal file
1525
node_modules/tsify-preprocess/node_modules/semver/semver.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
59
node_modules/tsify-preprocess/package.json
generated
vendored
Normal file
59
node_modules/tsify-preprocess/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "tsify-preprocess",
|
||||
"version": "2.0.3",
|
||||
"description": "Browserify plugin for compiling Typescript",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "test-peer-range browserify",
|
||||
"test-main": "node test/test.js"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.com"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jiborobot/tsify-preprocess"
|
||||
},
|
||||
"keywords": [
|
||||
"browserify",
|
||||
"browserify-plugin",
|
||||
"typescript"
|
||||
],
|
||||
"author": "Greg Smith",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jiborobot/tsify-preprocess/issues"
|
||||
},
|
||||
"homepage": "https://github.com/jiborobot/tsify-preprocess",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"convert-source-map": "^1.1.0",
|
||||
"fs.realpath": "^1.0.0",
|
||||
"object-assign": "^4.1.0",
|
||||
"preprocess": "^3.1.0",
|
||||
"semver": "^5.1.0",
|
||||
"through2": "^2.0.0",
|
||||
"tsconfig": "^5.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-preset-react": "^6.5.0",
|
||||
"babelify": "^7.2.0",
|
||||
"browserify": "^13.0.0",
|
||||
"eslint": "^3.3.1",
|
||||
"event-stream": "^3.3.1",
|
||||
"fs-extra": "^0.30.0",
|
||||
"node-foo": "^0.2.3",
|
||||
"source-map": "^0.5.3",
|
||||
"tape": "^4.0.0",
|
||||
"test-peer-range": "^1.0.1",
|
||||
"typescript": "^2.0.3",
|
||||
"watchify": "^3.2.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"browserify": ">= 6.x",
|
||||
"typescript": ">= 2.x"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user