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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Checklist before requesting a review

- [ ] I have formatted the subject to include ticket number as `[#123] Verb in past tense with dot at the end.`
- [ ] I have added a link to the issue tracker
- [ ] I have provided information in `Changed` section about WHY something was done if this was not a normal implementation
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have run new and existing relevant tests locally with my changes, and they passed
- [ ] I have provided screenshots, where applicable

## Changed

1.

## Screenshots
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Linting

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

jobs:
lint:
name: ESLint
runs-on: ubuntu-latest

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

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

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint:report || true

- name: Upload ESLint report
if: always()
uses: actions/upload-artifact@v4
with:
name: eslint-report
path: eslint-report.json
retention-days: 5
if-no-files-found: ignore
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ jspm_packages/
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.local
**/.claude/settings.local.json
33 changes: 33 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build Commands
- `npm start` - Runs the application

## Code Style Guidelines
- **Imports**: ES Modules with explicit .js extensions. Node modules first, third-party next, local last.
- **Formatting**: 2-space indentation, single quotes, semicolons, consistent spacing.
- **Functions**: Use async/await pattern, descriptive names, and proper error handling.
- **Naming**: camelCase for variables/functions, PascalCase for constructors, ALL_CAPS for constants.
- **Error Handling**: Use try/catch with specific error messages, log errors with logger.js.
- **Logging**: Use the custom logger module for consistent logging patterns.

## Project Structure
- Main entry: index.js
- Core functionality in src/ directory
- Modular design with focused files for specific features

## Libraries
- Commander.js for CLI
- Inquirer.js for interactive prompts
- Chalk for terminal styling
- Ora for loading spinners


## Development workflow

- Checkout Github issues for outstanding issues
- Implement each issue in a feature branch based on main
- Create a pull request with changes using the PR template located in `.github/PULL_REQUEST_TEMPLATE.md`
- Add tests as required to prove the work
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A Node.js CLI wrapper for the Lagoon CLI that provides an interactive interface
- Node.js (v14 or higher)
- Lagoon CLI installed and configured
- A valid `.lagoon.yml` file in your home directory
- SSH key(s) in your ~/.ssh directory for Lagoon authentication

## Installation

Expand All @@ -23,6 +24,12 @@ npm install
npm link
```

## Commands

- `npm start` - Run the CLI without global installation
- `lagoon-wrapper` - Run the CLI if globally installed
- `lagoon-wrapper interactive` - Explicitly start in interactive mode

## Usage

Simply run the command:
Expand Down
100 changes: 100 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import js from '@eslint/js';
import globals from 'globals';
import nodejs from 'eslint-plugin-n';

export default [
// Base configurations
js.configs.recommended,
nodejs.configs['flat/recommended'],

// Global variables
{
languageOptions: {
globals: {
...globals.node,
...globals.jest
},
ecmaVersion: 2022,
sourceType: 'module',
}
},

// File patterns and ignored files
{
ignores: [
'node_modules/',
'coverage/',
'.github/',
'dist/',
'build/',
'**/*.min.js',
'jest.config.mjs'
]
},

// Rules configuration
{
rules: {
// Disable specific rules for this project
'no-undef': 'off', // Disable undefined variable checks (we have variables from outer scopes)
// Error prevention
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'no-console': 'off',
'no-constant-condition': 'warn',
'no-debugger': 'error',
'no-duplicate-case': 'error',
'no-empty': 'warn',
'no-extra-boolean-cast': 'warn',
'no-fallthrough': 'warn',
'no-irregular-whitespace': 'warn',
'no-prototype-builtins': 'warn',
'no-return-await': 'warn',
'no-var': 'error',
'prefer-const': 'warn',

// Style
'camelcase': ['warn', { properties: 'never' }],
'semi': ['error', 'always'],
'indent': ['warn', 2, { SwitchCase: 1 }],
'quotes': ['warn', 'single', { allowTemplateLiterals: true, avoidEscape: true }],
'arrow-spacing': ['warn', { before: true, after: true }],
'block-spacing': ['warn', 'always'],
'brace-style': ['warn', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['warn', 'only-multiline'],
'comma-spacing': ['warn', { before: false, after: true }],
'comma-style': ['warn', 'last'],
'eol-last': ['warn', 'always'],
'func-call-spacing': ['warn', 'never'],
'key-spacing': ['warn', { beforeColon: false, afterColon: true }],
'keyword-spacing': ['warn', { before: true, after: true }],
'linebreak-style': ['error', 'unix'],
'max-len': ['warn', { code: 120, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true }],
'no-multiple-empty-lines': ['warn', { max: 2, maxEOF: 1 }],
'no-trailing-spaces': 'warn',
'object-curly-spacing': ['warn', 'always'],
'padded-blocks': ['warn', 'never'],
'space-before-blocks': ['warn', 'always'],
'space-before-function-paren': ['warn', { anonymous: 'always', named: 'never', asyncArrow: 'always' }],
'space-in-parens': ['warn', 'never'],
'space-infix-ops': 'warn',

// Node.js specific
'n/exports-style': ['error', 'module.exports'],
'n/file-extension-in-import': ['error', 'always', { '.js': 'never', '.mjs': 'always' }],
'n/prefer-global/buffer': ['error', 'always'],
'n/prefer-global/console': ['error', 'always'],
'n/prefer-global/process': ['error', 'always'],
'n/prefer-global/url-search-params': ['error', 'always'],
'n/prefer-global/url': ['error', 'always'],
'n/prefer-promises/dns': 'error',
'n/prefer-promises/fs': 'error',
'n/no-deprecated-api': 'warn',
'n/no-unpublished-require': 'off',
'n/no-missing-import': 'off',
'n/no-unpublished-import': 'off',
'n/no-unsupported-features/es-syntax': 'off',
// Allow process.exit() in CLI applications
'n/no-process-exit': 'off'
}
}
];
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node

import { program } from 'commander';
import { startInteractiveMode } from './src/interactive.js';
import { startInteractiveMode } from './src/interactive';

program
.name('lagoon-wrapper')
Expand All @@ -18,4 +17,4 @@ if (process.argv.length === 2) {
startInteractiveMode();
} else {
program.parse(process.argv);
}
}
Loading