@callstack/rspress-preset 0.4.5 → 0.5.0

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 CHANGED
@@ -137,6 +137,10 @@ function addUTMParameters(url, location, siteTitle) {
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: external_node_path_default().join(context, 'theme/styles.css'),
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
@@ -94,6 +94,10 @@ function addUTMParameters(url, location, siteTitle) {
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: node_path.join(context, 'theme/styles.css'),
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.4.5",
3
+ "version": "0.5.0",
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-beta.34",
43
- "@rspress/plugin-sitemap": "2.0.0-beta.34",
42
+ "@rspress/plugin-llms": "2.0.0-rc.3",
43
+ "@rspress/plugin-sitemap": "2.0.0-rc.3",
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.4.5"
47
+ "@callstack/rspress-theme": "0.5.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@rspress/core": "2.0.0-beta.34"
50
+ "@rspress/core": "2.0.0-rc.3"
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-beta.34",
55
+ "@rspress/core": "2.0.0-rc.3",
56
56
  "@types/node": "^22",
57
- "typescript": "^5.8.3"
57
+ "typescript": "^5.9.3"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "rslib build",