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

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,7 +29,6 @@ function createWindow() {
29
29
  height: 768,
30
30
  webPreferences: {
31
31
  nodeIntegrationInSubFrames: true,
32
- allowRunningInsecureContent: true,
33
32
  nodeIntegration: true,
34
33
  contextIsolation: false,
35
34
  webSecurity: false,
@@ -26,7 +26,7 @@
26
26
  const win = remote.getCurrentWindow()
27
27
 
28
28
  webview.setAttribute('nodeintegration', '')
29
- webview.setAttribute('webpreferences', 'webSecurity=false, allowRunningInsecureContent=true, nodeIntegration=yes, contextIsolation=no')
29
+ webview.setAttribute('webpreferences', 'contextIsolation=no, nodeIntegration=yes')
30
30
 
31
31
  webview.addEventListener('did-finish-load', () => {
32
32
  win.show()
@@ -49,14 +49,10 @@
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.
54
52
  if (options.mode === 'watch') escaped = `file://${escaped}`
55
53
  escaped = escaped.replace(/\\/g, '/')
56
-
57
54
  data.downloadsPath = escaped
58
55
 
59
-
60
56
  try {
61
57
  data.services = require(path.join(options.src, '/test/services.json')).services
62
58
  } catch (err) {
@@ -83,4 +79,4 @@
83
79
  </script>
84
80
  </body>
85
81
 
86
- </html>
82
+ </html>
package/dist/main.js CHANGED
@@ -100,8 +100,7 @@ function setupChildProcessLogging(child) {
100
100
  }
101
101
  // Función centralizada para compilar webpack
102
102
  async function compileWebpack() {
103
- // CORREGIDO: Usar __dirname para el webpack.config.js del module-packager
104
- const cfgPath = path.resolve(__dirname, 'webpack.config.js');
103
+ const cfgPath = path.resolve(__dirname, '..', 'dist/webpack.config.js');
105
104
  const webpackConfigFactory = (await import(cfgPath)).default;
106
105
  const compiler = webpack(webpackConfigFactory(options));
107
106
  return new Promise((resolve, reject) => {
@@ -238,8 +237,7 @@ function zip() {
238
237
  clc.move(-2, 0);
239
238
  }
240
239
  async function watch() {
241
- // CORREGIDO: Usar __dirname para el webpack.config.js del module-packager
242
- const cfgPath = path.resolve(__dirname, 'webpack.config.js');
240
+ const cfgPath = path.resolve(__dirname, '..', 'dist/webpack.config.js');
243
241
  const webpackConfigFactory = (await import(cfgPath)).default;
244
242
  const compiler = webpack(webpackConfigFactory(options));
245
243
  const server = new WebpackDevServer({
@@ -7,8 +7,7 @@ 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);
11
- console.log("🚀 ~ __dirname:", __dirname);
10
+ // const __dirname = path.dirname(__filename)
12
11
  export default (env = {}, argv = {}) => {
13
12
  const require = createRequire(import.meta.url);
14
13
  const options = {
@@ -20,16 +19,13 @@ export default (env = {}, argv = {}) => {
20
19
  const isDev = options.mode === 'watch';
21
20
  const buildPath = path.resolve(options.build);
22
21
  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: 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
+ entry: path.resolve(options.src, 'main.ts'),
33
29
  output: {
34
30
  path: buildPath,
35
31
  filename: '[name].js',
@@ -52,7 +48,7 @@ export default (env = {}, argv = {}) => {
52
48
  process: require.resolve('process/browser.js'),
53
49
  global: require.resolve('global')
54
50
  },
55
- modules: ['node_modules', 'src', 'static']
51
+ modules: ['node_modules']
56
52
  },
57
53
  module: {
58
54
  rules: [
@@ -76,10 +72,10 @@ export default (env = {}, argv = {}) => {
76
72
  exclude: /node_modules/
77
73
  },
78
74
  {
79
- test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|mp4)$/,
75
+ test: /\.(png|jpe?g|gif|svg|woff2?|ttf|eot)$/,
80
76
  type: 'asset/resource',
81
77
  generator: {
82
- filename: '[name][ext]'
78
+ filename: 'assets/[hash][ext][query]'
83
79
  }
84
80
  },
85
81
  {
@@ -128,15 +124,9 @@ export default (env = {}, argv = {}) => {
128
124
  })
129
125
  ]
130
126
  },
131
- devtool: isDev ? 'source-map' : false,
127
+ devtool: isDev ? 'eval' : false,
132
128
  devServer: isDev ? {
133
- static: [
134
- {
135
- directory: path.resolve(options.src, 'test'),
136
- publicPath: '/test',
137
- watch: true,
138
- }
139
- ],
129
+ static: false,
140
130
  open: false,
141
131
  client: {
142
132
  overlay: true
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@vixoniccom/module-packager",
3
- "version": "2.11.0-dev.12",
3
+ "version": "2.11.0-dev.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "vixonic-module-packager": "./dist/main.js"
7
7
  },
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "index.html"
10
11
  ],
11
12
  "main": "dist/main.js",
12
13
  "scripts": {
@@ -26,15 +27,13 @@
26
27
  },
27
28
  "dependencies": {
28
29
  "@electron/remote": "^2.1.2",
29
- "@types/which": "^3.0.4",
30
- "@vixoniccom/module-controller": "2.0.0-dev.6",
31
- "@vixoniccom/modules": "2.20.1-dev.0",
30
+ "@vixoniccom/module-controller": "^2.0.0-dev.3",
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",
38
37
  "electron": "^36.1.0",
39
38
  "electron-debug": "^3.2.0",
40
39
  "global": "^4.4.0",
@@ -43,14 +42,12 @@
43
42
  "lodash": "^4.17.21",
44
43
  "process": "^0.11.10",
45
44
  "raw-loader": "^0.5.1",
46
- "style-loader": "^4.0.0",
47
45
  "ts-loader": "^9.5.0",
48
46
  "ts-node": "^10.9.1",
49
47
  "typescript": "^5.8.3",
50
48
  "webpack": "^5.99.8",
51
49
  "webpack-cli": "^6.0.1",
52
- "webpack-dev-server": "^5.2.1",
53
- "which": "^5.0.0"
50
+ "webpack-dev-server": "^5.2.1"
54
51
  },
55
52
  "devDependencies": {
56
53
  "@types/archiver": "^6.0.3",
@@ -58,11 +55,14 @@
58
55
  "@types/command-line-args": "^5.2.3",
59
56
  "@types/node": "^20.11.25",
60
57
  "@types/webpack-env": "^1.18.8",
58
+ "@types/which": "^3.0.4",
61
59
  "concurrently": "^9.1.2",
60
+ "css-loader": "^7.1.2",
62
61
  "npm-run-all": "^4.1.5",
63
62
  "sass": "^1.88.0",
64
63
  "sass-loader": "^16.0.5",
65
64
  "standard-version": "^9.3.1",
65
+ "style-loader": "^4.0.0",
66
66
  "wait-on": "^8.0.3"
67
67
  }
68
68
  }