create-z3 0.0.19 → 0.0.21

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
@@ -1765,6 +1765,11 @@ async function replacePlaceholder(filePath, placeholder, content, options) {
1765
1765
  `Placeholder "${placeholder}" not found in file: ${filePath}`
1766
1766
  );
1767
1767
  }
1768
+ if (options?.inline) {
1769
+ const updatedContent = fileContent.replace(placeholder, content);
1770
+ await fs3.writeFile(filePath, updatedContent, "utf-8");
1771
+ return;
1772
+ }
1768
1773
  const lines = fileContent.split("\n");
1769
1774
  const updatedLines = [];
1770
1775
  for (const line of lines) {
@@ -1787,7 +1792,7 @@ async function replacePlaceholder(filePath, placeholder, content, options) {
1787
1792
  await fs3.writeFile(filePath, updatedLines.join("\n"), "utf-8");
1788
1793
  }
1789
1794
  function generateCredentialsValue(enabled) {
1790
- return enabled ? "true" : "false";
1795
+ return `credentials={${enabled}}`;
1791
1796
  }
1792
1797
  function generateAuthProvidersBlock(oauthProviders, emailPasswordEnabled) {
1793
1798
  const parts = [];
@@ -1861,7 +1866,10 @@ function generateOAuthUIProvidersBlock(providers) {
1861
1866
  if (providers.length === 0) {
1862
1867
  return "";
1863
1868
  }
1864
- return providers.map((id) => `"${id}"`).join(", ");
1869
+ const providerList = providers.map((id) => `"${id}"`).join(", ");
1870
+ return `social={{
1871
+ providers: [${providerList}]
1872
+ }}`;
1865
1873
  }
1866
1874
  function generateEnvVarsBlock(providers, framework) {
1867
1875
  if (providers.length === 0) {
@@ -2114,13 +2122,23 @@ var FrameworkInstaller = class {
2114
2122
  const packageManager = this.detectPackageManager();
2115
2123
  const spinner = ora("Formatting code...").start();
2116
2124
  try {
2117
- await execa(packageManager, ["run", "format"], {
2125
+ const result = await execa(packageManager, ["run", "format"], {
2118
2126
  cwd: this.targetPath,
2119
- stdio: "pipe"
2127
+ stdio: "pipe",
2128
+ reject: false
2120
2129
  });
2121
- spinner.succeed("Code formatted successfully");
2130
+ if (result.exitCode === 0) {
2131
+ spinner.succeed("Code formatted successfully");
2132
+ } else {
2133
+ spinner.warn(`Formatting completed with warnings`);
2134
+ if (result.stderr) {
2135
+ console.log(result.stderr);
2136
+ }
2137
+ }
2122
2138
  } catch (error) {
2123
- spinner.warn("Failed to format code (you may need to run `npm run format` manually)");
2139
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
2140
+ spinner.warn(`Failed to format code: ${errorMessage}`);
2141
+ console.log("You may need to run `npm run format` manually");
2124
2142
  }
2125
2143
  }
2126
2144
  /**
@@ -2132,13 +2150,24 @@ var FrameworkInstaller = class {
2132
2150
  const packageManager = this.detectPackageManager();
2133
2151
  const spinner = ora("Linting and fixing code...").start();
2134
2152
  try {
2135
- await execa(packageManager, ["run", "lint", "--", "--fix"], {
2153
+ const args = packageManager === "pnpm" ? ["lint", "--fix"] : ["run", "lint", "--", "--fix"];
2154
+ const result = await execa(packageManager, args, {
2136
2155
  cwd: this.targetPath,
2137
- stdio: "pipe"
2156
+ stdio: "pipe",
2157
+ reject: false
2138
2158
  });
2139
- spinner.succeed("Code linted and fixed successfully");
2159
+ if (result.exitCode === 0) {
2160
+ spinner.succeed("Code linted and fixed successfully");
2161
+ } else {
2162
+ spinner.warn(`Linting completed with warnings`);
2163
+ if (result.stderr) {
2164
+ console.log(result.stderr);
2165
+ }
2166
+ }
2140
2167
  } catch (error) {
2141
- spinner.warn("Failed to lint code (you may need to run `npm run lint -- --fix` manually)");
2168
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
2169
+ spinner.warn(`Failed to lint code: ${errorMessage}`);
2170
+ console.log("You may need to run `npm run lint -- --fix` manually");
2142
2171
  }
2143
2172
  }
2144
2173
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-z3",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "description": "CLI for scaffolding Z3 Stack applications (TanStack/Next.js + Convex + Better Auth)",
6
6
  "bin": {
@@ -31,14 +31,14 @@ export default function BetterAuthClientProvider({ children }: { children: React
31
31
  return (
32
32
  <AuthUIProvider
33
33
  authClient={authClient}
34
- credentials={/* {{EMAIL_PASSWORD_CREDENTIALS}} */}
34
+ /* {{EMAIL_PASSWORD_CREDENTIALS}} */
35
35
  Link={Link}
36
36
  navigate={router.push}
37
37
  onSessionChange={() => {
38
38
  router.refresh()
39
39
  }}
40
40
  replace={router.replace}
41
- // {{OAUTH_UI_PROVIDERS}}
41
+ // {{OAUTH_UI_PROVIDERS}}
42
42
  >
43
43
  {children}
44
44
  </AuthUIProvider>
@@ -23,15 +23,11 @@ export function Providers({ children }: { children: ReactNode }) {
23
23
  <AuthQueryProvider>
24
24
  <AuthUIProviderTanstack
25
25
  authClient={authClient}
26
- credentials={/* {{EMAIL_PASSWORD_CREDENTIALS}} */}
26
+ /* {{EMAIL_PASSWORD_CREDENTIALS}} */
27
27
  navigate={(href) => router.navigate({ href })}
28
28
  replace={(href) => router.navigate({ href, replace: true })}
29
29
  Link={({ href, ...props }) => <Link to={href} {...props} />}
30
- social={{
31
- providers: [
32
- // {{OAUTH_UI_PROVIDERS}}
33
- ],
34
- }}
30
+ // {{OAUTH_UI_PROVIDERS}}
35
31
  >
36
32
  {children}
37
33
  </AuthUIProviderTanstack>