Skip to content

Commit

Permalink
feat: sync more oss files
Browse files Browse the repository at this point in the history
  • Loading branch information
iowillhoit committed Nov 13, 2023
1 parent d0f50c1 commit 401959e
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
105 changes: 105 additions & 0 deletions files/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/
7 changes: 7 additions & 0 deletions files/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Security

Please report any security issue to [[email protected]](mailto:[email protected])
as soon as it is discovered. This library limits its runtime dependencies in
order to reduce the total cost of ownership as much as can be, but all consumers
should remain vigilant and have their security stakeholders review all third-party
products (3PP) like this one and their dependencies.
20 changes: 20 additions & 0 deletions utils/standardize-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const PackageJson = require('./package-json');
const FILES_PATH = join(__dirname, '..', 'files');

const FILE_NAME_LICENSE = 'LICENSE.txt';
// https://github.com/salesforce/oss-template/blob/main/CODE_OF_CONDUCT.md
const FILE_NAME_CODE_OF_CONDUCT = 'CODE_OF_CONDUCT.md';
// https://github.com/salesforce/oss-template/blob/main/SECURITY.mdq
const FILE_NAME_SECURITY = 'SECURITY.md';
const FILE_NAME_GITIGNORE = 'gitignore';
const FILE_NAME_MOCHARC = 'mocharc.json';

Expand Down Expand Up @@ -92,6 +96,20 @@ function writeMocharcJson(targetDir) {
return copyFile(mocharcSourcePath, gitignoreTargetPath);
}

function writeSecurityFile(targetDir) {
const securitySourcePath = join(FILES_PATH, FILE_NAME_SECURITY);
const securityTargetPath = join(targetDir, FILE_NAME_SECURITY);

return copyFile(securitySourcePath, securityTargetPath);
}

function writeCodeOfConductFile(targetDir) {
const codeOfConductSourcePath = join(FILES_PATH, FILE_NAME_CODE_OF_CONDUCT);
const codeOfConductTargetPath = join(targetDir, FILE_NAME_CODE_OF_CONDUCT);

return copyFile(codeOfConductSourcePath, codeOfConductTargetPath);
}

function replaceInFile(filePath, replaceFn) {
const contents = readFileSync(filePath, 'utf8');
const newContents = replaceFn(contents);
Expand All @@ -110,6 +128,8 @@ module.exports = (packageRoot = require('./package-path')) => {
let removed = [];

added.push(writeLicenseFile(packageRoot));
added.push(writeSecurityFile(packageRoot));
added.push(writeCodeOfConductFile(packageRoot));
added.push(writeGitignore(packageRoot));
added.push(writeMocharcJson(packageRoot));

Expand Down

0 comments on commit 401959e

Please sign in to comment.