Skip to content

Commit 2dec475

Browse files
committed
Updated package.json
- Removed tsconfig from test script - Updated main and types to point the correct files - Moved the cheerio require to the module level so rewire can replace it.
1 parent 7ba7a40 commit 2dec475

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/url-utils/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
},
99
"author": "Ghost Foundation",
1010
"license": "MIT",
11-
"main": "cjs/UrlUtils.js",
12-
"types": "types/src/UrlUtils.d.ts",
13-
"source": "src/UrlUtils.ts",
11+
"main": "index.js",
12+
"types": "cjs/UrlUtils.d.ts",
1413
"scripts": {
1514
"dev": "echo \"Implement me!\"",
1615
"pretest": "yarn build",
17-
"test": "NODE_ENV=testing TS_NODE_PROJECT=tsconfig.test.json c8 --src src --all --reporter text --reporter cobertura --reporter html mocha -r ts-node/register './test/**/*.test.js'",
16+
"test": "NODE_ENV=testing c8 --src src --all --reporter text --reporter cobertura --reporter html mocha -r ts-node/register './test/**/*.test.js'",
1817
"build": "tsc -p tsconfig.json",
1918
"lint": "eslint . --ext .js,.ts --cache",
2019
"prepare": "NODE_ENV=production yarn build",
@@ -23,7 +22,6 @@
2322
"files": [
2423
"src/",
2524
"cjs/",
26-
"types/",
2725
"index.js"
2826
],
2927
"publishConfig": {

packages/url-utils/src/utils/html-transform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// @ts-nocheck
2+
const cheerio = require('cheerio');
3+
24
function escapeRegExp(string) {
35
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
46
}
@@ -29,7 +31,6 @@ function htmlTransform(html = '', siteUrl, transformFunction, itemPath, _options
2931
return html;
3032
}
3133

32-
const cheerio = require('cheerio');
3334
const htmlContent = cheerio.load(html, {decodeEntities: false});
3435

3536
// replacements is keyed with the attr name + original relative value so

0 commit comments

Comments
 (0)