@vixoniccom/module-packager 2.11.0-dev.7 → 2.11.0-dev.9

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/dist/electron.js CHANGED
@@ -29,6 +29,7 @@ function createWindow() {
29
29
  height: 768,
30
30
  webPreferences: {
31
31
  nodeIntegrationInSubFrames: true,
32
+ allowRunningInsecureContent: true,
32
33
  nodeIntegration: true,
33
34
  contextIsolation: false,
34
35
  webSecurity: false,
@@ -26,7 +26,7 @@
26
26
  const win = remote.getCurrentWindow()
27
27
 
28
28
  webview.setAttribute('nodeintegration', '')
29
- webview.setAttribute('webpreferences', 'contextIsolation=no, nodeIntegration=yes')
29
+ webview.setAttribute('webpreferences', 'webSecurity=false, allowRunningInsecureContent=true, nodeIntegration=yes, contextIsolation=no')
30
30
 
31
31
  webview.addEventListener('did-finish-load', () => {
32
32
  win.show()
@@ -48,17 +48,15 @@
48
48
  console.log('No parameters:', err.message)
49
49
  }
50
50
 
51
- let escaped;
52
- if (options.mode === 'watch') {
53
- // Sirve los archivos desde el servidor webpack-dev-server
54
- escaped = `http://localhost:${options.port}/test/downloads`;
55
- } else {
56
- // En producción, usa file://
57
- escaped = `file://${path.join(options.build, 'test', 'downloads')}`;
58
- }
59
- escaped = escaped.replace(/\\/g, '/');
51
+ let escaped = path.join(options.mode === 'watch' ? options.src : options.build, 'test', 'downloads')
52
+
53
+ // Add file:// to watch because in this mode the app will be in a localhost hosted environment.
54
+ if (options.mode === 'watch') escaped = `file://${escaped}`
55
+ escaped = escaped.replace(/\\/g, '/')
56
+
60
57
  data.downloadsPath = escaped
61
58
 
59
+
62
60
  try {
63
61
  data.services = require(path.join(options.src, '/test/services.json')).services
64
62
  } catch (err) {
@@ -85,4 +83,4 @@
85
83
  </script>
86
84
  </body>
87
85
 
88
- </html>
86
+ </html>
package/dist/main.js CHANGED
@@ -100,7 +100,8 @@ function setupChildProcessLogging(child) {
100
100
  }
101
101
  // Función centralizada para compilar webpack
102
102
  async function compileWebpack() {
103
- const cfgPath = path.resolve(__dirname, '..', 'dist/webpack.config.js');
103
+ // CORREGIDO: Usar __dirname para el webpack.config.js del module-packager
104
+ const cfgPath = path.resolve(__dirname, 'webpack.config.js');
104
105
  const webpackConfigFactory = (await import(cfgPath)).default;
105
106
  const compiler = webpack(webpackConfigFactory(options));
106
107
  return new Promise((resolve, reject) => {
@@ -237,7 +238,8 @@ function zip() {
237
238
  clc.move(-2, 0);
238
239
  }
239
240
  async function watch() {
240
- const cfgPath = path.resolve(__dirname, '..', 'dist/webpack.config.js');
241
+ // CORREGIDO: Usar __dirname para el webpack.config.js del module-packager
242
+ const cfgPath = path.resolve(__dirname, 'webpack.config.js');
241
243
  const webpackConfigFactory = (await import(cfgPath)).default;
242
244
  const compiler = webpack(webpackConfigFactory(options));
243
245
  const server = new WebpackDevServer({
@@ -7,7 +7,8 @@ import CopyWebpackPlugin from 'copy-webpack-plugin';
7
7
  import TerserPlugin from 'terser-webpack-plugin';
8
8
  import webpack from 'webpack';
9
9
  const __filename = fileURLToPath(import.meta.url);
10
- // const __dirname = path.dirname(__filename)
10
+ const __dirname = path.dirname(__filename);
11
+ console.log("🚀 ~ __dirname:", __dirname);
11
12
  export default (env = {}, argv = {}) => {
12
13
  const require = createRequire(import.meta.url);
13
14
  const options = {
@@ -24,7 +25,11 @@ export default (env = {}, argv = {}) => {
24
25
  return {
25
26
  mode: isDev ? 'development' : 'production',
26
27
  target: 'electron-renderer',
27
- entry: path.resolve(options.src, 'main.ts'),
28
+ entry: isDev ? [
29
+ `webpack-dev-server/client?http://localhost:${options.port}/`,
30
+ 'webpack/hot/dev-server',
31
+ path.resolve(options.src, 'main.ts')
32
+ ] : path.resolve(options.src, 'main.ts'),
28
33
  output: {
29
34
  path: buildPath,
30
35
  filename: '[name].js',
@@ -47,7 +52,7 @@ export default (env = {}, argv = {}) => {
47
52
  process: require.resolve('process/browser.js'),
48
53
  global: require.resolve('global')
49
54
  },
50
- modules: ['node_modules']
55
+ modules: ['node_modules', 'src', 'static']
51
56
  },
52
57
  module: {
53
58
  rules: [
@@ -71,10 +76,10 @@ export default (env = {}, argv = {}) => {
71
76
  exclude: /node_modules/
72
77
  },
73
78
  {
74
- test: /\.(png|jpe?g|gif|svg|woff2?|ttf|eot)$/,
79
+ test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|mp4)$/,
75
80
  type: 'asset/resource',
76
81
  generator: {
77
- filename: 'assets/[hash][ext][query]'
82
+ filename: '[name][ext]'
78
83
  }
79
84
  },
80
85
  {
@@ -123,7 +128,7 @@ export default (env = {}, argv = {}) => {
123
128
  })
124
129
  ]
125
130
  },
126
- devtool: isDev ? 'eval' : false,
131
+ devtool: isDev ? 'source-map' : false,
127
132
  devServer: isDev ? {
128
133
  static: [
129
134
  {
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@vixoniccom/module-packager",
3
- "version": "2.11.0-dev.7",
3
+ "version": "2.11.0-dev.9",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "vixonic-module-packager": "./dist/main.js"
7
7
  },
8
8
  "files": [
9
- "dist",
10
- "index.html"
9
+ "dist"
11
10
  ],
12
11
  "main": "dist/main.js",
13
12
  "scripts": {
@@ -28,13 +27,14 @@
28
27
  "dependencies": {
29
28
  "@electron/remote": "^2.1.2",
30
29
  "@types/which": "^3.0.4",
31
- "@vixoniccom/module-controller": "2.0.0-dev.3",
30
+ "@vixoniccom/module-controller": "2.0.0-dev.5",
32
31
  "@vixoniccom/modules": "2.20.1-dev.0",
33
32
  "archiver": "^5.3.0",
34
33
  "clean-webpack-plugin": "^4.0.0",
35
34
  "cli-color": "^1.2.0",
36
35
  "command-line-args": "^3.0.1",
37
36
  "copy-webpack-plugin": "^13.0.0",
37
+ "css-loader": "^7.1.2",
38
38
  "electron": "^36.1.0",
39
39
  "electron-debug": "^3.2.0",
40
40
  "global": "^4.4.0",
@@ -43,14 +43,13 @@
43
43
  "lodash": "^4.17.21",
44
44
  "process": "^0.11.10",
45
45
  "raw-loader": "^0.5.1",
46
+ "style-loader": "^4.0.0",
46
47
  "ts-loader": "^9.5.0",
47
48
  "ts-node": "^10.9.1",
48
49
  "typescript": "^5.8.3",
49
50
  "webpack": "^5.99.8",
50
51
  "webpack-cli": "^6.0.1",
51
52
  "webpack-dev-server": "^5.2.1",
52
- "css-loader": "^7.1.2",
53
- "style-loader": "^4.0.0",
54
53
  "which": "^5.0.0"
55
54
  },
56
55
  "devDependencies": {