Pup

v2.x

Settings & Configurationpackage.json

The package.json file in your application contains various metadata (project name, version, etc.), configuration data, and utility information for your product.

Of note, the package.json file contains a meteor block with a nested mainModule object specifying where the main files for the app are stored. The "main files" are the files that are used to import all other files in the application: one for the client and one for the server.

Most importantly, the package.json file details the dependencies and devDependencies for your product. In other words, which NPM packages the product depends on. When collaborating with other developers, this list will be referenced by NPM when they run meteor npm install for the first time to download the product's dependencies.

The package.json file also contains configuration data for various tools utilized by Pup like ESLint, Husky, and Prettier.

As an aid to developers working on the product, the package.json file also contains a set of scripts which can be used as short-hand commands in your terminal for performing certain tasks (e.g., starting your development server and loading your settings-development.json file simultaneously).

/package.json
{
  "name": "pup",
  "version": "2.0.0",
  "description": "The Ultimate Boilerplate for Products.",
  "private": true,
  "repository": {
    "url": "git@cleverbeagle:cleverbeagle/pup.git",
    "type": "git"
  },
  "author": "cleverbeagle <business@cleverbeagle.com>",
  "license": "MIT",
  "meteor": {
    "mainModule": {
      "client": "startup/client/index.js",
      "server": "startup/server/index.js"
    }
  },
  "scripts": {
    "dev": "meteor --settings settings-development.json",
    "staging": "DEPLOY_HOSTNAME=us-east-1.galaxy-deploy.meteor.com meteor deploy pup-staging.cleverbeagle.com --settings settings-staging.json",
    "production": "DEPLOY_HOSTNAME=us-east-1.galaxy-deploy.meteor.com meteor deploy pup.cleverbeagle.com --settings settings-production.json",
    "lint": "eslint .",
    "lint:all": "eslint --fix .",
    "lint:file": "eslint --fix",
    "test": "jest",
    "test-watch": "jest --watch --verbose false",
    "test-e2e": "testcafe chrome:headless ui/**/*.e2e.js"
  },
  "dependencies": {
    "@babel/runtime": "^7.1.2",
    "@cleverbeagle/pupql": "0.0.4",
    "@cleverbeagle/seeder": "^2.0.3",
    "apollo-boost": "^0.1.14",
    "apollo-cache-inmemory": "^1.2.9",
    "apollo-client": "^2.4.1",
    "apollo-link": "^1.2.3",
    "apollo-link-error": "^1.1.1",
    "apollo-link-http": "^1.5.5",
    "apollo-link-persisted-queries": "^0.2.1",
    "apollo-link-ws": "^1.0.9",
    "apollo-server": "^2.1.0",
    "apollo-utilities": "^1.0.24",
    "b64-to-blob": "^1.2.19",
    "babel-plugin-lodash": "^3.3.4",
    "bcrypt": "^2.0.1",
    "commonmark": "^0.28.1",
    "core-js": "^2.5.5",
    "file-saver": "^1.3.8",
    "graphql": "^0.13.2",
    "graphql-subscriptions": "^0.5.8",
    "graphql-tag": "^2.9.2",
    "handlebars": "^4.0.11",
    "isomorphic-fetch": "^2.2.1",
    "jquery-validation": "^1.18.0",
    "jszip": "^3.1.5",
    "juice": "^4.3.2",
    "lodash": "^4.17.5",
    "meteor-node-stubs": "^0.3.3",
    "moment": "^2.22.1",
    "moment-timezone": "^0.5.16",
    "node-fetch": "^2.2.0",
    "polished": "^1.9.2",
    "prop-types": "^15.6.1",
    "react": "^16.3.2",
    "react-apollo": "^2.1.11",
    "react-autobind": "^1.0.6",
    "react-bootstrap": "^0.32.1",
    "react-dom": "^16.3.2",
    "react-helmet": "^5.2.0",
    "react-markdown": "^3.3.0",
    "react-redux": "^5.0.7",
    "react-router": "^4.2.0",
    "react-router-bootstrap": "^0.24.4",
    "react-router-dom": "^4.2.2",
    "redux": "^4.0.0",
    "redux-thunk": "^2.2.0",
    "sanitize-html": "^1.19.1",
    "simpl-schema": "^1.5.0",
    "styled-components": "^4.0.2",
    "subscriptions-transport-ws": "^0.9.14",
    "xml": "^1.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.1.2",
    "@babel/preset-env": "^7.1.0",
    "@babel/preset-react": "^7.0.0",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^8.2.6",
    "babel-jest": "^23.6.0",
    "enzyme": "^3.3.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-import-resolver-meteor": "^0.4.0",
    "eslint-plugin-babel": "^5.1.0",
    "eslint-plugin-import": "^2.11.0",
    "eslint-plugin-jest": "^21.27.1",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-meteor": "^4.2.0",
    "eslint-plugin-prettier": "^2.6.2",
    "eslint-plugin-react": "^7.11.1",
    "eslint-plugin-testcafe": "^0.2.1",
    "husky": "^1.0.0-rc.13",
    "jest": "^23.6.0",
    "jest-cli": "^23.6.0",
    "lint-staged": "^7.2.2",
    "prettier": "1.14.0",
    "testcafe": "^0.23.0"
  },
  "eslintConfig": {
    "parser": "babel-eslint",
    "parserOptions": {
      "ecmaFeatures": {
        "jsx": true
      }
    },
    "plugins": [
      "babel",
      "jest",
      "meteor",
      "prettier",
      "react",
      "testcafe"
    ],
    "extends": [
      "airbnb",
      "plugin:prettier/recommended",
      "plugin:meteor/recommended",
      "plugin:react/recommended",
      "plugin:testcafe/recommended",
      "plugin:jest/recommended"
    ],
    "env": {
      "browser": true
    },
    "globals": {
      "expect": false
    },
    "rules": {
      "arrow-parens": [
        2,
        "always"
      ],
      "import/no-unresolved": 0,
      "import/no-extraneous-dependencies": 0,
      "import/extensions": 0,
      "indent": 0,
      "jsx-a11y/anchor-is-valid": [
        "error",
        {
          "components": [
            "Link"
          ],
          "specialLink": [
            "to"
          ]
        }
      ],
      "max-len": 0,
      "no-alert": 0,
      "no-console": 0,
      "no-restricted-globals": 0,
      "no-return-assign": [
        "error",
        "except-parens"
      ],
      "no-underscore-dangle": [
        "error",
        {
          "allow": [
            "_id",
            "_ensureIndex",
            "_verifyEmailToken",
            "_resetPasswordToken",
            "_name"
          ]
        }
      ],
      "class-methods-use-this": 0,
      "prettier/prettier": 2,
      "react/jsx-filename-extension": 0,
      "react/forbid-prop-types": 0
    },
    "settings": {
      "import/resolver": "meteor"
    }
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{js,json,css,md}": [
      "./.githooks/pre-commit.sh",
      "git add"
    ]
  },
  "prettier": {
    "printWidth": 100,
    "tabWidth": 2,
    "useTabs": false,
    "semi": true,
    "singleQuote": true,
    "trailingComma": "all",
    "bracketSpacing": true,
    "jsxBracketSameLine": false,
    "arrowParens": "always",
    "rangeStart": 0,
    "rangeEnd": "Infinity",
    "parser": "babylon",
    "proseWrap": "preserve"
  }
}