Skip to content

Commit

Permalink
refactor: add confg files
Browse files Browse the repository at this point in the history
  • Loading branch information
animify committed Feb 9, 2020
1 parent dad7098 commit be1aae3
Show file tree
Hide file tree
Showing 9 changed files with 3,244 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,yml}]
indent_size = 2
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Build dribbblejs

function BUNDLE {
echo "Bundling..."
rm -rf dist
yarn bundle
mv dist/index.d.ts index.d.ts
echo "Bundling done."
}

BUNDLE
echo "Completed build process."
49 changes: 47 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,52 @@
{
"name": "dribbblejs",
"version": "1.0.0",
"main": "index.js",
"author": "Stefan Mansson <[email protected]>",
"license": "MIT"
"license": "MIT",
"main": "dist/index.js",
"umd": "dist/index.umd.js",
"module": "dist/index.m.js",
"scripts": {
"release": "changelog && git push --follow-tags && yarn publish --access public --non-interactive",
"build": "sh ./build.sh",
"bundle": "rollup -c",
"prepublishOnly": "yarn build",
"lint": "tslint -p tsconfig.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/animify/dribbblejs.git"
},
"devDependencies": {
"@types/react": "^16.8.17",
"changelog.md": "^1.1.0",
"husky": "^2.2.0",
"lint-staged": "^8.1.6",
"rollup": "^1.11.3",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.4",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-typescript2": "^0.21.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
},
"files": [
"dist",
"index.d.ts",
"README.md",
"LICENSE"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.ts": "yarn run lint"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
8 changes: 8 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
parser: "typescript",
printWidth: 100,
tabWidth: 4,
singleQuote: true,
trailingComma: "all",
"jsx-a11y/href-no-hash": false
};
31 changes: 31 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import typescript from "rollup-plugin-typescript2";
import commonjs from "rollup-plugin-commonjs";
import external from "rollup-plugin-peer-deps-external";
import resolve from "rollup-plugin-node-resolve";
import pkg from "./package.json";

export default {
input: "src/index.ts",
output: [
{
file: pkg.main,
format: "cjs",
exports: "named"
},
{
file: pkg.module,
format: "es",
exports: "named"
}
],
plugins: [
external(),
resolve(),
typescript({
clean: true,
rollupCommonJSResolveHack: true,
exclude: ["*.d.ts", "**/*.d.ts"]
}),
commonjs()
]
};
24 changes: 24 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"lib": ["dom", "es2015", "es2016", "es2017"],
"outDir": "build",
"module": "esnext",
"target": "es5",
"jsx": "react",
"sourceMap": false,
"allowJs": false,
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"declaration": true,
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedParameters": true
},
"include": ["src"],
"exclude": ["node_modules", "dist", "rollup.config.js"]
}
36 changes: 36 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"rules": {
"quotemark": [true, "single"],
"array-type": [true, "array"],
"no-namespace": [true, "allow-declarations"],
"no-trailing-whitespace": false,
"no-bitwise": false,
"no-angle-bracket-type-assertion": true,
"curly": [true, "ignore-same-line"],
"variable-name": [
false,
"ban-keywords",
"check-format",
"allow-leading-underscore"
],
"eofline": true,
"interface-name": false,
"member-ordering": false,
"no-any": false,
"no-console": false,
"no-unused-expression": [true, "allow-fast-null-checks", "allow-new"],
"object-literal-shorthand": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"prefer-const": true,
"radix": false,
"triple-equals": [true, "allow-null-check"]
},
"linterOptions": {
"exclude": [
"index.d.ts"
]
}
}
Loading

0 comments on commit be1aae3

Please sign in to comment.