The CSS in the project is relatively difficult to change. While it is very DRY, it relies heavily on inheritance. It's difficult to make changes in the markup modal without it also affecting styles elsewhere. [styled-components](https://www.styled-components.com/) is one of the leading CSS-in-JS libraries. By reducing dependency on global state and CSS inheritance, styles become explicit and are easier to inspect and change. It's also convenient that styles can be embedded with the components they modify. At runtime, the library creates CSS classes, so it's pretty efficient. We were using a little bit of [styled-jsx](https://github.com/zeit/styled-jsx) before, which ships with Next.js, though styled-components is more widely used and I've had good experiences with it all around. In a few cases I've duplicated styles where it feels more natural to do that: for example, `text-align: center` is duplicated in `Main` and `MarkupModal`. Much of this is a refactor, though there are a few visual changes, particularly in the markup modal and the style examples.
227 lines
8.4 KiB
JSON
227 lines
8.4 KiB
JSON
{
|
|
"name": "shields.io",
|
|
"version": "0.0.0",
|
|
"description": "Shields.io server and frontend",
|
|
"private": true,
|
|
"keywords": [
|
|
"GitHub",
|
|
"badge",
|
|
"SVG",
|
|
"image",
|
|
"shields.io"
|
|
],
|
|
"homepage": "http://shields.io",
|
|
"bugs": {
|
|
"url": "https://github.com/badges/shields/issues",
|
|
"email": "thaddee.tyl@gmail.com"
|
|
},
|
|
"license": "CC0-1.0",
|
|
"author": "Thaddée Tyl <thaddee.tyl@gmail.com>",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/badges/shields"
|
|
},
|
|
"dependencies": {
|
|
"camp": "~17.2.2",
|
|
"chalk": "^2.4.1",
|
|
"check-node-version": "^3.1.0",
|
|
"chrome-web-store-item-property": "~1.1.2",
|
|
"emojic": "^1.1.14",
|
|
"escape-string-regexp": "^1.0.5",
|
|
"fast-xml-parser": "^3.12.10",
|
|
"fsos": "^1.1.3",
|
|
"gh-badges": "file:gh-badges",
|
|
"glob": "^7.1.1",
|
|
"is-css-color": "^1.0.0",
|
|
"joi": "14.3.0",
|
|
"js-yaml": "^3.11.0",
|
|
"jsonpath": "~1.0.0",
|
|
"lodash.countby": "^4.6.0",
|
|
"lodash.mapkeys": "^4.6.0",
|
|
"lodash.throttle": "^4.1.1",
|
|
"lodash.times": "^4.3.2",
|
|
"lodash.uniq": "~4.5.0",
|
|
"moment": "^2.23.0",
|
|
"node-env-flag": "^0.1.0",
|
|
"path-to-regexp": "^2.4.0",
|
|
"pretty-bytes": "^5.0.0",
|
|
"priorityqueuejs": "^1.0.0",
|
|
"prom-client": "^11.2.0",
|
|
"query-string": "^6.0.0",
|
|
"raven": "^2.4.2",
|
|
"redis": "~2.8.0",
|
|
"request": "~2.88.0",
|
|
"semver": "~5.6.0",
|
|
"simple-icons": "1.9.15",
|
|
"xml2js": "~0.4.16",
|
|
"xmldom": "~0.1.27",
|
|
"xpath": "~0.0.27"
|
|
},
|
|
"scripts": {
|
|
"coverage:test:frontend": "BABEL_ENV=test nyc node_modules/mocha/bin/_mocha --opts mocha.opts --require @babel/polyfill --require @babel/register --require mocha-yaml-loader \"frontend/**/*.spec.js\"",
|
|
"coverage:test:server": "HANDLE_INTERNAL_ERRORS=false nyc node_modules/mocha/bin/_mocha --opts mocha.opts \"*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"",
|
|
"coverage:test:package": "nyc node_modules/mocha/bin/_mocha --opts mocha.opts \"gh-badges/**/*.spec.js\"",
|
|
"coverage:test:integration": "nyc node_modules/mocha/bin/_mocha --opts mocha.opts \"lib/**/*.integration.js\" \"services/**/*.integration.js\"",
|
|
"coverage:test:services": "nyc node_modules/mocha/bin/_mocha --opts mocha.opts --delay lib/service-test-runner/cli.js",
|
|
"coverage:test": "rimraf .nyc_output coverage; npm run coverage:test:server; npm run coverage:test:package; npm run coverage:test:frontend; npm run coverage:test:integration; npm run coverage:test:services",
|
|
"coverage:report": "nyc report",
|
|
"coverage:report:reopen": "opn coverage/lcov-report/index.html",
|
|
"coverage:report:open": "npm run coverage:report && npm run coverage:report:reopen",
|
|
"lint": "eslint \"**/*.js\"",
|
|
"prettier": "prettier --write \"**/*.js\"",
|
|
"prettier-check": "prettier-check \"**/*.js\"",
|
|
"danger": "danger",
|
|
"test:js:frontend": "BABEL_ENV=test mocha --opts mocha.opts --require @babel/polyfill --require @babel/register --require mocha-yaml-loader \"frontend/**/*.spec.js\"",
|
|
"test:js:server": "HANDLE_INTERNAL_ERRORS=false mocha --opts mocha.opts \"*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"",
|
|
"test:js:package": "mocha --opts mocha.opts \"gh-badges/**/*.spec.js\"",
|
|
"test:integration": "mocha --opts mocha.opts \"lib/**/*.integration.js\" \"services/**/*.integration.js\"",
|
|
"test:services": "HANDLE_INTERNAL_ERRORS=false mocha --opts mocha.opts --delay lib/service-test-runner/cli.js",
|
|
"test:services:trace": "TRACE_SERVICES=true npm run test:services -- $*",
|
|
"test:services:pr:prepare": "node lib/service-test-runner/pull-request-services-cli.js > pull-request-services.log",
|
|
"test:services:pr:run": "HANDLE_INTERNAL_ERRORS=false mocha --opts mocha.opts --delay lib/service-test-runner/cli.js --stdin < pull-request-services.log",
|
|
"test:services:pr": "npm run test:services:pr:prepare && npm run test:services:pr:run",
|
|
"test": "npm run defs && npm run lint && npm run test:js:frontend && npm run test:js:package && npm run test:js:server",
|
|
"depcheck": "check-node-version --node \">= 8.0\"",
|
|
"postinstall": "npm run depcheck",
|
|
"prebuild": "npm run depcheck",
|
|
"features": "node scripts/export-supported-features-cli.js > supported-features.json",
|
|
"defs": "node scripts/export-service-definitions-cli.js > service-definitions.yml",
|
|
"build": "npm run defs && npm run features && BABEL_ENV=dev-prod next build && BABEL_ENV=dev-prod next export -o build/",
|
|
"heroku-postbuild": "npm run build",
|
|
"heroku-start": "node scripts/export-heroku-secrets-cli.js",
|
|
"analyze": "ANALYZE=true LONG_CACHE=false BASE_URL=https://img.shields.io npm run build",
|
|
"start:server": "HANDLE_INTERNAL_ERRORS=false RATE_LIMIT=false node server 8080 ::",
|
|
"now-start": "node server",
|
|
"prestart": "npm run depcheck && npm run defs && npm run features",
|
|
"start": "concurrently --names server,frontend \"ALLOWED_ORIGIN=http://localhost:3000 npm run start:server\" \"BASE_URL=http://[::]:8080 BABEL_ENV=dev-prod next dev\"",
|
|
"refactoring-report": "node scripts/refactoring-cli.js"
|
|
},
|
|
"lint-staged": {
|
|
"**/*.js": [
|
|
"eslint --fix",
|
|
"prettier --write",
|
|
"git add"
|
|
]
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.1.6",
|
|
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
|
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
|
"@babel/polyfill": "^7.0.0",
|
|
"@babel/preset-env": "^7.1.6",
|
|
"@babel/register": "7.0.0",
|
|
"@mapbox/react-click-to-select": "^2.2.0",
|
|
"almost-equal": "^1.1.0",
|
|
"babel-eslint": "^10.0.0",
|
|
"caller": "^1.0.1",
|
|
"chai": "^4.1.2",
|
|
"chai-datetime": "^1.5.0",
|
|
"chai-enzyme": "^1.0.0-beta.1",
|
|
"chai-string": "^1.4.0",
|
|
"chainsmoker": "^0.1.0",
|
|
"child-process-promise": "^2.2.1",
|
|
"concurrently": "^4.1.0",
|
|
"danger": "^6.1.12",
|
|
"danger-plugin-no-test-shortcuts": "^2.0.0",
|
|
"enzyme": "^3.8.0",
|
|
"enzyme-adapter-react-16": "^1.7.1",
|
|
"eol": "^0.9.1",
|
|
"eslint": "^5.10.0",
|
|
"eslint-config-prettier": "^3.0.1",
|
|
"eslint-config-standard": "^12.0.0",
|
|
"eslint-config-standard-jsx": "^6.0.2",
|
|
"eslint-config-standard-react": "^7.0.2",
|
|
"eslint-plugin-chai-friendly": "^0.4.1",
|
|
"eslint-plugin-import": "^2.8.0",
|
|
"eslint-plugin-mocha": "^5.1.0",
|
|
"eslint-plugin-no-extension-in-require": "^0.2.0",
|
|
"eslint-plugin-node": "^8.0.0",
|
|
"eslint-plugin-promise": "^4.0.0",
|
|
"eslint-plugin-react": "^7.6.1",
|
|
"eslint-plugin-standard": "^4.0.0",
|
|
"fetch-ponyfill": "^6.0.0",
|
|
"fs-readfile-promise": "^3.0.1",
|
|
"got": "^9.4.0",
|
|
"husky": "^1.2.0",
|
|
"icedfrisby": "2.0.0-alpha.2",
|
|
"icedfrisby-nock": "^1.1.0",
|
|
"is-png": "^1.1.0",
|
|
"is-svg": "^3.0.0",
|
|
"joi-extension-semver": "2.0.0",
|
|
"js-yaml-loader": "^1.0.1",
|
|
"lint-staged": "^8.1.0",
|
|
"lodash.debounce": "^4.0.8",
|
|
"lodash.difference": "^4.5.0",
|
|
"lodash.groupby": "^4.6.0",
|
|
"lodash.mapvalues": "^4.6.0",
|
|
"minimist": "^1.2.0",
|
|
"mkdirp": "^0.5.1",
|
|
"mocha": "^5.0.0",
|
|
"mocha-env-reporter": "^3.0.0",
|
|
"mocha-junit-reporter": "^1.18.0",
|
|
"mocha-yaml-loader": "^1.0.3",
|
|
"next": "^6.1.1",
|
|
"nock": "^10.0.4",
|
|
"node-fetch": "^2.3.0",
|
|
"node-mocks-http": "^1.7.3",
|
|
"nyc": "^13.0.1",
|
|
"opn-cli": "^4.0.0",
|
|
"prettier": "1.15.3",
|
|
"prettier-check": "^2.0.0",
|
|
"pretty": "^2.0.0",
|
|
"prop-types": "^15.6.0",
|
|
"react": "^16.6.3",
|
|
"react-dom": "^16.6.3",
|
|
"react-modal": "^3.7.1",
|
|
"react-router-dom": "^4.3.1",
|
|
"read-all-stdin-sync": "^1.0.5",
|
|
"redis-server": "^1.2.2",
|
|
"rimraf": "^2.6.2",
|
|
"sazerac": "^0.4.2",
|
|
"sinon": "^7.2.2",
|
|
"sinon-chai": "^3.3.0",
|
|
"snap-shot-it": "^6.2.7",
|
|
"styled-components": "^4.1.2",
|
|
"tmp": "0.0.33",
|
|
"url": "^0.11.0"
|
|
},
|
|
"engines": {
|
|
"node": ">= 8",
|
|
"npm": ">= 5"
|
|
},
|
|
"babel": {
|
|
"plugins": [
|
|
"@babel/plugin-proposal-class-properties",
|
|
"@babel/plugin-proposal-object-rest-spread"
|
|
],
|
|
"env": {
|
|
"dev-prod": {
|
|
"presets": [
|
|
"next/babel"
|
|
]
|
|
},
|
|
"test": {
|
|
"presets": [
|
|
"@babel/preset-env",
|
|
[
|
|
"@babel/preset-react",
|
|
{
|
|
"development": true
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"collective": {
|
|
"type": "opencollective",
|
|
"url": "https://opencollective.com/shields",
|
|
"logo": "https://opencollective.com/opencollective/logo.txt"
|
|
},
|
|
"husky": {
|
|
"hooks": {
|
|
"pre-commit": "lint-staged"
|
|
}
|
|
}
|
|
}
|