create-rsbuild 2.2.14 → 2.3.0-beta.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/README.md CHANGED
@@ -134,6 +134,20 @@ npx -y create-rsbuild@latest my-app -t octane-js
134
134
  npx -y create-rsbuild@latest my-app -t octane-ts
135
135
  ```
136
136
 
137
+ - **Lynx**
138
+
139
+ Creates a ReactLynx app with Rsbuild using `@lynx-js/create-lynx`.
140
+
141
+ ```bash
142
+ # Basic (JavaScript)
143
+ npx -y create-rsbuild@latest my-app -t lynx-js
144
+
145
+ # Basic (TypeScript)
146
+ npx -y create-rsbuild@latest my-app -t lynx-ts
147
+ ```
148
+
149
+ See the [Lynx guide](https://lynxjs.org/next/guide/build/index.html) for configuration and development instructions.
150
+
137
151
  ## Documentation
138
152
 
139
153
  See [Documentation](https://rsbuild.rs/guide/start/quick-start).
package/dist/index.js CHANGED
@@ -147,15 +147,40 @@ async function getTemplateName({ dir, template }) {
147
147
  },
148
148
  {
149
149
  value: 'solid',
150
- label: 'Solid 1'
151
- },
152
- {
153
- value: 'solid2',
154
- label: 'Solid 2'
150
+ label: 'Solid'
155
151
  },
156
152
  {
157
153
  value: 'octane',
158
154
  label: 'Octane'
155
+ },
156
+ {
157
+ value: 'lynx',
158
+ label: 'Lynx'
159
+ }
160
+ ]
161
+ }));
162
+ if ('solid' === framework) return checkCancel(await create_toolkit_select({
163
+ message: 'Select template',
164
+ options: [
165
+ {
166
+ value: 'solid-ts',
167
+ label: 'Solid 1 (TypeScript)'
168
+ },
169
+ {
170
+ value: 'solid-js',
171
+ label: 'Solid 1 (JavaScript)'
172
+ },
173
+ {
174
+ value: 'solid2-ts',
175
+ label: 'Solid 2 (TypeScript)'
176
+ },
177
+ {
178
+ value: 'solid2-js',
179
+ label: 'Solid 2 (JavaScript)'
180
+ },
181
+ {
182
+ value: 'tanstack-start-solid',
183
+ label: 'TanStack Start'
159
184
  }
160
185
  ]
161
186
  }));
@@ -170,7 +195,7 @@ async function getTemplateName({ dir, template }) {
170
195
  value: 'js',
171
196
  label: 'Basic (JavaScript)'
172
197
  },
173
- ...'react' === framework || 'solid' === framework ? [
198
+ ...'react' === framework ? [
174
199
  {
175
200
  value: 'tanstack-start',
176
201
  label: 'TanStack Start'
@@ -207,7 +232,33 @@ function createTanStackProject(framework, { distFolder, packageName, gitEnabled,
207
232
  });
208
233
  process.exitCode = result.exitCode ?? 1;
209
234
  }
210
- function mapESLintTemplate(templateName) {
235
+ function createLynxProject(language, { distFolder, packageName, gitEnabled, override }) {
236
+ const args = [
237
+ '@lynx-js/create-lynx@latest',
238
+ distFolder,
239
+ '--template',
240
+ `rsbuild-react-${language}`,
241
+ '--package-name',
242
+ packageName
243
+ ];
244
+ if (isNonInteractive) args.unshift('--yes');
245
+ if (!gitEnabled) args.push('--no-git');
246
+ if (override) args.push('--override');
247
+ const result = xSync('npx', args, {
248
+ nodePath: false,
249
+ nodeOptions: {
250
+ stdio: 'inherit'
251
+ }
252
+ });
253
+ process.exitCode = result.exitCode ?? 1;
254
+ }
255
+ function mapESLintTemplate(templateName, { distFolder }) {
256
+ const packageJsonPath = node_path.join(distFolder, 'package.json');
257
+ const packageJson = JSON.parse(node_fs.readFileSync(packageJsonPath, 'utf-8'));
258
+ if (/^[~^]?7\./.test(packageJson.devDependencies.typescript ?? '')) {
259
+ packageJson.devDependencies.typescript = '^6.0.3';
260
+ node_fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`);
261
+ }
211
262
  switch(templateName){
212
263
  case 'react-js':
213
264
  case 'react-ts':
@@ -250,9 +301,11 @@ function mapRslintTemplate(templateName) {
250
301
  }
251
302
  }
252
303
  const root = node_path.join(import.meta.dirname, '..');
