@unsetsoft/ryunixjs 0.2.37-nightly.11 → 0.2.37-nightly.13

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.11",
3
+ "version": "0.2.37-nightly.13",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.js",
6
6
  "private": false,
@@ -29,8 +29,10 @@
29
29
  "@babel/preset-react": "^7.22.5",
30
30
  "@mdx-js/loader": "^2.3.0",
31
31
  "babel-loader": "^9.1.3",
32
+ "cors": "^2.8.5",
32
33
  "crypto": "^1.0.1",
33
34
  "css-loader": "^6.8.1",
35
+ "express": "^4.18.2",
34
36
  "file-loader": "^6.2.0",
35
37
  "glob": "^10.3.7",
36
38
  "html-loader": "^4.2.0",
package/src/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Ryunix from "./lib/index.js";
2
-
2
+ import Server from "./server/index.js";
3
3
  export {
4
4
  useStore,
5
5
  useEffect,
@@ -12,5 +12,5 @@ export {
12
12
 
13
13
  window.Ryunix = Ryunix;
14
14
 
15
-
15
+ export { Server };
16
16
  export default Ryunix;
@@ -0,0 +1,11 @@
1
+ import express from "express";
2
+ import cors from "cors";
3
+ const route = express();
4
+
5
+ const useCors = (config = {}) => app.use(cors(config));
6
+ const init = (port) =>
7
+ route.listen(port, () => {
8
+ console.log("Server is runing at: https://localhost:" + port);
9
+ });
10
+
11
+ export default { useCors, route, init };
package/utils/config.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  const config = require("../../../../ryunix.config.js");
2
- console.log(config);
3
2
  const defaultSettings = {
3
+ production: config?.production ? config.production : true,
4
4
  buildDirectory: config?.buildDirectory ? config.buildDirectory : ".ryunix",
5
5
  appDirectory: config?.appDirectory ? config.appDirectory : "src",
6
6
  publicDirectory: config?.publicDirectory ? config.publicDirectory : "public",
@@ -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,12 +22,8 @@ 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);
27
-
28
25
  export default {
29
- mode: "production",
26
+ mode: config.production ? "production" : "development",
30
27
  context: resolveApp(dir, config.appDirectory),
31
28
  entry: "./main.ryx",
32
29
  devtool: "nosources-source-map",
@@ -38,6 +35,7 @@ export default {
38
35
  devtoolModuleFilenameTemplate: "ryunix/[resource-path]",
39
36
  clean: true,
40
37
  },
38
+ target: "node",
41
39
  devServer: {
42
40
  hot: true,
43
41
  historyApiFallback: {
@@ -138,5 +136,6 @@ export default {
138
136
  ],
139
137
  externals: {
140
138
  ryunix: "Ryunix",
139
+ express: { commonjs: "express" },
141
140
  },
142
141
  };