@lynx-js/rspeedy-canary 0.11.7-canary-20251023-9fb4623f → 0.11.8-canary-20251028-0abaf22b

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 CHANGED
@@ -1,6 +1,14 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
- ## 0.11.7-canary-20251023071457-9fb4623f0e4c98c97146840ffe529d95577fa628
3
+ ## 0.11.8-canary-20251028110010-0abaf22b9e1d9b3ad225ea9106d3b9fbe473f47b
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: support web preview in rspeedy dev ([#1891](https://github.com/lynx-family/lynx-stack/pull/1891))
8
+
9
+ - print URLs with labels
10
+
11
+ ## 0.11.7
4
12
 
5
13
  ### Patch Changes
6
14
 
@@ -11,7 +19,7 @@
11
19
  - support web preview in rspeedy dev (experimental)
12
20
 
13
21
  - Updated dependencies []:
14
- - @lynx-js/web-rsbuild-server-middleware@0.18.1-canary-20251023071457-9fb4623f0e4c98c97146840ffe529d95577fa628
22
+ - @lynx-js/web-rsbuild-server-middleware@0.18.1
15
23
 
16
24
  ## 0.11.6
17
25
 
@@ -77,6 +77,41 @@ export const __webpack_modules__ = {
77
77
  assetPrefix
78
78
  }
79
79
  }));
80
+ api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
81
+ const rspeedyAPIs = api.useExposed(Symbol.for('rspeedy.api'));
82
+ const defaultFilename = '[name].[platform].bundle';
83
+ const { filename } = rspeedyAPIs.config.output ?? {};
84
+ let name;
85
+ name = filename ? 'object' == typeof filename ? filename.bundle ?? filename.template ?? defaultFilename : filename : defaultFilename;
86
+ if (config.server?.printUrls === void 0 || config.server?.printUrls === true) {
87
+ const environmentNames = Object.keys(config.environments ?? {});
88
+ return mergeRsbuildConfig(config, {
89
+ server: {
90
+ printUrls: (param)=>{
91
+ const finalUrls = [];
92
+ const baseForUrls = ('string' == typeof assetPrefix ? assetPrefix : `http://${hostname}:<port>/`).replaceAll('<port>', String(param.port));
93
+ for (const entry of Object.keys(config.source?.entry ?? {}))for (const environmentName of environmentNames){
94
+ const pathname = name.replaceAll('[name]', entry).replaceAll('[platform]', environmentName);
95
+ finalUrls.push({
96
+ label: environmentName,
97
+ url: new URL(pathname, baseForUrls).toString()
98
+ });
99
+ if ('web' === environmentName) finalUrls.push({
100
+ label: "Web Preview",
101
+ url: new URL(`/__web_preview?casename=${encodeURIComponent(pathname)}`, baseForUrls).toString()
102
+ });
103
+ }
104
+ return finalUrls.map((urlInfo)=>{
105
+ const label = urlInfo.label.charAt(0).toUpperCase() + urlInfo.label.slice(1);
106
+ urlInfo.label = label;
107
+ return urlInfo;
108
+ });
109
+ }
110
+ }
111
+ });
112
+ }
113
+ return config;
114
+ });
80
115
  const require = createRequire(import.meta.url);
81
116
  api.modifyBundlerChain((chain, { isDev, environment })=>{
82
117
  const { action } = api.context;
@@ -63,7 +63,7 @@ export const __webpack_modules__ = {
63
63
  });
64
64
  var core_ = __webpack_require__("@rsbuild/core");
65
65
  var package_namespaceObject = {
66
- rE: "0.11.6"
66
+ rE: "0.11.7"
67
67
  };
68
68
  const version = package_namespaceObject.rE;
69
69
  const rspackVersion = core_.rspack.rspackVersion;
@@ -77,6 +77,41 @@ export const __webpack_modules__ = {
77
77
  assetPrefix
78
78
  }
79
79
  }));
