refactor: move all the config files to root (#8033)

This commit is contained in:
Parbez
2022-06-07 16:05:19 +05:30
committed by GitHub
parent 8b979c0245
commit 769ea0bfe7
43 changed files with 123 additions and 413 deletions

12
.eslintrc.json Normal file
View File

@@ -0,0 +1,12 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
}

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,13 +1,9 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/index.ts', 'src/formatTag/index.ts'],
export default createTsupConfig({
entry: ['src/index.ts', 'src/formatTag/index.ts'],
format: ['cjs'],
minify: true,
skipNodeModulesBundle: false,
noExternal: ['@actions/core'],
sourcemap: true,
target: 'es2021',
minify: true,
});

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,20 +1,3 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: false,
keepNames: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
esbuildOptions: (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
});
export default createTsupConfig();

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,21 +1,3 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: false,
// if false: causes Collection.constructor to be a minified value like: 'o'
keepNames: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
esbuildOptions: (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
});
export default createTsupConfig();

View File

@@ -19,17 +19,6 @@
}
}
],
"prettier/prettier": [
2,
{
"printWidth": 120,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf",
"arrowParens": "avoid"
}
],
"strict": ["error", "global"],
"no-await-in-loop": "warn",
"no-compare-neg-zero": "error",

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,13 +1,5 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
keepNames: true,
minify: false,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
export default createTsupConfig({
minify: true,
});

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,20 +1,3 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: false,
keepNames: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
esbuildOptions: (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
});
export default createTsupConfig();

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,20 +1,3 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: false,
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: false,
keepNames: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
esbuildOptions: (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
});
export default createTsupConfig();

View File

@@ -1,12 +1,3 @@
{
"root": true,
"extends": "marine/prettier/node",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"extends": "../../.eslintrc.json"
}

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,12 +1,6 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/docs.ts'],
format: ['esm', 'cjs'],
export default createTsupConfig({
entry: ['src/docs.ts'],
minify: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
});

View File

@@ -0,0 +1 @@
module.exports = require('../../.prettierrc.json');

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

View File

@@ -1,20 +1,3 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
"extends": "../../tsconfig.eslint.json"
}

View File

@@ -1,20 +1,3 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../tsup.config';
export default defineConfig({
clean: true,
dts: true,
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: false,
keepNames: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'es2021',
esbuildOptions: (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
});
export default createTsupConfig();

20
tsconfig.eslint.json Normal file
View File

@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
}

48
tsup.config.ts Normal file
View File

@@ -0,0 +1,48 @@
import { relative, resolve } from 'node:path';
import { defineConfig, type Options } from 'tsup';
type ConfigOptions = Pick<
Options,
| 'globalName'
| 'minify'
| 'entry'
| 'format'
| 'target'
| 'sourcemap'
| 'skipNodeModulesBundle'
| 'noExternal'
| 'esbuildOptions'
>;
export const createTsupConfig = ({
globalName,
format = ['esm', 'cjs'],
target = 'es2021',
sourcemap = true,
minify = false,
entry = ['src/index.ts'],
skipNodeModulesBundle = true,
noExternal,
esbuildOptions = (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
}: ConfigOptions = {}) =>
defineConfig({
clean: true,
dts: true,
entry,
format,
minify,
skipNodeModulesBundle,
sourcemap,
target,
tsconfig: relative(__dirname, resolve(process.cwd(), 'tsconfig.json')),
keepNames: true,
globalName,
noExternal,
esbuildOptions,
});