-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolid.js
executable file
·53 lines (46 loc) · 1.17 KB
/
solid.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env zx
import 'zx/globals';
await $`rm -rf solid`;
await $`mkdir -p solid`;
cd('solid');
const templates = [
'bare',
'hackernews',
'movies',
'notes',
'todomvc',
'with-auth',
'with-authjs',
'with-mdx',
'with-prisma',
'with-solid-styled',
'with-tailwindcss',
'with-trpc',
'with-vitest',
'with-websocket',
];
// non-parallel version
const failed = [];
for (const template of templates) {
try {
// const answers = $`echo ${template}; sleep 1; echo yes; sleep 1; echo yes; sleep 1; echo yes`;
// await answers.pipe($`create-solid ${template}`);
await $`create-solid ${template}`;
} catch {
failed.push(template);
}
}
// TODO: fix parallel version, not working correctly
// const results = await Promise.allSettled(
// templates.map(template => {
// const answers = $`echo ${template}; sleep 1; echo yes; sleep 1; echo yes; sleep 1; echo yes`;
// return answers.pipe($`create-solid ${template}`);
// }),
// );
// const failed = results
// .map((result, i) => (result.status === 'rejected' ? templates[i] : null))
// .filter(x => x);
if (failed.length > 0) {
console.warn(`Failed templates: ${failed}`);
}
cd('..');