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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check formatting
run: pnpm format:check

- name: Lint
run: pnpm lint

- name: Run type check
run: pnpm typecheck

Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
pnpm-lock.yaml
src/lib/generated/
19 changes: 19 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"printWidth": 120,
"trailingComma": "all",
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"importOrder": [
"<BUILTIN_MODULES>",
"",
"<THIRD_PARTY_MODULES>",
"",
"^[.][.]/(.*)$",
"",
"^[.]/(.*)$",
""
],
"importOrderParserPlugins": ["typescript", "importAttributes"],
"plugins": ["@ianvs/prettier-plugin-sort-imports"]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ docs/plan.html # living plan/architecture/testing document
- **API types**: generated schemas come from the same OpenAPI docs endpoint as lifecycle-ui. Set
`NEXT_PUBLIC_API_URL` or `LIFECYCLE_API_URL`, then run `pnpm generate:api`. Keep CLI-specific
nullability/backward-compatibility in `src/lib/types.ts`, not in generated files.
- **Output discipline**: data → stdout; progress/confirmation chatter → stderr; `--json` must emit *only* JSON on stdout.
- **Output discipline**: data → stdout; progress/confirmation chatter → stderr; `--json` must emit _only_ JSON on stdout.
- **Interactivity**: prompts (`@clack/prompts`) only when stdin is a TTY; every prompt needs a flag escape hatch (`--yes`, `--device`, …) so agents can run non-interactively.
- **Auth**: never log tokens; token files are 0600. Anything touching the live Keycloak realm must be additive-only.
- Strict TypeScript; keep new code passing `pnpm typecheck` with `noUncheckedIndexedAccess`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lfc-cli (`lfc`)

Command-line interface for [Lifecycle](https://github.com/GoodRxOSS/lifecycle) — view and manage preview environments (builds), redeploy services, and host static sites, straight from your terminal. Built for humans *and* agents: every command supports `--json`.
Command-line interface for [Lifecycle](https://github.com/GoodRxOSS/lifecycle) — view and manage preview environments (builds), redeploy services, and host static sites, straight from your terminal. Built for humans _and_ agents: every command supports `--json`.

```
$ lfc builds list --mine
Expand Down
15 changes: 15 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist/**', 'node_modules/**', 'src/lib/generated/**'] },
js.configs.recommended,
...tseslint.configs.recommended,
// Node CLI: declare Node globals (URL, process, etc.) for all files.
{ languageOptions: { globals: { ...globals.node } } },
// eslint-config-prettier goes last: turns off any stylistic rules that would
// fight Prettier. Prettier owns formatting; ESLint owns correctness.
prettier,
);
5 changes: 5 additions & 0 deletions lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Mirrors lifecycle-ui: on any staged source file, run the full validate
// (format:write + lint + typecheck). The function form runs it once, not per file.
export default {
'*.{ts,js,mjs,cjs,json,md}': () => ['pnpm validate'],
};
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@
"build": "tsup",
"dev": "tsx src/index.ts",
"generate:api": "rm -rf ./src/lib/generated && orval --config ./orval.config.ts && node ./scripts/fix-generated-imports.mjs",
"lint": "eslint .",
"format": "prettier \"**/*.{ts,js,mjs,cjs,json,md}\"",
"format:check": "pnpm format --check",
"format:write": "pnpm format --write",
"validate": "pnpm format:write && pnpm lint && pnpm typecheck",
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"prepare": "husky"
},
"dependencies": {
"@clack/prompts": "^0.11.0",
Expand All @@ -44,14 +50,23 @@
"picocolors": "^1.1.1"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
"@types/archiver": "^6.0.3",
"@types/js-yaml": "^4.0.9",
"@types/node": "^24.0.0",
"dotenv": "^17.2.3",
"eslint": "^9",
"eslint-config-prettier": "^10.1.8",
"globals": "^17.7.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.8",
"orval": "7.4.1",
"prettier": "3.6.2",
"tsup": "^8.5.0",
"tsx": "^4.20.0",
"typescript": "^5.8.0",
"typescript-eslint": "^8.63.0",
"vitest": "^3.2.0"
}
}
Loading
Loading