@alessiofrittoli/package-configs 1.6.0 → 1.8.0-alpha.1
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 +1 -0
- package/dist/eslint/index.cjs +1 -1
- package/dist/eslint/index.d.cts +1 -3
- package/dist/eslint/index.d.mts +1 -3
- package/dist/eslint/profiles/index.cjs +1 -1
- package/dist/eslint/profiles/index.d.cts +1 -3
- package/dist/eslint/profiles/index.d.mts +1 -3
- package/dist/eslint/profiles/index.mjs +1 -1
- package/dist/eslint/profiles/nextjs/index.cjs +1 -0
- package/dist/eslint/profiles/nextjs/index.d.cts +1 -0
- package/dist/eslint/profiles/nextjs/index.d.mts +1 -0
- package/dist/eslint/profiles/nextjs/index.mjs +1 -0
- package/dist/index.cjs +0 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/oxlint/index.cjs +1 -1
- package/dist/oxlint/index.d.cts +0 -2
- package/dist/oxlint/index.d.mts +0 -2
- package/dist/oxlint/index.mjs +1 -1
- package/dist/oxlint/profiles/index.cjs +1 -1
- package/dist/oxlint/profiles/index.d.cts +22 -4
- package/dist/oxlint/profiles/index.d.mts +22 -4
- package/dist/oxlint/profiles/index.mjs +1 -1
- package/dist/prettier/index.d.cts +0 -2
- package/dist/prettier/index.d.mts +0 -2
- package/dist/prettier/profiles/index.d.cts +1 -3
- package/dist/prettier/profiles/index.d.mts +1 -3
- package/dist/prettier/profiles/index.mjs +1 -1
- package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
- package/dist/standard-BQ3PXrMc.mjs +1 -0
- package/dist/standard-BfZttPv4.cjs +1 -0
- package/dist/standard-DDkFL_et.cjs +1 -0
- package/dist/tsconfig/configs/base.json +0 -1
- package/dist/tsconfig/configs/nextjs-bundler.json +16 -0
- package/dist/tsconfig/configs/react-bundler.json +0 -1
- package/dist/tsconfig/index.cjs +1 -1
- package/dist/tsconfig/index.d.cts +1 -3
- package/dist/tsconfig/index.d.mts +1 -3
- package/dist/tsconfig/index.mjs +1 -1
- package/dist/tsdown/index.d.cts +1 -3
- package/dist/tsdown/index.d.mts +1 -3
- package/dist/vite/index.d.cts +1 -3
- package/dist/vite/index.d.mts +1 -3
- package/package.json +197 -166
- package/scripts/postinstall/index.ts +84 -0
- package/scripts/postinstall/install-dependencies.ts +132 -0
- package/dist/standard-BgmRUkms.cjs +0 -1
- package/dist/standard-C52ivef-.mjs +0 -1
- package/dist/standard-DahEN_JJ.cjs +0 -1
package/README.md
CHANGED
package/dist/eslint/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-DDkFL_et.cjs"),t=(...t)=>[...e.t,...t];exports.eslintConfig=t;
|
package/dist/eslint/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Linter } from "eslint";
|
|
2
|
-
//#region src/eslint/index.d.ts
|
|
3
2
|
export type LinterConfig = Linter.Config;
|
|
4
3
|
export type LinterConfigArray = LinterConfig[];
|
|
5
4
|
/**
|
|
@@ -9,5 +8,4 @@ export type LinterConfigArray = LinterConfig[];
|
|
|
9
8
|
*
|
|
10
9
|
* @returns The ESLint configuration array.
|
|
11
10
|
*/
|
|
12
|
-
export declare const eslintConfig: (...configs: LinterConfigArray) => LinterConfigArray;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare const eslintConfig: (...configs: LinterConfigArray) => LinterConfigArray;
|
package/dist/eslint/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Linter } from "eslint";
|
|
2
|
-
//#region src/eslint/index.d.ts
|
|
3
2
|
export type LinterConfig = Linter.Config;
|
|
4
3
|
export type LinterConfigArray = LinterConfig[];
|
|
5
4
|
/**
|
|
@@ -9,5 +8,4 @@ export type LinterConfigArray = LinterConfig[];
|
|
|
9
8
|
*
|
|
10
9
|
* @returns The ESLint configuration array.
|
|
11
10
|
*/
|
|
12
|
-
export declare const eslintConfig: (...configs: LinterConfigArray) => LinterConfigArray;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare const eslintConfig: (...configs: LinterConfigArray) => LinterConfigArray;
|
|
@@ -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-DDkFL_et.cjs");exports.standardProfile=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{t as standardProfile}from"../../standard-9H_vBPqI.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../rolldown-runtime-BocRIvOZ.cjs");let t=require("path"),n=require("eslint-config-next/core-web-vitals");n=e.t(n,1);let r=require("eslint/config"),i=require("eslint-config-next/typescript");i=e.t(i,1);let a=require("@eslint/compat"),o=require("@eslint/eslintrc");const s=(0,require("url").fileURLToPath)(require("url").pathToFileURL(__filename).href),c=(0,t.dirname)(s),l=new o.FlatCompat({baseDirectory:c}),u=(0,r.defineConfig)([...n.default,...i.default,(0,r.globalIgnores)([`.next/**`,`out/**`,`build/**`,`next-env.d.ts`]),...(0,a.fixupConfigRules)(l.extends(`plugin:react-server-components/recommended`)),{settings:{react:{version:`detect`}}}]);exports.nextjsProfile=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nextjsProfile: import("eslint/config").ConfigObject[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nextjsProfile: import("eslint/config").ConfigObject[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dirname as e}from"path";import t from"eslint-config-next/core-web-vitals";import{defineConfig as n,globalIgnores as r}from"eslint/config";import i from"eslint-config-next/typescript";import{fixupConfigRules as a}from"@eslint/compat";import{FlatCompat as o}from"@eslint/eslintrc";import{fileURLToPath as s}from"url";const c=s(import.meta.url),l=e(c),u=new o({baseDirectory:l}),d=n([...t,...i,r([`.next/**`,`out/**`,`build/**`,`next-env.d.ts`]),...a(u.extends(`plugin:react-server-components/recommended`)),{settings:{react:{version:`detect`}}}]);export{d as nextjsProfile};
|
package/dist/index.cjs
ADDED
|
File without changes
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
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.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OxlintConfig, OxlintConfig as OxlintConfig$1, defineConfig } from "oxlint";
|
|
2
|
-
//#region src/oxlint/index.d.ts
|
|
3
2
|
export type LintPlugins = OxlintConfig$1['plugins'];
|
|
4
3
|
/**
|
|
5
4
|
* Get `Oxlint` base configuration.
|
|
@@ -17,5 +16,4 @@ export type LintPlugins = OxlintConfig$1['plugins'];
|
|
|
17
16
|
* [Oxlint Supported Plugins](https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins)
|
|
18
17
|
*/
|
|
19
18
|
export declare const oxlintConfig: <T extends OxlintConfig$1>(configs?: T & OxlintConfig$1) => ReturnType<typeof defineConfig>;
|
|
20
|
-
//#endregion
|
|
21
19
|
export type { OxlintConfig };
|
package/dist/oxlint/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OxlintConfig, OxlintConfig as OxlintConfig$1, defineConfig } from "oxlint";
|
|
2
|
-
//#region src/oxlint/index.d.ts
|
|
3
2
|
export type LintPlugins = OxlintConfig$1['plugins'];
|
|
4
3
|
/**
|
|
5
4
|
* Get `Oxlint` base configuration.
|
|
@@ -17,5 +16,4 @@ export type LintPlugins = OxlintConfig$1['plugins'];
|
|
|
17
16
|
* [Oxlint Supported Plugins](https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins)
|
|
18
17
|
*/
|
|
19
18
|
export declare const oxlintConfig: <T extends OxlintConfig$1>(configs?: T & OxlintConfig$1) => ReturnType<typeof defineConfig>;
|
|
20
|
-
//#endregion
|
|
21
19
|
export type { OxlintConfig };
|
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,4 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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,4 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
1
|
+
export{t as standardProfile}from"../../standard-BQ3PXrMc.mjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config, Config as PrettierConfig } from "prettier";
|
|
2
|
-
//#region src/prettier/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get `Prettier` base configuration.
|
|
5
4
|
*
|
|
@@ -8,5 +7,4 @@ import { Config, Config as PrettierConfig } from "prettier";
|
|
|
8
7
|
* @returns The Prettier configuration array.
|
|
9
8
|
*/
|
|
10
9
|
export declare const prettierConfig: (configs?: Config) => Config;
|
|
11
|
-
//#endregion
|
|
12
10
|
export type { PrettierConfig };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config, Config as PrettierConfig } from "prettier";
|
|
2
|
-
//#region src/prettier/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get `Prettier` base configuration.
|
|
5
4
|
*
|
|
@@ -8,5 +7,4 @@ import { Config, Config as PrettierConfig } from "prettier";
|
|
|
8
7
|
* @returns The Prettier configuration array.
|
|
9
8
|
*/
|
|
10
9
|
export declare const prettierConfig: (configs?: Config) => Config;
|
|
11
|
-
//#endregion
|
|
12
10
|
export type { PrettierConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{t as standardProfile}from"../../standard-CRskCPOC.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -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}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BocRIvOZ.cjs");let t=require("typescript-eslint");t=e.t(t,1);let n=require("@eslint/js");n=e.t(n,1);let r=require("globals");r=e.t(r,1);const i=[{languageOptions:{globals:{...r.default.browser,...r.default.node}}},n.default.configs.recommended,...t.default.configs.recommended,{ignores:[`**/dist/*`,`**/coverage/*`,`.vscode`]},{rules:{"@typescript-eslint/no-namespace":`off`,"@typescript-eslint/consistent-type-imports":`warn`}}];Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./react-bundler.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ES2017",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"module": "esnext",
|
|
9
|
+
"incremental": true,
|
|
10
|
+
"plugins": [
|
|
11
|
+
{
|
|
12
|
+
"name": "next"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
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;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
|
-
//#region src/tsconfig/index.d.ts
|
|
3
2
|
export interface ParseTsConfigOptions {
|
|
4
3
|
/**
|
|
5
4
|
* The TypeScript configuration file path.
|
|
@@ -32,5 +31,4 @@ export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCo
|
|
|
32
31
|
*
|
|
33
32
|
* @returns The resolved TypeScript compiler target if any, `undefined` otherwise.
|
|
34
33
|
*/
|
|
35
|
-
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
|
36
|
-
//#endregion
|
|
34
|
+
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
|
-
//#region src/tsconfig/index.d.ts
|
|
3
2
|
export interface ParseTsConfigOptions {
|
|
4
3
|
/**
|
|
5
4
|
* The TypeScript configuration file path.
|
|
@@ -32,5 +31,4 @@ export declare const parseTsConfig: (options?: ParseTsConfigOptions) => ParsedCo
|
|
|
32
31
|
*
|
|
33
32
|
* @returns The resolved TypeScript compiler target if any, `undefined` otherwise.
|
|
34
33
|
*/
|
|
35
|
-
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
|
36
|
-
//#endregion
|
|
34
|
+
export declare const getTSConfigCompilerTarget: (options?: GetTSConfigCompilerTargetOptions) => string | undefined;
|
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/dist/tsdown/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
2
|
import { InlineConfig, UserConfig, UserConfigFn as UserConfigFn$1, UserConfigFnContext } from "tsdown";
|
|
3
|
-
//#region src/tsdown/index.d.ts
|
|
4
3
|
export interface UserTsdownConfig extends UserConfig {
|
|
5
4
|
/**
|
|
6
5
|
* The already parsed TS config.
|
|
@@ -38,5 +37,4 @@ inlineConfig: InlineConfig, context: UserConfigFnContext) => UserTsdownConfig |
|
|
|
38
37
|
* | `target` | resolved tsconfig target |
|
|
39
38
|
* | `deps` | `{ ... }` |
|
|
40
39
|
*/
|
|
41
|
-
export declare const tsdownConfig: (options?: UserTsdownConfig | UserConfigFn) => UserConfigFn$1;
|
|
42
|
-
//#endregion
|
|
40
|
+
export declare const tsdownConfig: (options?: UserTsdownConfig | UserConfigFn) => UserConfigFn$1;
|
package/dist/tsdown/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
2
|
import { InlineConfig, UserConfig, UserConfigFn as UserConfigFn$1, UserConfigFnContext } from "tsdown";
|
|
3
|
-
//#region src/tsdown/index.d.ts
|
|
4
3
|
export interface UserTsdownConfig extends UserConfig {
|
|
5
4
|
/**
|
|
6
5
|
* The already parsed TS config.
|
|
@@ -38,5 +37,4 @@ inlineConfig: InlineConfig, context: UserConfigFnContext) => UserTsdownConfig |
|
|
|
38
37
|
* | `target` | resolved tsconfig target |
|
|
39
38
|
* | `deps` | `{ ... }` |
|
|
40
39
|
*/
|
|
41
|
-
export declare const tsdownConfig: (options?: UserTsdownConfig | UserConfigFn) => UserConfigFn$1;
|
|
42
|
-
//#endregion
|
|
40
|
+
export declare const tsdownConfig: (options?: UserTsdownConfig | UserConfigFn) => UserConfigFn$1;
|
package/dist/vite/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UserConfig, defineConfig } from "vite";
|
|
2
|
-
//#region src/vite/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get `vite` base configuration.
|
|
5
4
|
*
|
|
@@ -17,5 +16,4 @@ import { UserConfig, defineConfig } from "vite";
|
|
|
17
16
|
* | `test.reporters` | `['tree']\|[]` based on `VITEST_VSCODE` environment variable. |
|
|
18
17
|
* | `test.coverage.exclude` | `['**\/*.mock.ts', '**\/__tests__/**\/*.mock.ts']` |
|
|
19
18
|
*/
|
|
20
|
-
export declare const viteConfig: (configs?: UserConfig) => ReturnType<typeof defineConfig>;
|
|
21
|
-
//#endregion
|
|
19
|
+
export declare const viteConfig: (configs?: UserConfig) => ReturnType<typeof defineConfig>;
|
package/dist/vite/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UserConfig, defineConfig } from "vite";
|
|
2
|
-
//#region src/vite/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get `vite` base configuration.
|
|
5
4
|
*
|
|
@@ -17,5 +16,4 @@ import { UserConfig, defineConfig } from "vite";
|
|
|
17
16
|
* | `test.reporters` | `['tree']\|[]` based on `VITEST_VSCODE` environment variable. |
|
|
18
17
|
* | `test.coverage.exclude` | `['**\/*.mock.ts', '**\/__tests__/**\/*.mock.ts']` |
|
|
19
18
|
*/
|
|
20
|
-
export declare const viteConfig: (configs?: UserConfig) => ReturnType<typeof defineConfig>;
|
|
21
|
-
//#endregion
|
|
19
|
+
export declare const viteConfig: (configs?: UserConfig) => ReturnType<typeof defineConfig>;
|
package/package.json
CHANGED
|
@@ -1,167 +1,198 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
2
|
+
"name": "@alessiofrittoli/package-configs",
|
|
3
|
+
"version": "1.8.0-alpha.1",
|
|
4
|
+
"description": "Utility library that offers base configurations for your packages.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Alessio Frittoli",
|
|
8
|
+
"email": "info@alessiofrittoli.it",
|
|
9
|
+
"url": "https://alessiofrittoli.it"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"funding": [
|
|
13
|
+
{
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/alessiofrittoli"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"tsdown",
|
|
20
|
+
"eslint",
|
|
21
|
+
"vite",
|
|
22
|
+
"vitest"
|
|
23
|
+
],
|
|
24
|
+
"homepage": "https://github.com/alessiofrittoli/package-configs#readme",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/alessiofrittoli/package-configs/issues",
|
|
27
|
+
"email": "info@alessiofrittoli.it"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/alessiofrittoli/package-configs.git"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=24.15.0",
|
|
36
|
+
"pnpm": ">=11.27.1"
|
|
37
|
+
},
|
|
38
|
+
"main": "./dist/index.cjs",
|
|
39
|
+
"module": "./dist/index.mjs",
|
|
40
|
+
"types": "./dist/index.d.mts",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"scripts/postinstall"
|
|
44
|
+
],
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/index.d.mts",
|
|
49
|
+
"default": "./dist/index.mjs"
|
|
50
|
+
},
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/index.d.cts",
|
|
53
|
+
"default": "./dist/index.cjs"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"./*": {
|
|
57
|
+
"import": {
|
|
58
|
+
"types": "./dist/*/index.d.mts",
|
|
59
|
+
"default": "./dist/*/index.mjs"
|
|
60
|
+
},
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./dist/*/index.d.cts",
|
|
63
|
+
"default": "./dist/*/index.cjs"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"./tsconfig/*.json": {
|
|
67
|
+
"import": "./dist/tsconfig/configs/*.json",
|
|
68
|
+
"require": "./dist/tsconfig/configs/*.json"
|
|
69
|
+
},
|
|
70
|
+
"./markdownlint/*.json": {
|
|
71
|
+
"import": "./dist/markdownlint/configs/*.json",
|
|
72
|
+
"require": "./dist/markdownlint/configs/*.json"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@eslint/compat": "^2.1.1",
|
|
77
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
78
|
+
"@eslint/js": "^10.0.1",
|
|
79
|
+
"eslint": "^10.11.0",
|
|
80
|
+
"eslint-config-next": "^16.4.2",
|
|
81
|
+
"eslint-plugin-react-server-components": "^1.2.0",
|
|
82
|
+
"globals": "^17.12.0",
|
|
83
|
+
"oxlint": "^1.85.0",
|
|
84
|
+
"oxlint-tsgolint": "^7.0.2004",
|
|
85
|
+
"prettier": "^3.9.9",
|
|
86
|
+
"prettier-plugin-sort-imports": "^1.8.11",
|
|
87
|
+
"tsdown": "^0.23.0",
|
|
88
|
+
"typescript": "^6.0.3",
|
|
89
|
+
"typescript-eslint": "^8.70.1",
|
|
90
|
+
"vite": "^8.3.0",
|
|
91
|
+
"vitest": "^5.0.1"
|
|
92
|
+
},
|
|
93
|
+
"peerDependenciesMeta": {
|
|
94
|
+
"@eslint/compat": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"@eslint/eslintrc": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"@eslint/js": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"eslint": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"eslint-config-next": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"eslint-plugin-react-server-components": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"globals": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"oxlint": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"oxlint-tsgolint": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"prettier": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"prettier-plugin-sort-imports": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"tsdown": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"typescript": {
|
|
131
|
+
"optional": false
|
|
132
|
+
},
|
|
133
|
+
"typescript-eslint": {
|
|
134
|
+
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"vite": {
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
"vitest": {
|
|
140
|
+
"optional": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"devDependencies": {
|
|
144
|
+
"@alessiofrittoli/node-scripts": "^4.1.0",
|
|
145
|
+
"@eslint/compat": "^2.1.1",
|
|
146
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
147
|
+
"@eslint/js": "^10.0.1",
|
|
148
|
+
"@types/node": "^24.13.2",
|
|
149
|
+
"@types/prompts": "^2.4.9",
|
|
150
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
151
|
+
"concurrently": "^10.0.6",
|
|
152
|
+
"eslint": "^10.11.0",
|
|
153
|
+
"eslint-config-next": "^16.4.2",
|
|
154
|
+
"eslint-plugin-react-server-components": "^1.2.0",
|
|
155
|
+
"globals": "^17.13.0",
|
|
156
|
+
"http-server": "^14.1.1",
|
|
157
|
+
"oxlint": "^1.89.0",
|
|
158
|
+
"oxlint-tsgolint": "^7.0.2004",
|
|
159
|
+
"prettier": "^3.9.10",
|
|
160
|
+
"prettier-plugin-sort-imports": "^1.8.11",
|
|
161
|
+
"tsdown": "^0.23.1",
|
|
162
|
+
"typescript": "6.0.3",
|
|
163
|
+
"typescript-eslint": "^8.72.0",
|
|
164
|
+
"vite": "^8.3.5",
|
|
165
|
+
"vitest": "^5.0.5"
|
|
166
|
+
},
|
|
167
|
+
"dependencies": {
|
|
168
|
+
"@alessiofrittoli/chain-functions": "^2.7.0",
|
|
169
|
+
"prompts": "^2.4.2"
|
|
170
|
+
},
|
|
171
|
+
"scripts": {
|
|
172
|
+
"//1a": "*********************************************************************",
|
|
173
|
+
"//1b": "******************** DEV - BUILD - LINT - RELEASE *******************",
|
|
174
|
+
"//1c": "*********************************************************************",
|
|
175
|
+
"dev": "tsdown --watch",
|
|
176
|
+
"build": "pnpm lint && pnpm tsdown",
|
|
177
|
+
"eslint": "eslint -c legacy-eslint.config.ts --report-unused-disable-directives --max-warnings 0 --cache --cache-location .cache/eslint",
|
|
178
|
+
"lint": "oxlint --report-unused-disable-directives --max-warnings 0",
|
|
179
|
+
"release": "node scripts/release.ts --verbose --npm",
|
|
180
|
+
"//2a": "*********************************************************************",
|
|
181
|
+
"//2b": "***************************** UNIT TESTS ****************************",
|
|
182
|
+
"//2c": "*********************************************************************",
|
|
183
|
+
"test": "vitest --reporter=tree",
|
|
184
|
+
"test:watch": "pnpm test watch",
|
|
185
|
+
"test:ci": "pnpm test run",
|
|
186
|
+
"//3a": "*********************************************************************",
|
|
187
|
+
"//3b": "************************ UNIT TESTS COVERAGE ************************",
|
|
188
|
+
"//3c": "*********************************************************************",
|
|
189
|
+
"test:coverage": "pnpm test:watch --coverage",
|
|
190
|
+
"test:coverage:ci": "pnpm test:ci --coverage",
|
|
191
|
+
"test:serve-coverage": "http-server ./coverage --gzip true -p 0 -o /index.html --silent",
|
|
192
|
+
"test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"",
|
|
193
|
+
"//4a": "*********************************************************************",
|
|
194
|
+
"//4b": "******************************* OTHER *******************************",
|
|
195
|
+
"//4c": "*********************************************************************",
|
|
196
|
+
"postinstall": "node scripts/postinstall/index.ts"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
export type PostInstallChainFn = () => void | Promise<void>
|
|
66
|
+
|
|
67
|
+
const lastChainLink: LastChainLink<PostInstallChainFn> = () => () => {
|
|
68
|
+
console.log({
|
|
69
|
+
package: project.name,
|
|
70
|
+
message: `Post-Install done. Thank you for installing ${project.name}!`,
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const postInstallChain: ChainFactory<PostInstallChainFn> = [installDependencies, lastChainLink]
|
|
75
|
+
|
|
76
|
+
const runChain = async (): Promise<void> => {
|
|
77
|
+
if (!isExternalPackage({ name: project.name, root: getProcessRoot() })) {
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await Chain.functions(postInstallChain)()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
runChain().catch(console.error)
|
|
@@ -0,0 +1,132 @@
|
|
|
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> = next => async (): Promise<void> => {
|
|
27
|
+
if (isCIEnv()) {
|
|
28
|
+
return next()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
const { installDeps } = await prompts([
|
|
33
|
+
{
|
|
34
|
+
type: 'confirm',
|
|
35
|
+
name: 'installDeps',
|
|
36
|
+
message: 'Would you like to install optional dependencies?',
|
|
37
|
+
initial: true,
|
|
38
|
+
},
|
|
39
|
+
])
|
|
40
|
+
|
|
41
|
+
if (!installDeps) {
|
|
42
|
+
return next()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const { _dependenciesChoice } = await prompts([
|
|
46
|
+
{
|
|
47
|
+
type: 'multiselect',
|
|
48
|
+
name: '_dependenciesChoice',
|
|
49
|
+
message: "Please, select which tool you're going to use",
|
|
50
|
+
choices: [
|
|
51
|
+
{
|
|
52
|
+
title: 'Vite',
|
|
53
|
+
selected: true,
|
|
54
|
+
description: 'Will install Vite',
|
|
55
|
+
value: ['vite'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: 'Vitest',
|
|
59
|
+
selected: true,
|
|
60
|
+
description: 'Will install Vitest',
|
|
61
|
+
value: ['vitest', '@vitest/coverage-v8'],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: 'Oxlint',
|
|
65
|
+
selected: true,
|
|
66
|
+
description: 'Will install Oxlint',
|
|
67
|
+
value: ['oxlint', 'oxlint-tsgolint'],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: 'Prettier',
|
|
71
|
+
selected: true,
|
|
72
|
+
description: 'Will install Prettier',
|
|
73
|
+
value: ['prettier', 'prettier-plugin-sort-imports'],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
title: 'tsdown',
|
|
77
|
+
selected: true,
|
|
78
|
+
description: 'Will install tsdown',
|
|
79
|
+
value: ['tsdown'],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: 'ESLint',
|
|
83
|
+
selected: false,
|
|
84
|
+
description: 'Will install ESLint dev dependencies',
|
|
85
|
+
value: [
|
|
86
|
+
'eslint',
|
|
87
|
+
'@eslint/compat',
|
|
88
|
+
'@eslint/eslintrc',
|
|
89
|
+
'@eslint/js',
|
|
90
|
+
'globals',
|
|
91
|
+
'typescript-eslint',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: 'Next.js',
|
|
96
|
+
description: 'Will install Next.js related ESLint dev dependencies',
|
|
97
|
+
selected: false,
|
|
98
|
+
value: [
|
|
99
|
+
'eslint',
|
|
100
|
+
'@eslint/compat',
|
|
101
|
+
'@eslint/eslintrc',
|
|
102
|
+
'@eslint/js',
|
|
103
|
+
'globals',
|
|
104
|
+
'typescript-eslint',
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
])
|
|
110
|
+
|
|
111
|
+
if (!_dependenciesChoice) {
|
|
112
|
+
return next()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const dependenciesChoice = arrayUnique((_dependenciesChoice as string[][]).flatMap(c => c))
|
|
116
|
+
|
|
117
|
+
let engine: 'npm' | 'pnpm' = 'npm'
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
execSync('pnpm -v', { stdio: 'ignore' })
|
|
121
|
+
engine = 'pnpm'
|
|
122
|
+
} catch {
|
|
123
|
+
engine = 'npm'
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const installCommand = engine === 'npm' ? 'npm install' : 'pnpm i'
|
|
127
|
+
|
|
128
|
+
execSync(`${installCommand} ${dependenciesChoice.join(' ')}`, { stdio: 'inherit' })
|
|
129
|
+
} catch {
|
|
130
|
+
return next()
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("typescript-eslint");c=s(c,1);let l=require("@eslint/js");l=s(l,1);let u=require("globals");u=s(u,1);const d=[{languageOptions:{globals:{...u.default.browser,...u.default.node}}},l.default.configs.recommended,...c.default.configs.recommended,{ignores:[`**/dist/*`,`**/coverage/*`,`.vscode`]},{rules:{"@typescript-eslint/no-namespace":`off`,"@typescript-eslint/consistent-type-imports":`warn`}}];Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -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`}};export{e as t};
|
|
@@ -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`}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|