Skip to content

Commit

Permalink
feat: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
bgatellier committed Jun 1, 2024
1 parent 6bb68d9 commit 645c15a
Show file tree
Hide file tree
Showing 31 changed files with 270 additions and 96 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ common/autoinstallers/*/.npmrc

# MikroORM temporary directory
modules/*/temp
test/temp
# moon
.moon/cache
.moon/docker
test/temp
# moon
.moon/cache
.moon/docker

*.tsbuildinfo
2 changes: 1 addition & 1 deletion modules/_abandoned/bigquery/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"removeComments": true
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
2 changes: 1 addition & 1 deletion modules/_abandoned/dareboost/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"outDir": "lib"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
5 changes: 3 additions & 2 deletions modules/api/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
24 changes: 20 additions & 4 deletions modules/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",

"include": ["src/**/*.ts", "tests/**/*.ts"]
"extends": "../../tsconfig.options.json",
"include": [
"src/**/*.ts",
"tests/**/*.ts"
],
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "../cli"
},
{
"path": "../common"
}
]
}
5 changes: 3 additions & 2 deletions modules/cli/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
22 changes: 16 additions & 6 deletions modules/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",

"extends": "../../tsconfig.options.json",
"compilerOptions": {
"esModuleInterop": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts", "tests/**/*.ts"]
"include": [
"src/**/*.ts",
"tests/**/*.ts"
],
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "../common"
}
]
}
2 changes: 1 addition & 1 deletion modules/common/src/error/InputError.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ErrorObject } from "ajv"

export class InputError extends Error {
cause: ErrorObject[] = []
override cause: ErrorObject[] = []

constructor(errors: ErrorObject[]) {
super("Something went wrong with the input validation")
Expand Down
5 changes: 3 additions & 2 deletions modules/common/src/time/timeout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* This is Promise wrapper of the setTimeout() function.
*/
export const timeout = (delay: number): Promise<object> =>
new Promise((resolve) => setTimeout(resolve, delay))
export const timeout = (delay: number): Promise<void> =>
new Promise((resolve) => setTimeout(() => {
resolve() }, delay))
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { SchemaObject } from "ajv"
import type { ModuleMetadata, ValidatedAnalysisInput } from "../../../index.js"
import { validateInput } from "../InputValidation.js"
import configSchema from "./schema/config.json" assert { type: "json" }
import thresholdSchema from "./schema/threshold.json" assert { type: "json" }
import verboseSchema from "../schema/verbose.json" assert { type: "json" }
import configSchema from "./schema/config.json" with { type: "json" }
import thresholdSchema from "./schema/threshold.json" with { type: "json" }
import verboseSchema from "../schema/verbose.json" with { type: "json" }

export function getAnalysisValidationSchema(listenerModulesIds: ModuleMetadata["id"][]): SchemaObject {
const listenerSchema = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { SchemaObject } from "ajv"
import type { ValidatedServerInput } from "../../../input/ServerInput.js"
import { validateInput } from "../InputValidation.js"
import corsSchema from "./schema/cors.json" assert { type: "json" }
import portSchema from "./schema/port.json" assert { type: "json" }
import verboseSchema from "../schema/verbose.json" assert { type: "json" }
import corsSchema from "./schema/cors.json" with { type: "json" }
import portSchema from "./schema/port.json" with { type: "json" }
import verboseSchema from "../schema/verbose.json" with { type: "json" }

function getValidationSchema(): SchemaObject {
return {
Expand Down
5 changes: 3 additions & 2 deletions modules/common/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts", "*.json"]
}
14 changes: 10 additions & 4 deletions modules/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",
"extends": "../../tsconfig.options.json",

"compilerOptions": {
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"resolveJsonModule": true
"resolveJsonModule": true,
},

"include": ["src/**/*.ts", "tests/**/*.ts"]
}
"references": [
{
"path": "./tsconfig.build.json"
}
],

"include": ["src/**/*", "tests/**/*", "*.ts", "*.json"]
}
2 changes: 1 addition & 1 deletion modules/greenit/tests/GreenITModule.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ModuleMetadata } from "@fabernovel/heart-common"
import { jest } from "@jest/globals"
import { Conf } from "./data/Conf.js"
import SuccessResult from "./data/SuccessResult.json" assert { type: "json" }
import SuccessResult from "./data/SuccessResult.json" with { type: "json" }

jest.unstable_mockModule("greenit-cli/cli-core/analysis.js", () => ({
createJsonReports: jest.fn(),
Expand Down
5 changes: 3 additions & 2 deletions modules/greenit/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
25 changes: 19 additions & 6 deletions modules/greenit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",

"extends": "../../tsconfig.options.json",
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true
"esModuleInterop": true,
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts", "tests/**/*.ts"]
"include": [
"src/**/*.ts",
"tests/**/*.ts"
],
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "../cli"
},
{
"path": "../common"
}
]
}
5 changes: 3 additions & 2 deletions modules/lighthouse/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

"compilerOptions": {
"esModuleInterop": false,
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
25 changes: 19 additions & 6 deletions modules/lighthouse/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",

"extends": "../../tsconfig.options.json",
"compilerOptions": {
"esModuleInterop": true
"esModuleInterop": true,
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts", "tests/**/*.ts"]
"include": [
"src/**/*.ts",
"tests/**/*.ts"
],
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "../cli"
},
{
"path": "../common"
}
]
}
5 changes: 3 additions & 2 deletions modules/mysql/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
25 changes: 19 additions & 6 deletions modules/mysql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",

"extends": "../../tsconfig.options.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts", "tests/**/*.ts"]
"include": [
"src/**/*.ts",
"tests/**/*.ts"
],
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "../cli"
},
{
"path": "../common"
}
]
}
5 changes: 3 additions & 2 deletions modules/observatory/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

"compilerOptions": {
"esModuleInterop": false,
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
25 changes: 19 additions & 6 deletions modules/observatory/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"$schema": "http://json.schemastore.org/tsconfig",

"extends": "../tsconfig.json",

"extends": "../../tsconfig.options.json",
"compilerOptions": {
"esModuleInterop": true
"esModuleInterop": true,
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts", "tests/**/*.ts"]
"include": [
"src/**/*.ts",
"tests/**/*.ts"
],
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "../cli"
},
{
"path": "../common"
}
]
}
5 changes: 3 additions & 2 deletions modules/slack/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"extends": "./tsconfig.json",

"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},

"include": ["src/**/*.ts"]
"include": ["src/**/*", "*.ts"]
}
Loading

0 comments on commit 645c15a

Please sign in to comment.