create-rspress 2.0.7 → 2.0.9

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.
Files changed (27) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +29 -4
  3. package/package.json +3 -3
  4. package/template-basic/template-placeholder +1 -0
  5. package/{template-basic → template-common}/docs/guide/start/getting-started.md +1 -0
  6. package/{template-basic → template-common}/package.json +1 -1
  7. package/template-custom-theme/theme/index.css +6 -0
  8. package/template-custom-theme/theme/index.tsx +3 -0
  9. /package/{template-basic → template-common}/docs/_nav.json +0 -0
  10. /package/{template-basic → template-common}/docs/api/_meta.json +0 -0
  11. /package/{template-basic → template-common}/docs/api/commands.mdx +0 -0
  12. /package/{template-basic → template-common}/docs/api/index.mdx +0 -0
  13. /package/{template-basic → template-common}/docs/guide/_meta.json +0 -0
  14. /package/{template-basic → template-common}/docs/guide/start/_meta.json +0 -0
  15. /package/{template-basic → template-common}/docs/guide/start/introduction.md +0 -0
  16. /package/{template-basic → template-common}/docs/guide/use-mdx/_meta.json +0 -0
  17. /package/{template-basic → template-common}/docs/guide/use-mdx/code-blocks/_meta.json +0 -0
  18. /package/{template-basic → template-common}/docs/guide/use-mdx/code-blocks/index.mdx +0 -0
  19. /package/{template-basic → template-common}/docs/guide/use-mdx/code-blocks/meta.md +0 -0
  20. /package/{template-basic → template-common}/docs/guide/use-mdx/code-blocks/title.md +0 -0
  21. /package/{template-basic → template-common}/docs/guide/use-mdx/components.mdx +0 -0
  22. /package/{template-basic → template-common}/docs/guide/use-mdx/container.md +0 -0
  23. /package/{template-basic → template-common}/docs/index.md +0 -0
  24. /package/{template-basic → template-common}/docs/public/rspress-dark-logo.png +0 -0
  25. /package/{template-basic → template-common}/docs/public/rspress-icon.png +0 -0
  26. /package/{template-basic → template-common}/docs/public/rspress-light-logo.png +0 -0
  27. /package/{template-basic → template-common}/rspress.config.ts +0 -0
package/README.md CHANGED
@@ -15,6 +15,9 @@ npx create-rspress --dir my-project
15
15
 
16
16
  # Using abbreviations
17
17
  npx create-rspress -d my-project
18
+
19
+ # Scaffold with the custom theme template
20
+ npx create-rspress --dir my-project --template custom-theme
18
21
  ```
19
22
 
20
23
  ## Documentation
package/dist/index.js CHANGED
@@ -1,9 +1,31 @@
1
1
  import node_path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- import { create } from "create-rstack";
3
+ import { checkCancel, create, select as external_create_rstack_select } from "create-rstack";
4
4
  const src_dirname = node_path.dirname(fileURLToPath(import.meta.url));
5
- async function getTemplateName() {
6
- return 'basic';
5
+ const templates = [
6
+ 'basic',
7
+ 'custom-theme'
8
+ ];
9
+ async function getTemplateName(argv) {
10
+ if (argv.template) {
11
+ if (templates.includes(argv.template)) return argv.template;
12
+ throw new Error(`Invalid template "${argv.template}". Expected one of: ${templates.join(', ')}.`);
13
+ }
14
+ return checkCancel(await external_create_rstack_select({
15
+ message: 'Would you like to customize the theme styles?',
16
+ initialValue: 'custom-theme',
17
+ options: [
18
+ {
19
+ value: 'custom-theme',
20
+ label: 'Yes, set up a "theme" folder for customization',
21
+ hint: 'Modify styles and components later.'
22
+ },
23
+ {
24
+ value: 'basic',
25
+ label: 'No, use the default theme'
26
+ }
27
+ ]
28
+ }));
7
29
  }
8
30
  function mapESLintTemplate() {
9
31
  return 'vanilla-ts';
@@ -11,8 +33,11 @@ function mapESLintTemplate() {
11
33
  create({
12
34
  root: node_path.resolve(src_dirname, '..'),
13
35
  name: 'rspress',
36
+ skipFiles: [
37
+ 'template-placeholder'
38
+ ],
14
39
  templates: [
15
- 'basic'
40
+ ...templates
16
41
  ],
17
42
  getTemplateName: getTemplateName,
18
43
  mapESLintTemplate: mapESLintTemplate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rspress",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Create a new Rspress project",
5
5
  "homepage": "https://rspress.rs",
6
6
  "repository": {
@@ -23,11 +23,11 @@
23
23
  "bin.js"
24
24
  ],
25
25
  "dependencies": {
26
- "create-rstack": "1.8.1"
26
+ "create-rstack": "1.9.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@microsoft/api-extractor": "^7.57.7",
30
- "@rslib/core": "0.20.0",
30
+ "@rslib/core": "0.21.0",
31
31
  "@types/node": "^22.8.1",
32
32
  "rsbuild-plugin-publint": "^0.3.4",
33
33
  "typescript": "^5.8.2"
@@ -0,0 +1 @@
1
+ Keep the template-basic directory in source control.
@@ -8,6 +8,7 @@ After creating a project with `create-rspress`, you will get the following proje
8
8
  - `docs/_nav.json` — The navigation bar configuration.
9
9
  - `docs/guide/_meta.json` — The sidebar configuration for the guide section.
10
10
  - `docs/public/` — Static assets directory.
11
+ - `theme/` — Optional custom theme directory, generated when you choose the custom theme scaffold.
11
12
  - `rspress.config.ts` — The Rspress configuration file.
12
13
 
13
14
  ## Development
@@ -9,7 +9,7 @@
9
9
  "preview": "rspress preview"
10
10
  },
11
11
  "dependencies": {
12
- "@rspress/core": "^2.0.6"
12
+ "@rspress/core": "^2.0.9"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^22.8.1",
@@ -0,0 +1,6 @@
1
+ :root {
2
+ /* Example brand color overrides for the custom theme scaffold. */
3
+ --rp-c-brand: #0f766e;
4
+ --rp-c-brand-dark: #115e59;
5
+ --rp-c-brand-tint: rgba(15, 118, 110, 0.16);
6
+ }
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+
3
+ export * from '@rspress/core/theme-original';