@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 CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('express'), require('cors')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'express', 'cors'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Ryunix = {}, global.express, global.cors));
5
- })(this, (function (exports, express, cors) { 'use strict';
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$1 = (root) => {
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: init$1,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunixjs",
3
- "version": "0.2.37-nightly.9",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.js",
6
6
  "private": false,
package/src/main.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import Ryunix from "./lib/index.js";
2
-
3
2
  export {
4
3
  useStore,
5
4
  useEffect,
@@ -12,5 +11,4 @@ export {
12
11
 
13
12
  window.Ryunix = Ryunix;
14
13
 
15
-
16
14
  export default Ryunix;
package/utils/config.cjs CHANGED
@@ -1,8 +1,16 @@
1
- const config = require("../../../../ryunix.config.js");
2
- console.log(config);
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
- buildDirectory: ".ryunix" || config.buildDirectory,
5
- appDirectory: "src" || config.appDirectory,
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;
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from "url";
2
- import { dirname, join, resolve } from "path";
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
- import config from "./utils/config.cjs";
25
-
26
- console.log(config);
25
+ const mode = config.production ? "production" : "development";
27
26
 
28
27
  export default {
29
- mode: "production",
30
- context: resolve(dir, config.appDirectory),
28
+ mode,
29
+ context: resolveApp(dir, config.appDirectory),
31
30
  entry: "./main.ryx",
32
31
  devtool: "nosources-source-map",
33
32
  output: {
34
- path: join(dir, config.buildDirectory),
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: join(dir, "public", "favicon.ico"),
136
- template: join(dir, "public", "index.html"),
134
+ favicon: resolveApp(dir, `${config.publicDirectory}/favicon.png`),
135
+ template: resolveApp(dir, `${config.publicDirectory}/index.html`),
137
136
  }),
138
137
  ],
139
138
  externals: {