Skip to content

Commit

Permalink
feat: add snapshot commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jayree committed Mar 25, 2023
0 parents commit 9bd40a4
Show file tree
Hide file tree
Showing 58 changed files with 10,100 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": { "header-max-length": [2, "always", 100] }
}
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
28 changes: 28 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2022, jayree
* 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
*/

{
"plugins": ["eslint-plugin-header"],
"extends": ["eslint-config-salesforce-typescript", "eslint-config-prettier", "plugin:sf-plugin/recommended"],
"rules": {
"header/header": [
2,
"block",
[
"",
{
"pattern": " \\* Copyright \\(c\\) \\d{4}, jayree",
"template": " * Copyright (c) 2022, jayree"
},
" * 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",
" "
]
]
}
}
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
labels:
- 'dependencies'
open-pull-requests-limit: 100
pull-request-branch-name:
separator: '-'
commit-message:
prefix: 'fix'
prefix-development: 'chore'
include: 'scope'
allow:
- dependency-type: 'production'
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '35 20 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-and-release
on:
workflow_dispatch:
jobs:
release:
name: test-and-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install dependencies
run: yarn
- name: Building
run: yarn build
- name: Testing
run: yarn test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install -global semantic-release https://github.com/jayree/semantic-release/raw/master/oclif-semantic-release-v3.1.5.tgz
semantic-release -e @oclif/semantic-release
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: build-and-test
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
jobs:
test:
name: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install dependencies
run: yarn
- name: Building
run: yarn build
- name: Testing
run: yarn test
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -- CLEAN

# use yarn by default, so ignore npm
package-lock.json

# never checkin npm config
.npmrc

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

# compile source
# lib

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

# generated docs
docs

# -- CLEAN ALL
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
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,source-map-support/register",
"watch-extensions": "ts",
"recursive": true,
"reporter": "spec",
"timeout": 5000,
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"]
}
5 changes: 5 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"nyc": {
"extends": "@salesforce/dev-config/nyc"
}
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib
*.md
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@salesforce/prettier-config"
3 changes: 3 additions & 0 deletions .sfdevrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"exclude-scripts": ["docs"]
}
48 changes: 48 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "127.0.0.1",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
},
{
"name": "Run All Tests",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "test/**/*.test.ts"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile"
},
{
"type": "node",
"request": "launch",
"name": "Run Current Test",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "${file}"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile"
}
]
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"search.exclude": {
"**/lib": true,
"**/bin": true
}
}
57 changes: 57 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"version": "2.0.0",
"problemMatcher": "$tsc-watch",
"tasks": [
{
"label": "Compile",
"group": {
"kind": "build",
"isDefault": true
},
"command": "yarn",
"type": "shell",
"presentation": {
"focus": false,
"panel": "dedicated"
},
"args": ["run", "prepack"],
"isBackground": false,
"problemMatcher": {
"owner": "typescript",
"fileLocation": "relative",
"pattern": {
"regexp": "^(.*\\.ts):(\\d*):(\\d*)(\\s*-\\s*)(error|warning|info)\\s*(TS\\d*):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 5,
"code": 6,
"message": 7
}
}
},
{
"label": "Lint",
"command": "yarn",
"type": "shell",
"presentation": {
"focus": false,
"panel": "dedicated"
},
"args": ["run", "lint"],
"isBackground": false,
"problemMatcher": {
"owner": "typescript",
"fileLocation": "relative",
"pattern": {
"regexp": "^(ERROR|WARNING|INFO):\\s*(.*\\.ts):(\\d*):(\\d*)(\\s*-\\s*)(.*)$",
"file": 2,
"line": 3,
"column": 4,
"severity": 1,
"message": 6
}
}
}
]
}
Loading

0 comments on commit 9bd40a4

Please sign in to comment.