@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
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import * as fse from
|
|
2
|
-
import { stat, readFile, readdir } from
|
|
1
|
+
import * as fse from "fs-extra";
|
|
2
|
+
import { stat, readFile, readdir } from "node:fs/promises";
|
|
3
3
|
/**
|
|
4
4
|
* Check if two files have identical content
|
|
5
|
+
* @param path1 First file path
|
|
6
|
+
* @param path2 Second file path
|
|
7
|
+
* @returns True if files have identical content
|
|
5
8
|
*/
|
|
6
9
|
export async function filesIdentical(path1, path2) {
|
|
7
10
|
try {
|
|
8
|
-
const [content1, content2] = await Promise.all([
|
|
11
|
+
const [content1, content2] = await Promise.all([
|
|
12
|
+
readFile(path1),
|
|
13
|
+
readFile(path2),
|
|
14
|
+
]);
|
|
9
15
|
return content1.equals(content2);
|
|
10
16
|
}
|
|
11
17
|
catch {
|
|
@@ -14,16 +20,19 @@ export async function filesIdentical(path1, path2) {
|
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
22
|
* Ensure the parent directory of a file exists
|
|
23
|
+
* @param filePath Path to ensure parent exists for
|
|
17
24
|
*/
|
|
18
25
|
export async function ensureParentDir(filePath) {
|
|
19
|
-
await fse.ensureDir(filePath.substring(0, filePath.lastIndexOf(
|
|
26
|
+
await fse.ensureDir(filePath.substring(0, filePath.lastIndexOf("/")));
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
29
|
* Read file as UTF-8 string, returning null if file doesn't exist
|
|
30
|
+
* @param filePath Path to file to read
|
|
31
|
+
* @returns File contents or null if file doesn't exist
|
|
23
32
|
*/
|
|
24
33
|
export async function readFileOrNull(filePath) {
|
|
25
34
|
try {
|
|
26
|
-
return await readFile(filePath,
|
|
35
|
+
return await readFile(filePath, "utf-8");
|
|
27
36
|
}
|
|
28
37
|
catch {
|
|
29
38
|
return null;
|
|
@@ -31,12 +40,16 @@ export async function readFileOrNull(filePath) {
|
|
|
31
40
|
}
|
|
32
41
|
/**
|
|
33
42
|
* Check if a path exists
|
|
43
|
+
* @param filePath Path to check
|
|
44
|
+
* @returns True if path exists
|
|
34
45
|
*/
|
|
35
46
|
export async function pathExists(filePath) {
|
|
36
47
|
return fse.pathExists(filePath);
|
|
37
48
|
}
|
|
38
49
|
/**
|
|
39
50
|
* Check if a path is a file
|
|
51
|
+
* @param filePath Path to check
|
|
52
|
+
* @returns True if path is a file
|
|
40
53
|
*/
|
|
41
54
|
export async function isFile(filePath) {
|
|
42
55
|
try {
|
|
@@ -49,6 +62,8 @@ export async function isFile(filePath) {
|
|
|
49
62
|
}
|
|
50
63
|
/**
|
|
51
64
|
* Check if a path is a directory
|
|
65
|
+
* @param filePath Path to check
|
|
66
|
+
* @returns True if path is a directory
|
|
52
67
|
*/
|
|
53
68
|
export async function isDirectory(filePath) {
|
|
54
69
|
try {
|
|
@@ -61,24 +76,45 @@ export async function isDirectory(filePath) {
|
|
|
61
76
|
}
|
|
62
77
|
/**
|
|
63
78
|
* List all files in a directory recursively
|
|
79
|
+
* @param dir Directory to walk
|
|
80
|
+
* @returns Array of file paths
|
|
64
81
|
*/
|
|
65
82
|
export async function listFilesRecursive(dir) {
|
|
66
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Recursively walk directory tree collecting files
|
|
85
|
+
* @param currentDir Current directory being walked
|
|
86
|
+
* @returns Array of file paths found in this directory and subdirectories
|
|
87
|
+
*/
|
|
67
88
|
async function walk(currentDir) {
|
|
68
89
|
const entries = await readdir(currentDir, { withFileTypes: true });
|
|
69
|
-
|
|
90
|
+
const results = await Promise.all(entries.map(async (entry) => {
|
|
70
91
|
const fullPath = `${currentDir}/${entry.name}`;
|
|
71
92
|
if (entry.isDirectory()) {
|
|
72
|
-
|
|
93
|
+
return walk(fullPath);
|
|
73
94
|
}
|
|
74
95
|
else if (entry.isFile()) {
|
|
75
|
-
|
|
96
|
+
return [fullPath];
|
|
76
97
|
}
|
|
77
|
-
|
|
98
|
+
return [];
|
|
99
|
+
}));
|
|
100
|
+
return results.flat();
|
|
78
101
|
}
|
|
79
102
|
if (await isDirectory(dir)) {
|
|
80
|
-
await walk(dir);
|
|
103
|
+
return [...(await walk(dir))];
|
|
81
104
|
}
|
|
82
|
-
return
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Generate timestamped backup directory name with date and time
|
|
109
|
+
* Format: <YYYY-MM-DD>-<HHmmss>
|
|
110
|
+
* Example: 2026-01-19-143056
|
|
111
|
+
* @returns Timestamped backup directory name
|
|
112
|
+
*/
|
|
113
|
+
export function generateBackupDirname() {
|
|
114
|
+
const now = new Date();
|
|
115
|
+
const date = now.toISOString().split("T")[0];
|
|
116
|
+
const time = now.toISOString().split("T")[1]?.split(".")[0]?.replace(/:/g, "") ||
|
|
117
|
+
"000000";
|
|
118
|
+
return `${date}-${time}`;
|
|
83
119
|
}
|
|
84
120
|
//# sourceMappingURL=file-operations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../src/utils/file-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../src/utils/file-operations.ts"],"names":[],"mappings":"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"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./file-operations.js";
|
|
2
|
+
export * from "./json-utils.js";
|
|
3
|
+
export * from "./path-utils.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./file-operations.js";
|
|
2
|
+
export * from "./json-utils.js";
|
|
3
|
+
export * from "./path-utils.js";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Read and parse a JSON file
|
|
3
|
+
* @param filePath Path to JSON file to read
|
|
4
|
+
* @returns Parsed JSON data
|
|
3
5
|
*/
|
|
4
6
|
export declare function readJson<T = unknown>(filePath: string): Promise<T>;
|
|
5
7
|
/**
|
|
6
8
|
* Read JSON file, returning null if file doesn't exist or is invalid
|
|
9
|
+
* @param filePath Path to JSON file to read
|
|
10
|
+
* @returns Parsed JSON data or null if file doesn't exist or is invalid
|
|
7
11
|
*/
|
|
8
12
|
export declare function readJsonOrNull<T = unknown>(filePath: string): Promise<T | null>;
|
|
9
13
|
/**
|
|
10
14
|
* Write object as JSON to a file
|
|
15
|
+
* @param filePath Path to file to write
|
|
16
|
+
* @param data Data to serialize as JSON
|
|
17
|
+
* @param spaces Number of spaces for indentation (default 2)
|
|
11
18
|
*/
|
|
12
19
|
export declare function writeJson(filePath: string, data: unknown, spaces?: number): Promise<void>;
|
|
13
20
|
/**
|
|
14
21
|
* Check if a file contains valid JSON
|
|
22
|
+
* @param filePath Path to file to check
|
|
23
|
+
* @returns True if file contains valid JSON
|
|
15
24
|
*/
|
|
16
25
|
export declare function isValidJson(filePath: string): Promise<boolean>;
|
|
17
26
|
/**
|
|
18
27
|
* Deep merge two objects (base values serve as defaults, override values take precedence)
|
|
19
28
|
* Uses lodash.merge for deep merging
|
|
29
|
+
* @param base Base object providing defaults
|
|
30
|
+
* @param override Override object with precedence
|
|
31
|
+
* @returns Merged object
|
|
20
32
|
*/
|
|
21
33
|
export declare function deepMerge<T extends object>(base: T, override: T): T;
|
|
22
34
|
//# sourceMappingURL=json-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-utils.d.ts","sourceRoot":"","sources":["../../src/utils/json-utils.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"json-utils.d.ts","sourceRoot":"","sources":["../../src/utils/json-utils.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAUxE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAMnB;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,MAAM,SAAI,GACT,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOpE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAGnE"}
|
package/dist/utils/json-utils.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { readFile, writeFile } from
|
|
2
|
-
import merge from
|
|
3
|
-
import { JsonParseError } from
|
|
1
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import merge from "lodash.merge";
|
|
3
|
+
import { JsonParseError } from "../errors/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Read and parse a JSON file
|
|
6
|
+
* @param filePath Path to JSON file to read
|
|
7
|
+
* @returns Parsed JSON data
|
|
6
8
|
*/
|
|
7
9
|
export async function readJson(filePath) {
|
|
8
10
|
try {
|
|
9
|
-
const content = await readFile(filePath,
|
|
11
|
+
const content = await readFile(filePath, "utf-8");
|
|
10
12
|
return JSON.parse(content);
|
|
11
13
|
}
|
|
12
14
|
catch (error) {
|
|
@@ -18,6 +20,8 @@ export async function readJson(filePath) {
|
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Read JSON file, returning null if file doesn't exist or is invalid
|
|
23
|
+
* @param filePath Path to JSON file to read
|
|
24
|
+
* @returns Parsed JSON data or null if file doesn't exist or is invalid
|
|
21
25
|
*/
|
|
22
26
|
export async function readJsonOrNull(filePath) {
|
|
23
27
|
try {
|
|
@@ -29,13 +33,18 @@ export async function readJsonOrNull(filePath) {
|
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
35
|
* Write object as JSON to a file
|
|
36
|
+
* @param filePath Path to file to write
|
|
37
|
+
* @param data Data to serialize as JSON
|
|
38
|
+
* @param spaces Number of spaces for indentation (default 2)
|
|
32
39
|
*/
|
|
33
40
|
export async function writeJson(filePath, data, spaces = 2) {
|
|
34
41
|
const content = JSON.stringify(data, null, spaces);
|
|
35
|
-
await writeFile(filePath, content
|
|
42
|
+
await writeFile(filePath, `${content}\n`, "utf-8");
|
|
36
43
|
}
|
|
37
44
|
/**
|
|
38
45
|
* Check if a file contains valid JSON
|
|
46
|
+
* @param filePath Path to file to check
|
|
47
|
+
* @returns True if file contains valid JSON
|
|
39
48
|
*/
|
|
40
49
|
export async function isValidJson(filePath) {
|
|
41
50
|
try {
|
|
@@ -49,6 +58,9 @@ export async function isValidJson(filePath) {
|
|
|
49
58
|
/**
|
|
50
59
|
* Deep merge two objects (base values serve as defaults, override values take precedence)
|
|
51
60
|
* Uses lodash.merge for deep merging
|
|
61
|
+
* @param base Base object providing defaults
|
|
62
|
+
* @param override Override object with precedence
|
|
63
|
+
* @returns Merged object
|
|
52
64
|
*/
|
|
53
65
|
export function deepMerge(base, override) {
|
|
54
66
|
// Create a new object to avoid mutating inputs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-utils.js","sourceRoot":"","sources":["../../src/utils/json-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"json-utils.js","sourceRoot":"","sources":["../../src/utils/json-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAc,QAAgB;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAM,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC5C,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAgB;IAEhB,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAI,QAAQ,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,QAAgB,EAChB,IAAa,EACb,MAAM,GAAG,CAAC;IAEV,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,SAAS,CAAC,QAAQ,EAAE,GAAG,OAAO,IAAI,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAmB,IAAO,EAAE,QAAW;IAC9D,+CAA+C;IAC/C,OAAO,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAM,CAAC;AACxC,CAAC"}
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolve a path to an absolute path
|
|
3
|
+
* @param inputPath Path to resolve
|
|
4
|
+
* @returns Absolute path
|
|
3
5
|
*/
|
|
4
6
|
export declare function toAbsolutePath(inputPath: string): string;
|
|
5
7
|
/**
|
|
6
8
|
* Get the relative path from base to target
|
|
9
|
+
* @param basePath Base path
|
|
10
|
+
* @param targetPath Target path
|
|
11
|
+
* @returns Relative path from base to target
|
|
7
12
|
*/
|
|
8
13
|
export declare function getRelativePath(basePath: string, targetPath: string): string;
|
|
9
14
|
/**
|
|
10
15
|
* Join path segments
|
|
16
|
+
* @param segments Path segments to join
|
|
17
|
+
* @returns Joined path
|
|
11
18
|
*/
|
|
12
19
|
export declare function joinPaths(...segments: string[]): string;
|
|
13
20
|
/**
|
|
14
21
|
* Get the directory name of a path
|
|
22
|
+
* @param filePath Path to get directory name from
|
|
23
|
+
* @returns Directory name
|
|
15
24
|
*/
|
|
16
25
|
export declare function getDirname(filePath: string): string;
|
|
17
26
|
/**
|
|
18
27
|
* Get the base name of a path
|
|
28
|
+
* @param filePath Path to get base name from
|
|
29
|
+
* @returns Base name
|
|
19
30
|
*/
|
|
20
31
|
export declare function getBasename(filePath: string): string;
|
|
21
32
|
//# sourceMappingURL=path-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
package/dist/utils/path-utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import * as path from
|
|
1
|
+
import * as path from "node:path";
|
|
2
2
|
/**
|
|
3
3
|
* Resolve a path to an absolute path
|
|
4
|
+
* @param inputPath Path to resolve
|
|
5
|
+
* @returns Absolute path
|
|
4
6
|
*/
|
|
5
7
|
export function toAbsolutePath(inputPath) {
|
|
6
8
|
if (path.isAbsolute(inputPath)) {
|
|
@@ -10,24 +12,33 @@ export function toAbsolutePath(inputPath) {
|
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Get the relative path from base to target
|
|
15
|
+
* @param basePath Base path
|
|
16
|
+
* @param targetPath Target path
|
|
17
|
+
* @returns Relative path from base to target
|
|
13
18
|
*/
|
|
14
19
|
export function getRelativePath(basePath, targetPath) {
|
|
15
20
|
return path.relative(basePath, targetPath);
|
|
16
21
|
}
|
|
17
22
|
/**
|
|
18
23
|
* Join path segments
|
|
24
|
+
* @param segments Path segments to join
|
|
25
|
+
* @returns Joined path
|
|
19
26
|
*/
|
|
20
27
|
export function joinPaths(...segments) {
|
|
21
28
|
return path.join(...segments);
|
|
22
29
|
}
|
|
23
30
|
/**
|
|
24
31
|
* Get the directory name of a path
|
|
32
|
+
* @param filePath Path to get directory name from
|
|
33
|
+
* @returns Directory name
|
|
25
34
|
*/
|
|
26
35
|
export function getDirname(filePath) {
|
|
27
36
|
return path.dirname(filePath);
|
|
28
37
|
}
|
|
29
38
|
/**
|
|
30
39
|
* Get the base name of a path
|
|
40
|
+
* @param filePath Path to get base name from
|
|
41
|
+
* @returns Base name
|
|
31
42
|
*/
|
|
32
43
|
export function getBasename(filePath) {
|
|
33
44
|
return path.basename(filePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,UAAkB;IAClE,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAG,QAAkB;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/* eslint-disable max-lines -- comprehensive test coverage requires extensive test cases */
|
|
2
7
|
/**
|
|
3
8
|
* Tests for enforce-statement-order ESLint rule
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# This file is managed by Lisa.
|
|
3
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
2
4
|
"""
|
|
3
5
|
Validates Gluestack UI v3 and NativeWind v4 styling patterns.
|
|
4
6
|
|
|
@@ -84,17 +86,6 @@ VALID_SPACING_VALUES = {
|
|
|
84
86
|
"36", "40", "44", "48", "52", "56", "60", "64", "72", "80", "96"
|
|
85
87
|
}
|
|
86
88
|
|
|
87
|
-
# Inline style patterns that could be className
|
|
88
|
-
INLINE_STYLE_PATTERNS = [
|
|
89
|
-
r'style=\{\{[^}]*backgroundColor\s*:',
|
|
90
|
-
r'style=\{\{[^}]*color\s*:',
|
|
91
|
-
r'style=\{\{[^}]*padding\s*:',
|
|
92
|
-
r'style=\{\{[^}]*margin\s*:',
|
|
93
|
-
r'style=\{\{[^}]*borderRadius\s*:',
|
|
94
|
-
r'style=\{\{[^}]*borderColor\s*:',
|
|
95
|
-
r'style=\{\{[^}]*borderWidth\s*:',
|
|
96
|
-
]
|
|
97
|
-
|
|
98
89
|
# Exceptions - files/patterns to skip
|
|
99
90
|
SKIP_PATTERNS = [
|
|
100
91
|
r'node_modules',
|
|
@@ -195,35 +186,6 @@ def check_arbitrary_values(content: str, file_path: str) -> list[Violation]:
|
|
|
195
186
|
return violations
|
|
196
187
|
|
|
197
188
|
|
|
198
|
-
def check_inline_styles(content: str, file_path: str) -> list[Violation]:
|
|
199
|
-
"""Check for inline styles that could be className."""
|
|
200
|
-
violations = []
|
|
201
|
-
lines = content.split('\n')
|
|
202
|
-
|
|
203
|
-
for i, line in enumerate(lines, 1):
|
|
204
|
-
# Skip comments
|
|
205
|
-
if line.strip().startswith('//') or line.strip().startswith('*'):
|
|
206
|
-
continue
|
|
207
|
-
|
|
208
|
-
for pattern in INLINE_STYLE_PATTERNS:
|
|
209
|
-
if re.search(pattern, line):
|
|
210
|
-
# Check for exceptions (dynamic values, animations)
|
|
211
|
-
if 'bottomInset' in line or 'Animated' in line or 'animatedValue' in line:
|
|
212
|
-
continue
|
|
213
|
-
if 'Platform.select' in line or 'Platform.OS' in line:
|
|
214
|
-
continue
|
|
215
|
-
|
|
216
|
-
violations.append(Violation(
|
|
217
|
-
file=file_path,
|
|
218
|
-
line=i,
|
|
219
|
-
rule="no-inline-styles",
|
|
220
|
-
message="Prefer className over inline style for static styling",
|
|
221
|
-
severity="warning",
|
|
222
|
-
))
|
|
223
|
-
|
|
224
|
-
return violations
|
|
225
|
-
|
|
226
|
-
|
|
227
189
|
def check_non_scale_spacing(content: str, file_path: str) -> list[Violation]:
|
|
228
190
|
"""Check for spacing values not in the standard scale."""
|
|
229
191
|
violations = []
|
|
@@ -270,7 +232,6 @@ def validate_file(file_path: str) -> list[Violation]:
|
|
|
270
232
|
violations.extend(check_rn_imports(content, file_path))
|
|
271
233
|
violations.extend(check_raw_colors(content, file_path))
|
|
272
234
|
violations.extend(check_arbitrary_values(content, file_path))
|
|
273
|
-
violations.extend(check_inline_styles(content, file_path))
|
|
274
235
|
violations.extend(check_non_scale_spacing(content, file_path))
|
|
275
236
|
|
|
276
237
|
return violations
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
quality:
|
|
12
|
+
name: 🔍 Quality Checks
|
|
13
|
+
# Reference to the quality checks workflow
|
|
14
|
+
uses: ./.github/workflows/quality.yml
|
|
15
|
+
with:
|
|
16
|
+
node_version: '22.21.1'
|
|
17
|
+
package_manager: 'bun'
|
|
18
|
+
skip_jobs: 'test,test:integration,test:e2e'
|
|
19
|
+
secrets: inherit
|
|
20
|
+
lighthouse:
|
|
21
|
+
name: 💡 Lighthouse CI
|
|
22
|
+
needs: [quality]
|
|
23
|
+
uses: ./.github/workflows/lighthouse.yml
|
|
24
|
+
with:
|
|
25
|
+
node_version: '22.21.1'
|
|
26
|
+
package_manager: 'bun'
|
|
27
|
+
|
|
28
|
+
create_issue_on_failure:
|
|
29
|
+
name: 📌 Create Issue on Failure
|
|
30
|
+
needs: [quality]
|
|
31
|
+
if: ${{ always() && (needs.quality.result == 'failure' || needs.quality.result == 'failure') && !contains(github.event.head_commit.message, '[skip ci]') }}
|
|
32
|
+
uses: ./.github/workflows/create-issue-on-failure.yml
|
|
33
|
+
with:
|
|
34
|
+
workflow_name: 'CI Quality Checks'
|
|
35
|
+
failed_job: ${{ needs.quality.result == 'failure' && 'quality' || 'playwright' }}
|
|
36
|
+
secrets: inherit
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
1
4
|
# This is an example deployment workflow that demonstrates the recommended pattern:
|
|
2
5
|
# 1. Call the release.yml workflow to create a release
|
|
3
6
|
# 2. Implement your custom deployment logic
|
|
@@ -172,6 +175,22 @@ jobs:
|
|
|
172
175
|
with:
|
|
173
176
|
source: ".env.${{ needs.determine_environment.outputs.environment == 'dev' && 'development' || needs.determine_environment.outputs.environment }}"
|
|
174
177
|
target: '.env.production'
|
|
178
|
+
- name: Copy amplify file (if exists)
|
|
179
|
+
run: |
|
|
180
|
+
ENV="${{ needs.determine_environment.outputs.environment }}"
|
|
181
|
+
if [ "$ENV" == "staging" ]; then
|
|
182
|
+
SOURCE_FILE="staging.aws-exports.js"
|
|
183
|
+
elif [ "$ENV" == "dev" ]; then
|
|
184
|
+
SOURCE_FILE="dev.aws-exports.js"
|
|
185
|
+
else
|
|
186
|
+
SOURCE_FILE="prod.aws-exports.js"
|
|
187
|
+
fi
|
|
188
|
+
if [ -f "$SOURCE_FILE" ]; then
|
|
189
|
+
cp "$SOURCE_FILE" aws-exports.js
|
|
190
|
+
echo "Copied $SOURCE_FILE to aws-exports.js"
|
|
191
|
+
else
|
|
192
|
+
echo "Skipping: $SOURCE_FILE does not exist"
|
|
193
|
+
fi
|
|
175
194
|
- name: Get version for deploy message
|
|
176
195
|
id: get_version
|
|
177
196
|
run: |
|
|
@@ -192,37 +211,14 @@ jobs:
|
|
|
192
211
|
|
|
193
212
|
- name: 📢 Notify on success
|
|
194
213
|
run: echo "Successfully deployed version ${{ steps.get_version.outputs.version }} to ${{ needs.determine_environment.outputs.environment }}"
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
# load_testing:
|
|
198
|
-
# name: 🔍 Load Testing
|
|
199
|
-
# needs: [determine_environment, release, deploy]
|
|
200
|
-
# if: |
|
|
201
|
-
# always() &&
|
|
202
|
-
# !cancelled() &&
|
|
203
|
-
# needs.deploy.result == 'success' &&
|
|
204
|
-
# (needs.determine_environment.outputs.environment == 'staging' || needs.determine_environment.outputs.environment == 'stage')
|
|
205
|
-
# uses: ./.github/workflows/load-test.yml
|
|
206
|
-
# with:
|
|
207
|
-
# environment: ${{ needs.determine_environment.outputs.environment }}
|
|
208
|
-
# test_scenario: 'smoke' # Start with smoke test after deployment
|
|
209
|
-
# base_url: ${{ needs.deploy.outputs.environment_url }}
|
|
210
|
-
# test_duration: '5m'
|
|
211
|
-
# virtual_users: 50
|
|
212
|
-
# fail_on_threshold: false # Don't fail the release if load test fails
|
|
213
|
-
# upload_results: true
|
|
214
|
-
# secrets: inherit
|
|
215
|
-
|
|
216
|
-
create_sentry_issue_on_failure:
|
|
217
|
-
name: 🚨 Create Sentry Issue on Failure
|
|
214
|
+
create_issue_on_failure:
|
|
215
|
+
name: 📌 Create Issue on Failure
|
|
218
216
|
needs: [release, deploy]
|
|
219
217
|
if: ${{ always() && (needs.release.result == 'failure' || needs.deploy.result == 'failure') && !contains(github.event.head_commit.message, '[skip ci]') }}
|
|
220
|
-
uses: ./.github/workflows/create-
|
|
218
|
+
uses: ./.github/workflows/create-issue-on-failure.yml
|
|
221
219
|
with:
|
|
222
220
|
package_manager: 'bun'
|
|
223
221
|
node_version: '22.21.1'
|
|
224
222
|
workflow_name: 'Release and Deploy'
|
|
225
223
|
failed_job: ${{ needs.release.result == 'failure' && 'release' || 'deploy' }}
|
|
226
|
-
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
|
227
|
-
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
|
|
228
224
|
secrets: inherit
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
1
4
|
name: 💡 Lighthouse CI
|
|
2
5
|
|
|
3
6
|
on:
|
|
@@ -6,7 +9,7 @@ on:
|
|
|
6
9
|
node_version:
|
|
7
10
|
description: 'Node.js version to use'
|
|
8
11
|
required: false
|
|
9
|
-
default: '
|
|
12
|
+
default: '22.21.1'
|
|
10
13
|
type: string
|
|
11
14
|
package_manager:
|
|
12
15
|
description: 'Package manager to use (npm, yarn, or bun)'
|