create-z3 0.0.41 → 0.0.44

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/dist/index.js CHANGED
@@ -6,12 +6,11 @@ import { select, input, checkbox, confirm, editor, Separator } from "@inquirer/p
6
6
  import chalk2 from "chalk";
7
7
  import { readFileSync } from "fs";
8
8
  import { fileURLToPath as fileURLToPath2 } from "url";
9
- import { dirname as dirname2, join as join4 } from "path";
9
+ import { dirname as dirname2, join as join4, basename } from "path";
10
10
 
11
11
  // src/utils/validation.ts
12
12
  import validateNpmPackageName from "validate-npm-package-name";
13
13
  import fs from "fs-extra";
14
- import { basename } from "path";
15
14
  function validateProjectName(name) {
16
15
  const result = validateNpmPackageName(name);
17
16
  if (result.validForNewPackages) {
@@ -39,14 +38,6 @@ async function isDirectoryEmpty(dirPath) {
39
38
  }
40
39
  }
41
40
  function resolveProjectName(input2, cwd) {
42
- if (input2 === ".") {
43
- const dirName = basename(cwd);
44
- const validation = validateProjectName(dirName);
45
- if (!validation.valid) {
46
- return dirName;
47
- }
48
- return dirName;
49
- }
50
41
  return input2;
51
42
  }
52
43
 
@@ -78,8 +69,19 @@ async function copyTemplate(framework, targetPath) {
78
69
  }
79
70
  await fs2.copy(templatePath, targetPath, {
80
71
  overwrite: false,
81
- errorOnExist: false
72
+ errorOnExist: false,
73
+ filter: (src) => {
74
+ return !src.endsWith("_gitignore");
75
+ }
82
76
  });
77
+ const sourceGitignore = join(templatePath, "_gitignore");
78
+ const targetGitignore = join(targetPath, ".gitignore");
79
+ if (await fs2.pathExists(sourceGitignore)) {
80
+ await fs2.copy(sourceGitignore, targetGitignore, {
81
+ overwrite: false,
82
+ errorOnExist: false
83
+ });
84
+ }
83
85
  }
84
86
 
85
87
  // src/utils/messages.ts
@@ -2559,9 +2561,10 @@ program.name("create-z3").version(packageJson.version).description("CLI for scaf
2559
2561
  let projectName = "";
2560
2562
  if (projectNameArg) {
2561
2563
  const resolvedName = resolveProjectName(projectNameArg, cwd);
2562
- const validation = validateProjectName(resolvedName);
2564
+ const nameToValidate = resolvedName === "." ? basename(cwd) : resolvedName;
2565
+ const validation = validateProjectName(nameToValidate);
2563
2566
  if (!validation.valid) {
2564
- displayInvalidNameError(resolvedName, validation.errors);
2567
+ displayInvalidNameError(nameToValidate, validation.errors);
2565
2568
  }
2566
2569
  projectName = resolvedName;
2567
2570
  } else {
@@ -2572,13 +2575,14 @@ program.name("create-z3").version(packageJson.version).description("CLI for scaf
2572
2575
  default: "my-z3-app"
2573
2576
  });
2574
2577
  const resolvedName = resolveProjectName(inputName, cwd);
2575
- const validation = validateProjectName(resolvedName);
2578
+ const nameToValidate = resolvedName === "." ? basename(cwd) : resolvedName;
2579
+ const validation = validateProjectName(nameToValidate);
2576
2580
  if (validation.valid) {
2577
2581
  projectName = resolvedName;
2578
2582
  isValid = true;
2579
2583
  } else {
2580
2584
  console.error();
2581
- console.error(chalk2.red(`Invalid project name '${resolvedName}'.`));
2585
+ console.error(chalk2.red(`Invalid project name '${nameToValidate}'.`));
2582
2586
  if (validation.errors.length > 0) {
2583
2587
  validation.errors.forEach((error) => {
2584
2588
  console.error(chalk2.yellow(` - ${error}`));
@@ -2674,11 +2678,12 @@ program.name("create-z3").version(packageJson.version).description("CLI for scaf
2674
2678
  }
2675
2679
  throw error;
2676
2680
  }
2681
+ const packageName = projectName === "." ? basename(createdPath) : projectName;
2677
2682
  let installer;
2678
2683
  if (framework === "tanstack") {
2679
- installer = new TanStackInstaller(createdPath, projectName);
2684
+ installer = new TanStackInstaller(createdPath, packageName);
2680
2685
  } else {
2681
- installer = new NextJSInstaller(createdPath, projectName);
2686
+ installer = new NextJSInstaller(createdPath, packageName);
2682
2687
  }
2683
2688
  try {
2684
2689
  await installer.initProject(projectOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-z3",
3
- "version": "0.0.41",
3
+ "version": "0.0.44",
4
4
  "type": "module",
5
5
  "description": "CLI for scaffolding Z3 Stack applications (TanStack/Next.js + Convex + Better Auth)",
6
6
  "bin": {
@@ -0,0 +1,16 @@
1
+ # Since the ".env" file is gitignored, you can use the ".env.example" file to
2
+ # build a new ".env" file when you clone the repo. Keep this file up-to-date
3
+ # when you add new variables to `.env`.
4
+
5
+ # This file will be committed to version control, so make sure not to have any
6
+ # secrets in it. If you are cloning this repo, create a copy of this file named
7
+ # ".env" and populate it with your secrets.
8
+
9
+ # When adding additional environment variables, the schema in "/src/env.js"
10
+ # should be updated accordingly.
11
+
12
+ NEXT_PUBLIC_CONVEX_URL=""
13
+ NEXT_PUBLIC_CONVEX_SITE_URL=""
14
+
15
+ NEXT_PUBLIC_SITE_URL=""
16
+ BETTER_AUTH_SECRET=""
@@ -0,0 +1,45 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.*
7
+ .yarn/*
8
+ !.yarn/patches
9
+ !.yarn/plugins
10
+ !.yarn/releases
11
+ !.yarn/versions
12
+
13
+ # testing
14
+ /coverage
15
+
16
+ # next.js
17
+ /.next/
18
+ /out/
19
+
20
+ # production
21
+ /build
22
+
23
+ # misc
24
+ .DS_Store
25
+ *.pem
26
+
27
+ # debug
28
+ npm-debug.log*
29
+ yarn-debug.log*
30
+ yarn-error.log*
31
+ .pnpm-debug.log*
32
+
33
+ # env files (can opt-in for committing if needed)
34
+ .env
35
+ .env.local
36
+ .env.development.local
37
+ .env.test.local
38
+ .env.production.local
39
+
40
+ # vercel
41
+ .vercel
42
+
43
+ # typescript
44
+ *.tsbuildinfo
45
+ next-env.d.ts
@@ -0,0 +1,6 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ import "./.next/types/routes.d.ts";
4
+
5
+ // NOTE: This file should not be edited
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -0,0 +1,13 @@
1
+ node_modules
2
+ .DS_Store
3
+ dist
4
+ dist-ssr
5
+ *.local
6
+ count.txt
7
+ .env
8
+ .nitro
9
+ .tanstack
10
+ .wrangler
11
+ .output
12
+ .vinxi
13
+ todos.json