Skip to content

Commit

Permalink
Initial Check-in (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Jan 3, 2023
1 parent 916662f commit 6ba8c22
Show file tree
Hide file tree
Showing 28 changed files with 3,874 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.CRLF.txt]
end_of_line = crlf

[*.noEOL.txt]
insert_final_newline = false

[*.{yaml,yml}]
indent_size = 2

[{package*.json,lerna.json}]
indent_size = 2

[.github/integrations.json]
indent_size = 2

[*.md]
indent_size = 2
trim_trailing_whitespace = false

[config.json]
indent_size = 2

[*.tsx]
indent_size = 2
80 changes: 80 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* @type { import("eslint").Linter.Config }
*/
const config = {
root: true,
reportUnusedDisableDirectives: true,
env: {
es2020: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:promise/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: [
'**/[Ss]amples/**', // cspell:disable-line
'**/[Tt]emp/**',
'**/*.d.ts',
'**/*.map',
'**/coverage/**',
'**/dist/**',
'**/node_modules/**',
'**/.docusaurus/**',
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['import'],
overrides: [
{
files: '**/*.ts',
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
// This is caught by 'import/no-unresolved'
'node/no-missing-import': [
'off',
{
tryExtensions: ['.js', '.d.ts', '.ts'],
},
],
'node/no-unsupported-features/es-syntax': [
'error',
{
ignores: ['modules'],
},
],
},
},
{
files: ['**/*.test.ts', '**/*.spec.ts'],
},
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code

// use an array of glob patterns
project: ['packages/*/tsconfig.json', 'integration-tests/tsconfig.json'],
},
},
},
rules: {
// turn on errors for missing imports
'import/no-unresolved': 'error',
},
};

module.exports = config;
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto eol=lf
*.txt text eol=lf
*.ts text eol=lf
*.go text eol=lf
*.CRLF.txt text eol=crlf
19 changes: 19 additions & 0 deletions .github/actions/install-build-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: install_build_test
description: Install Build and Test
inputs:
node-version:
required: true
description: The version of Node to use.
runs:
using: 'composite'
steps:
- name: Setup
# Directory name only
uses: ./.github/actions/setup
with:
node-version: ${{ inputs.node-version }}
- shell: bash
run: |
pnpm i
pnpm run build
pnpm test
23 changes: 23 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: setup_node
description: Setup Node, and install Pnpm
inputs:
node-version:
required: false
description: The version of Node to use.
default: '18.x'
runs:
using: 'composite'
steps:
- name: Setup pnpm
uses: pnpm/[email protected]

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

- name: Install
run: pnpm i
shell: bash
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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:
workflow_dispatch:
push:
branches: ['main']
pull_request:
# The branches below must be a subset of the branches above
branches: ['main']
schedule:
- cron: '15 13 * * 2'

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' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# # Autobuild attempts to build any compiled languages (C/C++, C#, Go, 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@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
20 changes: 20 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Lint

on:
workflow_dispatch:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
- name: Lint
run: pnpm lint
44 changes: 44 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: release-please

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: actions/checkout@v3
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest

# cspell:ignore noreply

publish:
runs-on: ubuntu-latest
needs:
- release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
# The logic below handles the npm publication:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup

- run: |
pnpm i
pnpm build
# - run: pnpm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM}}
Loading

0 comments on commit 6ba8c22

Please sign in to comment.