Compiler test

This commit is contained in:
The Arcane Brony 2021-10-06 18:20:22 +02:00
parent d99e5c565a
commit 7db9086dd0
29 changed files with 153 additions and 14 deletions

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"awooga.originalColorCustomizations": {},
"workbench.colorCustomizations": {}
}

9
api/.swcrc Normal file
View File

@ -0,0 +1,9 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2021"
}
}

BIN
api/package-lock.json generated

Binary file not shown.

View File

@ -40,6 +40,8 @@
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@babel/preset-typescript": "^7.15.0",
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.93",
"@types/amqplib": "^0.8.1",
"@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.9",
@ -102,7 +104,8 @@
"patch-package": "^6.4.7",
"supertest": "^6.1.6",
"tsconfig-paths": "^3.11.0",
"typeorm": "^0.2.37"
"typeorm": "^0.2.37",
"wsc": "^0.3.0"
},
"jest": {
"setupFiles": [

View File

@ -7,7 +7,7 @@
// "incremental": true, /* Enable incremental compilation */
"target": "ESNext" /* 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": ["ES2020"] /* Specify library files to be included in the compilation. */,
"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'. */

View File

@ -7,7 +7,7 @@
// "incremental": true, /* Enable incremental compilation */
"target": "ESNext" /* 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": ["ES2020"] /* Specify library files to be included in the compilation. */,
"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'. */

23
bundle/.swcrc Normal file
View File

@ -0,0 +1,23 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false,
"dynamicImport": false,
"privateMethod": false,
"functionBind": false,
"exportDefaultFrom": false,
"exportNamespaceFrom": false,
"decorators": false,
"decoratorsBeforeExport": false,
"topLevelAwait": false,
"importMeta": false
},
"transform": null,
"target": "es2021",
"loose": false,
"externalHelpers": false,
// Requires v1.2.50 or upper and requires target to be es2016 or upper.
"keepClassNames": false
}
}

BIN
bundle/package-lock.json generated

Binary file not shown.

View File

@ -7,7 +7,7 @@
"setup": "cd ../util && npm --production=false i && cd ../api && npm --production=false i && cd ../cdn && npm --production=false i && cd ../gateway && npm --production=false i && cd ../bundle/ && npm --production=false i && npm run build",
"build": "npm run build:util && npm run build:api && npm run build:cdn && npm run build:gateway && npm run build:bundle",
"postinstall": "ts-patch install -s",
"build:bundle": "npx tsc -b .",
"build:bundle": "swc src --out-dir dist",
"build:util": "cd ../util/ && npm run build",
"build:api": "cd ../api/ && npm run build",
"build:cdn": "cd ../cdn/ && npm run build",
@ -28,6 +28,8 @@
},
"homepage": "https://fosscord.com",
"devDependencies": {
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.93",
"@types/amqplib": "^0.8.1",
"@types/async-exit-hook": "^2.0.0",
"@types/bcrypt": "^5.0.0",
@ -59,6 +61,7 @@
"missing-native-js-functions": "^1.2.17",
"nanocolors": "^0.2.12",
"node-os-utils": "^1.3.5",
"swc": "^1.0.11",
"tsconfig-paths": "^3.11.0"
}
}

18
bundle/src/build.js Normal file
View File

@ -0,0 +1,18 @@
const { exec, spawn } = require("child_process");
const { exitCode } = require("process");
let parts = "api,cdn,gateway,util,bundle".split(",");
parts.forEach(element => {
// exec(`npm --prefix ../${element} run build`, (error, stdout, stderr) => {
// if (error) {
// console.log(`error: ${error.message}`);
// return;
// }
// if (stderr) {
// console.log(`stderr: ${stderr}`);
// return;
// }
// console.log(`stdout: ${stdout}`);
// });
spawn("npm", ["run", "build"], {cwd: `../${element}`});
});

View File

@ -4,10 +4,10 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"incremental": true, /* Enable incremental compilation */
"target": "ESNext" /* 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": ["ES2020"] /* Specify library files to be included in the compilation. */,
"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'. */

View File

@ -0,0 +1 @@
{"version":"4.4.3"}

9
cdn/.swcrc Normal file
View File

@ -0,0 +1,9 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2021"
}
}

BIN
cdn/package-lock.json generated

Binary file not shown.

View File

