Skip to content

Commit b0ce9b1

Browse files
committed
refactor: initial commit
1 parent 9342575 commit b0ce9b1

File tree

154 files changed

+23928
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+23928
-4
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/dist
2+
/templates
3+
/generated
4+
node_modules

.eslintrc.cjs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
**
3+
** Copyright (c) 2024, Oracle and/or its affiliates.
4+
** All rights reserved
5+
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
*/
7+
/* eslint-env node */
8+
9+
/** @type { import( './eslintrc' ).JSONSchemaForESLintConfigurationFiles } */
10+
const gEslintConfig = {
11+
extends: [
12+
'oclif',
13+
'oclif-typescript',
14+
'prettier',
15+
],
16+
plugins: [
17+
'import'
18+
],
19+
rules: {
20+
// IMPORTANT: Do not use styling rules as they may conflict with the
21+
// formatting. if in doubt, run the following command to make
22+
// sure your current config is not using any conflicting
23+
// rules `npx eslint-config-prettier <MAIN_JS_FILE>`
24+
25+
'array-bracket-spacing': [
26+
'warn',
27+
'always',
28+
{
29+
arraysInArrays: true,
30+
objectsInArrays: true,
31+
singleValue: true,
32+
}
33+
],
34+
'computed-property-spacing': [
35+
'warn',
36+
'always'
37+
],
38+
'import/extensions': [
39+
'error',
40+
{
41+
js: 'always',
42+
json: 'always'
43+
}
44+
],
45+
'indent': [
46+
'error',
47+
4
48+
],
49+
'no-console': [
50+
'error',
51+
{
52+
allow: [
53+
'table'
54+
]
55+
}
56+
],
57+
'object-curly-spacing': [
58+
'warn',
59+
'always'
60+
],
61+
'quotes': [
62+
'warn',
63+
'single'
64+
],
65+
'semi': [
66+
'warn',
67+
'always'
68+
],
69+
'space-in-parens': [
70+
'warn',
71+
'always'
72+
]
73+
}
74+
};
75+
76+
module.exports = gEslintConfig;
77+

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
7+
day: 'saturday'
8+
versioning-strategy: 'increase'
9+
labels:
10+
- 'dependencies'
11+
open-pull-requests-limit: 5
12+
pull-request-branch-name:
13+
separator: '-'
14+
commit-message:
15+
# cause a release for non-dev-deps
16+
prefix: fix(deps)
17+
# no release for dev-deps
18+
prefix-development: chore(dev-deps)
19+
ignore:
20+
- dependency-name: '@salesforce/dev-scripts'
21+
- dependency-name: '*'
22+
update-types: ['version-update:semver-major']

.github/workflows/automerge.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: automerge
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '17 2,5,8,11 * * *'
6+
7+
jobs:
8+
automerge:
9+
uses: oclif/github-workflows/.github/workflows/automerge.yml@main
10+
secrets: inherit
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: failureNotifications
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- version, tag and github release
7+
- publish
8+
types:
9+
- completed
10+
11+
jobs:
12+
failure-notify:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
15+
steps:
16+
- name: Announce Failure
17+
id: slack
18+
uses: slackapi/[email protected]
19+
env:
20+
# for non-CLI-team-owned plugins, you can send this anywhere you like
21+
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
22+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
23+
with:
24+
payload: |
25+
{
26+
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}",
27+
"blocks": [
28+
{
29+
"type": "header",
30+
"text": {
31+
"type": "plain_text",
32+
"text": ":bh-alert: ${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }} :bh-alert:"
33+
}
34+
},
35+
{
36+
"type": "section",
37+
"text": {
38+
"type": "mrkdwn",
39+
"text": "Repo: ${{ github.event.workflow_run.repository.html_url }}\nWorkflow name: `${{ github.event.workflow_run.name }}`\nJob url: ${{ github.event.workflow_run.html_url }}"
40+
}
41+
}
42+
]
43+
}

