Skip to content

Commit 727068f

Browse files
mansonajenweber
andauthored
Use volta and corepack to run yarn and pnpm (#125)
* WIP not working yet Try using volta to overcome perms problems * add stdio inherit to execa * fix running pnpm install in ember-data * update yarn lock --------- Co-authored-by: Jen Weber <[email protected]>
1 parent 781915d commit 727068f

File tree

2 files changed

+14
-34
lines changed

2 files changed

+14
-34
lines changed

generate-local.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const exit = function exit() {
1717
process.exit(1)
1818
}
1919

20-
const runCmd = async (cmd, path) => {
20+
const runCmd = async (cmd, path, args = []) => {
2121
console.log(chalk.underline(`Running '${chalk.green(cmd)}' in ${path}`))
22-
const executedCmd = await execa(cmd, { cwd: path, shell: true })
22+
const executedCmd = await execa(cmd, args, { cwd: path, shell: true, stdio: 'inherit' })
2323

2424
if (executedCmd.failed) {
2525
console.error(executedCmd.stderr)
@@ -57,11 +57,17 @@ const runCmd = async (cmd, path) => {
5757

5858
let buildDocs = async projDirPath => {
5959
checkIfProjectDirExists(projDirPath)
60-
await runCmd('yarn', projDirPath)
60+
61+
if (project === 'ember') {
62+
await runCmd('volta', projDirPath, ['run', 'yarn'])
63+
} else {
64+
await runCmd('corepack', projDirPath, ['pnpm', 'install'])
65+
}
66+
6167

6268
console.log('\n\n')
6369

64-
await runCmd(project === 'ember' ? 'yarn docs' : 'yarn workspace ember-data docs', projDirPath)
70+
await runCmd(project === 'ember' ? 'volta run yarn docs' : 'corepack pnpm run build:docs', projDirPath)
6571

6672
let destination = `${docsPath}/s3-docs/v${version}/${project}-docs.json`
6773
ensureFileSync(destination)
@@ -83,7 +89,9 @@ const runCmd = async (cmd, path) => {
8389

8490
await buildDocs(dirMap[project])
8591

86-
await execa('yarn', [
92+
await execa('volta', [
93+
'run',
94+
'yarn',
8795
'start',
8896
'--project',
8997
project,

yarn.lock

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,12 +1210,6 @@ has@^1.0.1, has@^1.0.3:
12101210
dependencies:
12111211
function-bind "^1.1.1"
12121212

1213-
hasha@^3.0.0:
1214-
version "3.0.0"
1215-
resolved "https://registry.yarnpkg.com/hasha/-/hasha-3.0.0.tgz#52a32fab8569d41ca69a61ff1a214f8eb7c8bd39"
1216-
dependencies:
1217-
is-stream "^1.0.1"
1218-
12191213
[email protected], he@^1.1.1:
12201214
version "1.2.0"
12211215
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
@@ -1473,7 +1467,7 @@ is-retry-allowed@^1.1.0:
14731467
version "1.1.0"
14741468
resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34"
14751469

1476-
is-stream@^1.0.1, is-stream@^1.1.0:
1470+
is-stream@^1.1.0:
14771471
version "1.1.0"
14781472
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
14791473

@@ -1882,10 +1876,6 @@ mocha@^6.2.0:
18821876
yargs-parser "13.0.0"
18831877
yargs-unparser "1.5.0"
18841878

1885-
modify-filename@^1.0.0:
1886-
version "1.1.0"
1887-
resolved "https://registry.yarnpkg.com/modify-filename/-/modify-filename-1.1.0.tgz#9a2dec83806fbb2d975f22beec859ca26b393aa1"
1888-
18891879
mri@^1.1.0:
18901880
version "1.1.1"
18911881
resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.1.tgz#85aa26d3daeeeedf80dc5984af95cc5ca5cad9f1"
@@ -2464,24 +2454,6 @@ restore-cursor@^2.0.0:
24642454
onetime "^2.0.0"
24652455
signal-exit "^3.0.2"
24662456

2467-
rev-file@^3.0.0:
2468-
version "3.0.0"
2469-
resolved "https://registry.yarnpkg.com/rev-file/-/rev-file-3.0.0.tgz#9bb027bee2efb820d14885c85f8c2934f458ce0b"
2470-
dependencies:
2471-
hasha "^3.0.0"
2472-
rev-hash "^2.0.0"
2473-
rev-path "^1.0.0"
2474-
2475-
rev-hash@^2.0.0:
2476-
version "2.0.0"
2477-
resolved "https://registry.yarnpkg.com/rev-hash/-/rev-hash-2.0.0.tgz#7720a236ed0c258df3e64bec03ec048b05b924c4"
2478-
2479-
rev-path@^1.0.0:
2480-
version "1.0.0"
2481-
resolved "https://registry.yarnpkg.com/rev-path/-/rev-path-1.0.0.tgz#d4ccb436ac3370c4607175ce88eafc5c65c5d653"
2482-
dependencies:
2483-
modify-filename "^1.0.0"
2484-
24852457
24862458
version "2.6.3"
24872459
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"

0 commit comments

Comments
 (0)