@codyswann/lisa 1.0.0 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -36
- package/all/copy-overwrite/.claude/README.md +1 -3
- package/all/copy-overwrite/.claude/REFERENCE.md +519 -0
- package/all/copy-overwrite/.claude/agents/skill-evaluator.md +7 -7
- package/all/copy-overwrite/.claude/agents/test-coverage-agent.md +17 -0
- package/all/copy-overwrite/.claude/commands/git/commit.md +9 -5
- package/all/copy-overwrite/.claude/commands/git/submit-pr.md +1 -1
- package/all/copy-overwrite/.claude/commands/lisa/review-implementation.md +209 -0
- package/all/copy-overwrite/.claude/commands/project/add-test-coverage.md +58 -0
- package/all/copy-overwrite/.claude/commands/project/archive.md +1 -1
- package/all/copy-overwrite/.claude/commands/project/complete-task.md +53 -1
- package/all/copy-overwrite/.claude/commands/project/debrief.md +12 -23
- package/all/copy-overwrite/.claude/commands/project/execute.md +33 -77
- package/all/copy-overwrite/.claude/commands/project/fix-linter-error.md +87 -0
- package/all/copy-overwrite/.claude/commands/project/implement.md +24 -28
- package/all/copy-overwrite/.claude/commands/project/lower-code-complexity.md +30 -55
- package/all/copy-overwrite/.claude/commands/project/plan.md +87 -242
- package/all/copy-overwrite/.claude/commands/project/reduce-max-lines-per-function.md +76 -0
- package/all/copy-overwrite/.claude/commands/project/reduce-max-lines.md +75 -0
- package/all/copy-overwrite/.claude/commands/project/research.md +86 -188
- package/all/copy-overwrite/.claude/commands/project/review.md +19 -38
- package/all/copy-overwrite/.claude/commands/project/setup.md +1 -1
- package/all/copy-overwrite/.claude/commands/project/verify.md +62 -25
- package/all/copy-overwrite/.claude/commands/pull-request/review.md +25 -7
- package/all/copy-overwrite/.claude/commands/tasks/load.md +63 -0
- package/all/copy-overwrite/.claude/commands/tasks/sync.md +84 -0
- package/all/copy-overwrite/.claude/hooks/README.md +75 -0
- package/all/copy-overwrite/.claude/hooks/check-tired-boss.sh +61 -0
- package/all/copy-overwrite/.claude/hooks/debug-hook.sh +47 -0
- package/all/copy-overwrite/.claude/hooks/notify-ntfy.sh +2 -0
- package/all/copy-overwrite/.claude/hooks/sync-tasks.sh +95 -0
- package/all/copy-overwrite/.claude/{skills/coding-philosophy/SKILL.md → rules/coding-philosophy.md} +93 -70
- package/all/copy-overwrite/.claude/settings.json +35 -14
- package/all/copy-overwrite/.claude/skills/prompt-complexity-scorer/SKILL.md +41 -9
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/init_skill.py +2 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/package_skill.py +2 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/quick_validate.py +2 -0
- package/all/copy-overwrite/.safety-net.json +25 -0
- package/all/copy-overwrite/CLAUDE.md +8 -30
- package/all/copy-overwrite/HUMAN.md +517 -17
- package/all/create-only/.claude/rules/PROJECT_RULES.md +9 -0
- package/all/create-only/scripts/setup-deploy-key.sh +190 -0
- package/all/deletions.json +5 -0
- package/cdk/copy-overwrite/.github/workflows/ci.yml +142 -0
- package/cdk/copy-overwrite/.github/workflows/deploy.yml +59 -0
- package/cdk/copy-overwrite/eslint.cdk.ts +175 -0
- package/cdk/copy-overwrite/eslint.config.ts +51 -0
- package/cdk/copy-overwrite/eslint.slow.config.ts +80 -0
- package/cdk/copy-overwrite/knip.json +53 -0
- package/cdk/copy-overwrite/tsconfig.eslint.json +11 -0
- package/cdk/merge/package.json +17 -1
- package/dist/cli/index.d.ts +3 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +83 -64
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/prompts.d.ts +17 -3
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +52 -16
- package/dist/cli/prompts.js.map +1 -1
- package/dist/core/config.d.ts +13 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +17 -9
- package/dist/core/config.js.map +1 -1
- package/dist/core/git-service.d.ts +40 -0
- package/dist/core/git-service.d.ts.map +1 -0
- package/dist/core/git-service.js +52 -0
- package/dist/core/git-service.js.map +1 -0
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +3 -3
- package/dist/core/lisa.d.ts +124 -7
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +423 -221
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/manifest.d.ts +5 -1
- package/dist/core/manifest.d.ts.map +1 -1
- package/dist/core/manifest.js +22 -16
- package/dist/core/manifest.js.map +1 -1
- package/dist/detection/detector.interface.d.ts +1 -1
- package/dist/detection/detectors/cdk.d.ts +6 -1
- package/dist/detection/detectors/cdk.d.ts.map +1 -1
- package/dist/detection/detectors/cdk.js +16 -8
- package/dist/detection/detectors/cdk.js.map +1 -1
- package/dist/detection/detectors/expo.d.ts +6 -1
- package/dist/detection/detectors/expo.d.ts.map +1 -1
- package/dist/detection/detectors/expo.js +13 -8
- package/dist/detection/detectors/expo.js.map +1 -1
- package/dist/detection/detectors/nestjs.d.ts +7 -2
- package/dist/detection/detectors/nestjs.d.ts.map +1 -1
- package/dist/detection/detectors/nestjs.js +17 -9
- package/dist/detection/detectors/nestjs.js.map +1 -1
- package/dist/detection/detectors/npm-package.d.ts +6 -1
- package/dist/detection/detectors/npm-package.d.ts.map +1 -1
- package/dist/detection/detectors/npm-package.js +9 -4
- package/dist/detection/detectors/npm-package.js.map +1 -1
- package/dist/detection/detectors/typescript.d.ts +6 -1
- package/dist/detection/detectors/typescript.d.ts.map +1 -1
- package/dist/detection/detectors/typescript.js +12 -7
- package/dist/detection/detectors/typescript.js.map +1 -1
- package/dist/detection/index.d.ts +13 -3
- package/dist/detection/index.d.ts.map +1 -1
- package/dist/detection/index.js +17 -7
- package/dist/detection/index.js.map +1 -1
- package/dist/errors/index.d.ts +66 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +89 -17
- package/dist/errors/index.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/logging/console-logger.d.ts +21 -1
- package/dist/logging/console-logger.d.ts.map +1 -1
- package/dist/logging/console-logger.js +26 -6
- package/dist/logging/console-logger.js.map +1 -1
- package/dist/logging/index.d.ts +3 -3
- package/dist/logging/index.js +2 -2
- package/dist/logging/logger.interface.d.ts +1 -1
- package/dist/logging/silent-logger.d.ts +21 -1
- package/dist/logging/silent-logger.d.ts.map +1 -1
- package/dist/logging/silent-logger.js +20 -0
- package/dist/logging/silent-logger.js.map +1 -1
- package/dist/strategies/copy-contents.d.ts +47 -6
- package/dist/strategies/copy-contents.d.ts.map +1 -1
- package/dist/strategies/copy-contents.js +99 -49
- package/dist/strategies/copy-contents.js.map +1 -1
- package/dist/strategies/copy-overwrite.d.ts +10 -2
- package/dist/strategies/copy-overwrite.d.ts.map +1 -1
- package/dist/strategies/copy-overwrite.js +17 -9
- package/dist/strategies/copy-overwrite.js.map +1 -1
- package/dist/strategies/create-only.d.ts +10 -2
- package/dist/strategies/create-only.d.ts.map +1 -1
- package/dist/strategies/create-only.js +14 -6
- package/dist/strategies/create-only.js.map +1 -1
- package/dist/strategies/index.d.ts +17 -7
- package/dist/strategies/index.d.ts.map +1 -1
- package/dist/strategies/index.js +19 -9
- package/dist/strategies/index.js.map +1 -1
- package/dist/strategies/merge.d.ts +10 -2
- package/dist/strategies/merge.d.ts.map +1 -1
- package/dist/strategies/merge.js +21 -21
- package/dist/strategies/merge.js.map +1 -1
- package/dist/strategies/strategy.interface.d.ts +1 -1
- package/dist/strategies/strategy.interface.d.ts.map +1 -1
- package/dist/transaction/backup.d.ts +15 -1
- package/dist/transaction/backup.d.ts.map +1 -1
- package/dist/transaction/backup.js +47 -12
- package/dist/transaction/backup.js.map +1 -1
- package/dist/transaction/index.d.ts +3 -3
- package/dist/transaction/index.js +2 -2
- package/dist/transaction/transaction.d.ts +25 -2
- package/dist/transaction/transaction.d.ts.map +1 -1
- package/dist/transaction/transaction.js +25 -2
- package/dist/transaction/transaction.js.map +1 -1
- package/dist/utils/file-operations.d.ts +21 -0
- package/dist/utils/file-operations.d.ts.map +1 -1
- package/dist/utils/file-operations.js +48 -12
- package/dist/utils/file-operations.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/json-utils.d.ts +12 -0
- package/dist/utils/json-utils.d.ts.map +1 -1
- package/dist/utils/json-utils.js +17 -5
- package/dist/utils/json-utils.js.map +1 -1
- package/dist/utils/path-utils.d.ts +11 -0
- package/dist/utils/path-utils.d.ts.map +1 -1
- package/dist/utils/path-utils.js +12 -1
- package/dist/utils/path-utils.js.map +1 -1
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +5 -0
- package/eslint-plugin-code-organization/index.js +5 -0
- package/eslint-plugin-code-organization/rules/enforce-statement-order.js +5 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/scripts/validate_atomic_structure.py +2 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/create_component.py +2 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/validate_component.py +2 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/scripts/validate_cross_platform.py +2 -0
- package/expo/copy-overwrite/.claude/skills/directory-structure/scripts/validate_structure.py +2 -0
- package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/scripts/generate-route.py +2 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/scripts/validate_styling.py +2 -41
- package/{typescript → expo}/copy-overwrite/.github/workflows/build.yml +3 -0
- package/expo/copy-overwrite/.github/workflows/ci.yml +36 -0
- package/{typescript → expo}/copy-overwrite/.github/workflows/deploy.yml +22 -26
- package/{typescript → expo}/copy-overwrite/.github/workflows/lighthouse.yml +4 -1
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/plugin-index.test.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/require-memo-in-view.test.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/single-component-per-file.test.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/index.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/enforce-component-structure.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/no-return-in-view.js +6 -1
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/require-memo-in-view.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/single-component-per-file.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/README.md +0 -68
- package/expo/copy-overwrite/eslint-plugin-ui-standards/index.js +5 -3
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-classname-outside-ui.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-direct-rn-imports.js +5 -0
- package/expo/copy-overwrite/eslint.config.ts +53 -0
- package/expo/copy-overwrite/eslint.expo.ts +330 -0
- package/expo/copy-overwrite/eslint.slow.config.ts +86 -0
- package/expo/copy-overwrite/knip.json +132 -0
- package/expo/copy-overwrite/lighthouserc.js +27 -0
- package/expo/copy-overwrite/tsconfig.eslint.json +25 -0
- package/expo/create-only/lighthouserc-config.json +6 -1
- package/expo/merge/package.json +16 -3
- package/nestjs/copy-overwrite/.claude/skills/nestjs-rules/SKILL.md +1 -1
- package/{typescript → nestjs}/copy-overwrite/.github/k6/README.md +2 -2
- package/{typescript → nestjs}/copy-overwrite/.github/k6/examples/customer-deploy-integration.yml +3 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/examples/data-driven-test.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/load.js +6 -2
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/smoke.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/soak.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/spike.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/stress.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scripts/api-test.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scripts/default-test.js +5 -0
- package/nestjs/copy-overwrite/.github/workflows/ci.yml +29 -0
- package/nestjs/copy-overwrite/.github/workflows/deploy.yml +291 -0
- package/{typescript → nestjs}/copy-overwrite/.github/workflows/load-test.yml +3 -0
- package/nestjs/copy-overwrite/eslint.config.ts +53 -0
- package/nestjs/copy-overwrite/eslint.nestjs.ts +178 -0
- package/nestjs/merge/package.json +11 -3
- package/package.json +34 -40
- package/typescript/copy-contents/.husky/pre-commit +1 -1
- package/typescript/copy-contents/.husky/pre-push +99 -118
- package/typescript/copy-overwrite/.claude/hooks/format-on-edit.sh +2 -0
- package/typescript/copy-overwrite/.claude/hooks/install_pkgs.sh +3 -11
- package/typescript/copy-overwrite/.claude/hooks/lint-on-edit.sh +2 -0
- package/typescript/copy-overwrite/.claude/hooks/sg-scan-on-edit.sh +68 -0
- package/typescript/copy-overwrite/.claude/settings.json +79 -0
- package/typescript/copy-overwrite/.claude/skills/jsdoc-best-practices/SKILL.md +44 -0
- package/typescript/copy-overwrite/.github/README.md +49 -1
- package/typescript/copy-overwrite/.github/dependabot.yml +3 -0
- package/typescript/copy-overwrite/.github/workflows/ci.yml +7 -29
- package/typescript/copy-overwrite/.github/workflows/claude.yml +3 -0
- package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +6 -4
- package/typescript/copy-overwrite/.github/workflows/create-issue-on-failure.yml +176 -0
- package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +3 -1
- package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +3 -1
- package/typescript/copy-overwrite/.github/workflows/lint-slow.yml +40 -0
- package/typescript/copy-overwrite/.github/workflows/quality.yml +151 -38
- package/typescript/copy-overwrite/.github/workflows/release.yml +3 -0
- package/typescript/copy-overwrite/.gitleaksignore +3 -0
- package/typescript/copy-overwrite/.lintstagedrc.json +6 -0
- package/typescript/copy-overwrite/.prettierignore +2 -1
- package/typescript/copy-overwrite/.yamllint +2 -0
- package/typescript/copy-overwrite/ast-grep/rule-tests/.gitkeep +3 -0
- package/typescript/copy-overwrite/ast-grep/rules/.gitkeep +3 -0
- package/typescript/copy-overwrite/ast-grep/utils/.gitkeep +3 -0
- package/typescript/copy-overwrite/{commitlint.config.js → commitlint.config.cjs} +5 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +5 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/index.js +5 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/rules/enforce-statement-order.js +5 -0
- package/typescript/copy-overwrite/eslint.base.ts +430 -0
- package/typescript/copy-overwrite/eslint.config.ts +52 -0
- package/typescript/copy-overwrite/eslint.ignore.config.json +19 -2
- package/typescript/copy-overwrite/eslint.slow.config.ts +69 -0
- package/typescript/copy-overwrite/eslint.typescript.ts +142 -0
- package/typescript/copy-overwrite/knip.json +64 -0
- package/typescript/copy-overwrite/sgconfig.yml +11 -0
- package/typescript/copy-overwrite/tsconfig.eslint.json +9 -0
- package/typescript/create-only/eslint.config.local.ts +24 -0
- package/typescript/{copy-overwrite/eslint.thresholds.config.json → create-only/eslint.thresholds.json} +1 -1
- package/typescript/github-rulesets/base.json +2 -75
- package/typescript/merge/.claude/settings.json +160 -0
- package/typescript/merge/package.json +35 -34
- package/all/copy-overwrite/.claude/commands/rules/format-md.md +0 -72
- package/all/copy-overwrite/.claude/skills/coding-philosophy/references/function-structure.md +0 -416
- package/all/copy-overwrite/.claude/skills/coding-philosophy/references/immutable-patterns.md +0 -316
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-inline-styles.js +0 -73
- package/expo/copy-overwrite/eslint.config.mjs +0 -560
- package/lisa.sh +0 -35
- package/typescript/copy-overwrite/eslint.config.mjs +0 -390
- /package/{all/create-only/PROJECT_RULES.md → cdk/copy-overwrite/.github/workflows/.keep} +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/BROWSER_TESTING_NOTE.md +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/INTEGRATION_GUIDE.md +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/SCENARIO_SELECTION_GUIDE.md +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/load.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/smoke.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/soak.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/spike.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/stress.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/normal.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/relaxed.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/strict.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/workflows/k6-load-test-README.md +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Setup GitHub Deploy Key for CI/CD
|
|
4
|
+
#
|
|
5
|
+
# This script creates an SSH key pair and configures it as a deploy key
|
|
6
|
+
# with write access, enabling GitHub Actions to push to protected branches.
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# ./scripts/setup-deploy-key.sh
|
|
10
|
+
#
|
|
11
|
+
# Requirements:
|
|
12
|
+
# - ssh-keygen (usually pre-installed)
|
|
13
|
+
# - gh CLI (optional, for automatic setup)
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
|
|
18
|
+
# Colors for output
|
|
19
|
+
RED='\033[0;31m'
|
|
20
|
+
GREEN='\033[0;32m'
|
|
21
|
+
YELLOW='\033[1;33m'
|
|
22
|
+
BLUE='\033[0;34m'
|
|
23
|
+
NC='\033[0m' # No Color
|
|
24
|
+
|
|
25
|
+
print_step() {
|
|
26
|
+
echo -e "${BLUE}==>${NC} $1"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
print_success() {
|
|
30
|
+
echo -e "${GREEN}✓${NC} $1"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
print_warning() {
|
|
34
|
+
echo -e "${YELLOW}!${NC} $1"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
print_error() {
|
|
38
|
+
echo -e "${RED}✗${NC} $1"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Check if we're in a git repository
|
|
42
|
+
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
|
|
43
|
+
print_error "Not in a git repository. Please run from your project root."
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
# Get repository info
|
|
48
|
+
REPO_URL=$(git remote get-url origin 2>/dev/null || echo "")
|
|
49
|
+
if [[ -z "$REPO_URL" ]]; then
|
|
50
|
+
print_error "No git remote 'origin' found."
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
# Extract owner/repo from URL
|
|
55
|
+
if [[ "$REPO_URL" =~ github\.com[:/]([^/]+)/([^/.]+)(\.git)?$ ]]; then
|
|
56
|
+
OWNER="${BASH_REMATCH[1]}"
|
|
57
|
+
REPO="${BASH_REMATCH[2]}"
|
|
58
|
+
else
|
|
59
|
+
print_error "Could not parse GitHub repository from remote URL: $REPO_URL"
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
echo ""
|
|
64
|
+
echo "=============================================="
|
|
65
|
+
echo " GitHub Deploy Key Setup"
|
|
66
|
+
echo "=============================================="
|
|
67
|
+
echo ""
|
|
68
|
+
echo "Repository: $OWNER/$REPO"
|
|
69
|
+
echo ""
|
|
70
|
+
|
|
71
|
+
# Check for existing key
|
|
72
|
+
KEY_FILE="deploy_key"
|
|
73
|
+
if [[ -f "$KEY_FILE" ]] || [[ -f "${KEY_FILE}.pub" ]]; then
|
|
74
|
+
print_warning "Deploy key files already exist in current directory."
|
|
75
|
+
read -p "Overwrite? (y/N) " -n 1 -r
|
|
76
|
+
echo
|
|
77
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
78
|
+
echo "Aborted."
|
|
79
|
+
exit 0
|
|
80
|
+
fi
|
|
81
|
+
rm -f "$KEY_FILE" "${KEY_FILE}.pub"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# Generate SSH key
|
|
85
|
+
print_step "Generating SSH key pair..."
|
|
86
|
+
ssh-keygen -t ed25519 -C "github-actions-deploy-key-${REPO}" -f "$KEY_FILE" -N "" -q
|
|
87
|
+
print_success "Generated $KEY_FILE and ${KEY_FILE}.pub"
|
|
88
|
+
|
|
89
|
+
# Check if gh CLI is available and authenticated
|
|
90
|
+
GH_AVAILABLE=false
|
|
91
|
+
if command -v gh &>/dev/null; then
|
|
92
|
+
if gh auth status &>/dev/null; then
|
|
93
|
+
GH_AVAILABLE=true
|
|
94
|
+
fi
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
if $GH_AVAILABLE; then
|
|
98
|
+
echo ""
|
|
99
|
+
print_step "GitHub CLI detected. Attempting automatic setup..."
|
|
100
|
+
echo ""
|
|
101
|
+
|
|
102
|
+
# Add deploy key with write access
|
|
103
|
+
print_step "Adding deploy key to repository..."
|
|
104
|
+
if gh repo deploy-key add "${KEY_FILE}.pub" \
|
|
105
|
+
--repo "$OWNER/$REPO" \
|
|
106
|
+
--title "GitHub Actions Deploy Key" \
|
|
107
|
+
--allow-write 2>/dev/null; then
|
|
108
|
+
print_success "Deploy key added with write access"
|
|
109
|
+
else
|
|
110
|
+
print_warning "Could not add deploy key automatically."
|
|
111
|
+
print_warning "You may not have admin permissions, or the key already exists."
|
|
112
|
+
echo ""
|
|
113
|
+
echo "Manual step required:"
|
|
114
|
+
echo " 1. Go to: https://github.com/$OWNER/$REPO/settings/keys"
|
|
115
|
+
echo " 2. Click 'Add deploy key'"
|
|
116
|
+
echo " 3. Title: GitHub Actions Deploy Key"
|
|
117
|
+
echo " 4. Key: (contents of ${KEY_FILE}.pub)"
|
|
118
|
+
echo " 5. Check 'Allow write access'"
|
|
119
|
+
echo ""
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
# Add secret
|
|
123
|
+
print_step "Adding DEPLOY_KEY secret..."
|
|
124
|
+
if gh secret set DEPLOY_KEY --repo "$OWNER/$REPO" < "$KEY_FILE" 2>/dev/null; then
|
|
125
|
+
print_success "DEPLOY_KEY secret added"
|
|
126
|
+
else
|
|
127
|
+
print_warning "Could not add secret automatically."
|
|
128
|
+
echo ""
|
|
129
|
+
echo "Manual step required:"
|
|
130
|
+
echo " 1. Go to: https://github.com/$OWNER/$REPO/settings/secrets/actions"
|
|
131
|
+
echo " 2. Click 'New repository secret'"
|
|
132
|
+
echo " 3. Name: DEPLOY_KEY"
|
|
133
|
+
echo " 4. Value: (entire contents of $KEY_FILE file)"
|
|
134
|
+
echo ""
|
|
135
|
+
fi
|
|
136
|
+
|
|
137
|
+
else
|
|
138
|
+
echo ""
|
|
139
|
+
print_warning "GitHub CLI not found or not authenticated."
|
|
140
|
+
print_warning "Please complete setup manually:"
|
|
141
|
+
echo ""
|
|
142
|
+
echo "1. Add the PUBLIC key as a Deploy Key:"
|
|
143
|
+
echo " - Go to: https://github.com/$OWNER/$REPO/settings/keys"
|
|
144
|
+
echo " - Click 'Add deploy key'"
|
|
145
|
+
echo " - Title: GitHub Actions Deploy Key"
|
|
146
|
+
echo " - Key: (copy from below)"
|
|
147
|
+
echo " - Check 'Allow write access'"
|
|
148
|
+
echo " - Click 'Add key'"
|
|
149
|
+
echo ""
|
|
150
|
+
echo " Public key contents:"
|
|
151
|
+
echo " ─────────────────────────────────────────"
|
|
152
|
+
cat "${KEY_FILE}.pub"
|
|
153
|
+
echo " ─────────────────────────────────────────"
|
|
154
|
+
echo ""
|
|
155
|
+
echo "2. Add the PRIVATE key as a Repository Secret:"
|
|
156
|
+
echo " - Go to: https://github.com/$OWNER/$REPO/settings/secrets/actions"
|
|
157
|
+
echo " - Click 'New repository secret'"
|
|
158
|
+
echo " - Name: DEPLOY_KEY"
|
|
159
|
+
echo " - Value: (entire contents of $KEY_FILE file, including BEGIN/END lines)"
|
|
160
|
+
echo " - Click 'Add secret'"
|
|
161
|
+
echo ""
|
|
162
|
+
echo " To copy the private key:"
|
|
163
|
+
echo " cat $KEY_FILE | pbcopy # macOS"
|
|
164
|
+
echo " cat $KEY_FILE | xclip # Linux"
|
|
165
|
+
echo ""
|
|
166
|
+
fi
|
|
167
|
+
|
|
168
|
+
# Cleanup prompt
|
|
169
|
+
echo ""
|
|
170
|
+
echo "=============================================="
|
|
171
|
+
echo " Cleanup"
|
|
172
|
+
echo "=============================================="
|
|
173
|
+
echo ""
|
|
174
|
+
print_warning "The key files contain sensitive data!"
|
|
175
|
+
echo ""
|
|
176
|
+
read -p "Delete local key files now? (Y/n) " -n 1 -r
|
|
177
|
+
echo
|
|
178
|
+
if [[ ! $REPLY =~ ^[Nn]$ ]]; then
|
|
179
|
+
rm -f "$KEY_FILE" "${KEY_FILE}.pub"
|
|
180
|
+
print_success "Deleted $KEY_FILE and ${KEY_FILE}.pub"
|
|
181
|
+
else
|
|
182
|
+
print_warning "Key files kept. Remember to delete them after setup!"
|
|
183
|
+
echo " rm $KEY_FILE ${KEY_FILE}.pub"
|
|
184
|
+
fi
|
|
185
|
+
|
|
186
|
+
echo ""
|
|
187
|
+
print_success "Deploy key setup complete!"
|
|
188
|
+
echo ""
|
|
189
|
+
echo "Your GitHub Actions workflows can now push to protected branches."
|
|
190
|
+
echo ""
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
4
|
+
name: 🔍 CI Quality Checks
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
determine_environment:
|
|
12
|
+
name: 🌍 Determine Environment
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 5
|
|
15
|
+
outputs:
|
|
16
|
+
environment: ${{ steps.env.outputs.environment }}
|
|
17
|
+
cdk_env: ${{ steps.env.outputs.cdk_env }}
|
|
18
|
+
aws_account_id: ${{ steps.env.outputs.aws_account_id }}
|
|
19
|
+
role_arn: ${{ steps.env.outputs.role_arn }}
|
|
20
|
+
steps:
|
|
21
|
+
- name: 🔄 Set environment
|
|
22
|
+
id: env
|
|
23
|
+
run: |
|
|
24
|
+
# For workflow dispatch, use the input
|
|
25
|
+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
26
|
+
TARGET_ENV="${{ github.event.inputs.environment }}"
|
|
27
|
+
# For pull requests, use the target branch
|
|
28
|
+
elif [ "${{ github.event_name }}" == "pull_request" ]; then
|
|
29
|
+
TARGET_BRANCH="${{ github.base_ref }}"
|
|
30
|
+
case $TARGET_BRANCH in
|
|
31
|
+
main)
|
|
32
|
+
TARGET_ENV="production"
|
|
33
|
+
;;
|
|
34
|
+
staging)
|
|
35
|
+
TARGET_ENV="staging"
|
|
36
|
+
;;
|
|
37
|
+
dev)
|
|
38
|
+
TARGET_ENV="dev"
|
|
39
|
+
;;
|
|
40
|
+
*)
|
|
41
|
+
TARGET_ENV="dev" # Default to dev for other branches
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
else
|
|
45
|
+
TARGET_ENV="dev" # Default fallback
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo "environment=$TARGET_ENV" >> $GITHUB_OUTPUT
|
|
49
|
+
|
|
50
|
+
# Map to CDK environment name
|
|
51
|
+
case $TARGET_ENV in
|
|
52
|
+
production)
|
|
53
|
+
echo "cdk_env=production" >> $GITHUB_OUTPUT
|
|
54
|
+
echo "aws_account_id=017820663592" >> $GITHUB_OUTPUT
|
|
55
|
+
echo "role_arn=arn:aws:iam::017820663592:role/DeployServiceRole" >> $GITHUB_OUTPUT
|
|
56
|
+
;;
|
|
57
|
+
staging)
|
|
58
|
+
echo "cdk_env=staging" >> $GITHUB_OUTPUT
|
|
59
|
+
echo "aws_account_id=017820663537" >> $GITHUB_OUTPUT
|
|
60
|
+
echo "role_arn=arn:aws:iam::017820663537:role/DeployServiceRole" >> $GITHUB_OUTPUT
|
|
61
|
+
;;
|
|
62
|
+
dev|*)
|
|
63
|
+
echo "cdk_env=dev" >> $GITHUB_OUTPUT
|
|
64
|
+
echo "aws_account_id=017820663466" >> $GITHUB_OUTPUT
|
|
65
|
+
echo "role_arn=arn:aws:iam::017820663466:role/DeployServiceRole" >> $GITHUB_OUTPUT
|
|
66
|
+
;;
|
|
67
|
+
esac
|
|
68
|
+
|
|
69
|
+
cdk-checks:
|
|
70
|
+
name: 🏗️ CDK Validation
|
|
71
|
+
needs: [determine_environment]
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
timeout-minutes: 10
|
|
74
|
+
permissions:
|
|
75
|
+
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
|
|
76
|
+
contents: read
|
|
77
|
+
steps:
|
|
78
|
+
- name: 📥 Checkout
|
|
79
|
+
uses: actions/checkout@v4
|
|
80
|
+
|
|
81
|
+
- name: 🔧 Setup Node.js
|
|
82
|
+
uses: actions/setup-node@v4
|
|
83
|
+
with:
|
|
84
|
+
node-version: '22.21.1'
|
|
85
|
+
|
|
86
|
+
- name: 📦 Install dependencies
|
|
87
|
+
run: npm ci
|
|
88
|
+
|
|
89
|
+
- name: 🏗️ Build project
|
|
90
|
+
run: npm run build
|
|
91
|
+
|
|
92
|
+
- name: 🔧 Install CDK
|
|
93
|
+
run: npm install -g aws-cdk
|
|
94
|
+
|
|
95
|
+
- name: 🔑 Configure AWS credentials
|
|
96
|
+
uses: aws-actions/configure-aws-credentials@v4
|
|
97
|
+
with:
|
|
98
|
+
role-to-assume: ${{ needs.determine_environment.outputs.role_arn }}
|
|
99
|
+
role-session-name: cdk-ci-checks
|
|
100
|
+
aws-region: us-east-1
|
|
101
|
+
|
|
102
|
+
- name: 📋 CDK Synth
|
|
103
|
+
run: |
|
|
104
|
+
echo "🔍 Running CDK synth for ${{ needs.determine_environment.outputs.environment }} environment..."
|
|
105
|
+
export CDK_DEFAULT_ACCOUNT=${{ secrets.AWS_INFRA_ACCOUNT_ID }}
|
|
106
|
+
export CDK_DEFAULT_REGION=us-east-1
|
|
107
|
+
|
|
108
|
+
npx cdk synth --all \
|
|
109
|
+
--quiet
|
|
110
|
+
|
|
111
|
+
- name: 🔍 CDK Diff
|
|
112
|
+
run: |
|
|
113
|
+
echo "📊 Running CDK diff for ${{ needs.determine_environment.outputs.environment }} environment..."
|
|
114
|
+
export CDK_DEFAULT_ACCOUNT=${{ secrets.AWS_INFRA_ACCOUNT_ID }}
|
|
115
|
+
export CDK_DEFAULT_REGION=us-east-1
|
|
116
|
+
|
|
117
|
+
npx cdk diff --all \
|
|
118
|
+
|| true # Don't fail on diff, just report changes
|
|
119
|
+
|
|
120
|
+
- name: 🧪 Run Tests (including snapshots)
|
|
121
|
+
run: |
|
|
122
|
+
echo "🧪 Running unit tests with snapshot validation..."
|
|
123
|
+
npm test
|
|
124
|
+
|
|
125
|
+
quality:
|
|
126
|
+
name: 🔍 Quality Checks
|
|
127
|
+
needs: [determine_environment, cdk-checks] # Ensure CDK checks pass first
|
|
128
|
+
# Reference to the quality checks workflow
|
|
129
|
+
uses: ./.github/workflows/quality.yml
|
|
130
|
+
with:
|
|
131
|
+
node_version: '22.21.1'
|
|
132
|
+
package_manager: 'bun'
|
|
133
|
+
secrets: inherit
|
|
134
|
+
create_issue_on_failure:
|
|
135
|
+
name: 📌 Create Issue on Failure
|
|
136
|
+
needs: [determine_environment, cdk-checks, quality]
|
|
137
|
+
if: ${{ always() && (needs.cdk-checks.result == 'failure' || needs.quality.result == 'failure') && !contains(github.event.head_commit.message, '[skip ci]') }}
|
|
138
|
+
uses: ./.github/workflows/create-issue-on-failure.yml
|
|
139
|
+
with:
|
|
140
|
+
workflow_name: 'CI Quality Checks'
|
|
141
|
+
failed_job: ${{ needs.cdk-checks.result == 'failure' && 'cdk-checks' || 'quality' }}
|
|
142
|
+
secrets: inherit
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
4
|
+
name: 🚀 Release and Deploy
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
inputs:
|
|
12
|
+
environment:
|
|
13
|
+
description: 'Environment to deploy to'
|
|
14
|
+
required: true
|
|
15
|
+
default: 'main'
|
|
16
|
+
type: choice
|
|
17
|
+
options:
|
|
18
|
+
- main
|
|
19
|
+
|
|
20
|
+
# Prevent concurrent runs of the same workflow on the same ref
|
|
21
|
+
concurrency:
|
|
22
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
23
|
+
cancel-in-progress: true
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
# Environment setup
|
|
27
|
+
determine_environment:
|
|
28
|
+
name: 🌍 Determine Environment
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
timeout-minutes: 5
|
|
31
|
+
outputs:
|
|
32
|
+
environment: ${{ steps.env.outputs.environment }}
|
|
33
|
+
steps:
|
|
34
|
+
- name: 🔄 Set environment
|
|
35
|
+
id: env
|
|
36
|
+
run: |
|
|
37
|
+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
38
|
+
echo "environment=${{ github.event.inputs.environment }}" >> $GITHUB_OUTPUT
|
|
39
|
+
else
|
|
40
|
+
echo "environment=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
release:
|
|
44
|
+
name: 📦 Release
|
|
45
|
+
# Reference to the quality checks workflow
|
|
46
|
+
uses: ./.github/workflows/release.yml
|
|
47
|
+
needs: [determine_environment]
|
|
48
|
+
with:
|
|
49
|
+
environment: ${{ needs.determine_environment.outputs.environment }}
|
|
50
|
+
release_strategy: 'semantic'
|
|
51
|
+
skip_jobs: 'test:e2e,test:integration'
|
|
52
|
+
require_approval: false
|
|
53
|
+
require_signatures: false
|
|
54
|
+
generate_sbom: true
|
|
55
|
+
override_blackout: true
|
|
56
|
+
node_version: '22.21.1'
|
|
57
|
+
package_manager: 'bun'
|
|
58
|
+
secrets: inherit
|
|
59
|
+
# Trigger staging deployment after CDK trust fix
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ESLint 9 Flat Config - CDK Stack
|
|
8
|
+
*
|
|
9
|
+
* This configuration extends TypeScript config for AWS CDK projects.
|
|
10
|
+
* It adjusts rules for CDK patterns like constructs, stacks, and
|
|
11
|
+
* infrastructure-as-code conventions.
|
|
12
|
+
*
|
|
13
|
+
* Inheritance chain:
|
|
14
|
+
* eslint.cdk.ts (this file)
|
|
15
|
+
* └── eslint.typescript.ts
|
|
16
|
+
* └── eslint.base.ts
|
|
17
|
+
*
|
|
18
|
+
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new
|
|
19
|
+
* @module eslint.cdk
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// Import TypeScript config and utilities
|
|
23
|
+
import {
|
|
24
|
+
codeOrganization,
|
|
25
|
+
defaultIgnores,
|
|
26
|
+
defaultThresholds,
|
|
27
|
+
getBaseConfigs,
|
|
28
|
+
getBaseLanguageOptions,
|
|
29
|
+
getJsFilesOverride,
|
|
30
|
+
getSharedFilesOverride,
|
|
31
|
+
getSharedRules,
|
|
32
|
+
getTestFilesOverride,
|
|
33
|
+
getTsFilesOverride,
|
|
34
|
+
getTsTestFilesOverride,
|
|
35
|
+
} from "./eslint.typescript";
|
|
36
|
+
|
|
37
|
+
// Re-export for downstream configs
|
|
38
|
+
export {
|
|
39
|
+
defaultIgnores,
|
|
40
|
+
defaultThresholds,
|
|
41
|
+
getBaseConfigs,
|
|
42
|
+
getBaseLanguageOptions,
|
|
43
|
+
getSharedRules,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// CDK-specific ignores
|
|
47
|
+
const cdkIgnores = [
|
|
48
|
+
...defaultIgnores,
|
|
49
|
+
"cdk.out/**",
|
|
50
|
+
"*.js", // CDK generates JS files
|
|
51
|
+
"*.d.ts",
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Creates the CDK ESLint configuration.
|
|
56
|
+
*
|
|
57
|
+
* @param {object} options - Configuration options
|
|
58
|
+
* @param {string} options.tsconfigRootDir - Root directory for tsconfig.json
|
|
59
|
+
* @param {string[]} [options.ignorePatterns] - Patterns to ignore
|
|
60
|
+
* @param {object} [options.thresholds] - Threshold overrides
|
|
61
|
+
* @returns {Array} ESLint flat config array
|
|
62
|
+
*/
|
|
63
|
+
export function getCdkConfig({
|
|
64
|
+
tsconfigRootDir,
|
|
65
|
+
ignorePatterns = cdkIgnores,
|
|
66
|
+
thresholds = defaultThresholds,
|
|
67
|
+
}: {
|
|
68
|
+
tsconfigRootDir: string;
|
|
69
|
+
ignorePatterns?: string[];
|
|
70
|
+
thresholds?: typeof defaultThresholds;
|
|
71
|
+
}) {
|
|
72
|
+
return [
|
|
73
|
+
// Global ignores
|
|
74
|
+
{
|
|
75
|
+
ignores: ignorePatterns,
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// Base configurations from shared module
|
|
79
|
+
...getBaseConfigs(),
|
|
80
|
+
|
|
81
|
+
// Base configuration for all files
|
|
82
|
+
{
|
|
83
|
+
languageOptions: getBaseLanguageOptions(),
|
|
84
|
+
plugins: {
|
|
85
|
+
"code-organization": codeOrganization,
|
|
86
|
+
},
|
|
87
|
+
rules: {
|
|
88
|
+
// Shared rules from base
|
|
89
|
+
...getSharedRules(thresholds),
|
|
90
|
+
|
|
91
|
+
// Code organization
|
|
92
|
+
"code-organization/enforce-statement-order": "error",
|
|
93
|
+
|
|
94
|
+
// Configuration enforcement - prevent direct process.env access
|
|
95
|
+
// All configuration should go through config module
|
|
96
|
+
// @see .claude/rules/PROJECT_RULES.md
|
|
97
|
+
"no-restricted-syntax": [
|
|
98
|
+
"error",
|
|
99
|
+
{
|
|
100
|
+
selector:
|
|
101
|
+
"MemberExpression[object.name='process'][property.name='env']",
|
|
102
|
+
message:
|
|
103
|
+
"Direct process.env access is forbidden. Use config module for type-safe configuration. See .claude/rules/PROJECT_RULES.md.",
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
|
|
107
|
+
// CDK uses classes for constructs and stacks
|
|
108
|
+
"functional/no-classes": "off",
|
|
109
|
+
|
|
110
|
+
// CDK constructs and stacks require documentation
|
|
111
|
+
"jsdoc/require-jsdoc": [
|
|
112
|
+
"error",
|
|
113
|
+
{
|
|
114
|
+
require: {
|
|
115
|
+
FunctionDeclaration: true,
|
|
116
|
+
MethodDefinition: true,
|
|
117
|
+
ClassDeclaration: true,
|
|
118
|
+
ArrowFunctionExpression: false,
|
|
119
|
+
FunctionExpression: false,
|
|
120
|
+
},
|
|
121
|
+
contexts: [
|
|
122
|
+
"TSInterfaceDeclaration",
|
|
123
|
+
"TSTypeAliasDeclaration",
|
|
124
|
+
"VariableDeclaration[declarations.0.init.type='ArrowFunctionExpression']:has([id.name=/^[A-Z]/])",
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
// JavaScript files override
|
|
132
|
+
getJsFilesOverride(),
|
|
133
|
+
|
|
134
|
+
// Shared hooks and components
|
|
135
|
+
getSharedFilesOverride(),
|
|
136
|
+
|
|
137
|
+
// Test files
|
|
138
|
+
getTestFilesOverride(),
|
|
139
|
+
|
|
140
|
+
// TypeScript files - enable type-checked linting
|
|
141
|
+
getTsFilesOverride(["**/*.ts"], tsconfigRootDir),
|
|
142
|
+
|
|
143
|
+
// TypeScript test files - disable immutable-data
|
|
144
|
+
getTsTestFilesOverride(["**/*.test.ts", "**/*.spec.ts"]),
|
|
145
|
+
|
|
146
|
+
// CDK bin files - entry points can access process.env for stage selection
|
|
147
|
+
{
|
|
148
|
+
files: ["bin/**/*.ts"],
|
|
149
|
+
rules: {
|
|
150
|
+
"no-restricted-syntax": "off",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
// Configuration files - allowed to use process.env directly
|
|
155
|
+
{
|
|
156
|
+
files: ["**/*config.*", "**/config/**/*.ts"],
|
|
157
|
+
rules: {
|
|
158
|
+
"no-restricted-syntax": "off",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
// Lambda handlers - often have different constraints
|
|
163
|
+
{
|
|
164
|
+
files: [
|
|
165
|
+
"**/lambda/**/*.ts",
|
|
166
|
+
"**/lambdas/**/*.ts",
|
|
167
|
+
"**/functions/**/*.ts",
|
|
168
|
+
],
|
|
169
|
+
rules: {
|
|
170
|
+
// Lambda cold starts benefit from simpler code
|
|
171
|
+
"sonarjs/cognitive-complexity": ["error", 15],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ESLint 9 Flat Config - Main Entry Point (CDK)
|
|
8
|
+
*
|
|
9
|
+
* This file imports the CDK-specific configuration and project-local customizations.
|
|
10
|
+
* Do not modify this file directly - use eslint.config.local.ts for project-specific rules.
|
|
11
|
+
*
|
|
12
|
+
* Inheritance chain:
|
|
13
|
+
* eslint.config.ts (this file)
|
|
14
|
+
* └── eslint.cdk.ts
|
|
15
|
+
* └── eslint.typescript.ts
|
|
16
|
+
* └── eslint.base.ts
|
|
17
|
+
*
|
|
18
|
+
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new
|
|
19
|
+
* @module eslint.config
|
|
20
|
+
*/
|
|
21
|
+
import { createRequire } from "module";
|
|
22
|
+
import path from "path";
|
|
23
|
+
import { fileURLToPath } from "url";
|
|
24
|
+
|
|
25
|
+
import { defaultIgnores, defaultThresholds, getCdkConfig } from "./eslint.cdk";
|
|
26
|
+
|
|
27
|
+
// Project-specific configuration loaded from JSON files (use createRequire for compatibility)
|
|
28
|
+
const require = createRequire(import.meta.url);
|
|
29
|
+
const ignoreConfig = require("./eslint.ignore.config.json");
|
|
30
|
+
const thresholdsConfig = require("./eslint.thresholds.json");
|
|
31
|
+
|
|
32
|
+
// Project-local customizations (create-only - safe to modify)
|
|
33
|
+
import localConfig from "./eslint.config.local";
|
|
34
|
+
|
|
35
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
36
|
+
const __dirname = path.dirname(__filename);
|
|
37
|
+
|
|
38
|
+
const ignorePatterns = ignoreConfig.ignores || defaultIgnores;
|
|
39
|
+
const thresholds = { ...defaultThresholds, ...thresholdsConfig };
|
|
40
|
+
|
|
41
|
+
export default [
|
|
42
|
+
// Stack-specific configuration (CDK)
|
|
43
|
+
...getCdkConfig({
|
|
44
|
+
tsconfigRootDir: __dirname,
|
|
45
|
+
ignorePatterns,
|
|
46
|
+
thresholds,
|
|
47
|
+
}),
|
|
48
|
+
|
|
49
|
+
// Project-local customizations
|
|
50
|
+
...localConfig,
|
|
51
|
+
];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ESLint 9 Flat Config - Slow Rules Only (CDK)
|
|
8
|
+
*
|
|
9
|
+
* This configuration runs ONLY slow linting rules that are disabled in the
|
|
10
|
+
* main eslint.config.ts for performance. Run this periodically via `lint:slow`
|
|
11
|
+
* rather than on every lint pass.
|
|
12
|
+
*
|
|
13
|
+
* Rules included:
|
|
14
|
+
* - import/namespace - Type checks all namespace imports (slow)
|
|
15
|
+
* - import/no-cycle - Detects circular dependencies (very slow)
|
|
16
|
+
*
|
|
17
|
+
* @see https://github.com/import-js/eslint-plugin-import
|
|
18
|
+
* @module eslint.slow.config
|
|
19
|
+
*/
|
|
20
|
+
import { createRequire } from "module";
|
|
21
|
+
|
|
22
|
+
import importPlugin from "eslint-plugin-import";
|
|
23
|
+
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
24
|
+
import tseslint from "typescript-eslint";
|
|
25
|
+
|
|
26
|
+
// Use createRequire for JSON imports (compatible with CDK's CommonJS tsconfig)
|
|
27
|
+
const require = createRequire(import.meta.url);
|
|
28
|
+
const ignoreConfig = require("./eslint.ignore.config.json");
|
|
29
|
+
|
|
30
|
+
const ignorePatterns = ignoreConfig.ignores || [];
|
|
31
|
+
|
|
32
|
+
// Get the TypeScript flat config from the import plugin
|
|
33
|
+
const importTypescriptConfig = importPlugin.flatConfigs.typescript;
|
|
34
|
+
|
|
35
|
+
export default [
|
|
36
|
+
// Use same ignores as main config, plus ignore all non-TS files
|
|
37
|
+
// This prevents errors from inline eslint directives in JS files
|
|
38
|
+
// that reference rules not loaded in this minimal config
|
|
39
|
+
{
|
|
40
|
+
ignores: [
|
|
41
|
+
...ignorePatterns,
|
|
42
|
+
"**/*.js",
|
|
43
|
+
"**/*.mjs",
|
|
44
|
+
"**/*.cjs",
|
|
45
|
+
"**/*.jsx",
|
|
46
|
+
"cdk.out/**",
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// TypeScript files - slow import rules only
|
|
51
|
+
{
|
|
52
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
53
|
+
languageOptions: {
|
|
54
|
+
parser: tseslint.parser,
|
|
55
|
+
parserOptions: {
|
|
56
|
+
project: "tsconfig.eslint.json",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
plugins: {
|
|
60
|
+
...(importTypescriptConfig?.plugins ?? {}),
|
|
61
|
+
sonarjs: sonarjsPlugin,
|
|
62
|
+
},
|
|
63
|
+
settings: {
|
|
64
|
+
...(importTypescriptConfig?.settings ?? {}),
|
|
65
|
+
"import/resolver": {
|
|
66
|
+
...((importTypescriptConfig?.settings?.["import/resolver"] as Record<
|
|
67
|
+
string,
|
|
68
|
+
unknown
|
|
69
|
+
>) ?? {}),
|
|
70
|
+
typescript: true,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
rules: {
|
|
74
|
+
// ONLY slow rules - everything else runs in the main config
|
|
75
|
+
"import/namespace": "error",
|
|
76
|
+
"import/no-cycle": "error",
|
|
77
|
+
"sonarjs/deprecation": "error",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
];
|