frontend-hamroun 1.1.62 → 1.1.64

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.
Files changed (2) hide show
  1. package/bin/cli.js +12 -3
  2. package/package.json +2 -2
package/bin/cli.js CHANGED
@@ -45,16 +45,25 @@ async function buildProject(root, isDev = false) {
45
45
  define: {
46
46
  'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production')
47
47
  },
48
+ // Update plugins to properly resolve frontend-hamroun
48
49
  plugins: [{
49
- name: 'jsx-import',
50
+ name: 'framework-resolve',
50
51
  setup(build) {
52
+ // Handle framework imports
53
+ build.onResolve({ filter: /^frontend-hamroun$/ }, () => ({
54
+ path: path.resolve(root, 'node_modules/frontend-hamroun/dist/index.mjs')
55
+ }));
56
+
57
+ // Handle JSX files
51
58
  build.onResolve({ filter: /\.[tj]sx$/ }, args => ({
52
- path: args.path,
59
+ path: path.resolve(args.resolveDir, args.path),
53
60
  namespace: 'jsx-namespace'
54
61
  }));
62
+
55
63
  build.onLoad({ filter: /\.[tj]sx$/, namespace: 'jsx-namespace' }, async args => ({
56
64
  contents: `import { createElement, Fragment } from 'frontend-hamroun';\n${await fs.readFile(args.path, 'utf8')}`,
57
- loader: 'tsx'
65
+ loader: 'tsx',
66
+ resolveDir: path.dirname(args.path)
58
67
  }));
59
68
  }
60
69
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontend-hamroun",
3
- "version": "1.1.62",
3
+ "version": "1.1.64",
4
4
  "description": "A lightweight frontend framework with hooks and virtual DOM",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "license": "MIT",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "your-repo-url"
45
+ "url": "https://github.com/your-username/frontend-hamroun"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/react": "^19.0.8",