create-nextly-app 0.0.2-alpha.40 → 0.0.2-alpha.42

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.
Files changed (64) hide show
  1. package/dist/{chunk-DDQB5KOQ.mjs → chunk-OCMWPADZ.mjs} +22 -13
  2. package/dist/chunk-OCMWPADZ.mjs.map +1 -0
  3. package/dist/cli.cjs +21 -12
  4. package/dist/cli.cjs.map +1 -1
  5. package/dist/cli.mjs +2 -2
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/index.cjs +20 -11
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/package.json +4 -4
  11. package/dist/chunk-DDQB5KOQ.mjs.map +0 -1
  12. package/templates/base/.env.example +0 -16
  13. package/templates/base/README.md +0 -30
  14. package/templates/base/eslint.config.mjs +0 -18
  15. package/templates/base/next.config.ts +0 -15
  16. package/templates/base/postcss.config.mjs +0 -7
  17. package/templates/base/public/file.svg +0 -1
  18. package/templates/base/public/globe.svg +0 -1
  19. package/templates/base/public/next.svg +0 -1
  20. package/templates/base/public/vercel.svg +0 -1
  21. package/templates/base/public/window.svg +0 -1
  22. package/templates/base/src/app/admin/[[...params]]/layout.tsx +0 -20
  23. package/templates/base/src/app/admin/[[...params]]/page.tsx +0 -18
  24. package/templates/base/src/app/admin/api/[[...params]]/route.ts +0 -12
  25. package/templates/base/src/app/admin/api/media/[[...path]]/route.ts +0 -26
  26. package/templates/base/src/app/api/health/route.ts +0 -7
  27. package/templates/base/src/app/api/media/[[...path]]/route.ts +0 -34
  28. package/templates/base/src/app/favicon.ico +0 -0
  29. package/templates/base/src/app/globals.css +0 -55
  30. package/templates/base/src/app/layout.tsx +0 -43
  31. package/templates/base/src/app/page.tsx +0 -65
  32. package/templates/base/src/types/generated/.gitkeep +0 -0
  33. package/templates/base/src/types/generated/nextly-types.ts +0 -12
  34. package/templates/base/tsconfig.json +0 -36
  35. package/templates/blank/.env.example +0 -8
  36. package/templates/blank/README.md +0 -63
  37. package/templates/blank/nextly.config.ts +0 -14
  38. package/templates/blank/src/app/(frontend)/components/README.md +0 -10
  39. package/templates/blank/src/app/(frontend)/components/ThemeToggle.tsx +0 -113
  40. package/templates/blank/src/app/(frontend)/page.tsx +0 -176
  41. package/templates/blank/src/app/globals.css +0 -79
  42. package/templates/blank/src/app/layout.tsx +0 -46
  43. package/templates/blank/template.json +0 -14
  44. package/templates/plugin/README.md +0 -44
  45. package/templates/plugin/dev/.env.example +0 -8
  46. package/templates/plugin/dev/instrumentation.ts +0 -10
  47. package/templates/plugin/dev/next.config.ts +0 -30
  48. package/templates/plugin/dev/nextly.config.ts +0 -17
  49. package/templates/plugin/dev/src/app/admin/[[...params]]/page.tsx +0 -9
  50. package/templates/plugin/dev/src/app/admin/api/[[...params]]/route.ts +0 -19
  51. package/templates/plugin/dev/src/app/layout.tsx +0 -13
  52. package/templates/plugin/dev/tsconfig.json +0 -22
  53. package/templates/plugin/eslint.config.mjs +0 -8
  54. package/templates/plugin/src/admin/SettingsPage.tsx +0 -13
  55. package/templates/plugin/src/admin/index.ts +0 -21
  56. package/templates/plugin/src/collections/example.ts +0 -13
  57. package/templates/plugin/src/index.ts +0 -6
  58. package/templates/plugin/src/plugin.test.ts +0 -29
  59. package/templates/plugin/src/plugin.ts +0 -48
  60. package/templates/plugin/src/types.ts +0 -17
  61. package/templates/plugin/template.json +0 -14
  62. package/templates/plugin/tsconfig.json +0 -18
  63. package/templates/plugin/tsup.config.ts +0 -22
  64. package/templates/plugin/vitest.config.ts +0 -8
