Skip to content

Commit d615804

Browse files
committed
Document next steps for a new project
1 parent 1c6abb1 commit d615804

File tree

3 files changed

+98
-6
lines changed

3 files changed

+98
-6
lines changed

packages/create-vue-lib/src/index.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,12 @@ async function init() {
339339
}
340340

341341
if (!fs.existsSync(path.join(targetDirPath, '.git'))) {
342-
console.log(' git init')
342+
console.log(' git init -b main')
343343
}
344344

345345
console.log(' pnpm install')
346-
347-
// if (!fs.existsSync(path.join(targetDirPath, 'packages', config.mainPackageDirName, 'LICENSE'))) {
348-
// console.log()
349-
// console.log(`You should add a suitable license at packages/${config.mainPackageDirName}/LICENSE`)
350-
// }
346+
console.log()
347+
console.log('See https://skirtles-code.github.io/create-vue-lib/next-steps for more suggestions.')
351348
}
352349

353350
function copyTemplate(templateName: string, config: Config) {

packages/docs/.vitepress/config.mts

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export default defineConfigWithTheme({
4747
}, {
4848
text: 'The questions explained',
4949
link: '/questions'
50+
}, {
51+
text: 'Next steps',
52+
link: '/next-steps'
5053
}
5154
]
5255
}

packages/docs/src/next-steps.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Next steps
2+
3+
Creating a project using `@skirtle/create-vue-lib` is just the first step. The tool can only take you so far, you'll still need to review and adjust the project configuration to get everything just the way you need it.
4+
5+
Here are some ideas for things you should do...
6+
7+
## Init git
8+
9+
Make sure you're in the correct directory, then run:
10+
11+
```sh
12+
git init -b main
13+
```
14+
15+
You should do this before running `pnpm install`, so that `simple-git-hooks` can configure the git hooks.
16+
17+
## Install dependencies
18+
19+
```sh
20+
pnpm install
21+
```
22+
23+
The project uses the `^` prefix for most dependencies. This is usually what you'd want, as it ensures you're getting the latest versions, but it does mean that the exact versions you install may differ slightly from those that have been tested with this tool. Occasionally, new releases of the dependencies introduce regressions that break a newly scaffolded project.
24+
25+
Bugs in the tool itself are also very much a possibility, especially if you've picked an unusual combination of options.
26+
27+
With that in mind...
28+
29+
## Check it works
30+
31+
Before you start making changes, it's worth quickly checking that the new project actually works.
32+
33+
Check everything builds:
34+
35+
```sh
36+
pnpm build
37+
```
38+
39+
Run the unit tests:
40+
41+
```sh
42+
pnpm test:unit
43+
```
44+
45+
If you chose to install ESLint:
46+
47+
```sh
48+
pnpm lint
49+
```
50+
51+
If you chose to include VitePress for documentation:
52+
53+
```sh
54+
pnpm docs:dev
55+
```
56+
57+
If you chose to include a playground application:
58+
59+
```sh
60+
pnpm dev
61+
```
62+
63+
## Update the `README.md`
64+
65+
While writing a detailed `README.md` can probably wait, you might want to write a few sentences now, before you push anything to GitHub.
66+
67+
The root `README.md` is primarily intended for readers on GitHub. It will be copied to the main package directory as part of the build, so that it can be included in the published package on npm. If you don't want that, e.g. because you'd prefer different contents in those two files, you should modify `package.json` and `.gitignore`.
68+
69+
## Add a `LICENSE`
70+
71+
You should populate the LICENSE file in the root directory of your project.
72+
73+
The root `LICENSE` will be copied to the main package directory as part of the build, so that it can be included in the published package. If you don't want that, you should modify `package.json` and `.gitignore`.
74+
75+
## Update `package.json`
76+
77+
There are multiple files called `package.json` in a newly generated project. The one that is used to publish your package to npm is the most important, and you'll need to populate some fields in that file yourself.
78+
79+
The generated project structure should be something like this:
80+
81+
```
82+
📁 packages
83+
📁 docs
84+
📁 playground
85+
📁 <main-package-directory>
86+
📁 src
87+
📄 package.json
88+
```
89+
90+
The file `packages/<main-package-directory>/package.json` is the one you need to update. It should already have most things populated, such as the `name`, but some of the other fields near the top will be empty, e.g. `author`, `license`, `description` and `keywords`.
91+
92+
It will also have `"private": true` set. This will prevent you from accidentally publishing the package to the npm registry. You should leave that line in for now, but you'll need to remove it when you're ready to make your first release.

0 commit comments

Comments
 (0)