anu-verzum 1.18.1 → 1.19.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <h3>@author: <strong>Anubis-programmer</strong></h3>
6
6
  <h3>@license: <strong>MIT</strong></h3>
7
- <h3>@version: <strong>1.18.1</strong></h3>
7
+ <h3>@version: <strong>1.19.0</strong></h3>
8
8
 
9
9
  <br>
10
10
 
@@ -46,47 +46,10 @@ Create a `babel.config.json` in your project root:
46
46
 
47
47
  <h3 id="webpack-setup">Webpack setup</h3>
48
48
 
49
- Install the required build dependencies:
50
-
51
- ```bash
52
- npm install --save-dev webpack webpack-cli webpack-dev-server html-webpack-plugin babel-loader @babel/core @babel/preset-env
53
- ```
54
-
55
- Create (or update) `webpack.config.js`:
49
+ All build tools ship with `anu-verzum` — no separate install needed. Create `webpack.config.js` in your project root:
56
50
 
57
51
  ```js
58
- const path = require('path');
59
- const HtmlWebpackPlugin = require('html-webpack-plugin');
60
-
61
- module.exports = {
62
- mode: 'development',
63
- entry: './src/index.tsx', // use index.js for JavaScript-only projects
64
- output: {
65
- path: path.resolve(__dirname, 'dist'),
66
- filename: 'bundle.js',
67
- publicPath: '/'
68
- },
69
- module: {
70
- rules: [
71
- {
72
- test: /\.[jt]sx?$/, // use /\.jsx?$/ for JavaScript-only projects
73
- exclude: /node_modules/,
74
- use: 'babel-loader'
75
- }
76
- ]
77
- },
78
- resolve: {
79
- extensions: ['.js', '.jsx', '.tsx', '.ts']
80
- },
81
- plugins: [
82
- new HtmlWebpackPlugin({ template: './index.html' })
83
- ],
84
- devServer: {
85
- port: 3000,
86
- historyApiFallback: true,
87
- open: true
88
- }
89
- };
52
+ module.exports = require('anu-verzum/webpack.config')(__dirname);
90
53
  ```
91
54
 
92
55
  Add scripts to `package.json`:
@@ -100,6 +63,16 @@ Add scripts to `package.json`:
100
63
  }
101
64
  ```
102
65
 
66
+ The default config targets `src/index.tsx` as the entry point and `index.html` as the HTML template, served on port 3000. Pass an options object to override any of these:
67
+
68
+ ```js
69
+ module.exports = require('anu-verzum/webpack.config')(__dirname, {
70
+ entry: './src/main.tsx',
71
+ template: './public/index.html',
72
+ port: 4000
73
+ });
74
+ ```
75
+
103
76
  <h3 id="importing-in-your-files">Importing in your files</h3>
104
77
 
105
78
  Every file that contains JSX must import `Anu`, because the JSX transform expands to `Anu.createElement(...)` calls at compile time:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anu-verzum",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "A \"React-like\" UI library that supports JSX syntax, Redux-like state management, array-rendering, i18n, routing and many more.",
5
5
  "keywords": [
6
6
  "anu-verzum",
@@ -13,7 +13,8 @@
13
13
  ],
14
14
  "files": [
15
15
  "dist",
16
- "babel-preset.js"
16
+ "babel-preset.js",
17
+ "webpack.config.js"
17
18
  ],
18
19
  "homepage": "https://github.com/Anubis-programmer/ANUVerzum#readme",
19
20
  "bugs": {
@@ -39,12 +40,17 @@
39
40
  },
40
41
  "dependencies": {
41
42
  "@babel/plugin-transform-react-jsx": "^7.21.0",
42
- "@babel/plugin-transform-typescript": "^7.28.6"
43
+ "@babel/plugin-transform-typescript": "^7.28.6",
44
+ "@babel/preset-env": "^7.21.0",
45
+ "babel-loader": "^9.0.0",
46
+ "html-webpack-plugin": "^5.0.0",
47
+ "webpack": "^5.0.0",
48
+ "webpack-cli": "^5.0.0",
49
+ "webpack-dev-server": "^5.0.0"
43
50
  },
44
51
  "devDependencies": {
45
52
  "@babel/cli": "^7.21.0",
46
53
  "@babel/core": "^7.21.0",
47
- "@babel/preset-env": "^7.21.0",
48
54
  "@babel/preset-typescript": "^7.28.5",
49
55
  "@eslint/js": "^10.0.1",
50
56
  "@typescript-eslint/eslint-plugin": "^8.59.3",
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const HtmlWebpackPlugin = require('html-webpack-plugin');
5
+
6
+ module.exports = (projectRoot, options = {}) => ({
7
+ mode: 'development',
8
+ entry: options.entry ?? path.join(projectRoot, 'src/index.tsx'),
9
+ output: {
10
+ path: path.join(projectRoot, 'dist'),
11
+ filename: 'bundle.js',
12
+ publicPath: '/'
13
+ },
14
+ module: {
15
+ rules: [
16
+ {
17
+ test: /\.[jt]sx?$/,
18
+ exclude: /node_modules/,
19
+ use: 'babel-loader'
20
+ }
21
+ ]
22
+ },
23
+ resolve: {
24
+ extensions: ['.js', '.jsx', '.ts', '.tsx']
25
+ },
26
+ plugins: [
27
+ new HtmlWebpackPlugin({
28
+ template: options.template ?? path.join(projectRoot, 'index.html')
29
+ })
30
+ ],
31
+ devServer: {
32
+ port: options.port ?? 3000,
33
+ historyApiFallback: true,
34
+ open: true
35
+ }
36
+ });