304
+ const { version: version } = JSON.parse(node_fs.readFileSync(node_path.join(root, 'package.json'), 'utf-8'));
253
305
  await create({
254
306
  root: root,
255
307
  name: 'rsbuild',
308
+ banner: `create-rsbuild v${version}`,
256
309
  templates: [
257
310
  'vanilla-js',
258
311
  'vanilla-ts',
@@ -279,7 +332,15 @@ await create({
279
332
  'solid2-js',
280
333
  'solid2-ts',
281
334
  'octane-js',
282
- 'octane-ts'
335
+ 'octane-ts',
336
+ {
337
+ name: 'lynx-js',
338
+ create: (context)=>createLynxProject('js', context)
339
+ },
340
+ {
341
+ name: 'lynx-ts',
342
+ create: (context)=>createLynxProject('ts', context)
343
+ }
283
344
  ],
284
345
  getTemplateName: getTemplateName,
285
346
  mapESLintTemplate: mapESLintTemplate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rsbuild",
3
- "version": "2.2.14",
3
+ "version": "2.3.0-beta.0",
4
4
  "description": "Create a new Rsbuild project",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -25,10 +25,10 @@
25
25
  "bin.js"
26
26
  ],
27
27
  "dependencies": {
28
- "@rstackjs/create-toolkit": "2.2.9"
28
+ "@rstackjs/create-toolkit": "2.2.11"
29
29
  },
30
30
  "devDependencies": {
31
- "@rsbuild/core": "2.2.14",
31
+ "@rsbuild/core": "2.3.0-beta.0",
32
32
  "@rsbuild/plugin-babel": "2.1.0",
33
33
  "@rsbuild/plugin-preact": "2.1.0",
34
34
  "@rsbuild/plugin-react": "2.1.1",
@@ -12,6 +12,6 @@
12
12
  "lit": "^3.3.3"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14"
15
+ "@rsbuild/core": "^2.3.0-beta.0"
16
16
  }
17
17
  }
@@ -12,8 +12,8 @@
12
12
  "lit": "^3.3.3"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@types/node": "^24.19.2",
17
- "typescript": "^6.0.3"
17
+ "typescript": "^7.0.2"
18
18
  }
19
19
  }
@@ -13,6 +13,6 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@octanejs/rsbuild-plugin": "^0.1.65",
16
- "@rsbuild/core": "^2.2.14"
16
+ "@rsbuild/core": "^2.3.0-beta.0"
17
17
  }
18
18
  }
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@octanejs/rsbuild-plugin": "^0.1.65",
17
- "@rsbuild/core": "^2.2.14",
17
+ "@rsbuild/core": "^2.3.0-beta.0",
18
18
  "@tsrx/typescript-plugin": "^0.6.3",
19
19
  "@types/node": "^24.19.2",
20
20
  "typescript": "^5.9.3"
@@ -12,7 +12,7 @@
12
12
  "preact": "^11.0.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-preact": "^2.1.0"
17
17
  }
18
18
  }
@@ -12,9 +12,9 @@
12
12
  "preact": "^11.0.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-preact": "^2.1.0",
17
17
  "@types/node": "^24.19.2",
18
- "typescript": "^6.0.3"
18
+ "typescript": "^7.0.2"
19
19
  }
20
20
  }
@@ -13,7 +13,7 @@
13
13
  "react-dom": "^19.3.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@rsbuild/core": "^2.2.14",
16
+ "@rsbuild/core": "^2.3.0-beta.0",
17
17
  "@rsbuild/plugin-react": "^2.1.1"
18
18
  }
19
19
  }
@@ -13,11 +13,11 @@
13
13
  "react-dom": "^19.3.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@rsbuild/core": "^2.2.14",
16
+ "@rsbuild/core": "^2.3.0-beta.0",
17
17
  "@rsbuild/plugin-react": "^2.1.1",
18
18
  "@types/node": "^24.19.2",
19
19
  "@types/react": "^19.3.0",
20
20
  "@types/react-dom": "^19.3.0",
21
- "typescript": "^6.0.3"
21
+ "typescript": "^7.0.2"
22
22
  }
23
23
  }
@@ -9,6 +9,6 @@
9
9
  "@testing-library/dom": "^10.4.2",
10
10
  "@testing-library/jest-dom": "^7.0.1",
11
11
  "@testing-library/react": "^16.3.3",
12
- "happy-dom": "^20.14.6"
12
+ "happy-dom": "^21.0.3"
13
13
  }
14
14
  }
@@ -9,6 +9,6 @@
9
9
  "@testing-library/dom": "^10.4.2",
10
10
  "@testing-library/jest-dom": "^7.0.1",
11
11
  "@testing-library/react": "^16.3.3",
12
- "happy-dom": "^20.14.6"
12
+ "happy-dom": "^21.0.3"
13
13
  }
14
14
  }
@@ -8,6 +8,6 @@
8
8
  "@rstest/core": "^0.12.3",
