Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Last active February 8, 2022 15:50
Show Gist options
  • Save apaleslimghost/292a17fd68f8b20e588ee360c14d5fda to your computer and use it in GitHub Desktop.
Save apaleslimghost/292a17fd68f8b20e588ee360c14d5fda to your computer and use it in GitHub Desktop.
origami bower to npm peerdependency migrator
#!/usr/bin/env volta run --node 16 npx -y zx
const bowerPath = path.resolve(process.cwd(), './bower.json')
if(!await fs.exists(bowerPath)) {
console.log(`no bower.json in ${path.basename(process.cwd())}, skipping`)
} else {
const { dependencies } = require(bowerPath)
const depSpecifiers = Object.keys(dependencies).map(dep => `@financial-times/${dep}`)
await $`npm install --save-peer --no-package-lock --ignore-scripts ${depSpecifiers}`
await $`npm install --save-dev --no-package-lock --ignore-scripts ${depSpecifiers}`
}
{ "name": "@apaleslimghost/bower-to-peer", "version": "0.0.0", "main": "bower.mjs", "bin": "bower.mjs" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment