From 7820f586b2129a9af03b4a62e9fcf684174ab57d Mon Sep 17 00:00:00 2001 From: Maddy Date: Sat, 1 Jan 2022 01:15:13 +1100 Subject: [PATCH 1/7] ts-node support. debugging is slightly wonky as vscode will not allow breakpoints in modules that aren't bundle, yet. --- bundle/.vscode/launch.json | 15 +++++++++++++++ bundle/package.json | 2 ++ bundle/tsconfig.json | 25 ++++++++++++++++++++----- util/src/util/TraverseDirectory.ts | 5 ++++- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/bundle/.vscode/launch.json b/bundle/.vscode/launch.json index aa4e743a..008c9821 100644 --- a/bundle/.vscode/launch.json +++ b/bundle/.vscode/launch.json @@ -4,6 +4,21 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "ts-node", + "type": "node", + "request": "launch", + "args": [ + "${workspaceFolder}/src/start.ts" + ], + "runtimeArgs": [ + "-r", + "ts-node/register" + ], + "cwd": "${workspaceRoot}", + "protocol": "inspector", + "internalConsoleOptions": "openOnSessionStart" + }, { "sourceMaps": true, "type": "node", diff --git a/bundle/package.json b/bundle/package.json index e0ae6156..7e41ff9f 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -51,6 +51,7 @@ "ts-node": "^10.2.1", "ts-node-dev": "^1.1.6", "ts-patch": "^1.4.4", + "tsconfig-paths": "^3.12.0", "typescript": "^4.2.3", "typescript-json-schema": "0.50.1" }, @@ -61,6 +62,7 @@ "@babel/preset-typescript": "^7.15.0", "@fosscord/api": "file:../api", "@fosscord/cdn": "file:../cdn", + "@fosscord/util": "file:../util", "@fosscord/gateway": "file:../gateway", "@sentry/node": "^6.16.1", "@sentry/tracing": "^6.16.1", diff --git a/bundle/tsconfig.json b/bundle/tsconfig.json index 2257b4ab..ef330139 100644 --- a/bundle/tsconfig.json +++ b/bundle/tsconfig.json @@ -1,6 +1,21 @@ { "include": ["dist/**/*.ts"], "exclude": [], + "ts-node": { + "transpileOnly": true, + "preferTsExts": true, + "compilerOptions": { + "rootDir": "../", + "baseUrl": ".", + "paths": { + "@fosscord/util": ["../util/src/index"], + "@fosscord/api": ["../api/src/index"], + "@fosscord/gateway": ["../gateway/src/index"], + "@fosscord/cdn": ["../cdn/src/index"] + }, + }, + "require": ["tsconfig-paths/register"] + }, "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ @@ -16,7 +31,7 @@ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ "declaration": false /* Generates corresponding '.d.ts' file. */, "declarationMap": false /* Generates a sourcemap for each corresponding '.d.ts' file. */, - "sourceMap": false /* Generates corresponding '.map' file. */, + "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ "outDir": "./dist/" /* Redirect output structure to the directory. */, "rootDir": "./dist/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, @@ -74,10 +89,10 @@ "resolveJsonModule": true, "baseUrl": "./dist/", "paths": { - "@fosscord/api": ["api/src/index"], - "@fosscord/gateway": ["gateway/src/index"], - "@fosscord/cdn": ["cdn/src/index"], - "@fosscord/util": ["util/src/index"] + "@fosscord/api": ["api/src/index", "../../api/src/index"], + "@fosscord/gateway": ["gateway/src/index", "../../gateway/src/index"], + "@fosscord/cdn": ["cdn/src/index", "../../cdn/src/index"], + "@fosscord/util": ["util/src/index", "../../util/src/index"] }, "plugins": [{ "transform": "@zerollup/ts-transform-paths" }], "noEmitHelpers": true, diff --git a/util/src/util/TraverseDirectory.ts b/util/src/util/TraverseDirectory.ts index 275b7dcc..3d0d6279 100644 --- a/util/src/util/TraverseDirectory.ts +++ b/util/src/util/TraverseDirectory.ts @@ -1,6 +1,9 @@ import { Server, traverseDirectory } from "lambert-server"; -const DEFAULT_FILTER = /^([^\.].*)(? Date: Sat, 1 Jan 2022 15:51:22 +1100 Subject: [PATCH 2/7] apparently ts-node compilerOptions.path wasn't needed? on windows I could've sworn it was. --- bundle/tsconfig.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bundle/tsconfig.json b/bundle/tsconfig.json index ef330139..c932d39c 100644 --- a/bundle/tsconfig.json +++ b/bundle/tsconfig.json @@ -7,12 +7,6 @@ "compilerOptions": { "rootDir": "../", "baseUrl": ".", - "paths": { - "@fosscord/util": ["../util/src/index"], - "@fosscord/api": ["../api/src/index"], - "@fosscord/gateway": ["../gateway/src/index"], - "@fosscord/cdn": ["../cdn/src/index"] - }, }, "require": ["tsconfig-paths/register"] }, From a396a41a0e215290806c297bcab601ed47972927 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 3 Jan 2022 22:33:14 +1100 Subject: [PATCH 3/7] Cleaned up tsconfig.json a bit ( moved tsnode config to own file ). Fixed breakpoints for all modules under tsnode --- bundle/.vscode/launch.json | 70 +++++++------- bundle/package.json | 1 - bundle/tsconfig.json | 181 +++++++++++++++++------------------- bundle/tsnode.tsconfig.json | 14 +++ 4 files changed, 137 insertions(+), 129 deletions(-) create mode 100644 bundle/tsnode.tsconfig.json diff --git a/bundle/.vscode/launch.json b/bundle/.vscode/launch.json index 008c9821..4f7c73c9 100644 --- a/bundle/.vscode/launch.json +++ b/bundle/.vscode/launch.json @@ -1,33 +1,37 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "ts-node", - "type": "node", - "request": "launch", - "args": [ - "${workspaceFolder}/src/start.ts" - ], - "runtimeArgs": [ - "-r", - "ts-node/register" - ], - "cwd": "${workspaceRoot}", - "protocol": "inspector", - "internalConsoleOptions": "openOnSessionStart" - }, - { - "sourceMaps": true, - "type": "node", - "request": "launch", - "name": "Launch Server", - "program": "${workspaceFolder}/dist/bundle/src/start.js", - "preLaunchTask": "tsc: build - tsconfig.json", - "outFiles": ["${workspaceFolder}/dist/**/*.js"], - "envFile": "${workspaceFolder}/.env" - } - ] -} +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "sourceMaps": true, + "name": "ts-node", + "type": "node", + "request": "launch", + "args": [ + "${workspaceFolder}/src/start.ts" + ], + "runtimeArgs": [ + "-r", + "ts-node/register" + ], + "protocol": "inspector", + "internalConsoleOptions": "openOnSessionStart", + "env": { + "TS_NODE_PROJECT": "${workspaceFolder}/tsnode.tsconfig.json", + }, + "resolveSourceMapLocations": null, /* allow breakpoints in modules other than bundle */ + }, + { + "sourceMaps": true, + "type": "node", + "request": "launch", + "name": "Launch Server", + "program": "${workspaceFolder}/dist/bundle/src/start.js", + "preLaunchTask": "tsc: build - tsconfig.json", + "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "envFile": "${workspaceFolder}/.env", + } + ] +} diff --git a/bundle/package.json b/bundle/package.json index 7e41ff9f..301ee18c 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -62,7 +62,6 @@ "@babel/preset-typescript": "^7.15.0", "@fosscord/api": "file:../api", "@fosscord/cdn": "file:../cdn", - "@fosscord/util": "file:../util", "@fosscord/gateway": "file:../gateway", "@sentry/node": "^6.16.1", "@sentry/tracing": "^6.16.1", diff --git a/bundle/tsconfig.json b/bundle/tsconfig.json index c932d39c..cc850b99 100644 --- a/bundle/tsconfig.json +++ b/bundle/tsconfig.json @@ -1,95 +1,86 @@ -{ - "include": ["dist/**/*.ts"], - "exclude": [], - "ts-node": { - "transpileOnly": true, - "preferTsExts": true, - "compilerOptions": { - "rootDir": "../", - "baseUrl": ".", - }, - "require": ["tsconfig-paths/register"] - }, - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - "incremental": false /* Enable incremental compilation */, - "target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "lib": [ - "ES2021" - ] /* Specify library files to be included in the compilation. */, - "allowJs": true /* Allow javascript files to be compiled. */, - "checkJs": true /* Report errors in .js files. */, - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": false /* Generates corresponding '.d.ts' file. */, - "declarationMap": false /* Generates a sourcemap for each corresponding '.d.ts' file. */, - "sourceMap": true /* Generates corresponding '.map' file. */, - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist/" /* Redirect output structure to the directory. */, - "rootDir": "./dist/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - "strictNullChecks": true /* Enable strict null checks. */, - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": [ - "node" - ] /* Type declaration files to be included in compilation. */, - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "resolveJsonModule": true, - "baseUrl": "./dist/", - "paths": { - "@fosscord/api": ["api/src/index", "../../api/src/index"], - "@fosscord/gateway": ["gateway/src/index", "../../gateway/src/index"], - "@fosscord/cdn": ["cdn/src/index", "../../cdn/src/index"], - "@fosscord/util": ["util/src/index", "../../util/src/index"] - }, - "plugins": [{ "transform": "@zerollup/ts-transform-paths" }], - "noEmitHelpers": true, - "importHelpers": true - } -} +{ + "include": ["dist/**/*.ts"], + "exclude": [], + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + "incremental": false /* Enable incremental compilation */, + "target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + "lib": [ + "ES2021" + ] /* Specify library files to be included in the compilation. */, + "allowJs": true /* Allow javascript files to be compiled. */, + "checkJs": true /* Report errors in .js files. */, + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": false /* Generates corresponding '.d.ts' file. */, + "declarationMap": false /* Generates a sourcemap for each corresponding '.d.ts' file. */, + "sourceMap": true /* Generates corresponding '.map' file. */, + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist/" /* Redirect output structure to the directory. */, + "rootDir": "./dist/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "strictNullChecks": true /* Enable strict null checks. */, + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + "types": [ + "node" + ] /* Type declaration files to be included in compilation. */, + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "resolveJsonModule": true, + "baseUrl": "./dist/", + "paths": { + "@fosscord/api": ["api/src/index"], + "@fosscord/gateway": ["gateway/src/index"], + "@fosscord/cdn": ["cdn/src/index"], + "@fosscord/util": ["util/src/index"] + }, + "plugins": [{ "transform": "@zerollup/ts-transform-paths" }], + "noEmitHelpers": true, + "importHelpers": true + } +} diff --git a/bundle/tsnode.tsconfig.json b/bundle/tsnode.tsconfig.json new file mode 100644 index 00000000..841cc013 --- /dev/null +++ b/bundle/tsnode.tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "ts-node": { + "transpileOnly": true, + "preferTsExts": true, + "require": ["tsconfig-paths/register"] + }, + "compilerOptions": { + "rootDir": "../", + "baseUrl": "../", + "sourceRoot": "../", + "sourceMap": true, + } +} \ No newline at end of file From 4e4d271882299b5ee8ef9ebc022e380f41b26eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Alp=20G=C3=BCney?= Date: Tue, 4 Jan 2022 09:47:48 +0300 Subject: [PATCH 4/7] Removed Microsoft Corp advert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Singed-off-by: Erkin Alp Güney --- bundle/.vscode/launch.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/bundle/.vscode/launch.json b/bundle/.vscode/launch.json index 4f7c73c9..ad91751f 100644 --- a/bundle/.vscode/launch.json +++ b/bundle/.vscode/launch.json @@ -1,7 +1,4 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { From b64fa4997a793f726b773f93c7a18b1a1ece937c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Alp=20G=C3=BCney?= Date: Tue, 4 Jan 2022 09:48:44 +0300 Subject: [PATCH 5/7] Remove one more Microsoft Corp. ad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Erkin Alp Güney --- bundle/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/bundle/tsconfig.json b/bundle/tsconfig.json index cc850b99..563ff444 100644 --- a/bundle/tsconfig.json +++ b/bundle/tsconfig.json @@ -2,7 +2,6 @@ "include": ["dist/**/*.ts"], "exclude": [], "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Basic Options */ "incremental": false /* Enable incremental compilation */, From b131efca2e2f81843092f7b83f9756c1b0c47e21 Mon Sep 17 00:00:00 2001 From: Madeline Date: Wed, 5 Jan 2022 01:38:53 +1100 Subject: [PATCH 6/7] Added `tsnode` npm script --- bundle/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundle/package.json b/bundle/package.json index 301ee18c..fa64ce6b 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -9,7 +9,8 @@ "start": "node scripts/build.js && node dist/bundle/src/start.js", "start:bundle": "node dist/bundle/src/start.js", "test": "echo \"Error: no test specified\" && exit 1", - "migrate": "cd ../util/ && npm i && node --require ts-node/register node_modules/typeorm/cli.js -f ../util/ormconfig.json migration:run" + "migrate": "cd ../util/ && npm i && node --require ts-node/register node_modules/typeorm/cli.js -f ../util/ormconfig.json migration:run", + "tsnode": "npx ts-node --transpile-only -P tsnode.tsconfig.json src/start.ts" }, "repository": { "type": "git", From e9393683facb57f9577c768bbd80fce672d80a72 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 8 Jan 2022 17:22:44 +1100 Subject: [PATCH 7/7] Added `typescript-cached-transpile` package to help improve performance --- bundle/.vscode/launch.json | 1 + bundle/package-lock.json | 180 +++++++++++++++++++++++++++++++++++- bundle/package.json | 7 +- bundle/tsnode.tsconfig.json | 3 +- 4 files changed, 184 insertions(+), 7 deletions(-) diff --git a/bundle/.vscode/launch.json b/bundle/.vscode/launch.json index ad91751f..d7129ed8 100644 --- a/bundle/.vscode/launch.json +++ b/bundle/.vscode/launch.json @@ -17,6 +17,7 @@ "internalConsoleOptions": "openOnSessionStart", "env": { "TS_NODE_PROJECT": "${workspaceFolder}/tsnode.tsconfig.json", + "TS_NODE_COMPILER": "typescript-cached-transpile" }, "resolveSourceMapLocations": null, /* allow breakpoints in modules other than bundle */ }, diff --git a/bundle/package-lock.json b/bundle/package-lock.json index e8b99037..294dfe1f 100644 --- a/bundle/package-lock.json +++ b/bundle/package-lock.json @@ -58,6 +58,7 @@ "tslib": "^2.3.1", "typeorm": "^0.2.37", "typescript": "^4.1.2", + "typescript-cached-transpile": "^0.0.6", "typescript-json-schema": "^0.50.1", "ws": "^7.4.2" }, @@ -90,11 +91,13 @@ "ts-node": "^10.2.1", "ts-node-dev": "^1.1.6", "ts-patch": "^1.4.4", + "tsconfig-paths": "^3.12.0", "typescript": "^4.2.3", "typescript-json-schema": "0.50.1" } }, "../api": { + "name": "@fosscord/api", "version": "1.0.0", "hasInstallScript": true, "license": "ISC", @@ -158,6 +161,7 @@ } }, "../cdn": { + "name": "@fosscord/cdn", "version": "1.0.0", "license": "ISC", "dependencies": { @@ -200,6 +204,7 @@ } }, "../gateway": { + "name": "@fosscord/gateway", "version": "1.0.0", "hasInstallScript": true, "license": "ISC", @@ -3598,6 +3603,12 @@ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "node_modules/@types/jsonwebtoken": { "version": "8.5.5", "integrity": "sha512-OGqtHQ7N5/Ap/TUwO6IgHDuLiAoTmHhGpNvgkCm/F4N6pKzx/RBSfr2OXZSwC6vkfnsEdb6+7DNZVtiXiwdwFw==", @@ -10557,6 +10568,39 @@ "strip-json-comments": "^2.0.0" } }, + "node_modules/tsconfig-paths": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", + "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/tsconfig/node_modules/strip-bom": { "version": "3.0.0", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", @@ -10822,7 +10866,6 @@ "node_modules/typescript": { "version": "4.4.3", "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -10831,6 +10874,58 @@ "node": ">=4.2.0" } }, + "node_modules/typescript-cached-transpile": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typescript-cached-transpile/-/typescript-cached-transpile-0.0.6.tgz", + "integrity": "sha512-bfPc7YUW0PrVkQHU0xN0ANRuxdPgoYYXtZEW6PNkH5a97/AOM+kPPxSTMZbpWA3BG1do22JUkfC60KoCKJ9VZQ==", + "dependencies": { + "@types/node": "^12.12.7", + "fs-extra": "^8.1.0", + "tslib": "^1.10.0" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/typescript-cached-transpile/node_modules/@types/node": { + "version": "12.20.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.41.tgz", + "integrity": "sha512-f6xOqucbDirG7LOzedpvzjP3UTmHttRou3Mosx3vL9wr9AIQGhcPgVnqa8ihpZYnxyM1rxeNCvTyukPKZtq10Q==" + }, + "node_modules/typescript-cached-transpile/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/typescript-cached-transpile/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/typescript-cached-transpile/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/typescript-cached-transpile/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/typescript-json-schema": { "version": "0.50.1", "integrity": "sha512-GCof/SDoiTDl0qzPonNEV4CHyCsZEIIf+mZtlrjoD8vURCcEzEfa2deRuxYid8Znp/e27eDR7Cjg8jgGrimBCA==", @@ -14020,6 +14115,12 @@ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/jsonwebtoken": { "version": "8.5.5", "integrity": "sha512-OGqtHQ7N5/Ap/TUwO6IgHDuLiAoTmHhGpNvgkCm/F4N6pKzx/RBSfr2OXZSwC6vkfnsEdb6+7DNZVtiXiwdwFw==", @@ -19221,6 +19322,35 @@ } } }, + "tsconfig-paths": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", + "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "tslib": { "version": "2.3.1", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" @@ -19357,8 +19487,52 @@ }, "typescript": { "version": "4.4.3", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", - "dev": true + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==" + }, + "typescript-cached-transpile": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typescript-cached-transpile/-/typescript-cached-transpile-0.0.6.tgz", + "integrity": "sha512-bfPc7YUW0PrVkQHU0xN0ANRuxdPgoYYXtZEW6PNkH5a97/AOM+kPPxSTMZbpWA3BG1do22JUkfC60KoCKJ9VZQ==", + "requires": { + "@types/node": "^12.12.7", + "fs-extra": "^8.1.0", + "tslib": "^1.10.0" + }, + "dependencies": { + "@types/node": { + "version": "12.20.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.41.tgz", + "integrity": "sha512-f6xOqucbDirG7LOzedpvzjP3UTmHttRou3Mosx3vL9wr9AIQGhcPgVnqa8ihpZYnxyM1rxeNCvTyukPKZtq10Q==" + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + } + } }, "typescript-json-schema": { "version": "0.50.1", diff --git a/bundle/package.json b/bundle/package.json index fa64ce6b..7dc9a776 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -93,6 +93,7 @@ "missing-native-js-functions": "^1.2.18", "morgan": "^1.10.0", "multer": "^1.4.2", + "nanocolors": "^0.2.12", "node-fetch": "^2.6.1", "node-os-utils": "^1.3.5", "patch-package": "^6.4.7", @@ -105,8 +106,8 @@ "tslib": "^2.3.1", "typeorm": "^0.2.37", "typescript": "^4.1.2", + "typescript-cached-transpile": "^0.0.6", "typescript-json-schema": "^0.50.1", - "ws": "^7.4.2", - "nanocolors": "^0.2.12" + "ws": "^7.4.2" } -} \ No newline at end of file +} diff --git a/bundle/tsnode.tsconfig.json b/bundle/tsnode.tsconfig.json index 841cc013..422d336c 100644 --- a/bundle/tsnode.tsconfig.json +++ b/bundle/tsnode.tsconfig.json @@ -3,7 +3,8 @@ "ts-node": { "transpileOnly": true, "preferTsExts": true, - "require": ["tsconfig-paths/register"] + "require": ["tsconfig-paths/register"], + "compiler": "typescript-cached-transpile", }, "compilerOptions": { "rootDir": "../",