Giter Club home page Giter Club logo

dept's Introduction

dept

NPM version npm module downloads Build Status Dependency Status License: MIT Greenkeeper badge

Dependencies templates management CLI to install your fixed NPM or Yarn dependencies and cofing files to your project.

Usage

$ dept -h
Usage: dept <command> [options]

Commands:
  dept list                    Show all templates                  [aliases: ls]
  dept show [templateName]     Show a template in details           [aliases: s]
  dept default [templateName]  Use a template by default           [aliases: df]
  dept install [templateName]  Install dependencies and config files from a
                               template                             [aliases: i]
  dept add [templateName]      Add a template with '--data' or '--file'
                               options                              [aliases: a]
  dept remove [templateName]   Remove a template                    [aliases: r]
  dept rename [templateName]   Rename a template name
  [newTemplateName]                                                [aliases: mv]
  dept view [templateName]     View a filed in a template
  [viewStatement]                                                   [aliases: v]
  dept update [templateName]   Update a field in a template
  [updateStatement]                                                 [aliases: u]
  dept export [templateName]   Export a JSON template file          [aliases: e]
  dept listenv                 Show all package managers          [aliases: env]
  dept useenv [environment]    Use a package manager              [aliases: use]
  dept json2yaml               Convert a JSON format to a YAML
                               format with '--data' or '--file'
                               options                             [aliases: jy]
  dept yaml2json               Convert a YAML format to a JSON
                               format with '--data' or '--file'
                               options                             [aliases: yj]

Options:
  --version, -v  Show version                                          [boolean]
  --data, -d     Specify a JSON or YAML data string with 'add',
                 'json2yaml' or 'yaml2json'                             [string]
  --file, -f     Specify a JSON or YAML file with 'add', 'json2yaml'
                 or 'yaml2json'                                         [string]
  --filename, -n  Specify a filename of a JSON or YAML file with 'export',
                  'json2yaml' or 'yaml2json'                            [string]
  --out-dir, -o   Specify an output directory path to export a JSON or YAML
                  file with 'export', 'json2yaml' or 'yaml2json'        [string]
  --help, -h     Show help                                             [boolean]

Template JSON/YAML format

You can define the following properties.

  • dependencies: NPM package dependencies
  • devDependencies: NPM package devDependencies
  • files: Config files like .eslintrc, .travis.yml and so on. If file extension is 'yaml' or 'yml', it is exported as a YAML file.

JSON example:

{
  "dependencies": {
    "module-name-A": "1.0.0"
  },
  "devDependencies": {
    "module-name-B": "*",
    "module-name-C": "^2.1.1"
  },
  "files": {
    "file-name-A.json": {
      "any-prop-1": [
        "any-element-1",
        "any-element-2",
        "any-element-3"
      ],
      "any-prop-2": {
        "any-value-1": 123,
        "any-value-2": true,
        "any-value-3": "something"
      },
      "any-prop-3": "anything"
    },
    "file-name-B.txt": "Hello World",
    "file-name-C.yml": {
      "any-value": "any-value",
      "any-list": [
        "any-element-1",
        "any-element-2"
      ]
    }
  }
}

YAML example:

dependencies:
  module-name-A: 1.0.0
devDependencies:
  module-name-B: '*'
  module-name-C: ^2.1.1
files:
  file-name-A.json:
    any-prop-1:
      - any-element-1
      - any-element-2
      - any-element-3
    any-prop-2:
      any-value-1: 123
      any-value-2: true
      any-value-3: something
    any-prop-3: anything
  file-name-B.txt: Hello World
  file-name-C.yml:
    any-value: any-value
    any-list:
      - any-element-1
      - any-element-2

Real world's templates' examples are HERE.

Use cases

Install your fixed template to your existing project

You can add your fixed template with dept add then install the template to your existing project with dept install. And you can set a default template with dept default.

$ dept add react-eslint-prettier -f ./template.json
$ dept default react-eslint-prettier
$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ cd your-app # Already NPM installed
$ dept install

Install your fixed template in your new project

It initializes your new project automatically if package.json doesn't exist.

$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ mkdir your-new-app
$ cd your-new-app # NOT NPM installed
$ dept install

Install your fixed template in your new project with Yarn

You can also use yarn instead of npm after you change a package manager with env and use.

$ dept env
* npm
  yarn
$ dept use yarn
$ dept env
  npm
* yarn
$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ mkdir your-new-app
$ cd your-new-app # NOT Yarn installed
$ dept install

Specify a template from your fixed templates

Of course, you can specify a template you'd like to use in your project after dept install.

