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
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sidebar_position: 1
- [Inputs](#inputs)
- [Protocols](#protocols)
- [Migrations](#migrations)
- [Telemetry](#telemetry)

<!-- tocstop -->

Expand Down Expand Up @@ -61,3 +62,4 @@ Get an overview of how to contribute to the project

### [Telemetry](./telemetry.md)
Get an overview of how telemetry works for this project

1 change: 1 addition & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,6 @@ Prefix that follows specification is not enough though. Remember that the title






1 change: 1 addition & 0 deletions docs/migrations/v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ We upgraded the AsyncAPI Modelina dependency to the `next` version so for the ne




34 changes: 31 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ npm install -g @the-codegen-project/cli
$ codegen COMMAND
running command...
$ codegen (--version)
@the-codegen-project/cli/0.57.0 linux-x64 node-v18.20.8
@the-codegen-project/cli/0.58.0 linux-x64 node-v18.20.8
$ codegen --help [COMMAND]
USAGE
$ codegen COMMAND
Expand All @@ -30,6 +30,7 @@ USAGE
* [`codegen generate [FILE]`](#codegen-generate-file)
* [`codegen help [COMMAND]`](#codegen-help-command)
* [`codegen init`](#codegen-init)
* [`codegen telemetry ACTION`](#codegen-telemetry-action)
* [`codegen version`](#codegen-version)

## `codegen autocomplete [SHELL]`
Expand Down Expand Up @@ -84,7 +85,7 @@ DESCRIPTION
Generate code based on your configuration, use `init` to get started.
```

_See code: [src/commands/generate.ts](https://github.com/the-codegen-project/cli/blob/v0.57.0/src/commands/generate.ts)_
_See code: [src/commands/generate.ts](https://github.com/the-codegen-project/cli/blob/v0.58.0/src/commands/generate.ts)_

## `codegen help [COMMAND]`

Expand Down Expand Up @@ -144,7 +145,34 @@ DESCRIPTION
Initialize The Codegen Project in your project
```

_See code: [src/commands/init.ts](https://github.com/the-codegen-project/cli/blob/v0.57.0/src/commands/init.ts)_
_See code: [src/commands/init.ts](https://github.com/the-codegen-project/cli/blob/v0.58.0/src/commands/init.ts)_

## `codegen telemetry ACTION`

Manage telemetry settings

```
USAGE
$ codegen telemetry ACTION [--help]

ARGUMENTS
ACTION (status|enable|disable) Action to perform: status, enable, or disable

FLAGS
--help Show CLI help.

DESCRIPTION
Manage telemetry settings

EXAMPLES
$ codegen telemetry status

$ codegen telemetry enable

$ codegen telemetry disable
```

_See code: [src/commands/telemetry.ts](https://github.com/the-codegen-project/cli/blob/v0.58.0/src/commands/telemetry.ts)_

## `codegen version`

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@the-codegen-project/cli",
"description": "CLI to work with code generation in any environment",
"version": "0.57.0",
"version": "0.58.0",
"bin": {
"codegen": "./bin/run.mjs"
},
Expand Down
25 changes: 25 additions & 0 deletions schemas/configuration-schema-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
}
]
}
},
"telemetry": {
"$ref": "#/definitions/AsyncAPICodegenConfiguration/properties/telemetry"
}
},
"required": [
Expand Down Expand Up @@ -97,6 +100,9 @@
}
]
}
},
"telemetry": {
"$ref": "#/definitions/AsyncAPICodegenConfiguration/properties/telemetry"
}
},
"required": [
Expand Down Expand Up @@ -696,6 +702,25 @@
}
]
}
},
"telemetry": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable or disable telemetry for this project (overrides global setting)"
},
"endpoint": {
"type": "string",
"description": "Custom telemetry endpoint (overrides global setting)"
},
"trackingId": {
"type": "string",
"description": "Custom tracking ID (overrides global setting)"
}
},
"additionalProperties": false,
"description": "Project-level telemetry configuration (overrides global settings in ~/.the-codegen-project/config.json)"
}
},
"required": [
Expand Down
2 changes: 1 addition & 1 deletion src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class Generate extends Command {
}

const context = await realizeGeneratorContext(file);

try {
if (watch) {
await this.handleWatchModeStartedTelemetry({context, inputSource});
Expand Down