docpensieve 0.1.2 → 0.1.3
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 +12 -0
- package/package.json +5 -5
- package/src/commands/init.js +12 -2
- package/starter/01-guide/01-installation.md +20 -1
- package/starter/03-reference/01-cli.md +5 -0
package/README.md
CHANGED
|
@@ -32,6 +32,18 @@ The development server reloads the browser after every rebuild, through a
|
|
|
32
32
|
script injected **at serving time**: the output of `build` stays free of
|
|
33
33
|
JavaScript.
|
|
34
34
|
|
|
35
|
+
## Updating
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install docpensieve@latest
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Run through `npx` alone, it needs nothing: `npx docpensieve` fetches the
|
|
42
|
+
latest version by itself. A project set up with 0.1.0 can rename
|
|
43
|
+
`docpensieve.config.js` to `docpensieve.config.mjs`, which Node reads as a
|
|
44
|
+
module whatever the `package.json` says: the warning printed on every build
|
|
45
|
+
goes away.
|
|
46
|
+
|
|
35
47
|
## Documentation
|
|
36
48
|
|
|
37
49
|
See the [repository](https://github.com/Juniors017/docpensieve#readme).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docpensieve",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "DocPensieve command-line interface (init, build, check, dev, serve)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"types"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@docpensieve/components": "0.1.
|
|
28
|
-
"@docpensieve/core": "0.1.
|
|
29
|
-
"@docpensieve/shared": "0.1.
|
|
30
|
-
"@docpensieve/theme": "0.1.
|
|
27
|
+
"@docpensieve/components": "0.1.3",
|
|
28
|
+
"@docpensieve/core": "0.1.3",
|
|
29
|
+
"@docpensieve/shared": "0.1.3",
|
|
30
|
+
"@docpensieve/theme": "0.1.3",
|
|
31
31
|
"chalk": "^6.0.0",
|
|
32
32
|
"chokidar": "^5.0.0",
|
|
33
33
|
"commander": "^15.0.0"
|
package/src/commands/init.js
CHANGED
|
@@ -127,9 +127,19 @@ async function collect(options) {
|
|
|
127
127
|
docs: !options.minimal,
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
+
if (options.yes) return fromOptions;
|
|
131
|
+
|
|
130
132
|
// Without a terminal — script, CI, pipe — the dialogue would never complete:
|
|
131
|
-
// stick to the options and the defaults.
|
|
132
|
-
|
|
133
|
+
// stick to the options and the defaults. But say so: some terminals run
|
|
134
|
+
// programs without handing them one, and the questions used to vanish
|
|
135
|
+
// without a word, the defaults going unnoticed.
|
|
136
|
+
if (!process.stdin.isTTY) {
|
|
137
|
+
console.log('No interactive terminal: no questions asked, the options and defaults apply.');
|
|
138
|
+
console.log(
|
|
139
|
+
'To choose, pass --name, --site-url, --theme, --version-name or --minimal; --yes silences this notice.',
|
|
140
|
+
);
|
|
141
|
+
return fromOptions;
|
|
142
|
+
}
|
|
133
143
|
|
|
134
144
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
135
145
|
try {
|
|
@@ -26,7 +26,9 @@ cd my-site
|
|
|
26
26
|
|
|
27
27
|
The command creates the folder and writes a configuration, a first
|
|
28
28
|
documentation folder and a home page into it. It asks a few questions; `--yes`
|
|
29
|
-
skips them and accepts the defaults.
|
|
29
|
+
skips them and accepts the defaults. Where it cannot ask — a script, continuous
|
|
30
|
+
integration, or a terminal that gives the programs it runs no interactive
|
|
31
|
+
input — it says so and sticks to the options and the defaults.
|
|
30
32
|
|
|
31
33
|
It also installs this very documentation, in a **DocPensieve** section at the
|
|
32
34
|
end of the new site's menu. It matches the version you installed, and its
|
|
@@ -69,6 +71,23 @@ Both are equivalent in use — the templates are the same, only the styling
|
|
|
69
71
|
changes. The choice is not final: it fits in one field of the configuration,
|
|
70
72
|
described in [Themes](./themes/).
|
|
71
73
|
|
|
74
|
+
## Updating
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install docpensieve@latest
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Run through `npx` alone, DocPensieve needs nothing: `npx docpensieve` fetches
|
|
81
|
+
the latest version by itself.
|
|
82
|
+
|
|
83
|
+
A project set up with 0.1.0 has a `docpensieve.config.js`. It still works, but
|
|
84
|
+
Node reads it as a module only when the `package.json` says so, and warns on
|
|
85
|
+
every build otherwise: rename it `docpensieve.config.mjs`.
|
|
86
|
+
|
|
87
|
+
The documentation `init` installed in `99-docpensieve` stays at the version it
|
|
88
|
+
came with. To refresh it, run `init` in a scratch folder and copy that folder
|
|
89
|
+
over.
|
|
90
|
+
|
|
72
91
|
## Checking
|
|
73
92
|
|
|
74
93
|
```bash
|
|
@@ -35,6 +35,11 @@ npx docpensieve init [dir]
|
|
|
35
35
|
|
|
36
36
|
Without `--force`, the command refuses to overwrite an existing configuration.
|
|
37
37
|
|
|
38
|
+
Without an interactive terminal — a script, continuous integration, or a
|
|
39
|
+
terminal that gives the programs it runs no interactive input — the command
|
|
40
|
+
asks nothing: it says so, then sticks to the options and the defaults. `--yes`
|
|
41
|
+
makes that choice explicit and silences the notice.
|
|
42
|
+
|
|
38
43
|
Unless `--minimal` is given, the command installs DocPensieve's documentation
|
|
39
44
|
in the new site, in `docs/<version>/99-docpensieve/`: a **DocPensieve** section
|
|
40
45
|
at the end of the menu, matching the installed version. Delete that folder when
|