Skip to content

Commit

Permalink
feat: first blood, should just work (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Aug 15, 2019
2 parents fb4c7c6 + d6ebfa4 commit d68e731
Show file tree
Hide file tree
Showing 39 changed files with 9,621 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { overrides } = require('@1stg/eslint-config/overrides')

module.exports = {
extends: '@1stg',
overrides,
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@1stg/husky-config')
1 change: 1 addition & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@1stg/lint-staged')
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
language: node_js

node_js: --lts

cache:
- yarn
- directories:
- .changelog

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- git config --global user.name "JounQin"
- git config --global user.email "admin@1stg.me"

install:
- yarn --frozen-lockfile
- yarn lerna bootstrap

script:
- yarn prettier-check
- yarn lint
- yarn test

before_deploy:
- npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
- git remote set-url origin https://user:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git
- git fetch origin $TRAVIS_BRANCH:$TRAVIS_BRANCH
- git checkout $TRAVIS_BRANCH
- yarn lerna-changelog

deploy:
- provider: script
skip_cleanup: true
script: yarn lerna publish from-package --create-release github --yes
on:
branch: master
- provider: script
skip_cleanup: true
script: yarn lerna publish --canary --conventional-prerelease --force-publish --preid beta --pre-dist-tag beta --yes
on:
branch: develop

after_script:
- yarn add -D @codechecks/client @codechecks/build-size-watcher @codechecks/type-coverage-watcher -W
- yarn codechecks
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# configs

[![Travis](https://img.shields.io/travis/com/1stg/configs.svg)](https://travis-com.org/1stg/configs)
[![David](https://img.shields.io/david/1stg/configs.svg)](https://david-dm.org/1stg/configs)
[![David Dev](https://img.shields.io/david/dev/1stg/configs.svg)](https://david-dm.org/1stg/configs?type=dev)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

Personal but Shareable Configurations for all 1stG.me projects.
11 changes: 11 additions & 0 deletions codechecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
checks:
- name: build-size-watcher
options:
files:
- path: 'packages/**/*.*'
- name: type-coverage-watcher
options:
ignoreCatch: true
ignoreFiles:
- '*.d.ts'
strict: true
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest/presets/js-with-babel',
testRegex: [/.*\.(spec|test)\.[jt]sx?$/],
}
30 changes: 30 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json.schemastore.org/lerna",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"changelog": {
"cacheDir": ".cache",
"ignoreCommitters": [
"*bot"
],
"nextVersion": "Unreleased"
},
"command": {
"version": {
"allowBranch": [
"develop",
"master"
],
"conventionalCommits": true,
"gitReset": false,
"message": "chore(release): %s"
},
"publish": {
"ignoreChanges": [
"test",
"*.md"
]
}
}
}
50 changes: 50 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "@1stg/configs",
"version": "0.1.0",
"description": "Personal but Shareable Configurations for all 1stG.me projects.",
"repository": "git@github.com:1stG/configs.git",
"author": "JounQin <admin@1stg.me>",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"prettier-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"lint": "node --preserve-symlinks node_modules/.bin/eslint . --ext js,jsx,mdx,ts,tsx,vue",
"test": "jest"
},
"devDependencies": {
"@1stg/babel-preset": "link:packages/babel-preset",
"@1stg/eslint-config": "link:packages/eslint-config",
"@1stg/husky-config": "link:packages/husky-config",
"@1stg/lint-staged": "link:packages/lint-staged",
"@1stg/prettier-config": "link:packages/prettier-config",
"@1stg/renovate-config": "link:packages/renovate-config",
"@1stg/tsconfig": "link:packages/tsconfig",
"@babel/core": "^7.5.5",
"@commitlint/config-conventional": "^8.1.0",
"@types/jest": "^24.0.17",
"@types/node": "^12.7.2",
"@types/react": "^16.9.1",
"commitlint": "^8.1.0",
"eslint": "^6.1.0",
"husky": "^3.0.3",
"jest": "^24.8.0",
"lerna": "^3.16.4",
"lerna-changelog": "^0.8.2",
"lint-staged": "^9.2.1",
"prettier": "^1.18.2",
"react": "^16.9.0",
"ts-jest": "^24.0.2",
"tslib": "^1.10.0",
"typescript": "^3.5.3",
"vue": "^2.6.10"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"prettier": "@1stg/prettier-config"
}
3 changes: 3 additions & 0 deletions packages/babel-preset/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ['@babel/proposal-optional-chaining'],
}
17 changes: 17 additions & 0 deletions packages/babel-preset/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@1stg/babel-preset",
"version": "0.1.0",
"description": "Personal but Shareable Babel Preset for all 1stG.me projects.",
"repository": "git@github.com:1stG/configs.git",
"author": "JounQin <admin@1stg.me>",
"license": "MIT",
"peerDependencies": {
"@babel/core": "^7.5.5"
},
"dependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.2.0"
},
"publishConfig": {
"access": "public"
}
}
27 changes: 27 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'standard',
'plugin:prettier/recommended',
'prettier/standard',
],
plugins: ['standard', 'prettier'],
rules: {
'import/order': [
2,
{
'newlines-between': 'always',
},
],
'no-empty': [
2,
{
allowEmptyCatch: true,
},
],
'no-empty-function': 2,
'prefer-const': 2,
},
}
Loading

0 comments on commit d68e731

Please sign in to comment.