9
9
  "@testing-library/dom": "^10.4.2",
10
10
  "@testing-library/jest-dom": "^7.0.1",
11
- "happy-dom": "^20.14.6"
11
+ "happy-dom": "^21.0.3"
12
12
  }
13
13
  }
@@ -8,6 +8,6 @@
8
8
  "@rstest/core": "^0.12.3",
9
9
  "@testing-library/dom": "^10.4.2",
10
10
  "@testing-library/jest-dom": "^7.0.1",
11
- "happy-dom": "^20.14.6"
11
+ "happy-dom": "^21.0.3"
12
12
  }
13
13
  }
@@ -8,6 +8,6 @@
8
8
  "@rstest/core": "^0.12.3",
9
9
  "@testing-library/jest-dom": "^7.0.1",
10
10
  "@vue/test-utils": "^2.5.1",
11
- "happy-dom": "^20.14.6"
11
+ "happy-dom": "^21.0.3"
12
12
  }
13
13
  }
@@ -8,6 +8,6 @@
8
8
  "@rstest/core": "^0.12.3",
9
9
  "@testing-library/jest-dom": "^7.0.1",
10
10
  "@vue/test-utils": "^2.5.1",
11
- "happy-dom": "^20.14.6"
11
+ "happy-dom": "^21.0.3"
12
12
  }
13
13
  }
@@ -12,7 +12,7 @@
12
12
  "solid-js": "^1.9.17"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-babel": "^2.1.0",
17
17
  "@rsbuild/plugin-solid": "^1.2.2"
18
18
  }
@@ -12,10 +12,10 @@
12
12
  "solid-js": "^1.9.17"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-babel": "^2.1.0",
17
17
  "@rsbuild/plugin-solid": "^1.2.2",
18
18
  "@types/node": "^24.19.2",
19
- "typescript": "^6.0.3"
19
+ "typescript": "^7.0.2"
20
20
  }
21
21
  }
@@ -13,7 +13,7 @@
13
13
  "solid-js": "^2.0.0-rc.15"
14
14
  },
15
15
  "devDependencies": {
16
- "@rsbuild/core": "^2.2.14",
16
+ "@rsbuild/core": "^2.3.0-beta.0",
17
17
  "@rsbuild/plugin-solid": "^2.0.0-rc.1"
18
18
  }
19
19
  }
@@ -13,9 +13,9 @@
13
13
  "solid-js": "^2.0.0-rc.15"
14
14
  },
15
15
  "devDependencies": {
16
- "@rsbuild/core": "^2.2.14",
16
+ "@rsbuild/core": "^2.3.0-beta.0",
17
17
  "@rsbuild/plugin-solid": "^2.0.0-rc.1",
18
18
  "@types/node": "^24.19.2",
19
- "typescript": "^6.0.3"
19
+ "typescript": "^7.0.2"
20
20
  }
21
21
  }
@@ -12,7 +12,7 @@
12
12
  "svelte": "^5.57.2"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-svelte": "^2.0.1"
17
17
  }
18
18
  }
@@ -13,7 +13,7 @@
13
13
  "svelte": "^5.57.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@rsbuild/core": "^2.2.14",
16
+ "@rsbuild/core": "^2.3.0-beta.0",
17
17
  "@rsbuild/plugin-svelte": "^2.0.1",
18
18
  "@types/node": "^24.19.2",
19
19
  "svelte-check": "^4.7.7",
@@ -9,6 +9,6 @@
9
9
  "preview": "rsbuild preview"
10
10
  },
11
11
  "devDependencies": {
12
- "@rsbuild/core": "^2.2.14"
12
+ "@rsbuild/core": "^2.3.0-beta.0"
13
13
  }
14
14
  }
@@ -9,8 +9,8 @@
9
9
  "preview": "rsbuild preview"
10
10
  },
11
11
  "devDependencies": {
12
- "@rsbuild/core": "^2.2.14",
12
+ "@rsbuild/core": "^2.3.0-beta.0",
13
13
  "@types/node": "^24.19.2",
14
- "typescript": "^6.0.3"
14
+ "typescript": "^7.0.2"
15
15
  }
16
16
  }
@@ -12,7 +12,7 @@
12
12
  "vue": "^3.5.44"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-vue": "^2.0.1"
17
17
  }
18
18
  }
@@ -12,7 +12,7 @@
12
12
  "vue": "^3.5.44"
13
13
  },
14
14
  "devDependencies": {
15
- "@rsbuild/core": "^2.2.14",
15
+ "@rsbuild/core": "^2.3.0-beta.0",
16
16
  "@rsbuild/plugin-vue": "^2.0.1",
17
17
  "@types/node": "^24.19.2",
18
18
  "typescript": "^6.0.3",