Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: consolidating our ts and tsup configs #813

Merged
merged 7 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"scripts": {
"alex": "alex .",
"attw": "npx lerna run attw --stream",
"build": "npx lerna run build --stream",
"clean": "npx lerna clean",
"lint": "npm run lint:types && npm run lint:js && npm run prettier",
Expand Down
1 change: 1 addition & 0 deletions packages/oas-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"url": "https://github.com/readmeio/oas/issues"
},
"scripts": {
"attw": "attw --pack --format table-flipped",
"build": "tsup",
"lint": "npm run lint:types && npm run lint:js",
"lint:js": "eslint . --ext .js,.ts",
Expand Down
10 changes: 2 additions & 8 deletions packages/oas-extensions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"baseUrl": "./src/",
erunion marked this conversation as resolved.
Show resolved Hide resolved
"declaration": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "bundler",
"noImplicitAny": true,
"outDir": "./dist",
"target": "ES2020"
"outDir": "./dist"
},
"include": ["./src/**/*"]
}
12 changes: 3 additions & 9 deletions packages/oas-extensions/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ import type { Options } from 'tsup';
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

import config from '../../tsup.config';

export default defineConfig((options: Options) => ({
...options,
...config,

cjsInterop: true,
clean: true,
dts: true,
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: false,
shims: true,
silent: !options.watch,
splitting: true,
sourcemap: true,
treeshake: true,
}));
1 change: 1 addition & 0 deletions packages/oas-normalize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"url": "https://github.com/readmeio/oas/issues"
},
"scripts": {
"attw": "attw --pack --format table-flipped",
"build": "tsup",
"lint": "npm run lint:types && npm run lint:js",
"lint:js": "eslint . --ext .js,.ts",
Expand Down
11 changes: 3 additions & 8 deletions packages/oas-normalize/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"baseUrl": "./src",
"declaration": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["DOM"],
erunion marked this conversation as resolved.
Show resolved Hide resolved
"outDir": "dist/",
"paths": {
"swagger2openapi": [".sink.d.ts"]
},
"skipLibCheck": true,
"target": "ES2020"
}
},
"include": ["./src/**/*"]
}
11 changes: 3 additions & 8 deletions packages/oas-normalize/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ import type { Options } from 'tsup';
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

import config from '../../tsup.config';

export default defineConfig((options: Options) => ({
...options,
...config,

cjsInterop: true,
clean: true,
dts: true,
entry: ['src/index.ts', 'src/lib/types.ts', 'src/lib/utils.ts'],
format: ['esm', 'cjs'],
minify: false,
shims: true,
silent: !options.watch,
sourcemap: true,
splitting: true,
}));
1 change: 1 addition & 0 deletions packages/oas-to-har/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"url": "https://github.com/readmeio/oas/issues"
},
"scripts": {
"attw": "attw --pack --format table-flipped",
"build": "tsup",
"lint": "npm run lint:types && npm run lint:js",
"lint:js": "eslint . --ext .js,.ts",
Expand Down
11 changes: 2 additions & 9 deletions packages/oas-to-har/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"baseUrl": "./src",
"declaration": true,
"downlevelIteration": true,
"esModuleInterop": true,
"lib": ["DOM", "ES2020"],
erunion marked this conversation as resolved.
Show resolved Hide resolved
"module": "ESNext",
"moduleResolution": "Bundler",
"noImplicitAny": true,
"outDir": "dist/",
"skipLibCheck": true,
"target": "ES2020"
"outDir": "dist/"
},
"include": ["./src/**/*"]
}
8 changes: 3 additions & 5 deletions packages/oas-to-har/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

import config from '../../tsup.config.js';

export default defineConfig(options => ({
...options,
...config,

cjsInterop: true,
dts: true,
entry: ['src/index.ts', 'src/lib/configure-security.ts', 'src/lib/types.ts'],
format: ['esm', 'cjs'],
shims: true,
silent: !options.watch,
sourcemap: true,
}));
1 change: 1 addition & 0 deletions packages/oas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"url": "https://github.com/readmeio/oas/issues"
},
"scripts": {
"attw": "attw --pack --format table-flipped",
"build": "tsup",
"lint": "npm run lint:types && npm run lint:js",
"lint:js": "eslint . --ext .js,.ts",
Expand Down
10 changes: 2 additions & 8 deletions packages/oas/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"baseUrl": "./src/",
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2023"],
erunion marked this conversation as resolved.
Show resolved Hide resolved
"module": "ESNext",
"moduleResolution": "bundler",
"noImplicitAny": true,
"outDir": "./dist",
"target": "ES2020"
"outDir": "./dist"
},
"include": ["./src/**/*"]
}
11 changes: 3 additions & 8 deletions packages/oas/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type { Options } from 'tsup';
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

import config from '../../tsup.config';

export default defineConfig((options: Options) => ({
...options,
...config,

cjsInterop: true,
clean: true,
dts: true,
entry: [
'src/analyzer/index.ts',
'src/lib/reducer.ts',
Expand All @@ -18,10 +18,5 @@ export default defineConfig((options: Options) => ({
'src/rmoas.types.ts',
'src/utils.ts',
],
format: ['esm', 'cjs'],
minify: false,
shims: true,
silent: !options.watch,
sourcemap: true,
splitting: true,
}));
12 changes: 12 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"allowJs": true,
erunion marked this conversation as resolved.
Show resolved Hide resolved
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2023"],
"module": "ESNext",
"moduleResolution": "Bundler",
"noImplicitAny": true,
"target": "ES2020"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

someday 🥺

Suggested change
"target": "ES2020"
"strict": true,
"target": "ES2020"

}
}
14 changes: 14 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Options } from 'tsup';

const config: Options = {
cjsInterop: true,
clean: true,
dts: true,
format: ['esm', 'cjs'],
minify: false,
shims: true,
sourcemap: true,
splitting: true,
};

export default config;