@ -7,7 +7,7 @@
"scripts": {
"postinstall": "ts-patch install -s",
"test": "npm run build && jest --coverage ./tests",
"build": "npx tsc -b .",
"build": "swc src --out-dir dist",
"start": "npm run build && node dist/start.js"
},
"repository": {
@ -22,6 +22,8 @@
},
"homepage": "https://github.com/fosscord/fosscord-server#readme",
"devDependencies": {
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.93",
"@types/amqplib": "^0.8.1",
"@types/body-parser": "^1.19.0",
"@types/btoa": "^1.2.3",
@ -59,6 +61,7 @@
"nanocolors": "^0.2.12",
"node-fetch": "^2.6.1",
"supertest": "^6.1.6",
"swc": "^1.0.11",
"typescript": "^4.1.2",
"uuid": "^8.3.2"
},

View File

@ -4,7 +4,7 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"incremental": true, /* 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": ["ES2015", "dom"] /* Specify library files to be included in the compilation. */,

1
cdn/tsconfig.tsbuildinfo Normal file

File diff suppressed because one or more lines are too long

23
dashboard/.swcrc Normal file
View File

@ -0,0 +1,23 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false,
"dynamicImport": false,
"privateMethod": false,
"functionBind": false,
"exportDefaultFrom": false,
"exportNamespaceFrom": false,
"decorators": false,
"decoratorsBeforeExport": false,
"topLevelAwait": false,
"importMeta": false
},
"transform": null,
"target": "es2021",
"loose": false,
"externalHelpers": false,
// Requires v1.2.50 or upper and requires target to be es2016 or upper.
"keepClassNames": false
}
}

9
gateway/.swcrc Normal file
View File

@ -0,0 +1,9 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2021"
}
}

Binary file not shown.

View File

@ -7,13 +7,15 @@
"postinstall": "npx ts-patch install -s",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run build && node dist/start.js",
"build": "npx tsc -b .",
"build": "swc src --out-dir dist",
"dev": "tsnd --respawn src/start.ts"
},
"keywords": [],
"author": "Fosscord",
"license": "ISC",
"devDependencies": {
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.93",
"@types/amqplib": "^0.8.1",
"@types/jsonwebtoken": "^8.5.0",
"@types/mongodb": "^3.6.9",
@ -38,6 +40,7 @@
"missing-native-js-functions": "^1.2.17",
"mongoose-autopopulate": "^0.12.3",
"node-fetch": "^2.6.1",
"swc": "^1.0.11",
"typeorm": "^0.2.37",
"uuid": "^8.3.2",
"ws": "^7.4.2"

View File

@ -5,7 +5,7 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"incremental": true, /* Enable incremental compilation */
"target": "ES2020" /* 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": ["ES2015", "ES2020.BigInt", "DOM"] /* Specify library files to be included in the compilation. */,

9
rtc/.swcrc Normal file
View File

@ -0,0 +1,9 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2021"
}
}

9
util/.swcrc Normal file
View File

@ -0,0 +1,9 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2021"
}
}

BIN
util/package-lock.json generated

Binary file not shown.

View File

@ -8,7 +8,7 @@
"start": "npm run build && node dist/",
"test": "npm run build && jest",
"postinstall": "npm run build",
"build": "npx tsc -b ."
"build": "swc src --out-dir dist"
},
"repository": {
"type": "git",
@ -28,6 +28,8 @@
},
"homepage": "https://docs.fosscord.com/",
"devDependencies": {
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.93",
"@types/amqplib": "^0.8.1",
"@types/jsonwebtoken": "^8.5.0",
"@types/mongoose-autopopulate": "^0.10.1",
@ -52,6 +54,7 @@
"pg": "^8.7.1",
"reflect-metadata": "^0.1.13",
"sqlite3": "^5.0.2",
"swc": "^1.0.11",
"tsconfig-paths": "^3.11.0",
"typeorm": "^0.2.37",
"typescript": "^4.4.2",

View File

@ -4,10 +4,10 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"incremental": true, /* 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": ["ES2020"] /* Specify library files to be included in the compilation. */,
"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'. */

9
webrtc/.swcrc Normal file
View File

@ -0,0 +1,9 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2021"
}
}

View File

@ -7,7 +7,7 @@
// "incremental": true, /* Enable incremental compilation */
"target": "ESNext" /* 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": ["ES2020"] /* Specify library files to be included in the compilation. */,
"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'. */