create-reactwright-doc 0.1.0 → 0.1.1
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 +10 -6
- package/src/index.js +30 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-reactwright-doc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Scaffolder for new Reactwright documents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Reactwright contributors",
|
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/PurpleReverie/reactwright/issues"
|
|
15
15
|
},
|
|
16
|
-
"keywords": [
|
|
16
|
+
"keywords": [
|
|
17
|
+
"reactwright",
|
|
18
|
+
"scaffolder",
|
|
19
|
+
"create-app"
|
|
20
|
+
],
|
|
17
21
|
"type": "module",
|
|
18
22
|
"bin": {
|
|
19
23
|
"create-reactwright-doc": "./src/index.js"
|
|
@@ -26,10 +30,10 @@
|
|
|
26
30
|
"engines": {
|
|
27
31
|
"node": ">=18"
|
|
28
32
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"check": "node --check src/index.js"
|
|
31
|
-
},
|
|
32
33
|
"publishConfig": {
|
|
33
34
|
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"check": "node --check src/index.js"
|
|
34
38
|
}
|
|
35
|
-
}
|
|
39
|
+
}
|
package/src/index.js
CHANGED
|
@@ -41,7 +41,7 @@ const TEMPLATES = {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const REACTWRIGHT_VERSION = "^0.
|
|
44
|
+
const REACTWRIGHT_VERSION = "^0.1.0";
|
|
45
45
|
const TEMPLATE_VERSION = "^0.1.0";
|
|
46
46
|
|
|
47
47
|
function parseArgs(argv) {
|
|
@@ -129,6 +129,11 @@ function main() {
|
|
|
129
129
|
starterTsx(args.template, args.name)
|
|
130
130
|
);
|
|
131
131
|
|
|
132
|
+
fs.writeFileSync(
|
|
133
|
+
path.join(targetDir, "tsconfig.json"),
|
|
134
|
+
starterTsconfig()
|
|
135
|
+
);
|
|
136
|
+
|
|
132
137
|
fs.writeFileSync(
|
|
133
138
|
path.join(targetDir, "README.md"),
|
|
134
139
|
starterReadme(args.name, args.template, entryFile)
|
|
@@ -138,6 +143,7 @@ function main() {
|
|
|
138
143
|
|
|
139
144
|
${args.name}/
|
|
140
145
|
├── package.json
|
|
146
|
+
├── tsconfig.json
|
|
141
147
|
├── ${entryFile}
|
|
142
148
|
└── README.md
|
|
143
149
|
|
|
@@ -154,6 +160,7 @@ function starterTsx(templateKey, name) {
|
|
|
154
160
|
const template = TEMPLATES[templateKey];
|
|
155
161
|
if (templateKey === "letter") {
|
|
156
162
|
return `import "reactwright/jsx";
|
|
163
|
+
import React from "react";
|
|
157
164
|
import { Template } from "${template.pkg}";
|
|
158
165
|
|
|
159
166
|
export { Template };
|
|
@@ -202,6 +209,7 @@ export default function Document() {
|
|
|
202
209
|
}
|
|
203
210
|
if (templateKey === "book") {
|
|
204
211
|
return `import "reactwright/jsx";
|
|
212
|
+
import React from "react";
|
|
205
213
|
import { Template } from "${template.pkg}";
|
|
206
214
|
|
|
207
215
|
export { Template };
|
|
@@ -235,6 +243,7 @@ export default function Document() {
|
|
|
235
243
|
`;
|
|
236
244
|
}
|
|
237
245
|
return `import "reactwright/jsx";
|
|
246
|
+
import React from "react";
|
|
238
247
|
import { Template } from "${template.pkg}";
|
|
239
248
|
|
|
240
249
|
export { Template };
|
|
@@ -249,8 +258,8 @@ export default function Document() {
|
|
|
249
258
|
flows through the engine to paginated HTML and PDF.
|
|
250
259
|
</p>
|
|
251
260
|
<p>
|
|
252
|
-
See <
|
|
253
|
-
documentation</
|
|
261
|
+
See <link href="https://github.com/PurpleReverie/reactwright">the
|
|
262
|
+
documentation</link> for the full primitive vocabulary.
|
|
254
263
|
</p>
|
|
255
264
|
</section>
|
|
256
265
|
|
|
@@ -273,6 +282,24 @@ export default function Document() {
|
|
|
273
282
|
`;
|
|
274
283
|
}
|
|
275
284
|
|
|
285
|
+
function starterTsconfig() {
|
|
286
|
+
return `{
|
|
287
|
+
"compilerOptions": {
|
|
288
|
+
"target": "ES2022",
|
|
289
|
+
"module": "NodeNext",
|
|
290
|
+
"moduleResolution": "NodeNext",
|
|
291
|
+
"jsx": "react-jsx",
|
|
292
|
+
"esModuleInterop": true,
|
|
293
|
+
"skipLibCheck": true,
|
|
294
|
+
"allowSyntheticDefaultImports": true,
|
|
295
|
+
"strict": false,
|
|
296
|
+
"noEmit": true
|
|
297
|
+
},
|
|
298
|
+
"include": ["*.tsx", "*.ts"]
|
|
299
|
+
}
|
|
300
|
+
`;
|
|
301
|
+
}
|
|
302
|
+
|
|
276
303
|
function starterReadme(name, templateKey, entryFile) {
|
|
277
304
|
return `# ${name}
|
|
278
305
|
|