seng-disposable
Advanced tools
Comparing version 1.0.1 to 1.1.2
@@ -1,3 +0,4 @@ | ||
import { default as _export } from "./lib/Disposable"; | ||
import 'ts-helpers'; | ||
import { default as _export } from './lib/Disposable'; | ||
export { default as IDisposable } from './lib/IDisposable'; | ||
export default _export; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("ts-helpers"); | ||
var Disposable_1 = require("./lib/Disposable"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = Disposable_1.default; |
@@ -1,4 +0,4 @@ | ||
import IDisposable from "./IDisposable"; | ||
import IDisposable from './IDisposable'; | ||
declare class Disposable implements IDisposable { | ||
private _isDisposed; | ||
private disposed; | ||
/** | ||
@@ -5,0 +5,0 @@ * After {@link dispose} has been called, this method returns true. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Disposable = (function () { | ||
function Disposable() { | ||
this._isDisposed = false; | ||
this.disposed = false; | ||
} | ||
@@ -11,3 +12,3 @@ /** | ||
Disposable.prototype.isDisposed = function () { | ||
return this._isDisposed; | ||
return this.disposed; | ||
}; | ||
@@ -18,7 +19,6 @@ /** | ||
Disposable.prototype.dispose = function () { | ||
this._isDisposed = true; | ||
this.disposed = true; | ||
}; | ||
return Disposable; | ||
}()); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = Disposable; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
127
package.json
{ | ||
"name": "seng-disposable", | ||
"version": "1.0.1", | ||
"version": "1.1.2", | ||
"description": "Disposable provides a common interface for disposing of objects", | ||
"main": "index.js", | ||
"typings": "index", | ||
"scripts": { | ||
"postinstall": "npm run typings", | ||
"prepublish": "npm run build-npm", | ||
"typings": "typings install", | ||
"test": "npm run typescript-test && karma start config/karma.conf.js --single-run --browsers PhantomJS", | ||
"validate": "npm-run-all -p validate-webpack lint test -s check-coverage", | ||
"check-coverage": "istanbul check-coverage --statement 1 --branches 1 --functions 1 --lines 1", | ||
"validate-webpack": "webpack-validator config/webpack.config.js", | ||
"lint": "tslint -c tslint.json src/**/*.ts", | ||
"clean": "rimraf dist lib index.js index.d.ts coverage", | ||
"compile": "npm-run-all typescript-npm typescript-test typescript-system typescript-es6 webpack-dist", | ||
"typescript-npm": "tsc -p ./ -d", | ||
"typescript-test": "tsc -p test", | ||
"typescript-system": "tsc -p ./ -m system --outFile ./dist/system/seng-disposable.js", | ||
"typescript-es6": "tsc -p ./ -t es6 -m es6 --outDir ./dist/es6/", | ||
"webpack-dist": "node script/webpack.js", | ||
"doc": "npm-run-all -p typedoc yuidoc", | ||
"typedoc": "typedoc --out doc/typedoc/ src/", | ||
"yuidoc": "yuidoc -o doc/yuidoc/ -t ./node_modules/yuidoc-mediamonks-theme -H ./node_modules/yuidoc-mediamonks-theme/helpers/helpers.js src/", | ||
"prepublish": "npm run build:npm", | ||
"test": "npm-run-all test:*", | ||
"test:unit": "karma start --single-run --browsers PhantomJS", | ||
"test:unit:dev": "karma start karma.conf.dev.js", | ||
"validate": "npm-run-all -p validate:webpack lint test:unit -s validate:coverage", | ||
"validate:webpack": "webpack-validator config/webpack.config.dist.js && webpack-validator config/webpack.config.test.js", | ||
"validate:coverage": "istanbul check-coverage --statement 1 --branches 1 --functions 1 --lines 1", | ||
"lint": "npm-run-all lint:*", | ||
"lint:ts": "tslint -c tslint.json \"src/**/*.ts\"", | ||
"clean": "npm-run-all clean:*", | ||
"clean:test": "shx rm -rf coverage", | ||
"clean:npm": "shx rm -rf lib npm index.js index.d.ts", | ||
"clean:dist": "shx rm -rf dist \"seng-*.@(zip|tar.gz)\"", | ||
"compile": "npm-run-all compile:**", | ||
"compile:npm": "npm run clean:npm && tsc -p ./ -d --outDir ./npm && shx mv \"./npm/*\" ./ && shx rm -rf ./npm", | ||
"compile:dist:typescript:es6": "tsc -p ./ -t es6 -m es6 --outDir ./dist/es6/", | ||
"compile:dist:webpack": "node script/webpack.js", | ||
"doc": "npm-run-all -p doc:*", | ||
"doc:typedoc": "typedoc --out docs/ src/ --mode file", | ||
"generate": "npm-run-all clean compile test:unit doc", | ||
"build": "npm-run-all clean compile", | ||
"build-npm": "npm-run-all clean test typescript-npm" | ||
"dev": "node script/webpack-dev.js", | ||
"build:npm": "npm-run-all test compile:npm", | ||
"build:dist": "npm-run-all clean:dist compile:dist:**" | ||
}, | ||
"pre-commit": [ | ||
"scriptsComment": { | ||
"test": "Placeholder for all types of tests", | ||
"test:unit": "Runs unit tests with Karma in PhantomJS", | ||
"test:unit:dev": "Runs unit tests with Karma in PhantomJS (with the watch mode)", | ||
"validate": "Runs all scripts that validate if the contents of this repos is correct", | ||
"validate:webpack": "Validates the webpack config file", | ||
"validate:coverage": "Checks if the code coverage results are above a defined minimun", | ||
"lint": "Placeholder for all types if linting checks", | ||
"lint:ts": "Lints the source files using tslint", | ||
"clean": "Placeholder for all clean tasks, resets the checkout to a clean state", | ||
"clean:test": "Remove all test related output", | ||
"clean:npm": "Remove all npm related output", | ||
"clean:dist": "Remove all dist related output", | ||
"compile": "Placeholder for all tasks that compile code", | ||
"compile:npm": "Compiles the code for npm. The output needs to end up in the current directory, but if we use that as outputPath in tsconfig.json it disables file-globbing for the includes array. That's why we are outputting it in a npm folder, and then moving it the this folder.", | ||
"compile:dist:typescript:es6": "Compiles typescript to es6 code in the dist folder", | ||
"compile:dist:webpack": "Compiles all dist bundles with webpack", | ||
"doc": "Placeholder for all doc scripts", | ||
"doc:typedoc": "Runs typedoc", | ||
"generate": "Placeholder for all scripts that generate something (code, test, doc, etc)", | ||
"build": "Cleans and compiles everything", | ||
"dev": "Compiles browser dist bundle with webpack and starts server", | ||
"build:npm": "Prepares the checkout for an npm publish", | ||
"build:dist": "Prepares the checkout for travis deployments to github and s3" | ||
}, | ||
"pre-push": [ | ||
"validate" | ||
], | ||
"author": "Arjan van Wijk", | ||
"author": "Stuart van Beek <stuart@mediamonks.com> (https://github.com/art0rz)", | ||
"homepage": "https://www.mediamonks.com/", | ||
@@ -38,3 +66,5 @@ "license": "MIT", | ||
"mediamonks", | ||
"boilerplate" | ||
"seng-disposable", | ||
"disposable", | ||
"seng" | ||
], | ||
@@ -49,26 +79,45 @@ "bugs": { | ||
"devDependencies": { | ||
"@types/chai": "^3.4.34", | ||
"@types/mocha": "^2.2.32", | ||
"@types/webpack": "^1.12.35", | ||
"archiver": "^1.0.0", | ||
"awesome-typescript-loader": "^3.0.0-beta.17", | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.11.6", | ||
"es6-promise": "^3.2.1", | ||
"es6-promisify": "^4.1.0", | ||
"es6-promisify-all": "^0.1.0", | ||
"istanbul": "^0.4.3", | ||
"istanbul-instrumenter-loader": "^0.1.3", | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^0.13.19", | ||
"karma-coverage": "^0.5.3", | ||
"karma-jasmine": "^0.3.6", | ||
"istanbul-instrumenter-loader": "^0.2.0", | ||
"karma": "^0.13.22", | ||
"karma-chai": "^0.1.0", | ||
"karma-coverage": "^1.0.0", | ||
"karma-mocha": "^1.1.1", | ||
"karma-mocha-reporter": "^2.2.0", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-remap-istanbul": "^0.1.1", | ||
"karma-source-map-support": "^1.1.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^1.7.0", | ||
"marked": "^0.3.5", | ||
"mocha": "^2.5.3", | ||
"npm-run-all": "^2.2.0", | ||
"phantomjs-prebuilt": "^2.1.3", | ||
"pre-commit": "^1.1.3", | ||
"rimraf": "^2.5.2", | ||
"ts-loader": "^0.8.0", | ||
"tslint": "^3.3.0", | ||
"typedoc": "^0.4.3", | ||
"typescript": "^1.8.0", | ||
"pre-push": "^0.1.1", | ||
"remap-istanbul": "^0.6.4", | ||
"shx": "^0.1.2", | ||
"ts-helpers": "^1.1.1", | ||
"tslint": "^5.3.2", | ||
"tslint-config-airbnb": "^5.0.1", | ||
"tsutils": "^2.1.0", | ||
"typedoc": "^0.7.1", | ||
"typescript": "^2.3.3", | ||
"webpack": "^1.12.12", | ||
"webpack-validator": "^2.1.3", | ||
"yuidoc-mediamonks-theme": "^2.0.2", | ||
"yuidocjs": "^0.10.0" | ||
"webpack-dev-server": "^1.16.2", | ||
"webpack-system-register": "^1.3.2", | ||
"webpack-validator": "^2.1.3" | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"tslib": "^1.2.0" | ||
} | ||
} |
@@ -15,15 +15,52 @@ [![Travis](https://img.shields.io/travis/mediamonks/seng-disposable.svg?maxAge=2592000)](https://travis-ci.org/mediamonks/seng-disposable) | ||
### yarn / npm | ||
```sh | ||
yarn add seng-disposable | ||
``` | ||
```sh | ||
npm i -S seng-disposable | ||
``` | ||
Or grab one of the following files from the `/dist/` folder for manual use: | ||
### other | ||
- **umd** (bundled with webpack) | ||
- **amd** (bundled with webpack) | ||
- **commonjs2** (bundled with webpack, but why don't you use npm?) | ||
- **browser** (bundled with webpack, available as `window.SengDisposable`) | ||
- **system** | ||
- **es6** | ||
We also have browser, amd, commonjs, umd, systemjs and es6 versions of | ||
this module available attached to the [Github Releases](https://github.com/mediamonks/seng-disposable/releases). | ||
<!--- | ||
Note: The below cannot be used yet, as there is no way to link to a | ||
specific version yet without updating this readme manually after each | ||
new version. | ||
### browser | ||
```html | ||
<script src="http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable.min.js"></script> | ||
``` | ||
```js | ||
console.log(window.SengDisposable) | ||
``` | ||
### other | ||
Besides the browser version, there are other versions available for | ||
download as well: | ||
- [browser](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable.js) (and [minified](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable.min.js)) | ||
- [umd](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable.js) (and [minified](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable-umd.min.js)) | ||
- [amd](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable-amd.js) | ||
- [commonjs](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable-commonjs.js) | ||
- [systemjs](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable-system.js) | ||
- [es6](http://mediamonks-development.s3.amazonaws.com/seng/libs/seng-disposable/1.2.0/seng-disposable-es6.zip) | ||
--> | ||
### manual | ||
Check the **build** section below to see your you can build for all the | ||
targets yourself. | ||
## Usage | ||
@@ -67,3 +104,3 @@ | ||
View the [generated documentation](https://rawgit.com/MediaMonks/seng-disposable/master/doc/typedoc/index.html). | ||
View the [generated documentation](http://mediamonks.github.io/seng-disposable/). | ||
@@ -78,3 +115,3 @@ | ||
```sh | ||
git clone https://github.com/MediaMonks/seng-disposable.git | ||
git clone https://github.com/mediamonks/seng-disposable.git | ||
``` | ||
@@ -89,3 +126,3 @@ | ||
```sh | ||
npm install | ||
yarn | ||
``` | ||
@@ -95,15 +132,34 @@ | ||
```sh | ||
npm run build # build this project (done on install) | ||
npm run typings # install .d.ts dependencies (done on install) | ||
npm test # run the tests | ||
npm validate # runs validation scripts, including test, lint and doc | ||
npm run lint # run tslint on this project | ||
npm run doc # generate typedoc and yuidoc documentation | ||
npm run typescript-npm # just compile the typescript output used in the npm module | ||
yarn build # build this project | ||
yarn dev # run dev-watch mode, serving example/index.html in the browser | ||
yarn generate # generate all artifacts (compiles ts, webpack, docs and coverage) | ||
yarn typings # install .d.ts dependencies (done on install) | ||
yarn test:unit # run the unit tests | ||
yarn validate # runs validation scripts, including test, lint and coverage check | ||
yarn lint # run tslint on this project | ||
yarn doc # generate typedoc documentation | ||
``` | ||
When installing this module, it adds a pre-commit hook, that runs the `validate` | ||
and `build` scripts before committing, so you can be sure that everything | ||
checks out and all files that should be committed are generated. | ||
When installing this module, it adds a pre-push hook, that runs the `validate` | ||
script before committing, so you can be sure that everything checks out. | ||
If you want to create the distribution files yourself, you can run the | ||
`build-dist` script, and the following files will get generated in the | ||
`dist` folder: | ||
- **/dist/seng-disposable.js**: bundled with webpack, can be loaded from | ||
a script tag, available as `window.SengDisposable` | ||
- **/dist/seng-disposable.min.js**: same as above, but minified | ||
- **/dist/seng-disposable-amd.js**: bundled with webpack, can be used | ||
with e.g. requirejs | ||
- **/dist/seng-disposable-commonjs.js**: bundled with webpack, can be | ||
used in systems that support commonjs, but you should just use npm | ||
- **/dist/seng-disposable-umd.js**: bundled with webpack, works in the | ||
browser, with requirejs, and in a commonjs system | ||
- **/dist/seng-disposable-umd.min.js**: same as above, but minified | ||
- **/dist/seng-disposable-system.js**: bundled with typescript, can be | ||
used in systems that support systemjs | ||
- **/dist/seng-disposable-es6.zip**: transpiled with typescript, only | ||
types are removed from the source files | ||
## Contribute | ||
@@ -110,0 +166,0 @@ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
175539
178
0
1
39
13
112
2
+ Addedtslib@^1.2.0
+ Addedtslib@1.14.1(transitive)