innetjs 2.2.6 → 2.2.7
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/_virtual/_rollup-plugin-inject-process-env.js +1 -1
- package/_virtual/_rollup-plugin-inject-process-env.mjs +1 -1
- package/bin/innet +7 -7
- package/helpers.d.ts +1 -1
- package/helpers.js +2 -2
- package/helpers.mjs +2 -2
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +1 -1
package/bin/innet
CHANGED
|
@@ -68,7 +68,7 @@ var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
|
|
|
68
68
|
var tmp__default = /*#__PURE__*/_interopDefaultLegacy(tmp);
|
|
69
69
|
|
|
70
70
|
(function() {
|
|
71
|
-
const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.
|
|
71
|
+
const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.7"};
|
|
72
72
|
try {
|
|
73
73
|
if (process) {
|
|
74
74
|
process.env = Object.assign({}, process.env);
|
|
@@ -172,11 +172,11 @@ function getFile(file) {
|
|
|
172
172
|
}
|
|
173
173
|
return file;
|
|
174
174
|
}
|
|
175
|
-
function convertIndexFile(data, version, baseUrl) {
|
|
175
|
+
function convertIndexFile(data, version, baseUrl, index) {
|
|
176
176
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
177
177
|
return data
|
|
178
178
|
.toString()
|
|
179
|
-
.replace('</head>', `<script type="module" defer src="${baseUrl}index.js${version ? `?v=${version}` : ''}"></script></head>`);
|
|
179
|
+
.replace('</head>', `<script type="module" defer src="${baseUrl}${index}.js${version ? `?v=${version}` : ''}"></script></head>`);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
const reporter = (options, outputOptions, info) => {
|
|
@@ -352,7 +352,7 @@ class InnetJS {
|
|
|
352
352
|
yield copyFiles(this.publicFolder, this.buildFolder);
|
|
353
353
|
const data = yield fs.promises.readFile(this.publicIndexFile);
|
|
354
354
|
const pkg = yield this.getPackage();
|
|
355
|
-
yield fs.promises.writeFile(this.buildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl));
|
|
355
|
+
yield fs.promises.writeFile(this.buildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl, index));
|
|
356
356
|
}
|
|
357
357
|
}));
|
|
358
358
|
if (pkg) {
|
|
@@ -435,7 +435,7 @@ class InnetJS {
|
|
|
435
435
|
}), string({
|
|
436
436
|
include: '**/*.*',
|
|
437
437
|
exclude: stringExcludeDom,
|
|
438
|
-
}), this.createClient(key, cert, pkg), livereload(Object.assign({ exts: ['html', 'css', 'js', 'png', 'svg', 'webp', 'gif', 'jpg', 'json'], watch: [this.devBuildFolder, this.publicFolder], verbose: false }, (key && cert ? { https: { key, cert } } : {}))), injectEnv__default["default"](innetEnv));
|
|
438
|
+
}), this.createClient(key, cert, pkg, index), livereload(Object.assign({ exts: ['html', 'css', 'js', 'png', 'svg', 'webp', 'gif', 'jpg', 'json'], watch: [this.devBuildFolder, this.publicFolder], verbose: false }, (key && cert ? { https: { key, cert } } : {}))), injectEnv__default["default"](innetEnv));
|
|
439
439
|
}
|
|
440
440
|
const watcher = rollup__default["default"].watch(options);
|
|
441
441
|
watcher.on('event', (e) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -700,7 +700,7 @@ class InnetJS {
|
|
|
700
700
|
return this.package;
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
|
-
createClient(key, cert, pkg) {
|
|
703
|
+
createClient(key, cert, pkg, index) {
|
|
704
704
|
let app;
|
|
705
705
|
return {
|
|
706
706
|
name: 'client',
|
|
@@ -710,7 +710,7 @@ class InnetJS {
|
|
|
710
710
|
app = express__default["default"]();
|
|
711
711
|
const update = () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
712
712
|
const data = yield fs.promises.readFile(this.publicIndexFile);
|
|
713
|
-
yield fs.promises.writeFile(this.devBuildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl));
|
|
713
|
+
yield fs.promises.writeFile(this.devBuildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl, index));
|
|
714
714
|
});
|
|
715
715
|
fs__default["default"].watch(this.publicIndexFile, update);
|
|
716
716
|
yield update();
|
package/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { FileSizeRender } from 'rollup-plugin-filesize';
|
|
3
3
|
export declare function getFile(file: any): any;
|
|
4
|
-
export declare function convertIndexFile(data: Buffer, version: string, baseUrl: string): Promise<string>;
|
|
4
|
+
export declare function convertIndexFile(data: Buffer, version: string, baseUrl: string, index: string): Promise<string>;
|
|
5
5
|
export declare const reporter: FileSizeRender<string | Promise<string>>;
|
package/helpers.js
CHANGED
|
@@ -38,11 +38,11 @@ function getFile(file) {
|
|
|
38
38
|
}
|
|
39
39
|
return file;
|
|
40
40
|
}
|
|
41
|
-
function convertIndexFile(data, version, baseUrl) {
|
|
41
|
+
function convertIndexFile(data, version, baseUrl, index) {
|
|
42
42
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
return data
|
|
44
44
|
.toString()
|
|
45
|
-
.replace('</head>', `<script type="module" defer src="${baseUrl}index.js${version ? `?v=${version}` : ''}"></script></head>`);
|
|
45
|
+
.replace('</head>', `<script type="module" defer src="${baseUrl}${index}.js${version ? `?v=${version}` : ''}"></script></head>`);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
const reporter = (options, outputOptions, info) => {
|
package/helpers.mjs
CHANGED
|
@@ -27,11 +27,11 @@ function getFile(file) {
|
|
|
27
27
|
}
|
|
28
28
|
return file;
|
|
29
29
|
}
|
|
30
|
-
function convertIndexFile(data, version, baseUrl) {
|
|
30
|
+
function convertIndexFile(data, version, baseUrl, index) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
return data
|
|
33
33
|
.toString()
|
|
34
|
-
.replace('</head>', `<script type="module" defer src="${baseUrl}index.js${version ? `?v=${version}` : ''}"></script></head>`);
|
|
34
|
+
.replace('</head>', `<script type="module" defer src="${baseUrl}${index}.js${version ? `?v=${version}` : ''}"></script></head>`);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
const reporter = (options, outputOptions, info) => {
|
package/index.d.ts
CHANGED
|
@@ -62,6 +62,6 @@ export declare class InnetJS {
|
|
|
62
62
|
release({ node, index, pub }?: ReleaseOptions): Promise<void>;
|
|
63
63
|
increaseVersion(release: string): Promise<void>;
|
|
64
64
|
getPackage(): Promise<Record<string, any>>;
|
|
65
|
-
createClient(key: any, cert: any, pkg: any): rollup.Plugin;
|
|
65
|
+
createClient(key: any, cert: any, pkg: any, index: string): rollup.Plugin;
|
|
66
66
|
createServer(): rollup.Plugin;
|
|
67
67
|
}
|
package/index.js
CHANGED
|
@@ -230,7 +230,7 @@ class InnetJS {
|
|
|
230
230
|
yield copyFiles(this.publicFolder, this.buildFolder);
|
|
231
231
|
const data = yield fs.promises.readFile(this.publicIndexFile);
|
|
232
232
|
const pkg = yield this.getPackage();
|
|
233
|
-
yield fs.promises.writeFile(this.buildIndexFile, yield helpers.convertIndexFile(data, pkg.version, this.baseUrl));
|
|
233
|
+
yield fs.promises.writeFile(this.buildIndexFile, yield helpers.convertIndexFile(data, pkg.version, this.baseUrl, index));
|
|
234
234
|
}
|
|
235
235
|
}));
|
|
236
236
|
if (pkg) {
|
|
@@ -313,7 +313,7 @@ class InnetJS {
|
|
|
313
313
|
}), string({
|
|
314
314
|
include: '**/*.*',
|
|
315
315
|
exclude: constants.stringExcludeDom,
|
|
316
|
-
}), this.createClient(key, cert, pkg), livereload(Object.assign({ exts: ['html', 'css', 'js', 'png', 'svg', 'webp', 'gif', 'jpg', 'json'], watch: [this.devBuildFolder, this.publicFolder], verbose: false }, (key && cert ? { https: { key, cert } } : {}))), injectEnv__default["default"](innetEnv));
|
|
316
|
+
}), this.createClient(key, cert, pkg, index), livereload(Object.assign({ exts: ['html', 'css', 'js', 'png', 'svg', 'webp', 'gif', 'jpg', 'json'], watch: [this.devBuildFolder, this.publicFolder], verbose: false }, (key && cert ? { https: { key, cert } } : {}))), injectEnv__default["default"](innetEnv));
|
|
317
317
|
}
|
|
318
318
|
const watcher = rollup__default["default"].watch(options);
|
|
319
319
|
watcher.on('event', (e) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -578,7 +578,7 @@ class InnetJS {
|
|
|
578
578
|
return this.package;
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
createClient(key, cert, pkg) {
|
|
581
|
+
createClient(key, cert, pkg, index) {
|
|
582
582
|
let app;
|
|
583
583
|
return {
|
|
584
584
|
name: 'client',
|
|
@@ -588,7 +588,7 @@ class InnetJS {
|
|
|
588
588
|
app = express__default["default"]();
|
|
589
589
|
const update = () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
590
590
|
const data = yield fs.promises.readFile(this.publicIndexFile);
|
|
591
|
-
yield fs.promises.writeFile(this.devBuildIndexFile, yield helpers.convertIndexFile(data, pkg.version, this.baseUrl));
|
|
591
|
+
yield fs.promises.writeFile(this.devBuildIndexFile, yield helpers.convertIndexFile(data, pkg.version, this.baseUrl, index));
|
|
592
592
|
});
|
|
593
593
|
fs__default["default"].watch(this.publicIndexFile, update);
|
|
594
594
|
yield update();
|
package/index.mjs
CHANGED
|
@@ -196,7 +196,7 @@ class InnetJS {
|
|
|
196
196
|
yield copyFiles(this.publicFolder, this.buildFolder);
|
|
197
197
|
const data = yield promises.readFile(this.publicIndexFile);
|
|
198
198
|
const pkg = yield this.getPackage();
|
|
199
|
-
yield promises.writeFile(this.buildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl));
|
|
199
|
+
yield promises.writeFile(this.buildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl, index));
|
|
200
200
|
}
|
|
201
201
|
}));
|
|
202
202
|
if (pkg) {
|
|
@@ -279,7 +279,7 @@ class InnetJS {
|
|
|
279
279
|
}), string({
|
|
280
280
|
include: '**/*.*',
|
|
281
281
|
exclude: stringExcludeDom,
|
|
282
|
-
}), this.createClient(key, cert, pkg), livereload(Object.assign({ exts: ['html', 'css', 'js', 'png', 'svg', 'webp', 'gif', 'jpg', 'json'], watch: [this.devBuildFolder, this.publicFolder], verbose: false }, (key && cert ? { https: { key, cert } } : {}))), injectEnv(innetEnv));
|
|
282
|
+
}), this.createClient(key, cert, pkg, index), livereload(Object.assign({ exts: ['html', 'css', 'js', 'png', 'svg', 'webp', 'gif', 'jpg', 'json'], watch: [this.devBuildFolder, this.publicFolder], verbose: false }, (key && cert ? { https: { key, cert } } : {}))), injectEnv(innetEnv));
|
|
283
283
|
}
|
|
284
284
|
const watcher = rollup.watch(options);
|
|
285
285
|
watcher.on('event', (e) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -544,7 +544,7 @@ class InnetJS {
|
|
|
544
544
|
return this.package;
|
|
545
545
|
});
|
|
546
546
|
}
|
|
547
|
-
createClient(key, cert, pkg) {
|
|
547
|
+
createClient(key, cert, pkg, index) {
|
|
548
548
|
let app;
|
|
549
549
|
return {
|
|
550
550
|
name: 'client',
|
|
@@ -554,7 +554,7 @@ class InnetJS {
|
|
|
554
554
|
app = express();
|
|
555
555
|
const update = () => __awaiter(this, void 0, void 0, function* () {
|
|
556
556
|
const data = yield promises.readFile(this.publicIndexFile);
|
|
557
|
-
yield promises.writeFile(this.devBuildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl));
|
|
557
|
+
yield promises.writeFile(this.devBuildIndexFile, yield convertIndexFile(data, pkg.version, this.baseUrl, index));
|
|
558
558
|
});
|
|
559
559
|
fs.watch(this.publicIndexFile, update);
|
|
560
560
|
yield update();
|