Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 39 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
# GitHub Action
# description: Lint the code
# author: Matt Norris <[email protected]>
# GitHub Action: Lint JavaScript code
#
# This workflow lints the JavaScript code in the repository.
#
# Maintainer: Matt Norris <[email protected]>
#
# Usage:
# - Lints the JavaScript code in the repository.
# - Fails the workflow if any linting issues are found.
#
# For more information on ESLint, see: https://eslint.org/
# For more information on Prettier, see: https://prettier.io/

name: Lint
name: Lint JavaScript
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'packages/javascript/**/*.js'
- 'packages/javascript/**/*.json'
- '.github/workflows/lint.yml'

jobs:
lint:
if: github.event.pull_request.user.login != 'gveappsupport'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/javascript
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/fermium
- run: npm ci
- run: npm run lint
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: packages/javascript/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint:eslint

- name: Run Prettier
run: npm run lint:prettier
30 changes: 23 additions & 7 deletions .github/workflows/scan-leaks.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# GitHub Action
# description: Scan the code for secrets, etc.
# author: Matt Norris <[email protected]>
# GitHub Action: Scan for Secrets and Sensitive Data
#
# This workflow scans the repository for secrets, credentials, and other sensitive information
# using TruffleHog OSS. It is triggered on pull requests and manual workflow dispatches.
#
# Maintainer: Matt Norris <[email protected]>
#
# Usage:
# - Ensures no sensitive data is committed to the repository.
# - Fails the workflow if any secrets or sensitive patterns are detected.
# - Uses .trufflehogignore file to exclude specific paths from scanning.
#
# For more information on TruffleHog, see: https://github.com/trufflesecurity/trufflehog

name: Scan for leaks

on: [pull_request, workflow_dispatch]

jobs:
gitleaks:
trufflehog:
if: github.event.pull_request.user.login != 'gveappsupport'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: gitleaks-action
uses: zricethezav/gitleaks-action@master
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full git history for comprehensive scanning

- name: TruffleHog Secret Scan
uses: trufflesecurity/trufflehog@main
with:
extra_args: --results=verified,unknown
45 changes: 35 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
# GitHub Action
# description: Run tests
# author: Matt Norris <[email protected]>
# GitHub Action: Test JavaScript code
#
# This workflow runs tests for the JavaScript packages in the repository.
#
# Maintainer: Matt Norris <[email protected]>
#
# Usage:
# - Runs tests for all JavaScript packages that have tests.
# - Fails the workflow if any tests fail.
#
# For more information on Jest, see: https://jestjs.io/

name: Test
name: Test JavaScript
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'packages/javascript/**/*.js'
- 'packages/javascript/**/*.json'
- '.github/workflows/test.yml'

jobs:
test:
if: github.event.pull_request.user.login != 'gveappsupport'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/javascript
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/fermium
- run: npm run lerna:ci
- run: npm test
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: packages/javascript/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
146 changes: 31 additions & 115 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,118 +1,34 @@
# Based on https://github.com/github/gitignore/blob/master/Node.gitignore

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

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variables file
.env
.env.*
.env-*
.env_*

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# Serverless directories
.serverless/

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# General
.DS_Store
__MACOSX/
.AppleDouble
.LSOverride
Icon[
]

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Backup files
*.bak

# Temporary and backup files
# Temporary files
tmp/
*.bak
*.orig
tmp[-.]*
*.tmp
tmp.*
tmp-*
tmp_*

# Configuration
local-*

# Temporary release files
.local-*
.releases
local-releases

# Service account secrets
*secret.yaml
*secret.yml
secret-*

# Private npm for publishing

## General
.npmrc
.npmrc-*

## Allow Docusaurus .npmrc
!docs/.npmrc

## Verdaccio
.local
htpasswd

# Images
*.psd

# Python
__pycache__
.ipynb_checkpoints
.venv

# Generated output, e.g., documentation
output

# Databases, e.g., sqlite
*.db

# System files
.DS_Store

# Local Netlify folder
.netlify
netlify.toml
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/fermium
lts/jod
11 changes: 11 additions & 0 deletions .trufflehogignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Exclude Git internal files
.git/

# Exclude common directories
node_modules/

# Exclude lock files (use full paths or patterns)
package-lock.json
poetry.lock
yarn.lock
pnpm-lock.yaml
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 Cisco Systems, Inc. or its Affiliates
Copyright 2025 Cisco Systems, Inc. or its Affiliates

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Makefile
# description: Build, lint, and run tasks for the essentials project
# author: Matt Norris <[email protected]>

.PHONY: help lint-javascript lint-js install-javascript install-js test-javascript test-js

# Default target - show help
help:
@echo "Available targets:"
@echo " lint-javascript (lint-js) - Lint JavaScript packages"
@echo " test-javascript (test-js) - Test JavaScript packages"
@echo " install-javascript (install-js) - Install JavaScript dependencies"
@echo " help - Show this help message"

# Lint JavaScript packages
lint-javascript: lint-js
lint-js:
@echo "Linting JavaScript packages..."
@cd packages/javascript && npm run lint

# Test JavaScript packages
test-javascript: test-js
test-js:
@echo "Testing JavaScript packages..."
@cd packages/javascript && npm test

# Install JavaScript dependencies
install-javascript: install-js
install-js:
@echo "Installing JavaScript dependencies..."
@cd packages/javascript && npm install
34 changes: 0 additions & 34 deletions Taskfile

This file was deleted.

Loading