Add back types absolute fixer

This commit is contained in:
Dolan Miu
2021-09-28 19:56:29 +01:00
parent 1f078e0687
commit 536204e5ef
4 changed files with 7 additions and 9 deletions

View File

@ -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",

View File

@ -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}"`;
},

View File

@ -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",

View File

@ -13,9 +13,9 @@
"noUnusedParameters": true,
"baseUrl": "./src",
"paths": {
"/*": ["./*"],
"convenience-functions": ["./convenience-functions"],
"@export/*": ["./export/*"]
"@export/*": ["./export/*"],
"file/*": ["./file/*"]
}
},
"include": ["src"]