Skip to content

Commit

Permalink
introduce binary pinning
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jul 9, 2019
1 parent 881636c commit b35acd5
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 35 deletions.
11 changes: 7 additions & 4 deletions prisma2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
"bin": {
"prisma2": "build/index.js"
},
"prisma": {
"version": "327a65626cf44076dc64c1fee1581191908f7d80"
},
"devDependencies": {
"@prisma/cli": "^0.0.23",
"@prisma/fetch-engine": "^0.0.31",
"@prisma/fetch-engine": "^0.0.35",
"@prisma/introspection": "0.0.36",
"@prisma/lift": "^0.0.126",
"@prisma/photon": "^0.0.136",
"@prisma/lift": "^0.0.128",
"@prisma/photon": "^0.0.137",
"@types/mocha": "^5.2.7",
"@zeit/ncc": "^0.18.5",
"jest": "24.8.0",
Expand All @@ -45,7 +48,7 @@
"ncc": "ncc build dist/bin.js -o build",
"ncc:download": "ncc build scripts/download.js -o download-build",
"build": "yarn tsc && yarn ncc:download && yarn ncc && sed -i.bak 's/env ts-node/env node/g' 'build/index.js' && rm -f build/index.js.bak && scripts/copy-runtime.sh",
"prepublishOnly": "yarn build",
"prepublishOnly": "node scripts/updateTag.js && yarn build",
"prepare": "yarn build && node download-build/index.js",
"update-deps": "yarn upgrade --latest --scope @prisma"
},
Expand Down
13 changes: 7 additions & 6 deletions prisma2/scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const path = require('path')
const {
ensureBinaries,
ensureMigrationBinary,
} = require('@prisma/fetch-engine')
const { ensureQueryEngineBinary, ensureMigrationBinary } = require('@prisma/fetch-engine')
const pkg = require('../package.json')

const runtimePath = eval(`path.join(__dirname, '../runtime')`)
const migrationBinaryPath = eval(`path.join(__dirname, '../')`)
ensureBinaries(runtimePath)
ensureMigrationBinary(migrationBinaryPath)

const version = (pkg && pkg.prisma && pkg.prisma.version) || 'latest'

ensureQueryEngineBinary(runtimePath, version)
ensureMigrationBinary(migrationBinaryPath, version)
14 changes: 14 additions & 0 deletions prisma2/scripts/updateTag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { getLatestAlphaTag } = require('@prisma/fetch-engine')
const pkg = require('../package.json')
const fs = require('fs')
const path = require('path')

async function main() {
const tag = await getLatestAlphaTag()
console.log(tag)
pkg.prisma = pkg.prisma || {}
pkg.prisma.version = tag
fs.writeFileSync(path.join(__dirname, '../package.json'), JSON.stringify(pkg, null, 2))
}

main()
3 changes: 2 additions & 1 deletion prisma2/src/Version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class Version implements Command {
}
private constructor() {}
async parse(argv: string[]) {
return `${packageJson.name}@${packageJson.version}`
const version = (packageJson.prisma && packageJson.prisma.version) || 'latest'
return `${packageJson.name}@${packageJson.version}, binary version: ${version}`
}
}
99 changes: 75 additions & 24 deletions prisma2/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@
chalk "^2.4.2"
strip-indent "^3.0.0"

"@prisma/engine-core@0.0.62":
version "0.0.62"
resolved "https://registry.yarnpkg.com/@prisma/engine-core/-/engine-core-0.0.62.tgz#cc60ad4e19720dc72db985f7f3deeb94c5d18b50"
integrity sha512-2Gv8SoVV+l+gu1Fxbm4coc1cIRdWCivb9lOGIM8RkI3KI+R9uFjxd4mCouj8UGlZERYdR82R1RfsDCjJA9+PBg==
"@prisma/engine-core@0.0.63":
version "0.0.63"
resolved "https://registry.yarnpkg.com/@prisma/engine-core/-/engine-core-0.0.63.tgz#c43fa52fe0c4337b0e0423c36711e097cdb873d0"
integrity sha512-4Ea4MCqxAmOsoXL9clSSBfK9jBfhlzq8tfpnuvLizynAzklVNsAFasfhaJ8+m7I4RkNKCRveUwptN+RFp651LA==
dependencies:
cross-fetch "^3.0.2"
debug "^4.1.1"
Expand All @@ -341,10 +341,10 @@
p-retry "^4.1.0"
progress "^2.0.3"

"@prisma/fetch-engine@^0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-0.0.29.tgz#ce452befc6f67c18f530fbaf0e5a51506104114c"
integrity sha512-g+IDWblZWJHinrell102ikWgCaC7Py5De61wtVzC7nNWMaGDf1OZPp9GwrCfdxeHas3LJ5+9i5W2ojehVXUXdQ==
"@prisma/fetch-engine@^0.0.32":
version "0.0.32"
resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-0.0.32.tgz#90b457aacae0fae30251b90ab146c512bbde91b6"
integrity sha512-BlnfBg5xA2O8SoZ8btuKMuEp5ndfwyrq6CIA6PxDH9cTXC4D0eV71fEmqFON09sX/MMRpV2+f6MwFBdGcIo1kA==
dependencies:
chalk "^2.4.2"
death "^1.1.0"
Expand All @@ -355,17 +355,18 @@
p-retry "^4.1.0"
progress "^2.0.3"

