frontend-hamroun 1.1.5 → 1.1.7

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.5",
3
+ "version": "1.1.7",
4
4
  "description": "A lightweight frontend framework with hooks and virtual DOM",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,8 @@
11
11
  "README.md",
12
12
  "LICENSE",
13
13
  "bin",
14
- "templates"
14
+ "templates",
15
+ "scripts"
15
16
  ],
16
17
  "exports": {
17
18
  ".": {
@@ -33,7 +34,9 @@
33
34
  "dev": "vite",
34
35
  "build": "vite build && tsc --emitDeclarationOnly",
35
36
  "clean": "rimraf dist",
36
- "prepublishOnly": "npm run clean && npm run build"
37
+ "prepublishOnly": "npm run clean && npm run build",
38
+ "postinstall": "node scripts/postinstall.js",
39
+ "prepare": "npm run build"
37
40
  },
38
41
  "keywords": [
39
42
  "frontend",
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { execSync } = require('child_process');
6
+
7
+ const packageRoot = path.resolve(__dirname, '..');
8
+
9
+ // Skip postinstall for development
10
+ if (process.env.NODE_ENV === 'development') {
11
+ process.exit(0);
12
+ }
13
+
14
+ try {
15
+ if (!fs.existsSync(path.join(packageRoot, 'dist'))) {
16
+ console.log('Building package...');
17
+ execSync('npm run build', {
18
+ cwd: packageRoot,
19
+ stdio: 'inherit'
20
+ });
21
+ }
22
+ } catch (error) {
23
+ console.warn('Warning: Failed to run postinstall build:', error.message);
24
+ // Don't exit with error to prevent blocking installations
25
+ process.exit(0);
26
+ }
@@ -9,10 +9,10 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "frontend-hamroun": "latest"
12
+ "frontend-hamroun": "^1.1.5"
13
13
  },
14
14
  "devDependencies": {
15
- "vite": "^4.4.9",
15
+ "vite": "^5.0.12",
16
16
  "typescript": "^5.0.0"
17
17
  }
18
18
  }