Skip to content

Commit

Permalink
Merge 89c9288 into b36b210
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Jan 7, 2023
2 parents b36b210 + 89c9288 commit adc7d00
Show file tree
Hide file tree
Showing 8 changed files with 1,967 additions and 6,024 deletions.
20 changes: 16 additions & 4 deletions jest.config.js
@@ -1,6 +1,18 @@
module.exports = {
roots: ["<rootDir>/src"],
export default {
roots: ["spec"],
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
"^.+\\.tsx?$": "ts-jest"
}
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
};
7,857 changes: 1,882 additions & 5,975 deletions package-lock.json

Large diffs are not rendered by default.

78 changes: 43 additions & 35 deletions package.json
Expand Up @@ -2,29 +2,37 @@
"name": "fanger",
"version": "0.3.0",
"description": "Defang and refang IoC",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"node": "./dist/index.cjs",
"default": "./dist/index.js"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"bin": {
"defang": "./dist/bin/defang.js",
"refang": "./dist/bin/refang.js"
},
"files": [
"dist"
],
"scripts": {
"prepare": "npm run build",
"build": "tsc",
"watch": "tsc -w",
"build": "tsup src --format cjs,esm --dts --clean",
"watch": "npm run build -- --watch src",
"test": "jest",
"coverage": "jest --coverage",
"lint": "eslint src --ext .ts",
"lint:fix": "npm run lint -- --fix",
"prettier": "prettier src/**/*.ts",
"prettier:write": "prettier --write src/**/*.ts",
"postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable"
},
"bin": {
"defang": "dist/bin/defang.js",
"refang": "dist/bin/refang.js"
"prepare": "husky install"
},
"lint-staged": {
"*.ts": [
"npm run lint:fix"
"npm run lint -- --fix"
]
},
"repository": {
Expand All @@ -38,29 +46,29 @@
},
"homepage": "https://github.com/ninoseki/fanger#readme",
"devDependencies": {
"@types/jest": "^28.1.4",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.30.3",
"@typescript-eslint/parser": "^5.30.3",
"@types/jest": "^29.2.5",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"coveralls": "^3.1.1",
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.5.3",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"husky": "^8.0.1",
"jest": "^28.1.2",
"lint-staged": "^13.0.3",
"pinst": "^3.0.0",
"prettier": "^2.7.1",
"ts-jest": "^28.0.5",
"ts-loader": "^9.3.1",
"ts-node": "^10.8.2",
"typescript": "^4.7.4"
"eslint-plugin-simple-import-sort": "^8.0.0",
"husky": "^8.0.3",
"jest": "^29.3.1",
"lint-staged": "^13.1.0",
"prettier": "^2.8.1",
"ts-jest": "^29.0.3",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsup": "^6.5.0",
"typescript": "^4.9.4"
},
"dependencies": {
"escape-string-regexp": "4.0.0",
"get-stdin": "8.0.0",
"ioc-extractor": "4.1.0"
"get-stdin": "9.0.0",
"ioc-extractor": "5.0.3"
}
}
2 changes: 1 addition & 1 deletion src/spec/defang.spec.ts → spec/defang.spec.ts
@@ -1,4 +1,4 @@
import { defang } from "../index";
import { defang } from "@/index";

describe("defang", () => {
it.each([
Expand Down
2 changes: 1 addition & 1 deletion src/spec/refang.spec.ts → spec/refang.spec.ts
@@ -1,4 +1,4 @@
import { refang } from "../index";
import { refang } from "@/index";

describe("refang", () => {
it.each([
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
@@ -1,7 +1,6 @@
import escapeStringRegexp from "escape-string-regexp";
import { extractIPv4s, refang as _refang } from "ioc-extractor";
import { extractDomains } from "ioc-extractor";
import { dedup, sortByValue } from "ioc-extractor/dist/src/aux/auxiliary";

import { tlds } from "./tlds";

Expand Down
2 changes: 1 addition & 1 deletion src/tlds.ts
@@ -1,3 +1,3 @@
import { getTLDs } from "ioc-extractor/dist/src/aux/tlds";
import { getTLDs } from "ioc-extractor/dist/aux/tlds";

export const tlds: string[] = getTLDs();
29 changes: 23 additions & 6 deletions tsconfig.json
@@ -1,15 +1,32 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"target": "esnext",
"module": "esnext",
"noImplicitAny": false,
"sourceMap": true,
"declaration": true,
"strict": true,
"rootDir": "src",
"rootDirs": [
"src",
"spec"
],
"outDir": "dist",
"noEmitOnError": true,
"esModuleInterop": true
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext"
],
"moduleResolution": "node",
"esModuleInterop": true,
"isolatedModules": true,
},
"exclude": ["node_modules", "dist"]
}
"exclude": [
"node_modules",
"dist"
]
}

0 comments on commit adc7d00

Please sign in to comment.