package/dist/cli.cjs CHANGED
@@ -6259,7 +6259,7 @@ var require_package = __commonJS({
6259
6259
  "package.json"(exports$1, module) {
6260
6260
  module.exports = {
6261
6261
  name: "create-nextly-app",
6262
- version: "0.0.2-alpha.40",
6262
+ version: "0.0.2-alpha.42",
6263
6263
  description: "CLI to scaffold Nextly in your Next.js project",
6264
6264
  license: "MIT",
6265
6265
  type: "module",
@@ -28626,6 +28626,10 @@ var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
28626
28626
  function projectUsesFormBuilder(projectType) {
28627
28627
  return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
28628
28628
  }
28629
+ var CONTENT_TEMPLATE_TYPES = /* @__PURE__ */ new Set(["blog"]);
28630
+ function templateNextlyChannel(projectType) {
28631
+ return CONTENT_TEMPLATE_TYPES.has(projectType) ? "alpha" : "latest";
28632
+ }
28629
28633
  var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
28630
28634
  ".ts",
28631
28635
  ".tsx",
@@ -28720,29 +28724,32 @@ var NEXTLY_PACKAGES = [
28720
28724
  "@nextlyhq/plugin-form-builder",
28721
28725
  "@nextlyhq/plugin-sdk"
28722
28726
  ];
28723
- var resolvedNextlyVersions = null;
28724
- async function fetchLatestVersion(pkg2) {
28727
+ var resolvedNextlyVersions = /* @__PURE__ */ new Map();
28728
+ async function fetchLatestVersion(pkg2, channel = "latest") {
28725
28729
  try {
28726
28730
  const res = await fetch(
28727
28731
  `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg2)}/dist-tags`,
28728
28732
  { signal: AbortSignal.timeout(5e3) }
28729
28733
  );
28730
- if (!res.ok) return "latest";
28734
+ if (!res.ok) return channel;
28731
28735
  const data = await res.json();
28732
- return data.latest ? `^${data.latest}` : "latest";
28736
+ const version2 = data[channel];
28737
+ return version2 ? `^${version2}` : channel;
28733
28738
  } catch {
28734
- return "latest";
28739
+ return channel;
28735
28740
  }
28736
28741
  }
28737
- async function resolveNextlyVersions() {
28738
- if (resolvedNextlyVersions) return resolvedNextlyVersions;
28742
+ async function resolveNextlyVersions(channel = "latest") {
28743
+ const cached = resolvedNextlyVersions.get(channel);
28744
+ if (cached) return cached;
28739
28745
  const entries = await Promise.all(
28740
28746
  NEXTLY_PACKAGES.map(
28741
- async (pkg2) => [pkg2, await fetchLatestVersion(pkg2)]
28747
+ async (pkg2) => [pkg2, await fetchLatestVersion(pkg2, channel)]
28742
28748
  )
28743
28749
  );
28744
- resolvedNextlyVersions = Object.fromEntries(entries);
28745
- return resolvedNextlyVersions;
28750
+ const versions = Object.fromEntries(entries);
28751
+ resolvedNextlyVersions.set(channel, versions);
28752
+ return versions;
28746
28753
  }
28747
28754
  var resolvedRuntimeVersions = null;
28748
28755
  async function resolveRuntimeVersions() {
@@ -28773,7 +28780,9 @@ async function generatePackageJson(projectName, database, useYalc = false, proje
28773
28780
  dependencies["@tanstack/react-query"] = "^5.62.0";
28774
28781
  dependencies["lucide-react"] = "^0.544.0";
28775
28782
  if (!useYalc) {
28776
- const versions = await resolveNextlyVersions();
28783
+ const versions = await resolveNextlyVersions(
28784
+ templateNextlyChannel(projectType)
28785
+ );
28777
28786
  dependencies["nextly"] = versions["nextly"];
28778
28787
  dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
28779
28788
  dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";