@alessiofrittoli/package-configs 1.7.0 → 1.8.0-alpha.2
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/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.d.cts +22 -2
- package/dist/oxlint/profiles/index.d.mts +22 -2
- package/dist/oxlint/profiles/index.mjs +1 -1
- package/dist/standard-BQ3PXrMc.mjs +1 -0
- package/dist/standard-BfZttPv4.cjs +1 -0
- package/dist/tsconfig/index.cjs +1 -1
- package/dist/tsconfig/index.mjs +1 -1
- package/package.json +14 -7
- package/scripts/postinstall/index.ts +90 -0
- package/scripts/postinstall/install-dependencies.ts +136 -0
- package/dist/standard-CObuhDHj.cjs +0 -1
- package/dist/standard-ty7dwh8r.mjs +0 -1
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-BfZttPv4.cjs");let t=require("oxlint");const{categories:n,rules:r,options:i}=e.t,a=e=>(0,t.defineConfig)({...e,options:{...i,...e?.options},categories:{...n,...e?.categories},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-BQ3PXrMc.mjs";import{defineConfig as t}from"oxlint";const{categories:n,rules:r,options:i}=e,a=e=>t({...e,options:{...i,...e?.options},categories:{...n,...e?.categories},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-BfZttPv4.cjs");exports.standardProfile=e.t;
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const standardProfile: {
|
|
2
|
+
options: {
|
|
3
|
+
typeAware: true;
|
|
4
|
+
typeCheck: true;
|
|
5
|
+
};
|
|
6
|
+
categories: {
|
|
7
|
+
correctness: "warn";
|
|
8
|
+
};
|
|
9
|
+
rules: {
|
|
10
|
+
'eslint/no-unused-vars': "error";
|
|
11
|
+
'prefer-const': ["error", {
|
|
12
|
+
ignoreReadBeforeAssign: true;
|
|
13
|
+
}];
|
|
14
|
+
'typescript/explicit-function-return-type': "error";
|
|
15
|
+
'typescript/consistent-type-imports': "warn";
|
|
16
|
+
'typescript/no-floating-promises': "error";
|
|
17
|
+
'typescript/no-misused-promises': "error";
|
|
18
|
+
'typescript/no-explicit-any': "error";
|
|
19
|
+
'typescript/explicit-member-accessibility': "error";
|
|
20
|
+
'no-param-reassign': "error";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const standardProfile: {
|
|
2
|
+
options: {
|
|
3
|
+
typeAware: true;
|
|
4
|
+
typeCheck: true;
|
|
5
|
+
};
|
|
6
|
+
categories: {
|
|
7
|
+
correctness: "warn";
|
|
8
|
+
};
|
|
9
|
+
rules: {
|
|
10
|
+
'eslint/no-unused-vars': "error";
|
|
11
|
+
'prefer-const': ["error", {
|
|
12
|
+
ignoreReadBeforeAssign: true;
|
|
13
|
+
}];
|
|
14
|
+
'typescript/explicit-function-return-type': "error";
|
|
15
|
+
'typescript/consistent-type-imports': "warn";
|
|
16
|
+
'typescript/no-floating-promises': "error";
|
|
17
|
+
'typescript/no-misused-promises': "error";
|
|
18
|
+
'typescript/no-explicit-any': "error";
|
|
19
|
+
'typescript/explicit-member-accessibility': "error";
|
|
20
|
+
'no-param-reassign': "error";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as standardProfile}from"../../standard-
|
|
1
|
+
export{t as standardProfile}from"../../standard-BQ3PXrMc.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={options:{typeAware:!0,typeCheck:!0},categories:{correctness:`warn`},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`,"typescript/no-explicit-any":`error`,"typescript/explicit-member-accessibility":`error`,"no-param-reassign":`error`}};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={options:{typeAware:!0,typeCheck:!0},categories:{correctness:`warn`},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`,"typescript/no-explicit-any":`error`,"typescript/explicit-member-accessibility":`error`,"no-param-reassign":`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{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
|
+
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,t=>e.sys.readFile(t));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;
|
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{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};
|
|
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,e=>r.readFile(e));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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/package-configs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-alpha.2",
|
|
4
4
|
"description": "Utility library that offers base configurations for your packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"module": "./dist/index.mjs",
|
|
40
40
|
"types": "./dist/index.d.mts",
|
|
41
41
|
"files": [
|
|
42
|
-
"dist"
|
|
42
|
+
"dist",
|
|
43
|
+
"scripts/postinstall"
|
|
43
44
|
],
|
|
44
45
|
"exports": {
|
|
45
46
|
".": {
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"eslint-plugin-react-server-components": "^1.2.0",
|
|
81
82
|
"globals": "^17.12.0",
|
|
82
83
|
"oxlint": "^1.85.0",
|
|
84
|
+
"oxlint-tsgolint": "^7.0.2004",
|
|
83
85
|
"prettier": "^3.9.9",
|
|
84
86
|
"prettier-plugin-sort-imports": "^1.8.11",
|
|
85
87
|
"tsdown": "^0.23.0",
|
|
@@ -113,6 +115,9 @@
|
|
|
113
115
|
"oxlint": {
|
|
114
116
|
"optional": true
|
|
115
117
|
},
|
|
118
|
+
"oxlint-tsgolint": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
116
121
|
"prettier": {
|
|
117
122
|
"optional": true
|
|
118
123
|
},
|
|
@@ -141,6 +146,7 @@
|
|
|
141
146
|
"@eslint/eslintrc": "^3.3.7",
|
|
142
147
|
"@eslint/js": "^10.0.1",
|
|
143
148
|
"@types/node": "^24.13.2",
|
|
149
|
+
"@types/prompts": "^2.4.9",
|
|
144
150
|
"@vitest/coverage-v8": "5.0.5",
|
|
145
151
|
"concurrently": "^10.0.6",
|
|
146
152
|
"eslint": "^10.11.0",
|
|
@@ -148,25 +154,26 @@
|
|
|
148
154
|
"eslint-plugin-react-server-components": "^1.2.0",
|
|
149
155
|
"globals": "^17.13.0",
|
|
150
156
|
"http-server": "^14.1.1",
|
|
151
|
-
"jiti": "^2.7.0",
|
|
152
157
|
"oxlint": "^1.89.0",
|
|
158
|
+
"oxlint-tsgolint": "^7.0.2004",
|
|
153
159
|
"prettier": "^3.9.10",
|
|
154
|
-
"prettier-plugin-organize-imports": "^4.3.0",
|
|
155
|
-
"prettier-plugin-sh": "^0.20.2",
|
|
156
160
|
"prettier-plugin-sort-imports": "^1.8.11",
|
|
157
|
-
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
158
161
|
"tsdown": "^0.23.1",
|
|
159
162
|
"typescript": "6.0.3",
|
|
160
163
|
"typescript-eslint": "^8.72.0",
|
|
161
164
|
"vite": "^8.3.5",
|
|
162
165
|
"vitest": "^5.0.5"
|
|
163
166
|
},
|
|
167
|
+
"dependencies": {
|
|
168
|
+
"@alessiofrittoli/chain-functions": "^2.7.0",
|
|
169
|
+
"prompts": "^2.4.2"
|
|
170
|
+
},
|
|
164
171
|
"scripts": {
|
|
165
172
|
"//1a": "*********************************************************************",
|
|
166
173
|
"//1b": "******************** DEV - BUILD - LINT - RELEASE *******************",
|
|
167
174
|
"//1c": "*********************************************************************",
|
|
168
175
|
"dev": "tsdown --watch",
|
|
169
|
-
"build": "pnpm lint && pnpm
|
|
176
|
+
"build": "pnpm lint && pnpm tsdown",
|
|
170
177
|
"eslint": "eslint -c legacy-eslint.config.ts --report-unused-disable-directives --max-warnings 0 --cache --cache-location .cache/eslint",
|
|
171
178
|
"lint": "oxlint --report-unused-disable-directives --max-warnings 0",
|
|
172
179
|
"release": "node scripts/release.ts --verbose --npm",
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ChainFactory, LastChainLink } from '@alessiofrittoli/chain-functions/types'
|
|
2
|
+
import { installDependencies } from './install-dependencies.ts'
|
|
3
|
+
import project from '../../package.json' with { type: 'json' }
|
|
4
|
+
import { Chain } from '@alessiofrittoli/chain-functions'
|
|
5
|
+
import { readFileSync } from 'fs'
|
|
6
|
+
import { resolve } from 'path'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents a package in the project.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
interface Package {
|
|
13
|
+
/**
|
|
14
|
+
* The root directory of the project.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
root: string
|
|
18
|
+
/**
|
|
19
|
+
* The name of the project.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
name: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type PackageJson = Record<string, string | Record<string, string>> & { name: string }
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Reads and parses the `package.json` file from the specified root directory.
|
|
29
|
+
*
|
|
30
|
+
* @param root - The root directory where the `package.json` file is located.
|
|
31
|
+
* @returns The parsed contents of the `package.json` file as an object.
|
|
32
|
+
* @throws Will throw an error if the file cannot be read or parsed.
|
|
33
|
+
*/
|
|
34
|
+
const getPackageJson = (root: Package['root']): PackageJson =>
|
|
35
|
+
JSON.parse(readFileSync(resolve(root, 'package.json')).toString()) as PackageJson
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Determines if the script is running in an external project.
|
|
39
|
+
*
|
|
40
|
+
* @param project - The options object excluding the 'outputFile' property.
|
|
41
|
+
* @returns A boolean indicating whether the script is running in an external project.
|
|
42
|
+
* @throws Will throw an error if `INIT_CWD` is not set or if the script cannot determine the project status.
|
|
43
|
+
*/
|
|
44
|
+
const isExternalPackage = ({ root, name }: Package): boolean => {
|
|
45
|
+
try {
|
|
46
|
+
const project = getPackageJson(root)
|
|
47
|
+
|
|
48
|
+
if (project.name.endsWith(name)) {
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
return true
|
|
52
|
+
} catch (cause) {
|
|
53
|
+
throw new Error("Couldn't check if script is running in an external project.", { cause })
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves the root directory of the current process.
|
|
59
|
+
*
|
|
60
|
+
* @returns The root directory of the current process, determined by the `INIT_CWD` environment variable if set,
|
|
61
|
+
* otherwise the current working directory.
|
|
62
|
+
*/
|
|
63
|
+
const getProcessRoot = (): string => process.env.INIT_CWD || process.cwd()
|
|
64
|
+
|
|
65
|
+
interface PostInstallChainFnParams {
|
|
66
|
+
cwd: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type PostInstallChainFn = (params: PostInstallChainFnParams) => void | Promise<void>
|
|
70
|
+
|
|
71
|
+
const lastChainLink: LastChainLink<PostInstallChainFn> = () => () => {
|
|
72
|
+
console.log({
|
|
73
|
+
package: project.name,
|
|
74
|
+
message: `Post-Install done. Thank you for installing ${project.name}!`,
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const postInstallChain: ChainFactory<PostInstallChainFn> = [installDependencies, lastChainLink]
|
|
79
|
+
|
|
80
|
+
const runChain = async (): Promise<void> => {
|
|
81
|
+
const cwd = getProcessRoot()
|
|
82
|
+
|
|
83
|
+
if (!isExternalPackage({ name: project.name, root: cwd })) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
await Chain.functions(postInstallChain)({ cwd })
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
runChain().catch(console.error)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { ChainLink } from '@alessiofrittoli/chain-functions/types'
|
|
2
|
+
import type { PostInstallChainFn } from '.'
|
|
3
|
+
import { execSync } from 'child_process'
|
|
4
|
+
import prompts from 'prompts'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Check whether script is running in a CI environment.
|
|
8
|
+
*
|
|
9
|
+
* @remarks Check if `CI` or `GITHUB_ACTIONS` is `true` or `GITHUB_WORKFLOW` is defined.
|
|
10
|
+
*
|
|
11
|
+
* @returns `true` if the script is running in a CI environment, `false` otherwise.
|
|
12
|
+
*/
|
|
13
|
+
const isCIEnv = (): boolean =>
|
|
14
|
+
process.env.CI === 'true' ||
|
|
15
|
+
process.env.GITHUB_ACTIONS === 'true' ||
|
|
16
|
+
typeof process.env.GITHUB_WORKFLOW !== 'undefined'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Removes duplicate values from an array.
|
|
20
|
+
*
|
|
21
|
+
* @param array The input array.
|
|
22
|
+
* @returns The filtered array.
|
|
23
|
+
*/
|
|
24
|
+
export const arrayUnique = <T>(array: T[]): T[] => (array.length <= 0 ? array : [...new Set(array)])
|
|
25
|
+
|
|
26
|
+
export const installDependencies: ChainLink<PostInstallChainFn> =
|
|
27
|
+
next =>
|
|
28
|
+
async (params): Promise<void> => {
|
|
29
|
+
if (isCIEnv()) {
|
|
30
|
+
return next(params)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { cwd } = params
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
const { installDeps } = await prompts([
|
|
37
|
+
{
|
|
38
|
+
type: 'confirm',
|
|
39
|
+
name: 'installDeps',
|
|
40
|
+
message: 'Would you like to install optional dependencies?',
|
|
41
|
+
initial: true,
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
|
|
45
|
+
if (!installDeps) {
|
|
46
|
+
return next(params)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { _dependenciesChoice } = await prompts([
|
|
50
|
+
{
|
|
51
|
+
type: 'multiselect',
|
|
52
|
+
name: '_dependenciesChoice',
|
|
53
|
+
message: "Please, select which tool you're going to use",
|
|
54
|
+
choices: [
|
|
55
|
+
{
|
|
56
|
+
title: 'Vite',
|
|
57
|
+
selected: true,
|
|
58
|
+
description: 'Will install Vite',
|
|
59
|
+
value: ['vite'],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: 'Vitest',
|
|
63
|
+
selected: true,
|
|
64
|
+
description: 'Will install Vitest',
|
|
65
|
+
value: ['vitest', '@vitest/coverage-v8'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: 'Oxlint',
|
|
69
|
+
selected: true,
|
|
70
|
+
description: 'Will install Oxlint',
|
|
71
|
+
value: ['oxlint', 'oxlint-tsgolint'],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: 'Prettier',
|
|
75
|
+
selected: true,
|
|
76
|
+
description: 'Will install Prettier',
|
|
77
|
+
value: ['prettier', 'prettier-plugin-sort-imports'],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: 'tsdown',
|
|
81
|
+
selected: true,
|
|
82
|
+
description: 'Will install tsdown',
|
|
83
|
+
value: ['tsdown'],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: 'ESLint',
|
|
87
|
+
selected: false,
|
|
88
|
+
description: 'Will install ESLint dev dependencies',
|
|
89
|
+
value: [
|
|
90
|
+
'eslint',
|
|
91
|
+
'@eslint/compat',
|
|
92
|
+
'@eslint/eslintrc',
|
|
93
|
+
'@eslint/js',
|
|
94
|
+
'globals',
|
|
95
|
+
'typescript-eslint',
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: 'Next.js',
|
|
100
|
+
description: 'Will install Next.js related ESLint dev dependencies',
|
|
101
|
+
selected: false,
|
|
102
|
+
value: [
|
|
103
|
+
'eslint',
|
|
104
|
+
'@eslint/compat',
|
|
105
|
+
'@eslint/eslintrc',
|
|
106
|
+
'@eslint/js',
|
|
107
|
+
'globals',
|
|
108
|
+
'typescript-eslint',
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
])
|
|
114
|
+
|
|
115
|
+
if (!_dependenciesChoice) {
|
|
116
|
+
return next(params)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const dependenciesChoice = arrayUnique((_dependenciesChoice as string[][]).flatMap(c => c))
|
|
120
|
+
|
|
121
|
+
let engine: 'npm' | 'pnpm' = 'npm'
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
execSync('pnpm -v', { cwd, stdio: 'ignore' })
|
|
125
|
+
engine = 'pnpm'
|
|
126
|
+
} catch {
|
|
127
|
+
engine = 'npm'
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const installCommand = engine === 'npm' ? 'npm install --save-dev' : 'pnpm add --save-dev'
|
|
131
|
+
|
|
132
|
+
execSync(`${installCommand} ${dependenciesChoice.join(' ')}`, { cwd, stdio: 'inherit' })
|
|
133
|
+
} catch {
|
|
134
|
+
return next(params)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
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`,"typescript/no-explicit-any":`error`,"typescript/explicit-member-accessibility":`error`,"no-param-reassign":`error`}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
|
@@ -1 +0,0 @@
|
|
|
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`,"typescript/no-explicit-any":`error`,"typescript/explicit-member-accessibility":`error`,"no-param-reassign":`error`}};export{e as t};
|