diff --git a/package.json b/package.json index cd2d9f3..b4d6006 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-routify", - "version": "1.4.1", + "version": "1.4.2", "description": "A powerful cli for super-powering your routify development experience", "main": "index.js", "type": "module", @@ -32,7 +32,7 @@ "url": "https://github.com/roxiness/create-routify/issues" }, "dependencies": { - "@roxi/routify": "^3.0.0-next", + "@roxi/routify": "^3.0.0-next.172", "kleur": "^4.1.5", "log-symbols": "^5.1.0", "minimist": "^1.2.7", diff --git a/src/versions/three/index.js b/src/versions/three/index.js index 642d7f7..286768e 100644 --- a/src/versions/three/index.js +++ b/src/versions/three/index.js @@ -37,13 +37,24 @@ async function getExampleDir() { let dirNames = await readdir(routifyExamplesDir); const projects = await Promise.all( dirNames - .map((name) => join(routifyExamplesDir, name)) - .filter((dir) => existsSync(join(dir, 'manifest.js'))) - .map((dir) => - import(pathToFileURL(join(dir, 'manifest.js')).pathname).then( - (m) => ({ dir, manifest: m.default }), - ), - ), + .map((name) => ({ name, dir: join(routifyExamplesDir, name) })) + .filter(({ dir }) => existsSync(join(dir, 'manifest.js'))) + .map(async ({ dir, name }) => { + try { + return await import( + pathToFileURL(join(dir, 'manifest.js')).pathname + ).then((m) => ({ dir, name, manifest: m.default })); + } catch (err) { + return { + dir, + name, + manifest: { + name, + description: 'Could not read template info', + }, + }; + } + }), ); const { project } = await prompts( @@ -51,7 +62,7 @@ async function getExampleDir() { message: 'Please select a starter template', name: 'project', type: 'select', - choices: projects.map((value) => ({ + choices: projects.filter(Boolean).map((value) => ({ title: value.manifest.name, description: value.manifest.description, value,