frontend-hamroun 1.1.35 → 1.1.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontend-hamroun",
3
- "version": "1.1.35",
3
+ "version": "1.1.37",
4
4
  "description": "A lightweight frontend framework with hooks and virtual DOM",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -6,19 +6,14 @@
6
6
  "scripts": {
7
7
  "dev": "node server.js",
8
8
  "build": "node esbuild.config.js",
9
- "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10
- "lint:fix": "eslint src --ext ts,tsx --fix"
9
+ "lint": "eslint src --ext ts,tsx"
11
10
  },
12
11
  "dependencies": {
13
12
  "frontend-hamroun": "latest"
14
13
  },
15
14
  "devDependencies": {
16
- "typescript": "^5.0.0",
17
15
  "esbuild": "^0.19.2",
18
- "@typescript-eslint/eslint-plugin": "^6.0.0",
19
- "@typescript-eslint/parser": "^6.0.0",
20
- "eslint": "^8.45.0",
21
- "eslint-plugin-react-hooks": "^4.6.0",
22
- "live-server": "^1.2.2"
16
+ "sirv-cli": "^2.0.2",
17
+ "typescript": "^5.0.0"
23
18
  }
24
19
  }
@@ -1,27 +1,24 @@
1
1
  import { spawn } from 'child_process';
2
- import liveServer from 'live-server';
2
+ import sirv from 'sirv';
3
+ import http from 'http';
3
4
 
4
5
  // Start esbuild in watch mode
5
6
  const esbuild = spawn('node', ['esbuild.config.js', '--watch'], {
6
7
  stdio: 'inherit'
7
8
  });
8
9
 
9
- // Start live-server
10
- const params = {
11
- port: 8080,
12
- host: "0.0.0.0",
13
- root: ".",
14
- open: true,
15
- wait: 1000,
16
- logLevel: 2
17
- };
10
+ // Create simple static server
11
+ const serve = sirv('.', {
12
+ dev: true,
13
+ single: true
14
+ });
18
15
 
19
- liveServer.start(params);
16
+ const server = http.createServer(serve);
17
+ server.listen(3000);
18
+ console.log('Server running at http://localhost:3000');
20
19
 
21
- // Handle process termination
22
- // eslint-disable-next-line no-undef
23
20
  process.on('SIGTERM', () => {
24
21
  esbuild.kill();
25
- // eslint-disable-next-line no-undef
22
+ server.close();
26
23
  process.exit();
27
24
  });
@@ -0,0 +1,4 @@
1
+ import { jsx as createElement, Fragment } from 'frontend-hamroun';
2
+
3
+ window.createElement = createElement;
4
+ window.Fragment = Fragment;