Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit 0f11d1b

Browse files
committed
Merge branch 'beta'
2 parents 2a8241c + 93b5af5 commit 0f11d1b

172 files changed

Lines changed: 32077 additions & 4414 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cli/packages/prisma-cli-core/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,3 @@ Prisma has a community of thousands of amazing developers and contributors. Welc
154154

155155
Contributions are **welcome and extremely helpful** 🙌
156156
Please refer [to the contribution guide](https://github.com/graphcool/prisma/blob/master/CONTRIBUTING.md) for more information.
157-

cli/packages/prisma-cli-core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"lodash.differenceby": "^4.8.0",
9898
"mongodb": "^3.1.10",
9999
"multimatch": "^2.1.0",
100+
"mysql": "^2.16.0",
100101
"node-forge": "^0.7.1",
101102
"npm-run": "4.1.2",
102103
"opn": "^5.1.0",

cli/packages/prisma-cli-core/src/commands/delete/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Command, flags, Flags } from 'prisma-cli-engine'
22
import chalk from 'chalk'
3-
import { prettyTime } from '../../util'
3+
import { prettyTime } from '../../utils/util'
44

55
export default class Delete extends Command {
66
static topic = 'delete'

cli/packages/prisma-cli-core/src/commands/deploy/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as path from 'path'
66
import * as fs from 'fs-extra'
77
import { Seeder } from '../seed/Seeder'
88
const debug = require('debug')('deploy')
9-
import { prettyTime, concatName, defaultDockerCompose } from '../../util'
9+
import { prettyTime, concatName, defaultDockerCompose } from '../../utils/util'
1010
import * as sillyname from 'sillyname'
1111
import { EndpointDialog } from '../../utils/EndpointDialog'
1212
import { spawnSync } from 'npm-run'

cli/packages/prisma-cli-core/src/commands/generate/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Command, flags, Flags } from 'prisma-cli-engine'
2-
import { prettyTime } from '../../util'
2+
import { prettyTime } from '../../utils/util'
33
import chalk from 'chalk'
44
import * as fs from 'fs-extra'
55
import * as path from 'path'

cli/packages/prisma-cli-core/src/commands/init/__snapshots__/index.test.ts.snap

Lines changed: 0 additions & 112 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`init choose local 1`] = `
4+
Object {
5+
"datamodel.prisma": "type User {
6+
id: ID! @unique
7+
name: String!
8+
}
9+
",
10+
"docker-compose.yml": "version: '3'
11+
services:
12+
prisma:
13+
restart: always
14+
ports:
15+
- \\"4466:4466\\"
16+
environment:
17+
PRISMA_CONFIG: |
18+
port: 4466
19+
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
20+
# managementApiSecret: my-secret
21+
databases:
22+
default:
23+
connector: postgres
24+
host: postgres
25+
rawAccess: true
26+
port: 5432
27+
migrations: true
28+
postgres:
29+
restart: always
30+
environment:
31+
POSTGRES_USER: prisma
32+
POSTGRES_PASSWORD: prisma
33+
volumes:
34+
- postgres:/var/lib/postgresql/data
35+
volumes:
36+
postgres:
37+
",
38+
"prisma.yml": "endpoint: http://localhost:4466
39+
datamodel: datamodel.prisma",
40+
}
41+
`;
42+
43+
exports[`init choose local 2`] = `
44+
"
45+
Created 3 new files:
46+
47+
prisma.yml Prisma service definition
48+
datamodel.prisma GraphQL SDL-based datamodel (foundation for database)
49+
docker-compose.yml Docker configuration file
50+
51+
Next steps:
52+
53+
1. Start your Prisma server: docker-compose up -d
54+
2. Deploy your Prisma service: prisma deploy
55+
3. Read more about Prisma server:
56+
http://bit.ly/prisma-server-overview
57+
"
58+
`;
59+
60+
exports[`init choose local 3`] = `""`;
61+
62+
exports[`init test project 1`] = `Object {}`;
63+
64+
exports[`init test project 2`] = `""`;
65+
66+
exports[`init test project 3`] = `""`;

cli/packages/prisma-cli-core/src/commands/init/index.test.ts renamed to cli/packages/prisma-cli-core/src/commands/init/init.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// import * as nock from 'nock'
22
import { mocki } from './inquirer-mock-prompt'
33
import { Config } from 'prisma-cli-engine'
4-
import Init from './'
4+
import Init from './init'
55
import { writeToStdIn, DOWN, ENTER } from '../../test/writeToStdin'
66
import { getTmpDir } from '../../test/getTmpDir'
77
import * as fs from 'fs-extra'

cli/packages/prisma-cli-core/src/commands/init/index.ts renamed to cli/packages/prisma-cli-core/src/commands/init/init.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ export default class Init extends Command {
2525
description: 'Initial service endpoint (optional)',
2626
required: false,
2727
}),
28+
29+
/**
30+
* Temporary flag needed to test Datamodel v2
31+
*/
32+
['prototype']: flags.boolean({
33+
description:
34+
'Output Datamodel v2. Note: This is a temporary flag for debugging',
35+
}),
2836
}
2937

3038
async run() {
@@ -107,10 +115,10 @@ datamodel: datamodel.prisma
107115

108116
this.out.log(`
109117
${chalk.bold(
110-
`Created ${
111-
endpointCreatedFiles.length
112-
} new files: `,
113-
)}
118+
`Created ${
119+
endpointCreatedFiles.length
120+
} new files: `,
121+
)}
114122
115123
${endpointCreatedFiles.join('\n')}
116124
@@ -128,6 +136,7 @@ ${endpointSteps.map((step, index) => ` ${index + 1}. ${step}`).join('\n')}`)
128136
config: this.config,
129137
definition: this.definition,
130138
shouldAskForGenerator: true,
139+
prototype: this.flags.prototype,
131140
})
132141

133142
const results = await endpointDialog.getEndpoint()
@@ -222,10 +231,10 @@ datamodel: datamodel.prisma${databaseTypeString}`
222231

223232
this.out.log(`
224233
${chalk.bold(
225-
`Created ${
226-
createdFiles.length
227-
} new files: `,
228-
)}
234+
`Created ${
235+
createdFiles.length
236+
} new files: `,
237+
)}
229238
230239
${createdFiles.join('\n')}
231240

cli/packages/prisma-cli-core/src/commands/introspect/TmpRelationalRendererV2.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)