@unsetsoft/ryunixjs 0.2.37-nightly.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Ryunix.js +6 -17
- package/package.json +1 -1
- package/src/main.js +0 -2
- package/utils/config.cjs +12 -4
- package/webpack.config.mjs +8 -9
package/dist/Ryunix.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports'
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Ryunix = {}
|
|
5
|
-
})(this, (function (exports
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Ryunix = {}));
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const vars = {
|
|
8
8
|
containerRoot: null,
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
* @param root - The parameter "root" is the id of the HTML element that will serve as the container
|
|
120
120
|
* for the root element.
|
|
121
121
|
*/
|
|
122
|
-
const init
|
|
122
|
+
const init = (root) => {
|
|
123
123
|
const rootElement = root || "__ryunix";
|
|
124
124
|
vars.containerRoot = document.getElementById(rootElement);
|
|
125
125
|
};
|
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
var Ryunix = {
|
|
667
667
|
createElement,
|
|
668
668
|
render,
|
|
669
|
-
init
|
|
669
|
+
init,
|
|
670
670
|
Fragments,
|
|
671
671
|
Dom,
|
|
672
672
|
Workers,
|
|
@@ -675,22 +675,11 @@
|
|
|
675
675
|
Commits,
|
|
676
676
|
};
|
|
677
677
|
|
|
678
|
-
const route = express();
|
|
679
|
-
|
|
680
|
-
const useCors = (config = {}) => app.use(cors(config));
|
|
681
|
-
const init = (port) =>
|
|
682
|
-
route.listen(port, () => {
|
|
683
|
-
console.log("Server is runing at: https://localhost:" + port);
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
var index = { useCors, route, init };
|
|
687
|
-
|
|
688
678
|
window.Ryunix = Ryunix;
|
|
689
679
|
|
|
690
680
|
exports.Fragments = Fragments;
|
|
691
681
|
exports.Navigate = Navigate;
|
|
692
682
|
exports.Router = Router;
|
|
693
|
-
exports.Server = index;
|
|
694
683
|
exports.createContext = createContext;
|
|
695
684
|
exports.default = Ryunix;
|
|
696
685
|
exports.useContext = useContext;
|
package/package.json
CHANGED
package/src/main.js
CHANGED
package/utils/config.cjs
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
|
|
3
|
+
let config = {};
|
|
4
|
+
|
|
5
|
+
if (fs.existsSync("../../../../ryunix.config.js")) {
|
|
6
|
+
config = require("../../../../ryunix.config.js");
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
const defaultSettings = {
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
production: config?.production ? config.production : true,
|
|
11
|
+
buildDirectory: config?.buildDirectory ? config.buildDirectory : ".ryunix",
|
|
12
|
+
appDirectory: config?.appDirectory ? config.appDirectory : "src",
|
|
13
|
+
publicDirectory: config?.publicDirectory ? config.publicDirectory : "public",
|
|
6
14
|
};
|
|
7
15
|
|
|
8
16
|
module.exports = defaultSettings;
|
package/webpack.config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "url";
|
|
2
|
-
import { dirname, join
|
|
2
|
+
import { dirname, join } from "path";
|
|
3
3
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
4
4
|
import {
|
|
5
5
|
getPackageManager,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
resolveApp,
|
|
9
9
|
} from "./utils/index.mjs";
|
|
10
10
|
import fs from "fs";
|
|
11
|
+
import config from "./utils/config.cjs";
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
|
|
13
14
|
const __dirname = dirname(__filename);
|
|
@@ -21,17 +22,15 @@ if (manager === "yarn" || manager === "npm" || manager === "bun") {
|
|
|
21
22
|
throw new Error(`The manager ${manager} is not supported.`);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
console.log(config);
|
|
25
|
+
const mode = config.production ? "production" : "development";
|
|
27
26
|
|
|
28
27
|
export default {
|
|
29
|
-
mode
|
|
30
|
-
context:
|
|
28
|
+
mode,
|
|
29
|
+
context: resolveApp(dir, config.appDirectory),
|
|
31
30
|
entry: "./main.ryx",
|
|
32
31
|
devtool: "nosources-source-map",
|
|
33
32
|
output: {
|
|
34
|
-
path:
|
|
33
|
+
path: resolveApp(dir, config.buildDirectory),
|
|
35
34
|
chunkFilename: "./assets/js/[name].[fullhash:8].bundle.js",
|
|
36
35
|
assetModuleFilename: "./assets/media/[name].[hash][ext]",
|
|
37
36
|
filename: "./assets/js/[name].[fullhash:8].bundle.js",
|
|
@@ -132,8 +131,8 @@ export default {
|
|
|
132
131
|
},
|
|
133
132
|
plugins: [
|
|
134
133
|
new HtmlWebpackPlugin({
|
|
135
|
-
favicon:
|
|
136
|
-
template:
|
|
134
|
+
favicon: resolveApp(dir, `${config.publicDirectory}/favicon.png`),
|
|
135
|
+
template: resolveApp(dir, `${config.publicDirectory}/index.html`),
|
|
137
136
|
}),
|
|
138
137
|
],
|
|
139
138
|
externals: {
|