@kitschpatrol/shared-config 5.0.7 → 5.1.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/bin/cli.js +25 -19
- package/package.json +12 -11
- package/readme.md +5 -3
package/bin/cli.js
CHANGED
|
@@ -6569,6 +6569,7 @@ var source_default = chalk;
|
|
|
6569
6569
|
|
|
6570
6570
|
// ../../src/command-builder.ts
|
|
6571
6571
|
import { cosmiconfig } from "cosmiconfig";
|
|
6572
|
+
import { TypeScriptLoader as typeScriptLoader } from "cosmiconfig-typescript-loader";
|
|
6572
6573
|
import { execa } from "execa";
|
|
6573
6574
|
import fse2 from "fs-extra";
|
|
6574
6575
|
import fs3 from "node:fs";
|
|
@@ -11493,7 +11494,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
11493
11494
|
var yargs_default = Yargs;
|
|
11494
11495
|
|
|
11495
11496
|
// ../../package.json
|
|
11496
|
-
var version = "5.0
|
|
11497
|
+
var version = "5.1.0";
|
|
11497
11498
|
|
|
11498
11499
|
// ../../src/execa-utilities.ts
|
|
11499
11500
|
function isErrorExecaError(error) {
|
|
@@ -11834,11 +11835,11 @@ async function executeCliCommand(logStream, positionalArguments, optionFlags, co
|
|
|
11834
11835
|
env: {
|
|
11835
11836
|
// Use colorful output unless NO_COLOR is set
|
|
11836
11837
|
// eslint-disable-next-line ts/naming-convention
|
|
11837
|
-
...process.env.NO_COLOR === void 0 ? { FORCE_COLOR: "true" } : {}
|
|
11838
|
-
// Quiet
|
|
11838
|
+
...process.env.NO_COLOR === void 0 ? { FORCE_COLOR: "true" } : {}
|
|
11839
|
+
// Quiet Node when processing *.config.ts files in Node 22
|
|
11839
11840
|
// Suppress experimental type stripping warning with --no-warnings
|
|
11840
|
-
//
|
|
11841
|
-
NODE_OPTIONS:
|
|
11841
|
+
// TODO what's the story here on Node 20?
|
|
11842
|
+
// NODE_OPTIONS: '--experimental-strip-types --disable-warning=ExperimentalWarning',
|
|
11842
11843
|
},
|
|
11843
11844
|
preferLocal: true,
|
|
11844
11845
|
reject: false,
|
|
@@ -12161,6 +12162,14 @@ function getCosmiconfigCommand(configName) {
|
|
|
12161
12162
|
}
|
|
12162
12163
|
async function getCosmiconfigResult(configName) {
|
|
12163
12164
|
const explorer = cosmiconfig(configName, {
|
|
12165
|
+
loaders: {
|
|
12166
|
+
// Using the alternate typescript loader fixes ERR_MODULE_NOT_FOUND errors
|
|
12167
|
+
// in configuration files that import modules via a path
|
|
12168
|
+
// https://github.com/cosmiconfig/cosmiconfig/issues/345
|
|
12169
|
+
// https://github.com/Codex-/cosmiconfig-typescript-loader
|
|
12170
|
+
// Same approach taken in mdat's implementation...
|
|
12171
|
+
".ts": typeScriptLoader()
|
|
12172
|
+
},
|
|
12164
12173
|
searchStrategy: "project"
|
|
12165
12174
|
// Alt approach?
|
|
12166
12175
|
// searchStrategy: 'global',
|
|
@@ -12451,13 +12460,13 @@ var sharedKnipConfig = {
|
|
|
12451
12460
|
"src/{index,cli,main}.{js,mjs,cjs,jsx,ts,tsx,mts,cts}!",
|
|
12452
12461
|
// Customized entries
|
|
12453
12462
|
"src/{bin,lib,cli}/{index,cli,main}.{js,mjs,cjs,jsx,ts,tsx,mts,cts}!",
|
|
12454
|
-
"scripts/**/*.ts",
|
|
12455
|
-
".remarkrc.js",
|
|
12456
|
-
"cspell.config.js",
|
|
12457
|
-
"eslint.config.ts",
|
|
12458
|
-
"mdat.config.ts",
|
|
12459
|
-
"prettier.config.js",
|
|
12460
|
-
"stylelint.config.js"
|
|
12463
|
+
"scripts/**/*.{js,mjs,cjs,ts,mts,cts}",
|
|
12464
|
+
".remarkrc.{js,mjs,cjs,ts,mts,cts}",
|
|
12465
|
+
"cspell.config.{js,mjs,cjs,ts,mts,cts}",
|
|
12466
|
+
"eslint.config.{js,mjs,cjs,ts,mts,cts}",
|
|
12467
|
+
"mdat.config.{js,mjs,cjs,ts,mts,cts}",
|
|
12468
|
+
"prettier.config.{js,mjs,cjs,ts,mts,cts}",
|
|
12469
|
+
"stylelint.config.{js,mjs,cjs,ts,mts,cts}"
|
|
12461
12470
|
],
|
|
12462
12471
|
// Allow calling of individual kpi binaries...
|
|
12463
12472
|
ignoreBinaries: [
|
|
@@ -13274,15 +13283,12 @@ function updateLicenseContent(content, currentYear) {
|
|
|
13274
13283
|
async function copyrightYear(logStream, fix = false) {
|
|
13275
13284
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
13276
13285
|
const licenseFiles = [];
|
|
13277
|
-
const patterns = [
|
|
13278
|
-
"**/license.txt",
|
|
13279
|
-
"**/LICENSE.txt",
|
|
13280
|
-
"**/License.txt",
|
|
13281
|
-
"**/LICENSE",
|
|
13282
|
-
"!node_modules/**"
|
|
13283
|
-
];
|
|
13286
|
+
const patterns = ["**/license.txt", "**/license", "!node_modules/**"];
|
|
13284
13287
|
const files = await globby(patterns, {
|
|
13288
|
+
caseSensitiveMatch: false,
|
|
13285
13289
|
cwd: getPackageDirectory(),
|
|
13290
|
+
followSymbolicLinks: false,
|
|
13291
|
+
// Avoid infinite loops
|
|
13286
13292
|
gitignore: true
|
|
13287
13293
|
});
|
|
13288
13294
|
for (const filePath of files) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/shared-config",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "A collection of shared configurations, linters, and formatting tools for TypeScript projects. All managed as a single dependency, and invoked via a single CLI command.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
@@ -38,19 +38,20 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
40
40
|
"cosmiconfig": "^9.0.0",
|
|
41
|
+
"cosmiconfig-typescript-loader": "^6.1.0",
|
|
41
42
|
"execa": "^9.5.2",
|
|
42
43
|
"find-workspaces": "^0.3.1",
|
|
43
44
|
"fs-extra": "^11.3.0",
|
|
44
|
-
"prettier": "^3.5.
|
|
45
|
-
"@kitschpatrol/cspell-config": "5.0
|
|
46
|
-
"@kitschpatrol/
|
|
47
|
-
"@kitschpatrol/
|
|
48
|
-
"@kitschpatrol/
|
|
49
|
-
"@kitschpatrol/
|
|
50
|
-
"@kitschpatrol/
|
|
51
|
-
"@kitschpatrol/
|
|
52
|
-
"@kitschpatrol/
|
|
53
|
-
"@kitschpatrol/
|
|
45
|
+
"prettier": "^3.5.3",
|
|
46
|
+
"@kitschpatrol/cspell-config": "5.1.0",
|
|
47
|
+
"@kitschpatrol/prettier-config": "5.1.0",
|
|
48
|
+
"@kitschpatrol/eslint-config": "5.1.0",
|
|
49
|
+
"@kitschpatrol/knip-config": "5.1.0",
|
|
50
|
+
"@kitschpatrol/remark-config": "5.1.0",
|
|
51
|
+
"@kitschpatrol/mdat-config": "5.1.0",
|
|
52
|
+
"@kitschpatrol/repo-config": "5.1.0",
|
|
53
|
+
"@kitschpatrol/stylelint-config": "5.1.0",
|
|
54
|
+
"@kitschpatrol/typescript-config": "5.1.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"chalk": "^5.4.1",
|
package/readme.md
CHANGED
|
@@ -126,17 +126,19 @@ The top-level `kpi` command also takes care of some nuances in terms of _which_
|
|
|
126
126
|
Bootstrap a new project and open in VS Code:
|
|
127
127
|
|
|
128
128
|
```sh
|
|
129
|
-
git init && pnpm init && pnpm pkg set type="module" && pnpm dlx @kitschpatrol/repo-config init && pnpm add -D @kitschpatrol/shared-config && pnpm kpi init
|
|
129
|
+
git init && pnpm init && pnpm pkg set type="module" && pnpm dlx @kitschpatrol/repo-config init && pnpm add -D @kitschpatrol/shared-config && pnpm kpi init && pnpm i && code .
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
Note that `kpi init` takes an optional `--location package` flag will put as much configuration in your `package.json` as possible instead of creating discrete config files in your project root for each tool. Putting config in `package.json` can save some clutter, but can make it clunkier to extend or customize configurations.
|
|
133
|
+
|
|
134
|
+
At any point, you can call `kpi init` again with the `--location package` or `--location file` flag to reinitialize your configuration files in one place or the other and restore the default configurations.
|
|
133
135
|
|
|
134
136
|
#### Quick add to an existing project:
|
|
135
137
|
|
|
136
138
|
This might overwrite certain config files, so commit first:
|
|
137
139
|
|
|
138
140
|
```sh
|
|
139
|
-
pnpm dlx @kitschpatrol/repo-config init && pnpm i && pnpm add -D @kitschpatrol/shared-config && pnpm kpi init
|
|
141
|
+
pnpm dlx @kitschpatrol/repo-config init && pnpm i && pnpm add -D @kitschpatrol/shared-config && pnpm kpi init
|
|
140
142
|
```
|
|
141
143
|
|
|
142
144
|
#### Step-by-step:
|