Skip to content

Commit eaaadd7

Browse files
committed
Make docs package optional
1 parent 60fcb33 commit eaaadd7

File tree

7 files changed

+16
-0
lines changed

7 files changed

+16
-0
lines changed

src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type Config = {
1818
githubUrl: string
1919
githubIssues: string
2020
githubRepository: string
21+
includeDocs: boolean
2122
includePlayground: boolean
2223
}
2324

@@ -27,6 +28,7 @@ async function init() {
2728
let result: {
2829
packageName?: string
2930
githubPath?: string
31+
includeDocs: boolean
3032
includePlayground: boolean
3133
} = {}
3234

@@ -43,6 +45,13 @@ async function init() {
4345
type: 'text',
4446
message: 'GitHub path, e.g. skirtles-code/test-project (optional)',
4547
initial: ''
48+
}, {
49+
name: 'includeDocs',
50+
type: 'toggle',
51+
message: 'Include VitePress for documentation?',
52+
initial: true,
53+
active: 'Yes',
54+
inactive: 'No'
4655
}, {
4756
name: 'includePlayground',
4857
type: 'toggle',
@@ -112,11 +121,16 @@ async function init() {
112121
githubUrl,
113122
githubIssues,
114123
githubRepository,
124+
includeDocs: result.includeDocs,
115125
includePlayground: result.includePlayground
116126
}
117127

118128
copyTemplate('base', config)
119129

130+
if (config.includeDocs) {
131+
copyTemplate('vitepress', config)
132+
}
133+
120134
if (config.includePlayground) {
121135
copyTemplate('playground', config)
122136
}

src/template/base/package.json.ejs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<%_ if (config.includePlayground) { _%>
1010
"dev": "pnpm run --filter ./packages/playground -r dev",
1111
<%_ } _%>
12+
<%_ if (config.includeDocs) { _%>
1213
"docs:dev": "pnpm run --filter ./packages/docs -r dev",
14+
<%_ } _%>
1315
"test:unit": "pnpm run --filter ./packages/<%- config.shortUnscopedPackageName %> -r test:unit",
1416
"coverage": "pnpm run --filter ./packages/<%- config.shortUnscopedPackageName %> -r coverage",
1517
"preinstall": "node scripts/preinstall.js",
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)