split package.json to separate config files

This commit is contained in:
Labhansh Agrawal 2019-12-29 20:11:00 +05:30 committed by Benjamin Staneck
parent f3a553f5b6
commit f684093e94
6 changed files with 229 additions and 235 deletions

98
.eslintrc.json Normal file
View file

@ -0,0 +1,98 @@
{
"plugins": [
"react",
"prettier",
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": true,
"experimentalObjectRestSpread": true
},
"allowImportExportEverywhere": true
},
"env": {
"es6": true,
"browser": true,
"node": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"func-names": [
"error",
"as-needed"
],
"no-shadow": "error",
"no-extra-semi": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 0,
"react/no-unescaped-entities": 0,
"react/jsx-no-target-blank": 0,
"react/no-string-refs": 0,
"prettier/prettier": [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"semi": true,
"useTabs": false,
"jsxBracketSameLine": false
}
]
},
"overrides": [
{
"files": [
"app/config/config-default.js",
".hyper.js"
],
"rules": {
"prettier/prettier": [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": false,
"semi": true,
"useTabs": false,
"parser": "babel",
"jsxBracketSameLine": false
}
]
}
},
{
"files": [
"**.ts",
"**.tsx"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off"
}
}
]
}

6
.huskyrc.json Normal file
View file

@ -0,0 +1,6 @@
{
"$schema": "http://json.schemastore.org/huskyrc",
"hooks": {
"pre-push": "yarn test"
}
}

7
ava.config.js Normal file
View file

@ -0,0 +1,7 @@
export default {
files: ['test/unit/*'],
helpers: ['**/testUtils/**/*'],
compileEnhancements: false,
extensions: ['ts'],
require: ['ts-node/register/transpile-only']
};

45
babel.config.json Normal file
View file

@ -0,0 +1,45 @@
{
"presets": [
"@babel/react",
"@babel/typescript"
],
"plugins": [
[
"styled-jsx/babel",
{
"vendorPrefixes": false
}
],
"@babel/plugin-proposal-numeric-separator",
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining"
],
"env": {
"production": {
"plugins": [
"minify-constant-folding",
"minify-dead-code-elimination",
"minify-flip-comparisons",
"minify-guarded-expressions",
"minify-infinity",
[
"minify-mangle-names",
{
"keepClassName": true,
"keepFnName": true
}
],
"minify-replace",
"minify-simplify",
"minify-type-constructors",
"transform-member-expression-literals",
"transform-merge-sibling-variables",
"transform-minify-booleans",
"transform-property-literals",
"transform-simplify-comparison-operators",
"transform-undefined-to-void"
]
}
}
}

73
electron-builder.json Normal file
View file

@ -0,0 +1,73 @@
{
"$schema": "http://json.schemastore.org/electron-builder",
"appId": "co.zeit.hyper",
"directories": {
"app": "target"
},
"extraResources": [
"./bin/yarn-standalone.js",
"./bin/cli.js",
{
"from": "./build/${os}/",
"to": "./bin/",
"filter": [
"hyper*"
]
}
],
"linux": {
"category": "TerminalEmulator",
"target": [
{
"target": "deb",
"arch": [
"x64"
]
},
{
"target": "AppImage",
"arch": [
"x64"
]
},
{
"target": "rpm",
"arch": [
"x64"
]
},
{
"target": "snap",
"arch": [
"x64"
]
}
]
},
"win": {
"target": [
"squirrel"
],
"rfc3161TimeStampServer": "http://timestamp.comodoca.com"
},
"mac": {
"category": "public.app-category.developer-tools",
"extendInfo": "build/Info.plist",
"darkModeSupport": true
},
"deb": {
"afterInstall": "./build/linux/after-install.tpl"
},
"rpm": {
"afterInstall": "./build/linux/after-install.tpl"
},
"snap": {
"confinement": "classic"
},
"protocols": {
"name": "ssh URL",
"schemes": [
"ssh"
]
}
}

View file

