@unsetsoft/ryunixjs 0.2.6-alpha.0 → 0.2.6-alpha.2

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/.babelrc ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ [
5
+ "@babel/preset-react",
6
+ {
7
+ "runtime": "automatic"
8
+ }
9
+ ]
10
+ ],
11
+ "plugins": [
12
+ [
13
+ "@babel/plugin-transform-react-jsx",
14
+ {
15
+ "pragma": "Ryunix.createElement"
16
+ }
17
+ ],
18
+ "@babel/plugin-proposal-class-properties"
19
+ ]
20
+ }
package/bin/index.js ADDED
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env node
2
+ const yargs = require("yargs");
3
+ const { hideBin } = require("yargs/helpers");
4
+ const runServer = require("./serve");
5
+ const serv = {
6
+ command: "server",
7
+ describe: "Run server",
8
+ handler: async (arg) => {
9
+ runServer();
10
+ },
11
+ };
12
+ yargs(hideBin(process.argv)).command(serv).parse();
package/bin/serve.js ADDED
@@ -0,0 +1,20 @@
1
+ const Webpack = require("webpack");
2
+ const WebpackDevServer = require("webpack-dev-server");
3
+ const webpackConfig = require("../webpack.config.js");
4
+
5
+ const compiler = Webpack(webpackConfig);
6
+ const devServerOptions = { ...webpackConfig.devServer, open: true };
7
+ const server = new WebpackDevServer(devServerOptions, compiler);
8
+
9
+ const runServer = async () => {
10
+ console.log("Starting server...");
11
+ await server.start();
12
+
13
+ server.startCallback(() => {
14
+ console.log(
15
+ `Successfully started server on http://localhost:${webpackConfig.devServer.port}`
16
+ );
17
+ });
18
+ };
19
+
20
+ module.exports = runServer;
package/lib/dom.js CHANGED
@@ -185,6 +185,7 @@ function commitWork(fiber) {
185
185
  } else if (fiber.effectTag === "DELETION") {
186
186
  cancelEffects(fiber);
187
187
  commitDeletion(fiber, domParent);
188
+ return;
188
189
  }
189
190
 
190
191
  commitWork(fiber.child);
@@ -200,7 +201,7 @@ function commitWork(fiber) {
200
201
  */
201
202
  function commitDeletion(fiber, domParent) {
202
203
  if (fiber.dom) {
203
- fiber.dom.remove();
204
+ domParent.removeChild(fiber.dom);
204
205
  } else {
205
206
  commitDeletion(fiber.child, domParent);
206
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunixjs",
3
- "version": "0.2.6-alpha.0",
3
+ "version": "0.2.6-alpha.2",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.js",
6
6
  "private": false,
@@ -12,10 +12,33 @@
12
12
  "build": "rollup ./lib/main.js --file ./dist/Ryunix.js --format umd --name Ryunix",
13
13
  "postinstall": "yarn build"
14
14
  },
15
+ "bin": {
16
+ "ryunix": "./bin/index.js"
17
+ },
15
18
  "dependencies": {
16
- "rollup": "3.24.0"
19
+ "rollup": "3.24.0",
20
+ "yargs": "^17.7.2"
21
+ },
22
+ "devDependencies": {
23
+ "@babel/core": "^7.22.5",
24
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
25
+ "@babel/plugin-transform-react-jsx": "^7.22.5",
26
+ "@babel/preset-env": "^7.22.5",
27
+ "@babel/preset-react": "^7.22.5",
28
+ "babel-loader": "^9.1.2",
29
+ "css-loader": "6.8.1",
30
+ "error-overlay-webpack-plugin": "^1.1.1",
31
+ "file-loader": "^6.2.0",
32
+ "html-webpack-plugin": "^5.5.2",
33
+ "image-webpack-loader": "8.1.0",
34
+ "node-sass": "9.0.0",
35
+ "sass-loader": "13.3.2",
36
+ "style-loader": "3.3.3",
37
+ "webpack": "^5.86.0",
38
+ "webpack-cli": "^5.1.4",
39
+ "webpack-dev-server": "^4.15.1"
17
40
  },
18
41
  "engines": {
19
42
  "node": ">=18.16.0"
20
43
  }
21
- }
44
+ }
@@ -0,0 +1,49 @@
1
+ const path = require("path");
2
+ const HtmlWebpackPlugin = require("html-webpack-plugin");
3
+ const ErrorOverlayPlugin = require("error-overlay-webpack-plugin");
4
+
5
+ const dir = path.dirname(require.main.filename);
6
+
7
+ module.exports = {
8
+ mode: process.env.NODE_ENV !== "production" ? "development" : "production",
9
+ entry: path.join(dir, "src", "main.ryx"),
10
+ output: {
11
+ path: path.resolve(dir, ".ryunix"),
12
+ filename: "./assets/js/[chunkhash].bundle.js",
13
+ },
14
+ devServer: {
15
+ port: 3000,
16
+ },
17
+ module: {
18
+ rules: [
19
+ {
20
+ test: /\.(js|jsx|ts|tsx|ryx)$/,
21
+ exclude: /node_modules/,
22
+ use: {
23
+ loader: "babel-loader",
24
+ options: {
25
+ presets: ["@babel/preset-env", "@babel/preset-react"],
26
+ },
27
+ },
28
+ },
29
+ {
30
+ test: /\.(css|scss)$/,
31
+ use: ["style-loader", "css-loader"],
32
+ },
33
+ {
34
+ test: /\.(jpg|jpeg|png|gif|mp3|svg|mp4)$/,
35
+ use: ["file-loader"],
36
+ },
37
+ ],
38
+ },
39
+ resolve: {
40
+ extensions: ["*", ".js", ".jsx", ".ts", ".tsx", ".ryx"],
41
+ },
42
+ plugins: [
43
+ new HtmlWebpackPlugin({
44
+ template: path.join(dir, "public", "index.html"),
45
+ //favicon: path.join(dir, "public", "favicon.ico"),
46
+ }),
47
+ new ErrorOverlayPlugin(),
48
+ ],
49
+ };