{"_id":"@backpacktools/backpack-bin-win32-x64","name":"@backpacktools/backpack-bin-win32-x64","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@backpacktools/backpack-bin-win32-x64","version":"2.0.0","os":["win32"],"cpu":["x64"],"gitHead":"797182f1e0e0b5946b63a0cc1b191982d61d5e27","description":"<h1 align=\"center\">    <img src=\"media/backpack-light.svg\" width=\"160\"/>    <br/>    Backpack </h1>","_id":"@backpacktools/backpack-bin-win32-x64@2.0.0","_nodeVersion":"17.3.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-YtVx7wBy6CcBApjrg487PGQAak65Swem5PCq5IEyNAZTMCTfd4Jb6A8gIIOkcLZn8KF2kIwwXkOceQdbxf18KA==","shasum":"0b33449d6ee600d6a2a7a10b3bf3fca3f3b2f78d","tarball":"https://registry.npmjs.org/@backpacktools/backpack-bin-win32-x64/-/backpack-bin-win32-x64-2.0.0.tgz","fileCount":3,"unpackedSize":10924270,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmC7MZmEARRdmKEslFq63G7aFjwOV9QTv+AQWiCKairQIgYpdRV1fL+nZqZ+UJkYnA1PcZZkd0lEd2mMRM3fdcMAs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl2R8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqk9hAAjKg3uRXon/hi9Q4N79yXM8GFMuWFd969oJbSTOcs2+s7FNiC\r\npwi9lCKuqfbg2DPSuWV5ArPZcFvbQiXEufY8LS73OEITbcvJ4aLBLYIznyxK\r\nE2zIQVMbK6I1GK7uyB4zU4ESe2H9xQJnWe5DlrXp2n76ivYgVn4Z6y4V7hgO\r\nujsdQUmUo6B/4OXGY5AONd3DfusL1Hf61/ka+SiNunT6lqu8/uMCPwl2Kx0/\r\ndhb56V16ajzTc2URdaBzEe5xDB3TyTtQ9PmwT14DZ++7jxt+m7FiXvCF7pe7\r\nzCpm6ZqpH7b8ORs1ICpsWz1PXcqeShMqhhlOe9QDijy/VbBUgwTYXMdBkl7o\r\nP5X0HINLFs08xgDilONt45vN6tZYCkymevno0kR9k5cC2Z2l3kfhJH43jt9J\r\nxNNQMO52ZvMaK7QLOm0c+ynK+tet7LykkyBKDNFnJCaabIn70DQHV842I8Hp\r\n21SeSVvv2rKJjjsPkv2FN5YwVWHXz4yOTEPJmSlXZKF7aOihXi1dUrHmauv+\r\nHeS4ktzb5F2l96vh5VV8OKxr50aEpr0cOccTJuKX6BXjc6v77lhTE7cWsCaf\r\nnWW8iJc3xPcRkTxLiiH9gX/1cH2U+X5vAeSlqByDTCFmvXpUZRxXURd+X7O1\r\nRoUOkZUqWBKafiuT9+U/03lveJ8cjXBVEQE=\r\n=d3OU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jondot","email":"jondotan@gmail.com"},"directories":{},"maintainers":[{"name":"jondot","email":"jondotan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/backpack-bin-win32-x64_2.0.0_1670866044513_0.6129396343008338"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-12T17:27:24.422Z","2.0.0":"2022-12-12T17:27:24.757Z","modified":"2022-12-12T17:27:24.995Z"},"maintainers":[{"name":"jondot","email":"jondotan@gmail.com"}],"description":"<h1 align=\"center\">    <img src=\"media/backpack-light.svg\" width=\"160\"/>    <br/>    Backpack </h1>","readme":"<h1 align=\"center\">\n   <img src=\"media/backpack-light.svg\" width=\"160\"/>\n   <br/>\n   Backpack\n</h1>\n\n<h4 align=\"center\">A tool to curate and automate your starter projects</h4>\n<p align=\"center\">\n<img src=\"https://github.com/rusty-ferris-club/backpack/actions/workflows/build.yml/badge.svg\"/>\n</p>\n<p align=\"center\">\n  <a href=\"#key-features\">Key Features</a> •\n  <a href=\"#how-to-use\">How To Use</a> •\n  <a href=\"#download\">Download</a> •\n  <a href=\"#contributing\">Contributing</a> •\n  <a href=\"#license\">License</a>\n</p>\n\n![screenshot](media/bpnew.gif)\n\n## Key Features\n\n* **Generate from full project, subfolders, branches, tags :stars:** - use complete, versions, or any parts of repos you like\n* **Shortcuts :rocket:** - create a personal or team  list of your projects with global and local shortcuts\n* **Variable replacements** - replace variables in content and path (like cookiecutter)     \n* **Automated setup steps :robot:** - run `yarn install` or `make` automatically after a clone\n* **Interactive inputs** - define steps to take inputs and select options in YAML while generating a new project\n*  **Fast & efficient :running:** - no history or `.git` folder, local caching of content by default, supporting `git` and `tar.gz` download\n\n## How to Use\n\n\n\n```\n$ bp --help\nbackpack 2.0.0\nSet up projects and download files from existing repos\n\nUSAGE:\n    bp [OPTIONS] [ARGS] [SUBCOMMAND]\n\nARGS:\n    <shortlink>    A full or short link to a repo (e.g. org/user)\n    <dest>         Target folder\n\nOPTIONS:\n    -c, --config <config>    Use a specified configuration file\n    -f, --fetch              Fetch and apply into the current folder\n    -g, --git                Clone with git\n    -h, --help               Print help information\n    -n, --no-cache           Fetch resources without using the cache\n    -V, --version            Print version information\n    -w, --overwrite          Always overwrite target file(s)\n\nSUBCOMMANDS:\n    add       Save a repo as a project\n    cache     Cache handling\n    config    Create a personal configuration\n    help      Print this message or the help of the given subcommand(s)\n```\n\nTo download and generate a new project, you can use any repo:\n\n```\n$ bp your/repo\n```\n\n## Download\n\nFor macOS:\n\n```\nbrew tap rusty-ferris-club/tap && brew install backpack\n```\n\nOtherwise, grab a release from [releases](https://github.com/rusty-ferris-club/backpack/releases) and run `bp --help`:\n\n\n## :hammer: Create starters from ordinary repos\n\nGo to your ordinary repo and follow the `add` wizard:\n\n```\n$ cd your-repo\n$ bp add\n```\n\n## :hammer: Create starters manually\n\nCreate a `backpack.yaml`:\n\n```\n$ bp config --init\nwrote: /Users/jondot/.backpack/backpack.yaml.\n```\n\nConfigure a starter:\n\n```yaml\nprojects:\n  rust-starter: \n    shortlink: jondot/rust-starter  # you can use any custom prefix here too\n    # is_git: true # force fetch from ssh\n    actions:\n    - name: run an initial build\n      run: cargo build\n```\n\nAnd now run:\n\n```\n$ bp rust-starter\n```\n\nTo personalize a project you can take input  and replace content:\n\n```yaml\nprojects:\n  rust-starter: \n    shortlink: jondot/rust-starter  # you can use any custom prefix here too\n    actions:\n    - name: get app name\n      hook: before\n      interaction:\n        kind: input\n        prompt: name of your app\n        out: app_name\n    swaps:\n    - key: APP_NAME\n      val_template: \"Welcome to {{app_name}}\"\n      path: \"README.md\"\n```\n\n## :smiley: Convert a repo into starter project\n\nIf you include a `.backpack-project.yml` file in a repo, `backpack` will use it to understand which actions and swaps to make while copying content.\n\n<details><summary>Show example</summary>\n\nSee [this example](https://github.com/rusty-ferris-club/backpack-e2e-frozen-localproj/blob/main/.backpack-project.yml):\n\n```yml\nversion: 1\nnew:\n    shortlink: \"\"\n    actions:\n    - name: name\n      hook: before\n      interaction:\n        kind: input\n        prompt: name of your project\n        out: project_name\n    swaps:\n    - key: crewl\n      val_template: \"{{project_name}}\"\n      path: .*\n```\n\nYou can set different actions and swaps for when people do `bp` vs `bp -f` (fetch and apply to current folder).\n\nFor file operations such as renaming, moving and so on, you can use vanilla actions (`mv x y`, `rm x`).\n</details>\n\n\n## :raising_hand_woman:     Configure user projects\n\n`bp` (with no args) will automatically display a list of projects if configure those.\n\nProjects define repos and custom actions and / or swaps you want to attach to each.\n\nGenerate a **global user** configuration file:\n\n```\n$ bp config --init --global\n```\n\nEdit the file:\n\n```\n$ vim ~/.backpack/backpack.yaml\n```\n\nAdd to the `projects` section:\n\n```yaml\nprojects:\n  rust-starter: \n    shortlink: rusty-ferris-club/rust-starter\n```\n\nOptionally indicate it is *only* suitable for applying into an existing folder:\n\n```yaml\nprojects:\n  rust-starter: \n    shortlink: rusty-ferris-club/rust-starter\n    mode: apply # or new, or remove property.\n```\n\n\n## :rotating_light:     Run actions and user input\n\nYou can add custom actions to a project:\n\n```yaml\nprojects:\n  rust:\n    shortlink: rusty-ferris-club/rust-starter\n    actions:\n    - name: 🚨 ====== init git ===========\n      run: git init . && git add . && git commit -am \"first commit\"\n    - name: 🚨 ====== first build ========\n      run: cargo build\n```\n\nYou can also add inputs, selections and confirmation, **including variable capture**.\n\n<details><summary>Show full example</summary>\n\n```yaml\nactions:\n  - name: \"Install deps\"\n    interaction:\n      kind: confirm\n      prompt: \"are you sure?\"\n    run: yarn install\n    ignore_exit: true\n  - name: select a DB\n    interaction:\n      kind: select\n      prompt: select a database\n      options:\n      - sqlite\n      - postgres\n      - mysql\n      default: sqlite\n      out: db\n  - name: \"generate a model\"\n    interaction:\n      kind: input\n      prompt: name of your app?\n      out: name\n    run: yarn run init-app {{db}} {{name}}\n```\n\nActions have a `before` and `after` hook, which make them run **before** copying content (e.g. user input), and **after** the content have being copied (e.g. installing dependencies).\n\nBy default actions are hooked to the `after` event, but you can change it:\n\n```yaml\n- name: name\n  hook: before\n  interaction:\n    kind: input\n    prompt: name of your project\n    out: project_name\n```\n\n</details>\n\n## :bulb:  Replace content\n\nDefine **keys to swap**, where a key can be anything.\n\n\n* Swaps can happen both in content or path.\n* You can limit to a path with a regex\n* You can use a `val_template` which pulls a variable from those you gathered while running actions. You also have a set of inflections such as `{{project_name | kebab_case}}`\n\n<details><summary>Show example</summary>\n\n```yaml\nprojects:\n  my-project:\n    shortlink: kriasoft/react-starter-kit\n    swaps:\n    - key: MIT\n      val: Apache 2.0\n      path: README.md\n    - key: AUTHOR_NAME\n      val_template: Dr. {{user_name}}\n      path: src/.*\n```\n</details>\n\n# FAQ\n\n<details><summary><b>\nHow can I set up an enterprise / hosted git, or use Gitlab or others?\n</b></summary>\nYou can use custom git vendors.\n\nStart by generating a **project-local** configuration file:\n\n```\n$ bp config --init\nwrote: .backpack.yaml.\n```\n\nExample: configure a Github Enterprise instance:\n\n```yaml\nvendors:\n  custom:\n    ghe: # <--- this prefix is yours\n      kind: github\n      base: enterprise-github.acme.org\n             # `---- it will point here now\n```\n\nAnd now, you can use the `ghe:` prefix for your shortlinks:\n\n```\n$ bp ghe:user/repo\n```\n\nYou can check in the `.backpack.yaml` to your project to share it with your team. When `backpack` runs it will **pick it up automatically**.\n\nYou can also generate a **global user config** by specifying:\n\n```\n$ bp config --init --global\n```\n</details>\n\n<details>\n<summary><b>What's the difference between `bp` and `bp -f`?</b></summary>\n\n```\n$ bp kriasoft/react-starter-kit my-react-project\n```\n\n* Create **a new project**  into `my-react-project`   \n* Resolves to [https://github.com/kriasoft/react-starter-kit](https://github.com/kriasoft/react-starter-kit)     \n* Finds the default branch, downloads it and caches locally. Next time you run, it'll be much faster.    \n\n\n\n\n```\n$ bp -f kriasoft/react-starter-kit/-/.github\n```\n\nLet's say you really like how `react-starter-kit` configured its Github Action, and you'd like to copy that to your **existing project**. You can do this:\n\n* Use `/-/` to access a subfolder   \n* Use `-f` to overlay files onto your current working directory    \n\n</details>\n\n<details>\n<summary><b>How can I define actions and variables for a repo I know?</b></summary>\n\n\nTo maximize producitivity, you can do either of these, or all of these in sequence:\n\n1. Just copy material from a template repo, as a faster `git clone` that has built-in cache and knows how to take **parts of repos**.\n2. Embed **placeholder variables** in your template repo and have `backpack` swap these when doing `bp` or `bp -f`\n3. **Execute actions** for input taking from a user, or for running install actions after a clone\n\nYou can build a `.backpack-project.yml` into your template repo for defining actions and variables, or a `project` pointing to that repo in your central `backpack.yml`.\n\n\n</details>\n\n\n\n<details>\n<summary><b>Can I generate a project without typing the name of the repo?</b></summary>\n\n\n```\n$ bp\n```\n\nAnd follow the interactive menu, which will let you:\n\n* Pick a project, if you have any configured\n* Input a shortlink\n* Input a destination or pick an auto generated one\n\n</details>\n\n\n\n<details>\n<summary><b>What's a shortlink?</b></summary>\n\nA shortlink is a pointer to a Git repo which looks like this:\n\n![shortlink](media/shortlink.png)\n\nAny one of these is a legal shortlink:\n\n```\nuser/repo -> resolves to https://github.com/user/repo\ngl:user/repo -> resolves to https://gitlab.org/user/repo\nuser/repo/-/subfolder -> takes only 'subfolder'\nuser/repo#wip -> takes the 'wip' branch\n```\n\n:white_check_mark: Bare minimum is `user/repo` which defaults to Github.  \n:white_check_mark: You can set up a custom prefix if you want.  \n</details>\n\n\n\n<details>\n<summary><b>Is it possible to use backpack only on parts of source repos?</b></summary>\n\nYes, use the folder notation `/-/`:\n\n```\n$ bp user/repo/-/path/to/folder dest-folder\n```\n</details>\n\n<details>\n<summary><b>Can I generate from a given branch?</b>\n</summary>\n\nBranches or tags can be used with the `#branch` specifier.\n\n```\n$ bp kriasoft/react-starter-kit#feature/redux my-starter\n```\n</details>\n\n<details><summary><b> Can I use backpack on empty or populated directories?</b></summary>\n\nYes. Use `-f` to grab content and apply it to an existing empty or populated directories:\n\n```\n$ cd your-directory\n$ bp -f user/repo\n```\n\n</details>\n\n\n<details><summary><b>Can backpack work on self hosted Git servers?</b></summary>\n\nIf it's one of the supported vendors, you can create a custom prefix configuration:\n\n```yaml\nvendors:\n  custom:\n    gh:\n      kind: github\n      base: github.acme.com/my-org\n```\n\nNote that in addition to the custom hosted `github.acme.com` server, we also specified a default org `my-org` above, so it saves a bit of typing. Then you can run:\n\n```\n$ bp gh:my-repo my-repo\n```\n</details>\n\n<details><summary><b>Can backpack infer the name of the destination folder and save me some more typing?</b></summary>\n\nWhere it's non ambiguous, yes. For example, when you specify a subfolder:\n\n```\n$ bp user/repo/-/my-folder\n```\n\nWill grab just `my-folder` from `user/repo` and create in a destinaton folder called `my-folder`.\n\nIf there's a inference strategy you think will work, open an issue or submit a PR.\n</details>\n\n<details><summary><b>How to install backpack globally?</b></summary>\n\nWith `Homebrew` it happens automatically. Otherwise, download a binary and add its containing folder to your `PATH` in the way that's supported by your OS.\n\nWe're accepting PRs for other OS specific installers.\n</details>\n\n<details><summary><b>Any requirements or dependencies for backpack?</b></summary>\n\nJust `git` to exist (and we will eventually remove that dependency). Other than that the `bp` binary is self contained and has no dependencies.\n\n</details>\n<details><summary><b>Can I get a single file?</b></summary>\n\nYes. `backpack` will act differently when the source is a file, it will do what you're expecting it to.\n\nFor example, this will give you a `.gitignore` file from another project:\n\n```\n$ cd my-project\n$ bp -f rusty-ferris-club/backpack/-/.gitignore\n$ tree\n.gitignore\n```\n\nThis will copy just a single workflow file, but also the entire hierarchy of folders:\n\n```\n$ cd my-project\n$ bp -f rusty-ferris-club/backpack/-/.github/workflows/build.yml\n$ tree\n.github/\n  workflows/\n    build.yml\n```\n\nOr in other words:\n\n1. When you specify a target file verbatim, it will use that\n2. If you're not specifying a target file, the destination file and folder path will be copied from the source.\n</details>\n\n# Contributing\n\nWe are accepting PRs. Feel free to [submit PRs](https://github.com/rusty-ferris-club/backpack/pulls).\n\nTo all [Contributors](https://github.com/rusty-ferris-club/backpack/graphs/contributors) - you make this happen, thanks!\n\n# License\n\nCopyright (c) 2022 [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.\n","readmeFilename":"README.md"}