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 +11 -10
- package/index.d.ts +1 -1
- package/index.es6.js +10 -9
- package/index.js +10 -9
- package/package.json +17 -17
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(
|
|
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(
|
|
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.
|
|
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
|
|
622
|
+
var version = "2.1.0";
|
|
622
623
|
|
|
623
624
|
require('dotenv').config();
|
|
624
625
|
const innetJS = new InnetJS();
|
package/index.d.ts
CHANGED
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(
|
|
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(
|
|
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.
|
|
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(
|
|
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(
|
|
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.
|
|
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
|
|
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": "^
|
|
36
|
-
"@rollup/plugin-eslint": "^
|
|
37
|
-
"@rollup/plugin-image": "^
|
|
38
|
-
"@rollup/plugin-json": "^
|
|
39
|
-
"@rollup/plugin-node-resolve": "^
|
|
40
|
-
"address": "^1.2.
|
|
41
|
-
"autoprefixer": "^10.4.
|
|
42
|
-
"axios": "^
|
|
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.
|
|
46
|
-
"dotenv": "^16.0.
|
|
47
|
-
"express": "^4.18.
|
|
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
|
-
"
|
|
52
|
-
"
|
|
51
|
+
"postcss": "^8.4.18",
|
|
52
|
+
"sass": "^1.55.0",
|
|
53
53
|
"prompts": "^2.4.2",
|
|
54
|
-
"rollup": "^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.
|
|
62
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
63
63
|
"tmp": "^0.2.1",
|
|
64
|
-
"typescript": "^4.
|
|
64
|
+
"typescript": "^4.8.4",
|
|
65
65
|
"unzipper": "^0.10.11"
|
|
66
66
|
}
|
|
67
67
|
}
|