Skip to content

Commit

Permalink
feat: 🔥 allow TypeScript configuration for the package (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
tal-rofe committed Nov 12, 2023
2 parents 9259ba9 + f2c8e55 commit c72f2d5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ Configuration can be set in environment variables or in the following files (the
- a `package.json` property: `"czvinyl": {...}` or in `~/package.json`, for example
- a `.czvinylrc` file in JSON or YAML format
- a `.czvinylrc.json`, `.czvinylrc.yaml`, `.czvinylrc.yml`, `.czvinylrc.js`, or `.czvinylrc.cjs` file
- a `czvinyl.config.js`, or `czvinyl.config.cjs` CommonJS module exporting an object
Currently, a TypeScript configuration file is not supported: https://github.com/Codex-/cosmiconfig-typescript-loader/issues/60
- a `inflint.config.ts`, `czvinyl.config.js`, or `czvinyl.config.cjs` CommonJS module exporting an object
The default commit types, descriptions and emoji that are used are:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
},
"dependencies": {
"cosmiconfig": "8.3.6",
"cosmiconfig-typescript-loader": "5.0.0",
"fuse.js": "7.0.0",
"inquirer-autocomplete-prompt": "2.0.1",
"inquirer-maxlength-input-prompt": "1.0.2",
Expand All @@ -76,13 +77,13 @@
"@exlint.io/inflint": "2.0.0",
"@types/inquirer": "9.0.6",
"@types/inquirer-autocomplete-prompt": "3.0.0",
"@vitest/coverage-v8": "0.34.6",
"@types/json-diff": "1.0.1",
"@types/node": "20.8.10",
"@types/string-template": "1.0.4",
"@types/webpack-node-externals": "3.0.3",
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1",
"@vitest/coverage-v8": "0.34.6",
"chalk": "5.3.0",
"commitizen": "4.3.0",
"commitlint": "18.2.0",
Expand All @@ -107,10 +108,10 @@
"rimraf": "5.0.5",
"ts-loader": "9.5.0",
"ts-node": "10.9.1",
"vitest": "0.34.6",
"tsconfig-paths-webpack-plugin": "4.1.0",
"typescript": "5.2.2",
"vite-tsconfig-paths": "4.2.1",
"vitest": "0.34.6",
"webpack": "5.89.0",
"webpack-cli": "5.1.4",
"webpack-node-externals": "3.0.0",
Expand Down
25 changes: 18 additions & 7 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions src/utils/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { cosmiconfig } from 'cosmiconfig';
import { TypeScriptLoader } from 'cosmiconfig-typescript-loader';

import { DEFAULT_CONFIGURATION } from '../constants/configuration';
import { CONFIGURATION_MODULE_NAME, SEARCH_PLACES } from '../constants/cosmiconfig';
Expand All @@ -18,6 +19,7 @@ export const getConfiguration = async () => {

const explorer = cosmiconfig(CONFIGURATION_MODULE_NAME, {
searchPlaces: SEARCH_PLACES,
loaders: { '.ts': TypeScriptLoader() },
});

try {
Expand Down

0 comments on commit c72f2d5

Please sign in to comment.