feat: improve monorepo dev experience

This commit is contained in:
2023-10-30 17:31:40 +01:00
parent f65fb52def
commit 8466976b3c
59 changed files with 157 additions and 2662 deletions

View File

@@ -25,6 +25,16 @@
],
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./schema.json": {
"import": "./lib/schema.json",
"types": "./lib/schema.d.ts"
}
},
"files": [
"lib",
"test/resources",
@@ -41,7 +51,6 @@
"test": "c8 mocha"
},
"dependencies": {
"@openstapps/core-tools": "workspace:*",
"@types/geojson": "1.0.6",
"fast-deep-equal": "3.1.3",
"http-status-codes": "2.2.0",

View File

@@ -12,7 +12,6 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {ValidationError} from '@openstapps/core-tools';
import {StatusCodes} from 'http-status-codes';
import {SCError} from '../error.js';
@@ -24,14 +23,14 @@ export class SCValidationErrorResponse extends SCError {
/**
* List of validatation errors
*/
additionalData: ValidationError[];
additionalData: unknown[]; // TODO
/**
* Create a SCValidationErrorResponse
* @param errors List of validation errors
* @param stack Set to true if a stack trace should be created
*/
constructor(errors: ValidationError[], stack?: boolean) {
constructor(errors: unknown[] /* TODO */, stack?: boolean) {
super('ValidationError', 'Validation of request failed', StatusCodes.BAD_REQUEST, stack);
this.additionalData = errors;
}

View File

@@ -1,3 +1,6 @@
{
"extends": "@openstapps/tsconfig"
"extends": "@openstapps/tsconfig",
"compilerOptions": {
"typeRoots": ["./node_modules/@openstapps/json-schema-generator/types"]
}
}

View File

@@ -10,7 +10,7 @@ export default defineConfig({
format: 'esm',
outDir: 'lib',
plugins: [
jsonSchemaPlugin('index.schema.json', elasticsearchMappingGenerator('elasticsearch.json')),
openapiPlugin('openapi.json', 'index.schema.json'),
jsonSchemaPlugin('schema.json', elasticsearchMappingGenerator('elasticsearch.json')),
openapiPlugin('openapi.json', 'schema.json'),
],
});