This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
261 changed files
with
8,631 additions
and
8,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
{ | ||
"scripts": { | ||
"_build_core": "cd ./projects/melon-core && npm run build && cd ../..", | ||
"_build_tests": "cd ./projects/melon-tests && npm run build && cd ../..", | ||
"_apply_core_bundle_windows": "xcopy .\\projects\\melon-core\\dist\\core.js .\\projects\\melon-runtime\\MelonRuntime.Core\\Scripts\\core.js /Y", | ||
"_apply_core_bundle_linux": "cp ./projects/melon-core/dist/core.js ./projects/melon-runtime/Melon.Library/Bundle/core.js", | ||
"_apply_tests_bundle_windows": "xcopy .\\projects\\melon-tests\\dist\\tests.js .\\projects\\melon-runtime\\MelonRuntime.Core\\Scripts\\tests.js /Y", | ||
"_apply_tests_bundle_linux": "cp ./projects/melon-tests/dist/tests.js ./projects/melon-runtime/Melon.Library/Bundle/tests.js", | ||
"_build_runtime": "cd ./projects/melon-runtime && npm run build && cd ../..", | ||
"_run": "cd ./projects/melon-runtime && npm run dev && cd ../..", | ||
"build:win": "npm run _build_core && npm run _apply_core_bundle_windows && npm run _build_tests && npm run _apply_tests_bundle_windows && npm run _build_runtime", | ||
"build:linux": "npm run _build_core && npm run _apply_core_bundle_linux && npm run _build_tests && npm run _apply_tests_bundle_linux && npm run _build_runtime", | ||
"dev:win": "npm run build:win && npm run _run", | ||
"dev:linux": "npm run build:linux && npm run _run", | ||
"install-dev:win": "npm run build:win && cd ./projects/melon-runtime && npm i -g -f && cd ../..", | ||
"install-dev:linux": "npm run build:linux && cd ./projects/melon-runtime && npm i -g -f && cd ../..", | ||
"all-benchmarks": "cd ./projects/melon-benchmarks/ && npm run all-benchmarks" | ||
"build": "cd projects/core && npm run build && cd ../native && npm run build", | ||
"dev": "cd projects/native && npm run dev" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"presets": ["@babel/preset-typescript", "@babel/preset-env"], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"alias": { | ||
"types": "./types", | ||
"logic": "./logic" | ||
} | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import { spawnSync } from "child_process" | ||
import { mkdirSync, cpSync, rmSync, existsSync } from "fs" | ||
|
||
/* | ||
:: [core] building Script | ||
:: ========================= | ||
:: Warning: "-i" will overwrite the packages '@babel/core', | ||
:: '@babel/cli' and 'webpack-cli' globally. | ||
*/ | ||
|
||
export const CHILD_SPAWN_OPTIONS: unknown = { | ||
stdio: "inherit", | ||
shell: true | ||
}; | ||
|
||
const GLOBAL_INSTALLS = [ | ||
"@babel/cli", | ||
"@babel/core", | ||
"webpack-cli" | ||
]; | ||
|
||
const args = process.argv; | ||
const forceGlobalInstalls = args.includes(" -i "); | ||
const keepCache = args.includes(" -kc "); | ||
|
||
if (args.includes(" --help ")) { | ||
console.log(" --kc | Keep the previous build cache") | ||
console.log(" -i | Forces global installs") | ||
process.exit(0); | ||
} | ||
|
||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Melon Runtime Builder - Core"); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
if (forceGlobalInstalls) { | ||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Installing Global Dependencies"); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
spawnSync("npm", [ | ||
"install", | ||
...GLOBAL_INSTALLS, | ||
"-g", | ||
"-f" | ||
], CHILD_SPAWN_OPTIONS); | ||
} | ||
|
||
if (!keepCache) { | ||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Cleaning the previous build..."); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
if (existsSync(__dirname + "\\output")) { | ||
rmSync(__dirname + "\\output", { recursive: true, force: true }); | ||
} | ||
} | ||
|
||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Installing Local Dependencies..."); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
mkdirSync("output"); | ||
|
||
spawnSync("npm", [ | ||
"install", | ||
"-f" | ||
], CHILD_SPAWN_OPTIONS); | ||
|
||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Executing transpiler (TypeScript >> JavaScript)..."); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
spawnSync("echo", ["a"]) | ||
spawnSync("npx", [ | ||
"babel", | ||
"--extensions", | ||
".ts", | ||
__dirname + "\\", | ||
"--out-dir", | ||
__dirname + "\\output\\js-logic" | ||
], CHILD_SPAWN_OPTIONS); | ||
|
||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Executing bundler (JavaScript >> Core bundle)..."); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
spawnSync("npx", [ | ||
"webpack", | ||
__dirname + "\\output\\js-logic\\logic\\index.js", | ||
"--config webpack.config.json" | ||
], CHILD_SPAWN_OPTIONS); | ||
|
||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Copying output files..."); | ||
console.log("──────────────────────────────────────────────────────"); | ||
|
||
cpSync(__dirname + "\\dist", __dirname + "\\output\\final", { recursive: true, force: true }); | ||
rmSync(__dirname + "\\dist", { recursive: true, force: true }); | ||
|
||
console.log("──────────────────────────────────────────────────────"); | ||
console.log("Done."); | ||
console.log("──────────────────────────────────────────────────────"); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Utilitary imports | ||
import { setupEnvironmentVariables } from "logic/runtime/global-environment-core"; | ||
import { addPrototypeExtension } from "./partials/utils/generic/addPrototypeExtension"; | ||
import { and } from "logic/runtime/global-extensions"; | ||
|
||
// Isolated imports | ||
import { _Version } from "./partials/constructors/_Version" | ||
|
||
// Module imports | ||
import { console as _console } from "logic/partials/modules/console/console" | ||
import { dotnet } from "./partials/modules/dotnet/dotnet" | ||
import { _crypto } from "./partials/statics/_Crypto" | ||
import { _fs } from "./partials/modules/fs/fs" | ||
import { _guards } from "./partials/modules/guards/_guards" | ||
import { http } from "./partials/modules/http/http" | ||
import { _std } from "./partials/modules/std/_std" | ||
import { _data } from "./partials/modules/data/_data" | ||
import { testing } from "./partials/modules/testing/testing" | ||
import { runtime } from "./partials/modules/runtime/runtime" | ||
import { interopCache } from "./runtime/interop-cache-core"; | ||
|
||
setupEnvironmentVariables(); | ||
addPrototypeExtension(Object, "and", and); | ||
|
||
const Melon = { | ||
console: _console, | ||
testing, | ||
std: _std, | ||
data: _data, | ||
guards: _guards, | ||
fs: _fs, | ||
http, | ||
dotnet, | ||
crypto: _crypto, | ||
runtime, | ||
Version: _Version | ||
} | ||
|
||
globalThis["Melon"] = Melon; | ||
|
||
export { Melon } |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.