diff --git a/packages/create-primate/package.json b/packages/create-primate/package.json index 1fb19271..212208e7 100644 --- a/packages/create-primate/package.json +++ b/packages/create-primate/package.json @@ -16,24 +16,24 @@ }, "dependencies": { "@clack/prompts": "^0.7.0", - "rcompat": "^0.8.0" + "rcompat": "^0.8.2" }, "type": "module", "devDependencies": { - "@primate/build": "^0.4.1", - "@primate/frontend": "^0.13.2", + "@primate/build": "^0.4.2", + "@primate/frontend": "^0.13.5", "@primate/session": "^0.17.1", - "@primate/store": "^0.22.1", + "@primate/store": "^0.22.2", "@primate/types": "^0.13.1", "babel-preset-solid": "^1.8.12", - "better-sqlite3": "^9.4.0", + "better-sqlite3": "^9.4.1", "esbuild": "^0.20.0", "handlebars": "^4.7.8", "htmx.org": "^1.9.10", "marked": "^12.0.0", "mongodb": "^6.3.0", "postgres": "^3.4.3", - "primate": "^0.29.1", + "primate": "^0.29.4", "react": "^18.2.0", "react-dom": "^18.2.0", "solid-js": "^1.8.14", diff --git a/packages/create-primate/src/commands/create.js b/packages/create-primate/src/commands/create.js index e4af49f8..93a7819c 100644 --- a/packages/create-primate/src/commands/create.js +++ b/packages/create-primate/src/commands/create.js @@ -21,9 +21,13 @@ const create = async ([root, configs]) => { await files.gitignore(root, config); await files.package_json(root, config); await files.primate_config_js(root, config); - await root.join("pages").create(); - await files.app_html(root); - await files.error_html(root); + const pages = root.join("pages"); + await pages.create(); + await files.app_html(pages); + await files.error_html(pages); + const routes = root.join("routes"); + await routes.create(); + await files.index_route(routes); return root; }; diff --git a/packages/create-primate/src/files/app_html.js b/packages/create-primate/src/files/app_html.js index 1ca9727e..51e465e4 100644 --- a/packages/create-primate/src/files/app_html.js +++ b/packages/create-primate/src/files/app_html.js @@ -1,6 +1,4 @@ -const path = ["pages", "app.html"]; - -export default root => root.join(...path).write(` +export default pages => pages.join("app.html").write(` Primate app diff --git a/packages/create-primate/src/files/error_html.js b/packages/create-primate/src/files/error_html.js index ebc84973..c80a968d 100644 --- a/packages/create-primate/src/files/error_html.js +++ b/packages/create-primate/src/files/error_html.js @@ -1,6 +1,4 @@ -const path = ["pages", "error.html"]; - -export default root => root.join(...path).write(` +export default pages => pages.join("error.html").write(` Error page diff --git a/packages/create-primate/src/files/exports.js b/packages/create-primate/src/files/exports.js index a9761023..2ec66c99 100644 --- a/packages/create-primate/src/files/exports.js +++ b/packages/create-primate/src/files/exports.js @@ -3,3 +3,4 @@ export { default as package_json } from "./package_json.js"; export { default as primate_config_js } from "./primate_config_js.js"; export { default as app_html } from "./app_html.js"; export { default as error_html } from "./error_html.js"; +export { default as index_route } from "./index_route.js"; diff --git a/packages/create-primate/src/files/index_route.js b/packages/create-primate/src/files/index_route.js new file mode 100644 index 00000000..e38c1a29 --- /dev/null +++ b/packages/create-primate/src/files/index_route.js @@ -0,0 +1,5 @@ +export default routes => routes.join("index.js").write(`export default { + get() { + return "Hello, world!"; + }, +};`);