Skip to content

Commit 73dcf5f

Browse files
committed
feat: add project boilerplate
1 parent 2eccbc9 commit 73dcf5f

File tree

9 files changed

+3916
-0
lines changed

9 files changed

+3916
-0
lines changed

.circleci/config.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
version: 2
2+
3+
aliases:
4+
- &defaults
5+
working_directory: ~/core
6+
- &node8_executor
7+
docker:
8+
- image: circleci/node:8
9+
- &node9_executor
10+
docker:
11+
- image: circleci/node:9
12+
- &node10_executor
13+
docker:
14+
- image: circleci/node:10
15+
- &default_executor
16+
<<: *node10_executor
17+
- &repo_key
18+
repo-{{ .Branch }}-{{ .Revision }}
19+
- &base_config_key
20+
base-config-{{ .Branch }}-{{ .Revision }}
21+
- &restore_repo
22+
restore_cache:
23+
keys:
24+
- *repo_key
25+
- &ignore_non_dev_branches
26+
filters:
27+
tags:
28+
only: /.*/
29+
branches:
30+
ignore:
31+
- /release\/.*/
32+
- &execute_on_release
33+
filters:
34+
tags:
35+
only: /(v)?[0-9]+(\.[0-9]+)*/
36+
branches:
37+
ignore:
38+
- /.*/
39+
40+
jobs:
41+
prepare:
42+
<<: *defaults
43+
<<: *default_executor
44+
steps:
45+
- *restore_repo
46+
- checkout
47+
- restore_cache:
48+
key: *base_config_key
49+
- run:
50+
name: 'Base environment setup'
51+
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
52+
- save_cache:
53+
key: *base_config_key
54+
paths:
55+
- ~/.npmrc
56+
- run:
57+
name: Install root dependencies
58+
command: yarn install --no-progress
59+
- run:
60+
name: Install packages dependencies and symlink them
61+
command: yarn bootstrap
62+
- save_cache:
63+
key: *repo_key
64+
paths:
65+
- ~/core
66+
67+
# test_node8:
68+
# <<: *defaults
69+
# <<: *node8_executor
70+
# steps:
71+
# - *restore_repo
72+
# - run:
73+
# name: Test with Node 8
74+
# command: yarn test
75+
76+
# test_node9:
77+
# <<: *defaults
78+
# <<: *default_executor
79+
# steps:
80+
# - *restore_repo
81+
# - run:
82+
# name: Test with Node 9
83+
# command: yarn test
84+
# - save_cache:
85+
# key: *coverage_key
86+
# paths:
87+
# - coverage
88+
89+
# test_node10:
90+
# <<: *defaults
91+
# <<: *node10_executor
92+
# steps:
93+
# - *restore_repo
94+
# - run:
95+
# name: Test with Node 10
96+
# command: yarn run test
97+
98+
publish_package:
99+
<<: *defaults
100+
<<: *default_executor
101+
steps:
102+
- *restore_repo
103+
- restore_cache:
104+
key: *base_config_key
105+
- run:
106+
name: Publish
107+
command: yarn run publish
108+
109+
workflows:
110+
version: 2
111+
workflow:
112+
jobs:
113+
- prepare:
114+
<<: *ignore_non_dev_branches
115+
# - test_node8:
116+
# requires:
117+
# - prepare
118+
# <<: *ignore_non_dev_branches
119+
# - test_node9:
120+
# requires:
121+
# - prepare
122+
# <<: *ignore_non_dev_branches
123+
# - test_node10:
124+
# requires:
125+
# - prepare
126+
# <<: *ignore_non_dev_branches
127+
- publish_package:
128+
requires:
129+
- prepare
130+
# - test_node8
131+
# - test_node9
132+
# - test_node10
133+
<<: *execute_on_release

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
### Code ###
2+
.settings/
3+
.vscode/
4+
tsconfig.json
5+
jsconfig.json
6+
7+
### Intellij ###
8+
.idea/**
9+
cmake-build-*/
10+
*.iws
11+
out/
12+
.idea_modules/
13+
atlassian-ide-plugin.xml
14+
com_crashlytics_export_strings.xml
15+
crashlytics.properties
16+
crashlytics-build.properties
17+
fabric.properties
18+
19+
### Node ###
20+
logs
21+
*.log*
22+
pids
23+
*.pid*
24+
*.seed
25+
lib-cov
26+
coverage
27+
.nyc_output
28+
.grunt
29+
bower_components
30+
.lock-wscript
31+
build/
32+
dist/
33+
node_modules/
34+
jspm_packages/
35+
typings/
36+
.npm
37+
.eslintcache
38+
.node_repl_history
39+
*.tgz
40+
.yarn-integrity
41+
.env
42+
.cache
43+
.next
44+
.nuxt
45+
.vuepress/dist
46+
.serverless

CODE_OF_CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing
2+
3+
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/).
4+
5+
## Investigate
6+
7+
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.
8+
9+
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).
10+
11+
## Development
12+
13+
To start developing, you should perform some steps to prepare the packages:
14+
15+
1. Install monorepo dependencies. We use [Yarn](https://yarnpkg.com) as package manager.
16+
```shell
17+
yarn install
18+
```
19+
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.
20+
```shell
21+
yarn bootstrap
22+
```
23+
3. Move to package directory to work normally (e.g, pass tests with `yarn test`)
24+
25+
## Committing changes
26+
27+
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:
28+
```shell
29+
feat([babel-preset-core]): add basic config
30+
```
31+
```shell
32+
fix([eslint-config-core]): remove unnecessary comment
33+
```
34+
```shell
35+
chore([eslint-config-core]): update some deps
36+
```

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Verdaccio Core
2+
3+
This monorepo contains the core packages of the Verdaccio architechture.
4+
5+
## List of packages
6+
7+
## Contributing
8+
9+
Please, refer to our [CONTRIBUTING](CONTRIBUTING.md) to learn how to contribute.
10+
11+
## License
12+
13+
Verdaccio core is a open source project with [MIT license](LICENSE)

lerna.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.0.0",
3+
"packages": [
4+
"packages/*"
5+
],
6+
"npmClient": "yarn",
7+
"useWorkspaces": true,
8+
"command": {
9+
"publish": {
10+
"message": "chore(release): publish %s"
11+
}
12+
}
13+
}

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"private": true,
3+
"workspaces": ["packages/*"],
4+
"author": "Sergio Herrera <sergio@sergiohgz.eu>",
5+
"license": "MIT",
6+
"scripts": {
7+
"bootstrap": "lerna bootstrap",
8+
"commitmsg": "commitlint -e $GIT_PARAMS",
9+
"publish": "lerna publish --amend",
10+
"version": "lerna publish --conventional-commits --skip-npm"
11+
},
12+
"devDependencies": {
13+
"@commitlint/cli": "7.0.0",
14+
"@commitlint/config-conventional": "7.0.1",
15+
"lerna": "^3.0.0-rc.0"
16+
},
17+
"commitlint": {
18+
"extends": [
19+
"@commitlint/config-conventional"
20+
]
21+
}
22+
}

packages/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)