Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
chore(yttrex): added typescript as dep
Browse files Browse the repository at this point in the history
  • Loading branch information
ascariandrea committed Feb 10, 2022
1 parent e02c544 commit c0ed034
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
20 changes: 10 additions & 10 deletions YCAI/src/utils/endpoint.utils.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as Endpoints from '@trex/shared/endpoints';
import * as A from 'fp-ts/lib/Array';
import { pipe } from 'fp-ts/lib/function';
import * as R from 'fp-ts/lib/Record';
import * as S from 'fp-ts/lib/string';
import {
MinimalEndpointInstance,
TypeOfEndpointInstance,
TypeOfEndpointInstance
} from 'ts-endpoint/lib/helpers';
import * as R from 'fp-ts/lib/Record';
import { pipe } from 'fp-ts/lib/function';
import * as Endpoints from '@trex/shared/endpoints';
import * as S from 'fp-ts/lib/string';
import * as A from 'fp-ts/lib/Array';

export const getStaticPath = <E extends MinimalEndpointInstance>(
e: E,
Input: TypeOfEndpointInstance<E>['Input']
): string => {
const params = pipe(
Input?.Params ?? ({} as any),
(Input as any)?.Params ?? ({} as any),
R.mapWithIndex((i) => `:${i}`)
);
const path = e.getPath(params);
Expand All @@ -36,14 +36,14 @@ const allEndpoints = [
Endpoints.v3.Creator,
].flatMap(toArray);

export const fromStaticPath = (
export const fromStaticPath = <M extends MinimalEndpointInstance>(
staticPath?: string,
Params?: any
): MinimalEndpointInstance | undefined => {
): M | undefined => {
if (staticPath !== undefined) {
return allEndpoints.find((e) =>
S.Eq.equals(getStaticPath(e, Params), staticPath)
);
) as M;
}
return undefined;
};
4 changes: 2 additions & 2 deletions extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"path": "../packages/shared"
}
],
"include": ["./src", "./typings", "./webpack.config.ts"],
"exclude": ["./jest.config.js", "./webpack.config.ts"],
"include": ["."],
"exclude": ["jest.config.js", "webpack.config.js"],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
Expand Down
2 changes: 1 addition & 1 deletion guardoni/bin/guardoni-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const { GetGuardoniCLI } = require('../build/guardoni/cli.js');
const { GetGuardoniCLI } = require('../../build/ts/guardoni/src/cli.js');
const puppeteer = require('puppeteer');

const runGuardoni = ({
Expand Down
8 changes: 4 additions & 4 deletions guardoni/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"resolveJsonModule": true,
"typeRoots": ["../node_modules/@types", "node_modules/@types"]
},
"include": [".", "./package.json"],
"include": ["."],
"exclude": [
"reload.js",
"node_modules",
"bin",
"build",
"dist",
"jest.config.js",
"webpack.config.ts"
"package.json",
"webpack.config.ts",
"reload.js"
],
"watchOptions": {
"watchFile": "useFsEvents",
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
"compilerOptions": {
"baseUrl": "./",
"noEmit": true,
"module": "esnext",
"jsx": "react",
"skipLibCheck": true,
"lib": ["dom", "ESNext"],
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"target": "es5",
"typeRoots": [
"./node_modules/@types",
"./packages/shared/node_modules/@types",
Expand All @@ -13,6 +19,7 @@
]
},
"include": [
"./typings",
"./config/typescript/**/*",
"./packages/shared/**/*",
"./packages/taboule/**/*",
Expand Down

0 comments on commit c0ed034

Please sign in to comment.