Publish typings with npm package

This commit is contained in:
zoehneto
2018-03-29 11:18:11 +02:00
parent d72753b559
commit 5263db8088
17 changed files with 68 additions and 32 deletions
+1
View File
@@ -2,3 +2,4 @@ node_modules/
.idea/
.nyc_output/
coverage/
dist/src
+3
View File
@@ -1,5 +1,8 @@
# Change Log
## [2.2] - 2018-03-29
- Publish typings with npm package
## [2.1] - 2018-03-28
- support importing rtf.js as a module
- rtf.js is now published on npm: https://www.npmjs.com/package/rtf.js
Generated Vendored
+1 -3
View File
@@ -3194,7 +3194,7 @@ var Pen = /** @class */ (function (_super) {
/*!****************************!*\
!*** ./src/emfjs/index.ts ***!
\****************************/
/*! exports provided: Error, loggingEnabled, Renderer, EMF */
/*! exports provided: Renderer, Error, loggingEnabled */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -3206,8 +3206,6 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Renderer */ "./src/emfjs/Renderer.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return _Renderer__WEBPACK_IMPORTED_MODULE_2__["Renderer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EMF", function() { return _Renderer__WEBPACK_IMPORTED_MODULE_2__["EMF"]; });
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Helper */ "./src/emfjs/Helper.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Error", function() { return _Helper__WEBPACK_IMPORTED_MODULE_3__["EMFJSError"]; });
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -7
View File
@@ -3104,7 +3104,7 @@ var WMFRecords = /** @class */ (function () {
/*!****************************!*\
!*** ./src/wmfjs/index.ts ***!
\****************************/
/*! exports provided: Error, loggingEnabled, Renderer, WMFRect16, WMFPlacable, WMF */
/*! exports provided: Renderer, Error, loggingEnabled */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -3116,12 +3116,6 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Renderer */ "./src/wmfjs/Renderer.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return _Renderer__WEBPACK_IMPORTED_MODULE_2__["Renderer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WMFRect16", function() { return _Renderer__WEBPACK_IMPORTED_MODULE_2__["WMFRect16"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WMFPlacable", function() { return _Renderer__WEBPACK_IMPORTED_MODULE_2__["WMFPlacable"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WMF", function() { return _Renderer__WEBPACK_IMPORTED_MODULE_2__["WMF"]; });
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Helper */ "./src/wmfjs/Helper.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Error", function() { return _Helper__WEBPACK_IMPORTED_MODULE_3__["WMFJSError"]; });
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+6 -5
View File
@@ -24,8 +24,9 @@ SOFTWARE.
*/
const RTFJS = require('./dist/RTFJS.bundle');
const EMFJS = require('./dist/EMFJS.bundle');
const WMFJS = require('./dist/WMFJS.bundle');
module.exports = { RTFJS, EMFJS, WMFJS };
import * as RTFJS from './dist/RTFJS.bundle';
export { RTFJS };
import * as EMFJS from './dist/EMFJS.bundle';
export { EMFJS };
import * as WMFJS from './dist/WMFJS.bundle';
export { WMFJS };
+3 -1
View File
@@ -3,6 +3,7 @@
"version": "2.1.0",
"description": "Render RTF documents in HTML. This also includes rendering WMF and EMF images which are often contained in RTF documents.",
"main": "index.js",
"types": "./dist/src",
"scripts": {
"lint": "tslint --project tsconfig.json",
"fix": "tslint --project tsconfig.json --fix",
@@ -14,7 +15,8 @@
"coverage": "npm run clean && webpack --config webpack/coverage.config.js --progress && nyc mocha test/test-rtfjs.js",
"coverage-html": "rimraf coverage && nyc report --reporter html",
"coverage-coveralls": "nyc report --reporter text-lcov | coveralls",
"typewiz": "npm run clean && webpack --config webpack/typewiz.config.js --progress && npm run test"
"typewiz": "npm run clean && webpack --config webpack/typewiz.config.js --progress && npm run test",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
+1 -1
View File
@@ -27,5 +27,5 @@ SOFTWARE.
import "jquery.svg";
import "jquery.svgfilter";
export * from "./Renderer";
export { Renderer, IRendererSettings } from "./Renderer";
export { EMFJSError as Error, loggingEnabled } from "./Helper";
+34
View File
@@ -0,0 +1,34 @@
/*
The MIT License (MIT)
Copyright (c) 2018 Tom Zoehner
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.
*/
import * as RTFJS from './rtfjs/index';
export { RTFJS };
import * as EMFJS from './emfjs/index';
export { EMFJS };
import * as WMFJS from './wmfjs/index';
export { WMFJS };
+2 -7
View File
@@ -27,14 +27,9 @@ SOFTWARE.
import { RTFJSError } from "./Helper";
import { IColor } from "./parser/destinations/ColortblDestinations";
import { FonttblDestinationSub } from "./parser/destinations/FonttblDestinations";
import { IContainerElement, Renderer } from "./renderer/Renderer";
import { Renderer } from "./renderer/Renderer";
import { ISettings } from "./DocumentFacade";
export interface ISettings {
onHyperlink?(create: () => void, hyperlink: {url: () => string}): IContainerElement;
onPicture?(isLegacy: boolean, create: () => void): JQuery;
onImport?(relUrls: string, callback: (data: {error?: Error, keyword?: string, blob?: ArrayBuffer,
width?: number, height?: number}) => void): void;
}
export class Document {
public _settings: ISettings;
public _meta: {[key: string]: any};
+9 -2
View File
@@ -24,10 +24,17 @@ SOFTWARE.
*/
import { Document, ISettings } from "./Document";
import { Document } from "./Document";
import { RTFJSError } from "./Helper";
import { Parser } from "./parser/Parser";
import { Renderer } from "./renderer/Renderer";
import {IContainerElement, Renderer} from "./renderer/Renderer";
export interface ISettings {
onHyperlink?(create: () => void, hyperlink: {url: () => string}): IContainerElement;
onPicture?(isLegacy: boolean, create: () => void): JQuery;
onImport?(relUrls: string, callback: (data: {error?: Error, keyword?: string, blob?: ArrayBuffer,
width?: number, height?: number}) => void): void;
}
export class DocumentFacade {
private _document: Document;
+1 -1
View File
@@ -24,5 +24,5 @@ SOFTWARE.
*/
export { DocumentFacade as Document } from "./DocumentFacade";
export { DocumentFacade as Document, ISettings } from "./DocumentFacade";
export { RTFJSError as Error, loggingEnabled } from "./Helper";
+1 -1
View File
@@ -26,5 +26,5 @@ SOFTWARE.
import "jquery.svg";
import "jquery.svgfilter";
export * from "./Renderer";
export { Renderer, IRendererSettings } from "./Renderer";
export { WMFJSError as Error, loggingEnabled } from "./Helper";
+1
View File
@@ -6,6 +6,7 @@
"moduleResolution": "node",
"module": "es2015",
"sourceMap": true,
"declaration": true,
"alwaysStrict": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = {
entry: {
EMFJS: './src/emfjs/index.ts',
RTFJS: './src/rtfjs/index.ts',
WMFJS: './src/wmfjs/index.ts'
WMFJS: './src/wmfjs/index.ts',
},
devtool: 'source-map',
resolve: {