Skip to content

Commit

Permalink
Merge pull request #21 from event-catalog/sharing-config-files-betwee…
Browse files Browse the repository at this point in the history
…n-plugins

Sharing config files between plugins
  • Loading branch information
boyney123 authored Feb 5, 2025
2 parents 241ca09 + 3cded09 commit 42a60b7
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 102 deletions.
6 changes: 6 additions & 0 deletions .changeset/nice-roses-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@eventcatalog/generator-asyncapi": patch
"@eventcatalog/generator-openapi": patch
---

chore(project): sharing files between plugins
15 changes: 15 additions & 0 deletions configs/generator-tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": false,
"resolveJsonModule": true
},
"module": "ESNext",
"moduleResolution": "node"
}
16 changes: 16 additions & 0 deletions configs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "config",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"tsup": "^8.1.0",
"vitest": "^2.0.2"
}
}
13 changes: 13 additions & 0 deletions configs/tsup/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Options, defineConfig } from 'tsup';

export function createTsupConfig(options?: Partial<Options>) {
return defineConfig({
target: 'es2020',
format: ['cjs', 'esm'],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
...options,
});
}
File renamed without changes.
1 change: 1 addition & 0 deletions configs/vitest/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './matchers';
12 changes: 1 addition & 11 deletions packages/generator-asyncapi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
{
"compilerOptions": {
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "commonjs" /* Specify what module code is generated. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": false /* Skip type checking all .d.ts files. */,
"resolveJsonModule": true
},
"module": "ESNext",
"moduleResolution": "node"
"extends": "../../configs/generator-tsconfig.json"
}
10 changes: 2 additions & 8 deletions packages/generator-asyncapi/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../configs/tsup/base';

export default defineConfig({
target: 'es2020',
format: ['cjs', 'esm'],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
export default createTsupConfig({
entry: ['src/*', '!src/test/*', '!src/docs.ts'],
});
6 changes: 1 addition & 5 deletions packages/generator-asyncapi/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
setupFiles: ['./vitest.setup.ts'],
deps: {
inline: ['@eventcatalog/sdk'],
},
// ... Specify options here.
setupFiles: ['../../configs/vitest/setup.ts'],
},
});
4 changes: 0 additions & 4 deletions packages/generator-openapi/.prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions packages/generator-openapi/.prettierrc

This file was deleted.

12 changes: 1 addition & 11 deletions packages/generator-openapi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
{
"compilerOptions": {
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "commonjs" /* Specify what module code is generated. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": false /* Skip type checking all .d.ts files. */,
"resolveJsonModule": true
},
"module": "ESNext",
"moduleResolution": "node"
"extends": "../../configs/generator-tsconfig.json"
}
10 changes: 2 additions & 8 deletions packages/generator-openapi/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { defineConfig } from 'tsup';
import { createTsupConfig } from '../../configs/tsup/base';

export default defineConfig({
target: 'es2020',
format: ['cjs', 'esm'],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
export default createTsupConfig({
entry: ['src/*', '!src/test/*', '!src/docs.ts'],
});
6 changes: 1 addition & 5 deletions packages/generator-openapi/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
setupFiles: ['./vitest.setup.ts'],
deps: {
inline: ['@eventcatalog/sdk'],
},
// ... Specify options here.
setupFiles: ['../../configs/vitest/setup.ts'],
},
});
41 changes: 0 additions & 41 deletions packages/generator-openapi/vitest.setup.ts

This file was deleted.

9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 42a60b7

Please sign in to comment.