diff --git a/packages/upscalerjs/src/shared/errors-and-warnings.ts b/packages/upscalerjs/src/shared/errors-and-warnings.ts index e06173059..1a5f76ca6 100644 --- a/packages/upscalerjs/src/shared/errors-and-warnings.ts +++ b/packages/upscalerjs/src/shared/errors-and-warnings.ts @@ -2,7 +2,7 @@ import { ModelDefinition, MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE, } from "../../../shared/src/types"; -import { ModelDefinitionValidationError, } from "../constants"; +// import { ModelDefinitionValidationError, } from "../constants"; const WARNING_DEPRECATED_MODEL_DEFINITION_URL = 'https://upscalerjs.com/documentation/troubleshooting#deprecated-model-definition-function'; @@ -114,6 +114,15 @@ export const GET_MODEL_CONFIGURATION_MISSING_PATH_AND_INTERNALS = (modelConfigur `The model configuration provided was: ${JSON.stringify(modelConfiguration)}`, ].join(' '); +// TODO: Import this from ../constants +export class ModelDefinitionValidationError extends Error { + type: MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE; + + constructor(type: MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE) { + super(type); + this.type = type; + } +} export function getModelDefinitionError({ type, message, }: ModelDefinitionValidationError, modelDefinition?: ModelDefinition): Error { switch (type) { case MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE.INVALID_MODEL_TYPE: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b6b3bd2f..ccf01e7b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -936,21 +936,27 @@ importers: models/maxim-experiments: devDependencies: + '@rollup/plugin-json': + specifier: ^6.0.0 + version: 6.0.1(rollup@3.28.0) '@tensorflow/tfjs': - specifier: ^4.8.0 + specifier: ~4.11.0 version: 4.11.0(seedrandom@3.0.5) '@tensorflow/tfjs-core': - specifier: ^4.8.0 + specifier: ~4.11.0 version: 4.11.0 '@tensorflow/tfjs-layers': - specifier: ^4.8.0 + specifier: ~4.11.0 version: 4.11.0(@tensorflow/tfjs-core@4.11.0) '@tensorflow/tfjs-node': - specifier: ^4.8.0 + specifier: ~4.11.0 version: 4.11.0(seedrandom@3.0.5) '@tensorflow/tfjs-node-gpu': - specifier: ^4.8.0 + specifier: ~4.11.0 version: 4.11.0(seedrandom@3.0.5) + babel-plugin-transform-inline-environment-variables: + specifier: ^0.4.4 + version: 0.4.4 seedrandom: specifier: 3.0.5 version: 3.0.5 @@ -1055,64 +1061,6 @@ importers: specifier: workspace:* version: link:../upscalerjs - tmp/bundlers/esbuild: - dependencies: - '@tensorflow/tfjs': - specifier: ~4.11.0 - version: 4.11.0(seedrandom@3.0.5) - '@upscalerjs/default-model': - specifier: workspace:* - version: link:../../../models/default-model - '@upscalerjs/esrgan-legacy': - specifier: workspace:* - version: link:../../../models/esrgan-legacy - '@upscalerjs/esrgan-medium': - specifier: workspace:* - version: link:../../../models/esrgan-medium - '@upscalerjs/esrgan-slim': - specifier: workspace:* - version: link:../../../models/esrgan-slim - '@upscalerjs/esrgan-thick': - specifier: workspace:* - version: link:../../../models/esrgan-thick - '@upscalerjs/maxim-deblurring': - specifier: workspace:* - version: link:../../../models/maxim-deblurring - '@upscalerjs/maxim-dehazing-indoor': - specifier: workspace:* - version: link:../../../models/maxim-dehazing-indoor - '@upscalerjs/maxim-dehazing-outdoor': - specifier: workspace:* - version: link:../../../models/maxim-dehazing-outdoor - '@upscalerjs/maxim-denoising': - specifier: workspace:* - version: link:../../../models/maxim-denoising - '@upscalerjs/maxim-deraining': - specifier: workspace:* - version: link:../../../models/maxim-deraining - '@upscalerjs/maxim-enhancement': - specifier: workspace:* - version: link:../../../models/maxim-enhancement - '@upscalerjs/maxim-retouching': - specifier: workspace:* - version: link:../../../models/maxim-retouching - '@upscalerjs/pixel-upsampler': - specifier: workspace:* - version: link:../../../models/pixel-upsampler - upscaler: - specifier: workspace:* - version: link:../../../packages/upscalerjs - devDependencies: - '@babel/plugin-transform-modules-commonjs': - specifier: 7.22.5 - version: 7.22.5(@babel/core@7.23.2) - '@babel/preset-typescript': - specifier: 7.22.5 - version: 7.22.5(@babel/core@7.23.2) - seedrandom: - specifier: 3.0.5 - version: 3.0.5 - tmp/bundlers/node: dependencies: '@tensorflow/tfjs-node': @@ -1324,6 +1272,7 @@ packages: /@babel/cli@7.23.0(@babel/core@7.23.2): resolution: {integrity: sha512-17E1oSkGk2IwNILM4jtfAvgjt+ohmpfBky8aLerUfYZhiPNg7ca+CRCxZn8QDxwNhV/upsc2VHBCqGFIR+iBfA==} engines: {node: '>=6.9.0'} + hasBin: true peerDependencies: '@babel/core': ^7.0.0-0 dependencies: @@ -2077,18 +2026,6 @@ packages: '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-transform-modules-commonjs@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.2 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.2) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-simple-access': 7.22.5 - dev: true - /@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.2): resolution: {integrity: sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==} engines: {node: '>=6.9.0'} @@ -2550,20 +2487,6 @@ packages: '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.23.2) '@babel/plugin-transform-react-pure-annotations': 7.23.3(@babel/core@7.23.2) - /@babel/preset-typescript@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.2 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.22.15 - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.2) - '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-typescript': 7.23.3(@babel/core@7.23.2) - dev: true - /@babel/preset-typescript@7.23.2(@babel/core@7.23.2): resolution: {integrity: sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA==} engines: {node: '>=6.9.0'} @@ -2742,6 +2665,7 @@ packages: /@docusaurus/core@2.4.3(@docusaurus/types@2.4.3)(esbuild@0.19.2)(eslint@8.47.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(uglify-js@3.17.4): resolution: {integrity: sha512-dWH5P7cgeNSIg9ufReX6gaCl/TmrGKD38Orbwuz05WPhAQtFXHd5B8Qym1TiXfvUNvwoYKkAJOJuGe8ou0Z7PA==} engines: {node: '>=16.14'} + hasBin: true peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 @@ -6390,6 +6314,7 @@ packages: /autoprefixer@10.4.16(postcss@8.4.31): resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} engines: {node: ^10 || ^12 || >=14} + hasBin: true peerDependencies: postcss: ^8.1.0 dependencies: @@ -8482,6 +8407,7 @@ packages: /eslint-config-prettier@9.0.0(eslint@8.47.0): resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} + hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: @@ -10334,6 +10260,7 @@ packages: /jest-cli@29.7.0(@types/node@20.5.1)(ts-node@10.9.1): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: @@ -10687,6 +10614,7 @@ packages: /jest@29.6.3(@types/node@20.5.1)(ts-node@10.9.1): resolution: {integrity: sha512-alueLuoPCDNHFcFGmgETR4KpQ+0ff3qVaiJwxQM4B5sC0CvXcgg4PEi7xrDkxuItDmdz/FVc7SSit4KEu8GRvw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: @@ -14604,6 +14532,7 @@ packages: /ts-jest@29.1.1(@babel/core@7.23.2)(esbuild@0.19.2)(jest@29.6.3)(typescript@5.1.6): resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true peerDependencies: '@babel/core': '>=7.0.0-beta.0 <8' '@jest/types': ^29.0.0 @@ -14637,6 +14566,7 @@ packages: /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.1.6): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -14667,6 +14597,7 @@ packages: /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -14789,6 +14720,7 @@ packages: /typedoc@0.24.8(typescript@5.1.6): resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} engines: {node: '>= 14.14'} + hasBin: true peerDependencies: typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x dependencies: @@ -14802,6 +14734,7 @@ packages: /typedoc@0.24.8(typescript@5.2.2): resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} engines: {node: '>= 14.14'} + hasBin: true peerDependencies: typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x dependencies: @@ -15017,6 +14950,7 @@ packages: /update-browserslist-db@1.0.13(browserslist@4.22.1): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: @@ -15248,6 +15182,7 @@ packages: /vite@4.4.9(@types/node@20.5.1): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' @@ -15292,6 +15227,7 @@ packages: /vitest@0.34.6(jsdom@22.1.0): resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} engines: {node: '>=v14.18.0'} + hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@vitest/browser': '*' @@ -15451,6 +15387,7 @@ packages: /webpack-dev-server@4.15.1(webpack@5.89.0): resolution: {integrity: sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==} engines: {node: '>= 12.13.0'} + hasBin: true peerDependencies: webpack: ^4.37.0 || ^5.0.0 webpack-cli: '*' @@ -15519,6 +15456,7 @@ packages: /webpack@5.89.0(esbuild@0.19.2)(uglify-js@3.17.4): resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==} engines: {node: '>=10.13.0'} + hasBin: true peerDependencies: webpack-cli: '*' peerDependenciesMeta: