Skip to content

Commit

Permalink
Fix package json for legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
thekevinscott committed Nov 15, 2023
1 parent 729be60 commit cf26896
Showing 1 changed file with 41 additions and 44 deletions.
85 changes: 41 additions & 44 deletions models/esrgan-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
"import": "./dist/esm/models/esrgan-legacy/src/div2k/x4/index.js"
},
"./psnr-small": {
"umd": "./dist/umd/models/esrgan-legacy/src/div2k/psnr-small/index.min.js",
"umd": "./dist/umd/models/esrgan-legacy/src/psnr-small/index.min.js",
"require": "./dist/cjs/models/esrgan-legacy/src/psnr-small/cjs.js",
"import": "./dist/esm/models/esrgan-legacy/src/psnr-small/index.js"
},
"./gans": {
"umd": "./dist/umd/models/esrgan-legacy/src/div2k/gans/index.min.js",
"umd": "./dist/umd/models/esrgan-legacy/src/gans/index.min.js",
"require": "./dist/cjs/models/esrgan-legacy/src/gans/cjs.js",
"import": "./dist/esm/models/esrgan-legacy/src/gans/index.js"
}
Expand Down Expand Up @@ -114,8 +114,29 @@
"prepublishOnly": {
"command": "pnpm lint && pnpm build && pnpm validate:build"
},
"scaffold": {
"command": "node -e 'const fs = require(\"fs\"); const {name, version} = require(\"./package.json\"); fs.writeFileSync(\"./src/constants.generated.ts\", `export const NAME = \"${name}\";\\nexport const VERSION=\"${version}\"`, \"utf-8\");'",
"files": [
"package.json"
],
"output": [
"./src/constants.generated.ts"
]
},
"build:umd:tsc": {
"command": "tsc -p ./tsconfig.umd.json --outDir ./dist/umd-tmp"
},
"build:umd:index": {
"command": "pnpm build:umd:rollup:index && pnpm build:umd:uglify:index"
},
"validate:build": {
"command": "pnpm --filter @internals/scripts validate models/esrgan-legacy"
"command": "ts-node ../../scripts/package-scripts/validate-build.ts models/esrgan-legacy"
},
"build:umd:rollup:index": {
"command": "rollup -c ../rollup.config.cjs --input ./dist/umd-tmp/models/esrgan-legacy/src/umd.js --file ./dist/umd/models/esrgan-legacy/src/umd.js --name ESRGANLegacy --format umd"
},
"build:umd:uglify:index": {
"command": "uglifyjs ./dist/umd/models/esrgan-legacy/src/umd.js --output ./dist/umd/models/esrgan-legacy/src/umd.min.js --compress --mangle --source-map"
},
"build": {
"command": "pnpm build:cjs && pnpm build:esm && pnpm build:umd",
Expand All @@ -125,15 +146,15 @@
"!src/**/*.generated.ts",
"../../packages/shared/src/esrgan/**/*.ts",
"package.json",
"tsconfig.json",
"../tsconfig.json",
"tsconfig.umd.json",
"umd-names.json",
"tsconfig.cjs.json",
"../tsconfig.umd.json",
"tsconfig.esm.json",
"tsconfig.umd.json",
"tsconfig.json",
"../tsconfig.cjs.json",
"../tsconfig.esm.json",
"../tsconfig.umd.json",
"../tsconfig.json"
"tsconfig.cjs.json",
"../tsconfig.cjs.json"
],
"output": [
"dist/**"
Expand All @@ -150,10 +171,10 @@
"!src/**/*.generated.ts",
"../../packages/shared/src/esrgan/**/*.ts",
"package.json",
"tsconfig.cjs.json",
"tsconfig.json",
"../tsconfig.cjs.json",
"../tsconfig.json"
"../tsconfig.json",
"tsconfig.cjs.json",
"../tsconfig.cjs.json"
],
"output": [
"dist/cjs/**"
Expand All @@ -170,17 +191,17 @@
"!src/**/*.generated.ts",
"../../packages/shared/src/esrgan/**/*.ts",
"package.json",
"tsconfig.esm.json",
"tsconfig.json",
"../tsconfig.esm.json",
"../tsconfig.json"
"../tsconfig.json",
"tsconfig.esm.json",
"../tsconfig.esm.json"
],
"output": [
"dist/esm/**"
]
},
"build:umd": {
"command": "pnpm run build:umd:tsc && pnpm run build:umd:index && pnpm run build:umd:div2k/x2 && pnpm run build:umd:div2k/x3 && pnpm run build:umd:div2k/x4 && pnpm run build:umd:psnr-small && pnpm run build:umd:gans && rimraf ./dist/umd-tmp",
"command": "pnpm run build:umd:tsc && pnpm run build:umd:index && pnpm run build:umd:div2k/2x && pnpm run build:umd:div2k/3x && pnpm run build:umd:div2k/4x && pnpm run build:umd:psnr-small && pnpm run build:umd:gans && rimraf ./dist/umd-tmp",
"dependencies": [
"scaffold"
],
Expand All @@ -189,41 +210,17 @@
"!src/**/*.test.ts",
"!src/**/*.generated.ts",
"../../packages/shared/src/esrgan/**/*.ts",
"umd-names.json",
"package.json",
"tsconfig.umd.json",
"tsconfig.json",
"../tsconfig.umd.json",
"../tsconfig.json"
"../tsconfig.json",
"tsconfig.umd.json",
"umd-names.json",
"../tsconfig.umd.json"
],
"output": [
"dist/umd/**"
]
},
"clean": {
"command": "ts-node ../../scripts/package-scripts/clean-model.ts esrgan-legacy"
},
"scaffold": {
"command": "node -e 'const fs = require(\"fs\"); const {name, version} = require(\"./package.json\"); fs.writeFileSync(\"./src/constants.generated.ts\", `export const NAME = \"${name}\";\\nexport const VERSION=\"${version}\"`, \"utf-8\");'",
"files": [
"package.json"
],
"output": [
"./src/constants.generated.ts"
]
},
"build:umd:tsc": {
"command": "tsc -p ./tsconfig.umd.json --outDir ./dist/umd-tmp"
},
"build:umd:index": {
"command": "pnpm build:umd:rollup:index && pnpm build:umd:uglify:index"
},
"build:umd:rollup:index": {
"command": "rollup -c ../rollup.config.cjs --input ./dist/umd-tmp/models/esrgan-legacy/src/umd.js --file ./dist/umd/models/esrgan-legacy/src/umd.js --name ESRGANLegacy --format umd"
},
"build:umd:uglify:index": {
"command": "uglifyjs ./dist/umd/models/esrgan-legacy/src/umd.js --output ./dist/umd/models/esrgan-legacy/src/umd.min.js --compress --mangle --source-map"
},
"build:umd:div2k/2x": {
"command": "pnpm build:umd:rollup:div2k/2x && pnpm build:umd:uglify:div2k/2x"
},
Expand Down

0 comments on commit cf26896

Please sign in to comment.