Skip to content

Commit

Permalink
feat: add project boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiohgz committed Aug 4, 2018
1 parent 2eccbc9 commit 73dcf5f
Show file tree
Hide file tree
Showing 9 changed files with 3,916 additions and 0 deletions.
133 changes: 133 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
version: 2

aliases:
- &defaults
working_directory: ~/core
- &node8_executor
docker:
- image: circleci/node:8
- &node9_executor
docker:
- image: circleci/node:9
- &node10_executor
docker:
- image: circleci/node:10
- &default_executor
<<: *node10_executor
- &repo_key
repo-{{ .Branch }}-{{ .Revision }}
- &base_config_key
base-config-{{ .Branch }}-{{ .Revision }}
- &restore_repo
restore_cache:
keys:
- *repo_key
- &ignore_non_dev_branches
filters:
tags:
only: /.*/
branches:
ignore:
- /release\/.*/
- &execute_on_release
filters:
tags:
only: /(v)?[0-9]+(\.[0-9]+)*/
branches:
ignore:
- /.*/

jobs:
prepare:
<<: *defaults
<<: *default_executor
steps:
- *restore_repo
- checkout
- restore_cache:
key: *base_config_key
- run:
name: 'Base environment setup'
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- save_cache:
key: *base_config_key
paths:
- ~/.npmrc
- run:
name: Install root dependencies
command: yarn install --no-progress
- run:
name: Install packages dependencies and symlink them
command: yarn bootstrap
- save_cache:
key: *repo_key
paths:
- ~/core

# test_node8:
# <<: *defaults
# <<: *node8_executor
# steps:
# - *restore_repo
# - run:
# name: Test with Node 8
# command: yarn test

# test_node9:
# <<: *defaults
# <<: *default_executor
# steps:
# - *restore_repo
# - run:
# name: Test with Node 9
# command: yarn test
# - save_cache:
# key: *coverage_key
# paths:
# - coverage

# test_node10:
# <<: *defaults
# <<: *node10_executor
# steps:
# - *restore_repo
# - run:
# name: Test with Node 10
# command: yarn run test

publish_package:
<<: *defaults
<<: *default_executor
steps:
- *restore_repo
- restore_cache:
key: *base_config_key
- run:
name: Publish
command: yarn run publish

workflows:
version: 2
workflow:
jobs:
- prepare:
<<: *ignore_non_dev_branches
# - test_node8:
# requires:
# - prepare
# <<: *ignore_non_dev_branches
# - test_node9:
# requires:
# - prepare
# <<: *ignore_non_dev_branches
# - test_node10:
# requires:
# - prepare
# <<: *ignore_non_dev_branches
- publish_package:
requires:
- prepare
# - test_node8
# - test_node9
# - test_node10
<<: *execute_on_release
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Code ###
.settings/
.vscode/
tsconfig.json
jsconfig.json

### Intellij ###
.idea/**
cmake-build-*/
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Node ###
logs
*.log*
pids
*.pid*
*.seed
lib-cov
coverage
.nyc_output
.grunt
bower_components
.lock-wscript
build/
dist/
node_modules/
jspm_packages/
typings/
.npm
.eslintcache
.node_repl_history
*.tgz
.yarn-integrity
.env
.cache
.next
.nuxt
.vuepress/dist
.serverless
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Contributing

This project is managed in a Monorepo structure. We decided to use Lerna for this purpose. If you don't know what a monorepo is, we recommend you to read the core concepts described in [this article](https://medium.com/@maoberlehner/monorepos-in-the-wild-33c6eb246cb9) and [Lerna docs](https://lernajs.io/).

## Investigate

First of all, we encourage you to search issues and find if it is already opened. If not, open a new one with a detailed description. With more details we can help you better.

If you are not sure about the problem, you can talk with us at Discord, in our [general](https://discord.gg/6s5CBRu) or [question channel](https://discord.gg/BVyg4F6).

## Development

To start developing, you should perform some steps to prepare the packages:

1. Install monorepo dependencies. We use [Yarn](https://yarnpkg.com) as package manager.
```shell
yarn install
```
2. Install packages dependencies and link them together (if have dependency in each). **Note:** If you install or add dependencies in any package manually, ensure that the links with other packages are not broken, in that case repeat this step.
```shell
yarn bootstrap
```
3. Move to package directory to work normally (e.g, pass tests with `yarn test`)

## Committing changes

We follow [Conventional Commits Specification](https://conventionalcommits.org/) to generate changelogs automatically. Because every commit affects every package in the monorepo, we must specify the package folder in the scope field to generate each changelog correctly. Some examples of use is:
```shell
feat([babel-preset-core]): add basic config
```
```shell
fix([eslint-config-core]): remove unnecessary comment
```
```shell
chore([eslint-config-core]): update some deps
```
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Verdaccio Core

This monorepo contains the core packages of the Verdaccio architechture.

## List of packages

## Contributing

Please, refer to our [CONTRIBUTING](CONTRIBUTING.md) to learn how to contribute.

## License

Verdaccio core is a open source project with [MIT license](LICENSE)
13 changes: 13 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.0.0",
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"message": "chore(release): publish %s"
}
}
}
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"private": true,
"workspaces": ["packages/*"],
"author": "Sergio Herrera <sergio@sergiohgz.eu>",
"license": "MIT",
"scripts": {
"bootstrap": "lerna bootstrap",
"commitmsg": "commitlint -e $GIT_PARAMS",
"publish": "lerna publish --amend",
"version": "lerna publish --conventional-commits --skip-npm"
},
"devDependencies": {
"@commitlint/cli": "7.0.0",
"@commitlint/config-conventional": "7.0.1",
"lerna": "^3.0.0-rc.0"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
}
}
Empty file added packages/.gitkeep
Empty file.
Loading

0 comments on commit 73dcf5f

Please sign in to comment.