Skip to content

Commit

Permalink
chore(cli): Add @fern-api/cli-logger (#5287)
Browse files Browse the repository at this point in the history
  • Loading branch information
amckinney authored Nov 26, 2024
1 parent ea5e828 commit 1ca6030
Show file tree
Hide file tree
Showing 19 changed files with 120 additions and 13 deletions.
10 changes: 10 additions & 0 deletions packages/cli/cli-logger/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ignores": [
"@types/jest",
"globals",
"@types/node"
],
"ignore-patterns": [
"lib"
]
}
1 change: 1 addition & 0 deletions packages/cli/cli-logger/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../../../.prettierrc.json");
43 changes: 43 additions & 0 deletions packages/cli/cli-logger/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@fern-api/cli-logger",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/fern-api/fern.git",
"directory": "packages/cli/cli-logger"
},
"private": true,
"files": [
"lib"
],
"type": "module",
"source": "src/index.ts",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"sideEffects": false,
"scripts": {
"clean": "rm -rf ./lib && tsc --build --clean",
"compile": "tsc --build",
"test": "vitest --passWithNoTests --run",
"test:update": "vitest --passWithNoTests --run -u",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore",
"lint:eslint:fix": "yarn lint:eslint --fix",
"format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"",
"organize-imports": "organize-imports-cli tsconfig.json",
"depcheck": "depcheck"
},
"dependencies": {
"chalk": "^5.3.0"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "18.7.18",
"depcheck": "^1.4.6",
"eslint": "^8.56.0",
"vitest": "^2.1.4",
"organize-imports-cli": "^0.10.0",
"prettier": "^2.7.1",
"typescript": "4.6.4"
}
}
File renamed without changes.
1 change: 1 addition & 0 deletions packages/cli/cli-logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { formatLog } from "./formatLog";
11 changes: 11 additions & 0 deletions packages/cli/cli-logger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../shared/tsconfig.shared.json",
"compilerOptions": {
"composite": true,
"outDir": "lib",
"rootDir": "src"
},
"include": [
"./src/**/*"
]
}
1 change: 1 addition & 0 deletions packages/cli/cli-logger/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "../../../shared/vitest.config";
1 change: 1 addition & 0 deletions packages/cli/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@fern-api/docs-resolver": "workspace:*",
"@fern-api/api-workspace-commons": "workspace:*",
"@fern-api/auth": "workspace:*",
"@fern-api/cli-logger": "workspace:*",
"@fern-api/cli-migrations": "workspace:*",
"@fern-api/configuration": "workspace:*",
"@fern-api/core": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/cli/src/commands/validate/logViolations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { assertNever } from "@fern-api/core-utils";
import { formatLog, LogLevel } from "@fern-api/logger";
import { LogLevel } from "@fern-api/logger";
import { formatLog } from "@fern-api/cli-logger";
import { TaskContext } from "@fern-api/task-context";
import { ValidationViolation } from "@fern-api/fern-definition-validator";
import chalk from "chalk";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{ "path": "../generation/local-generation/local-workspace-runner" },
{ "path": "../generation/remote-generation/remote-workspace-runner" },
{ "path": "../init" },
{ "path": "../cli-logger" },
{ "path": "../logger" },
{ "path": "../login" },
{ "path": "../mock" },
Expand Down
1 change: 1 addition & 0 deletions packages/cli/lazy-fern-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"dependencies": {
"@fern-api/api-workspace-commons": "workspace:*",
"@fern-api/cli-logger": "workspace:*",
"@fern-api/configuration": "workspace:*",
"@fern-api/core": "workspace:*",
"@fern-api/core-utils": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { DEPENDENCIES_FILENAME } from "@fern-api/configuration";
import { assertNever, entries } from "@fern-api/core-utils";
import { RelativeFilePath } from "@fern-api/fs-utils";
import { formatLog, Logger } from "@fern-api/logger";
import { Logger } from "@fern-api/logger";
import { formatLog } from "@fern-api/cli-logger";
import chalk from "chalk";
import { YAMLException } from "js-yaml";
import { ZodIssue, ZodIssueCode } from "zod";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/lazy-fern-workspace/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ "path": "../api-importers/conjure/conjure-to-fern" },
{ "path": "../../core" },
{ "path": "../configuration" },
{ "path": "../cli-logger" },
{ "path": "../logger" },
{ "path": "../api-importers/openapi/openapi-ir-to-fern" },
{ "path": "../api-importers/openapi/openapi-ir-parser" },
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
"depcheck": "depcheck"
},
"dependencies": {
"@fern-api/core-utils": "workspace:*",
"chalk": "^5.3.0"
"@fern-api/core-utils": "workspace:*"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "18.7.18",
"depcheck": "^1.4.6",
"eslint": "^8.56.0",
"vitest": "^2.1.4",
Expand Down
1 change: 0 additions & 1 deletion packages/cli/logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export { CONSOLE_LOGGER } from "./console";
export { createLogger } from "./createLogger";
export { formatLog } from "./formatLog";
export { type Logger } from "./Logger";
export { LogLevel, LOG_LEVELS } from "./LogLevel";
export { NOOP_LOGGER } from "./noop";
1 change: 1 addition & 0 deletions packages/cli/workspace-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@fern-api/configuration": "workspace:*",
"@fern-api/core-utils": "workspace:*",
"@fern-api/fs-utils": "workspace:*",
"@fern-api/cli-logger": "workspace:*",
"@fern-api/logger": "workspace:*",
"@fern-api/logging-execa": "workspace:*",
"@fern-api/task-context": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { DEPENDENCIES_FILENAME } from "@fern-api/configuration";
import { assertNever, entries } from "@fern-api/core-utils";
import { RelativeFilePath } from "@fern-api/fs-utils";
import { formatLog, Logger } from "@fern-api/logger";
import { Logger } from "@fern-api/logger";
import { formatLog } from "@fern-api/cli-logger";
import chalk from "chalk";
import { YAMLException } from "js-yaml";
import { ZodIssue, ZodIssueCode } from "zod";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/workspace-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{ "path": "../../commons/logging-execa" },
{ "path": "../../core" },
{ "path": "../configuration" },
{ "path": "../cli-logger" },
{ "path": "../logger" },
{ "path": "../api-importers/openapi/openapi-ir-parser" },
{ "path": "../semver-utils" },
Expand Down
46 changes: 40 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ca6030

Please sign in to comment.