Update dependencies

This commit is contained in:
Piotr Rogowski 2023-09-11 16:34:31 +02:00
parent cc4e710521
commit 0a13120199
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
5 changed files with 87 additions and 71 deletions

79
package-lock.json generated
View File

@ -9,7 +9,7 @@
"version": "0.7.6", "version": "0.7.6",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@hyper-tuner/types": "^0.4.2", "@hyper-tuner/types": "git+https://github.com/hyper-tuner/types.git",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"parsimmon": "^1.18.1" "parsimmon": "^1.18.1"
}, },
@ -18,22 +18,21 @@
}, },
"devDependencies": { "devDependencies": {
"@types/js-yaml": "^4.0.5", "@types/js-yaml": "^4.0.5",
"@types/node": "^18.14.4", "@types/node": "^20.6.0",
"@types/parsimmon": "^1.10.6", "@types/parsimmon": "^1.10.6",
"rome": "^11.0.0", "rome": "^12.1.3",
"typescript": "^4.9.5" "typescript": "^5.2.2"
} }
}, },
"node_modules/@hyper-tuner/types": { "node_modules/@hyper-tuner/types": {
"version": "0.4.2", "version": "0.4.2",
"resolved": "https://npm.pkg.github.com/download/@hyper-tuner/types/0.4.2/05d62b0f9d876b4ba411c892e27af41ae097abb9", "resolved": "git+ssh://git@github.com/hyper-tuner/types.git#ce82322cf79b1a4c569723932b06f514a53a2e09",
"integrity": "sha512-jHspEqVLBufTPbkf3rZx+xm4w4U6D8CxZ1ZKad/sP2c+7QW7LbsXbLeVmGQNVEEUg178GjtQ/+g6HZx1XbYIOA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@rometools/cli-darwin-arm64": { "node_modules/@rometools/cli-darwin-arm64": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-11.0.0.tgz", "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-12.1.3.tgz",
"integrity": "sha512-F3vkdY+s3FLIEnAjSbyHTuIPB88cLpccimW4ecid5I7S6GzGG3iUJI4xT00JhH73K4P/qW20/9r+kH1T9Du8Xg==", "integrity": "sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -44,9 +43,9 @@
] ]
}, },
"node_modules/@rometools/cli-darwin-x64": { "node_modules/@rometools/cli-darwin-x64": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-11.0.0.tgz", "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-12.1.3.tgz",
"integrity": "sha512-X6jhtS6Iml4GOzgNtnLwIp/KXXhSdqeVyfv69m/AHnIzx3gQAjPZ7BPnJLvTCbhe4SKHL+uTZYFSCJpkUUKE6w==", "integrity": "sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -57,9 +56,9 @@
] ]
}, },
"node_modules/@rometools/cli-linux-arm64": { "node_modules/@rometools/cli-linux-arm64": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-11.0.0.tgz", "resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-12.1.3.tgz",
"integrity": "sha512-dktTJJlTpmycBZ2TwhJBcAO8ztK8DdevdyZnFFxdYRvtmJgTjIsC2UFayf/SbKew8B8q1IhI0it+D6ihAeIpeg==", "integrity": "sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -70,9 +69,9 @@
] ]
}, },
"node_modules/@rometools/cli-linux-x64": { "node_modules/@rometools/cli-linux-x64": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-11.0.0.tgz", "resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-12.1.3.tgz",
"integrity": "sha512-WVcnXPNdWGUWo0p4NU8YzuthjYR7q+b4vRcjdxtP1DlpphZmSsoC/RSE85nEqRAz8hChcKUansVzOPM8BSsuGA==", "integrity": "sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -83,9 +82,9 @@
] ]
}, },
"node_modules/@rometools/cli-win32-arm64": { "node_modules/@rometools/cli-win32-arm64": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-11.0.0.tgz", "resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-12.1.3.tgz",
"integrity": "sha512-tPj6RThQzS7Q45jqQll7NlTYvNcsg/BEP3LYiiazqSh9FAFnMkrV6ewUcMPKWyAfiyLs7jlz4rRvdNRUSygzfQ==", "integrity": "sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -96,9 +95,9 @@
] ]
}, },
"node_modules/@rometools/cli-win32-x64": { "node_modules/@rometools/cli-win32-x64": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-11.0.0.tgz", "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3.tgz",
"integrity": "sha512-bmBai8WHxYjsGk1+je7ZTfCUCWq30WJI3pQM8pzTA674lfGTZ9ymJoZwTaIMSO4rL5V9mlO6uLunsBKso9VqOg==", "integrity": "sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -115,9 +114,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.14.4", "version": "20.6.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.4.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz",
"integrity": "sha512-VhCw7I7qO2X49+jaKcAUwi3rR+hbxT5VcYF493+Z5kMLI0DL568b7JI4IDJaxWFH0D/xwmGJNoXisyX+w7GH/g==", "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==",
"dev": true "dev": true
}, },
"node_modules/@types/parsimmon": { "node_modules/@types/parsimmon": {
@ -148,9 +147,9 @@
"integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==" "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw=="
}, },
"node_modules/rome": { "node_modules/rome": {
"version": "11.0.0", "version": "12.1.3",
"resolved": "https://registry.npmjs.org/rome/-/rome-11.0.0.tgz", "resolved": "https://registry.npmjs.org/rome/-/rome-12.1.3.tgz",
"integrity": "sha512-rRo6JOwpMLc3OkeTDRXkrmrDqnxDvZ75GS4f0jLDBNmRgDXWbu0F8eVnJoRn+VbK2AE7vWvhVOMBjnWowcopkQ==", "integrity": "sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"bin": { "bin": {
@ -160,25 +159,25 @@
"node": ">=14.*" "node": ">=14.*"
}, },
"optionalDependencies": { "optionalDependencies": {
"@rometools/cli-darwin-arm64": "11.0.0", "@rometools/cli-darwin-arm64": "12.1.3",
"@rometools/cli-darwin-x64": "11.0.0", "@rometools/cli-darwin-x64": "12.1.3",
"@rometools/cli-linux-arm64": "11.0.0", "@rometools/cli-linux-arm64": "12.1.3",
"@rometools/cli-linux-x64": "11.0.0", "@rometools/cli-linux-x64": "12.1.3",
"@rometools/cli-win32-arm64": "11.0.0", "@rometools/cli-win32-arm64": "12.1.3",
"@rometools/cli-win32-x64": "11.0.0" "@rometools/cli-win32-x64": "12.1.3"
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "4.9.5", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
}, },
"engines": { "engines": {
"node": ">=4.2.0" "node": ">=14.17"
} }
} }
} }

