Skip to content

Commit

Permalink
fix: shrinkwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Oct 13, 2018
1 parent 8b53492 commit 7f86997
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/generators/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ class App extends Generator {
this.pjson.scripts.prepack = nps.series(`${rmrf} lib`, 'tsc -b')
}
if (['plugin', 'multi'].includes(this.type)) {
this.pjson.scripts.prepack = nps.series('oclif-dev manifest', 'oclif-dev readme', 'npm shrinkwrap')
this.pjson.scripts.postpack = `${rmf} oclif.manifest.json npm-shrinkwrap.json`
this.pjson.scripts.prepack = nps.series('oclif-dev manifest', 'oclif-dev readme')
this.pjson.scripts.postpack = `${rmf} oclif.manifest.json`
this.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')
this.pjson.files.push('/oclif.manifest.json')
this.pjson.files.push('/npm-shrinkwrap.json')
Expand Down Expand Up @@ -495,7 +495,11 @@ class App extends Generator {
return Promise.all([
install(devDependencies, {...yarnOpts, ...dev, ignoreScripts: true}),
install(dependencies, {...yarnOpts, ...save}),
])
]).then(() => {
if (!this.yarn) {
return this.spawnCommand('npm', ['shrinkwrap'])
}
})
}

end() {
Expand Down
4 changes: 2 additions & 2 deletions templates/circle.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- checkout
- restore_cache: &restore_cache
keys:
- v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'package-lock.json' %>"}}
- v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'npm-shrinkwrap.json' %>"}}
- v1-npm-{{checksum ".circleci/config.yml"}}
- run:
name: Install dependencies
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
name: Install dependencies
command: yarn
- save_cache:
key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'package-lock.json' %>"}}
key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'npm-shrinkwrap.json' %>"}}
paths:
- ~/cli/node_modules
<%_ if (yarn) { _%>
Expand Down

0 comments on commit 7f86997

Please sign in to comment.