Skip to content

Commit 6ba8c22

Browse files
authored
Initial Check-in (#1)
1 parent 916662f commit 6ba8c22

28 files changed

+3874
-0
lines changed

.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.CRLF.txt]
12+
end_of_line = crlf
13+
14+
[*.noEOL.txt]
15+
insert_final_newline = false
16+
17+
[*.{yaml,yml}]
18+
indent_size = 2
19+
20+
[{package*.json,lerna.json}]
21+
indent_size = 2
22+
23+
[.github/integrations.json]
24+
indent_size = 2
25+
26+
[*.md]
27+
indent_size = 2
28+
trim_trailing_whitespace = false
29+
30+
[config.json]
31+
indent_size = 2
32+
33+
[*.tsx]
34+
indent_size = 2

.eslintrc.cjs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* @type { import("eslint").Linter.Config }
3+
*/
4+
const config = {
5+
root: true,
6+
reportUnusedDisableDirectives: true,
7+
env: {
8+
es2020: true,
9+
node: true,
10+
},
11+
extends: [
12+
'eslint:recommended',
13+
'plugin:node/recommended',
14+
'plugin:import/errors',
15+
'plugin:import/warnings',
16+
'plugin:promise/recommended',
17+
'plugin:prettier/recommended',
18+
],
19+
ignorePatterns: [
20+
'**/[Ss]amples/**', // cspell:disable-line
21+
'**/[Tt]emp/**',
22+
'**/*.d.ts',
23+
'**/*.map',
24+
'**/coverage/**',
25+
'**/dist/**',
26+
'**/node_modules/**',
27+
'**/.docusaurus/**',
28+
],
29+
parserOptions: {
30+
ecmaVersion: 2020,
31+
sourceType: 'module',
32+
},
33+
plugins: ['import'],
34+
overrides: [
35+
{
36+
files: '**/*.ts',
37+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript'],
38+
parser: '@typescript-eslint/parser',
39+
plugins: ['@typescript-eslint'],
40+
rules: {
41+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
42+
// This is caught by 'import/no-unresolved'
43+
'node/no-missing-import': [
44+
'off',
45+
{
46+
tryExtensions: ['.js', '.d.ts', '.ts'],
47+
},
48+
],
49+
'node/no-unsupported-features/es-syntax': [
50+
'error',
51+
{
52+
ignores: ['modules'],
53+
},
54+
],
55+
},
56+
},
57+
{
58+
files: ['**/*.test.ts', '**/*.spec.ts'],
59+
},
60+
],
61+
settings: {
62+
'import/parsers': {
63+
'@typescript-eslint/parser': ['.ts', '.tsx'],
64+
},
65+
'import/resolver': {
66+
typescript: {
67+
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code
68+
69+
// use an array of glob patterns
70+
project: ['packages/*/tsconfig.json', 'integration-tests/tsconfig.json'],
71+
},
72+
},
73+
},
74+
rules: {
75+
// turn on errors for missing imports
76+
'import/no-unresolved': 'error',
77+
},
78+
};
79+
80+
module.exports = config;

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto eol=lf
3+
*.txt text eol=lf
4+
*.ts text eol=lf
5+
*.go text eol=lf
6+
*.CRLF.txt text eol=crlf
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: install_build_test
2+
description: Install Build and Test
3+
inputs:
4+
node-version:
5+
required: true
6+
description: The version of Node to use.
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Setup
11+
# Directory name only
12+
uses: ./.github/actions/setup
13+
with:
14+
node-version: ${{ inputs.node-version }}
15+
- shell: bash
16+
run: |
17+
pnpm i
18+
pnpm run build
19+
pnpm test

.github/actions/setup/action.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: setup_node
2+
description: Setup Node, and install Pnpm
3+
inputs:
4+
node-version:
5+
required: false
6+
description: The version of Node to use.
7+
default: '18.x'
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- name: Setup pnpm
12+
uses: pnpm/[email protected]
13+
14+
- name: Use Node.js ${{ inputs.node-version }}
15+
uses: actions/setup-node@v3
16+
with:
17+
registry-url: 'https://registry.npmjs.org'
18+
node-version: ${{ inputs.node-version }}
19+
cache: 'pnpm'
20+
21+
- name: Install
22+
run: pnpm i
23+
shell: bash

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: 'CodeQL'
13+
14+
on:
15+
workflow_dispatch:
16+
push:
17+
branches: ['main']
18+
pull_request:
19+
# The branches below must be a subset of the branches above
20+
branches: ['main']
21+
schedule:
22+
- cron: '15 13 * * 2'
23+
24+
jobs:
25+
analyze:
26+
name: Analyze
27+
runs-on: ubuntu-latest
28+
permissions:
29+
actions: read
30+
contents: read
31+
security-events: write
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: ['javascript']
37+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
38+
# Use only 'java' to analyze code written in Java, Kotlin or both
39+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v3
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v2
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
55+
# 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
56+
# queries: security-extended,security-and-quality
57+
58+
# # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59+
# # If this step fails, then you should remove it and run the build manually (see below)
60+
# - name: Autobuild
61+
# uses: github/codeql-action/autobuild@v2
62+
63+
# ℹ️ Command-line programs to run using the OS shell.
64+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65+
66+
# If the Autobuild fails above, remove it and uncomment the following three lines.
67+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68+
69+
# - run: |
70+
# echo "Run, Build Application using script"
71+
# ./location_of_script_within_repo/buildscript.sh
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v2
75+
with:
76+
category: '/language:${{matrix.language}}'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependency Review Action
2+
#
3+
# 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.
4+
#
5+
# Source repository: https://github.com/actions/dependency-review-action
6+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
7+
name: 'Dependency Review'
8+
on: [pull_request]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
dependency-review:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: 'Checkout Repository'
18+
uses: actions/checkout@v3
19+
- name: 'Dependency Review'
20+
uses: actions/dependency-review-action@v2

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# 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
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Lint
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: ['main']
10+
pull_request:
11+
branches: ['main']
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Setup
19+
uses: ./.github/actions/setup
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: Lint
23+
run: pnpm lint

.github/workflows/release-please.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release-please
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: google-github-actions/release-please-action@v3
21+
id: release
22+
with:
23+
command: manifest
24+
25+
# cspell:ignore noreply
26+
27+
publish:
28+
runs-on: ubuntu-latest
29+
needs:
30+
- release-please
31+
if: ${{ needs.release-please.outputs.release_created }}
32+
steps:
33+
# The logic below handles the npm publication:
34+
- uses: actions/checkout@v3
35+
- name: Setup
36+
uses: ./.github/actions/setup
37+
38+
- run: |
39+
pnpm i
40+
pnpm build
41+
42+
# - run: pnpm publish
43+
# env:
44+
# NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM}}

0 commit comments

Comments
 (0)