Skip to content

Commit

Permalink
chore: initial repo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Nov 1, 2024
0 parents commit 57b4700
Show file tree
Hide file tree
Showing 43 changed files with 8,567 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cjs/
10 changes: 10 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2020, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/recommended'],
root: true,
};
9 changes: 9 additions & 0 deletions .git2gus/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"productTag": "a1aB00000004Bx8IAE",
"defaultBuild": "offcore.tooling.56",
"issueTypeLabels": {
"feature": "USER STORY",
"regression": "BUG P1",
"bug": "BUG P3"
}
}
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
---

<!--
NOTICE: While GitHub is the preferred channel for reporting issues/feedback, this is not a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, please use official support channels.
-->

<!--
FOR BUGS RELATED TO THE SALEFORCE CLI, please use this repository: https://github.com/forcedotcom/cli/issues
-->

### Summary

_Short summary of what is going on or to provide context_.

### Steps To Reproduce:

1. This is step 1.
1. This is step 2. All steps should start with '1.'

### Expected result

_Describe what should have happened_.

### Actual result

_Describe what actually happened instead_.

### Additional information

_Feel free to attach a screenshot_.

**VS Code Version**:

**SFDX CLI Version**:

**OS and version**:
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature request
about: Suggest an idea for this project
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### What does this PR do?

### What issues does this PR fix or reference?
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
day: 'saturday'
versioning-strategy: 'increase'
labels:
- 'dependencies'
open-pull-requests-limit: 5
pull-request-branch-name:
separator: '-'
commit-message:
# cause a release for non-dev-deps
prefix: fix(deps)
# no release for dev-deps
prefix-development: chore(dev-deps)
ignore:
- dependency-name: '@salesforce/dev-scripts'
- dependency-name: '*'
update-types: ['version-update:semver-major']
9 changes: 9 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

daysUntilClose: 7
responseRequiredLabel: 'more information required'
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. Currently, there
is not enough information provided for us to take action. Please reply and
reopen this issue if you need additional assistance.
10 changes: 10 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: automerge
on:
workflow_dispatch:
schedule:
- cron: '42 2,5,8,11 * * *'

jobs:
automerge:
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
secrets: inherit
32 changes: 32 additions & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: create-github-release

on:
push:
branches:
- main
- prerelease/**
tags-ignore:
- "*"
workflow_dispatch:
inputs:
prerelease:
type: string
description: "Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here."

jobs:
release:
uses: salesforcecli/github-workflows/.github/workflows/create-github-release.yml@main
secrets: inherit
with:
prerelease: ${{ inputs.prerelease }}
# If this is a push event, we want to skip the release if there are no semantic commits
# However, if this is a manual release (workflow_dispatch), then we want to disable skip-on-empty
# This helps recover from forgetting to add semantic commits ('fix:', 'feat:', etc.)
skip-on-empty: ${{ github.event_name == 'push' }}
# docs:
# # Most repos won't use this
# # Depends on the 'release' job to avoid git collisions, not for any functionality reason
# needs: release
# secrets: inherit
# if: ${{ github.ref_name == 'main' }}
# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main
10 changes: 10 additions & 0 deletions .github/workflows/devScripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: devScripts
on:
workflow_dispatch:
schedule:
- cron: '50 6 * * 0'

jobs:
update:
uses: salesforcecli/github-workflows/.github/workflows/devScriptsUpdate.yml@main
secrets: inherit
43 changes: 43 additions & 0 deletions .github/workflows/failureNotifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: failureNotifications
on:
workflow_run:
workflows:
- publish
- create-github-release
types:
- completed
jobs:
failure-notify:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Announce Failure
id: slack
uses: slackapi/[email protected]
env:
# for non-CLI-team-owned plugins, you can send this anywhere you like
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
# Payload can be visually tested here: https://app.slack.com/block-kit-builder/T01GST6QY0G#%7B%22blocks%22:%5B%5D%7D
# Only copy over the "blocks" array to the Block Kit Builder
payload: |
{
"text": "Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":bh-alert: Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }} :bh-alert:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Repo:* ${{ github.event.workflow_run.repository.html_url }}\n*Workflow name:* `${{ github.event.workflow_run.name }}`\n*Job url:* ${{ github.event.workflow_run.html_url }}"
}
}
]
}
23 changes: 23 additions & 0 deletions .github/workflows/notify-slack-on-pr-open.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pull Request Slack Notification

on:
pull_request:
types: [opened, reopened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Notify Slack on PR open
env:
WEBHOOK_URL: ${{ secrets.CLI_TEAM_SLACK_WEBHOOK_URL }}
PULL_REQUEST_AUTHOR_ICON_URL: ${{ github.event.pull_request.user.avatar_url }}
PULL_REQUEST_AUTHOR_NAME: ${{ github.event.pull_request.user.login }}
PULL_REQUEST_AUTHOR_PROFILE_URL: ${{ github.event.pull_request.user.html_url }}
PULL_REQUEST_BASE_BRANCH_NAME: ${{ github.event.pull_request.base.ref }}
PULL_REQUEST_COMPARE_BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
PULL_REQUEST_REPO: ${{ github.event.pull_request.head.repo.name }}
PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }}
uses: salesforcecli/github-workflows/.github/actions/prNotification@main
33 changes: 33 additions & 0 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: publish
on:
release:
# both release and prereleases
types: [published]
# support manual release in case something goes wrong and needs to be repeated or tested
workflow_dispatch:
inputs:
tag:
description: github tag that needs to publish
type: string
required: true
jobs:
getDistTag:
outputs:
tag: ${{ steps.distTag.outputs.tag }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
id: distTag
npm:
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
needs: [getDistTag]
with:
ctc: true
sign: true
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
githubTag: ${{ github.event.release.tag_name || inputs.tag }}

secrets: inherit
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: tests
on:
push:
branches-ignore: [main]
workflow_dispatch:

jobs:
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
# Since the Windows unit tests take much longer, we run the linux unit tests first and then run the windows unit tests in parallel with NUTs
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
nuts:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/nut.yml@main
secrets: inherit
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
with:
os: ${{ matrix.os }}
11 changes: 11 additions & 0 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pr-validation

on:
pull_request:
types: [opened, reopened, edited]
# only applies to PRs that want to merge to main
branches: [main]

jobs:
pr-validation:
uses: salesforcecli/github-workflows/.github/workflows/validatePR.yml@main
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -- CLEAN
tmp/
# use yarn by default, so ignore npm
package-lock.json

# never checkin npm config
.npmrc

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

# compile source
lib

# test artifacts
*xunit.xml
*checkstyle.xml
*unitcoverage
.nyc_output
coverage
test_session*

# generated docs
docs

# ignore sfdx-trust files
*.tgz
*.sig
package.json.bak.


npm-shrinkwrap.json

# -- CLEAN ALL
*.tsbuildinfo
.eslintcache
.wireit
node_modules

# --
# put files here you don't want cleaned with sf-clean

# os specific files
.DS_Store
.idea
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint && yarn pretty-quick --staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build && yarn test
3 changes: 3 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'**/*.{js,json,md}?(x)': () => 'npm run reformat'
};
8 changes: 8 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": ["ts-node/register"],
"watch-extensions": "ts",
"recursive": true,
"reporter": "spec",
"timeout": 600000,
"node-option": ["loader=ts-node/esm"]
}
Loading

0 comments on commit 57b4700

Please sign in to comment.