@vixoniccom/module-packager 2.11.0-dev.0 → 2.11.0-dev.12

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()
@@ -49,10 +49,14 @@
49
49
  }
50
50
 
51
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.
52
54
  if (options.mode === 'watch') escaped = `file://${escaped}`
53
55
  escaped = escaped.replace(/\\/g, '/')
56
+
54
57
  data.downloadsPath = escaped
55
58
 
59
+
56
60
  try {
57
61
  data.services = require(path.join(options.src, '/test/services.json')).services
58
62
  } catch (err) {
@@ -79,4 +83,4 @@
79
83
  </script>
80
84
  </body>
81
85
 
82
- </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 = {
@@ -19,13 +20,16 @@ export default (env = {}, argv = {}) => {
19
20
  const isDev = options.mode === 'watch';
20
21
  const buildPath = path.resolve(options.build);
21
22
  const controllerHtmlPath = path.resolve(options.src, 'index.html');
22
- console.log("🚀 ~ controllerHtmlPath:", controllerHtmlPath);
23
23
  const controllerStaticPath = path.resolve(path.dirname(controllerHtmlPath), '../static');
24
24
  const controllerFontsPath = path.resolve(path.dirname(controllerHtmlPath), '../fonts');
25
25
  return {
26
26
  mode: isDev ? 'development' : 'production',
27
27
  target: 'electron-renderer',
28
- 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'),
29
33
  output: {
30
34
  path: buildPath,
31
35
  filename: '[name].js',
@@ -48,7 +52,7 @@ export default (env = {}, argv = {}) => {
48
52
  process: require.resolve('process/browser.js'),
49
53
  global: require.resolve('global')
50
54
  },
51
- modules: ['node_modules']
55
+ modules: ['node_modules', 'src', 'static']
52
56
  },
53
57
  module: {
54
58
  rules: [
@@ -72,10 +76,10 @@ export default (env = {}, argv = {}) => {
72
76
  exclude: /node_modules/
73
77
  },
74
78
  {
75
- test: /\.(png|jpe?g|gif|svg|woff2?|ttf|eot)$/,
79
+ test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|mp4)$/,
76
80
  type: 'asset/resource',
77
81
  generator: {
78
- filename: 'assets/[hash][ext][query]'
82
+ filename: '[name][ext]'
79
83
  }
80
84
  },
81
85
  {
@@ -124,9 +128,15 @@ export default (env = {}, argv = {}) => {
124
128
  })
125
129
  ]
126
130
  },
127
- devtool: isDev ? 'eval' : false,
131
+ devtool: isDev ? 'source-map' : false,
128
132
  devServer: isDev ? {
129
- static: false,
133
+ static: [
134
+ {
135
+ directory: path.resolve(options.src, 'test'),
136
+ publicPath: '/test',
137
+ watch: true,
138
+ }
139
+ ],
130
140
  open: false,
131
141
  client: {
132
142
  overlay: true
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@vixoniccom/module-packager",
3
- "version": "2.11.0-dev.0",
3
+ "version": "2.11.0-dev.12",
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": {
@@ -27,13 +26,15 @@
27
26
  },
28
27
  "dependencies": {
29
28
  "@electron/remote": "^2.1.2",
30
- "@vixoniccom/module-controller": "^2.0.0-dev.2",
31
- "@vixoniccom/modules": "^2.20.0",
29
+ "@types/which": "^3.0.4",
30
+ "@vixoniccom/module-controller": "2.0.0-dev.6",
31
+ "@vixoniccom/modules": "2.20.1-dev.0",
32
32
  "archiver": "^5.3.0",
33
33
  "clean-webpack-plugin": "^4.0.0",
34
34
  "cli-color": "^1.2.0",
35
35
  "command-line-args": "^3.0.1",
36
36
  "copy-webpack-plugin": "^13.0.0",
37
+ "css-loader": "^7.1.2",
37
38
  "electron": "^36.1.0",
38
39
  "electron-debug": "^3.2.0",
39
40
  "global": "^4.4.0",
@@ -42,12 +43,14 @@
42
43
  "lodash": "^4.17.21",
43
44
  "process": "^0.11.10",
44
45
  "raw-loader": "^0.5.1",
46
+ "style-loader": "^4.0.0",
45
47
  "ts-loader": "^9.5.0",
46
48
  "ts-node": "^10.9.1",
47
49
  "typescript": "^5.8.3",
48
50
  "webpack": "^5.99.8",
49
51
  "webpack-cli": "^6.0.1",
50
- "webpack-dev-server": "^5.2.1"
52
+ "webpack-dev-server": "^5.2.1",
53
+ "which": "^5.0.0"
51
54
  },
52
55
  "devDependencies": {
53
56
  "@types/archiver": "^6.0.3",
@@ -55,14 +58,11 @@
55
58
  "@types/command-line-args": "^5.2.3",
56
59
  "@types/node": "^20.11.25",
57
60
  "@types/webpack-env": "^1.18.8",
58
- "@types/which": "^3.0.4",
59
61
  "concurrently": "^9.1.2",
60
- "css-loader": "^7.1.2",
61
62
  "npm-run-all": "^4.1.5",
62
63
  "sass": "^1.88.0",
63
64
  "sass-loader": "^16.0.5",
64
65
  "standard-version": "^9.3.1",
65
- "style-loader": "^4.0.0",
66
66
  "wait-on": "^8.0.3"
67
67
  }
68
68
  }