80
+ api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
81
+ const rspeedyAPIs = api.useExposed(Symbol.for('rspeedy.api'));
82
+ const defaultFilename = '[name].[platform].bundle';
83
+ const { filename } = rspeedyAPIs.config.output ?? {};
84
+ let name;
85
+ name = filename ? 'object' == typeof filename ? filename.bundle ?? filename.template ?? defaultFilename : filename : defaultFilename;
86
+ if (config.server?.printUrls === void 0 || config.server?.printUrls === true) {
87
+ const environmentNames = Object.keys(config.environments ?? {});
88
+ return mergeRsbuildConfig(config, {
89
+ server: {
90
+ printUrls: (param)=>{
91
+ const finalUrls = [];
92
+ const baseForUrls = ('string' == typeof assetPrefix ? assetPrefix : `http://${hostname}:<port>/`).replaceAll('<port>', String(param.port));
93
+ for (const entry of Object.keys(config.source?.entry ?? {}))for (const environmentName of environmentNames){
94
+ const pathname = name.replaceAll('[name]', entry).replaceAll('[platform]', environmentName);
95
+ finalUrls.push({
96
+ label: environmentName,
97
+ url: new URL(pathname, baseForUrls).toString()
98
+ });
99
+ if ('web' === environmentName) finalUrls.push({
100
+ label: "Web Preview",
101
+ url: new URL(`/__web_preview?casename=${encodeURIComponent(pathname)}`, baseForUrls).toString()
102
+ });
103
+ }
104
+ return finalUrls.map((urlInfo)=>{
105
+ const label = urlInfo.label.charAt(0).toUpperCase() + urlInfo.label.slice(1);
106
+ urlInfo.label = label;
107
+ return urlInfo;
108
+ });
109
+ }
110
+ }
111
+ });
112
+ }
113
+ return config;
114
+ });
80
115
  const require = createRequire(import.meta.url);
81
116
  api.modifyBundlerChain((chain, { isDev, environment })=>{
82
117
  const { action } = api.context;
@@ -11,7 +11,7 @@ export const __webpack_modules__ = {
11
11
  });
12
12
  var core_ = __webpack_require__("@rsbuild/core");
13
13
  var package_namespaceObject = {
14
- rE: "0.11.6"
14
+ rE: "0.11.7"
15
15
  };
16
16
  const version = package_namespaceObject.rE;
17
17
  const rspackVersion = core_.rspack.rspackVersion;
package/dist/index.js CHANGED
@@ -108,7 +108,7 @@ var __webpack_modules__ = {
108
108
  });
109
109
  var core_ = __webpack_require__("@rsbuild/core");
110
110
  var package_namespaceObject = {
111
- rE: "0.11.6"
111
+ rE: "0.11.7"
112
112
  };
113
113
  const version = package_namespaceObject.rE;
114
114
  const rspackVersion = core_.rspack.rspackVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/rspeedy-canary",
3
- "version": "0.11.7-canary-20251023-9fb4623f",
3
+ "version": "0.11.8-canary-20251028-0abaf22b",
4
4
  "description": "A webpack/rspack-based frontend toolchain for Lynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@lynx-js/cache-events-webpack-plugin": "npm:@lynx-js/cache-events-webpack-plugin-canary@0.0.2",
52
52
  "@lynx-js/chunk-loading-webpack-plugin": "npm:@lynx-js/chunk-loading-webpack-plugin-canary@0.3.3",
53
- "@lynx-js/web-rsbuild-server-middleware": "npm:@lynx-js/web-rsbuild-server-middleware-canary@0.18.1-canary-20251023-9fb4623f",
53
+ "@lynx-js/web-rsbuild-server-middleware": "npm:@lynx-js/web-rsbuild-server-middleware-canary@0.18.1",
54
54
  "@lynx-js/webpack-dev-transport": "npm:@lynx-js/webpack-dev-transport-canary@0.2.0",
55
55
  "@lynx-js/websocket": "npm:@lynx-js/websocket-canary@0.0.4",
56
56
  "@rsbuild/core": "1.5.17",