innetjs 2.0.11 → 2.1.0

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/bin/innet CHANGED
@@ -196,9 +196,14 @@ const readline = require('readline');
196
196
  const execAsync = util.promisify(exec);
197
197
  const copyFiles = util.promisify(fs__default["default"].copy);
198
198
  require('dotenv').config();
199
+ function normalizeEnv(value) {
200
+ if (value) {
201
+ return value.replace(/\${([a-zA-Z0-9]+)}/g, (placeholder, placeholderId) => { var _a; return (_a = process.env[placeholderId]) !== null && _a !== void 0 ? _a : placeholder; });
202
+ }
203
+ }
199
204
  const innetEnv = Object.keys(process.env).reduce((result, key) => {
200
205
  if (key.startsWith('INNETJS_')) {
201
- result[key] = process.env[key];
206
+ result[key] = normalizeEnv(process.env[key]);
202
207
  }
203
208
  return result;
204
209
  }, {});
@@ -387,11 +392,11 @@ class InnetJS {
387
392
  options.output.format = 'cjs';
388
393
  options.external = Object.keys((pkg === null || pkg === void 0 ? void 0 : pkg.dependencies) || {});
389
394
  options.plugins.push(pluginNodeResolve.nodeResolve({
390
- moduleDirectories: [path__default["default"].resolve(this.srcFolder, 'node_modules')]
395
+ moduleDirectories: [path__default["default"].resolve(this.srcFolder, 'node_modules')],
391
396
  }), string({
392
397
  include: '**/*.*',
393
398
  exclude: stringExcludeNode,
394
- }), this.createServer(options.external));
399
+ }), this.createServer());
395
400
  }
396
401
  else {
397
402
  const key = path__default["default"].basename(this.sslKey) !== this.sslKey
@@ -602,23 +607,19 @@ class InnetJS {
602
607
  })
603
608
  };
604
609
  }
605
- createServer(external) {
610
+ createServer() {
606
611
  let app;
607
612
  return {
608
613
  writeBundle: () => __awaiter(this, void 0, void 0, function* () {
609
614
  app === null || app === void 0 ? void 0 : app.kill();
610
- const filePath = path__default["default"].resolve(this.buildFolder, 'index.js');
611
- let data = yield fs__default["default"].readFile(filePath, 'UTF-8');
612
- const regExp = new RegExp(`require\\('(${external.join('|')})'\\)`, 'g');
613
- data = data.replace(regExp, `require('${path__default["default"].resolve(this.projectFolder, 'node_modules', '$1')}')`);
614
- yield fs__default["default"].writeFile(filePath, data);
615
+ const filePath = path__default["default"].resolve(this.devBuildFolder, 'index.js');
615
616
  app = spawn('node', ['-r', 'source-map-support/register', filePath], { stdio: 'inherit' });
616
617
  })
617
618
  };
618
619
  }
619
620
  }
620
621
 
621
- var version = "2.0.11";
622
+ var version = "2.1.0";
622
623
 
623
624
  require('dotenv').config();
624
625
  const innetJS = new InnetJS();
package/index.d.ts CHANGED
@@ -48,7 +48,7 @@ export default class InnetJS {
48
48
  createClient(key: any, cert: any, pkg: any): {
49
49
  writeBundle: () => Promise<void>;
50
50
  };
51
- createServer(external: string[]): {
51
+ createServer(): {
52
52
  writeBundle: () => Promise<void>;
53
53
  };
54
54
  }
package/index.es6.js CHANGED
@@ -165,9 +165,14 @@ const readline = require('readline');
165
165
  const execAsync = promisify(exec);
166
166
  const copyFiles = promisify(fs.copy);
167
167
  require('dotenv').config();
168
+ function normalizeEnv(value) {
169
+ if (value) {
170
+ return value.replace(/\${([a-zA-Z0-9]+)}/g, (placeholder, placeholderId) => { var _a; return (_a = process.env[placeholderId]) !== null && _a !== void 0 ? _a : placeholder; });
171
+ }
172
+ }
168
173
  const innetEnv = Object.keys(process.env).reduce((result, key) => {
169
174
  if (key.startsWith('INNETJS_')) {
170
- result[key] = process.env[key];
175
+ result[key] = normalizeEnv(process.env[key]);
171
176
  }
172
177
  return result;
173
178
  }, {});
@@ -356,11 +361,11 @@ class InnetJS {
356
361
  options.output.format = 'cjs';
357
362
  options.external = Object.keys((pkg === null || pkg === void 0 ? void 0 : pkg.dependencies) || {});
358
363
  options.plugins.push(nodeResolve({
359
- moduleDirectories: [path$1.resolve(this.srcFolder, 'node_modules')]
364
+ moduleDirectories: [path$1.resolve(this.srcFolder, 'node_modules')],
360
365
  }), string({
361
366
  include: '**/*.*',
362
367
  exclude: stringExcludeNode,
363
- }), this.createServer(options.external));
368
+ }), this.createServer());
364
369
  }
365
370
  else {
366
371
  const key = path$1.basename(this.sslKey) !== this.sslKey
@@ -571,16 +576,12 @@ class InnetJS {
571
576
  })
572
577
  };
573
578
  }
