Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoKloganB authored Dec 25, 2023
0 parents commit fd3bd85
Show file tree
Hide file tree
Showing 38 changed files with 28,767 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NPM_USER=<your_lowercased_github_username>
NPM_PASS=<your_github_pat_with_packages_write_permission>
NPM_EMAIL=<your_github_email>
NPM_REGISTRY=https://npm.pkg.github.com/
NPM_SCOPE=@owner-or-organization
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotenv .env
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/.gitignore
**/coverage/
.github/
.husky/
.vscode/
dist/
locales/
node_modules/
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "no-only-tests"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"max-len": [
"error",
{
"code": 88,
"tabWidth": 2
}
],
"no-only-tests/no-only-tests": "error",
"quotes": [
"error",
"double",
{ "avoidEscape": false, "allowTemplateLiterals": true }
]
}
}
28 changes: 28 additions & 0 deletions .github/workflows/build-distribution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Callable Build Distribution Workflow

on: [workflow_call]

jobs:
distribution:
name: Build Distribution (${{ matrix.os }} - ${{ matrix.node }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["16.14"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Install Dependencies
run: npm install

- name: Create "dist/" Folder Contents
run: npm run build

- name: Create Package
run: npm pack
34 changes: 34 additions & 0 deletions .github/workflows/essential-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Callable Essential Test Workflow

on: [workflow_call]

jobs:
test:
name: Essential (${{ matrix.os }}, ${{ matrix.node }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["16.14"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Install Dependencies
run: npm install

- name: Scan Vulnerabilities
run: npm audit --production

- name: Format
run: npm run format

- name: Lint
run: npm run eslint

- name: Test Unit
run: npm run test:ci
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on: [push]

jobs:
essential-test:
name: Call Essential Test Workflow
uses: ./.github/workflows/essential-test.yml

build:
name: Call Build Distribution Workflow
needs: [essential-test]
uses: ./.github/workflows/build-distribution.yml
if: >-
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/master'
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish

on:
# Type 'published' triggers if the release is published, no matter it's draft or not.
# Type 'created' triggers when a NON-draft release is created AND published.
push:
tags:
- "v*.*.*"
release:
types: [created]

jobs:
essential-test:
name: Call Essential Test Workflow
uses: ./.github/workflows/essential-test.yml

build-publishable-distribution:
name: Publish
needs: [essential]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.14"
cache: "npm"
registry-url: https://npm.pkg.github.com/
scope: "@owner-or-organization"

- name: Install dependencies
run: npm install

- name: Build Distribution
run: npm run build

- name: Publish
run: npm publish
env:
# https://docs.github.com/en/[email protected]/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Bundle Size

on:
pull_request:
branches:
- main
- master

jobs:
check-bundle-size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Editor directories and files
.idea/
.vscode/
!.vscode/settings.json
!.vscode/launch.json
!.vscode/extensions.json

*.log
*.ntvs*
*.njsproj
*.sln
*.sw?
*.suo

# Local files
*.local
LOCAL_NOTES.md

# Local environment files
.env
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# NPM
node_modules
dist-ssr
dist

# Operating System
.DS_Store

# Tests
/tests/**/videos/
/tests/**/screenshots/
/instrumented
/coverage
.nyc_output
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
7 changes: 7 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

npx commitlint --edit
Empty file added .husky/common.sh
Empty file.
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

npx lint-staged
6 changes: 6 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

npm run test:ci
6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.{js,jsx,ts,tsx}": [
"eslint --fix --ext \"**/*.{js,jsx,ts,tsx}\"",
"prettier --write \"{*,{src,test}/**/*}.+(css|json|js|jsx|ts|tsx)\""
]
}
30 changes: 30 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
app/
src/
test/

.github/
.husky/
.env
.env.*
.envrc

.commitlintrc.json
.eslintignore
.eslintrc.json
.prettierignore
.prettierrc
.size-limit.json
mangle.json
tsconfig.json
testpkg.sh
jest.config.ts

**/*.spec.ts
**/*.test.ts
**/*.cy.ts
**/*.e2e.ts

**/*.spec.js
**/*.test.js
**/*.cy.js
**/*.e2e.js
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/.gitignore
**/coverage/
.github/
.husky/
.vscode/
dist/
locales/
node_modules/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 88,
"singleQuote": false,
"trailingComma": "none",
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
14 changes: 14 additions & 0 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"path": "dist/index.js",
"limit": "10 KB"
},
{
"path": "dist/index.umd.js",
"limit": "10 KB"
},
{
"path": "dist/index.modern.mjs",
"limit": "10 KB"
}
]
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.rulers": [88],
"editor.autoClosingQuotes": "always",
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.quickSuggestions": {
"strings": true // forces VS Code to trigger completions when editing "string"
},
"prettier.enable": true,
"prettier.configPath": ".prettierrc",
}
Loading

0 comments on commit fd3bd85

Please sign in to comment.