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

Commit ef89798

Browse files
committed
Merge branch 'alpha' into beta
2 parents 433b613 + a52d4b8 commit ef89798

72 files changed

Lines changed: 2244 additions & 739 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/src/commands/deploy/deploy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ ${chalk.gray(
312312
const splittedHook = hook.split(' ')
313313
this.out.action.start(`Running ${chalk.cyan(hook)}`)
314314
const isPackaged = fs.existsSync('/snapshot')
315+
debug({ isPackaged })
315316
const spawnPath = isPackaged ? nativeSpawnSync : spawnSync
316317
const child = spawnPath(splittedHook[0], splittedHook.slice(1))
317318
const stderr = child.stderr && child.stderr.toString()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import generateCRUDSchemaString, {
1919
import { DatabaseType, IGQLType } from 'prisma-datamodel'
2020
import { fetchAndPrintSchema } from '../deploy/printSchema'
2121

22+
const debug = require('debug')('generate')
2223
export default class GenereateCommand extends Command {
2324
static topic = 'generate'
2425
static description = 'Generate a schema or Prisma Bindings'
@@ -267,6 +268,7 @@ export default class GenereateCommand extends Command {
267268
this.out.log(`Saving Prisma Client (Go) at ${output}`)
268269
// Run "go fmt" on the file if user has it installed.
269270
const isPackaged = fs.existsSync('/snapshot')
271+
debug({isPackaged})
270272
const spawnPath = isPackaged ? nativeSpawnSync : spawnSync
271273
spawnPath('go', ['fmt', path.join(output, 'prisma.go')])
272274
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ datamodel: datamodel.prisma${databaseTypeString}`
173173
results.datamodel,
174174
)
175175
if (results.cluster!.local && results.writeDockerComposeYml) {
176+
debug(`prisma init: writing docker-compose.yml`)
176177
fs.writeFileSync(
177178
path.join(this.config.definitionDir, 'docker-compose.yml'),
178179
results.dockerComposeYml,
@@ -261,6 +262,7 @@ ${steps.map((step, index) => ` ${index + 1}. ${step}`).join('\n')}`)
261262
this.out.log(chalk.red(err))
262263
}
263264
const isPackaged = fs.existsSync('/snapshot')
265+
debug({ isPackaged })
264266
const spawnPath = isPackaged ? nativeSpawnSync : spawnSync
265267
const child = spawnPath('prisma', ['generate'])
266268
const stderr = child.stderr && child.stderr.toString()

cli/packages/prisma-cli/package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@
2929
"author": "Tim Suchanek <suchanek@prisma.io>",
3030
"license": "Apache-2.0",
3131
"devDependencies": {
32+
"@expo/spawn-async": "1.4.0",
3233
"@types/fs-extra": "^5.0.0",
3334
"@types/node": "^8.0.22",
3435
"aws-sdk": "^2.373.0",
3536
"axios": "^0.18.0",
3637
"dotenv-cli": "^1.4.0",
37-
"git-commit-push-via-github-api": "^1.0.1",
38+
"git-commit-push-via-github-api": "1.0.1",
3839
"husky": "^0.14.3",
3940
"lint-staged": "^4.0.3",
4041
"pkg": "^4.3.5",
4142
"prettier": "1.14.3",
43+
"progress-estimator": "0.2.2",
4244
"rimraf": "^2.6.1",
45+
"ts-node": "8.0.2",
4346
"tslint": "^5.6.0",
4447
"tslint-config-prettier": "^1.17.0",
4548
"tslint-eslint-rules": "^5.4.0",
@@ -48,13 +51,13 @@
4851
"scripts": {
4952
"build": "rimraf dist && tsc -d && chmod +x dist/index.js",
5053
"lint": "tslint src/**/*.ts",
51-
"publish-homebrew": "dotenv -e scripts/.env ts-node ./scripts/release-brew.ts",
52-
"make-binary": "npm run build && npm run package",
54+
"publish-macos": "dotenv -e scripts/.env ts-node ./scripts/release/macos.ts",
55+
"publish-linux": "dotenv -e scripts/.env ts-node ./scripts/release/linux.ts",
56+
"binary-macos": "npm run build && ./scripts/cp-assets.sh && dotenv -e scripts/.env ts-node ./scripts/release/pre-release.ts && pkg package.json --targets node10-macos-x64",
57+
"binary-linux": "npm run build && ./scripts/cp-assets.sh && dotenv -e scripts/.env ts-node ./scripts/release/pre-release.ts && pkg package.json --targets node10-linux-x64",
5358
"precommit": "lint-staged",
5459
"prettier": "prettier --single-quote --no-semi --trailing-comma all --write '*.ts' 'src/**/*.ts'",
55-
"prepublishOnly": "npm run lint && npm run build",
56-
"package": "./scripts/cp-assets.sh && pkg package.json --targets node10-macos-x64",
57-
"package-linux": "./scripts/cp-assets.sh && pkg package.json --targets node10-linux-x64"
60+
"prepublishOnly": "npm run lint && npm run build"
5861
},
5962
"cli-engine": {
6063
"bin": "prisma",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
cp -r ../prisma-cli-core/src/commands/init/boilerplate ../prisma-cli-core/dist/commands/init/boilerplate
4+
cp -r ../prisma-cli-core/src/commands/init/boilerplate ../prisma-cli-core/dist/commands/init/boilerplate

cli/packages/prisma-cli/scripts/release-brew.ts

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { getReleaseFromGithubAPI, linux, checkEnvs, updateFiles } from './release-lib'
2+
3+
async function main() {
4+
try {
5+
checkEnvs()
6+
const version = await getReleaseFromGithubAPI()
7+
// Files are updated from binary-X commands which in invoked by the following function using spawn sync
8+
await linux(version)
9+
} catch (e) {
10+
throw new Error(e)
11+
}
12+
}
13+
14+
main()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { getReleaseFromGithubAPI, brew, checkEnvs, updateFiles } from './release-lib'
2+
3+
async function main() {
4+
try {
5+
checkEnvs()
6+
const version = await getReleaseFromGithubAPI()
7+
// Files are updated from binary-X commands which in invoked by the following function using spawn sync
8+
await brew(version)
9+
} catch (e) {
10+
console.error(e)
11+
process.exit(1)
12+
}
13+
}
14+
15+
main()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { getReleaseFromGithubAPI, updateFiles } from './release-lib'
2+
3+
async function main() {
4+
const version = await getReleaseFromGithubAPI()
5+
updateFiles(version)
6+
console.log(`Version: ${version}`)
7+
}
8+
9+
main()

0 commit comments

Comments
 (0)