574
- createServer(external) {
579
+ createServer() {
575
580
  let app;
576
581
  return {
577
582
  writeBundle: () => __awaiter(this, void 0, void 0, function* () {
578
583
  app === null || app === void 0 ? void 0 : app.kill();
579
- const filePath = path$1.resolve(this.buildFolder, 'index.js');
580
- let data = yield fs.readFile(filePath, 'UTF-8');
581
- const regExp = new RegExp(`require\\('(${external.join('|')})'\\)`, 'g');
582
- data = data.replace(regExp, `require('${path$1.resolve(this.projectFolder, 'node_modules', '$1')}')`);
583
- yield fs.writeFile(filePath, data);
584
+ const filePath = path$1.resolve(this.devBuildFolder, 'index.js');
584
585
  app = spawn('node', ['-r', 'source-map-support/register', filePath], { stdio: 'inherit' });
585
586
  })
586
587
  };
package/index.js CHANGED
@@ -194,9 +194,14 @@ const readline = require('readline');
194
194
  const execAsync = util.promisify(exec);
195
195
  const copyFiles = util.promisify(fs__default["default"].copy);
196
196
  require('dotenv').config();
197
+ function normalizeEnv(value) {
198
+ if (value) {
199
+ return value.replace(/\${([a-zA-Z0-9]+)}/g, (placeholder, placeholderId) => { var _a; return (_a = process.env[placeholderId]) !== null && _a !== void 0 ? _a : placeholder; });
200
+ }
201
+ }
197
202
  const innetEnv = Object.keys(process.env).reduce((result, key) => {
198
203
  if (key.startsWith('INNETJS_')) {
199
- result[key] = process.env[key];
204
+ result[key] = normalizeEnv(process.env[key]);
200
205
  }
201
206
  return result;
202
207
  }, {});
@@ -385,11 +390,11 @@ class InnetJS {
385
390
  options.output.format = 'cjs';
386
391
  options.external = Object.keys((pkg === null || pkg === void 0 ? void 0 : pkg.dependencies) || {});
387
392
  options.plugins.push(pluginNodeResolve.nodeResolve({
388
- moduleDirectories: [path__default["default"].resolve(this.srcFolder, 'node_modules')]
393
+ moduleDirectories: [path__default["default"].resolve(this.srcFolder, 'node_modules')],
389
394
  }), string({
390
395
  include: '**/*.*',
391
396
  exclude: stringExcludeNode,
392
- }), this.createServer(options.external));
397
+ }), this.createServer());
393
398
  }
394
399
  else {
395
400
  const key = path__default["default"].basename(this.sslKey) !== this.sslKey
@@ -600,16 +605,12 @@ class InnetJS {
600
605
  })
601
606
  };
602
607
  }
603
- createServer(external) {
608
+ createServer() {
604
609
  let app;
605
610
  return {
606
611
  writeBundle: () => __awaiter(this, void 0, void 0, function* () {
607
612
  app === null || app === void 0 ? void 0 : app.kill();
608
- const filePath = path__default["default"].resolve(this.buildFolder, 'index.js');
609
- let data = yield fs__default["default"].readFile(filePath, 'UTF-8');
610
- const regExp = new RegExp(`require\\('(${external.join('|')})'\\)`, 'g');
611
- data = data.replace(regExp, `require('${path__default["default"].resolve(this.projectFolder, 'node_modules', '$1')}')`);
612
- yield fs__default["default"].writeFile(filePath, data);
613
+ const filePath = path__default["default"].resolve(this.devBuildFolder, 'index.js');
613
614
  app = spawn('node', ['-r', 'source-map-support/register', filePath], { stdio: 'inherit' });
614
615
  })
615
616
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "2.0.11",
3
+ "version": "2.1.0",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",
@@ -32,26 +32,26 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@cantinc/logger": "^1.1.0",
35
- "@rollup/plugin-commonjs": "^22.0.2",
36
- "@rollup/plugin-eslint": "^8.0.2",
37
- "@rollup/plugin-image": "^2.1.1",
38
- "@rollup/plugin-json": "^4.1.0",
39
- "@rollup/plugin-node-resolve": "^13.3.0",
40
- "address": "^1.2.0",
41
- "autoprefixer": "^10.4.8",
42
- "axios": "^0.27.2",
35
+ "@rollup/plugin-commonjs": "^23.0.2",
36
+ "@rollup/plugin-eslint": "^9.0.1",
37
+ "@rollup/plugin-image": "^3.0.1",
38
+ "@rollup/plugin-json": "^5.0.1",
39
+ "@rollup/plugin-node-resolve": "^15.0.1",
40
+ "address": "^1.2.1",
41
+ "autoprefixer": "^10.4.13",
42
+ "axios": "^1.1.3",
43
43
  "chalk": "^4.1.2",
44
44
  "cli-select": "^1.1.2",
45
- "commander": "^9.4.0",
46
- "dotenv": "^16.0.1",
47
- "express": "^4.18.1",
45
+ "commander": "^9.4.1",
46
+ "dotenv": "^16.0.3",
47
+ "express": "^4.18.2",
48
48
  "express-http-proxy": "^1.6.3",
49
49
  "fs-extra": "^10.1.0",
50
50
  "lines-and-columns": "^2.0.3",
51
- "node-sass": "^7.0.1",
52
- "postcss": "^8.4.16",
51
+ "postcss": "^8.4.18",
52
+ "sass": "^1.55.0",
53
53
  "prompts": "^2.4.2",
54
- "rollup": "^2.77.2",
54
+ "rollup": "^2.79.1",
55
55
  "rollup-plugin-filesize": "^9.1.2",
56
56
  "rollup-plugin-inject-process-env": "^1.3.1",
57
57
  "rollup-plugin-innet-jsx": "^1.3.0",
@@ -59,9 +59,9 @@
59
59
  "rollup-plugin-string": "^3.0.0",
60
60
  "rollup-plugin-styles": "^4.0.0",
61
61
  "rollup-plugin-terser": "^7.0.2",
62
- "rollup-plugin-typescript2": "^0.32.1",
62
+ "rollup-plugin-typescript2": "^0.34.1",
63
63
  "tmp": "^0.2.1",
64
- "typescript": "^4.7.4",
64
+ "typescript": "^4.8.4",
65
65
  "unzipper": "^0.10.11"
66
66
  }
67
67
  }