Skip to content

Commit

Permalink
feat: init repo (#1)
Browse files Browse the repository at this point in the history
feat: init repo
  • Loading branch information
leohxj authored Aug 14, 2019
2 parents 2a610c9 + fa8ad32 commit 05bf7e1
Show file tree
Hide file tree
Showing 28 changed files with 7,990 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: ['@mjolnir/eslint-config/node', 'plugin:prettier/recommended'],
rules: {}
};
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# OS junk files
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Coverage directory used by tools like istanbul
coverage

# build
dist/

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# lerna
.changelog/

6 changes: 6 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
$schema: 'http://json.schemastore.org/huskyrc',
hooks: {
'pre-commit': 'lint-staged'
}
};
4 changes: 4 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
$schema: 'http://json.schemastore.org/lintstagedrc.schema',
'**/*.{js, ts}': ['prettier --write', 'eslint --fix', 'git add']
};
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.svg
**/*.ejs
**/*.html
package.json
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
printWidth: 80,
singleQuote: true,
arrowParens: 'always'
};
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
{ "language": "typescriptreact", "autoFix": true }
],
"cSpell.words": [
"mjolnir"
"repo",
"mjolnir",
"mjolnirjs"
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CHANGELOG

This project adheres to [Semantic Versioning](http://semver.org/).
See all notable changes on [Releases](https://github.com/mjolnir/template-monorepo-libs/releases) page.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# templates-monorepo-libs
template for monorepo which used to build tool/library.

## NOTE!!!
Your need to replace `templates-monorepo-libs` literal to your actual project name.
Empty file added assets/.gitkeep
Empty file.
Empty file added docs/.gitkeep
Empty file.
Empty file added examples/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
preset: 'ts-jest',
collectCoverage: true
};
10 changes: 10 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://json.schemastore.org/lerna",
"version": "0.0.0",
"useWorkspaces": true,
"npmClient": "yarn",
"changelog": {
"repo": "mjolnirjs/template-monorepo-libs",
"cacheDir": ".changelog"
}
}
34 changes: 33 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
{
"name": "template-monorepo-libs",
"version": "0.0.1",
"private": true,
"workspaces": [
"packages/*"
],
"description": "template for monorepo which used to build tool/library.",
"main": "index.js",
"repository": "https://github.com/mjolnirjs/template-monorepo-libs.git",
"author": "Leo Hui <[email protected]>",
"license": "MIT"
"license": "MIT",
"scripts": {
"start": "jest --watch",
"clean": "lerna run clean --parallel",
"changelog": "lerna-changelog",
"build": "lerna run build",
"lint": "lerna run lint --parallel",
"test": "jest",
"release": "npm run test && npm run build && lerna publish"
},
"devDependencies": {
"@mjolnir/eslint-config": "^0.1.1",
"@mjolnir/tsconfig": "^0.0.2",
"@types/jest": "^24.0.17",
"@types/node": "^12.7.1",
"cross-env": "^5.2.0",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.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",
"rimraf": "^2.7.0",
"ts-jest": "^24.0.2",
"typescript": "^3.5.3"
}
}
8 changes: 8 additions & 0 deletions packages/package-demo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [
'@mjolnir/eslint-config/typescript',
'plugin:prettier/recommended',
'prettier/@typescript-eslint'
],
rules: {}
};
2 changes: 2 additions & 0 deletions packages/package-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# package-demo

11 changes: 11 additions & 0 deletions packages/package-demo/__tests__/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: [
'@mjolnir/eslint-config/typescript',
'@mjolnir/eslint-config/jest',
'plugin:prettier/recommended',
'prettier/@typescript-eslint'
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off'
}
};
5 changes: 5 additions & 0 deletions packages/package-demo/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Confirm component', () => {
test('adds 1 + 2 to equal 3', () => {
expect(3).toBe(3);
});
});
5 changes: 5 additions & 0 deletions packages/package-demo/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Confirm component', () => {
test('adds 1 + 2 to equal 3', () => {
expect(3).toBe(3);
});
});
12 changes: 12 additions & 0 deletions packages/package-demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "package-demo",
"version": "0.0.0",
"main": "dist/index.js",
"scripts": {
"clean": "rimraf dist",
"build:lib": "tsc -p ./tsconfig.json",
"build": "npm run clean && npm run build:lib",
"lint": "eslint --ext .ts src/ __tests__/"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions packages/package-demo/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const x = 42;
9 changes: 9 additions & 0 deletions packages/package-demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist/lib",
"declaration": false,
"sourceMap": false
}
}
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"config:base",
":preserveSemverRanges"
]
}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@mjolnir/tsconfig/base.json"
}
Loading

0 comments on commit 05bf7e1

Please sign in to comment.