innetjs 2.3.5 → 2.3.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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  ;(function () {
4
- const env = {"__INNETJS__PACKAGE_VERSION":"2.3.5"};
4
+ const env = {"__INNETJS__PACKAGE_VERSION":"2.3.6"};
5
5
  if (typeof process === 'undefined') {
6
6
  globalThis.process = { env: env };
7
7
  } else if (process.env) {
@@ -1,5 +1,5 @@
1
1
  ;(function () {
2
- const env = {"__INNETJS__PACKAGE_VERSION":"2.3.5"};
2
+ const env = {"__INNETJS__PACKAGE_VERSION":"2.3.6"};
3
3
  if (typeof process === 'undefined') {
4
4
  globalThis.process = { env: env };
5
5
  } else if (process.env) {
package/bin/innet CHANGED
@@ -164,9 +164,11 @@ function getFile(file) {
164
164
  }
165
165
  function convertIndexFile(data, version, baseUrl, index) {
166
166
  return tslib.__awaiter(this, void 0, void 0, function* () {
167
+ const { env } = process;
167
168
  return data
168
169
  .toString()
169
- .replace('</head>', `<script type="module" defer src="${baseUrl}${index}.js${version ? `?v=${version}` : ''}"></script></head>`);
170
+ .replace('</head>', `<script type="module" defer src="${baseUrl}${index}.js${version ? `?v=${version}` : ''}"></script></head>`)
171
+ .replace(/%([A-Z0-9_]+)%/g, (placeholder, placeholderId) => { var _a; return (_a = env[placeholderId]) !== null && _a !== void 0 ? _a : placeholder; });
170
172
  });
171
173
  }
172
174
  const reporter = (options, outputOptions, info) => {
@@ -769,7 +771,7 @@ class InnetJS {
769
771
  }
770
772
 
771
773
  (function () {
772
- const env = {"__INNETJS__PACKAGE_VERSION":"2.3.5"};
774
+ const env = {"__INNETJS__PACKAGE_VERSION":"2.3.6"};
773
775
  if (typeof process === 'undefined') {
774
776
  globalThis.process = { env: env };
775
777
  } else if (process.env) {
package/helpers.js CHANGED
@@ -39,9 +39,11 @@ function getFile(file) {
39
39
  }
40
40
  function convertIndexFile(data, version, baseUrl, index) {
41
41
  return tslib.__awaiter(this, void 0, void 0, function* () {
42
+ const { env } = process;
42
43
  return data
43
44
  .toString()
44
- .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
+ .replace(/%([A-Z0-9_]+)%/g, (placeholder, placeholderId) => { var _a; return (_a = env[placeholderId]) !== null && _a !== void 0 ? _a : placeholder; });
45
47
  });
46
48
  }
47
49
  const reporter = (options, outputOptions, info) => {
package/helpers.mjs CHANGED
@@ -28,9 +28,11 @@ function getFile(file) {
28
28
  }
29
29
  function convertIndexFile(data, version, baseUrl, index) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ const { env } = process;
31
32
  return data
32
33
  .toString()
33
- .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
+ .replace(/%([A-Z0-9_]+)%/g, (placeholder, placeholderId) => { var _a; return (_a = env[placeholderId]) !== null && _a !== void 0 ? _a : placeholder; });
34
36
  });
35
37
  }
36
38
  const reporter = (options, outputOptions, info) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",