Skip to content

Commit

Permalink
update dependencies, remove cli (unused)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnste committed Jan 8, 2024
1 parent fe52370 commit 64a4351
Show file tree
Hide file tree
Showing 7 changed files with 1,382 additions and 2,799 deletions.
8 changes: 3 additions & 5 deletions config-api/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ module.exports = {
testEnvironment: "node",

testPathIgnorePatterns: ["/node_modules/", "src/fastidious/"],
globals: {
"ts-jest": {
diagnostics: true
}
}
transform: {
"^.+\\.ts$": ["ts-jest"],
},
};
18 changes: 7 additions & 11 deletions config-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,17 @@
"scripts": {
"build-api": "npx esbuild --global-name=finickyConfigApi --bundle src/index.ts --outfile=dist/finickyConfigAPI.js --target=es2016 --format=iife && cp ./dist/finickyConfigAPI.js ../Finicky/Finicky/finickyConfigAPI.js",
"build": "yarn build-api",
"cli": "ts-node ./src/cli.ts",
"test": "yarn jest"
},
"devDependencies": {
"@types/chalk": "^2.2.0",
"@types/jest": "^26.0.20",
"@types/node": "^14.0.1",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.7",
"@types/url-parse": "^1.4.3",
"chalk": "^4.0.0",
"esbuild": "^0.8.33",
"jest": "^26.6.3",
"prettier": "^2.0.5",
"ts-jest": "^26.4.4",
"ts-node": "^9.1.1",
"typescript": "^4.1.3",
"esbuild": "^0.19.11",
"jest": "^29.7.0",
"prettier": "^3.1.1",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3",
"url-parse": "^1.5.0"
},
"dependencies": {}
Expand Down
63 changes: 0 additions & 63 deletions config-api/src/cli.ts

This file was deleted.

5 changes: 5 additions & 0 deletions config-api/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ConfigAPI } from "./types";

declare global {
var finicky: ConfigAPI;
}
9 changes: 4 additions & 5 deletions config-api/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ export function validateSchema(
*/
export function deprecate<T extends Object>(
target: T,
deprecated: Map<keyof T, string>
deprecated: Map<string, string>
): T {
const handler = {
get: function (target: T, prop: keyof T, receiver?: any) {
const handler: ProxyHandler<T> = {
get: function (target: T, prop: string, receiver?: any) {
if (deprecated.has(prop)) {
// @ts-ignore
finicky.log("⚠️", prop, "is deprecated: ", deprecated.get(prop));
finicky.log("⚠️", prop, "is deprecated: ", deprecated.get(prop) || "");
}

return Reflect.get(target, prop, receiver);
Expand Down
6 changes: 3 additions & 3 deletions config-api/test/processUrl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe("Rewrites", () => {
}),
});
const result = processUrl(config, "https://test.example", processOptions);
expect(result.url).toBe("https://test2.example");
expect(result.url).toBe("https://test2.example/");
});
});

Expand All @@ -136,15 +136,15 @@ describe("Rewrites", () => {
test("Protocol change", () => {
const config = createRewriteConfig({ urlResult: { protocol: "ftp" } });
const result = processUrl(config, "http://example.com", processOptions);
expect(result.url).toBe("ftp://example.com");
expect(result.url).toBe("ftp://example.com/");
});

test("Hostname change", () => {
const config = createRewriteConfig({
urlResult: { host: "example.org" },
});
const result = processUrl(config, "http://example.com", processOptions);
expect(result.url).toBe("http://example.org");
expect(result.url).toBe("http://example.org/");
});

test("Multiple change", () => {
Expand Down

0 comments on commit 64a4351

Please sign in to comment.