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

Commit f234d24

Browse files
janpiotimsuchanek
andauthored
prisma1 (#5060)
Co-authored-by: timsuchanek <[email protected]>
1 parent 939e487 commit f234d24

File tree

14 files changed

+60
-64
lines changed

14 files changed

+60
-64
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Email: ${account!.login[0].email}
1414
Name: ${account!.name}`)
1515
} catch (e) {
1616
this.out.log(
17-
`Currently not logged in. Run ${chalk.cyan('prisma login')} to login.`,
17+
`Currently not logged in. Run ${chalk.cyan('prisma1 login')} to login.`,
1818
)
1919
}
2020
}

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ export default class Deploy extends Command {
2323
${chalk.green.bold('Examples:')}
2424
2525
${chalk.gray(
26-
'-',
27-
)} Deploy local changes from prisma.yml to the default service environment.
28-
${chalk.green('$ prisma deploy')}
26+
'-',
27+
)} Deploy local changes from prisma.yml to the default service environment.
28+
${chalk.green('$ prisma1 deploy')}
2929
3030
${chalk.gray(
31-
'-',
32-
)} Deploy local changes from default service file accepting potential data loss caused by schema changes
33-
${chalk.green('$ prisma deploy --force')}
31+
'-',
32+
)} Deploy local changes from default service file accepting potential data loss caused by schema changes
33+
${chalk.green('$ prisma1 deploy --force')}
3434
`
3535
static flags: Flags = {
3636
force: flags.boolean({
@@ -135,9 +135,7 @@ ${chalk.gray(
135135

136136
if (cluster && cluster.local && !(await cluster.isOnline())) {
137137
throw new Error(
138-
`Could not connect to server at ${
139-
cluster.baseUrl
140-
}. Please check if your server is running.`,
138+
`Could not connect to server at ${cluster.baseUrl}. Please check if your server is running.`,
141139
)
142140
}
143141

@@ -189,7 +187,7 @@ ${chalk.gray(
189187
workspace!,
190188
noMigrate,
191189
noGenerate,
192-
noHook
190+
noHook,
193191
)
194192
}
195193

@@ -370,12 +368,12 @@ ${chalk.gray(
370368
if (!noHook && isGenerateHookPresent) {
371369
this.out.log(
372370
chalk.yellow(
373-
`Warning: The \`prisma generate\` command was executed twice. Since Prisma 1.31, the Prisma client is generated automatically after running \`prisma deploy\`. It is not necessary to generate it via a \`post-deploy\` hook any more, you can therefore remove the hook if you do not need it otherwise.`,
371+
`Warning: The \`prisma1 generate\` command was executed twice. Since Prisma 1.31, the Prisma client is generated automatically after running \`prisma1 deploy\`. It is not necessary to generate it via a \`post-deploy\` hook any more, you can therefore remove the hook if you do not need it otherwise.`,
374372
),
375373
)
376374
}
377375
const generateCommand = new GenerateCommand({
378-
config: this.config
376+
config: this.config,
379377
})
380378
generateCommand.run()
381379
} else {
@@ -481,7 +479,7 @@ ${chalk.gray(
481479
} else {
482480
this.out.log(
483481
`\nIf you want to ignore the warnings, please deploy with the --force flag: ${chalk.cyan(
484-
'$ prisma deploy --force',
482+
'$ prisma1 deploy --force',
485483
)}`,
486484
)
487485
this.out.log(

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ export default class Export extends Command {
3838
if (
3939
this.definition.definition!.databaseType &&
4040
this.definition.definition!.databaseType === 'document'
41-
) {
42-
throw new Error(`Export is not yet supported for document stores. Please use the native export features of your database.
41+
) {
42+
throw new Error(`Export is not yet supported for document stores. Please use the native export features of your database.
4343
4444
More info here: https://docs.mongodb.com/manual/reference/program/mongodump/`)
45-
} else {
46-
this.out.log(chalk.yellow(`Warning: The \`prisma export\` command will not be further developed in the future. Please use the native export features of your database for these workflows.
45+
} else {
46+
this.out.log(
47+
chalk.yellow(`Warning: The \`prisma1 export\` command will not be further developed in the future. Please use the native export features of your database for these workflows.
4748
4849
More info here:
4950
MySQL: https://dev.mysql.com/doc/refman/5.7/en/mysqlimport.html
5051
Postgres: https://www.postgresql.org/docs/10/app-pgrestore.html
51-
`))
52+
`),
53+
)
5254
}
5355

5456
const cluster = await this.definition.getCluster()
@@ -63,7 +65,7 @@ Postgres: https://www.postgresql.org/docs/10/app-pgrestore.html
6365
)
6466

6567
const importCommand = chalk.green.bold(
66-
`$ prisma import --data ${exportPath}`,
68+
`$ prisma1 import --data ${exportPath}`,
6769
)
6870
this.out.log(`Exported service to ${chalk.bold(exportPath)}
6971
You can import it to a new service with

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class Init extends Command {
4747
try {
4848
files = fs.readdirSync(this.config.definitionDir)
4949
} catch (e) {
50-
debug(`prisma init workflow called without existing directory.`)
50+
debug(`prisma1 init workflow called without existing directory.`)
5151
debug(e.toString())
5252
}
5353
// the .prismarc must be allowed for the docker version to be functioning
@@ -104,7 +104,7 @@ datamodel: datamodel.prisma
104104
}
105105

106106
endpointSteps.push(
107-
`Deploy your Prisma service: ${chalk.cyan('prisma deploy')}`,
107+
`Deploy your Prisma service: ${chalk.cyan('prisma1 deploy')}`,
108108
)
109109

110110
const endpointCreatedFiles = [
@@ -116,10 +116,8 @@ datamodel: datamodel.prisma
116116

117117
this.out.log(`
118118
${chalk.bold(
119-
`Created ${
120-
endpointCreatedFiles.length
121-
} new files: `,
122-
)}
119+
`Created ${endpointCreatedFiles.length} new files: `,
120+
)}
123121
124122
${endpointCreatedFiles.join('\n')}
125123
@@ -193,7 +191,7 @@ datamodel: datamodel.prisma${databaseTypeString}`
193191
)
194192
}
195193

196-
steps.push(`Deploy your Prisma service: ${chalk.cyan('prisma deploy')}`)
194+
steps.push(`Deploy your Prisma service: ${chalk.cyan('prisma1 deploy')}`)
197195

198196
if (results.database && results.database.alreadyData) {
199197
steps.push(
@@ -235,10 +233,8 @@ datamodel: datamodel.prisma${databaseTypeString}`
235233

236234
this.out.log(`
237235
${chalk.bold(
238-
`Created ${
239-
createdFiles.length
240-
} new files: `,
241-
)}
236+
`Created ${createdFiles.length} new files: `,
237+
)}
242238
243239
${createdFiles.join('\n')}
244240

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class List extends Command {
7676
if (!gotCloud) {
7777
this.out.log('')
7878
this.out.warn(`This does not include your services deployed in the cloud.
79-
In order to see them, please run ${chalk.bold.green('prisma login')}`)
79+
In order to see them, please run ${chalk.bold.green('prisma1 login')}`)
8080
}
8181
}
8282
}

cli/packages/prisma-cli-core/src/examples.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const defaultDefinition: ProjectDefinition = {
1717
# This file is the main config file for your Prisma Service.
1818
# It's very minimal at this point and uses default values.
1919
# We've included a hello world function here.
20-
# Just run \`prisma deploy\` to have the first running Prisma Service.
20+
# Just run \`prisma1 deploy\` to have the first running Prisma Service.
2121
#
2222
# Check out some examples:
2323
# https://github.com/prisma/framework/tree/master/examples
@@ -118,7 +118,7 @@ export const changedDefaultDefinition: ProjectDefinition = {
118118
# This file is the main config file for your Prisma Service.
119119
# It's very minimal at this point and uses default values.
120120
# We've included a hello world function here.
121-
# Just uncomment it and run \`prisma deploy\`
121+
# Just uncomment it and run \`prisma1 deploy\`
122122
#
123123
# Check out some examples:
124124
# https://github.com/prisma/framework/tree/master/examples

cli/packages/prisma-cli-engine/src/CLI.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ jest.unmock('fs-extra')
55
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000
66

77
async function run(...argv: string[]) {
8-
const cli = new CLI({ config: { argv: ['prisma'].concat(argv), mock: true } })
8+
const cli = new CLI({
9+
config: { argv: ['prisma1'].concat(argv), mock: true },
10+
})
911
try {
1012
await cli.run()
1113
return cli
@@ -53,7 +55,7 @@ async function run(...argv: string[]) {
5355
describe('edge cases', () => {
5456
test('shows help for `help` command itself', async () => {
5557
const cli = await run('help')
56-
expect(cli.cmd.out.stdout.output).toMatch(/Usage: prisma COMMAND/)
58+
expect(cli.cmd.out.stdout.output).toMatch(/Usage: prisma1 COMMAND/)
5759
})
5860
})
5961

@@ -83,14 +85,14 @@ describe('cli help', () => {
8385
describe('cli version', () => {
8486
test('-v', async () => {
8587
const cli = await run('-v')
86-
expect(cli.cmd.out.stdout.output).toContain('prisma/')
88+
expect(cli.cmd.out.stdout.output).toContain('/1.1')
8789
})
8890
test('--version', async () => {
8991
const cli = await run('--version')
90-
expect(cli.cmd.out.stdout.output).toContain('prisma/')
92+
expect(cli.cmd.out.stdout.output).toContain('/1.1')
9193
})
9294
test('version', async () => {
9395
const cli = await run('version')
94-
expect(cli.cmd.out.stdout.output).toContain('prisma/')
96+
expect(cli.cmd.out.stdout.output).toContain('/1.1')
9597
})
9698
})

cli/packages/prisma-cli-engine/src/CLI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ export class CLI {
209209
}
210210
}
211211

212-
if (this.notifier.update) {
212+
if (this.notifier.update && this.notifier.update.latest.startsWith('1.')) {
213213
this.notifier.notify({
214214
message:
215215
'Update available ' +
216216
chalk.dim(this.notifier.update.current) +
217217
chalk.reset(' → ') +
218218
chalk.cyan(this.notifier.update.latest) +
219-
`\nRun ${chalk.bold.cyan('npm i -g prisma')} to update`,
219+
`\nRun ${chalk.bold.cyan('npm i -g prisma1')} to update`,
220220
boxenOpts: {
221221
padding: 1,
222222
margin: 1,

cli/packages/prisma-cli-engine/src/Parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class Parser {
6161
if (this.input.cmd.constructor.name === 'Export' && arg === '-E') {
6262
throw new Error(
6363
`-E has been renamed to -e. -e has been renamed to -p. Get more information with ${chalk.bold.green(
64-
'prisma export -h',
64+
'prisma1 export -h',
6565
)}`,
6666
)
6767
} else {

cli/packages/prisma-cli-engine/src/commands/help.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class Help extends Command {
101101
'https://www.prisma.io',
102102
)})
103103
104-
${chalk.bold('Usage:')} ${chalk.bold('prisma')} COMMAND`)
104+
${chalk.bold('Usage:')} ${chalk.bold('prisma1')} COMMAND`)
105105
const topics = (ptopics || this.plugins.topics).filter(t => {
106106
if (!t.id) {
107107
return
@@ -128,16 +128,14 @@ ${chalk.bold('Usage:')} ${chalk.bold('prisma')} COMMAND`)
128128
// if (t.id === 'cluster') {
129129
// debugger
130130
// }
131-
return cmds
132-
.filter(cmd => !cmd.hidden)
133-
.map(cmd => {
134-
const cmdName = cmd.command ? ` ${cmd.command}` : ''
135-
const deprecation = cmd.deprecated ? ' (deprecated)' : ''
136-
return [
137-
t.id + cmdName,
138-
chalk.dim((cmd.description || t.description) + deprecation),
139-
]
140-
})
131+
return cmds.filter(cmd => !cmd.hidden).map(cmd => {
132+
const cmdName = cmd.command ? ` ${cmd.command}` : ''
133+
const deprecation = cmd.deprecated ? ' (deprecated)' : ''
134+
return [
135+
t.id + cmdName,
136+
chalk.dim((cmd.description || t.description) + deprecation),
137+
]
138+
})
141139
}),
142140
)) as any
143141
const name = group.deprecated ? `${group.name} (deprecated)` : group.name
@@ -160,17 +158,17 @@ ${chalk.bold('Usage:')} ${chalk.bold('prisma')} COMMAND`)
160158
})
161159

162160
this.out.log(`\nUse ${chalk.cyan(
163-
'prisma help [command]',
161+
'prisma1 help [command]',
164162
)} for more information about a command.
165163
Docs can be found here: https://bit.ly/prisma-cli-commands
166164
167165
${chalk.dim('Examples:')}
168166
169167
${chalk.gray('-')} Initialize files for a new Prisma service
170-
${chalk.cyan('$ prisma init')}
168+
${chalk.cyan('$ prisma1 init')}
171169
172170
${chalk.gray('-')} Deploy service changes (or new service)
173-
${chalk.cyan('$ prisma deploy')}
171+
${chalk.cyan('$ prisma1 deploy')}
174172
`)
175173
}
176174

0 commit comments

Comments
 (0)