create-payloadpack-auth 0.1.0 → 0.2.0
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 +10 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import * as p from "@clack/prompts";
|
|
|
3
3
|
import pc from "picocolors";
|
|
4
4
|
|
|
5
5
|
// src/constants.ts
|
|
6
|
-
var REGISTRY_URL = "https://payloadpack.
|
|
6
|
+
var REGISTRY_URL = "https://registry.payloadpack.com";
|
|
7
7
|
var PACKAGE_NAME = "@payloadpack/auth";
|
|
8
|
-
var DOCS_URL = "https://
|
|
9
|
-
var TOKEN_ENV_VAR = "
|
|
10
|
-
var DEPENDENCIES = ["@payloadpack/auth", "better-auth"];
|
|
8
|
+
var DOCS_URL = "https://payloadpack.com/docs";
|
|
9
|
+
var TOKEN_ENV_VAR = "PAYLOADPACK_TOKEN";
|
|
10
|
+
var DEPENDENCIES = ["@payloadpack/auth", "better-auth", "@better-auth/passkey"];
|
|
11
11
|
var DEV_DEPENDENCIES = ["dotenv-cli"];
|
|
12
|
-
var NPMRC_CONTENT = `@payloadpack:registry=https://payloadpack.
|
|
13
|
-
//payloadpack.
|
|
12
|
+
var NPMRC_CONTENT = `@payloadpack:registry=https://registry.payloadpack.com
|
|
13
|
+
//registry.payloadpack.com/:_authToken=\${PAYLOADPACK_TOKEN}
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
16
|
// src/validators/license.ts
|
|
@@ -217,7 +217,7 @@ async function configureNpmrc(cwd) {
|
|
|
217
217
|
if (await fs4.pathExists(npmrcPath)) {
|
|
218
218
|
const existing = await fs4.readFile(npmrcPath, "utf-8");
|
|
219
219
|
const hasRegistry = existing.includes("@payloadpack:registry");
|
|
220
|
-
const hasTokenLine = existing.includes("//payloadpack.
|
|
220
|
+
const hasTokenLine = existing.includes("//registry.payloadpack.com/:_authToken");
|
|
221
221
|
if (hasRegistry && hasTokenLine) {
|
|
222
222
|
return { created: false, updated: false, alreadyConfigured: true };
|
|
223
223
|
}
|
|
@@ -353,7 +353,7 @@ function getManualInstructions() {
|
|
|
353
353
|
}
|
|
354
354
|
async function modifyPayloadConfig(configPath, cwd) {
|
|
355
355
|
const source = await fs7.readFile(configPath, "utf-8");
|
|
356
|
-
if (source.includes("betterPayloadAuth") || source.includes("
|
|
356
|
+
if (source.includes("betterPayloadAuth") || source.includes("@payloadpack/auth")) {
|
|
357
357
|
return { success: true, modified: false, alreadyConfigured: true };
|
|
358
358
|
}
|
|
359
359
|
const formatter = await detectFormatter(cwd);
|
|
@@ -484,7 +484,7 @@ async function installDependencies({
|
|
|
484
484
|
async function main() {
|
|
485
485
|
const cwd = process.cwd();
|
|
486
486
|
console.log();
|
|
487
|
-
p.intro(pc.bgCyan(pc.black("
|
|
487
|
+
p.intro(pc.bgCyan(pc.black(" @payloadpack/auth Setup ")));
|
|
488
488
|
const project = await validatePayloadProject(cwd);
|
|
489
489
|
if (!project.valid) {
|
|
490
490
|
p.cancel(project.error || "This does not appear to be a Payload CMS project.");
|
|
@@ -609,7 +609,7 @@ async function main() {
|
|
|
609
609
|
p.outro(pc.red("Setup incomplete - dependency installation failed"));
|
|
610
610
|
process.exit(1);
|
|
611
611
|
}
|
|
612
|
-
p.outro(pc.green("
|
|
612
|
+
p.outro(pc.green("@payloadpack/auth is now configured!"));
|
|
613
613
|
console.log(`
|
|
614
614
|
${pc.bold("Next steps:")}
|
|
615
615
|
1. Ensure ${pc.cyan("PAYLOAD_SECRET")} is set in your .env (required for auth)
|