Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Sep 23, 2024
0 parents commit ea798ef
Showing 35 changed files with 147,799 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/dhoeric/features/act:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"cschleiden.vscode-github-actions",
"redhat.vscode-yaml"
]
}
}
}
76 changes: 76 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked", // Enable type checking, max strictness
"plugin:prettier/recommended" // prettier rules
],

parser: "@typescript-eslint/parser",

parserOptions: {
project: true,
tsconfigRootDir: __dirname
},

plugins: ["@typescript-eslint"],

root: true,

ignorePatterns: [
".eslintrc.js",
"*.spec.ts",
"*.test.ts",
"dist/",
"coverage/",
"lib/",
"pnpm-lock.yaml",
".pnpm-store/"
], // ESLINT IGNORE

env: {
// ESLINT ENV
node: true,
jest: true
},

rules: {
"no-else-return": ["error", { allowElseIf: false }],
"consistent-return": "error",
"no-console": "warn",
"prettier/prettier": [
"error",
{
endOfLine: "auto"
}
],
"@typescript-eslint/typedef": [
"error",
{
variableDeclaration: true,
memberVariableDeclaration: true
}
],
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "class",
format: ["PascalCase"]
}
],
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "explicit",
overrides: {
accessors: "explicit",
constructors: "no-public",
methods: "explicit",
properties: "explicit",
parameterProperties: "explicit"
}
}
]
}
};
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
69 changes: 69 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# In TypeScript actions, `dist/` is a special directory. When you reference
# an action with the `uses:` property, `dist/index.js` is the code that will be
# run. For this project, the `dist/index.js` file is transpiled from other
# source files. This workflow ensures the `dist/` directory contains the
# expected transpiled code.
#
# If this workflow is run from a feature branch, it will act as an additional CI
# check and fail if the checked-in `dist/` directory does not match what is
# expected from the build.
name: Check Transpiled JavaScript

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
check-dist:
name: Check dist/
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Install pnpm
id: setup-pnpm
uses: pnpm/action-setup@v4
with:
version: '9.9.0'

- name: Set node version
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: 'pnpm'

- name: Build dist/ Directory
id: build
run: pnpm run preflight

# This will fail the workflow if the `dist/` directory is different from
# expected.
- name: Compare Directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
exit 1
fi
# If `dist/` was different from expected, upload the expected version as a
# workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Continuous Integration

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Install pnpm
id: setup-pnpm
uses: pnpm/action-setup@v4
with:
version: '9.9.0'

- name: Set node version
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: 'pnpm'

- name: Install Dependencies
id: install
run: pnpm install

- name: Check Format
id: pnpm-format-check
run: pnpm run format:check

- name: Lint
id: pnpm-lint
run: pnpm run lint

- name: Test
id: pnpm-ci-test
run: pnpm run ci-test

test-action:
runs-on: ubuntu-latest
name: Test the action
steps:
# To use this repository's private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
id: setup-pnpm
uses: pnpm/action-setup@v4
with:
version: '9.9.0'
- name: Install dependencies and build
run: pnpm run preflight
- name: Vue Mess Detector Action
uses: ./ # Uses an action in the root directory
id: vmd
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: 'latest'
commentsEnabled: "false"
48 changes: 48 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CodeQL

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "31 7 * * 3"

permissions:
actions: read
checks: write
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language:
- TypeScript

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
75 changes: 75 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Integration Tests

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
test-vue-mess-detector:
runs-on: ubuntu-latest
strategy:
matrix:
package-manager: [ npm, yarn, pnpm, bun ]

name: Test Vue Mess Detector with ${{ matrix.package-manager }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Check PNPM
if: matrix.package-manager == 'pnpm'
uses: pnpm/action-setup@v4
with:
version: '9.9.0'

- name: Check Yarn
if: matrix.package-manager == 'yarn'
run: npm install -g yarn

- name: Check Bun
if: matrix.package-manager == 'bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.1.26'

- name: Create Vue Project
run: |
mkdir ../test-repo
cd ../test-repo
if [ "${{ matrix.package-manager }}" == "pnpm" ]; then
yes "my-package" | head -n 1 | pnpm create vue@latest . --default --typescript
pnpm install
elif [ "${{ matrix.package-manager }}" == "yarn" ]; then
yes "my-package" | head -n 1 | yarn --cwd . create vue . --default --typescript
yarn --cwd . install
elif [ "${{ matrix.package-manager }}" == "bun" ]; then
yes "my-package" | head -n 1 | bun create vue . --default --typescript --cwd=. --ignore-scripts
bun install --cwd=. --ignore-scripts
else
yes "my-package" | head -n 1 | npm create vue@latest -- . --default --typescript
npm install
fi
- name: Vue Mess Detector Action
uses: ./ # Uses an action in the root directory
id: vmd
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
packageManager: ${{ matrix.package-manager }}
entryPoint: '../test-repo'
commentsEnabled: "false"

Loading

0 comments on commit ea798ef

Please sign in to comment.