create-routify 1.4.1 → 1.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-routify",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "A powerful cli for super-powering your routify development experience",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "url": "https://github.com/roxiness/create-routify/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@roxi/routify": "^3.0.0-next",
35
+ "@roxi/routify": "^3.0.0-next.172",
36
36
  "kleur": "^4.1.5",
37
37
  "log-symbols": "^5.1.0",
38
38
  "minimist": "^1.2.7",
@@ -37,13 +37,24 @@ async function getExampleDir() {
37
37
  let dirNames = await readdir(routifyExamplesDir);
38
38
  const projects = await Promise.all(
39
39
  dirNames
40
- .map((name) => join(routifyExamplesDir, name))
41
- .filter((dir) => existsSync(join(dir, 'manifest.js')))
42
- .map((dir) =>
43
- import(pathToFileURL(join(dir, 'manifest.js')).pathname).then(
44
- (m) => ({ dir, manifest: m.default }),
45
- ),
46
- ),
40
+ .map((name) => ({ name, dir: join(routifyExamplesDir, name) }))
41
+ .filter(({ dir }) => existsSync(join(dir, 'manifest.js')))
42
+ .map(async ({ dir, name }) => {
43
+ try {
44
+ return await import(
45
+ pathToFileURL(join(dir, 'manifest.js')).pathname
46
+ ).then((m) => ({ dir, name, manifest: m.default }));
47
+ } catch (err) {
48
+ return {
49
+ dir,
50
+ name,
51
+ manifest: {
52
+ name,
53
+ description: 'Could not read template info',
54
+ },
55
+ };
56
+ }
57
+ }),
47
58
  );
48
59
 
49
60
  const { project } = await prompts(
@@ -51,7 +62,7 @@ async function getExampleDir() {
51
62
  message: 'Please select a starter template',
52
63
  name: 'project',
53
64
  type: 'select',
54
- choices: projects.map((value) => ({
65
+ choices: projects.filter(Boolean).map((value) => ({
55
66
  title: value.manifest.name,
56
67
  description: value.manifest.description,
57
68
  value,