"@prisma/fetch-engine@^0.0.31":
version "0.0.31"
resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-0.0.31.tgz#83b4f5e873a3fa8f0eae9320e8d181fedc00e054"
integrity sha512-bY4ivUyTDxqF6zKDTpObvvzRH1Dxd/Sc/FiJ81y216/3tkATUmfvJLW6HBv2G41KDENE7mrj6OfNQIOYZNmh1A==
"@prisma/fetch-engine@^0.0.35":
version "0.0.35"
resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-0.0.35.tgz#a5131f2dbace39a359d48d9d4d9a52fc79e25001"
integrity sha512-BJWPkzHx/y/zSKB3AuwVFM8Wya1yjDEHE2YuASswRMiBt5C5LGwO97VvjtDavUVxGse6/4uj1VVK31SG/ZzAuQ==
dependencies:
chalk "^2.4.2"
death "^1.1.0"
find-cache-dir "^3.0.0"
hasha "^5.0.0"
htmlparser2 "^3.10.1"
make-dir "^3.0.0"
node-fetch "^2.5.0"
node-fetch "^2.6.0"
p-retry "^4.1.0"
progress "^2.0.3"

Expand Down Expand Up @@ -395,10 +396,10 @@
tar "^4.4.10"
tmp "^0.1.0"

"@prisma/lift@^0.0.126":
version "0.0.126"
resolved "https://registry.yarnpkg.com/@prisma/lift/-/lift-0.0.126.tgz#243e67a51996604402e43a82f36f2061f46a3493"
integrity sha512-Z5a3QpUMytcVGp9/XwM6Qf8yjBGmkgHezIED+sZhgOZoNrZ9DPKGj/MrmH+j0WAFmV7nAWqmSLnZ3MhKe3ankg==
"@prisma/lift@^0.0.128":
version "0.0.128"
resolved "https://registry.yarnpkg.com/@prisma/lift/-/lift-0.0.128.tgz#59d9ea1d611292a21342ab7bac444d4c0bf7cd4a"
integrity sha512-z2whBdYGI37KG3euqDwkfcYdeGHT4k4OD5S9Pcs/9TCSIjfpQK2a8OM2JP2xNtwh5GX8RqAppVwdvs+EWumW/Q==
dependencies:
"@prisma/fetch-engine" "^0.0.24"
"@prisma/studio-server" "^0.0.34"
Expand Down Expand Up @@ -443,15 +444,15 @@
dependencies:
tslib "^1.9.3"

"@prisma/photon@^0.0.136":
version "0.0.136"
resolved "https://registry.yarnpkg.com/@prisma/photon/-/photon-0.0.136.tgz#5aa63b508a9592d01de5596bd69f175d40eb3e9b"
integrity sha512-gfwARpc8TYk/qEkT2TUDXcy2LWg53bS24GDVNllJGp2WxR5U07xiV2M2/mEe1BSQt+UYYoTPIrLLKzfyEhclIg==
"@prisma/photon@^0.0.137":
version "0.0.137"
resolved "https://registry.yarnpkg.com/@prisma/photon/-/photon-0.0.137.tgz#f91ef8332e1e9a34e4138ef95db336d16a8a7abc"
integrity sha512-b6kOnSpU68tWGT37/aJA1FvZoEz7UuBd0zMTbEJ6EN5HS5U3n9X6wSPrUw+ExwX3SH8+QmP5Is1gFfcafAmibA==
dependencies:
"@apexearth/copy" "^1.4.1"
"@prisma/cli" "0.0.23"
"@prisma/engine-core" "0.0.62"
"@prisma/fetch-engine" "^0.0.29"
"@prisma/engine-core" "0.0.63"
"@prisma/fetch-engine" "^0.0.32"
chalk "^2.4.2"
cpy "^7.3.0"
dotenv "^8.0.0"
Expand Down Expand Up @@ -1565,13 +1566,41 @@ dir-glob@^2.2.2:
dependencies:
path-type "^3.0.0"

dom-serializer@0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
dependencies:
domelementtype "^1.3.0"
entities "^1.1.1"

domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==

domexception@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"
integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==
dependencies:
webidl-conversions "^4.0.2"

domhandler@^2.3.0:
version "2.4.2"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
dependencies:
domelementtype "1"

domutils@^1.5.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
dependencies:
dom-serializer "0"
domelementtype "1"

dotenv@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d"
Expand Down Expand Up @@ -1631,6 +1660,11 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"

entities@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==

error-ex@^1.3.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
Expand Down Expand Up @@ -2351,6 +2385,18 @@ html-encoding-sniffer@^1.0.2:
dependencies:
whatwg-encoding "^1.0.1"

htmlparser2@^3.10.1:
version "3.10.1"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
dependencies:
domelementtype "^1.3.1"
domhandler "^2.3.0"
domutils "^1.5.1"
entities "^1.1.1"
inherits "^2.0.1"
readable-stream "^3.1.1"

http-errors@1.7.2, http-errors@~1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f"
Expand Down Expand Up @@ -2437,6 +2483,11 @@ inherits@2, inherits@2.0.3, inherits@^2.0.3, inherits@~2.0.3:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=

inherits@^2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==

ini@^1.3.4, ini@~1.3.0:
version "1.3.5"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
Expand Down Expand Up @@ -4636,7 +4687,7 @@ read-pkg@^3.0.0:
normalize-package-data "^2.3.2"
path-type "^3.0.0"

"readable-stream@2 || 3":
"readable-stream@2 || 3", readable-stream@^3.1.1:
version "3.4.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc"
integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==
Expand Down

0 comments on commit b35acd5

Please sign in to comment.