@callstack/rspress-preset 0.4.5 → 0.5.1
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/dist/index.cjs +7 -4
- package/dist/index.js +7 -4
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -133,10 +133,14 @@ function addUTMParameters(url, location, siteTitle) {
|
|
|
133
133
|
const urlObj = new URL(url);
|
|
134
134
|
urlObj.searchParams.set('utm_campaign', 'open_source');
|
|
135
135
|
urlObj.searchParams.set('utm_source', siteTitle);
|
|
136
|
-
urlObj.searchParams.set('utm_medium', '
|
|
136
|
+
urlObj.searchParams.set('utm_medium', 'referral');
|
|
137
137
|
urlObj.searchParams.set('utm_content', location);
|
|
138
138
|
return urlObj.toString();
|
|
139
139
|
}
|
|
140
|
+
function getGlobalStyles(context) {
|
|
141
|
+
const stylesPath = external_node_path_default().join(context, 'theme/styles.css');
|
|
142
|
+
return external_node_fs_default().existsSync(stylesPath) ? stylesPath : void 0;
|
|
143
|
+
}
|
|
140
144
|
const createPreset = (config)=>{
|
|
141
145
|
var _config_theme, _docs_socials, _docs_socials1;
|
|
142
146
|
const { context, docs, vercelAnalytics } = config;
|
|
@@ -161,7 +165,7 @@ const createPreset = (config)=>{
|
|
|
161
165
|
title: docs.title,
|
|
162
166
|
description: docs.description,
|
|
163
167
|
icon: docs.icon,
|
|
164
|
-
globalStyles:
|
|
168
|
+
globalStyles: getGlobalStyles(context),
|
|
165
169
|
globalUIComponents: enableVercel ? [
|
|
166
170
|
[
|
|
167
171
|
external_node_path_default().join(external_node_path_default().dirname(preset_dirname), 'vendor/VercelAnalytics.ts'),
|
|
@@ -194,8 +198,7 @@ const createPreset = (config)=>{
|
|
|
194
198
|
message: `Copyright \xa9 ${new Date().getFullYear()} Callstack`
|
|
195
199
|
},
|
|
196
200
|
editLink: {
|
|
197
|
-
docRepoBaseUrl: docs.editUrl
|
|
198
|
-
text: 'Edit this page on GitHub'
|
|
201
|
+
docRepoBaseUrl: docs.editUrl
|
|
199
202
|
},
|
|
200
203
|
socialLinks: createSocialLinks(docs.socials)
|
|
201
204
|
},
|
package/dist/index.js
CHANGED
|
@@ -90,10 +90,14 @@ function addUTMParameters(url, location, siteTitle) {
|
|
|
90
90
|
const urlObj = new URL(url);
|
|
91
91
|
urlObj.searchParams.set('utm_campaign', 'open_source');
|
|
92
92
|
urlObj.searchParams.set('utm_source', siteTitle);
|
|
93
|
-
urlObj.searchParams.set('utm_medium', '
|
|
93
|
+
urlObj.searchParams.set('utm_medium', 'referral');
|
|
94
94
|
urlObj.searchParams.set('utm_content', location);
|
|
95
95
|
return urlObj.toString();
|
|
96
96
|
}
|
|
97
|
+
function getGlobalStyles(context) {
|
|
98
|
+
const stylesPath = node_path.join(context, 'theme/styles.css');
|
|
99
|
+
return node_fs.existsSync(stylesPath) ? stylesPath : void 0;
|
|
100
|
+
}
|
|
97
101
|
const createPreset = (config)=>{
|
|
98
102
|
var _config_theme, _docs_socials, _docs_socials1;
|
|
99
103
|
const { context, docs, vercelAnalytics } = config;
|
|
@@ -118,7 +122,7 @@ const createPreset = (config)=>{
|
|
|
118
122
|
title: docs.title,
|
|
119
123
|
description: docs.description,
|
|
120
124
|
icon: docs.icon,
|
|
121
|
-
globalStyles:
|
|
125
|
+
globalStyles: getGlobalStyles(context),
|
|
122
126
|
globalUIComponents: enableVercel ? [
|
|
123
127
|
[
|
|
124
128
|
node_path.join(node_path.dirname(preset_dirname), 'vendor/VercelAnalytics.ts'),
|
|
@@ -151,8 +155,7 @@ const createPreset = (config)=>{
|
|
|
151
155
|
message: `Copyright \xa9 ${new Date().getFullYear()} Callstack`
|
|
152
156
|
},
|
|
153
157
|
editLink: {
|
|
154
|
-
docRepoBaseUrl: docs.editUrl
|
|
155
|
-
text: 'Edit this page on GitHub'
|
|
158
|
+
docRepoBaseUrl: docs.editUrl
|
|
156
159
|
},
|
|
157
160
|
socialLinks: createSocialLinks(docs.socials)
|
|
158
161
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callstack/rspress-preset",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Callstack preset for Rspress docs",
|
|
5
5
|
"author": "Jakub Romańczyk <jakub.romanczyk@callstack.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"typescript"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@rspress/plugin-llms": "2.0.0-
|
|
43
|
-
"@rspress/plugin-sitemap": "2.0.0-
|
|
42
|
+
"@rspress/plugin-llms": "2.0.0-rc.4",
|
|
43
|
+
"@rspress/plugin-sitemap": "2.0.0-rc.4",
|
|
44
44
|
"@vercel/analytics": "^1.5.0",
|
|
45
45
|
"rsbuild-plugin-open-graph": "^1.0.2",
|
|
46
46
|
"zod": "^3.23.8",
|
|
47
|
-
"@callstack/rspress-theme": "0.
|
|
47
|
+
"@callstack/rspress-theme": "0.5.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@rspress/core": "2.0.0-
|
|
50
|
+
"@rspress/core": "2.0.0-rc.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@microsoft/api-extractor": "^7.52.8",
|
|
54
54
|
"@rslib/core": "^0.10.5",
|
|
55
|
-
"@rspress/core": "2.0.0-
|
|
55
|
+
"@rspress/core": "2.0.0-rc.4",
|
|
56
56
|
"@types/node": "^22",
|
|
57
|
-
"typescript": "^5.
|
|
57
|
+
"typescript": "^5.9.3"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "rslib build",
|