@alessiofrittoli/package-configs 0.1.0 → 1.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/README.md +22 -22
- package/dist/oxlint/index.cjs +1 -1
- package/dist/oxlint/index.mjs +1 -1
- package/dist/oxlint/profiles/index.cjs +1 -1
- package/dist/oxlint/profiles/index.mjs +1 -1
- package/dist/prettier/index.cjs +1 -1
- package/dist/prettier/index.mjs +1 -1
- package/dist/{standard-BaghAlFU.cjs → standard-BNGXkMX_.mjs} +1 -1
- package/dist/{standard-DKXaHXIw.mjs → standard-B_jeKmrH.cjs} +1 -1
- package/dist/tsconfig/index.cjs +1 -1
- package/dist/tsconfig/index.d.cts +12 -5
- package/dist/tsconfig/index.d.mts +12 -5
- package/dist/tsconfig/index.mjs +1 -1
- package/dist/tsdown/index.cjs +1 -1
- package/dist/tsdown/index.d.cts +0 -1
- package/dist/tsdown/index.d.mts +0 -1
- package/dist/tsdown/index.mjs +1 -1
- package/package.json +7 -7
- /package/dist/{markdown → markdownlint}/configs/base.json +0 -0
package/README.md
CHANGED
|
@@ -194,10 +194,10 @@ Parse TypeScript configuration file.
|
|
|
194
194
|
|
|
195
195
|
<summary style="cursor:pointer">Parameters</summary>
|
|
196
196
|
|
|
197
|
-
| Parameter
|
|
198
|
-
|
|
|
199
|
-
| `
|
|
200
|
-
| `
|
|
197
|
+
| Parameter | Type | Default | Description |
|
|
198
|
+
| ------------------ | ---------------------- | ------------------- | -------------------------------------------------- |
|
|
199
|
+
| `options` | `ParseTsConfigOptions` | `{}` | (Optional) An object defining required parameters. |
|
|
200
|
+
| `options.filepath` | `string` | `"./tsconfig.json"` | (Optional) The TypeScript configuration file path. |
|
|
201
201
|
|
|
202
202
|
</details>
|
|
203
203
|
|
|
@@ -247,10 +247,11 @@ Get TypeScript compiler target from resolved configuration file.
|
|
|
247
247
|
|
|
248
248
|
<summary style="cursor:pointer">Parameters</summary>
|
|
249
249
|
|
|
250
|
-
| Parameter
|
|
251
|
-
|
|
|
252
|
-
| `
|
|
253
|
-
| `
|
|
250
|
+
| Parameter | Type | Default | Description |
|
|
251
|
+
| ------------------------ | ---------------------- | ------------------- | -------------------------------------------------- |
|
|
252
|
+
| `options` | `ParseTsConfigOptions` | `{}` | (Optional) An object defining required parameters. |
|
|
253
|
+
| `options.filepath` | `string` | `"./tsconfig.json"` | (Optional) The TypeScript configuration file path. |
|
|
254
|
+
| `options.parsedTsConfig` | `ParsedCommandLine` | - | (Optional) The already parsed TS config. |
|
|
254
255
|
|
|
255
256
|
</details>
|
|
256
257
|
|
|
@@ -453,19 +454,18 @@ A callable function executed by `tsdown` processes.
|
|
|
453
454
|
|
|
454
455
|
<summary style="cursor:pointer">Default configurations</summary>
|
|
455
456
|
|
|
456
|
-
| Property
|
|
457
|
-
|
|
|
458
|
-
| `entry`
|
|
459
|
-
| `format`
|
|
460
|
-
| `dts`
|
|
461
|
-
| `shims`
|
|
462
|
-
| `clean`
|
|
463
|
-
| `treeshake`
|
|
464
|
-
| `minify`
|
|
465
|
-
| `sourcemap`
|
|
466
|
-
| `target`
|
|
467
|
-
| `deps`
|
|
468
|
-
| `deps.neverBundle` | `true` |
|
|
457
|
+
| Property | Value |
|
|
458
|
+
| ----------- | ------------------------ |
|
|
459
|
+
| `entry` | `["src/**\/index.ts"]` |
|
|
460
|
+
| `format` | `["cjs", "esm"]` |
|
|
461
|
+
| `dts` | `true` |
|
|
462
|
+
| `shims` | `true` |
|
|
463
|
+
| `clean` | `true` |
|
|
464
|
+
| `treeshake` | `true` |
|
|
465
|
+
| `minify` | `!watch` |
|
|
466
|
+
| `sourcemap` | `!!watch` |
|
|
467
|
+
| `target` | resolved tsconfig target |
|
|
468
|
+
| `deps` | `{ ... }` |
|
|
469
469
|
|
|
470
470
|
</details>
|
|
471
471
|
|
|
@@ -568,7 +568,7 @@ Simply create a `.markdownlint.json` file at the root of your project and config
|
|
|
568
568
|
|
|
569
569
|
```json
|
|
570
570
|
{
|
|
571
|
-
"extends": "@alessiofrittoli/package-configs/
|
|
571
|
+
"extends": "@alessiofrittoli/package-configs/markdownlint/base.json"
|
|
572
572
|
}
|
|
573
573
|
```
|
|
574
574
|
|
package/dist/oxlint/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../standard-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../standard-B_jeKmrH.cjs");let t=require("oxlint");const{categories:n,rules:r,plugins:i}=e.t,a=e=>{let a=[...i||[],...e?.plugins||[]];return(0,t.defineConfig)({...e,categories:{...n,...e?.categories},plugins:a.length>0?a:void 0,rules:{...r,...e?.rules}})};exports.oxlintConfig=a;
|
package/dist/oxlint/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../standard-
|
|
1
|
+
import{t as e}from"../standard-BNGXkMX_.mjs";import{defineConfig as t}from"oxlint";const{categories:n,rules:r,plugins:i}=e,a=e=>{let a=[...i||[],...e?.plugins||[]];return t({...e,categories:{...n,...e?.categories},plugins:a.length>0?a:void 0,rules:{...r,...e?.rules}})};export{a as oxlintConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../standard-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../standard-B_jeKmrH.cjs");exports.standardProfile=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../standard-
|
|
1
|
+
import{t as e}from"../../standard-BNGXkMX_.mjs";export{e as standardProfile};
|
package/dist/prettier/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../standard-6L5tOVhX.cjs"),t=t=>
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../standard-6L5tOVhX.cjs"),t=t=>{let n=[...e.t.plugins||[],...t?.plugins||[]];return{...e.t,...t,plugins:n.length>0?n:void 0}};exports.prettierConfig=t;
|
package/dist/prettier/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../standard-CRskCPOC.mjs";const t=t=>
|
|
1
|
+
import{t as e}from"../standard-CRskCPOC.mjs";const t=t=>{let n=[...e.plugins||[],...t?.plugins||[]];return{...e,...t,plugins:n.length>0?n:void 0}};export{t as prettierConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={categories:{correctness:`warn`},plugins:[`eslint`,`typescript`,`unicorn`,`oxc`],rules:{"eslint/no-unused-vars":`error`,"prefer-const":[`error`,{ignoreReadBeforeAssign:!0}],"typescript/explicit-function-return-type":`error`,"typescript/consistent-type-imports":`warn`}};
|
|
1
|
+
const e={categories:{correctness:`warn`},plugins:[`eslint`,`typescript`,`unicorn`,`oxc`],rules:{"eslint/no-unused-vars":`error`,"prefer-const":[`error`,{ignoreReadBeforeAssign:!0}],"typescript/explicit-function-return-type":`error`,"typescript/consistent-type-imports":`warn`,"typescript/no-floating-promises":`error`,"typescript/no-misused-promises":`error`}};export{e as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={categories:{correctness:`warn`},plugins:[`eslint`,`typescript`,`unicorn`,`oxc`],rules:{"eslint/no-unused-vars":`error`,"prefer-const":[`error`,{ignoreReadBeforeAssign:!0}],"typescript/explicit-function-return-type":`error`,"typescript/consistent-type-imports":`warn`}};
|
|
1
|
+
const e={categories:{correctness:`warn`},plugins:[`eslint`,`typescript`,`unicorn`,`oxc`],rules:{"eslint/no-unused-vars":`error`,"prefer-const":[`error`,{ignoreReadBeforeAssign:!0}],"typescript/explicit-function-return-type":`error`,"typescript/consistent-type-imports":`warn`,"typescript/no-floating-promises":`error`,"typescript/no-misused-promises":`error`}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
package/dist/tsconfig/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("typescript"),t=require("path"),n=require("fs");const r=(r={})=>{let{filepath:i=(0,t.resolve)(process.cwd(),`tsconfig.json`)}=r;if(!(0,n.existsSync)(i))throw Error(`No configuration file found.`,{cause:{filepath:i}});let a=(0,t.parse)(i).dir,o=(0,e.readConfigFile)(i,e.sys.readFile);return(0,e.parseJsonConfigFileContent)(o.config,e.sys,a)},i=t=>{try{let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("typescript"),t=require("path"),n=require("fs");const r=(r={})=>{let{filepath:i=(0,t.resolve)(process.cwd(),`tsconfig.json`)}=r;if(!(0,n.existsSync)(i))throw Error(`No configuration file found.`,{cause:{filepath:i}});let a=(0,t.parse)(i).dir,o=(0,e.readConfigFile)(i,e.sys.readFile);return(0,e.parseJsonConfigFileContent)(o.config,e.sys,a)},i=(t={})=>{try{let{parsedTsConfig:n}=t,i=(n||r(t)).options.target;return i?i===e.ScriptTarget.Latest?`esnext`:e.ScriptTarget[i]?.toLowerCase():void 0}catch(e){console.error(e)}};exports.getTSConfigCompilerTarget=i,exports.parseTsConfig=r;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
2
|
//#region src/tsconfig/index.d.ts
|
|
3
|
-
export interface
|
|
3
|
+
export interface ParseTsConfigOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The TypeScript configuration file path.
|
|
6
6
|
*
|
|
@@ -8,22 +8,29 @@ export interface ParseTsConfigParams {
|
|
|
8
8
|
*/
|
|
9
9
|
filepath?: string;
|
|
10
10
|
}
|
|
11
|
+
export interface GetTSConfigCompilerTargetOptions extends ParseTsConfigOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The already parsed TS config.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
parsedTsConfig?: ParsedCommandLine;
|
|
17
|
+
}
|
|
11
18
|
/**
|
|
12
19
|
* Parse TypeScript configuration file.
|
|
13
20
|
*
|
|
14
|
-
* @param
|
|
21
|
+
* @param options An object defining required parameters. See {@link ParseTsConfigOptions} for more info.
|
|
15
22
|
*
|
|
16
23
|
* @returns The parsed TypeScript configuration file.
|
|
17
24
|
*
|
|
18
25
|
* @throws {Error} if the resolved `filepath` does not exists.
|
|
19
26
|
*/
|
|
20
|
-
export declare const parseTsConfig: (
|
|
27
|
+
export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCommandLine;
|
|
21
28
|
/**
|
|
22
29
|
* Get TypeScript compiler target from resolved configuration file.
|
|
23
30
|
*
|
|
24
|
-
* @param
|
|
31
|
+
* @param options An object defining required parameters. See {@link GetTSConfigCompilerTargetOptions} for more info.
|
|
25
32
|
*
|
|
26
33
|
* @returns The resolved TypeScript compiler target if any, `undefined` otherwise.
|
|
27
34
|
*/
|
|
28
|
-
export declare const getTSConfigCompilerTarget: (
|
|
35
|
+
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
|
29
36
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
2
|
//#region src/tsconfig/index.d.ts
|
|
3
|
-
export interface
|
|
3
|
+
export interface ParseTsConfigOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The TypeScript configuration file path.
|
|
6
6
|
*
|
|
@@ -8,22 +8,29 @@ export interface ParseTsConfigParams {
|
|
|
8
8
|
*/
|
|
9
9
|
filepath?: string;
|
|
10
10
|
}
|
|
11
|
+
export interface GetTSConfigCompilerTargetOptions extends ParseTsConfigOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The already parsed TS config.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
parsedTsConfig?: ParsedCommandLine;
|
|
17
|
+
}
|
|
11
18
|
/**
|
|
12
19
|
* Parse TypeScript configuration file.
|
|
13
20
|
*
|
|
14
|
-
* @param
|
|
21
|
+
* @param options An object defining required parameters. See {@link ParseTsConfigOptions} for more info.
|
|
15
22
|
*
|
|
16
23
|
* @returns The parsed TypeScript configuration file.
|
|
17
24
|
*
|
|
18
25
|
* @throws {Error} if the resolved `filepath` does not exists.
|
|
19
26
|
*/
|
|
20
|
-
export declare const parseTsConfig: (
|
|
27
|
+
export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCommandLine;
|
|
21
28
|
/**
|
|
22
29
|
* Get TypeScript compiler target from resolved configuration file.
|
|
23
30
|
*
|
|
24
|
-
* @param
|
|
31
|
+
* @param options An object defining required parameters. See {@link GetTSConfigCompilerTargetOptions} for more info.
|
|
25
32
|
*
|
|
26
33
|
* @returns The resolved TypeScript compiler target if any, `undefined` otherwise.
|
|
27
34
|
*/
|
|
28
|
-
export declare const getTSConfigCompilerTarget: (
|
|
35
|
+
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
|
29
36
|
//#endregion
|
package/dist/tsconfig/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScriptTarget as e,parseJsonConfigFileContent as t,readConfigFile as n,sys as r}from"typescript";import{parse as i,resolve as a}from"path";import{existsSync as o}from"fs";const s=(e={})=>{let{filepath:s=a(process.cwd(),`tsconfig.json`)}=e;if(!o(s))throw Error(`No configuration file found.`,{cause:{filepath:s}});let c=i(s).dir,l=n(s,r.readFile);return t(l.config,r,c)},c=t=>{try{let
|
|
1
|
+
import{ScriptTarget as e,parseJsonConfigFileContent as t,readConfigFile as n,sys as r}from"typescript";import{parse as i,resolve as a}from"path";import{existsSync as o}from"fs";const s=(e={})=>{let{filepath:s=a(process.cwd(),`tsconfig.json`)}=e;if(!o(s))throw Error(`No configuration file found.`,{cause:{filepath:s}});let c=i(s).dir,l=n(s,r.readFile);return t(l.config,r,c)},c=(t={})=>{try{let{parsedTsConfig:n}=t,r=(n||s(t)).options.target;return r?r===e.Latest?`esnext`:e[r]?.toLowerCase():void 0}catch(e){console.error(e)}};export{c as getTSConfigCompilerTarget,s as parseTsConfig};
|
package/dist/tsdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../tsconfig/index.cjs");let t=require("tsdown");const n=(n={})=>(0,t.defineConfig)(async(t,r)=>{let{target:i,watch:a=t.watch,tsconfig:o=t.tsconfig,deps:s=t.deps,...c}=typeof n==`function`?await n(t,r):n,l=i||(typeof o==`string`?e.getTSConfigCompilerTarget({filepath:o}):i);return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],dts:!0,shims:!0,clean:!0,treeshake:!0,minify:!a,sourcemap:!!a,tsconfig:o,target:l,watch:a,deps:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../tsconfig/index.cjs");let t=require("tsdown");const n=(n={})=>(0,t.defineConfig)(async(t,r)=>{let{target:i,watch:a=t.watch,tsconfig:o=t.tsconfig,deps:s=t.deps,...c}=typeof n==`function`?await n(t,r):n,l=i||(typeof o==`string`?e.getTSConfigCompilerTarget({filepath:o}):i);return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],dts:!0,shims:!0,clean:!0,treeshake:!0,minify:!a,sourcemap:!!a,tsconfig:o,target:l,watch:a,deps:s,...c}});exports.tsdownConfig=n;
|
package/dist/tsdown/index.d.cts
CHANGED
|
@@ -24,7 +24,6 @@ export type UserConfigFn = (inlineConfig: InlineConfig, context: UserConfigFnCon
|
|
|
24
24
|
* | `sourcemap` | `!!watch` |
|
|
25
25
|
* | `target` | resolved tsconfig target |
|
|
26
26
|
* | `deps` | `{ ... }` |
|
|
27
|
-
* | `deps.neverBundle` | `true` |
|
|
28
27
|
*/
|
|
29
28
|
export declare const tsdownConfig: (options?: UserConfig | UserConfigFn) => UserConfigFn$1;
|
|
30
29
|
//#endregion
|
package/dist/tsdown/index.d.mts
CHANGED
|
@@ -24,7 +24,6 @@ export type UserConfigFn = (inlineConfig: InlineConfig, context: UserConfigFnCon
|
|
|
24
24
|
* | `sourcemap` | `!!watch` |
|
|
25
25
|
* | `target` | resolved tsconfig target |
|
|
26
26
|
* | `deps` | `{ ... }` |
|
|
27
|
-
* | `deps.neverBundle` | `true` |
|
|
28
27
|
*/
|
|
29
28
|
export declare const tsdownConfig: (options?: UserConfig | UserConfigFn) => UserConfigFn$1;
|
|
30
29
|
//#endregion
|
package/dist/tsdown/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getTSConfigCompilerTarget as e}from"../tsconfig/index.mjs";import{defineConfig as t}from"tsdown";const n=(n={})=>t(async(t,r)=>{let{target:i,watch:a=t.watch,tsconfig:o=t.tsconfig,deps:s=t.deps,...c}=typeof n==`function`?await n(t,r):n,l=i||(typeof o==`string`?e({filepath:o}):i);return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],dts:!0,shims:!0,clean:!0,treeshake:!0,minify:!a,sourcemap:!!a,tsconfig:o,target:l,watch:a,deps:
|
|
1
|
+
import{getTSConfigCompilerTarget as e}from"../tsconfig/index.mjs";import{defineConfig as t}from"tsdown";const n=(n={})=>t(async(t,r)=>{let{target:i,watch:a=t.watch,tsconfig:o=t.tsconfig,deps:s=t.deps,...c}=typeof n==`function`?await n(t,r):n,l=i||(typeof o==`string`?e({filepath:o}):i);return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],dts:!0,shims:!0,clean:!0,treeshake:!0,minify:!a,sourcemap:!!a,tsconfig:o,target:l,watch:a,deps:s,...c}});export{n as tsdownConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/package-configs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Utility library that offers base configurations for your packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"import": "./dist/tsconfig/configs/*.json",
|
|
67
67
|
"require": "./dist/tsconfig/configs/*.json"
|
|
68
68
|
},
|
|
69
|
-
"./
|
|
70
|
-
"import": "./dist/
|
|
71
|
-
"require": "./dist/
|
|
69
|
+
"./markdownlint/*.json": {
|
|
70
|
+
"import": "./dist/markdownlint/configs/*.json",
|
|
71
|
+
"require": "./dist/markdownlint/configs/*.json"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
@@ -101,10 +101,7 @@
|
|
|
101
101
|
"globals": "^17.12.0",
|
|
102
102
|
"oxlint": "^1.85.0",
|
|
103
103
|
"prettier": "^3.9.9",
|
|
104
|
-
"prettier-plugin-organize-imports": "^4.3.0",
|
|
105
|
-
"prettier-plugin-sh": "^0.20.2",
|
|
106
104
|
"prettier-plugin-sort-imports": "^1.8.11",
|
|
107
|
-
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
108
105
|
"tsdown": "^0.23.0",
|
|
109
106
|
"typescript": "^6.0.3",
|
|
110
107
|
"typescript-eslint": "^8.70.1",
|
|
@@ -127,6 +124,9 @@
|
|
|
127
124
|
"prettier": {
|
|
128
125
|
"optional": true
|
|
129
126
|
},
|
|
127
|
+
"prettier-plugin-sort-imports": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
130
|
"tsdown": {
|
|
131
131
|
"optional": true
|
|
132
132
|
},
|
|
File without changes
|