@vixoniccom/module-packager 2.10.3-dev.5 → 2.10.3-dev.6

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.
@@ -13,8 +13,10 @@
13
13
  const path = require('path')
14
14
  let ModuleController;
15
15
  try {
16
- ModuleController = require('@vixoniccom/module-controller')
17
- console.log('[WEBVIEW] ModuleController cargado OK');
16
+ const moduleControllerModule = require('@vixoniccom/module-controller');
17
+ ModuleController = moduleControllerModule.default;
18
+
19
+ console.log('[WEBVIEW] ModuleController cargado OK', ModuleController);
18
20
  } catch (err) {
19
21
  console.error('[WEBVIEW] NO se pudo cargar ModuleController', err);
20
22
  }
package/dist/main.js CHANGED
@@ -11,11 +11,10 @@ import archiver from 'archiver';
11
11
  import clc from 'cli-color';
12
12
  import { Configuration } from '@vixoniccom/modules';
13
13
  import tsNode from 'ts-node';
14
+ import { createRequire } from 'module';
14
15
  const __filename = fileURLToPath(import.meta.url);
15
16
  const __dirname = path.dirname(__filename);
16
17
  const electronPath = path.join(__dirname, 'electron.js');
17
- // import pjson from '../package.json' assert { type: 'json' }
18
- // console.log(`VIXONIC PACKAGER: Version ${pjson.version}`)
19
18
  const optionDefinitions = [
20
19
  { name: 'externals', type: String, defaultValue: [], multiple: true },
21
20
  { name: 'target', type: String, defaultValue: 'web' },
@@ -52,7 +51,7 @@ else if (options.mode === 'run') {
52
51
  run();
53
52
  }
54
53
  else if (options.mode === 'generate-configuration') {
55
- generateConfiguration();
54
+ await generateConfiguration();
56
55
  }
57
56
  else if (options.mode === 'validate-configuration') {
58
57
  validateConfiguration();
@@ -231,7 +230,8 @@ async function run() {
231
230
  child.stdout?.pipe(process.stdout);
232
231
  child.stderr?.pipe(process.stderr);
233
232
  }
234
- function loadConfiguration() {
233
+ async function loadConfiguration() {
234
+ const require = createRequire(import.meta.url);
235
235
  tsNode.register({
236
236
  compilerOptions: {
237
237
  moduleResolution: 'node',
@@ -240,11 +240,12 @@ function loadConfiguration() {
240
240
  checkJs: false
241
241
  }
242
242
  });
243
- return require(path.resolve(options.confDefinition, 'index.ts')).configuration;
243
+ const configPath = path.resolve(options.confDefinition, 'index.ts');
244
+ return require(configPath).configuration;
244
245
  }
245
- function generateConfiguration() {
246
+ async function generateConfiguration() {
246
247
  try {
247
- let configuration = loadConfiguration();
248
+ let configuration = await loadConfiguration();
248
249
  fs.writeFileSync(path.resolve(options.src, 'parameters.d.ts'), configuration.declarationFileString);
249
250
  fs.writeFileSync(path.resolve(options.src, '..', 'configuration.json'), JSON.stringify(configuration, undefined, 2));
250
251
  console.log(clc.green(`Configuration generated`));
package/package.json CHANGED
@@ -55,7 +55,7 @@
55
55
  ],
56
56
  "dependencies": {
57
57
  "@electron/remote": "^2.1.2",
58
- "@vixoniccom/module-controller": "^2.0.0-dev.1",
58
+ "@vixoniccom/module-controller": "^2.0.0-dev.2",
59
59
  "@vixoniccom/modules": "^2.20.0",
60
60
  "archiver": "^5.3.0",
61
61
  "clean-webpack-plugin": "^4.0.0",
@@ -108,7 +108,7 @@
108
108
  "release": "standard-version"
109
109
  },
110
110
  "type": "module",
111
- "version": "2.10.3-dev.5",
111
+ "version": "2.10.3-dev.6",
112
112
  "license": "ISC",
113
113
  "devDependencies": {
114
114
  "@types/archiver": "^6.0.3",