gatsby-matrix-theme 53.28.7 → 53.28.8
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/CHANGELOG.md +11 -0
- package/critical-css/publicPrefix.js +19 -1
- package/critical-css/publicPrefix.test.js +25 -1
- package/gatsby-ssr.js +16 -1
- package/package.json +1 -1
- package/storybook/public/project.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [53.28.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.28.7...v53.28.8) (2026-09-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* match ssr skipRoutes on subfolder-prefixed pathnames ([a4e9239](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/a4e92399e1dcee8fcf7f16d29f77d30ea19b90f3))
|
|
7
|
+
* match ssr skipRoutes when the market subfolder is the first route segment ([6c0467b](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/6c0467b81e963ec5eed51d22d2de7d550435128a))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'fix/critical-css-asset-prefix' into 'master' ([2b628c6](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/2b628c634d2efa3c54dc1af38aea72bf571480b9))
|
|
11
|
+
|
|
1
12
|
## [53.28.7](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.28.6...v53.28.7) (2026-09-01)
|
|
2
13
|
|
|
3
14
|
|
|
@@ -25,4 +25,22 @@ function composePublicPrefix({ assetPrefix, pathPrefix, prefixPaths }) {
|
|
|
25
25
|
return '';
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* pathOfPrefix — the path-only portion of a combined prefix: '' for none, '/apostas' for both
|
|
30
|
+
* `/apostas` and `https://www.meutimao.com.br/apostas`. Subfolder-served sites receive request
|
|
31
|
+
* pathnames WITH the subfolder (e.g. `/apostas/s`), so route matching must strip this first.
|
|
32
|
+
*/
|
|
33
|
+
function pathOfPrefix(prefix) {
|
|
34
|
+
if (!prefix) return '';
|
|
35
|
+
if (isURL(prefix)) {
|
|
36
|
+
try {
|
|
37
|
+
const url = new URL(prefix.startsWith('//') ? `http:${prefix}` : prefix);
|
|
38
|
+
return url.pathname.replace(/\/$/, '');
|
|
39
|
+
} catch (e) {
|
|
40
|
+
return '';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return prefix;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = { composePublicPrefix, pathOfPrefix };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { composePublicPrefix } from './publicPrefix';
|
|
1
|
+
import { composePublicPrefix, pathOfPrefix } from './publicPrefix';
|
|
2
2
|
|
|
3
3
|
// Mirrors Gatsby's getPublicPath (gatsby/dist/utils/get-public-path.js) — these cases are the
|
|
4
4
|
// documented semantics of __PATH_PREFIX__ / webpack publicPath.
|
|
@@ -43,3 +43,27 @@ describe('composePublicPrefix', () => {
|
|
|
43
43
|
);
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
describe('pathOfPrefix', () => {
|
|
48
|
+
test('empty prefix has no path', () => {
|
|
49
|
+
expect(pathOfPrefix('')).toBe('');
|
|
50
|
+
expect(pathOfPrefix(undefined)).toBe('');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('URL prefix with a subfolder yields the subfolder path', () => {
|
|
54
|
+
expect(pathOfPrefix('https://www.meutimao.com.br/apostas')).toBe('/apostas');
|
|
55
|
+
expect(pathOfPrefix('https://odia.ig.com.br/apostas')).toBe('/apostas');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('URL prefix at the domain root yields no path', () => {
|
|
59
|
+
expect(pathOfPrefix('https://prelive.apostasbrz.com')).toBe('');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('protocol-relative prefix yields its path', () => {
|
|
63
|
+
expect(pathOfPrefix('//cdn.example.com/sub')).toBe('/sub');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('bare path prefix is returned as-is', () => {
|
|
67
|
+
expect(pathOfPrefix('/blog')).toBe('/blog');
|
|
68
|
+
});
|
|
69
|
+
});
|
package/gatsby-ssr.js
CHANGED
|
@@ -26,6 +26,7 @@ const fs = require('fs');
|
|
|
26
26
|
const path = require('path');
|
|
27
27
|
const React = require('react');
|
|
28
28
|
const { resolveConfig } = require('./critical-css/config');
|
|
29
|
+
const { pathOfPrefix } = require('./critical-css/publicPrefix');
|
|
29
30
|
|
|
30
31
|
// module chunks = every emitted stylesheet except the base (`styles.*`) and route shells
|
|
31
32
|
// (`component---*`), which Gatsby already inlines render-blocking for the matched route.
|
|
@@ -83,11 +84,25 @@ exports.onRenderBody = ({ setHeadComponents, pathname, pathPrefix }, pluginOptio
|
|
|
83
84
|
try {
|
|
84
85
|
const cfg = resolveConfig(pluginOptions);
|
|
85
86
|
if (!cfg.enabled) return;
|
|
86
|
-
if (!cfg.skipRoutes.includes(firstSegment(pathname))) return;
|
|
87
87
|
|
|
88
88
|
// pathPrefix here is Gatsby's combined __PATH_PREFIX__ (assetPrefix + pathPrefix) on
|
|
89
89
|
// --prefix-paths builds — required for subfolder-served sites, '' on root-served ones.
|
|
90
90
|
const prefix = typeof pathPrefix === 'string' ? pathPrefix.replace(/\/+$/, '') : '';
|
|
91
|
+
|
|
92
|
+
// Subfolder sites carry the subfolder IN the route: gatsby-core-theme creates the search page
|
|
93
|
+
// at `${market.path_prefix}/s` (e.g. `/apostas/s`), on every environment — so the first path
|
|
94
|
+
// segment is the market subfolder, not the route name. Match skipRoutes against the first two
|
|
95
|
+
// raw segments (route name is at most one market subfolder deep) and, for deeper asset-prefix
|
|
96
|
+
// subfolders, against the pathname with the prefix's path part stripped.
|
|
97
|
+
const basePath = pathOfPrefix(prefix);
|
|
98
|
+
const rawPath = String(pathname || '').split('?')[0];
|
|
99
|
+
const strippedPath =
|
|
100
|
+
basePath && (rawPath === basePath || rawPath.startsWith(`${basePath}/`))
|
|
101
|
+
? rawPath.slice(basePath.length)
|
|
102
|
+
: rawPath;
|
|
103
|
+
const segments = rawPath.split('/').filter(Boolean).slice(0, 2);
|
|
104
|
+
segments.push(firstSegment(strippedPath));
|
|
105
|
+
if (!segments.some((seg) => cfg.skipRoutes.includes(seg))) return;
|
|
91
106
|
const links = getModuleCssLinks(prefix);
|
|
92
107
|
if (links.length) setHeadComponents(links);
|
|
93
108
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
2
|
-
don-measure":{"version":"6.5.16-alpha.0"},"@storybook/addon-outline":{"version":"6.5.16-alpha.0"},"@storybook/addon-storyshots":{"version":"6.5.16-alpha.0"},"@storybook/addon-storyshots-puppeteer":{"version":"6.5.16-alpha.0"},"@storybook/addon-storysource":{"version":"6.5.16-alpha.0"},"@storybook/addon-toolbars":{"version":"6.5.16-alpha.0"},"@storybook/addon-viewport":{"version":"6.5.16-alpha.0"},"@storybook/addons":{"version":"6.5.16-alpha.0"},"@storybook/angular":{"version":"6.5.16-alpha.0"},"@storybook/api":{"version":"6.5.16-alpha.0"},"@storybook/babel-plugin-require-context-hook":{"version":"1.0.1"},"@storybook/channel-postmessage":{"version":"6.5.16-alpha.0"},"@storybook/channel-websocket":{"version":"6.5.16-alpha.0"},"@storybook/channels":{"version":"6.5.16-alpha.0"},"@storybook/cli":{"version":"6.5.16-alpha.0"},"@storybook/client-api":{"version":"6.5.16-alpha.0"},"@storybook/client-logger":{"version":"6.5.16-alpha.0"},"@storybook/codemod":{"version":"6.5.16-alpha.0"},"@storybook/components":{"version":"6.5.16-alpha.0"},"@storybook/core":{"version":"6.5.16-alpha.0"},"@storybook/core-events":{"version":"6.5.16-alpha.0"},"@storybook/csf-tools":{"version":"6.5.16-alpha.0"},"@storybook/docs-tools":{"version":"6.5.16-alpha.0"},"@storybook/ember":{"version":"6.5.16-alpha.0"},"@storybook/eslint-config-storybook":{"version":"2.4.0"},"@storybook/html":{"version":"6.5.16-alpha.0"},"@storybook/instrumenter":{"version":"6.5.16-alpha.0"},"@storybook/jest":{"version":"0.0.5"},"@storybook/linter-config":{"version":"2.5.0"},"@storybook/node-logger":{"version":"6.5.16-alpha.0"},"@storybook/postinstall":{"version":"6.5.16-alpha.0"},"@storybook/preact":{"version":"6.5.16-alpha.0"},"@storybook/preview-web":{"version":"6.5.16-alpha.0"},"@storybook/react":{"version":"6.5.16-alpha.0"},"@storybook/router":{"version":"6.5.16-alpha.0"},"@storybook/semver":{"version":"7.3.2"},"@storybook/server":{"version":"6.5.16-alpha.0"},"@storybook/source-loader":{"version":"6.5.16-alpha.0"},"@storybook/store":{"version":"6.5.16-alpha.0"},"@storybook/svelte":{"version":"6.5.16-alpha.0"},"@storybook/telemetry":{"version":"6.5.16-alpha.0"},"@storybook/testing-library":{"version":"0.0.7"},"@storybook/theming":{"version":"6.5.16-alpha.0"},"@storybook/ui":{"version":"6.5.16-alpha.0"},"@storybook/vue":{"version":"6.5.16-alpha.0"},"@storybook/web-components":{"version":"6.5.16-alpha.0"},"eslint-plugin-storybook":{"version":"0.3.5"}},"framework":{"name":"angular"},"addons":{"@storybook/addon-links":{"version":"6.5.16-alpha.0"},"@storybook/addon-essentials":{"version":"6.5.16-alpha.0"}}}
|
|
1
|
+
{"generatedAt":1788264822388,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"Gatsby","packageName":"gatsby","version":"5.13.6"},"monorepo":"Workspaces","packageManager":{"type":"yarn","version":"1.22.19"},"storybookVersion":"6.5.16","language":"javascript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/builder-webpack5":{"version":"6.5.16"},"@storybook/manager-webpack5":{"version":"6.5.16"},"@storybook/react":{"version":"6.5.16"}},"framework":{"name":"react"},"addons":{"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":"6.5.16"}}}
|