@tramvai/module-progressive-web-app 3.41.22 → 3.41.26

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,5 +1,6 @@
1
1
  import { declareModule, provide, Scope } from '@tramvai/core';
2
2
  import { PROXY_CONFIG_TOKEN } from '@tramvai/tokens-server';
3
+ import { ASSETS_PREFIX_TOKEN } from '@tramvai/tokens-render';
3
4
  import { appConfig } from '@tramvai/cli/lib/external/config';
4
5
  import { PWA_MANIFEST_URL_TOKEN, PWA_SW_SCOPE_TOKEN } from '../tokens.es.js';
5
6
  import { registerWebManifestProvider, validateRelativeUrlProvider } from './shared/providers.es.js';
@@ -10,12 +11,12 @@ const TramvaiPwaManifestModule = declareModule({
10
11
  provide({
11
12
  provide: PROXY_CONFIG_TOKEN,
12
13
  scope: Scope.SINGLETON,
13
- useFactory: ({ manifestUrl, swScope }) => {
14
+ useFactory: ({ manifestUrl, swScope, assetsPrefixFactory }) => {
14
15
  var _a, _b;
15
16
  return {
16
17
  context: [manifestUrl],
17
18
  // appConfig.assetsPrefix available in 'development' mode
18
- target: (_b = (_a = appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : process.env.ASSETS_PREFIX) !== null && _b !== void 0 ? _b : '',
19
+ target: (_b = (_a = appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : assetsPrefixFactory()) !== null && _b !== void 0 ? _b : '',
19
20
  pathRewrite: (path) => {
20
21
  return path.replace(swScope, '/');
21
22
  },
@@ -24,6 +25,7 @@ const TramvaiPwaManifestModule = declareModule({
24
25
  deps: {
25
26
  manifestUrl: PWA_MANIFEST_URL_TOKEN,
26
27
  swScope: PWA_SW_SCOPE_TOKEN,
28
+ assetsPrefixFactory: ASSETS_PREFIX_TOKEN,
27
29
  },
28
30
  }),
29
31
  provide({
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@tramvai/core');
6
6
  var tokensServer = require('@tramvai/tokens-server');
7
+ var tokensRender = require('@tramvai/tokens-render');
7
8
  var config = require('@tramvai/cli/lib/external/config');
8
9
  var tokens = require('../tokens.js');
9
10
  var providers = require('./shared/providers.js');
@@ -14,12 +15,12 @@ const TramvaiPwaManifestModule = core.declareModule({
14
15
  core.provide({
15
16
  provide: tokensServer.PROXY_CONFIG_TOKEN,
16
17
  scope: core.Scope.SINGLETON,
17
- useFactory: ({ manifestUrl, swScope }) => {
18
+ useFactory: ({ manifestUrl, swScope, assetsPrefixFactory }) => {
18
19
  var _a, _b;
19
20
  return {
20
21
  context: [manifestUrl],
21
22
  // appConfig.assetsPrefix available in 'development' mode
22
- target: (_b = (_a = config.appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : process.env.ASSETS_PREFIX) !== null && _b !== void 0 ? _b : '',
23
+ target: (_b = (_a = config.appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : assetsPrefixFactory()) !== null && _b !== void 0 ? _b : '',
23
24
  pathRewrite: (path) => {
24
25
  return path.replace(swScope, '/');
25
26
  },
@@ -28,6 +29,7 @@ const TramvaiPwaManifestModule = core.declareModule({
28
29
  deps: {
29
30
  manifestUrl: tokens.PWA_MANIFEST_URL_TOKEN,
30
31
  swScope: tokens.PWA_SW_SCOPE_TOKEN,
32
+ assetsPrefixFactory: tokensRender.ASSETS_PREFIX_TOKEN,
31
33
  },
32
34
  }),
33
35
  core.provide({
@@ -1,5 +1,6 @@
1
1
  import { provide, commandLineListTokens, declareModule, Scope } from '@tramvai/core';
2
2
  import { PROXY_CONFIG_TOKEN } from '@tramvai/tokens-server';
3
+ import { ASSETS_PREFIX_TOKEN } from '@tramvai/tokens-render';
3
4
  import { appConfig } from '@tramvai/cli/lib/external/config';
4
5
  import { PWA_SW_URL_TOKEN, PWA_SW_SCOPE_TOKEN } from '../tokens.es.js';
5
6
  import { providers, sharedPwaLightModuleProviders } from './shared/providers/swProviders.es.js';
@@ -38,12 +39,12 @@ const TramvaiPwaWorkboxModule = declareModule({
38
39
  provide({
39
40
  provide: PROXY_CONFIG_TOKEN,
40
41
  scope: Scope.SINGLETON,
41
- useFactory: ({ swUrl, swScope }) => {
42
+ useFactory: ({ swUrl, swScope, assetsPrefixFactory }) => {
42
43
  var _a, _b;
43
44
  return {
44
45
  context: [swUrl, swUrl.replace(/\.js$/, '.modern.js')],
45
46
  // appConfig.assetsPrefix available in 'development' mode
46
- target: (_b = (_a = appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : process.env.ASSETS_PREFIX) !== null && _b !== void 0 ? _b : '',
47
+ target: (_b = (_a = appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : assetsPrefixFactory()) !== null && _b !== void 0 ? _b : '',
47
48
  pathRewrite: (path) => {
48
49
  return path.replace(swScope, '/');
49
50
  },
@@ -52,6 +53,7 @@ const TramvaiPwaWorkboxModule = declareModule({
52
53
  deps: {
53
54
  swUrl: PWA_SW_URL_TOKEN,
54
55
  swScope: PWA_SW_SCOPE_TOKEN,
56
+ assetsPrefixFactory: ASSETS_PREFIX_TOKEN,
55
57
  },
56
58
  }),
57
59
  validateSwUrlAndScopeProvider,
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@tramvai/core');
6
6
  var tokensServer = require('@tramvai/tokens-server');
7
+ var tokensRender = require('@tramvai/tokens-render');
7
8
  var config = require('@tramvai/cli/lib/external/config');
8
9
  var tokens = require('../tokens.js');
9
10
  var swProviders = require('./shared/providers/swProviders.js');
@@ -42,12 +43,12 @@ const TramvaiPwaWorkboxModule = core.declareModule({
42
43
  core.provide({
43
44
  provide: tokensServer.PROXY_CONFIG_TOKEN,
44
45
  scope: core.Scope.SINGLETON,
45
- useFactory: ({ swUrl, swScope }) => {
46
+ useFactory: ({ swUrl, swScope, assetsPrefixFactory }) => {
46
47
  var _a, _b;
47
48
  return {
48
49
  context: [swUrl, swUrl.replace(/\.js$/, '.modern.js')],
49
50
  // appConfig.assetsPrefix available in 'development' mode
50
- target: (_b = (_a = config.appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : process.env.ASSETS_PREFIX) !== null && _b !== void 0 ? _b : '',
51
+ target: (_b = (_a = config.appConfig.assetsPrefix) !== null && _a !== void 0 ? _a : assetsPrefixFactory()) !== null && _b !== void 0 ? _b : '',
51
52
  pathRewrite: (path) => {
52
53
  return path.replace(swScope, '/');
53
54
  },
@@ -56,6 +57,7 @@ const TramvaiPwaWorkboxModule = core.declareModule({
56
57
  deps: {
57
58
  swUrl: tokens.PWA_SW_URL_TOKEN,
58
59
  swScope: tokens.PWA_SW_SCOPE_TOKEN,
60
+ assetsPrefixFactory: tokensRender.ASSETS_PREFIX_TOKEN,
59
61
  },
60
62
  }),
61
63
  validateSwUrlAndScopeProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-progressive-web-app",
3
- "version": "3.41.22",
3
+ "version": "3.41.26",
4
4
  "description": "Pwa integration - SW, manifest, icons and meta",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -23,15 +23,15 @@
23
23
  "registry": "https://registry.npmjs.org/"
24
24
  },
25
25
  "dependencies": {
26
- "@tramvai/tokens-common": "3.41.22",
27
- "@tramvai/tokens-render": "3.41.22",
28
- "@tramvai/tokens-server": "3.41.22",
26
+ "@tramvai/tokens-common": "3.41.26",
27
+ "@tramvai/tokens-render": "3.41.26",
28
+ "@tramvai/tokens-server": "3.41.26",
29
29
  "workbox-window": "^6.6.1"
30
30
  },
31
31
  "devDependencies": {},
32
32
  "peerDependencies": {
33
- "@tramvai/cli": "3.41.22",
34
- "@tramvai/core": "3.41.22",
33
+ "@tramvai/cli": "3.41.26",
34
+ "@tramvai/core": "3.41.26",
35
35
  "@tinkoff/dippy": "0.9.4",
36
36
  "tslib": "^2.4.0"
37
37
  }