Skip to content

Commit

Permalink
Update upscaler to build while leveraging shared folder (#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekevinscott authored Oct 8, 2023
1 parent 980ee4b commit e02c846
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 905 deletions.
20 changes: 10 additions & 10 deletions packages/upscalerjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"description": "Enhance Images with Javascript and AI. Increase resolution, retouch, denoise, and more. Open Source, Browser and Node Compatible, MIT License.",
"exports": {
"./node": {
"types": "./dist/node/node/cjs/index.d.ts",
"require": "./dist/node/node/cjs/index.js"
"types": "./dist/node/upscalerjs/src/node/cjs/index.d.ts",
"require": "./dist/node/upscalerjs/src/node/cjs/index.js"
},
"./node-gpu": {
"types": "./dist/node-gpu/node-gpu/cjs/index.d.ts",
"require": "./dist/node-gpu/node-gpu/cjs/index.js"
"types": "./dist/node-gpu/upscalerjs/src/node-gpu/cjs/index.d.ts",
"require": "./dist/node-gpu/upscalerjs/src/node-gpu/cjs/index.js"
},
".": {
"types": "./dist/browser/esm/browser/esm/index.d.ts",
"import": "./dist/browser/esm/browser/esm/index.js"
"types": "./dist/browser/esm/upscalerjs/src/browser/esm/index.d.ts",
"import": "./dist/browser/esm/upscalerjs/src/browser/esm/index.js"
}
},
"engines": {
"node": ">=16.0"
},
"module": "dist/browser/esm/browser/esm/index.js",
"types": "dist/browser/esm/browser/esm/index.d.ts",
"module": "dist/browser/esm/upscalerjs/src/browser/esm/index.js",
"types": "dist/browser/esm/upscalerjs/src/browser/esm/index.d.ts",
"umd:main": "dist/browser/umd/upscaler.min.js",
"keywords": [
"image enhancement",
Expand Down Expand Up @@ -116,7 +116,7 @@
"command": "tsc -p ./tsconfig.browser.umd.json --outDir ./dist/browser/tmp"
},
"build:browser:umd:rollup": {
"command": "rollup -c ./rollup.config.mjs --input ./dist/browser/tmp/browser/umd/index.js --file ./dist/browser/umd/upscaler.js --name Upscaler --format umd"
"command": "rollup -c ./rollup.config.mjs --input ./dist/browser/tmp/upscalerjs/src/browser/umd/index.js --file ./dist/browser/umd/upscaler.js --name Upscaler --format umd"
},
"build:browser:umd:uglify": {
"command": "uglifyjs ./dist/browser/umd/upscaler.js --output ./dist/browser/umd/upscaler.min.js --compress --mangle --source-map"
Expand Down Expand Up @@ -183,7 +183,7 @@
"command": "vitest --config vite.node.ts"
},
"validate:build": {
"command": "pnpm --filter @upscalerjs/scripts validate:build packages/upscalerjs -c './dist/node/node/cjs/cjs.js' -c './dist/node/node/cjs/cjs.d.ts' -c './dist/node-gpu/node-gpu/cjs/cjs.js' -c './dist/node-gpu/node-gpu/cjs/cjs.d.ts' -c './dist/browser/esm/browser/esm/index.js' -c './dist/browser/esm/browser/esm/index.d.ts' -c './dist/browser/umd/upscaler.js' -c './dist/browser/umd/upscaler.min.js'"
"command": "pnpm --filter @upscalerjs/scripts validate:build packages/upscalerjs -c './dist/node/upscalerjs/src/node/cjs/index.js' -c './dist/node/upscalerjs/src/node/cjs/index.d.ts' -c './dist/node-gpu/upscalerjs/src/node-gpu/cjs/index.js' -c './dist/node-gpu/upscalerjs/src/node-gpu/cjs/index.d.ts' -c './dist/browser/esm/upscalerjs/src/browser/esm/index.js' -c './dist/browser/esm/upscalerjs/src/browser/esm/index.d.ts' -c './dist/browser/umd/upscaler.js' -c './dist/browser/umd/upscaler.min.js'"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/upscalerjs/src/shared/upscaler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type {
} from './types';
import { cancellableWarmup, } from './warmup';
import { cancellableUpscale, } from './upscale';
import type { TF, ModelDefinitionObjectOrFn, } from '@upscalerjs/core';
import type { TF, ModelDefinitionObjectOrFn, } from '../../../shared/src/types';
import { getModel, } from './model-utils';

// TODO: Why do we need to explicitly cast this to ModelDefinition?
Expand Down
4 changes: 2 additions & 2 deletions packages/upscalerjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"rootDir": "./src",
"baseUrl": "./src",
"skipLibCheck": true,
"strict": true,
Expand All @@ -18,7 +17,8 @@
"removeComments": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"rootDirs": ["./src", "../shared/src"],
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "**/*.test.ts"]
Expand Down
130 changes: 0 additions & 130 deletions scripts/package-scripts/clean-model.ts

This file was deleted.

Loading

0 comments on commit e02c846

Please sign in to comment.