View File

@ -21,19 +21,20 @@
"start": "tsc --watch", "start": "tsc --watch",
"generate": "npm run build && node test/test.js generate", "generate": "npm run build && node test/test.js generate",
"test": "npm run build && node test/test.js", "test": "npm run build && node test/test.js",
"lint": "tsc && rome ci src", "lint": "tsc && npm run lint:rome",
"lint:rome": "rome ci src",
"lint:fix": "rome format --write src && rome check --apply src", "lint:fix": "rome format --write src && rome check --apply src",
"lint:fix:suggested": "rome check --apply-suggested src" "lint:fix:unsafe": "rome check --apply-unsafe src"
}, },
"devDependencies": { "devDependencies": {
"@types/js-yaml": "^4.0.5", "@types/js-yaml": "^4.0.5",
"@types/node": "^18.14.4", "@types/node": "^20.6.0",
"@types/parsimmon": "^1.10.6", "@types/parsimmon": "^1.10.6",
"rome": "^11.0.0", "rome": "^12.1.3",
"typescript": "^4.9.5" "typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"@hyper-tuner/types": "^0.4.2", "@hyper-tuner/types": "git+https://github.com/hyper-tuner/types.git",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"parsimmon": "^1.18.1" "parsimmon": "^1.18.1"
} }

View File

@ -18,12 +18,25 @@
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true, "all": true,
"correctness": {
"all": true,
"noUnusedVariables": "warn"
},
"style": { "style": {
"noImplicitBoolean": "off" "all": true,
"noImplicitBoolean": "off",
"useEnumInitializers": "off",
"noNonNullAssertion": "off"
}, },
"suspicious": { "suspicious": {
"all": true,
"noExplicitAny": "off" "noExplicitAny": "off"
},
"nursery": {
"all": true,
"useExhaustiveDependencies": "off",
"noForEach": "off"
} }
} }
} }

View File

@ -64,10 +64,11 @@ switch (command) {
break; break;
} }
default: default: {
console.info( console.info(
`❗️ Unknown command: ${command}, please use one of: [${Object.values(Commands).join(', ')}]`, `❗️ Unknown command: ${command}, please use one of: [${Object.values(Commands).join(', ')}]`,
); );
process.exit(1); process.exit(1);
break; break;
}
} }

View File

@ -483,9 +483,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) { if (!this.currentCurve) {
throw new Error('Curve not set'); throw new Error('Curve not set');
} }
this.result.curves[this.currentCurve].xAxis = xAxisResult.value.values.map((val: string) => this.result.curves[this.currentCurve].xAxis = xAxisResult.value.values.map((val: string) => {
INI.isNumber(val) ? Number(val) : INI.sanitize(val), return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
); });
return; return;
} }
@ -495,9 +495,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) { if (!this.currentCurve) {
throw new Error('Curve not set'); throw new Error('Curve not set');
} }
this.result.curves[this.currentCurve].yAxis = yAxisResult.value.values.map((val: string) => this.result.curves[this.currentCurve].yAxis = yAxisResult.value.values.map((val: string) => {
INI.isNumber(val) ? Number(val) : INI.sanitize(val), return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
); });
return; return;
} }
@ -507,9 +507,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) { if (!this.currentCurve) {
throw new Error('Curve not set'); throw new Error('Curve not set');
} }
this.result.curves[this.currentCurve].xBins = xBinsResult.value.values.map((val: string) => this.result.curves[this.currentCurve].xBins = xBinsResult.value.values.map((val: string) => {
INI.isNumber(val) ? Number(val) : INI.sanitize(val), return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
); });
return; return;
} }
@ -519,9 +519,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) { if (!this.currentCurve) {
throw new Error('Curve not set'); throw new Error('Curve not set');
} }
this.result.curves[this.currentCurve].yBins = yBinsResult.value.values.map((val: string) => this.result.curves[this.currentCurve].yBins = yBinsResult.value.values.map((val: string) => {
INI.isNumber(val) ? Number(val) : INI.sanitize(val), return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
); });
return; return;
} }
@ -531,9 +531,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) { if (!this.currentCurve) {
throw new Error('Curve not set'); throw new Error('Curve not set');
} }
this.result.curves[this.currentCurve].size = size.value.values.map((val: string) => this.result.curves[this.currentCurve].size = size.value.values.map((val: string) => {
INI.isNumber(val) ? Number(val) : INI.sanitize(val), return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
); });
} }
} }
@ -870,9 +870,9 @@ export class INI implements ParserInterface {
this.result.defines[result.name] = result.values.map(INI.sanitize); this.result.defines[result.name] = result.values.map(INI.sanitize);
const resolved = this.result.defines[result.name].flatMap((val) => const resolved = this.result.defines[result.name].flatMap((val) => {
val.startsWith('$') ? this.result.defines[val.slice(1)] : val, return val.startsWith('$') ? this.result.defines[val.slice(1)] : val;
); });
this.result.defines[result.name] = resolved; this.result.defines[result.name] = resolved;
} }
@ -1154,11 +1154,13 @@ export class INI implements ParserInterface {
.tryParse(line); .tryParse(line);
} }
private static numberOrExpression = (val: string | undefined | null) => private static numberOrExpression = (val: string | undefined | null) => {
INI.isNumber(val || '0') ? Number(val || 0) : INI.sanitize(`${val}`); return INI.isNumber(val || '0') ? Number(val || 0) : INI.sanitize(`${val}`);
};
private static sanitize = (val: any) => private static sanitize = (val: any) => {
val === undefined ? '' : `${val}`.replace(/"/g, '').replace(/\s+/g, ' ').trim(); return val === undefined ? '' : `${val}`.replace(/"/g, '').replace(/\s+/g, ' ').trim();
};
private static isNumber = (val: any) => !Number.isNaN(Number(val)); private static isNumber = (val: any) => !Number.isNaN(Number(val));