Skip to content

Commit

Permalink
OCLIF + TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgco committed Apr 4, 2024
1 parent e0ee7fe commit b089661
Show file tree
Hide file tree
Showing 64 changed files with 64,681 additions and 2,996 deletions.
39 changes: 0 additions & 39 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["oclif", "oclif-typescript", "prettier"],
"rules": {
"unicorn/prefer-module": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-bitwise": "off"
}
}
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

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']
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: '17 2,5,8,11 * * *'

jobs:
automerge:
uses: oclif/github-workflows/.github/workflows/automerge.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:
- version, tag and github release
- publish
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: |
{
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":bh-alert: ${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }} :bh-alert:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Repo: ${{ github.event.workflow_run.repository.html_url }}\nWorkflow name: `${{ github.event.workflow_run.name }}`\nJob url: ${{ github.event.workflow_run.html_url }}"
}
}
]
}
36 changes: 36 additions & 0 deletions .github/workflows/manualRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: manual release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@d360fad3a42feca6462f72c97c165d60a02d4bf2
# overriding some of the basic behaviors to just get the changelog
with:
git-user-name: svc-cli-bot
git-user-email: [email protected]
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
output-file: false
# always do the release, even if there are no semantic commits
skip-on-empty: false
tag-prefix: ''
- uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3
id: packageVersion
with:
path: 'package.json'
prop_path: 'version'
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
with:
tag_name: ${{ steps.packageVersion.outputs.prop }}
release_name: ${{ steps.packageVersion.outputs.prop }}
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
18 changes: 18 additions & 0 deletions .github/workflows/onPushToMain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# test
name: version, tag and github release

on:
push:
branches: [main]

jobs:
release:
uses: oclif/github-workflows/.github/workflows/githubRelease.yml@main
secrets: inherit

# most repos won't use this
# depends on previous job to avoid git collisions, not for any functionality reason
# docs:
# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main
# secrets: inherit
# needs: release
19 changes: 19 additions & 0 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: publish

on:
release:
types: [released]
# support manual release in case something goes wrong and needs to be repeated or tested
workflow_dispatch:
inputs:
tag:
description: tag that needs to publish
type: string
required: true
jobs:
npm:
uses: oclif/github-workflows/.github/workflows/npmPublish.yml@main
with:
tag: latest
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
secrets: inherit
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: tests
on:
push:
branches-ignore: [main]
workflow_dispatch:

jobs:
unit-tests:
uses: oclif/github-workflows/.github/workflows/unitTest.yml@main
143 changes: 13 additions & 130 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,13 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


.DS_Store
**/.DS_Store
*-debug.log
*-error.log
/.idea
/.nyc_output
/dist
/lib
/package-lock.json
/tmp
/yarn.lock
node_modules
oclif.lock
oclif.manifest.json
11 changes: 11 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"require": [
"ts-node/register"
],
"watch-extensions": [
"ts"
],
"recursive": true,
"reporter": "spec",
"timeout": 60000
}
Loading

0 comments on commit b089661

Please sign in to comment.