neutronium 1.5.0 → 1.7.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PFMCODES
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -15,8 +15,8 @@ function compileProject(projectDir = process.cwd()) {
15
15
  const outHtmlPath = path.join(distDir, 'index.html');
16
16
  const outJsPath = path.join(distDir, 'App.compiled.js');
17
17
 
18
- // Use relative path to Neutronium source
19
- const neutroniumPath = path.relative(distDir, path.join(projectDir, 'node_modules/neutronium/src/index.js')).replace(/\\/g, '/');
18
+ // Use direct path to neutronium module
19
+ const neutroniumPath = '../node_modules/neutronium/src/index.js';
20
20
 
21
21
  try {
22
22
  log('📖 Reading App.js...');
@@ -29,7 +29,6 @@ function compileProject(projectDir = process.cwd()) {
29
29
  plugins: [['@babel/plugin-transform-react-jsx', { pragma: 'h' }]],
30
30
  });
31
31
 
32
- log('📦 Writing App.compiled.js...');
33
32
  const finalJsCode = `
34
33
  import { h, createApp } from '${neutroniumPath}';
35
34
 
@@ -73,8 +72,14 @@ function serveProject(projectDir = process.cwd(), port = 3000) {
73
72
  const distDir = path.join(projectDir, 'dist');
74
73
 
75
74
  const server = http.createServer((req, res) => {
76
- let reqPath = req.url === '/' ? '/index.html' : req.url;
77
- const filePath = path.join(distDir, reqPath);
75
+ let reqPath = req.url;
76
+
77
+ // Redirect "/" to "dist/index.html"
78
+ if (reqPath === '/' || reqPath === '/index.html') {
79
+ reqPath = '/dist/index.html';
80
+ }
81
+
82
+ const filePath = path.join(projectDir, reqPath);
78
83
 
79
84
  if (!fs.existsSync(filePath)) {
80
85
  res.writeHead(404);
@@ -104,4 +109,4 @@ function serveProject(projectDir = process.cwd(), port = 3000) {
104
109
  return server;
105
110
  }
106
111
 
107
- module.exports = { compileProject, compileProjectWatch };
112
+ module.exports = { compileProject, compileProjectWatch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neutronium",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "A dense, efficient JavaScript framework for building modern web applications",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
package/.babelrc DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "plugins": [
3
- [
4
- "@babel/plugin-transform-react-jsx",
5
- {
6
- "pragma": "h",
7
- "pragmaFrag": "Fragment"
8
- }
9
- ]
10
- ]
11
- }
package/test-open.js DELETED
@@ -1,6 +0,0 @@
1
-
2
- const { default:open } = require('open');
3
-
4
- open('http://localhost:3000').catch(err => {
5
- console.error('❌ Failed to open browser:', err);
6
- });