diff --git a/package.json b/package.json index 61a702e773..96c31acb6a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test.watch": "npm test -- --watch", "prepublishOnly": "npm run build --production", "lint": "tslint --project .", - "build": "npm run webpack", + "build": "npm run webpack && npm run fix-types", "webpack": "rimraf ./build && webpack --config ./webpack.config.ts", "demo": "npm run build && npm run ts-node --skip-project ./demo", "typedoc": "rimraf ./build && typedoc src/index.ts --tsconfig tsconfig.typedoc.json", diff --git a/scripts/types-absolute-fixer.ts b/scripts/types-absolute-fixer.ts index e7787e387f..6eea3c600e 100644 --- a/scripts/types-absolute-fixer.ts +++ b/scripts/types-absolute-fixer.ts @@ -1,18 +1,16 @@ import * as glob from "glob"; -import * as replace from "replace-in-file"; +import { replaceInFile } from "replace-in-file"; const files = glob.sync("build/**/*.d.ts"); for (const file of files) { - replace({ + replaceInFile({ files: file, from: /"file[a-z/-]*"/gi, to: (match) => { const matchSlug = match.replace(/['"]+/g, "").trim(); const levelCount = file.split("/").length - 2; - const backLevels = Array(levelCount) - .fill("../") - .join(""); + const backLevels = Array(levelCount).fill("../").join(""); return `"${backLevels}${matchSlug}"`; }, diff --git a/src/file/paragraph/frame/frame-properties.ts b/src/file/paragraph/frame/frame-properties.ts index 4a6b5a5505..bcf3b6ac02 100644 --- a/src/file/paragraph/frame/frame-properties.ts +++ b/src/file/paragraph/frame/frame-properties.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPparagraph-textFrames.php +import { HeightRule } from "file"; import { HorizontalPositionAlign, VerticalPositionAlign } from "file/shared/alignment"; import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; -import { HeightRule } from "/file"; export enum DropCapType { NONE = "none", diff --git a/tsconfig.json b/tsconfig.json index 48aabc1b3a..277a2eb2dd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,9 +13,9 @@ "noUnusedParameters": true, "baseUrl": "./src", "paths": { - "/*": ["./*"], "convenience-functions": ["./convenience-functions"], - "@export/*": ["./export/*"] + "@export/*": ["./export/*"], + "file/*": ["./file/*"] } }, "include": ["src"]