frontend-hamroun 1.2.2 → 1.2.4

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 (35) hide show
  1. package/bin/cli.cjs +16 -0
  2. package/bin/cli.mjs +237 -0
  3. package/dist/frontend-hamroun.es.js +16 -32
  4. package/dist/frontend-hamroun.es.js.map +1 -1
  5. package/dist/frontend-hamroun.umd.js.map +1 -1
  6. package/package.json +5 -4
  7. package/scripts/build-cli.js +409 -121
  8. package/templates/basic/.eslintignore +5 -0
  9. package/templates/basic/.eslintrc.json +25 -0
  10. package/templates/basic/docs/rapport_pfe.aux +27 -0
  11. package/templates/basic/docs/rapport_pfe.log +399 -0
  12. package/templates/basic/docs/rapport_pfe.out +10 -0
  13. package/templates/basic/docs/rapport_pfe.pdf +0 -0
  14. package/templates/basic/docs/rapport_pfe.tex +68 -0
  15. package/templates/basic/docs/rapport_pfe.toc +14 -0
  16. package/templates/basic/index.html +12 -0
  17. package/templates/basic/package.json +30 -0
  18. package/templates/basic/postcss.config.js +7 -0
  19. package/templates/basic/src/App.tsx +65 -0
  20. package/templates/basic/src/api.ts +58 -0
  21. package/templates/basic/src/components/Counter.tsx +26 -0
  22. package/templates/basic/src/components/Header.tsx +9 -0
  23. package/templates/basic/src/components/TodoList.tsx +90 -0
  24. package/templates/basic/src/main.css +3 -0
  25. package/templates/basic/src/main.ts +20 -0
  26. package/templates/basic/src/main.tsx +144 -0
  27. package/templates/basic/src/server.ts +99 -0
  28. package/templates/basic/tailwind.config.js +32 -0
  29. package/templates/basic/tsconfig.json +13 -0
  30. package/templates/basic/vite.config.ts +86 -0
  31. package/templates/basic-app/package.json +5 -15
  32. package/templates/basic-app/vite.config.ts +66 -2
  33. package/templates/full-stack/package.json +2 -19
  34. package/templates/full-stack/vite.config.ts +79 -0
  35. package/bin/cli.js +0 -16
@@ -0,0 +1,79 @@
1
+ import { defineConfig } from 'vite';
2
+ import { nodePolyfills } from 'vite-plugin-node-polyfills';
3
+
4
+ export default defineConfig({
5
+ esbuild: {
6
+ jsxFactory: 'jsx',
7
+ jsxFragment: 'Fragment'
8
+ },
9
+ build: {
10
+ outDir: 'dist',
11
+ emptyOutDir: true,
12
+ rollupOptions: {
13
+ // Mark server-side dependencies as external
14
+ external: [
15
+ 'express',
16
+ 'compression',
17
+ 'helmet',
18
+ 'morgan',
19
+ 'bcrypt',
20
+ 'jsonwebtoken',
21
+ 'mongoose',
22
+ 'aws-sdk',
23
+ 'nock',
24
+ 'mock-aws-s3',
25
+ '@mswjs/interceptors',
26
+ /node:.*/
27
+ ]
28
+ }
29
+ },
30
+ server: {
31
+ port: 3000,
32
+ open: true,
33
+ proxy: {
34
+ '/api': {
35
+ target: 'http://localhost:3001',
36
+ changeOrigin: true
37
+ }
38
+ }
39
+ },
40
+ optimizeDeps: {
41
+ esbuildOptions: {
42
+ define: {
43
+ global: 'globalThis'
44
+ },
45
+ plugins: [
46
+ {
47
+ name: 'node-modules-polyfill',
48
+ setup(build) {
49
+ build.onResolve({ filter: /^node:/ }, () => {
50
+ return { external: true };
51
+ });
52
+ build.onResolve({ filter: /\.html$/ }, () => {
53
+ return { external: true };
54
+ });
55
+ }
56
+ }
57
+ ]
58
+ },
59
+ exclude: [
60
+ 'mock-aws-s3',
61
+ 'aws-sdk',
62
+ 'nock',
63
+ '@mswjs/interceptors',
64
+ 'node-pre-gyp',
65
+ 'bcrypt'
66
+ ]
67
+ },
68
+ plugins: [
69
+ nodePolyfills({
70
+ protocolImports: true,
71
+ }),
72
+ ],
73
+ resolve: {
74
+ alias: {
75
+ '@mswjs/interceptors/presets/node': { find: /^@mswjs\/interceptors\/presets\/node/, replacement: '{}' },
76
+ './util/nw-pre-gyp/index.html': { find: './util/nw-pre-gyp/index.html', replacement: '{}' }
77
+ }
78
+ }
79
+ });
package/bin/cli.js DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('path');
4
- const fs = require('fs');
5
-
6
- try {
7
- // Try to load the ESM version
8
- import('../dist/cli/index.js')
9
- .catch(err => {
10
- console.error('Failed to load CLI:', err);
11
- process.exit(1);
12
- });
13
- } catch (error) {
14
- console.error('Error loading CLI:', error);
15
- process.exit(1);
16
- }