@ -16,236 +16,6 @@
"dist": "yarn run build && cross-env BABEL_ENV=production babel target/renderer/bundle.js --out-file target/renderer/bundle.js --no-comments --minified && electron-builder", "dist": "yarn run build && cross-env BABEL_ENV=production babel target/renderer/bundle.js --out-file target/renderer/bundle.js --no-comments --minified && electron-builder",
"clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer" "clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer"
}, },
"ava": {
"files": [
"test/unit/*"
],
"helpers": [
"**/testUtils/**/*"
],
"compileEnhancements": false,
"extensions": [
"ts"
],
"require": [
"ts-node/register/transpile-only"
]
},
"eslintConfig": {
"plugins": [
"react",
"prettier",
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": true,
"experimentalObjectRestSpread": true
},
"allowImportExportEverywhere": true
},
"env": {
"es6": true,
"browser": true,
"node": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"func-names": [
"error",
"as-needed"
],
"no-shadow": "error",
"no-extra-semi": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 0,
"react/no-unescaped-entities": 0,
"react/jsx-no-target-blank": 0,
"react/no-string-refs": 0,
"prettier/prettier": [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"semi": true,
"useTabs": false,
"jsxBracketSameLine": false
}
]
},
"overrides": [
{
"files": [
"app/config/config-default.js",
".hyper.js"
],
"rules": {
"prettier/prettier": [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": false,
"semi": true,
"useTabs": false,
"parser": "babel",
"jsxBracketSameLine": false
}
]
}
},
{
"files": [
"**.ts",
"**.tsx"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off"
}
}
]
},
"babel": {
"presets": [
"@babel/react",
"@babel/typescript"
],
"plugins": [
[
"styled-jsx/babel",
{
"vendorPrefixes": false
}
],
"@babel/plugin-proposal-numeric-separator",
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining"
],
"env": {
"production": {
"plugins": [
"minify-constant-folding",
"minify-dead-code-elimination",
"minify-flip-comparisons",
"minify-guarded-expressions",
"minify-infinity",
[
"minify-mangle-names",
{
"keepClassName": true,
"keepFnName": true
}
],
"minify-replace",
"minify-simplify",
"minify-type-constructors",
"transform-member-expression-literals",
"transform-merge-sibling-variables",
"transform-minify-booleans",
"transform-property-literals",
"transform-simplify-comparison-operators",
"transform-undefined-to-void"
]
}
}
},
"build": {
"appId": "co.zeit.hyper",
"directories": {
"app": "target"
},
"extraResources": [
"./bin/yarn-standalone.js",
"./bin/cli.js",
{
"from": "./build/${os}/",
"to": "./bin/",
"filter": [
"hyper*"
]
}
],
"linux": {
"category": "TerminalEmulator",
"target": [
{
"target": "deb",
"arch": [
"x64"
]
},
{
"target": "AppImage",
"arch": [
"x64"
]
},
{
"target": "rpm",
"arch": [
"x64"
]
},
{
"target": "snap",
"arch": [
"x64"
]
}
]
},
"win": {
"target": [
"squirrel"
],
"rfc3161TimeStampServer": "http://timestamp.comodoca.com"
},
"mac": {
"category": "public.app-category.developer-tools",
"extendInfo": "build/Info.plist",
"darkModeSupport": true
},
"deb": {
"afterInstall": "./build/linux/after-install.tpl"
},
"rpm": {
"afterInstall": "./build/linux/after-install.tpl"
},
"snap": {
"confinement": "classic"
},
"protocols": {
"name": "ssh URL",
"schemes": [
"ssh"
]
}
},
"license": "MIT", "license": "MIT",
"author": { "author": {
"name": "ZEIT, Inc.", "name": "ZEIT, Inc.",
@ -345,10 +115,5 @@
"ts-node": "8.5.4", "ts-node": "8.5.4",
"typescript": "3.7.4", "typescript": "3.7.4",
"webpack": "4.41.5" "webpack": "4.41.5"
},
"husky": {
"hooks": {
"pre-push": "yarn test"
}
} }
} }