.github/workflows/manualRelease.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: manual release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
13+
- name: Conventional Changelog Action
14+
id: changelog
15+
uses: TriPSs/conventional-changelog-action@d360fad3a42feca6462f72c97c165d60a02d4bf2
16+
# overriding some of the basic behaviors to just get the changelog
17+
with:
18+
git-user-name: svc-cli-bot
19+
git-user-email: [email protected]
20+
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
21+
output-file: false
22+
# always do the release, even if there are no semantic commits
23+
skip-on-empty: false
24+
tag-prefix: ''
25+
- uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3
26+
id: packageVersion
27+
with:
28+
path: 'package.json'
29+
prop_path: 'version'
30+
- name: Create Github Release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ steps.packageVersion.outputs.prop }}
36+
release_name: ${{ steps.packageVersion.outputs.prop }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pull Request Slack Notification
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Notify Slack on PR open
12+
env:
13+
WEBHOOK_URL : ${{ secrets.CLI_TEAM_SLACK_WEBHOOK_URL }}
14+
PULL_REQUEST_AUTHOR_ICON_URL : ${{ github.event.pull_request.user.avatar_url }}
15+
PULL_REQUEST_AUTHOR_NAME : ${{ github.event.pull_request.user.login }}
16+
PULL_REQUEST_AUTHOR_PROFILE_URL: ${{ github.event.pull_request.user.html_url }}
17+
PULL_REQUEST_BASE_BRANCH_NAME : ${{ github.event.pull_request.base.ref }}
18+
PULL_REQUEST_COMPARE_BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
19+
PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }}
20+
PULL_REQUEST_REPO: ${{ github.event.pull_request.head.repo.name }}
21+
PULL_REQUEST_TITLE : ${{ github.event.pull_request.title }}
22+
PULL_REQUEST_URL : ${{ github.event.pull_request.html_url }}
23+
uses: salesforcecli/github-workflows/.github/actions/prNotification@main

.github/workflows/onPushToMain.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# test
2+
name: version, tag and github release
3+
4+
on:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
release:
10+
uses: oclif/github-workflows/.github/workflows/githubRelease.yml@main
11+
secrets: inherit
12+
13+
# most repos won't use this
14+
# depends on previous job to avoid git collisions, not for any functionality reason
15+
# docs:
16+
# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main
17+
# secrets: inherit
18+
# needs: release

.github/workflows/onRelease.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
# support manual release in case something goes wrong and needs to be repeated or tested
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: tag that needs to publish
11+
type: string
12+
required: true
13+
jobs:
14+
npm:
15+
uses: oclif/github-workflows/.github/workflows/npmPublish.yml@main
16+
with:
17+
tag: latest
18+
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
19+
secrets: inherit

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: tests
2+
on:
3+
push:
4+
branches-ignore: [main]
5+
workflow_dispatch:
6+
7+
jobs:
8+
unit-tests:
9+
uses: oclif/github-workflows/.github/workflows/unitTest.yml@main

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit "$1"

.markdownlint.jsonc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.27.0/schema/markdownlint-config-schema.json",
3+
"default": true,
4+
"MD007": {
5+
"indent": 4
6+
},
7+
"MD040": false,
8+
"MD033": {
9+
"allowed_elements": [
10+
"details",
11+
"summary",
12+
"section",
13+
"img"
14+
]
15+
}
16+
}

.mocharc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"require": [
3+
"ts-node/register"
4+
],
5+
"watch-extensions": [
6+
"ts"
7+
],
8+
"recursive": true,
9+
"reporter": "spec",
10+
"timeout": 60000,
11+
"node-option": [
12+
"loader=ts-node/esm",
13+
"experimental-specifier-resolution=node"
14+
]
15+
}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
script-shell=/bin/bash

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/hydrogen

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@oclif/prettier-config"

.shellcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
external-sources=true

.vscode/extensions.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"recommendations": [
3+
"streetsidesoftware.code-spell-checker",
4+
"dbaeumer.vscode-eslint",
5+
"yzhang.markdown-all-in-one",
6+
"davidanson.vscode-markdownlint",
7+
"forbeslindesay.forbeslindesay-taskrunner",
8+
"gruntfuggly.triggertaskonsave",
9+
"dotenv.dotenv-vscode",
10+
"gruntfuggly.todo-tree"
11+
]
12+
}

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Execute Command",
8+
"skipFiles": [
9+
"<node_internals>/**"
10+
],
11+
"program": "${workspaceFolder}/bin/dev.js",
12+
"args": [
13+
"hello",
14+
"world",
15+
],
16+
}
17+
]
18+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"npm.exclude": [
3+
"**/templates/**",
4+
"**/generated/**",
5+
],
6+
"npm.scriptExplorerExclude": [
7+
"^_",
8+
"^pre(?!pare)",
9+
"^post",
10+
"^prepare:",
11+
],
12+
"forbeslindesay-taskrunner.source": "Workspace"
13+
}

0 commit comments

Comments
 (0)