$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ cd your-app
$ dept install express-typescript

View a field in a template

You can view a field in a template with dept view.

$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ dept view express-typescript "dependencies"
{
        "express": "^4.16.0",
        "mongoose": "*"
}
$ dept view express-typescript "dependencies.express"
"^4.16.0"

Update a field in a template

You can update a field in a template with dept update. Either dependencies, devDependencies or files is updatable.

$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ dept update express-typescript "dependencies={\"express\":\"^4.16.4\", \"mongoose\":\">=5.3.10\"}"

Export a template file as JSON format

You can export a JSON template file with dept export to share it.

$ dept list
* react-eslint-prettier
  express-typescript
  vue-nuxt
$ dept export react-eslint-prettier --filename fixed-react-eslint-prettier.json --out-dir ./fixed-templates-dir

Helper commands

Convert a JSON file to a YAML file

You can convet a JSON file to a YAML file with dept json2yaml.

$ dept json2yaml --file ./data.json --filename your-data.yml --out-dir ./converted-dir
$ ls ./converted-dir/
your-data.yml
$ dept jy -f ./data.json # Short expression
$ ls ./
data.yml

Convert a YAML file to a JSON file

You can convet a YAML file to a JSON file with dept yaml2json.

$ dept yaml2json --file ./data.yml --filename your-data.json --out-dir ./converted-dir
$ ls ./converted-dir/
your-data.json
$ dept yj -f ./data.yml # Short expression
$ ls ./
data.json

dept's People

Contributors

dependabot[bot] avatar greenkeeper[bot] avatar keidrun avatar snyk-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

dept's Issues

An in-range update of eslint-plugin-jest is breaking the build 🚨

The devDependency eslint-plugin-jest was updated from 22.9.0 to 22.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v22.10.0

22.10.0 (2019-07-17)

Features

Commits

The new version differs by 7 commits.

  • 28bd1dc feat(rules): adds no-if rule (#293)
  • 7ebdc0e chore: enforce import destructure order
  • 31c7cef chore: convert to import/export (#302)
  • 9f858cb chore: delete tests instead of ignoring them with babel
  • c595ba0 chore: do not include tests in published tarball
  • 4b4eb78 chore: fix lint error in md file
  • d3ea720 chore(docs): fix typo (#304)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of yargs is breaking the build 🚨

The dependency yargs was updated from 13.2.2 to 13.2.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

yargs is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 14 commits.

  • a6e67f1 chore(release): 13.2.4
  • fc13476 chore: update standard-verison dependency
  • bf46813 fix(i18n): rename unclear 'implication failed' to 'missing dependent arguments' (#1317)
  • a3a5d05 docs: fix a broken link to MS Terminology Search (#1341)
  • b4f8018 build: add .versionrc that hides test/build
  • 0c39183 chore(release): 13.2.3
  • 08e0746 chore: update deps (#1340)
  • 843e939 docs: make --no- boolean prefix easier to find in the docs (#1338)
  • 84cac07 docs: restore removed changelog of v13.2.0 (#1337)
  • b20db65 fix(deps): upgrade cliui for compatibility with latest chalk. (#1330)
  • c294d1b test: accept differently formatted output (#1327)
  • ac3f10c chore: move .hbs templates into .js to facilitate webpacking (#1320)
  • 0295132 fix: address issues with dutch translation (#1316)
  • 9f2468e doc: clarify parserConfiguration object structure (#1309)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-jest is breaking the build 🚨

The devDependency eslint-plugin-jest was updated from 22.5.1 to 22.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v22.6.0

22.6.0 (2019-05-22)

Features

Commits

The new version differs by 9 commits.

  • 14d83ef feat(rules): add no-commented-out rule (#262)
  • 83ff198 chore: migrate no-jest-import to typescript (#259)
  • 718c08c chore: upgrade @typescript-eslint
  • ca2aa27 chore: port lowercase-name to TypeScript (#258)
  • 3df0058 chore(ci): run danger with lts version of node
  • 48e3a59 chore: precompile with babel (#257)
  • 8670804 chore: bump deps
  • 05eb11a chore: fix lint error
  • dff6446 docs: link to eslint-plugin-jest-formatting

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-jest is breaking the build 🚨

The devDependency eslint-plugin-jest was updated from 22.3.1 to 22.3.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v22.3.2

22.3.2 (2019-03-12)

Bug Fixes

  • jest/no-identical-title: don't show an error for different template literals (#239) (f6f6d84)
Commits

The new version differs by 1 commits.

  • f6f6d84 fix(jest/no-identical-title): don't show an error for different template literals (#239)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.