Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(root): Initial project scaffolding #2

Merged
merged 25 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
05d6752
chore: lerna init
Feb 19, 2020
f623fb3
chore: typescript init
Feb 19, 2020
163a05b
chore: set yarn as npm client for lerna
Mar 12, 2020
f7baef3
chore: add dev deps typescript, jest
Mar 12, 2020
8cde185
chore: add editor config
Mar 12, 2020
5baf5fb
chore: add git ignore
Mar 12, 2020
c412301
chore: add typescript config with minimal overrides
Mar 12, 2020
85ac589
chore: add dev dep eslint typescript plugin with minimal eslint config
Mar 12, 2020
343ca82
chore: add dev dep jest eslint plugin
Mar 12, 2020
08f0a43
chore: add prettier eslint plugins, config
Mar 12, 2020
1d7b7ea
chore: add scaffolding for ruleset package
Mar 12, 2020
8a0ad5a
chore: add yarn lock file
Mar 12, 2020
df24f10
doc: Add readme with high-level outline of packages
Mar 12, 2020
5a080b8
doc: Add license, code of conduct
Mar 12, 2020
9ffae41
doc: add eslint plugin to check/fix copyright header
Mar 12, 2020
03ed0de
chore: update prettier config to sync with editorconfig
Mar 12, 2020
d3db063
build: add deps, config to lint git commits
Mar 12, 2020
4a183fa
ci(root): add ci workflow based on github actions
Mar 13, 2020
1bc9a35
build(root): add deps, config for typescript jest integration
Mar 13, 2020
303b9c2
build(root): mark generated files for github
Mar 13, 2020
f866783
build(root): add explicit public npm registry to override internal
Mar 17, 2020
3fdfb3b
doc(root): rename readme, white-space reformat, add TBD status
Mar 18, 2020
61a5d12
build(root): add ci,changelog,build npm scripts;switch to npm@12 for ci
Mar 18, 2020
f390e1a
build(root): add node engines, update version of package, set exact
Mar 18, 2020
9ca1584
docs(root): add contribution guide
Mar 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .editorConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{json,yml}]
indent_size = 2
37 changes: 37 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: [
'@typescript-eslint',
'jest',
'prettier',
'notice', // checks for and fixes copyright header in each file
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
],
rules: {
'notice/notice': [
'error',
{
templateFile: 'license-header.txt',
},
],
},
env: {
browser: true,
node: true,
},
ignorePatterns: ['node_modules', 'dist', 'coverage'],
};
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mark generated files so that github can better display diffs in PRs
# https://help.github.com/articles/customizing-how-changed-files-appear-on-github/
# https://github.com/github/linguist#using-gitattributes
# https://www.git-scm.com/docs/gitignore#_pattern_format
#
# Mark generated files
yarn.lock linguist-generated=true
# generated JS files
dist/* linguist-generated=true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.log
.DS_Store
.vscode/
.idea/
.project/
packages/**/dist/
node_modules/
coverage/
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@types:registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to set these? They should be the defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I have the internal nexus registry configured in the global .npmrc, it was resulting in refs to the internal nexus in the yarn.lock file. Hence had to override it to make sure there are no refs to internal registry - which could affect the CI among others. I guess most projects override the publish config in package.json to the public npm?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the references should point to the pubic registry rather than internal Nexus for this project. From an open source point of view I don't think there should be any references to the public registry though. I personally comment out the line pointing to Nexus in my root npmrc and only uncomment it when I need to access internal stuff.

Since it's probably a ways away from being truly open source it's probably fine to leave for now, but I think it should be removed by the time it's exposed externally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we can also switch npm registries using profiles https://docs.npmjs.com/configuring-your-registry-settings-as-an-npm-enterprise-user#create-a-profile-for-the-public-npm-registry
But then this adds a manual step to the process which could be easily forgotten.
Agree that we can revisit this later again when we are ready to make this public.

6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
tabWidth: 4,
printWidth: 120,
singleQuote: true,
trailingComma: 'es5'
};
105 changes: 105 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Salesforce Open Source Community Code of Conduct

## About the Code of Conduct

Equality is a core value at Salesforce. We believe a diverse and inclusive
community fosters innovation and creativity, and are committed to building a
culture where everyone feels included.

Salesforce open-source projects are committed to providing a friendly, safe, and
welcoming environment for all, regardless of gender identity and expression,
sexual orientation, disability, physical appearance, body size, ethnicity, nationality,
race, age, religion, level of experience, education, socioeconomic status, or
other similar personal characteristics.

The goal of this code of conduct is to specify a baseline standard of behavior so
that people with different social values and communication styles can work
together effectively, productively, and respectfully in our open source community.
It also establishes a mechanism for reporting issues and resolving conflicts.

All questions and reports of abusive, harassing, or otherwise unacceptable behavior
in a Salesforce open-source project may be reported by contacting the Salesforce
Open Source Conduct Committee at [email protected].

## 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 gender
identity and expression, sexual orientation, disability, physical appearance,
body size, ethnicity, nationality, race, age, religion, level of experience, education,
socioeconomic status, or other similar personal characteristics.

## 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 toward other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Personal attacks, insulting/derogatory comments, or trolling
* Public or private harassment
* Publishing, or threatening to publish, 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
* Advocating for or encouraging any of the above behaviors

## 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 with 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 email
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 Salesforce Open Source Conduct Committee
at [email protected]. All complaints will be reviewed and investigated
and will result in a response that is deemed necessary and appropriate to the
circumstances. The committee 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 and the Salesforce Open Source Conduct
Committee.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][contributor-covenant-home],
version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html.
It includes adaptions and additions from [Go Community Code of Conduct][golang-coc],
[CNCF Code of Conduct][cncf-coc], and [Microsoft Open Source Code of Conduct][microsoft-coc].

This Code of Conduct is licensed under the [Creative Commons Attribution 3.0 License][cc-by-3-us].

[contributor-covenant-home]: https://www.contributor-covenant.org (https://www.contributor-covenant.org/)
[golang-coc]: https://golang.org/conduct
[cncf-coc]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
[microsoft-coc]: https://opensource.microsoft.com/codeofconduct/
[cc-by-3-us]: https://creativecommons.org/licenses/by/3.0/us/
Loading