create-rapidoc 0.1.0 → 0.1.2
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/package.json +2 -2
- package/src/index.js +2 -1
- package/src/scaffold.js +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rapidoc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Interactive scaffolding CLI to create new RapiDoc Developer Portals",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create-rapidoc",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"directory": "packages/create-rapidoc"
|
|
23
23
|
},
|
|
24
24
|
"bin": {
|
|
25
|
-
"create-rapidoc": "
|
|
25
|
+
"create-rapidoc": "src/index.js"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"src"
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs";
|
|
5
|
+
import pkg from "../package.json" with { type: "json" };
|
|
5
6
|
import { findOpenApiSpecs, scaffoldProject } from "./scaffold.js";
|
|
6
7
|
import { askInitQuestions } from "./wizard.js";
|
|
7
8
|
|
|
@@ -34,7 +35,7 @@ if (args.includes("--help") || args.includes("-h")) {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
if (args.includes("--version") || args.includes("-v")) {
|
|
37
|
-
console.log(
|
|
38
|
+
console.log(pkg.version);
|
|
38
39
|
process.exit(0);
|
|
39
40
|
}
|
|
40
41
|
|
package/src/scaffold.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import pkg from "../package.json" with { type: "json" };
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Range for the @rapidoc packages a new project depends on. They release with create-rapidoc as one
|
|
7
|
+
* fixed group (.changeset/config.json), so its own version is theirs too.
|
|
8
|
+
*/
|
|
9
|
+
const RAPIDOC_PACKAGES_RANGE = `^${pkg.version}`;
|
|
3
10
|
|
|
4
11
|
/**
|
|
5
12
|
* Starter template contents for scaffolding a new RapiDoc Developer Portal.
|
|
@@ -345,8 +352,8 @@ const STARTER_PACKAGE_JSON = (projectName) =>
|
|
|
345
352
|
// The CLI loads the portal engine for dev/build; listing it here also makes the config's
|
|
346
353
|
// $schema path (node_modules/@rapidoc/portal/schema.json) resolve.
|
|
347
354
|
devDependencies: {
|
|
348
|
-
"@rapidoc/cli":
|
|
349
|
-
"@rapidoc/portal":
|
|
355
|
+
"@rapidoc/cli": RAPIDOC_PACKAGES_RANGE,
|
|
356
|
+
"@rapidoc/portal": RAPIDOC_PACKAGES_RANGE,
|
|
350
357
|
},
|
|
351
358
|
},
|
|
352
359
|
null,
|