@jonloucks/badges-ts 1.0.3 → 1.2.0
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 +60 -174
- package/api/Variances.d.ts +29 -0
- package/api/Variances.d.ts.map +1 -0
- package/api/Variances.js +157 -0
- package/api/Variances.js.map +1 -0
- package/auxiliary/Command.d.ts +2 -0
- package/auxiliary/Command.d.ts.map +1 -1
- package/auxiliary/DiscoverProject.d.ts +2 -1
- package/auxiliary/DiscoverProject.d.ts.map +1 -1
- package/auxiliary/DiscoverProject.js.map +1 -1
- package/cli.d.ts.map +1 -1
- package/cli.js +2 -66
- package/cli.js.map +1 -1
- package/data/Resolver.d.ts.map +1 -1
- package/data/Resolver.js +4 -5
- package/data/Resolver.js.map +1 -1
- package/data/badge-template.svg.dat +16 -1
- package/impl/BadgeFactory.impl.d.ts +5 -1
- package/impl/BadgeFactory.impl.d.ts.map +1 -1
- package/impl/BadgeFactory.impl.js +19 -33
- package/impl/BadgeFactory.impl.js.map +1 -1
- package/impl/Command.impl.d.ts.map +1 -1
- package/impl/Command.impl.js +56 -25
- package/impl/Command.impl.js.map +1 -1
- package/impl/DiscoverProject.impl.d.ts +5 -1
- package/impl/DiscoverProject.impl.d.ts.map +1 -1
- package/impl/DiscoverProject.impl.js +50 -22
- package/impl/DiscoverProject.impl.js.map +1 -1
- package/impl/Installer.impl.d.ts.map +1 -1
- package/impl/Installer.impl.js +24 -8
- package/impl/Installer.impl.js.map +1 -1
- package/impl/Internal.impl.d.ts +7 -6
- package/impl/Internal.impl.d.ts.map +1 -1
- package/impl/Internal.impl.js +49 -30
- package/impl/Internal.impl.js.map +1 -1
- package/impl/apply-version-command.js +15 -9
- package/impl/apply-version-command.js.map +1 -1
- package/impl/discover-command.js +1 -1
- package/impl/discover-command.js.map +1 -1
- package/impl/generate-command.d.ts +0 -11
- package/impl/generate-command.d.ts.map +1 -1
- package/impl/generate-command.js +77 -65
- package/impl/generate-command.js.map +1 -1
- package/package.json +16 -21
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -6,18 +6,7 @@
|
|
|
6
6
|
[](https://jonloucks.github.io/badges-ts/lcov-report/)
|
|
7
7
|
[](https://jonloucks.github.io/badges-ts/typedoc/)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
Typescript badge maker
|
|
11
|
-
|
|
12
|
-
## Documentation
|
|
13
|
-
* [License](LICENSE.md)
|
|
14
|
-
* [Contributing](CONTRIBUTING.md)
|
|
15
|
-
* [Code of conduct](CODE_OF_CONDUCT.md)
|
|
16
|
-
* [Coding standards](CODING_STANDARDS.md)
|
|
17
|
-
* [Security policy](SECURITY.md)
|
|
18
|
-
* [Pull request template](PULL_REQUEST_TEMPLATE.md)
|
|
19
|
-
* [How to use API](https://jonloucks.github.io/badges-ts/typedoc/)
|
|
20
|
-
* [Test coverage report](https://jonloucks.github.io/badges-ts/lcov-report)
|
|
9
|
+
`badges-ts` is a TypeScript/Node.js CLI for generating SVG project badges (npm version, coverage, and typedoc) with configurable colors, file paths, and templates.
|
|
21
10
|
|
|
22
11
|
## Installation
|
|
23
12
|
|
|
@@ -25,202 +14,99 @@ Typescript badge maker
|
|
|
25
14
|
npm install @jonloucks/badges-ts
|
|
26
15
|
```
|
|
27
16
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<details markdown="1"><summary>Importing the Package</summary>
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
import {
|
|
34
|
-
createBadge,
|
|
35
|
-
BadgeConfig
|
|
36
|
-
} from '@jonloucks/badges-ts';
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
</details>
|
|
40
|
-
|
|
41
|
-
<details markdown="1"><summary>Importing the Convenience Package</summary>
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import {
|
|
45
|
-
createBadge,
|
|
46
|
-
BadgeConfig
|
|
47
|
-
} from "@jonloucks/badges-ts/api/Convenience";
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
</details>
|
|
51
|
-
|
|
52
|
-
<details markdown="1"><summary>Creating a Contract</summary>
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
17
|
+
For one-off usage, you can also run with `npx`.
|
|
55
18
|
|
|
56
|
-
|
|
57
|
-
</details>
|
|
58
|
-
|
|
59
|
-
<details markdown="1"><summary>Binding a Contract</summary>
|
|
19
|
+
## Quick Start
|
|
60
20
|
|
|
61
|
-
|
|
21
|
+
### 1) Discover project metadata
|
|
62
22
|
|
|
23
|
+
```bash
|
|
24
|
+
npx badges-ts discover
|
|
63
25
|
```
|
|
64
|
-
</details>
|
|
65
26
|
|
|
66
|
-
|
|
27
|
+
### 2) Generate badges
|
|
67
28
|
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
logger.log("Using the service in the test.");
|
|
29
|
+
```bash
|
|
30
|
+
npx badges-ts generate --verbose
|
|
71
31
|
```
|
|
72
|
-
</details>
|
|
73
32
|
|
|
74
|
-
|
|
33
|
+
By default this creates:
|
|
34
|
+
- `npm-badge.svg`
|
|
35
|
+
- `coverage-summary.svg`
|
|
36
|
+
- `typedoc-badge.svg`
|
|
75
37
|
|
|
76
|
-
|
|
38
|
+
### 3) Apply version artifacts
|
|
77
39
|
|
|
78
40
|
```bash
|
|
79
|
-
|
|
41
|
+
npx badges-ts apply-version
|
|
80
42
|
```
|
|
81
|
-
</details>
|
|
82
43
|
|
|
83
|
-
|
|
44
|
+
This updates `src/version.ts` and creates release notes for the current package version if a release notes file does not already exist.
|
|
84
45
|
|
|
85
|
-
|
|
86
|
-
npm run build
|
|
87
|
-
```
|
|
88
|
-
</details>
|
|
46
|
+
## CLI Commands
|
|
89
47
|
|
|
90
|
-
|
|
48
|
+
- `badges-ts discover` — Reads project metadata from `package.json`.
|
|
49
|
+
- `badges-ts generate` — Generates npm, coverage, and typedoc badges.
|
|
50
|
+
- `badges-ts apply-version` — Writes `src/version.ts` and creates release-notes file from template.
|
|
51
|
+
- `badges-ts version` — Prints CLI version.
|
|
52
|
+
- `badges-ts help` — Prints usage.
|
|
91
53
|
|
|
92
|
-
|
|
93
|
-
npm test
|
|
94
|
-
```
|
|
95
|
-
</details>
|
|
54
|
+
### Common flags
|
|
96
55
|
|
|
97
|
-
|
|
56
|
+
- `--dry-run`, `-d` — Preview writes without writing files.
|
|
57
|
+
- `--quiet`, `-q` — Suppress standard output.
|
|
58
|
+
- `--trace`, `-t` — Enable trace logs.
|
|
59
|
+
- `--warn`, `-w` — Enable warning logs.
|
|
60
|
+
- `--verbose` — Enable verbose output.
|
|
98
61
|
|
|
99
|
-
|
|
100
|
-
npm run test:watch
|
|
101
|
-
```
|
|
102
|
-
</details>
|
|
62
|
+
## Configuration
|
|
103
63
|
|
|
104
|
-
|
|
64
|
+
`badges-ts` supports both environment variables and a project config file (`badges-ts.json`).
|
|
105
65
|
|
|
106
|
-
|
|
107
|
-
npm run test:coverage
|
|
108
|
-
```
|
|
109
|
-
</details>
|
|
66
|
+
See [Configuration Profiles](DOCUMENTATION.md#configuration-profiles) for ready-to-use examples (default, monorepo, and CI-only).
|
|
110
67
|
|
|
111
|
-
|
|
68
|
+
Example:
|
|
112
69
|
|
|
113
|
-
```
|
|
114
|
-
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"kit.badges.folder": "badges",
|
|
73
|
+
"kit.coverage.summary.path": "coverage/coverage-summary.json",
|
|
74
|
+
"kit.coverage.summary.badge.path": "main-coverage.svg",
|
|
75
|
+
"kit.npm.badge.path": "main-npm.svg",
|
|
76
|
+
"kit.typedoc.badge.path": "main-typedoc.svg",
|
|
77
|
+
"kit.template.badge.path": "src/data/badge-template.svg.dat",
|
|
78
|
+
"kit.above.90.percent.color": "#377526",
|
|
79
|
+
"kit.0.percent.color": "#ff0000"
|
|
80
|
+
}
|
|
115
81
|
```
|
|
116
|
-
</details>
|
|
117
82
|
|
|
118
|
-
|
|
83
|
+
The default badge SVG template is custom/original and stored at `src/data/badge-template.svg.dat`.
|
|
84
|
+
You can override it with `KIT_TEMPLATE_BADGE_PATH`:
|
|
119
85
|
|
|
120
86
|
```bash
|
|
121
|
-
|
|
87
|
+
KIT_TEMPLATE_BADGE_PATH=./my-template.svg npx badges-ts generate
|
|
122
88
|
```
|
|
123
|
-
</details>
|
|
124
89
|
|
|
125
|
-
|
|
90
|
+
## Documentation
|
|
126
91
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
92
|
+
- [Full Documentation](DOCUMENTATION.md)
|
|
93
|
+
- [TypeDoc API](https://jonloucks.github.io/badges-ts/typedoc/)
|
|
94
|
+
- [Coverage Report](https://jonloucks.github.io/badges-ts/lcov-report)
|
|
95
|
+
- [Contributing](CONTRIBUTING.md)
|
|
96
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
97
|
+
- [Coding Standards](CODING_STANDARDS.md)
|
|
98
|
+
- [Security Policy](SECURITY.md)
|
|
131
99
|
|
|
132
|
-
|
|
100
|
+
## Development
|
|
133
101
|
|
|
134
102
|
```bash
|
|
103
|
+
npm install
|
|
104
|
+
npm run build
|
|
105
|
+
npm run test
|
|
106
|
+
npm run lint
|
|
107
|
+
npm run docs
|
|
135
108
|
npm run badges
|
|
136
109
|
```
|
|
137
|
-
</details>
|
|
138
|
-
|
|
139
|
-
<details markdown="1"><summary>Project Structure</summary>
|
|
140
|
-
|
|
141
|
-
* All tests must have suffix of -test.ts or -spec.ts
|
|
142
|
-
* Tests that validate supported APIs go in src/test
|
|
143
|
-
* Tests that validate internal implementation details go in src/impl
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
badges-ts
|
|
147
|
-
├── .github
|
|
148
|
-
│ ├── ISSUE_TEMPLATE
|
|
149
|
-
│ │ ├── bug_report.md
|
|
150
|
-
│ │ └── feature_request.md
|
|
151
|
-
│ └── workflows
|
|
152
|
-
│ ├── main-pull-request-matrix.yml
|
|
153
|
-
│ ├── main-pull-request.yml
|
|
154
|
-
│ ├── main-push.yml
|
|
155
|
-
│ └── main-release.yml
|
|
156
|
-
├── CODE_OF_CONDUCT.md
|
|
157
|
-
├── CODING_STANDARDS.md
|
|
158
|
-
├── CONTRIBUTING.md
|
|
159
|
-
├── editorconfig
|
|
160
|
-
├── eslint.config.mjs
|
|
161
|
-
├── jest.config.js
|
|
162
|
-
├── LICENSE
|
|
163
|
-
├── package-lock.json
|
|
164
|
-
├── package.json
|
|
165
|
-
├── PULL_REQUEST_TEMPLATE.md
|
|
166
|
-
├── README.md
|
|
167
|
-
├── scripts
|
|
168
|
-
│ ├── badge-template.svg.dat
|
|
169
|
-
│ └── tsconfig.json
|
|
170
|
-
├── SECURITY.md
|
|
171
|
-
├── src
|
|
172
|
-
│ ├── index.ts
|
|
173
|
-
│ ├── version.ts
|
|
174
|
-
│ ├── api
|
|
175
|
-
│ │ ├── *.ts
|
|
176
|
-
│ │ ├── *.api.ts
|
|
177
|
-
│ ├── auxiliary
|
|
178
|
-
│ │ ├── *.ts
|
|
179
|
-
│ │ ├── *.impl.ts
|
|
180
|
-
│ │ ├── *.test.ts // internal implementation specific
|
|
181
|
-
│ │ └── *.api.ts
|
|
182
|
-
│ ├── impl
|
|
183
|
-
│ │ ├── *.ts
|
|
184
|
-
│ │ ├── *.impl.ts
|
|
185
|
-
│ │ ├── *.test.ts // internal implementation specific
|
|
186
|
-
│ │ └── *.api.ts
|
|
187
|
-
│ ├── test
|
|
188
|
-
│ │ └── *.test.ts
|
|
189
|
-
│ └── never-publish // non shippable development scripts
|
|
190
|
-
│ ├── *.ts
|
|
191
|
-
│ ├── *.*. // data files etc
|
|
192
|
-
│ └── *.test.ts
|
|
193
|
-
├── tsconfig.json
|
|
194
|
-
└── typedoc.json
|
|
195
|
-
```
|
|
196
|
-
</details>
|
|
197
|
-
|
|
198
|
-
## GitHub Workflows
|
|
199
|
-
|
|
200
|
-
<details markdown="1"><summary>CI Workflow</summary>
|
|
201
|
-
|
|
202
|
-
The CI workflow runs on every push and pull request to `main` branch. It:
|
|
203
|
-
- Tests against Node.js versions 18.x, 20.x, 22.x, and 24.x
|
|
204
|
-
- Runs linting
|
|
205
|
-
- Builds the project
|
|
206
|
-
- Runs tests with coverage
|
|
207
|
-
- Uploads coverage to Codecov (optional)
|
|
208
|
-
|
|
209
|
-
</details>
|
|
210
|
-
|
|
211
|
-
<details markdown="1"><summary>Publish Workflow</summary>
|
|
212
|
-
|
|
213
|
-
The GitHub publishings workflows are run to make an official release.
|
|
214
|
-
- If all scanning and tests pass it is published. There is no other way allowed.
|
|
215
|
-
- Publishing authentication is done using ([OIDC trusted publishing](https://docs.npmjs.com/trusted-publishers))
|
|
216
|
-
|
|
217
|
-
To set up your own publishing:
|
|
218
|
-
1. Publishing this project as is intentionally disabled
|
|
219
|
-
2. You are welcome to fork this repository and publish where you want.
|
|
220
|
-
3. Run `npm pkg delete private` to remove the `private` flag from the package.
|
|
221
|
-
4. Change the `name` field in `package.json` to your desired package name.
|
|
222
|
-
|
|
223
|
-
</details>
|
|
224
110
|
|
|
225
111
|
## License
|
|
226
112
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Variant } from "@jonloucks/variants-ts/api/Variant";
|
|
2
|
+
/**
|
|
3
|
+
* Only resolving KIT_PROJECT_FOLDER to an absolute path at the point of initialization allows it to be set to a
|
|
4
|
+
* relative path that is resolved from the current working directory instead of the location of the
|
|
5
|
+
* executing code. Other path variances should be resolved relative to KIT_PROJECT_FOLDER,
|
|
6
|
+
* so they will be resolved correctly as well.
|
|
7
|
+
*/
|
|
8
|
+
export declare const KIT_PROJECT_FOLDER: Variant<string>;
|
|
9
|
+
export declare const KIT_BADGES_CONFIG_PATH: Variant<string>;
|
|
10
|
+
export declare const KIT_PACKAGE_JSON_PATH: Variant<string>;
|
|
11
|
+
export declare const KIT_COVERAGE_SUMMARY_PATH: Variant<string>;
|
|
12
|
+
export declare const KIT_CODE_COVERAGE_PERCENT: Variant<number>;
|
|
13
|
+
export declare const KIT_COVERAGE_SUMMARY_BADGE_PATH: Variant<string>;
|
|
14
|
+
export declare const KIT_TYPEDOC_BADGE_PATH: Variant<string>;
|
|
15
|
+
export declare const KIT_BADGES_FOLDER: Variant<string>;
|
|
16
|
+
export declare const KIT_NPM_BADGE_PATH: Variant<string>;
|
|
17
|
+
export declare const KIT_TEMPLATE_BADGE_PATH: Variant<string>;
|
|
18
|
+
export declare const KIT_RELEASE_NOTES_OUTPUT_FOLDER: Variant<string>;
|
|
19
|
+
export declare const KIT_RELEASE_NOTES_TEMPLATE_PATH: Variant<string>;
|
|
20
|
+
export declare const KIT_LCOV_REPORT_INDEX_PATH: Variant<string>;
|
|
21
|
+
export declare const KIT_VERSION_TS_PATH: Variant<string>;
|
|
22
|
+
export declare const KIT_100_PERCENT_COLOR: Variant<string>;
|
|
23
|
+
export declare const KIT_ABOVE_90_PERCENT_COLOR: Variant<string>;
|
|
24
|
+
export declare const KIT_ABOVE_80_PERCENT_COLOR: Variant<string>;
|
|
25
|
+
export declare const KIT_ABOVE_70_PERCENT_COLOR: Variant<string>;
|
|
26
|
+
export declare const KIT_ABOVE_60_PERCENT_COLOR: Variant<string>;
|
|
27
|
+
export declare const KIT_BELOW_60_PERCENT_COLOR: Variant<string>;
|
|
28
|
+
export declare const KIT_0_PERCENT_COLOR: Variant<string>;
|
|
29
|
+
//# sourceMappingURL=Variances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variances.d.ts","sourceRoot":"","sources":["../../src/api/Variances.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAI7D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAM7C,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC,MAAM,CAMjD,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAMhD,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC,MAAM,CAMpD,CAAC;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js";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Only resolving KIT_PROJECT_FOLDER to an absolute path at the point of initialization allows it to be set to a
|
|
6
|
+
* relative path that is resolved from the current working directory instead of the location of the
|
|
7
|
+
* executing code. Other path variances should be resolved relative to KIT_PROJECT_FOLDER,
|
|
8
|
+
* so they will be resolved correctly as well.
|
|
9
|
+
*/
|
|
10
|
+
export const KIT_PROJECT_FOLDER = createVariant({
|
|
11
|
+
name: 'Project Folder',
|
|
12
|
+
keys: ['KIT_PROJECT_FOLDER', 'kit.project.folder'],
|
|
13
|
+
description: 'The folder path of the project.',
|
|
14
|
+
of: ofString(),
|
|
15
|
+
fallback: resolve('./')
|
|
16
|
+
});
|
|
17
|
+
export const KIT_BADGES_CONFIG_PATH = createVariant({
|
|
18
|
+
name: 'Config Path',
|
|
19
|
+
keys: ['KIT_BADGES_CONFIG_PATH', 'kit.badges.config.path'],
|
|
20
|
+
description: 'The file path to the configuration file.',
|
|
21
|
+
of: ofString(),
|
|
22
|
+
fallback: 'badges-ts.json'
|
|
23
|
+
});
|
|
24
|
+
export const KIT_PACKAGE_JSON_PATH = createVariant({
|
|
25
|
+
name: 'Package JSON Path',
|
|
26
|
+
keys: ['KIT_PACKAGE_JSON_PATH', 'kit.package.json.path'],
|
|
27
|
+
description: 'The file path to the package.json file.',
|
|
28
|
+
of: ofString(),
|
|
29
|
+
fallback: 'package.json'
|
|
30
|
+
});
|
|
31
|
+
export const KIT_COVERAGE_SUMMARY_PATH = createVariant({
|
|
32
|
+
name: 'Coverage Summary Path',
|
|
33
|
+
keys: ['KIT_COVERAGE_SUMMARY_PATH', 'kit.coverage.summary.path'],
|
|
34
|
+
description: 'The file path to the coverage summary JSON file.',
|
|
35
|
+
of: ofString(),
|
|
36
|
+
fallback: 'coverage/coverage-summary.json'
|
|
37
|
+
});
|
|
38
|
+
export const KIT_CODE_COVERAGE_PERCENT = createVariant({
|
|
39
|
+
name: 'Code Coverage Percent',
|
|
40
|
+
keys: ['KIT_CODE_COVERAGE_PERCENT', 'kit.code.coverage.percent'],
|
|
41
|
+
description: 'The code coverage percentage.',
|
|
42
|
+
of: ofNumber(),
|
|
43
|
+
fallback: undefined
|
|
44
|
+
});
|
|
45
|
+
export const KIT_COVERAGE_SUMMARY_BADGE_PATH = createVariant({
|
|
46
|
+
name: 'Coverage Summary Badge Path',
|
|
47
|
+
keys: ['KIT_COVERAGE_SUMMARY_BADGE_PATH', 'kit.coverage.summary.badge.path'],
|
|
48
|
+
description: 'The file path to output the generated coverage summary badge SVG file.',
|
|
49
|
+
of: ofString(),
|
|
50
|
+
fallback: 'coverage-summary.svg'
|
|
51
|
+
});
|
|
52
|
+
export const KIT_TYPEDOC_BADGE_PATH = createVariant({
|
|
53
|
+
name: 'Typedoc Badge Path',
|
|
54
|
+
keys: ['KIT_TYPEDOC_BADGE_PATH', 'kit.typedoc.badge.path'],
|
|
55
|
+
description: 'The file path to output the generated typedoc badge SVG file.',
|
|
56
|
+
of: ofString(),
|
|
57
|
+
fallback: 'typedoc-badge.svg'
|
|
58
|
+
});
|
|
59
|
+
export const KIT_BADGES_FOLDER = createVariant({
|
|
60
|
+
name: 'Badges Folder',
|
|
61
|
+
keys: ['KIT_BADGES_FOLDER', 'kit.badges.folder'],
|
|
62
|
+
description: 'The folder path to output the generated badge SVG files.',
|
|
63
|
+
of: ofString(),
|
|
64
|
+
link: KIT_PROJECT_FOLDER
|
|
65
|
+
});
|
|
66
|
+
export const KIT_NPM_BADGE_PATH = createVariant({
|
|
67
|
+
name: 'NPM Badge Path',
|
|
68
|
+
keys: ['KIT_NPM_BADGE_PATH', 'kit.npm.badge.path'],
|
|
69
|
+
description: 'The file path to output the generated npm badge SVG file.',
|
|
70
|
+
of: ofString(),
|
|
71
|
+
fallback: 'npm-badge.svg'
|
|
72
|
+
});
|
|
73
|
+
export const KIT_TEMPLATE_BADGE_PATH = createVariant({
|
|
74
|
+
name: 'Template Badge Path',
|
|
75
|
+
keys: ['KIT_TEMPLATE_BADGE_PATH', 'kit.template.badge.path'],
|
|
76
|
+
description: 'The file path to the badge template SVG file.',
|
|
77
|
+
of: ofString(),
|
|
78
|
+
fallback: resolveDataPath('badge-template.svg.dat')
|
|
79
|
+
});
|
|
80
|
+
export const KIT_RELEASE_NOTES_OUTPUT_FOLDER = createVariant({
|
|
81
|
+
name: 'Release Notes Output Folder',
|
|
82
|
+
keys: ['KIT_RELEASE_NOTES_OUTPUT_FOLDER', 'kit.release.notes.output.folder'],
|
|
83
|
+
description: 'The folder path to output the generated release notes files.',
|
|
84
|
+
of: ofString(),
|
|
85
|
+
fallback: 'notes'
|
|
86
|
+
});
|
|
87
|
+
export const KIT_RELEASE_NOTES_TEMPLATE_PATH = createVariant({
|
|
88
|
+
name: 'Release Notes Template Path',
|
|
89
|
+
keys: ['KIT_RELEASE_NOTES_TEMPLATE_PATH', 'kit.release.notes.template.path'],
|
|
90
|
+
description: 'The file path to the release notes template file.',
|
|
91
|
+
of: ofString(),
|
|
92
|
+
fallback: 'notes/release-notes-template.md'
|
|
93
|
+
});
|
|
94
|
+
export const KIT_LCOV_REPORT_INDEX_PATH = createVariant({
|
|
95
|
+
name: 'LCOV Report Index Path',
|
|
96
|
+
keys: ['KIT_LCOV_REPORT_INDEX_PATH', 'kit.lcov.report.index.path'],
|
|
97
|
+
description: 'The file path to the LCOV report index.html file.',
|
|
98
|
+
of: ofString(),
|
|
99
|
+
fallback: 'coverage/lcov-report/index.html'
|
|
100
|
+
});
|
|
101
|
+
export const KIT_VERSION_TS_PATH = createVariant({
|
|
102
|
+
name: 'Version TS Path',
|
|
103
|
+
keys: ['KIT_VERSION_TS_PATH', 'kit.version.ts.path'],
|
|
104
|
+
description: 'The file path to output the generated version.ts file.',
|
|
105
|
+
of: ofString(),
|
|
106
|
+
fallback: 'src/version.ts'
|
|
107
|
+
});
|
|
108
|
+
export const KIT_100_PERCENT_COLOR = createVariant({
|
|
109
|
+
name: '100% Color',
|
|
110
|
+
keys: ['KIT_100_PERCENT_COLOR', 'kit.100.percent.color'],
|
|
111
|
+
description: 'The color to use for badges that are at 100% complete.',
|
|
112
|
+
of: ofString(),
|
|
113
|
+
fallback: '#4bc124'
|
|
114
|
+
});
|
|
115
|
+
export const KIT_ABOVE_90_PERCENT_COLOR = createVariant({
|
|
116
|
+
name: 'Above 90% Color',
|
|
117
|
+
keys: ['KIT_ABOVE_90_PERCENT_COLOR', 'kit.above.90.percent.color'],
|
|
118
|
+
description: 'The color to use for badges that are above 90% complete.',
|
|
119
|
+
of: ofString(),
|
|
120
|
+
fallback: '#377526'
|
|
121
|
+
});
|
|
122
|
+
export const KIT_ABOVE_80_PERCENT_COLOR = createVariant({
|
|
123
|
+
name: 'Above 80% Color',
|
|
124
|
+
keys: ['KIT_ABOVE_80_PERCENT_COLOR', 'kit.above.80.percent.color'],
|
|
125
|
+
description: 'The color to use for badges that are above 80% complete.',
|
|
126
|
+
of: ofString(),
|
|
127
|
+
fallback: 'yellowgreen'
|
|
128
|
+
});
|
|
129
|
+
export const KIT_ABOVE_70_PERCENT_COLOR = createVariant({
|
|
130
|
+
name: 'Above 70% Color',
|
|
131
|
+
keys: ['KIT_ABOVE_70_PERCENT_COLOR', 'kit.above.70.percent.color'],
|
|
132
|
+
description: 'The color to use for badges that are above 70% complete.',
|
|
133
|
+
of: ofString(),
|
|
134
|
+
fallback: 'yellow'
|
|
135
|
+
});
|
|
136
|
+
export const KIT_ABOVE_60_PERCENT_COLOR = createVariant({
|
|
137
|
+
name: 'Above 60% Color',
|
|
138
|
+
keys: ['KIT_ABOVE_60_PERCENT_COLOR', 'kit.above.60.percent.color'],
|
|
139
|
+
description: 'The color to use for badges that are above 60% complete.',
|
|
140
|
+
of: ofString(),
|
|
141
|
+
fallback: 'orange'
|
|
142
|
+
});
|
|
143
|
+
export const KIT_BELOW_60_PERCENT_COLOR = createVariant({
|
|
144
|
+
name: 'Below 60% Color',
|
|
145
|
+
keys: ['KIT_BELOW_60_PERCENT_COLOR', 'kit.below.60.percent.color'],
|
|
146
|
+
description: 'The color to use for badges that are below 60% complete.',
|
|
147
|
+
of: ofString(),
|
|
148
|
+
fallback: 'darkred'
|
|
149
|
+
});
|
|
150
|
+
export const KIT_0_PERCENT_COLOR = createVariant({
|
|
151
|
+
name: '0% Color',
|
|
152
|
+
keys: ['KIT_0_PERCENT_COLOR', 'kit.0.percent.color'],
|
|
153
|
+
description: 'The color to use for badges that are at 0% complete.',
|
|
154
|
+
of: ofString(),
|
|
155
|
+
fallback: '#ff0000'
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=Variances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variances.js","sourceRoot":"","sources":["../../src/api/Variances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AAEjG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAoB,aAAa,CAAS;IACvE,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAClD,WAAW,EAAE,iCAAiC;IAC9C,EAAE,EAAE,QAAQ,EAAE;IACd,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAoB,aAAa,CAAS;IAC3E,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAC1D,WAAW,EAAE,0CAA0C;IACvD,EAAE,EAAE,QAAQ,EAAE;IACd,QAAQ,EAAE,gBAAgB;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAoB,aAAa,CAAS;IAC1E,IAAI,EAAE,mBAAmB;IACz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AAC,MAAM,0BAA0B,GAAoB,aAAa,CAAS;IAC/E,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,CAAC,4BAA4B,EAAE,4BAA4B,CAAC;IAClE,WAAW,EAAE,0DAA0D;IACvE,EAAE,EAAE,QAAQ,EAAE;IACd,QAAQ,EAAE,QAAQ;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAoB,aAAa,CAAS;IAC/E,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,CAAC,4BAA4B,EAAE,4BAA4B,CAAC;IAClE,WAAW,EAAE,0DAA0D;IACvE,EAAE,EAAE,QAAQ,EAAE;IACd,QAAQ,EAAE,SAAS;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAoB,aAAa,CAAS;IACxE,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IACpD,WAAW,EAAE,sDAAsD;IACnE,EAAE,EAAE,QAAQ,EAAE;IACd,QAAQ,EAAE,SAAS;CACpB,CAAC,CAAC"}
|
package/auxiliary/Command.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Display, Flags } from "@jonloucks/badges-ts/api/Types";
|
|
2
|
+
import { Environment } from "@jonloucks/variants-ts/api/Environment";
|
|
2
3
|
export interface Command<T> {
|
|
3
4
|
execute(context: Context): Promise<T>;
|
|
4
5
|
}
|
|
@@ -6,5 +7,6 @@ export interface Context {
|
|
|
6
7
|
arguments: string[];
|
|
7
8
|
display: Display;
|
|
8
9
|
flags: Flags;
|
|
10
|
+
environment: Environment;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=Command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,MAAM,WAAW,OAAO,CAAC,CAAC;IAExB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAEvC;AAED,MAAM,WAAW,OAAO;IAEtB,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IAEjB,KAAK,EAAE,KAAK,CAAC;IAEb,WAAW,EAAE,WAAW,CAAC;CAC1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Project } from "@jonloucks/badges-ts/api/Project";
|
|
2
2
|
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
3
|
import { Contract } from "@jonloucks/contracts-ts";
|
|
4
|
+
import { Context } from "./Command.js";
|
|
4
5
|
/**
|
|
5
6
|
* Interface for discovering project information
|
|
6
7
|
*/
|
|
@@ -10,7 +11,7 @@ export interface DiscoverProject {
|
|
|
10
11
|
*
|
|
11
12
|
* @returns a Promise that resolves to a Project
|
|
12
13
|
*/
|
|
13
|
-
discoverProject(): Promise<Project>;
|
|
14
|
+
discoverProject(context: Context): Promise<Project>;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Determine if an instance implements DiscoverProject
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscoverProject.d.ts","sourceRoot":"","sources":["../../src/auxiliary/DiscoverProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAkB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"DiscoverProject.d.ts","sourceRoot":"","sources":["../../src/auxiliary/DiscoverProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAkB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,eAAe;IAE9B;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,eAAe,CAAC,CAElF;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAG7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscoverProject.js","sourceRoot":"","sources":["../../src/auxiliary/DiscoverProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAY,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"DiscoverProject.js","sourceRoot":"","sources":["../../src/auxiliary/DiscoverProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAY,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAgBnE;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,QAAiB;IACrC,OAAO,cAAc,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA8B,cAAc,CAAC;IAChE,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,KAAK;CACZ,CAAC,CAAC"}
|
package/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAMpF;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAc7D"}
|
package/cli.js
CHANGED
|
@@ -1,63 +1,8 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
1
|
import { COMMAND as APPLY_VERSION_COMMAND } from "./impl/apply-version-command.js";
|
|
54
2
|
import { COMMAND as DISCOVER_COMMAND } from "./impl/discover-command.js";
|
|
55
3
|
import { COMMAND as GENERATE_COMMAND } from "./impl/generate-command.js";
|
|
56
4
|
import { createInstaller } from "@jonloucks/badges-ts";
|
|
57
5
|
import { isNotPresent, isPresent } from '@jonloucks/contracts-ts/api/Types';
|
|
58
|
-
import { used } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
59
|
-
import { toContext } from "./impl/Command.impl.js";
|
|
60
|
-
import { Internal } from './impl/Internal.impl.js';
|
|
61
6
|
import { VERSION } from "./version.js";
|
|
62
7
|
/**
|
|
63
8
|
* Main entry point for the Badges CLI application.
|
|
@@ -71,10 +16,8 @@ import { VERSION } from "./version.js";
|
|
|
71
16
|
*
|
|
72
17
|
*/
|
|
73
18
|
export async function runMain(context) {
|
|
74
|
-
const
|
|
19
|
+
const usingInstaller = createInstaller().open();
|
|
75
20
|
try {
|
|
76
|
-
const usingInstaller = __addDisposableResource(env_1, createInstaller().open(), false);
|
|
77
|
-
used(usingInstaller);
|
|
78
21
|
const command = findCommand(context);
|
|
79
22
|
if (isPresent(command)) {
|
|
80
23
|
await command.execute(context);
|
|
@@ -84,12 +27,8 @@ export async function runMain(context) {
|
|
|
84
27
|
printUsage(context);
|
|
85
28
|
}
|
|
86
29
|
}
|
|
87
|
-
catch (e_1) {
|
|
88
|
-
env_1.error = e_1;
|
|
89
|
-
env_1.hasError = true;
|
|
90
|
-
}
|
|
91
30
|
finally {
|
|
92
|
-
|
|
31
|
+
usingInstaller.close();
|
|
93
32
|
}
|
|
94
33
|
}
|
|
95
34
|
function findCommand(context) {
|
|
@@ -149,7 +88,4 @@ function findFirstCommand(args) {
|
|
|
149
88
|
}
|
|
150
89
|
return args.find(arg => !arg.startsWith('-'));
|
|
151
90
|
}
|
|
152
|
-
if (Internal.isRunning(import.meta.url)) {
|
|
153
|
-
await runMain(toContext(process.argv.slice(2)));
|
|
154
|
-
}
|
|
155
91
|
//# sourceMappingURL=cli.js.map
|
package/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EA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;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
package/data/Resolver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resolver.d.ts","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"Resolver.d.ts","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAI7D"}
|