@rspress/shared 1.2.0 → 1.3.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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { BuilderConfig } from '@modern-js/builder-rspack-provider';
1
+ import { RsbuildPlugin } from '@rsbuild/core';
2
+ import { RsbuildConfig } from '@rsbuild/core/rspack-provider';
2
3
  import { PluggableList } from 'unified';
3
- import { BuilderPlugin } from '@modern-js/builder';
4
4
 
5
5
  interface ZoomOptions {
6
6
  /**
@@ -278,9 +278,9 @@ interface RspressPlugin {
278
278
  globalComponents?: string[];
279
279
  };
280
280
  /**
281
- * Builder config.
281
+ * Rsbuild config.
282
282
  */
283
- builderConfig?: BuilderConfig;
283
+ builderConfig?: RsbuildConfig;
284
284
  /**
285
285
  * Inject global components.
286
286
  */
@@ -413,9 +413,9 @@ interface UserConfig<ThemeConfig = Config$1> {
413
413
  */
414
414
  themeConfig?: ThemeConfig;
415
415
  /**
416
- * Builder Configuration
416
+ * Rsbuild Configuration
417
417
  */
418
- builderConfig?: BuilderConfig;
418
+ builderConfig?: RsbuildConfig;
419
419
  /**
420
420
  * The custom config of vite-plugin-route
421
421
  */
@@ -466,7 +466,7 @@ interface UserConfig<ThemeConfig = Config$1> {
466
466
  /**
467
467
  * Add some extra builder plugins
468
468
  */
469
- builderPlugins?: BuilderPlugin[];
469
+ builderPlugins?: RsbuildPlugin[];
470
470
  /**
471
471
  * Multi version config
472
472
  */
@@ -549,6 +549,7 @@ interface Feature {
549
549
  icon: string;
550
550
  title: string;
551
551
  details: string;
552
+ span?: number;
552
553
  link?: string;
553
554
  }
554
555
  interface PageModule<T extends React.ComponentType<unknown>> {
package/dist/index.js CHANGED
@@ -1263,7 +1263,10 @@ function withBase(url = "/", base = "") {
1263
1263
  return normalizedUrl.startsWith(normalizedBase) ? normalizedUrl : `${normalizedBase}${normalizedUrl}`;
1264
1264
  }
1265
1265
  function removeBase(url, base) {
1266
- return addLeadingSlash(url).replace(normalizeSlash(base), "");
1266
+ return addLeadingSlash(url).replace(
1267
+ new RegExp(`^${normalizeSlash(base)}`),
1268
+ ""
1269
+ );
1267
1270
  }
1268
1271
  function withoutHash(url) {
1269
1272
  return url.split("#")[0];
package/dist/index.mjs CHANGED
@@ -1209,7 +1209,10 @@ function withBase(url = "/", base = "") {
1209
1209
  return normalizedUrl.startsWith(normalizedBase) ? normalizedUrl : `${normalizedBase}${normalizedUrl}`;
1210
1210
  }
1211
1211
  function removeBase(url, base) {
1212
- return addLeadingSlash(url).replace(normalizeSlash(base), "");
1212
+ return addLeadingSlash(url).replace(
1213
+ new RegExp(`^${normalizeSlash(base)}`),
1214
+ ""
1215
+ );
1213
1216
  }
1214
1217
  function withoutHash(url) {
1215
1218
  return url.split("#")[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -22,8 +22,7 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@modern-js/builder": "2.37.1",
26
- "@modern-js/builder-rspack-provider": "2.37.1",
25
+ "@rsbuild/core": "0.0.10",
27
26
  "unified": "10.1.2",
28
27
  "chalk": "4.1.2",
29
28
  "rslog": "^1.1.0"