Last active
February 8, 2022 15:50
-
-
Save apaleslimghost/292a17fd68f8b20e588ee360c14d5fda to your computer and use it in GitHub Desktop.
origami bower to npm peerdependency migrator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}` | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "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