@alessiofrittoli/package-configs 1.8.1 → 1.9.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 +26 -0
- package/dist/tsconfig/index.d.cts +10 -0
- package/dist/tsconfig/index.d.mts +10 -0
- package/dist/tsdown/index.cjs +1 -1
- package/dist/tsdown/index.d.mts +1 -1
- package/dist/tsdown/index.mjs +1 -1
- package/package.json +11 -6
- package/scripts/install-dependencies.cjs +5 -3
package/README.md
CHANGED
|
@@ -186,10 +186,30 @@ This file is intended for `base` processes and it mainly contains all the requir
|
|
|
186
186
|
|
|
187
187
|
---
|
|
188
188
|
|
|
189
|
+
<details>
|
|
190
|
+
|
|
191
|
+
<summary style="cursor:pointer">Next.JS bundler configuration file</summary>
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"extends": "@alessiofrittoli/package-configs/tsconfig/nextjs-bundler.json"
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
189
203
|
##### TypeScript utility functions
|
|
190
204
|
|
|
191
205
|
###### `parseTsConfig()`
|
|
192
206
|
|
|
207
|
+
> [!WARNING]
|
|
208
|
+
>
|
|
209
|
+
> @deprecated
|
|
210
|
+
>
|
|
211
|
+
> This function has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
212
|
+
|
|
193
213
|
Parse TypeScript configuration file.
|
|
194
214
|
|
|
195
215
|
<details>
|
|
@@ -243,6 +263,12 @@ const parsedTsConfig = parseTsConfig({ filepath: './tsconfig.build.json' })
|
|
|
243
263
|
|
|
244
264
|
###### `getTSConfigCompilerTarget()`
|
|
245
265
|
|
|
266
|
+
> [!WARNING]
|
|
267
|
+
>
|
|
268
|
+
> @deprecated
|
|
269
|
+
>
|
|
270
|
+
> This function has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
271
|
+
|
|
246
272
|
Get TypeScript compiler target from resolved configuration file.
|
|
247
273
|
|
|
248
274
|
<details>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated This interface has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
4
|
+
*/
|
|
2
5
|
export interface ParseTsConfigOptions {
|
|
3
6
|
/**
|
|
4
7
|
* The TypeScript configuration file path.
|
|
@@ -7,6 +10,9 @@ export interface ParseTsConfigOptions {
|
|
|
7
10
|
*/
|
|
8
11
|
filepath?: string;
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This interface has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
15
|
+
*/
|
|
10
16
|
export interface GetTSConfigCompilerTargetOptions extends ParseTsConfigOptions {
|
|
11
17
|
/**
|
|
12
18
|
* The already parsed TS config.
|
|
@@ -22,6 +28,8 @@ export interface GetTSConfigCompilerTargetOptions extends ParseTsConfigOptions {
|
|
|
22
28
|
* @returns The parsed TypeScript configuration file.
|
|
23
29
|
*
|
|
24
30
|
* @throws {Error} if the resolved `filepath` does not exists.
|
|
31
|
+
*
|
|
32
|
+
* @deprecated This function has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
25
33
|
*/
|
|
26
34
|
export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCommandLine;
|
|
27
35
|
/**
|
|
@@ -30,5 +38,7 @@ export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCo
|
|
|
30
38
|
* @param options An object defining required parameters. See {@link GetTSConfigCompilerTargetOptions} for more info.
|
|
31
39
|
*
|
|
32
40
|
* @returns The resolved TypeScript compiler target if any, `undefined` otherwise.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated This function has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
33
43
|
*/
|
|
34
44
|
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated This interface has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
4
|
+
*/
|
|
2
5
|
export interface ParseTsConfigOptions {
|
|
3
6
|
/**
|
|
4
7
|
* The TypeScript configuration file path.
|
|
@@ -7,6 +10,9 @@ export interface ParseTsConfigOptions {
|
|
|
7
10
|
*/
|
|
8
11
|
filepath?: string;
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This interface has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
15
|
+
*/
|
|
10
16
|
export interface GetTSConfigCompilerTargetOptions extends ParseTsConfigOptions {
|
|
11
17
|
/**
|
|
12
18
|
* The already parsed TS config.
|
|
@@ -22,6 +28,8 @@ export interface GetTSConfigCompilerTargetOptions extends ParseTsConfigOptions {
|
|
|
22
28
|
* @returns The parsed TypeScript configuration file.
|
|
23
29
|
*
|
|
24
30
|
* @throws {Error} if the resolved `filepath` does not exists.
|
|
31
|
+
*
|
|
32
|
+
* @deprecated This function has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
25
33
|
*/
|
|
26
34
|
export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCommandLine;
|
|
27
35
|
/**
|
|
@@ -30,5 +38,7 @@ export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCo
|
|
|
30
38
|
* @param options An object defining required parameters. See {@link GetTSConfigCompilerTargetOptions} for more info.
|
|
31
39
|
*
|
|
32
40
|
* @returns The resolved TypeScript compiler target if any, `undefined` otherwise.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated This function has been moved to [`@alessiofrittoli/tsconfig`](https://npmjs.org/package/@alessiofrittoli/tsconfig) package.
|
|
33
43
|
*/
|
|
34
44
|
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
package/dist/tsdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@alessiofrittoli/tsconfig"),t=require("tsdown");const n=(n={})=>(0,t.defineConfig)(async(t,r)=>{let{target:i,watch:a,tsconfig:o,deps:s,clean:c,outDir:l,parsedTsConfig:u,...d}=typeof n==`function`?await n(t,r):n,{target:f=i,watch:p=a,tsconfig:m=o,deps:h=s,clean:g=c??!p,outDir:_=l}=t,v=u||m||typeof m==`string`?(0,e.parseTsConfig)({filepath:typeof m==`string`?m:void 0}):void 0,y=_||v?.options.outDir||`dist`,b=f||v&&(0,e.getTSConfigCompilerTarget)({parsedTsConfig:v});return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],outDir:y,dts:!0,shims:!0,clean:g,treeshake:!0,minify:!p,sourcemap:!!p,tsconfig:m,target:b,watch:p,deps:h,...d}});exports.tsdownConfig=n;
|
package/dist/tsdown/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ParsedCommandLine } from "typescript";
|
|
2
1
|
import { InlineConfig, UserConfig, UserConfigFn as UserConfigFn$1, UserConfigFnContext } from "tsdown";
|
|
2
|
+
import { ParsedCommandLine } from "typescript";
|
|
3
3
|
export interface UserTsdownConfig extends UserConfig {
|
|
4
4
|
/**
|
|
5
5
|
* The already parsed TS config.
|
package/dist/tsdown/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getTSConfigCompilerTarget as e,parseTsConfig as t}from"
|
|
1
|
+
import{getTSConfigCompilerTarget as e,parseTsConfig as t}from"@alessiofrittoli/tsconfig";import{defineConfig as n}from"tsdown";const r=(r={})=>n(async(n,i)=>{let{target:a,watch:o,tsconfig:s,deps:c,clean:l,outDir:u,parsedTsConfig:d,...f}=typeof r==`function`?await r(n,i):r,{target:p=a,watch:m=o,tsconfig:h=s,deps:g=c,clean:_=l??!m,outDir:v=u}=n,y=d||h||typeof h==`string`?t({filepath:typeof h==`string`?h:void 0}):void 0,b=v||y?.options.outDir||`dist`,x=p||y&&e({parsedTsConfig:y});return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],outDir:b,dts:!0,shims:!0,clean:_,treeshake:!0,minify:!m,sourcemap:!!m,tsconfig:h,target:x,watch:m,deps:g,...f}});export{r as tsdownConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/package-configs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Utility library that offers base configurations for your packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
+
"@alessiofrittoli/tsconfig": "^1.0.0",
|
|
76
77
|
"@eslint/compat": "^2.1.1",
|
|
77
78
|
"@eslint/eslintrc": "^3.3.7",
|
|
78
79
|
"@eslint/js": "^10.0.1",
|
|
@@ -91,6 +92,9 @@
|
|
|
91
92
|
"vitest": "^5.0.1"
|
|
92
93
|
},
|
|
93
94
|
"peerDependenciesMeta": {
|
|
95
|
+
"@alessiofrittoli/tsconfig": {
|
|
96
|
+
"optional": true
|
|
97
|
+
},
|
|
94
98
|
"@eslint/compat": {
|
|
95
99
|
"optional": true
|
|
96
100
|
},
|
|
@@ -141,7 +145,8 @@
|
|
|
141
145
|
}
|
|
142
146
|
},
|
|
143
147
|
"devDependencies": {
|
|
144
|
-
"@alessiofrittoli/node-scripts": "^4.
|
|
148
|
+
"@alessiofrittoli/node-scripts": "^4.2.0",
|
|
149
|
+
"@alessiofrittoli/tsconfig": "^1.0.0",
|
|
145
150
|
"@eslint/compat": "^2.1.1",
|
|
146
151
|
"@eslint/eslintrc": "^3.3.7",
|
|
147
152
|
"@eslint/js": "^10.0.1",
|
|
@@ -149,16 +154,16 @@
|
|
|
149
154
|
"@types/prompts": "^2.4.9",
|
|
150
155
|
"@vitest/coverage-v8": "5.0.5",
|
|
151
156
|
"concurrently": "^10.0.6",
|
|
152
|
-
"eslint": "^10.
|
|
153
|
-
"eslint-config-next": "^16.4.
|
|
157
|
+
"eslint": "^10.13.0",
|
|
158
|
+
"eslint-config-next": "^16.4.3",
|
|
154
159
|
"eslint-plugin-react-server-components": "^1.2.0",
|
|
155
160
|
"globals": "^17.13.0",
|
|
156
161
|
"http-server": "^14.1.1",
|
|
157
162
|
"oxlint": "^1.89.0",
|
|
158
|
-
"oxlint-tsgolint": "^7.0.
|
|
163
|
+
"oxlint-tsgolint": "^7.0.2005",
|
|
159
164
|
"prettier": "^3.9.10",
|
|
160
165
|
"prettier-plugin-sort-imports": "^1.8.11",
|
|
161
|
-
"tsdown": "^0.23.
|
|
166
|
+
"tsdown": "^0.23.2",
|
|
162
167
|
"typescript": "6.0.3",
|
|
163
168
|
"typescript-eslint": "^8.72.0",
|
|
164
169
|
"vite": "^8.3.5",
|
|
@@ -93,7 +93,7 @@ const installDependencies = async () => {
|
|
|
93
93
|
choices: [
|
|
94
94
|
{
|
|
95
95
|
title: 'Vite',
|
|
96
|
-
selected:
|
|
96
|
+
selected: false,
|
|
97
97
|
description: 'Will install Vite',
|
|
98
98
|
value: ['vite'],
|
|
99
99
|
},
|
|
@@ -101,7 +101,7 @@ const installDependencies = async () => {
|
|
|
101
101
|
title: 'Vitest',
|
|
102
102
|
selected: true,
|
|
103
103
|
description: 'Will install Vitest',
|
|
104
|
-
value: ['vitest', '@vitest/coverage-v8'],
|
|
104
|
+
value: ['vitest', 'jsdom', '@vitest/coverage-v8'],
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
title: 'Oxlint',
|
|
@@ -145,6 +145,8 @@ const installDependencies = async () => {
|
|
|
145
145
|
'@eslint/js',
|
|
146
146
|
'globals',
|
|
147
147
|
'typescript-eslint',
|
|
148
|
+
'eslint-config-next',
|
|
149
|
+
'eslint-plugin-react-server-components',
|
|
148
150
|
],
|
|
149
151
|
},
|
|
150
152
|
],
|
|
@@ -172,7 +174,7 @@ const installDependencies = async () => {
|
|
|
172
174
|
|
|
173
175
|
const installCommand = engine === 'npm' ? 'npm install --save-dev' : 'pnpm add --save-dev'
|
|
174
176
|
|
|
175
|
-
execSync(`${installCommand} ${dependenciesChoice.join(' ')}`, { cwd, stdio: '
|
|
177
|
+
execSync(`${installCommand} ${dependenciesChoice.join(' ')}`, { cwd, stdio: 'inherit' })
|
|
176
178
|
|
|
177
179
|
return process.exit(0)
|
|
178
180
|
} catch {
|