prettier formatted /bundle
This commit is contained in:
parent
3ff1f460ff
commit
b5c0ee7f30
4
bundle/.prettierrc
Normal file
4
bundle/.prettierrc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"useTabs": true,
|
||||||
|
"tabWidth": 4
|
||||||
|
}
|
@ -18,15 +18,24 @@ if (argv.includes("clean")) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fse.copySync(path.join(__dirname, "..", "..", "api", "assets"), path.join(__dirname, "..", "dist", "api", "assets"));
|
fse.copySync(
|
||||||
|
path.join(__dirname, "..", "..", "api", "assets"),
|
||||||
|
path.join(__dirname, "..", "dist", "api", "assets")
|
||||||
|
);
|
||||||
fse.copySync(
|
fse.copySync(
|
||||||
path.join(__dirname, "..", "..", "api", "client_test"),
|
path.join(__dirname, "..", "..", "api", "client_test"),
|
||||||
path.join(__dirname, "..", "dist", "api", "client_test")
|
path.join(__dirname, "..", "dist", "api", "client_test")
|
||||||
);
|
);
|
||||||
fse.copySync(path.join(__dirname, "..", "..", "api", "locales"), path.join(__dirname, "..", "dist", "api", "locales"));
|
fse.copySync(
|
||||||
|
path.join(__dirname, "..", "..", "api", "locales"),
|
||||||
|
path.join(__dirname, "..", "dist", "api", "locales")
|
||||||
|
);
|
||||||
dirs.forEach((a) => {
|
dirs.forEach((a) => {
|
||||||
fse.copySync("../" + a + "/src", "dist/" + a + "/src");
|
fse.copySync("../" + a + "/src", "dist/" + a + "/src");
|
||||||
if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
|
if (verbose)
|
||||||
|
console.log(
|
||||||
|
`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Copying src files done");
|
console.log("Copying src files done");
|
||||||
@ -35,7 +44,14 @@ console.log("Compiling src files ...");
|
|||||||
console.log(
|
console.log(
|
||||||
execSync(
|
execSync(
|
||||||
'node "' +
|
'node "' +
|
||||||
path.join(__dirname, "..", "node_modules", "typescript", "lib", "tsc.js") +
|
path.join(
|
||||||
|
__dirname,
|
||||||
|
"..",
|
||||||
|
"node_modules",
|
||||||
|
"typescript",
|
||||||
|
"lib",
|
||||||
|
"tsc.js"
|
||||||
|
) +
|
||||||
'" -p "' +
|
'" -p "' +
|
||||||
path.join(__dirname, "..") +
|
path.join(__dirname, "..") +
|
||||||
'"',
|
'"',
|
||||||
|
@ -5,10 +5,19 @@ const parts = ["api", "util", "cdn", "gateway"];
|
|||||||
const bundle = require("../package.json");
|
const bundle = require("../package.json");
|
||||||
|
|
||||||
for (const part of parts) {
|
for (const part of parts) {
|
||||||
const { devDependencies, dependencies } = require(path.join("..", "..", part, "package.json"));
|
const { devDependencies, dependencies } = require(path.join(
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
part,
|
||||||
|
"package.json"
|
||||||
|
));
|
||||||
bundle.devDependencies = { ...bundle.devDependencies, ...devDependencies };
|
bundle.devDependencies = { ...bundle.devDependencies, ...devDependencies };
|
||||||
bundle.dependencies = { ...bundle.dependencies, ...dependencies };
|
bundle.dependencies = { ...bundle.dependencies, ...dependencies };
|
||||||
delete bundle.dependencies["@fosscord/util"];
|
delete bundle.dependencies["@fosscord/util"];
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(path.join(__dirname, "..", "package.json"), JSON.stringify(bundle, null, "\t"), { encoding: "utf8" });
|
fs.writeFileSync(
|
||||||
|
path.join(__dirname, "..", "package.json"),
|
||||||
|
JSON.stringify(bundle, null, "\t"),
|
||||||
|
{ encoding: "utf8" }
|
||||||
|
);
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
"incremental": false /* Enable incremental compilation */,
|
"incremental": false /* Enable incremental compilation */,
|
||||||
"target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
"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'. */,
|
"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. */,
|
"lib": [
|
||||||
|
"ES2021"
|
||||||
|
] /* Specify library files to be included in the compilation. */,
|
||||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||||
"checkJs": true /* Report errors in .js files. */,
|
"checkJs": true /* Report errors in .js files. */,
|
||||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||||
@ -46,7 +48,9 @@
|
|||||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
// "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. */
|
// "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. */
|
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||||
"types": ["node"] /* Type declaration files to be included in compilation. */,
|
"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. */
|
// "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'. */,
|
"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. */
|
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user