create-nextly-app 0.0.2-alpha.41 → 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/index.cjs CHANGED
@@ -21081,6 +21081,10 @@ var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
21081
21081
  function projectUsesFormBuilder(projectType) {
21082
21082
  return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
21083
21083
  }
21084
+ var CONTENT_TEMPLATE_TYPES = /* @__PURE__ */ new Set(["blog"]);
21085
+ function templateNextlyChannel(projectType) {
21086
+ return CONTENT_TEMPLATE_TYPES.has(projectType) ? "alpha" : "latest";
21087
+ }
21084
21088
  var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
21085
21089
  ".ts",
21086
21090
  ".tsx",
@@ -21175,29 +21179,32 @@ var NEXTLY_PACKAGES = [
21175
21179
  "@nextlyhq/plugin-form-builder",
21176
21180
  "@nextlyhq/plugin-sdk"
21177
21181
  ];
21178
- var resolvedNextlyVersions = null;
21179
- async function fetchLatestVersion(pkg) {
21182
+ var resolvedNextlyVersions = /* @__PURE__ */ new Map();
21183
+ async function fetchLatestVersion(pkg, channel = "latest") {
21180
21184
  try {
21181
21185
  const res = await fetch(
21182
21186
  `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
21183
21187
  { signal: AbortSignal.timeout(5e3) }
21184
21188
  );
21185
- if (!res.ok) return "latest";
21189
+ if (!res.ok) return channel;
21186
21190
  const data = await res.json();
21187
- return data.latest ? `^${data.latest}` : "latest";
21191
+ const version = data[channel];
21192
+ return version ? `^${version}` : channel;
21188
21193
  } catch {
21189
- return "latest";
21194
+ return channel;
21190
21195
  }
21191
21196
  }
21192
- async function resolveNextlyVersions() {
21193
- if (resolvedNextlyVersions) return resolvedNextlyVersions;
21197
+ async function resolveNextlyVersions(channel = "latest") {
21198
+ const cached = resolvedNextlyVersions.get(channel);
21199
+ if (cached) return cached;
21194
21200
  const entries = await Promise.all(
21195
21201
  NEXTLY_PACKAGES.map(
21196
- async (pkg) => [pkg, await fetchLatestVersion(pkg)]
21202
+ async (pkg) => [pkg, await fetchLatestVersion(pkg, channel)]
21197
21203
  )
21198
21204
  );
21199
- resolvedNextlyVersions = Object.fromEntries(entries);
21200
- return resolvedNextlyVersions;
21205
+ const versions = Object.fromEntries(entries);
21206
+ resolvedNextlyVersions.set(channel, versions);
21207
+ return versions;
21201
21208
  }
21202
21209
  var resolvedRuntimeVersions = null;
21203
21210
  async function resolveRuntimeVersions() {
@@ -21228,7 +21235,9 @@ async function generatePackageJson(projectName, database, useYalc = false, proje
21228
21235
  dependencies["@tanstack/react-query"] = "^5.62.0";
21229
21236
  dependencies["lucide-react"] = "^0.544.0";
21230
21237
  if (!useYalc) {
21231
- const versions = await resolveNextlyVersions();
21238
+ const versions = await resolveNextlyVersions(
21239
+ templateNextlyChannel(projectType)
21240
+ );
21232
21241
  dependencies["nextly"] = versions["nextly"];
21233
21242
  dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
21234
21243
  dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";