Skip to content

Commit

Permalink
Clear out @upscalerjs/core directory and its references (#1189)
Browse files Browse the repository at this point in the history
* Clear out @upscalerjs/core directory and its references
  • Loading branch information
thekevinscott authored Oct 9, 2023
1 parent c13cb03 commit e74eb91
Show file tree
Hide file tree
Showing 30 changed files with 20 additions and 640 deletions.
2 changes: 0 additions & 2 deletions .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ version = 1
test_patterns = ["packages/upscalerjs/src/**/*.ts"]

exclude_patterns = [
"packages/core/src/**/*.test.ts",
"packages/core/jest.setup.ts",
"packages/upscalerjs/src/**/*.test.ts",
"packages/upscalerjs/jest.setup.ts",
"examples/**",
Expand Down
1 change: 0 additions & 1 deletion internals/common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const DEV_DIR = path.resolve(ROOT_DIR, 'dev');
export const PACKAGES_DIR = path.resolve(ROOT_DIR, 'packages');

export const UPSCALER_DIR = path.resolve(PACKAGES_DIR, 'upscalerjs');
export const CORE_DIR = path.resolve(PACKAGES_DIR, 'core');
export const SHARED_DIR = path.resolve(PACKAGES_DIR, 'shared');
export const WRAPPER_DIR = path.resolve(PACKAGES_DIR, 'upscalerjs-wrapper');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ReflectionKind,
} from 'typedoc';
import { Platform } from '../prompt/types';
import { CORE_DIR, DOCS_DIR, UPSCALER_DIR } from '../utils/constants';
import { DOCS_DIR, UPSCALER_DIR } from '../utils/constants';
import { clearOutMarkdownFiles } from './utils/clear-out-markdown-files';
import { getSharedArgs, SharedArgs } from './types';
import {
Expand Down Expand Up @@ -299,8 +299,6 @@ const writePlatformSpecificDefinitions = (definitions: Definitions): string => {
*/
const UPSCALER_TSCONFIG_PATH = path.resolve(UPSCALER_DIR, 'tsconfig.browser.esm.json');
const UPSCALER_SRC_PATH = path.resolve(UPSCALER_DIR, 'src/browser/esm');
const CORE_TSCONFIG_PATH = path.resolve(CORE_DIR, 'tsconfig.json');
const CORE_SRC_PATH = path.resolve(CORE_DIR, 'src');
const EXAMPLES_DOCS_DEST = path.resolve(DOCS_DIR, 'docs/documentation/api');
const VALID_EXPORTS_FOR_WRITING_DOCS = ['default'];
const VALID_METHODS_FOR_WRITING_DOCS = [
Expand Down Expand Up @@ -459,18 +457,12 @@ const getDefinitions = async (): Promise<Definitions> => {
UPSCALER_DIR,
);
console.log('***** 2')
const coreTree = getPackageAsTree(
CORE_SRC_PATH,
CORE_TSCONFIG_PATH,
CORE_DIR,
);
const platformSpecificTypes = await getTypesFromPlatformSpecificFiles();
if (!upscalerTree.children) {
throw new Error('No children were found on upscaler tree object. Indicates an error in the returned structure from getPackageAsTree');
}
const children = [
...upscalerTree.children,
...(coreTree.children || []),
...(platformSpecificTypes.children || []),
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import inquirer from 'inquirer';
import isValidVersion from './utils/isValidVersion';
import { AVAILABLE_PACKAGES, CORE, DIRECTORIES, EXAMPLES, getPackageJSON, getPackageJSONPath, getPreparedFolderName, Package, PackageUpdaterLogger, ROOT, TransformPackageJsonFn, updateMultiplePackages, updateSinglePackage, UPSCALER_JS, WRAPPER } from './utils/packages';
import { AVAILABLE_PACKAGES, DIRECTORIES, EXAMPLES, getPackageJSON, getPackageJSONPath, getPreparedFolderName, Package, PackageUpdaterLogger, ROOT, TransformPackageJsonFn, updateMultiplePackages, updateSinglePackage, UPSCALER_JS, WRAPPER } from './utils/packages';
import { ROOT_DIR } from './utils/constants';

/****
Expand All @@ -27,11 +27,9 @@ const getVersion = (dir: string) => {
const getCurrentVersions = () => {
const upscalerJSVersion = getVersion(DIRECTORIES[UPSCALER_JS].directory);
const rootVersion = getVersion(DIRECTORIES[ROOT].directory);
const coreVersion = getVersion(DIRECTORIES[CORE].directory);
return [
`root: ${rootVersion}`,
`upscaler: ${upscalerJSVersion}`,
`core: ${coreVersion}`,
].join(' | ');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ export const DEV_DIR = path.resolve(ROOT_DIR, 'dev');
export const PACKAGES_DIR = path.resolve(ROOT_DIR, 'packages');

export const UPSCALER_DIR = path.resolve(PACKAGES_DIR, 'upscalerjs');
export const CORE_DIR = path.resolve(PACKAGES_DIR, 'core');
export const SHARED_DIR = path.resolve(PACKAGES_DIR, 'shared');
export const WRAPPER_DIR = path.resolve(PACKAGES_DIR, 'upscalerjs-wrapper');
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import findAllPackages from '../find-all-packages.js';
import { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package';
import { CORE_DIR, DEV_DIR, DOCS_DIR, EXAMPLES_DIR, MODELS_DIR, PACKAGES_DIR, ROOT_DIR, TEST_DIR, UPSCALER_DIR, WRAPPER_DIR } from './constants.js';
import { DEV_DIR, DOCS_DIR, EXAMPLES_DIR, MODELS_DIR, PACKAGES_DIR, ROOT_DIR, TEST_DIR, UPSCALER_DIR, WRAPPER_DIR } from './constants.js';

interface FakeExports {
[index: string]: string | FakeExports;
Expand All @@ -12,12 +12,11 @@ export type JSONSchema = JSONSchemaForNPMPackageJsonFiles & {
exports: FakeExports;
};

export type Package = 'UpscalerJS' | 'Core' | 'Models' | 'Test' | 'Examples' | 'Root' | 'Wrapper' | 'Dev' | 'Packages';
export type Package = 'UpscalerJS' | 'Models' | 'Test' | 'Examples' | 'Root' | 'Wrapper' | 'Dev' | 'Packages';
export type TransformPackageJsonFn = (packageJSON: JSONSchema, dir: string) => JSONSchema;
export type PackageUpdaterLogger = (file: string) => (string | undefined);

export const UPSCALER_JS = 'UpscalerJS';
export const CORE = 'Core';
export const ROOT = 'Root';
export const WRAPPER = 'Wrapper';
export const EXAMPLES = 'Examples';
Expand All @@ -27,12 +26,11 @@ export const DEV = 'Development';
export const DOCS = 'Docs';
export const PACKAGES = 'Packages';

export const AVAILABLE_PACKAGES = [ ROOT, UPSCALER_JS, CORE, MODELS, EXAMPLES, TEST, WRAPPER, DEV, DOCS, PACKAGES ];
export const AVAILABLE_PACKAGES = [ ROOT, UPSCALER_JS, MODELS, EXAMPLES, TEST, WRAPPER, DEV, DOCS, PACKAGES ];

export const DIRECTORIES: Record<string, { directory: string, multiple?: boolean }> = {
[ROOT]: { directory: ROOT_DIR },
[UPSCALER_JS]: { directory: UPSCALER_DIR },
[CORE]: { directory: CORE_DIR },
[MODELS]: { directory: MODELS_DIR, multiple: true },
[EXAMPLES]: { directory: EXAMPLES_DIR, multiple: true },
[TEST]: { directory: TEST_DIR, multiple: true },
Expand Down
1 change: 0 additions & 1 deletion models/default-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"build": {
"command": "pnpm build:cjs && pnpm build:esm && pnpm build:umd",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand Down
3 changes: 0 additions & 3 deletions models/esrgan-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
"build:cjs": {
"command": "tsc -p ./tsconfig.cjs.json --outDir ./dist/cjs --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -152,7 +151,6 @@
"build:esm": {
"command": "tsc -p ./tsconfig.esm.json --outDir ./dist/esm --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -173,7 +171,6 @@
"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",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand Down
3 changes: 0 additions & 3 deletions models/esrgan-medium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
"build:cjs": {
"command": "tsc -p ./tsconfig.cjs.json --outDir ./dist/cjs --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -156,7 +155,6 @@
"build:esm": {
"command": "tsc -p ./tsconfig.esm.json --outDir ./dist/esm --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -177,7 +175,6 @@
"build:umd": {
"command": "pnpm run build:umd:tsc && pnpm run build:umd:index && pnpm run build:umd:x2 && pnpm run build:umd:x3 && pnpm run build:umd:x4 && pnpm run build:umd:x8 && rimraf ./dist/umd-tmp",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand Down
3 changes: 0 additions & 3 deletions models/esrgan-slim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
"build:cjs": {
"command": "tsc -p ./tsconfig.cjs.json --outDir ./dist/cjs --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -156,7 +155,6 @@
"build:esm": {
"command": "tsc -p ./tsconfig.esm.json --outDir ./dist/esm --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -177,7 +175,6 @@
"build:umd": {
"command": "pnpm run build:umd:tsc && pnpm run build:umd:index && pnpm run build:umd:x2 && pnpm run build:umd:x3 && pnpm run build:umd:x4 && pnpm run build:umd:x8 && rimraf ./dist/umd-tmp",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand Down
3 changes: 0 additions & 3 deletions models/esrgan-thick/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"build:cjs": {
"command": "tsc -p ./tsconfig.cjs.json --outDir ./dist/cjs --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -149,7 +148,6 @@
"build:esm": {
"command": "tsc -p ./tsconfig.esm.json --outDir ./dist/esm --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -170,7 +168,6 @@
"build:umd": {
"command": "pnpm run build:umd:tsc && pnpm run build:umd:index && pnpm run build:umd:x2 && pnpm run build:umd:x3 && pnpm run build:umd:x4 && pnpm run build:umd:x8 && rimraf ./dist/umd-tmp",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand Down
3 changes: 0 additions & 3 deletions models/pixel-upsampler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
"build:cjs": {
"command": "tsc -p ./tsconfig.cjs.json --outDir ./dist/cjs --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -126,7 +125,6 @@
"build:esm": {
"command": "tsc -p ./tsconfig.esm.json --outDir ./dist/esm --baseUrl ./src",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand All @@ -146,7 +144,6 @@
"build:umd": {
"command": "pnpm run build:umd:tsc && pnpm run build:umd:index && pnpm run build:umd:x2 && pnpm run build:umd:x3 && pnpm run build:umd:x4 && rimraf ./dist/umd-tmp",
"dependencies": [
"../../packages/core:build",
"scaffold"
],
"files": [
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
},
"postinstall": {
"dependencies": [
"./packages/core:build",
"./models/default-model:build"
]
},
Expand Down
45 changes: 0 additions & 45 deletions packages/core/.eslintrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/core/.npmignore

This file was deleted.

4 changes: 2 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This package is a folder of shared types and functions consumed by UpscalerJS and its upscaling models. You shouldn't install this package directly.
**DEPRECATED**

For more information on UpscalerJS, [check out the documentation](https://upscalerjs.com).
This package is deprecated. Please install `upscaler` and import types from its exports.
Loading

0 comments on commit e74eb91

Please sign in to comment.