create-prisma 0.4.2-pr.53.184.1 → 0.4.2-pr.53.186.1
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/README.md +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{create-DfcHV9O8.mjs → create-bFiIt7sP.mjs} +15 -9
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ yarn dlx create-prisma@next my-app
|
|
|
13
13
|
bunx create-prisma@next my-app
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The CLI initializes Prisma Next with `@prisma/cli
|
|
16
|
+
The CLI initializes Prisma Next with the aligned `@prisma/cli` prerelease, installs dependencies, emits the contract, and generates a deployable Composer app. PostgreSQL projects use Composer's native Prisma Postgres provider, including migrations and a typed runtime client.
|
|
17
17
|
|
|
18
18
|
The only Composer prompt is:
|
|
19
19
|
|
package/dist/cli.mjs
CHANGED
|
@@ -40,7 +40,7 @@ async function getAnonymousId() {
|
|
|
40
40
|
}
|
|
41
41
|
function getCommonProperties() {
|
|
42
42
|
return {
|
|
43
|
-
"cli-version": "0.4.2-pr.53.
|
|
43
|
+
"cli-version": "0.4.2-pr.53.186.1",
|
|
44
44
|
"node-version": process.version,
|
|
45
45
|
platform: process.platform,
|
|
46
46
|
arch: process.arch
|
|
@@ -471,6 +471,7 @@ async function scaffoldCreateFrameworkTemplate(opts) {
|
|
|
471
471
|
const dependencyVersionMap = {
|
|
472
472
|
"@astrojs/node": "^10.0.2",
|
|
473
473
|
"@elysiajs/node": "^1.4.5",
|
|
474
|
+
"@prisma/cli": "8.0.0-rc.2",
|
|
474
475
|
"@prisma/cli-engine": "8.0.0-rc.2",
|
|
475
476
|
"@prisma/composer": "0.6.0-dev.18",
|
|
476
477
|
"@prisma/composer-prisma-cloud": "0.6.0-dev.18",
|
|
@@ -490,6 +491,7 @@ const dependencyVersionMap = {
|
|
|
490
491
|
tsx: "^4.21.0",
|
|
491
492
|
typescript: "^5.9.3"
|
|
492
493
|
};
|
|
494
|
+
const PRISMA_PLATFORM_CLI_PACKAGE = `@prisma/cli@${dependencyVersionMap["@prisma/cli"]}`;
|
|
493
495
|
function getDependencyVersion(packageName) {
|
|
494
496
|
return dependencyVersionMap[packageName];
|
|
495
497
|
}
|
|
@@ -531,7 +533,6 @@ function getDbPackages(provider) {
|
|
|
531
533
|
|
|
532
534
|
//#endregion
|
|
533
535
|
//#region src/tasks/install.ts
|
|
534
|
-
const PRISMA_CLI_PACKAGE$2 = "@prisma/cli@next";
|
|
535
536
|
function getPrismaNextScriptMap(packageManager) {
|
|
536
537
|
return {
|
|
537
538
|
"contract:emit": "prisma-next contract emit",
|
|
@@ -547,7 +548,7 @@ function getPrismaNextScriptMap(packageManager) {
|
|
|
547
548
|
}
|
|
548
549
|
function getComposerScriptMap(packageManager) {
|
|
549
550
|
const composerCommand = (subcommand, extraArgs = []) => getPackageExecutionCommand(packageManager, [
|
|
550
|
-
|
|
551
|
+
PRISMA_PLATFORM_CLI_PACKAGE,
|
|
551
552
|
"composer",
|
|
552
553
|
subcommand,
|
|
553
554
|
"module.ts",
|
|
@@ -640,7 +641,6 @@ async function installProjectDependencies(packageManager, projectDir = process.c
|
|
|
640
641
|
|
|
641
642
|
//#endregion
|
|
642
643
|
//#region src/tasks/deploy-with-composer.ts
|
|
643
|
-
const PRISMA_CLI_PACKAGE$1 = "@prisma/cli@next";
|
|
644
644
|
function redactSecrets(message) {
|
|
645
645
|
return message.replace(/\b((?:prisma\+)?postgres(?:ql)?:\/\/)[^\s'"]+/gi, "$1<redacted>").replace(/\b([A-Z0-9_]*(?:DATABASE_URL|TOKEN|SECRET|PASSWORD|API_KEY|PRIVATE_KEY)[A-Z0-9_]*=)[^\s]+/g, "$1<redacted>");
|
|
646
646
|
}
|
|
@@ -659,8 +659,11 @@ function parsePrismaCliEnvelope(output) {
|
|
|
659
659
|
} catch {}
|
|
660
660
|
throw new Error("Prisma CLI returned output that is not a valid result envelope.");
|
|
661
661
|
}
|
|
662
|
+
function extractDeploymentUrl(output) {
|
|
663
|
+
return output.match(/https:\/\/[a-z0-9.-]+\.prisma\.build\/?/gi)?.at(-1)?.replace(/\/$/, "");
|
|
664
|
+
}
|
|
662
665
|
function getPrismaCliArgs(packageManager, args) {
|
|
663
|
-
return getPackageExecutionArgs(packageManager, [
|
|
666
|
+
return getPackageExecutionArgs(packageManager, [PRISMA_PLATFORM_CLI_PACKAGE, ...args]);
|
|
664
667
|
}
|
|
665
668
|
async function isAuthenticated(packageManager, projectDir) {
|
|
666
669
|
const invocation = getPrismaCliArgs(packageManager, [
|
|
@@ -682,7 +685,7 @@ async function isAuthenticated(packageManager, projectDir) {
|
|
|
682
685
|
async function ensureAuthentication(packageManager, projectDir) {
|
|
683
686
|
if (await isAuthenticated(packageManager, projectDir)) return;
|
|
684
687
|
const loginCommand = getPackageExecutionCommand(packageManager, [
|
|
685
|
-
|
|
688
|
+
PRISMA_PLATFORM_CLI_PACKAGE,
|
|
686
689
|
"auth",
|
|
687
690
|
"login"
|
|
688
691
|
]);
|
|
@@ -702,13 +705,17 @@ async function deployWithComposer(options) {
|
|
|
702
705
|
await ensureAuthentication(options.packageManager, options.projectDir);
|
|
703
706
|
progress?.start("Deploying to Prisma...");
|
|
704
707
|
const command = getRunScriptArgs(options.packageManager, "deploy");
|
|
705
|
-
await execa(command.command, command.args, {
|
|
708
|
+
const result = await execa(command.command, command.args, {
|
|
706
709
|
cwd: options.projectDir,
|
|
707
710
|
env: process.env,
|
|
708
711
|
stdio: options.verbose ? "inherit" : "pipe"
|
|
709
712
|
});
|
|
710
713
|
progress?.stop("Deployed to Prisma.");
|
|
711
714
|
if (options.verbose) log.success("Deployed to Prisma.");
|
|
715
|
+
else {
|
|
716
|
+
const deploymentUrl = extractDeploymentUrl([result.stdout, result.stderr].filter((value) => typeof value === "string").join("\n"));
|
|
717
|
+
if (deploymentUrl) log.info(`App: ${deploymentUrl}`);
|
|
718
|
+
}
|
|
712
719
|
return true;
|
|
713
720
|
} catch (error) {
|
|
714
721
|
progress?.stop("Deployment failed.");
|
|
@@ -719,7 +726,6 @@ async function deployWithComposer(options) {
|
|
|
719
726
|
|
|
720
727
|
//#endregion
|
|
721
728
|
//#region src/tasks/setup-prisma.ts
|
|
722
|
-
const PRISMA_CLI_PACKAGE = "@prisma/cli@next";
|
|
723
729
|
const DEFAULT_DATABASE_PROVIDER = "postgres";
|
|
724
730
|
const DEFAULT_AUTHORING = "psl";
|
|
725
731
|
async function promptForDatabaseProvider() {
|
|
@@ -838,7 +844,7 @@ function getInitTarget(provider) {
|
|
|
838
844
|
return provider === "mongo" ? "mongodb" : "postgres";
|
|
839
845
|
}
|
|
840
846
|
function getPrismaCliInvocation(packageManager, args) {
|
|
841
|
-
return getPackageExecutionArgs(packageManager, [
|
|
847
|
+
return getPackageExecutionArgs(packageManager, [PRISMA_PLATFORM_CLI_PACKAGE, ...args]);
|
|
842
848
|
}
|
|
843
849
|
async function runPrismaInit(context, projectDir) {
|
|
844
850
|
const args = [
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, t as runCreateCommand } from "./create-bFiIt7sP.mjs";
|
|
3
3
|
import { os } from "@orpc/server";
|
|
4
4
|
import { createCli } from "trpc-cli";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/index.ts
|
|
8
|
-
const CLI_VERSION = "0.4.2-pr.53.
|
|
8
|
+
const CLI_VERSION = "0.4.2-pr.53.186.1";
|
|
9
9
|
const CreateCliInputSchema = z.tuple([z.string().trim().min(1, "Please enter a valid project name").optional().describe("Project name / directory"), CreateCommandInputSchema]);
|
|
10
10
|
function normalizeCreateCliInput(input) {
|
|
11
11
|
const [projectName, options] = input;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-prisma",
|
|
3
|
-
"version": "0.4.2-pr.53.
|
|
3
|
+
"version": "0.4.2-pr.53.186.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Create Prisma Next projects with first-party templates and great DX.",
|
|
6
6
|
"homepage": "https://github.com/prisma/create-prisma",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dev": "tsdown --watch",
|
|
38
38
|
"start": "bun run ./dist/cli.mjs",
|
|
39
39
|
"test": "bun run test:unit && bun run test:e2e",
|
|
40
|
-
"test:unit": "bun test ./tests/dependencies.test.ts ./tests/install.test.ts ./tests/node-version.test.ts ./tests/setup-prisma.test.ts ./tests/telemetry.test.ts",
|
|
40
|
+
"test:unit": "bun test ./tests/dependencies.test.ts ./tests/deploy-with-composer.test.ts ./tests/install.test.ts ./tests/node-version.test.ts ./tests/setup-prisma.test.ts ./tests/telemetry.test.ts",
|
|
41
41
|
"test:e2e": "bun test --timeout 180000 ./tests/e2e/create-prisma.e2e.test.ts",
|
|
42
42
|
"check": "bun run format:check && bun run lint",
|
|
43
43
|
"lint": "oxlint . --deny-warnings",
|