From 67e6bf4ec2fc736d0afcd303d18a3639ac40e8fa Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 11:23:29 -0500 Subject: [PATCH 01/16] DRY rollup.config --- plugins/autocast/rollup.config.mjs | 83 +------------ plugins/constraints/rollup.config.mjs | 82 +------------ plugins/dedupe/rollup.config.mjs | 83 +------------ plugins/dxp-configure/rollup.config.mjs | 65 +--------- .../foreign-db-extractor/rollup.config.mjs | 81 +------------ plugins/job-handler/rollup.config.mjs | 81 +------------ plugins/json-extractor/rollup.config.mjs | 65 +--------- plugins/openapi-schema/rollup.config.mjs | 63 +--------- plugins/record-hook/rollup.config.mjs | 97 +-------------- plugins/space-configure/rollup.config.mjs | 81 +------------ plugins/webhook-egress/rollup.config.mjs | 88 +------------- .../webhook-event-forwarder/rollup.config.mjs | 79 +------------ rollup.config.mjs | 111 ++++++++++++++++++ utils/common/rollup.config.mjs | 81 +------------ utils/response-rejection/rollup.config.mjs | 80 +------------ 15 files changed, 156 insertions(+), 1064 deletions(-) create mode 100644 rollup.config.mjs diff --git a/plugins/autocast/rollup.config.mjs b/plugins/autocast/rollup.config.mjs index 74bf34ea0..82d8d1319 100644 --- a/plugins/autocast/rollup.config.mjs +++ b/plugins/autocast/rollup.config.mjs @@ -1,84 +1,7 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' - -import dotenv from 'dotenv' -dotenv.config() - -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} +import { buildConfig } from '../../rollup.config.mjs' const external = ['@flatfile/plugin-record-hook'] -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} +const config = buildConfig({ external }) -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - external, - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - external, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/constraints/rollup.config.mjs b/plugins/constraints/rollup.config.mjs index 8d52053c9..82d8d1319 100644 --- a/plugins/constraints/rollup.config.mjs +++ b/plugins/constraints/rollup.config.mjs @@ -1,83 +1,7 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' - -import dotenv from 'dotenv' -dotenv.config() - -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} +import { buildConfig } from '../../rollup.config.mjs' const external = ['@flatfile/plugin-record-hook'] -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} +const config = buildConfig({ external }) -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - external, - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - external, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/dedupe/rollup.config.mjs b/plugins/dedupe/rollup.config.mjs index 74bf34ea0..82d8d1319 100644 --- a/plugins/dedupe/rollup.config.mjs +++ b/plugins/dedupe/rollup.config.mjs @@ -1,84 +1,7 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' - -import dotenv from 'dotenv' -dotenv.config() - -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} +import { buildConfig } from '../../rollup.config.mjs' const external = ['@flatfile/plugin-record-hook'] -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} +const config = buildConfig({ external }) -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - external, - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - external, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/dxp-configure/rollup.config.mjs b/plugins/dxp-configure/rollup.config.mjs index 9cdb630e9..83b706947 100644 --- a/plugins/dxp-configure/rollup.config.mjs +++ b/plugins/dxp-configure/rollup.config.mjs @@ -1,64 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import nodeResolve from '@rollup/plugin-node-resolve' -import typescript from '@rollup/plugin-typescript' +import { buildConfig } from '../../rollup.config.mjs' -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: [ - json(), - commonjs({ include: '../../node_modules/**' }), - nodeResolve({ browser: false }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: true, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - ], - }, +const config = buildConfig({}) - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: [ - json(), - commonjs({ include: '../../node_modules/**' }), - nodeResolve({ browser: true }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: true, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - ], - }, -] +export default config diff --git a/plugins/foreign-db-extractor/rollup.config.mjs b/plugins/foreign-db-extractor/rollup.config.mjs index dbf6fe80d..5b6d31c35 100644 --- a/plugins/foreign-db-extractor/rollup.config.mjs +++ b/plugins/foreign-db-extractor/rollup.config.mjs @@ -1,80 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' +import { buildConfig } from '../../rollup.config.mjs' -import dotenv from 'dotenv' -dotenv.config() +const config = buildConfig({ includeBrowser: false }) -const PROD = process.env.NODE_ENV === 'production' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} - -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} - -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/job-handler/rollup.config.mjs b/plugins/job-handler/rollup.config.mjs index 6cf9b0f70..83b706947 100644 --- a/plugins/job-handler/rollup.config.mjs +++ b/plugins/job-handler/rollup.config.mjs @@ -1,80 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' +import { buildConfig } from '../../rollup.config.mjs' -import dotenv from 'dotenv' -dotenv.config() +const config = buildConfig({}) -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} - -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} - -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/json-extractor/rollup.config.mjs b/plugins/json-extractor/rollup.config.mjs index 9cdb630e9..83b706947 100644 --- a/plugins/json-extractor/rollup.config.mjs +++ b/plugins/json-extractor/rollup.config.mjs @@ -1,64 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import nodeResolve from '@rollup/plugin-node-resolve' -import typescript from '@rollup/plugin-typescript' +import { buildConfig } from '../../rollup.config.mjs' -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: [ - json(), - commonjs({ include: '../../node_modules/**' }), - nodeResolve({ browser: false }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: true, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - ], - }, +const config = buildConfig({}) - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: [ - json(), - commonjs({ include: '../../node_modules/**' }), - nodeResolve({ browser: true }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: true, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - ], - }, -] +export default config diff --git a/plugins/openapi-schema/rollup.config.mjs b/plugins/openapi-schema/rollup.config.mjs index aae1f0652..83b706947 100644 --- a/plugins/openapi-schema/rollup.config.mjs +++ b/plugins/openapi-schema/rollup.config.mjs @@ -1,62 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import nodeResolve from '@rollup/plugin-node-resolve' -import typescript from '@rollup/plugin-typescript' +import { buildConfig } from '../../rollup.config.mjs' -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: [ - json(), - commonjs({ include: '../../node_modules/**' }), - nodeResolve({ browser: false }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: true, - declarationDir: './dist', - }), - ], - }, +const config = buildConfig({}) - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: [ - json(), - commonjs({ include: '../../node_modules/**' }), - nodeResolve({ browser: true }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: true, - declarationDir: './dist', - }), - ], - }, -] +export default config diff --git a/plugins/record-hook/rollup.config.mjs b/plugins/record-hook/rollup.config.mjs index 759824852..d5dcf8d0c 100644 --- a/plugins/record-hook/rollup.config.mjs +++ b/plugins/record-hook/rollup.config.mjs @@ -1,18 +1,4 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' - -import dotenv from 'dotenv' -dotenv.config() - -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} +import { buildConfig } from '../../rollup.config.mjs' const internal = [ '@flatfile/api', @@ -21,80 +7,9 @@ const internal = [ '@flatfile/util-common', ] -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} +const config = buildConfig({ + includeUmd: true, + umdConfig: { name: 'PluginRecordHook', internal }, +}) -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - }, - // UMD build - { - input: 'src/index.ts', - output: [ - { - file: 'dist/index.js', - format: 'umd', - name: 'PluginRecordHook', - }, - ], - plugins: commonPlugins(true, true), - internal, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/space-configure/rollup.config.mjs b/plugins/space-configure/rollup.config.mjs index 6cf9b0f70..83b706947 100644 --- a/plugins/space-configure/rollup.config.mjs +++ b/plugins/space-configure/rollup.config.mjs @@ -1,80 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' +import { buildConfig } from '../../rollup.config.mjs' -import dotenv from 'dotenv' -dotenv.config() +const config = buildConfig({}) -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} - -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} - -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/webhook-egress/rollup.config.mjs b/plugins/webhook-egress/rollup.config.mjs index c8dc2cf03..83b706947 100644 --- a/plugins/webhook-egress/rollup.config.mjs +++ b/plugins/webhook-egress/rollup.config.mjs @@ -1,87 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' +import { buildConfig } from '../../rollup.config.mjs' -import dotenv from 'dotenv' -dotenv.config() +const config = buildConfig({}) -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} - -const external = [ - '@flatfile/listener', - '@flatfile/plugin-job-handler', - '@flatfile/util-response-rejection', - '@flatfile/util-common', - 'node-fetch', -] - -function commonPlugins(browser) { - return [ - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} - -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - external, - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - external, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/plugins/webhook-event-forwarder/rollup.config.mjs b/plugins/webhook-event-forwarder/rollup.config.mjs index e21780d7a..83b706947 100644 --- a/plugins/webhook-event-forwarder/rollup.config.mjs +++ b/plugins/webhook-event-forwarder/rollup.config.mjs @@ -1,78 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' +import { buildConfig } from '../../rollup.config.mjs' -import dotenv from 'dotenv' -dotenv.config() +const config = buildConfig({}) -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} - -const external = ['@flatfile/listener', 'node-fetch'] - -function commonPlugins(browser) { - return [ - json(), - commonjs({ include: '**/node_modules/**', requireReturnsDefault: 'auto' }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} - -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - external, - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - external, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/rollup.config.mjs b/rollup.config.mjs new file mode 100644 index 000000000..1cc09e8d3 --- /dev/null +++ b/rollup.config.mjs @@ -0,0 +1,111 @@ +import commonjs from '@rollup/plugin-commonjs' +import json from '@rollup/plugin-json' +import resolve from '@rollup/plugin-node-resolve' +import terser from '@rollup/plugin-terser' +import typescript from '@rollup/plugin-typescript' +import { dts } from 'rollup-plugin-dts' +import peerDepsExternal from 'rollup-plugin-peer-deps-external' + +import dotenv from 'dotenv' +dotenv.config() + +const PROD = process.env.NODE_ENV !== 'development' +if (!PROD) { + console.log('Not in production mode - skipping minification') +} + +function commonPlugins(browser, umd = false) { + return [ + !umd && peerDepsExternal(), + json(), + commonjs({ + include: '**/node_modules/**', + requireReturnsDefault: 'auto', + esmExternals: true, + }), + resolve({ browser, preferBuiltins: !browser }), + typescript({ + tsconfig: '../../tsconfig.json', + declaration: false, + declarationMap: false, + declarationDir: './dist', + exclude: ['**/tests/*', '**/*.spec.ts'], + }), + PROD && terser(), + ] +} + +export function buildConfig({ + external = [], + includeBrowser = true, + includeUmd = false, + umdConfig = { name: undefined, internal: [] }, +}) { + return [ + // Node.js build + { + input: 'src/index.ts', + output: [ + { + exports: 'auto', + file: 'dist/index.cjs', + format: 'cjs', + }, + { + exports: 'auto', + file: 'dist/index.mjs', + sourcemap: false, + format: 'es', + }, + ], + plugins: commonPlugins(false), + external, + }, + // Browser build + ...(includeBrowser + ? [ + { + input: 'src/index.ts', + output: [ + { + exports: 'auto', + file: 'dist/index.browser.cjs', + format: 'cjs', + }, + { + exports: 'auto', + file: 'dist/index.browser.mjs', + sourcemap: false, + format: 'es', + }, + ], + plugins: commonPlugins(true), + external, + }, + ] + : []), + // Definition file + { + input: 'src/index.ts', + output: [{ file: 'dist/index.d.ts', format: 'es' }], + plugins: [dts()], + }, + // UMD build + ...(includeUmd + ? [ + { + input: 'src/index.ts', + output: [ + { + file: 'dist/index.js', + format: 'umd', + name: umdConfig.name, + }, + ], + plugins: commonPlugins(true, true), + internal: umdConfig.internal, + }, + ] + : []), + ] +} diff --git a/utils/common/rollup.config.mjs b/utils/common/rollup.config.mjs index 6cf9b0f70..83b706947 100644 --- a/utils/common/rollup.config.mjs +++ b/utils/common/rollup.config.mjs @@ -1,80 +1,5 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' -import peerDepsExternal from 'rollup-plugin-peer-deps-external' +import { buildConfig } from '../../rollup.config.mjs' -import dotenv from 'dotenv' -dotenv.config() +const config = buildConfig({}) -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} - -function commonPlugins(browser, umd = false) { - return [ - !umd ? peerDepsExternal() : undefined, - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - esmExternals: true, - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} - -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config diff --git a/utils/response-rejection/rollup.config.mjs b/utils/response-rejection/rollup.config.mjs index 0e47d4683..c8c032a43 100644 --- a/utils/response-rejection/rollup.config.mjs +++ b/utils/response-rejection/rollup.config.mjs @@ -1,81 +1,7 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' -import resolve from '@rollup/plugin-node-resolve' -import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' -import { dts } from 'rollup-plugin-dts' - -import dotenv from 'dotenv' -dotenv.config() - -const PROD = process.env.NODE_ENV !== 'development' -if (!PROD) { - console.log('Not in production mode - skipping minification') -} +import { buildConfig } from '../../rollup.config.mjs' const external = ['@flatfile/util-common'] -function commonPlugins(browser) { - return [ - json(), - commonjs({ - include: '**/node_modules/**', - requireReturnsDefault: 'auto', - }), - resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], - }), - PROD ? terser() : null, - ] -} +const config = buildConfig({ external }) -export default [ - // Node.js build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(false), - external, - }, - // Browser build - { - input: 'src/index.ts', - output: [ - { - exports: 'auto', - file: 'dist/index.browser.cjs', - format: 'cjs', - }, - { - exports: 'auto', - file: 'dist/index.browser.mjs', - sourcemap: false, - format: 'es', - }, - ], - plugins: commonPlugins(true), - external, - }, - { - input: 'src/index.ts', - output: [{ file: 'dist/index.d.ts', format: 'es' }], - plugins: [dts()], - }, -] +export default config From 693047933fb55b9245cbc419ae827251136c8292 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 11:29:46 -0500 Subject: [PATCH 02/16] Move @flatfile/listener to peerDependencies & import types as such --- plugins/automap/package.json | 4 +++- plugins/automap/src/automap.plugin.ts | 2 +- plugins/automap/src/automap.service.ts | 2 +- plugins/constraints/src/external.constraint.ts | 5 +++-- plugins/constraints/src/external.sheet.constraint.ts | 9 +++++---- plugins/dedupe/src/dedupe.plugin.ts | 5 +++-- plugins/dedupe/src/index.ts | 4 ++-- plugins/dxp-configure/package.json | 4 +++- plugins/export-workbook/package.json | 4 +++- plugins/export-workbook/src/index.ts | 2 +- plugins/export-workbook/src/plugin.ts | 5 +++-- plugins/foreign-db-extractor/src/index.ts | 5 +++-- plugins/json-schema/package.json | 4 +++- plugins/json-schema/src/index.ts | 4 ++-- plugins/merge-connection/package.json | 4 +++- plugins/merge-connection/src/create.workbook.ts | 5 +++-- plugins/merge-connection/src/merge.plugin.ts | 2 +- plugins/merge-connection/src/sync.workbook.ts | 5 +++-- plugins/openapi-schema/package.json | 3 +++ plugins/openapi-schema/src/index.ts | 4 ++-- plugins/pdf-extractor/package.json | 4 +++- plugins/pdf-extractor/src/index.ts | 2 +- plugins/pdf-extractor/src/plugin.ts | 5 +++-- plugins/psv-extractor/package.json | 4 +++- plugins/psv-extractor/src/index.ts | 4 ++-- plugins/record-hook/package.json | 4 +++- plugins/record-hook/src/index.ts | 2 +- plugins/record-hook/src/record.hook.plugin.ts | 8 ++------ plugins/space-configure/src/space.configure.spec.ts | 3 ++- plugins/sql-ddl-converter/package.json | 4 +++- plugins/sql-ddl-converter/src/index.ts | 4 ++-- plugins/tsv-extractor/package.json | 3 +++ plugins/tsv-extractor/src/index.ts | 4 ++-- plugins/webhook-egress/package.json | 6 ++++-- plugins/webhook-event-forwarder/package.json | 4 +++- plugins/webhook-event-forwarder/src/forward.webhook.ts | 2 +- plugins/xlsx-extractor/package.json | 3 +++ plugins/xml-extractor/package.json | 3 +++ plugins/yaml-schema/package.json | 5 +++-- plugins/yaml-schema/src/index.ts | 4 ++-- plugins/zip-extractor/package.json | 4 +++- utils/common/src/async.batch.spec.ts | 2 +- utils/common/src/async.batch.ts | 2 +- utils/extractor/package.json | 4 +++- utils/file-buffer/src/index.ts | 3 ++- 45 files changed, 110 insertions(+), 65 deletions(-) diff --git a/plugins/automap/package.json b/plugins/automap/package.json index f8c015026..152aaaf9e 100644 --- a/plugins/automap/package.json +++ b/plugins/automap/package.json @@ -29,9 +29,11 @@ "dependencies": { "@flatfile/api": "^1.7.4", "@flatfile/common-plugin-utils": "^1.0.1", - "@flatfile/listener": "^1.0.1", "remeda": "^1.23.0" }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + }, "devDependencies": { "@flatfile/utils-testing": "^0.1.3" } diff --git a/plugins/automap/src/automap.plugin.ts b/plugins/automap/src/automap.plugin.ts index 14d5bd547..e425897a2 100644 --- a/plugins/automap/src/automap.plugin.ts +++ b/plugins/automap/src/automap.plugin.ts @@ -1,4 +1,4 @@ -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { AutomapService } from './automap.service' /** diff --git a/plugins/automap/src/automap.service.ts b/plugins/automap/src/automap.service.ts index ed3543dac..43dd69f5b 100644 --- a/plugins/automap/src/automap.service.ts +++ b/plugins/automap/src/automap.service.ts @@ -1,6 +1,6 @@ import api, { Flatfile } from '@flatfile/api' import { asyncMap } from '@flatfile/common-plugin-utils' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import * as R from 'remeda' import { AutomapOptions } from './automap.plugin' diff --git a/plugins/constraints/src/external.constraint.ts b/plugins/constraints/src/external.constraint.ts index be24bcbee..1bc7f6a89 100644 --- a/plugins/constraints/src/external.constraint.ts +++ b/plugins/constraints/src/external.constraint.ts @@ -1,5 +1,6 @@ -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { FlatfileRecord, bulkRecordHookPlugin, diff --git a/plugins/constraints/src/external.sheet.constraint.ts b/plugins/constraints/src/external.sheet.constraint.ts index 5b1b23f3e..a9db60d69 100644 --- a/plugins/constraints/src/external.sheet.constraint.ts +++ b/plugins/constraints/src/external.sheet.constraint.ts @@ -1,11 +1,12 @@ -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { TPrimitive } from '@flatfile/hooks' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { - bulkRecordHookPlugin, FlatfileRecord, + bulkRecordHookPlugin, } from '@flatfile/plugin-record-hook' import { getSheetConstraints } from './get.constraints' -import { TPrimitive } from '@flatfile/hooks' /** * External sheet constraints can be registered on a combination of fields. Unlike the single diff --git a/plugins/dedupe/src/dedupe.plugin.ts b/plugins/dedupe/src/dedupe.plugin.ts index 4792fd0b6..100d298dc 100644 --- a/plugins/dedupe/src/dedupe.plugin.ts +++ b/plugins/dedupe/src/dedupe.plugin.ts @@ -1,5 +1,6 @@ -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { FlatfileEvent } from '@flatfile/listener' import { processRecords } from '@flatfile/util-common' import { keepFirst } from './keep.first.logic' import { keepLast } from './keep.last.logic' diff --git a/plugins/dedupe/src/index.ts b/plugins/dedupe/src/index.ts index 3a2229ee1..f2f71f51c 100644 --- a/plugins/dedupe/src/index.ts +++ b/plugins/dedupe/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { jobHandler } from '@flatfile/plugin-job-handler' import { PluginOptions, dedupe } from './dedupe.plugin' diff --git a/plugins/dxp-configure/package.json b/plugins/dxp-configure/package.json index 45eb613c5..c5ce693e4 100644 --- a/plugins/dxp-configure/package.json +++ b/plugins/dxp-configure/package.json @@ -45,7 +45,9 @@ }, "license": "ISC", "dependencies": { - "@flatfile/api": "^1.7.4", + "@flatfile/api": "^1.7.4" + }, + "peerDependencies": { "@flatfile/listener": "^1.0.1" }, "devDependencies": { diff --git a/plugins/export-workbook/package.json b/plugins/export-workbook/package.json index a001c3ae6..292666579 100644 --- a/plugins/export-workbook/package.json +++ b/plugins/export-workbook/package.json @@ -28,9 +28,11 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-common": "^1.0.0", "remeda": "^1.14.0", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/export-workbook/src/index.ts b/plugins/export-workbook/src/index.ts index 7547ea412..7d4bc6686 100644 --- a/plugins/export-workbook/src/index.ts +++ b/plugins/export-workbook/src/index.ts @@ -1,4 +1,4 @@ -import { FlatfileListener } from '@flatfile/listener' +import type { FlatfileListener } from '@flatfile/listener' import { PluginOptions, exportRecords } from './plugin' /** diff --git a/plugins/export-workbook/src/plugin.ts b/plugins/export-workbook/src/plugin.ts index 68e5a42b3..9975a80ca 100644 --- a/plugins/export-workbook/src/plugin.ts +++ b/plugins/export-workbook/src/plugin.ts @@ -1,5 +1,6 @@ -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { FlatfileEvent } from '@flatfile/listener' import { logError, logInfo, processRecords } from '@flatfile/util-common' import * as fs from 'fs' import path from 'path' diff --git a/plugins/foreign-db-extractor/src/index.ts b/plugins/foreign-db-extractor/src/index.ts index a2859f358..bc9acc641 100644 --- a/plugins/foreign-db-extractor/src/index.ts +++ b/plugins/foreign-db-extractor/src/index.ts @@ -1,9 +1,10 @@ import api, { Flatfile } from '@flatfile/api' -import FlatfileListener, { FlatfileEvent } from '@flatfile/listener' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import sql from 'mssql' import { pollDatabaseStatus } from './database.poll.status' import { restoreDatabase } from './database.restore' -import { DBUser, pollForUser } from './database.user' +import type { DBUser } from './database.user' +import { pollForUser } from './database.user' import { s3Upload } from './s3.upload' import { generateSheets } from './sheets.generator' diff --git a/plugins/json-schema/package.json b/plugins/json-schema/package.json index 4662440b3..b50f69c99 100644 --- a/plugins/json-schema/package.json +++ b/plugins/json-schema/package.json @@ -28,8 +28,10 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-space-configure": "^0.3.2", "axios": "^1.6.5" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/json-schema/src/index.ts b/plugins/json-schema/src/index.ts index 1c8bc276f..0d63f63fb 100644 --- a/plugins/json-schema/src/index.ts +++ b/plugins/json-schema/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { configureSpace } from '@flatfile/plugin-space-configure' import { JsonSetupFactory, generateSetup } from './setup.factory' diff --git a/plugins/merge-connection/package.json b/plugins/merge-connection/package.json index bc208b395..84b770c3d 100644 --- a/plugins/merge-connection/package.json +++ b/plugins/merge-connection/package.json @@ -28,9 +28,11 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-convert-openapi-schema": "^0.1.2", "@flatfile/plugin-job-handler": "^0.4.1", "@mergeapi/merge-node-client": "^1.0.4" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/merge-connection/src/create.workbook.ts b/plugins/merge-connection/src/create.workbook.ts index 468e4e976..bc6fee524 100644 --- a/plugins/merge-connection/src/create.workbook.ts +++ b/plugins/merge-connection/src/create.workbook.ts @@ -1,5 +1,6 @@ -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { FlatfileEvent } from '@flatfile/listener' import { PartialSheetConfig, SetupFactory, diff --git a/plugins/merge-connection/src/merge.plugin.ts b/plugins/merge-connection/src/merge.plugin.ts index 45a88afbe..0062882d0 100644 --- a/plugins/merge-connection/src/merge.plugin.ts +++ b/plugins/merge-connection/src/merge.plugin.ts @@ -1,4 +1,4 @@ -import { FlatfileListener } from '@flatfile/listener' +import type { FlatfileListener } from '@flatfile/listener' import { jobHandler } from '@flatfile/plugin-job-handler' import { handleCreateConnectedWorkbooks } from './create.workbook' import { handleConnectedWorkbookSync } from './sync.workbook' diff --git a/plugins/merge-connection/src/sync.workbook.ts b/plugins/merge-connection/src/sync.workbook.ts index 710720b47..ebde992fd 100644 --- a/plugins/merge-connection/src/sync.workbook.ts +++ b/plugins/merge-connection/src/sync.workbook.ts @@ -1,5 +1,6 @@ -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { FlatfileEvent } from '@flatfile/listener' import { MERGE_ACCESS_KEY } from './config' import { waitForMergeSync } from './poll.for.merge.sync' import { syncData } from './sync.data' diff --git a/plugins/openapi-schema/package.json b/plugins/openapi-schema/package.json index 5bc1c6705..f215f0aff 100644 --- a/plugins/openapi-schema/package.json +++ b/plugins/openapi-schema/package.json @@ -44,6 +44,9 @@ "@flatfile/plugin-space-configure": "^0.3.2", "axios": "^1.6.5" }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + }, "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.1", diff --git a/plugins/openapi-schema/src/index.ts b/plugins/openapi-schema/src/index.ts index 593f6526c..500a4203b 100644 --- a/plugins/openapi-schema/src/index.ts +++ b/plugins/openapi-schema/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { configureSpace } from '@flatfile/plugin-space-configure' import { OpenAPISetupFactory, generateSetup } from './setup.factory' diff --git a/plugins/pdf-extractor/package.json b/plugins/pdf-extractor/package.json index 0faa5cef6..e359a009d 100644 --- a/plugins/pdf-extractor/package.json +++ b/plugins/pdf-extractor/package.json @@ -28,12 +28,14 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-file-buffer": "^0.2.1", "axios": "^1.6.5", "fs-extra": "^11.1.1", "remeda": "^1.14.0" }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + }, "devDependencies": { "@types/fs-extra": "^11.0.1" } diff --git a/plugins/pdf-extractor/src/index.ts b/plugins/pdf-extractor/src/index.ts index 931a06fa9..867b70bff 100644 --- a/plugins/pdf-extractor/src/index.ts +++ b/plugins/pdf-extractor/src/index.ts @@ -1,4 +1,4 @@ -import { FlatfileListener } from '@flatfile/listener' +import type { FlatfileListener } from '@flatfile/listener' import { fileBuffer } from '@flatfile/util-file-buffer' import { PluginOptions, run } from './plugin' diff --git a/plugins/pdf-extractor/src/plugin.ts b/plugins/pdf-extractor/src/plugin.ts index 764309d24..c1646025d 100644 --- a/plugins/pdf-extractor/src/plugin.ts +++ b/plugins/pdf-extractor/src/plugin.ts @@ -1,6 +1,7 @@ +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' +import type { FlatfileEvent } from '@flatfile/listener' import axios from 'axios' -import api, { Flatfile } from '@flatfile/api' -import { FlatfileEvent } from '@flatfile/listener' import * as fs from 'fs-extra' import * as R from 'remeda' diff --git a/plugins/psv-extractor/package.json b/plugins/psv-extractor/package.json index 9f90c2897..44847d0e4 100644 --- a/plugins/psv-extractor/package.json +++ b/plugins/psv-extractor/package.json @@ -27,7 +27,9 @@ }, "license": "ISC", "dependencies": { - "@flatfile/api": "^1.7.4", + "@flatfile/api": "^1.7.4" + }, + "peerDependencies": { "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/psv-extractor/src/index.ts b/plugins/psv-extractor/src/index.ts index 1d1c1f64a..db16df931 100644 --- a/plugins/psv-extractor/src/index.ts +++ b/plugins/psv-extractor/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileListener } from '@flatfile/listener' /* * @deprecated diff --git a/plugins/record-hook/package.json b/plugins/record-hook/package.json index 24cd6af54..0404f78dc 100644 --- a/plugins/record-hook/package.json +++ b/plugins/record-hook/package.json @@ -46,11 +46,13 @@ }, "license": "ISC", "dependencies": { - "@flatfile/hooks": "^1.3.1", "@flatfile/util-common": "^1.0.3" }, "peerDependencies": { "@flatfile/api": "^1.7.4", "@flatfile/listener": "^1.0.1" + }, + "devDependencies": { + "@flatfile/hooks": "^1.3.1" } } diff --git a/plugins/record-hook/src/index.ts b/plugins/record-hook/src/index.ts index d06f1d80f..e03a6c642 100644 --- a/plugins/record-hook/src/index.ts +++ b/plugins/record-hook/src/index.ts @@ -1,4 +1,4 @@ export * from './RecordHook' export * from './record.hook.plugin' -export { FlatfileRecord } from '@flatfile/hooks' +export type { FlatfileRecord } from '@flatfile/hooks' diff --git a/plugins/record-hook/src/record.hook.plugin.ts b/plugins/record-hook/src/record.hook.plugin.ts index b75642358..eabbda181 100644 --- a/plugins/record-hook/src/record.hook.plugin.ts +++ b/plugins/record-hook/src/record.hook.plugin.ts @@ -1,11 +1,7 @@ import type { FlatfileRecord } from '@flatfile/hooks' import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' -import { - BulkRecordHook, - BulkRecordHookOptions, - RecordHook, - RecordHookOptions, -} from './RecordHook' +import type { BulkRecordHookOptions, RecordHookOptions } from './RecordHook' +import { BulkRecordHook, RecordHook } from './RecordHook' export const recordHookPlugin = ( sheetSlug: string, diff --git a/plugins/space-configure/src/space.configure.spec.ts b/plugins/space-configure/src/space.configure.spec.ts index bdbc1b3f2..957fa1d4e 100644 --- a/plugins/space-configure/src/space.configure.spec.ts +++ b/plugins/space-configure/src/space.configure.spec.ts @@ -1,7 +1,8 @@ import api from '@flatfile/api' import { deleteSpace, setupListener, setupSpace } from '@flatfile/utils-testing' +import type { SetupFactory } from '.' +import { configureSpace } from '.' import { gettingStartedSheet } from '../ref/getting_started' -import { SetupFactory, configureSpace } from '.' const setup: SetupFactory = { workbooks: [ diff --git a/plugins/sql-ddl-converter/package.json b/plugins/sql-ddl-converter/package.json index 415b3ca7d..47007931e 100644 --- a/plugins/sql-ddl-converter/package.json +++ b/plugins/sql-ddl-converter/package.json @@ -30,7 +30,9 @@ "@flatfile/api": "^1.7.4", "@flatfile/plugin-convert-json-schema": "^0.2.2", "@flatfile/plugin-space-configure": "^0.3.2", - "axios": "^1.5.1", "sql-ddl-to-json-schema": "^4.1.0" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } \ No newline at end of file diff --git a/plugins/sql-ddl-converter/src/index.ts b/plugins/sql-ddl-converter/src/index.ts index 95c231d86..3360e66bf 100644 --- a/plugins/sql-ddl-converter/src/index.ts +++ b/plugins/sql-ddl-converter/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { configureSpace } from '@flatfile/plugin-space-configure' import { SqlSetupFactory, generateSetup } from './setup.factory' diff --git a/plugins/tsv-extractor/package.json b/plugins/tsv-extractor/package.json index 542adf62b..31721b766 100644 --- a/plugins/tsv-extractor/package.json +++ b/plugins/tsv-extractor/package.json @@ -28,5 +28,8 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/tsv-extractor/src/index.ts b/plugins/tsv-extractor/src/index.ts index 13ba71746..5a0b0c2cf 100644 --- a/plugins/tsv-extractor/src/index.ts +++ b/plugins/tsv-extractor/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileListener } from '@flatfile/listener' /* * @deprecated diff --git a/plugins/webhook-egress/package.json b/plugins/webhook-egress/package.json index 689b910cc..348eacbc3 100644 --- a/plugins/webhook-egress/package.json +++ b/plugins/webhook-egress/package.json @@ -42,11 +42,13 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-job-handler": "^0.4.1", "@flatfile/util-common": "^1.0.3", "@flatfile/util-response-rejection": "^1.2.4", - "node-fetch": "^3.3.2" + "cross-fetch": "^4.0.0" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" }, "devDependencies": { "@flatfile/utils-testing": "^0.1.3", diff --git a/plugins/webhook-event-forwarder/package.json b/plugins/webhook-event-forwarder/package.json index 6cb5edd87..4560a315d 100644 --- a/plugins/webhook-event-forwarder/package.json +++ b/plugins/webhook-event-forwarder/package.json @@ -45,9 +45,11 @@ "homepage": "https://github.com/FlatFilers/flatfile-plugins#readme", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "node-fetch": "^3.3.2" }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + }, "devDependencies": { "jest-fetch-mock": "^3.0.3" } diff --git a/plugins/webhook-event-forwarder/src/forward.webhook.ts b/plugins/webhook-event-forwarder/src/forward.webhook.ts index d6a7e8b92..a345c724c 100644 --- a/plugins/webhook-event-forwarder/src/forward.webhook.ts +++ b/plugins/webhook-event-forwarder/src/forward.webhook.ts @@ -1,4 +1,4 @@ -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' export function webhookEventForward( url?: string, diff --git a/plugins/xlsx-extractor/package.json b/plugins/xlsx-extractor/package.json index e6fc29b34..35c504d83 100644 --- a/plugins/xlsx-extractor/package.json +++ b/plugins/xlsx-extractor/package.json @@ -30,5 +30,8 @@ "@flatfile/util-extractor": "^0.5.5", "remeda": "^1.14.0", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/xml-extractor/package.json b/plugins/xml-extractor/package.json index 042293bda..efa3d3350 100644 --- a/plugins/xml-extractor/package.json +++ b/plugins/xml-extractor/package.json @@ -30,5 +30,8 @@ "@flatfile/util-extractor": "^0.5.0", "remeda": "^1.24.0", "xml-json-format": "^1.0.8" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/plugins/yaml-schema/package.json b/plugins/yaml-schema/package.json index f23742e70..738f519c2 100644 --- a/plugins/yaml-schema/package.json +++ b/plugins/yaml-schema/package.json @@ -28,14 +28,15 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-convert-json-schema": "^0.2.2", "@flatfile/plugin-space-configure": "^0.3.2", "@flatfile/util-fetch-schema": "^0.1.2", "@flatfile/utils-testing": "^0.1.3", - "axios": "^1.6.5", "js-yaml": "^4.1.0" }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + }, "devDependencies": { "express": "^4.18.2" } diff --git a/plugins/yaml-schema/src/index.ts b/plugins/yaml-schema/src/index.ts index a0aa123ba..36a4bf3cf 100644 --- a/plugins/yaml-schema/src/index.ts +++ b/plugins/yaml-schema/src/index.ts @@ -1,5 +1,5 @@ -import { Flatfile } from '@flatfile/api' -import { FlatfileEvent, FlatfileListener } from '@flatfile/listener' +import type { Flatfile } from '@flatfile/api' +import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { generateFields } from '@flatfile/plugin-convert-json-schema' import { Setup, diff --git a/plugins/zip-extractor/package.json b/plugins/zip-extractor/package.json index 5e300fcdd..fb4051c52 100644 --- a/plugins/zip-extractor/package.json +++ b/plugins/zip-extractor/package.json @@ -28,11 +28,13 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-common": "^1.0.0", "@flatfile/util-file-buffer": "^0.2.1", "adm-zip": "^0.5.10" }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + }, "devDependencies": { "@flatfile/utils-testing": "^0.1.3", "@types/adm-zip": "^0.4.3" diff --git a/utils/common/src/async.batch.spec.ts b/utils/common/src/async.batch.spec.ts index 82404f644..131d7d97a 100644 --- a/utils/common/src/async.batch.spec.ts +++ b/utils/common/src/async.batch.spec.ts @@ -1,4 +1,4 @@ -import { FlatfileEvent } from '@flatfile/listener' +import type { FlatfileEvent } from '@flatfile/listener' import { asyncBatch, chunkify } from './async.batch' describe('asyncBatch', () => { diff --git a/utils/common/src/async.batch.ts b/utils/common/src/async.batch.ts index c11a0bff4..ff9751f6a 100644 --- a/utils/common/src/async.batch.ts +++ b/utils/common/src/async.batch.ts @@ -1,4 +1,4 @@ -import { FlatfileEvent } from '@flatfile/listener' +import type { FlatfileEvent } from '@flatfile/listener' export async function asyncBatch( arr: T[], diff --git a/utils/extractor/package.json b/utils/extractor/package.json index cadbc57e5..c7b8a41e1 100644 --- a/utils/extractor/package.json +++ b/utils/extractor/package.json @@ -25,8 +25,10 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-common": "^1.0.0", "@flatfile/util-file-buffer": "^0.2.1" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } } diff --git a/utils/file-buffer/src/index.ts b/utils/file-buffer/src/index.ts index 7876db0bd..faf49a009 100644 --- a/utils/file-buffer/src/index.ts +++ b/utils/file-buffer/src/index.ts @@ -1,4 +1,5 @@ -import api, { Flatfile } from '@flatfile/api' +import type { Flatfile } from '@flatfile/api' +import api from '@flatfile/api' import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' export const fileBuffer = ( From d23742ced64296e0e6fe67fc2aac89ee87a9965e Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 11:33:30 -0500 Subject: [PATCH 03/16] axios -> cross-fetch axios -> cross-fetch --- package-lock.json | 1768 +++++++++++++++--- plugins/json-schema/package.json | 2 +- plugins/json-schema/src/setup.factory.ts | 19 +- plugins/openapi-schema/package.json | 2 +- plugins/openapi-schema/src/setup.factory.ts | 13 +- plugins/pdf-extractor/package.json | 4 +- plugins/pdf-extractor/src/plugin.ts | 66 +- plugins/webhook-event-forwarder/package.json | 4 +- utils/fetch-schema/package.json | 3 +- utils/fetch-schema/src/index.ts | 24 +- utils/testing/package.json | 4 +- utils/testing/src/test.helpers.ts | 41 +- 12 files changed, 1634 insertions(+), 316 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f87970a4..43aa1e7ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,6 @@ "flatfilers/playground": { "name": "flatfile-playground", "version": "0.0.0", - "extraneous": true, "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.10", @@ -1080,6 +1079,20 @@ "prettier": "^2.7.1" } }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@faker-js/faker": { "version": "7.6.0", "dev": true, @@ -1090,9 +1103,7 @@ } }, "node_modules/@flatfile/api": { - "version": "1.7.10", - "resolved": "https://registry.npmjs.org/@flatfile/api/-/api-1.7.10.tgz", - "integrity": "sha512-jEptJHdkCO+ZUJ35dSZEykv6fF/5KbOaSNcNIoIMZJLIrZAey2n8HKhpLNA1yXpNQ8MuwOuAoKC4RaX9qoyjxw==", + "version": "1.7.11", "dependencies": { "@flatfile/cross-env-config": "0.0.4", "@types/pako": "2.0.1", @@ -1313,6 +1324,88 @@ "resolved": "utils/testing", "link": true }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "license": "ISC", @@ -1965,7 +2058,6 @@ }, "node_modules/@jridgewell/source-map": { "version": "0.3.5", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", @@ -2080,8 +2172,6 @@ }, "node_modules/@mergeapi/merge-node-client": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@mergeapi/merge-node-client/-/merge-node-client-1.0.5.tgz", - "integrity": "sha512-cDjdG0+waWzhx19aS/jnS4+PtzY7OznVvpWsikYtA9cfn0ZnCn5oVSWs62VjOvXs1pYWEh11tNQ6E16s2k1eWA==", "dependencies": { "form-data": "4.0.0", "js-base64": "3.7.2", @@ -2117,7 +2207,6 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -2129,7 +2218,6 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -2137,7 +2225,6 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -3953,6 +4040,14 @@ "@parcel/core": "^2.12.0" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@rollup/plugin-commonjs": { "version": "25.0.7", "dev": true, @@ -3998,7 +4093,6 @@ }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.2.3", - "dev": true, "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -4068,7 +4162,6 @@ }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", - "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", @@ -4191,9 +4284,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz", - "integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.0.tgz", + "integrity": "sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==", "cpu": [ "x64" ], @@ -4274,7 +4367,7 @@ }, "node_modules/@swc/core": { "version": "1.3.104", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -4326,7 +4419,7 @@ }, "node_modules/@swc/counter": { "version": "0.1.2", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@swc/helpers": { @@ -4339,7 +4432,7 @@ }, "node_modules/@swc/types": { "version": "0.1.5", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@tediousjs/connection-string": { @@ -4412,7 +4505,6 @@ }, "node_modules/@types/estree": { "version": "1.0.5", - "dev": true, "license": "MIT" }, "node_modules/@types/flat": { @@ -4488,6 +4580,14 @@ "undici-types": "~5.26.4" } }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", "dev": true, @@ -4519,7 +4619,6 @@ }, "node_modules/@types/resolve": { "version": "1.20.2", - "dev": true, "license": "MIT" }, "node_modules/@types/semver": { @@ -4542,6 +4641,13 @@ "version": "21.0.3", "license": "MIT" }, + "node_modules/@vercel/ncc": { + "version": "0.36.1", + "license": "MIT", + "bin": { + "ncc": "dist/ncc/cli.js" + } + }, "node_modules/abort-controller": { "version": "3.0.0", "license": "MIT", @@ -4571,7 +4677,6 @@ }, "node_modules/acorn": { "version": "8.11.3", - "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -4626,6 +4731,20 @@ "node": ">= 4.0.0" } }, + "node_modules/ajv": { + "version": "8.12.0", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-colors": { "version": "4.1.3", "license": "MIT", @@ -4649,7 +4768,6 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4665,6 +4783,10 @@ "node": ">=4" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "license": "MIT" + }, "node_modules/anymatch": { "version": "3.1.3", "license": "ISC", @@ -4701,7 +4823,6 @@ }, "node_modules/array-union": { "version": "2.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4765,6 +4886,13 @@ "node": ">=4" } }, + "node_modules/astral-regex": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/asynckit": { "version": "0.4.0", "license": "MIT" @@ -5005,6 +5133,22 @@ "node": ">=4" } }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/body-parser": { "version": "1.20.1", "dev": true, @@ -5049,7 +5193,6 @@ }, "node_modules/brace-expansion": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -5121,18 +5264,38 @@ "node-int64": "^0.4.0" } }, + "node_modules/buffer": { + "version": "5.7.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "license": "BSD-3-Clause" }, "node_modules/buffer-from": { "version": "1.1.2", - "dev": true, "license": "MIT" }, "node_modules/builtin-modules": { "version": "3.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -5141,6 +5304,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bundle-require": { + "version": "4.0.2", + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.17" + } + }, "node_modules/bytes": { "version": "3.1.2", "dev": true, @@ -5149,6 +5325,13 @@ "node": ">= 0.8" } }, + "node_modules/cac": { + "version": "6.7.14", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.5", "license": "MIT", @@ -5259,6 +5442,28 @@ "dev": true, "license": "MIT" }, + "node_modules/chokidar": { + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "dev": true, @@ -5285,6 +5490,26 @@ "dev": true, "license": "MIT" }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "8.0.1", "dev": true, @@ -5351,7 +5576,6 @@ }, "node_modules/commondir": { "version": "1.0.1", - "dev": true, "license": "MIT" }, "node_modules/component-emitter": { @@ -5532,15 +5756,13 @@ }, "node_modules/cross-fetch": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "license": "MIT", "dependencies": { "node-fetch": "^2.6.12" } }, "node_modules/cross-spawn": { "version": "7.0.3", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -5717,6 +5939,13 @@ "dev": true, "license": "MIT" }, + "node_modules/custom-exception": { + "version": "0.1.2", + "license": "MIT", + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/data-uri-to-buffer": { "version": "6.0.1", "license": "MIT", @@ -5791,9 +6020,15 @@ } } }, + "node_modules/deep-extend": { + "version": "0.6.0", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deepmerge": { "version": "4.3.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -5801,7 +6036,6 @@ }, "node_modules/defaults": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "clone": "^1.0.2" @@ -5812,7 +6046,6 @@ }, "node_modules/defaults/node_modules/clone": { "version": "1.0.4", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8" @@ -5932,7 +6165,6 @@ }, "node_modules/dir-glob": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "path-type": "^4.0.0" @@ -6006,7 +6238,6 @@ }, "node_modules/dotenv": { "version": "16.3.1", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -6042,6 +6273,10 @@ "node": ">=10" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "license": "MIT" + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "license": "Apache-2.0", @@ -6071,7 +6306,6 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, "license": "MIT" }, "node_modules/encodeurl": { @@ -6226,6 +6460,41 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.17.19", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, "node_modules/escalade": { "version": "3.1.1", "license": "MIT", @@ -6284,7 +6553,6 @@ }, "node_modules/estree-walker": { "version": "2.0.2", - "dev": true, "license": "MIT" }, "node_modules/esutils": { @@ -6318,7 +6586,6 @@ }, "node_modules/execa": { "version": "5.1.1", - "dev": true, "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", @@ -6414,6 +6681,10 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/extend": { + "version": "3.0.2", + "license": "MIT" + }, "node_modules/extendable-error": { "version": "0.1.7", "dev": true, @@ -6432,9 +6703,22 @@ "node": ">=4" } }, + "node_modules/extract-files": { + "version": "9.0.0", + "license": "MIT", + "engines": { + "node": "^10.17.0 || ^12.0.0 || >= 13.7.0" + }, + "funding": { + "url": "https://github.com/sponsors/jaydenseric" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "license": "MIT" + }, "node_modules/fast-glob": { "version": "3.3.2", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -6457,7 +6741,6 @@ }, "node_modules/fastq": { "version": "1.16.0", - "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -6470,25 +6753,14 @@ "bser": "2.1.1" } }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], + "node_modules/figlet": { + "version": "1.7.0", "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" + "bin": { + "figlet": "bin/index.js" }, "engines": { - "node": "^12.20 || >= 14.13" + "node": ">= 0.4.0" } }, "node_modules/fill-range": { @@ -6545,6 +6817,183 @@ "flat": "cli.js" } }, + "node_modules/flatfile": { + "version": "3.6.2", + "dependencies": { + "@flatfile/cross-env-config": "^0.0.5", + "@flatfile/listener": "^1.0.0", + "@flatfile/listener-driver-pubsub": "^2.0.3", + "@rollup/plugin-commonjs": "^23.0.3", + "@rollup/plugin-json": "^5.0.2", + "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-terser": "^0.1.0", + "@rollup/plugin-typescript": "^10.0.1", + "@types/node-fetch": "^2.6.2", + "@vercel/ncc": "^0.36.1", + "axios": "^1.6.0", + "commander": "^9.3.0", + "dotenv": "^16.0.1", + "figlet": "^1.5.2", + "graphql": "^16.5.0", + "graphql-request": "^4.3.0", + "interpolate-json": "^2.2.2", + "node-fetch": "^2.6.7", + "ora": "^5.4.1", + "prompts": "^2.4.2", + "rc": "^1.2.8", + "read-package-json": "^6.0.2", + "remeda": "^0.0.35", + "rollup": "^2.79.1", + "rollup-plugin-inject-process-env": "^1.3.1", + "simple-mock": "^0.8.0", + "table": "^6.8.1", + "tsup": "^6.1.3", + "typescript": "^4.9.3", + "util": "^0.12.5", + "uuid": "^9.0.0", + "wildcard-match": "^5.1.2", + "zod": "^3.19.1" + }, + "bin": { + "flatfile": "dist/index.js" + } + }, + "node_modules/flatfile-playground": { + "resolved": "flatfilers/playground", + "link": true + }, + "node_modules/flatfile/node_modules/@flatfile/cross-env-config": { + "version": "0.0.5", + "license": "ISC" + }, + "node_modules/flatfile/node_modules/@rollup/plugin-commonjs": { + "version": "23.0.7", + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^8.0.3", + "is-reference": "1.2.1", + "magic-string": "^0.27.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/flatfile/node_modules/@rollup/plugin-json": { + "version": "5.0.2", + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/flatfile/node_modules/@rollup/plugin-terser": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "terser": "^5.15.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.x || ^3.x" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/flatfile/node_modules/@rollup/plugin-typescript": { + "version": "10.0.1", + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/flatfile/node_modules/commander": { + "version": "9.5.0", + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/flatfile/node_modules/magic-string": { + "version": "0.27.0", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/flatfile/node_modules/remeda": { + "version": "0.0.35", + "license": "MIT" + }, + "node_modules/flatfile/node_modules/rollup": { + "version": "2.79.1", + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/flatfile/node_modules/typescript": { + "version": "4.9.5", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/follow-redirects": { "version": "1.15.5", "funding": [ @@ -6570,6 +7019,30 @@ "is-callable": "^1.1.3" } }, + "node_modules/foreground-child": { + "version": "3.1.1", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.0", "license": "MIT", @@ -6582,16 +7055,6 @@ "node": ">= 6" } }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/formidable": { "version": "2.1.2", "license": "MIT", @@ -6724,7 +7187,6 @@ }, "node_modules/get-stream": { "version": "6.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -6793,7 +7255,6 @@ }, "node_modules/glob": { "version": "8.1.0", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -6811,7 +7272,6 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -6842,7 +7302,6 @@ }, "node_modules/globby": { "version": "11.1.0", - "dev": true, "license": "MIT", "dependencies": { "array-union": "^2.1.0", @@ -6878,6 +7337,44 @@ "dev": true, "license": "MIT" }, + "node_modules/graphql": { + "version": "16.8.1", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "node_modules/graphql-request": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "cross-fetch": "^3.1.5", + "extract-files": "^9.0.0", + "form-data": "^3.0.0" + }, + "peerDependencies": { + "graphql": "14 - 16" + } + }, + "node_modules/graphql-request/node_modules/cross-fetch": { + "version": "3.1.8", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/graphql-request/node_modules/form-data": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/handlebars": { "version": "4.7.8", "dev": true, @@ -7136,7 +7633,6 @@ }, "node_modules/human-signals": { "version": "2.1.0", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.17.0" @@ -7180,7 +7676,6 @@ }, "node_modules/ignore": { "version": "5.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 4" @@ -7254,6 +7749,10 @@ "version": "2.0.4", "license": "ISC" }, + "node_modules/ini": { + "version": "1.3.8", + "license": "ISC" + }, "node_modules/internal-slot": { "version": "1.0.6", "license": "MIT", @@ -7266,6 +7765,18 @@ "node": ">= 0.4" } }, + "node_modules/interpolate-json": { + "version": "2.3.3", + "license": "MIT", + "dependencies": { + "custom-exception": "^0.1.2", + "extend": "^3.0.2", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/ip": { "version": "1.1.8", "license": "MIT" @@ -7278,6 +7789,20 @@ "node": ">= 0.10" } }, + "node_modules/is-arguments": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-array-buffer": { "version": "3.0.2", "license": "MIT", @@ -7305,6 +7830,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-boolean-object": { "version": "1.1.2", "license": "MIT", @@ -7321,7 +7856,6 @@ }, "node_modules/is-builtin-module": { "version": "3.2.1", - "dev": true, "license": "MIT", "dependencies": { "builtin-modules": "^3.3.0" @@ -7345,7 +7879,6 @@ }, "node_modules/is-core-module": { "version": "2.13.1", - "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.0" @@ -7382,7 +7915,6 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -7390,7 +7922,6 @@ }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7404,9 +7935,21 @@ "node": ">=6" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", - "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -7415,6 +7958,13 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-json": { "version": "2.0.1", "dev": true, @@ -7422,7 +7972,6 @@ }, "node_modules/is-module": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/is-negative-zero": { @@ -7465,7 +8014,6 @@ }, "node_modules/is-reference": { "version": "1.2.1", - "dev": true, "license": "MIT", "dependencies": { "@types/estree": "*" @@ -7497,7 +8045,6 @@ }, "node_modules/is-stream": { "version": "2.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7556,6 +8103,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-weakref": { "version": "1.0.2", "license": "MIT", @@ -7590,7 +8147,6 @@ }, "node_modules/isexe": { "version": "2.0.0", - "dev": true, "license": "ISC" }, "node_modules/istanbul-lib-coverage": { @@ -7693,17 +8249,33 @@ "node": ">=8" } }, - "node_modules/jest": { - "version": "29.7.0", - "dev": true, - "license": "MIT", + "node_modules/jackspeak": { + "version": "2.3.6", + "license": "BlueOak-1.0.0", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" + "@isaacs/cliui": "^8.0.2" }, - "bin": { + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { "jest": "bin/jest.js" }, "engines": { @@ -9219,6 +9791,13 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/joycon": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/js-base64": { "version": "3.7.2", "license": "BSD-3-Clause" @@ -9276,6 +9855,10 @@ "node": ">=10" } }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "license": "MIT", @@ -9361,7 +9944,6 @@ }, "node_modules/kleur": { "version": "3.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -9424,9 +10006,15 @@ "version": "0.1.1", "license": "MIT" }, + "node_modules/lilconfig": { + "version": "2.1.0", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", - "dev": true, "license": "MIT" }, "node_modules/lmdb": { @@ -9458,6 +10046,13 @@ "dev": true, "license": "MIT" }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/load-yaml-file": { "version": "0.2.0", "dev": true, @@ -9523,11 +10118,91 @@ "version": "4.1.1", "license": "MIT" }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "license": "MIT" + }, "node_modules/lodash.startcase": { "version": "4.4.0", "dev": true, "license": "MIT" }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/lru-cache": { "version": "5.1.1", "license": "ISC", @@ -9644,7 +10319,6 @@ }, "node_modules/merge2": { "version": "1.4.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -9698,7 +10372,6 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -9714,7 +10387,6 @@ }, "node_modules/minimatch": { "version": "5.1.6", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -9725,7 +10397,6 @@ }, "node_modules/minimist": { "version": "1.2.8", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9744,6 +10415,13 @@ "node": ">= 6" } }, + "node_modules/minipass": { + "version": "7.0.4", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mixme": { "version": "0.5.10", "dev": true, @@ -9844,6 +10522,15 @@ "version": "2.1.2", "license": "MIT" }, + "node_modules/mz": { + "version": "2.7.0", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/native-duplexpair": { "version": "1.0.0", "license": "MIT" @@ -9905,23 +10592,6 @@ "dev": true, "license": "MIT" }, - "node_modules/node-domexception": { - "version": "1.0.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, "node_modules/node-fetch": { "version": "2.7.0", "license": "MIT", @@ -9995,9 +10665,15 @@ "node": ">=0.10.0" } }, + "node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.0.0" @@ -10022,6 +10698,13 @@ "dev": true, "license": "MIT" }, + "node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.1", "license": "MIT", @@ -10072,7 +10755,6 @@ }, "node_modules/onetime": { "version": "5.1.2", - "dev": true, "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" @@ -10165,6 +10847,85 @@ "node": ">= 10.0.0" } }, + "node_modules/ora": { + "version": "5.4.1", + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ordered-binary": { "version": "1.5.1", "dev": true, @@ -10436,7 +11197,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10444,9 +11204,29 @@ }, "node_modules/path-parse": { "version": "1.0.7", - "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "1.10.1", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.0", + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/path-to-regexp": { "version": "0.1.7", "dev": true, @@ -10454,7 +11234,6 @@ }, "node_modules/path-type": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10500,6 +11279,33 @@ "node": ">=8" } }, + "node_modules/postcss-load-config": { + "version": "3.1.4", + "license": "MIT", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^1.10.2" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, "node_modules/postcss-value-parser": { "version": "4.2.0", "dev": true, @@ -10671,7 +11477,6 @@ }, "node_modules/prompts": { "version": "2.4.2", - "dev": true, "license": "MIT", "dependencies": { "kleur": "^3.0.3", @@ -10780,9 +11585,16 @@ "ieee754": "^1.2.1" } }, - "node_modules/pure-rand": { - "version": "6.0.4", - "dev": true, + "node_modules/punycode": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.0.4", + "dev": true, "funding": [ { "type": "individual", @@ -10810,7 +11622,6 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "dev": true, "funding": [ { "type": "github", @@ -10880,6 +11691,26 @@ "node": ">= 0.8" } }, + "node_modules/rc": { + "version": "1.2.8", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-error-overlay": { "version": "6.0.9", "dev": true, @@ -10897,6 +11728,89 @@ "node": ">=0.10.0" } }, + "node_modules/read-package-json": { + "version": "6.0.4", + "license": "ISC", + "dependencies": { + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/glob": { + "version": "10.3.10", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/hosted-git-info": { + "version": "6.1.1", + "license": "ISC", + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/lru-cache": { + "version": "7.18.3", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/read-package-json/node_modules/minimatch": { + "version": "9.0.3", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/normalize-package-data": { + "version": "5.0.0", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/read-pkg": { "version": "5.2.0", "dev": true, @@ -10965,6 +11879,28 @@ "node": ">=4" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/redent": { "version": "3.0.0", "dev": true, @@ -11009,6 +11945,13 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-main-filename": { "version": "2.0.0", "dev": true, @@ -11016,7 +11959,6 @@ }, "node_modules/resolve": { "version": "1.22.8", - "dev": true, "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", @@ -11056,6 +11998,17 @@ "node": ">=10" } }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ret": { "version": "0.1.15", "license": "MIT", @@ -11065,7 +12018,6 @@ }, "node_modules/reusify": { "version": "1.0.4", - "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -11078,7 +12030,7 @@ }, "node_modules/rollup": { "version": "4.12.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.5" @@ -11128,6 +12080,20 @@ "typescript": "^4.5 || ^5.0" } }, + "node_modules/rollup-plugin-inject-process-env": { + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "magic-string": "^0.25.7" + } + }, + "node_modules/rollup-plugin-inject-process-env/node_modules/magic-string": { + "version": "0.25.9", + "license": "MIT", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, "node_modules/rollup-plugin-peer-deps-external": { "version": "2.2.4", "dev": true, @@ -11151,7 +12117,6 @@ }, "node_modules/run-parallel": { "version": "1.2.0", - "dev": true, "funding": [ { "type": "github", @@ -11343,7 +12308,6 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -11354,7 +12318,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -11376,9 +12339,12 @@ "version": "3.0.7", "license": "ISC" }, + "node_modules/simple-mock": { + "version": "0.8.0", + "license": "MIT" + }, "node_modules/sisteransi": { "version": "1.0.5", - "dev": true, "license": "MIT" }, "node_modules/slash": { @@ -11388,6 +12354,48 @@ "node": ">=8" } }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, "node_modules/smart-buffer": { "version": "4.2.0", "license": "MIT", @@ -11548,7 +12556,6 @@ }, "node_modules/source-map": { "version": "0.6.1", - "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -11573,6 +12580,10 @@ "source-map": "^0.6.0" } }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "license": "MIT" + }, "node_modules/spawndamnit": { "version": "2.0.0", "dev": true, @@ -11638,7 +12649,6 @@ }, "node_modules/spdx-correct": { "version": "3.2.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", @@ -11647,12 +12657,10 @@ }, "node_modules/spdx-exceptions": { "version": "2.3.0", - "dev": true, "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", @@ -11661,7 +12669,6 @@ }, "node_modules/spdx-license-ids": { "version": "3.0.16", - "dev": true, "license": "CC0-1.0" }, "node_modules/sprintf-js": { @@ -11758,7 +12765,19 @@ }, "node_modules/string-width": { "version": "4.2.3", - "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -11810,7 +12829,17 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -11829,7 +12858,6 @@ }, "node_modules/strip-final-newline": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -11857,6 +12885,66 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/sucrase": { + "version": "3.35.0", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/sucrase/node_modules/glob": { + "version": "10.3.10", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sucrase/node_modules/minimatch": { + "version": "9.0.3", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/superagent": { "version": "8.1.2", "license": "MIT", @@ -11917,7 +13005,6 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -11952,6 +13039,20 @@ "url": "https://opencollective.com/svgo" } }, + "node_modules/table": { + "version": "6.8.1", + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/tarn": { "version": "3.0.2", "license": "MIT", @@ -12052,7 +13153,6 @@ }, "node_modules/terser": { "version": "5.27.0", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -12069,12 +13169,10 @@ }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", - "dev": true, "license": "MIT" }, "node_modules/terser/node_modules/source-map-support": { "version": "0.5.21", - "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", @@ -12129,6 +13227,23 @@ "node": "*" } }, + "node_modules/thenify": { + "version": "3.3.1", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/timsort": { "version": "0.3.0", "dev": true, @@ -12178,6 +13293,13 @@ "version": "0.0.3", "license": "MIT" }, + "node_modules/tree-kill": { + "version": "1.2.2", + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/trim-newlines": { "version": "3.0.1", "dev": true, @@ -12186,6 +13308,10 @@ "node": ">=8" } }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "license": "Apache-2.0" + }, "node_modules/ts-jest": { "version": "29.1.2", "dev": true, @@ -12240,7 +13366,113 @@ "version": "2.6.2", "license": "0BSD" }, - "node_modules/tty-table": { + "node_modules/tsup": { + "version": "6.7.0", + "license": "MIT", + "dependencies": { + "bundle-require": "^4.0.0", + "cac": "^6.7.12", + "chokidar": "^3.5.1", + "debug": "^4.3.1", + "esbuild": "^0.17.6", + "execa": "^5.0.0", + "globby": "^11.0.3", + "joycon": "^3.0.1", + "postcss-load-config": "^3.0.1", + "resolve-from": "^5.0.0", + "rollup": "^3.2.5", + "source-map": "0.8.0-beta.0", + "sucrase": "^3.20.3", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/tsup/node_modules/rollup": { + "version": "3.29.4", + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/tsup/node_modules/source-map": { + "version": "0.8.0-beta.0", + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tsup/node_modules/tr46": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/tsup/node_modules/webidl-conversions": { + "version": "4.0.2", + "license": "BSD-2-Clause" + }, + "node_modules/tsup/node_modules/whatwg-url": { + "version": "7.1.0", + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "node_modules/tty-table": { "version": "4.2.3", "dev": true, "license": "MIT", @@ -12449,7 +13681,7 @@ }, "node_modules/typescript": { "version": "5.3.3", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -12531,10 +13763,32 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/url-join": { "version": "4.0.1", "license": "MIT" }, + "node_modules/util": { + "version": "0.12.5", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, "node_modules/utility-types": { "version": "3.11.0", "dev": true, @@ -12551,6 +13805,17 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "dev": true, @@ -12566,7 +13831,6 @@ }, "node_modules/validate-npm-package-license": { "version": "3.0.4", - "dev": true, "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", @@ -12590,7 +13854,6 @@ }, "node_modules/wcwidth": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "defaults": "^1.0.3" @@ -12601,13 +13864,6 @@ "dev": true, "license": "MIT" }, - "node_modules/web-streams-polyfill": { - "version": "3.3.2", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "license": "BSD-2-Clause" @@ -12622,7 +13878,6 @@ }, "node_modules/which": { "version": "2.0.2", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -12707,6 +13962,49 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "dev": true, @@ -12793,6 +14091,13 @@ "version": "3.1.1", "license": "ISC" }, + "node_modules/yaml": { + "version": "1.10.2", + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, "node_modules/yargs": { "version": "17.7.2", "dev": true, @@ -12841,9 +14146,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zod": { + "version": "3.22.4", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "plugins/autocast": { "name": "@flatfile/plugin-autocast", - "version": "0.7.8", + "version": "0.7.9", "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", @@ -12865,7 +14177,6 @@ "dependencies": { "@flatfile/api": "^1.7.4", "@flatfile/common-plugin-utils": "^1.0.1", - "@flatfile/listener": "^1.0.1", "remeda": "^1.23.0" }, "devDependencies": { @@ -12873,6 +14184,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/constraints": { @@ -12940,8 +14254,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1" + "@flatfile/api": "^1.7.4" }, "devDependencies": { "@flatfile/configure": "^0.5.39", @@ -12953,6 +14266,9 @@ }, "engines": { "node": ">= 12" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/export-workbook": { @@ -12961,13 +14277,15 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-common": "^1.0.0", "remeda": "^1.14.0", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz" }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/foreign-db-extractor": { @@ -13033,12 +14351,14 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-space-configure": "^0.3.2", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/merge-connection": { @@ -13047,24 +14367,15 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-convert-openapi-schema": "^0.1.2", "@flatfile/plugin-job-handler": "^0.4.1", "@mergeapi/merge-node-client": "^1.0.4" }, "engines": { "node": ">= 16" - } - }, - "plugins/merge-connection/node_modules/@mergeapi/merge-node-client/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "extraneous": true, - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/openapi-schema": { @@ -13074,7 +14385,7 @@ "dependencies": { "@flatfile/api": "^1.7.4", "@flatfile/plugin-space-configure": "^0.3.2", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", @@ -13085,6 +14396,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/pdf-extractor": { @@ -13093,9 +14407,10 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", + "@flatfile/util-common": "^1.0.3", "@flatfile/util-file-buffer": "^0.2.1", - "axios": "^1.6.5", + "cross-fetch": "^4.0.0", + "form-data": "^4.0.0", "fs-extra": "^11.1.1", "remeda": "^1.14.0" }, @@ -13104,6 +14419,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/pdf-extractor/node_modules/fs-extra": { @@ -13140,11 +14458,13 @@ "version": "1.7.1", "license": "ISC", "dependencies": { - "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1" + "@flatfile/api": "^1.7.4" }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/record-hook": { @@ -13152,9 +14472,11 @@ "version": "1.4.6", "license": "ISC", "dependencies": { - "@flatfile/hooks": "^1.3.1", "@flatfile/util-common": "^1.0.3" }, + "devDependencies": { + "@flatfile/hooks": "^1.3.1" + }, "engines": { "node": ">= 12" }, @@ -13189,11 +14511,13 @@ "@flatfile/api": "^1.7.4", "@flatfile/plugin-convert-json-schema": "^0.2.2", "@flatfile/plugin-space-configure": "^0.3.2", - "axios": "^1.5.1", "sql-ddl-to-json-schema": "^4.1.0" }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/tsv-extractor": { @@ -13205,6 +14529,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/webhook-egress": { @@ -13213,11 +14540,10 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-job-handler": "^0.4.1", "@flatfile/util-common": "^1.0.3", "@flatfile/util-response-rejection": "^1.2.4", - "node-fetch": "^3.3.2" + "cross-fetch": "^4.0.0" }, "devDependencies": { "@flatfile/utils-testing": "^0.1.3", @@ -13225,29 +14551,9 @@ }, "engines": { "node": ">= 16" - } - }, - "plugins/webhook-egress/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "plugins/webhook-egress/node_modules/node-fetch": { - "version": "3.3.2", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/webhook-event-forwarder": { @@ -13256,37 +14562,16 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", - "node-fetch": "^3.3.2" + "cross-fetch": "^4.0.0" }, "devDependencies": { "jest-fetch-mock": "^3.0.3" }, "engines": { "node": ">= 16" - } - }, - "plugins/webhook-event-forwarder/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "plugins/webhook-event-forwarder/node_modules/node-fetch": { - "version": "3.3.2", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/xlsx-extractor": { @@ -13300,6 +14585,9 @@ }, "engines": { "node": ">= 12" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/xml-extractor": { @@ -13313,6 +14601,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/yaml-schema": { @@ -13321,12 +14612,10 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/plugin-convert-json-schema": "^0.2.2", "@flatfile/plugin-space-configure": "^0.3.2", "@flatfile/util-fetch-schema": "^0.1.2", "@flatfile/utils-testing": "^0.1.3", - "axios": "^1.6.5", "js-yaml": "^4.1.0" }, "devDependencies": { @@ -13334,6 +14623,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "plugins/yaml-schema/node_modules/argparse": { @@ -13356,7 +14648,6 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-common": "^1.0.0", "@flatfile/util-file-buffer": "^0.2.1", "adm-zip": "^0.5.10" @@ -13367,6 +14658,9 @@ }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "support/common-utils": { @@ -13395,8 +14689,7 @@ }, "utils/common/node_modules/@flatfile/cross-env-config": { "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@flatfile/cross-env-config/-/cross-env-config-0.0.5.tgz", - "integrity": "sha512-4/hRTQ6BsD+CQKkrexcqd3wwIyRx7uilC0JOF6E0Q1K26/pgatuo1yBMO7Ofo3zs3ZqM5YISQps+0huggypMmg==" + "license": "ISC" }, "utils/extractor": { "name": "@flatfile/util-extractor", @@ -13404,12 +14697,14 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", "@flatfile/util-common": "^1.0.0", "@flatfile/util-file-buffer": "^0.2.1" }, "engines": { "node": ">= 16" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" } }, "utils/fetch-schema": { @@ -13418,8 +14713,7 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" }, "engines": { "node": ">= 16" @@ -13458,7 +14752,7 @@ "@flatfile/listener": "^1.0.1", "@flatfile/listener-driver-pubsub": "^2.0.0", "@jest/globals": "^29.6.4", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" }, "engines": { "node": ">= 16" diff --git a/plugins/json-schema/package.json b/plugins/json-schema/package.json index b50f69c99..d56640bbe 100644 --- a/plugins/json-schema/package.json +++ b/plugins/json-schema/package.json @@ -29,7 +29,7 @@ "dependencies": { "@flatfile/api": "^1.7.4", "@flatfile/plugin-space-configure": "^0.3.2", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" }, "peerDependencies": { "@flatfile/listener": "^1.0.1" diff --git a/plugins/json-schema/src/setup.factory.ts b/plugins/json-schema/src/setup.factory.ts index 90b5d9ccb..111a04320 100644 --- a/plugins/json-schema/src/setup.factory.ts +++ b/plugins/json-schema/src/setup.factory.ts @@ -1,6 +1,6 @@ import { Flatfile } from '@flatfile/api' import { SetupFactory } from '@flatfile/plugin-space-configure' -import axios from 'axios' +import fetch from 'cross-fetch' export type JsonSetupFactory = { workbooks: PartialWorkbookConfig[] @@ -219,13 +219,18 @@ export function resolveLocalReference(schema: any, ref: string): any { export async function fetchExternalReference(url: string): Promise { try { - const { status, data } = await axios.get(url, { - validateStatus: () => true, - }) - if (status !== 200) - throw new Error(`API returned status ${status}: ${data.statusText}`) + const response = await fetch(url) + if (!response.ok) { + throw new Error( + `API returned status ${response.status}: ${response.statusText}` + ) + } + + const data = await response.json() return data } catch (error) { - throw new Error(`Error fetching external reference: ${error.message}`) + throw new Error( + `Error fetching external reference: ${(error as any).message}` + ) } } diff --git a/plugins/openapi-schema/package.json b/plugins/openapi-schema/package.json index f215f0aff..373f7a6b5 100644 --- a/plugins/openapi-schema/package.json +++ b/plugins/openapi-schema/package.json @@ -42,7 +42,7 @@ "dependencies": { "@flatfile/api": "^1.7.4", "@flatfile/plugin-space-configure": "^0.3.2", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" }, "peerDependencies": { "@flatfile/listener": "^1.0.1" diff --git a/plugins/openapi-schema/src/setup.factory.ts b/plugins/openapi-schema/src/setup.factory.ts index b1f62584d..f2b89fd81 100644 --- a/plugins/openapi-schema/src/setup.factory.ts +++ b/plugins/openapi-schema/src/setup.factory.ts @@ -1,6 +1,6 @@ import { Flatfile } from '@flatfile/api' import { PartialWb, SetupFactory } from '@flatfile/plugin-space-configure' -import axios from 'axios' +import fetch from 'cross-fetch' export type OpenAPISetupFactory = { workbooks: PartialWorkbookConfig[] @@ -48,14 +48,15 @@ export async function generateSetup( try { const workbooks: PartialWb[] = await Promise.all( setupFactory.workbooks.map(async (workbook) => { - const { status, data } = await axios.get(workbook.source, { - validateStatus: () => true, - }) + const response = await fetch(workbook.source) - if (status !== 200) { - throw new Error(`API returned status ${status}: ${data.statusText}`) + if (!response.ok) { + throw new Error( + `API returned status ${response.status}: ${response.statusText}` + ) } + const data = await response.json() const schemas: ApiSchemas = data.components.schemas const sheets: Flatfile.SheetConfig[] = ( diff --git a/plugins/pdf-extractor/package.json b/plugins/pdf-extractor/package.json index e359a009d..b4df31332 100644 --- a/plugins/pdf-extractor/package.json +++ b/plugins/pdf-extractor/package.json @@ -28,8 +28,10 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", + "@flatfile/util-common": "^1.0.3", "@flatfile/util-file-buffer": "^0.2.1", - "axios": "^1.6.5", + "cross-fetch": "^4.0.0", + "form-data": "^4.0.0", "fs-extra": "^11.1.1", "remeda": "^1.14.0" }, diff --git a/plugins/pdf-extractor/src/plugin.ts b/plugins/pdf-extractor/src/plugin.ts index c1646025d..67ef332fd 100644 --- a/plugins/pdf-extractor/src/plugin.ts +++ b/plugins/pdf-extractor/src/plugin.ts @@ -1,16 +1,12 @@ import type { Flatfile } from '@flatfile/api' import api from '@flatfile/api' import type { FlatfileEvent } from '@flatfile/listener' -import axios from 'axios' +import { logError, logInfo } from '@flatfile/util-common' +import fetch from 'cross-fetch' +import FormData from 'form-data' import * as fs from 'fs-extra' import * as R from 'remeda' -/** - * Plugin config options. - * - * @property {string} apiKey - `pdftables.com` API key - * @property {boolean} debug - show helpful messages useful for debugging (usage intended for development) - */ export interface PluginOptions { readonly apiKey: string readonly debug?: boolean @@ -29,7 +25,7 @@ export const run = async ( } if (R.isEmpty(opts.apiKey)) { - logError('Found invalid API key') + logError('@flatfile/plugin-pdf-extractor', 'Found invalid API key') return } @@ -42,20 +38,33 @@ export const run = async ( )} (Converted PDF)-${currentEpoch()}.csv` const formData = new FormData() - formData.append('file', new Blob([buffer])) + formData.append('file', buffer, { filename: file.name }) - const response = await axios.postForm(url, formData) + const fetchOptions = { + method: 'POST', + body: formData as any, + headers: formData.getHeaders(), + } - if (response.status !== 200) { - logError('Failed to convert PDF on files.com') + const response = await fetch(url, fetchOptions) + if (response.status !== 200) { + logError( + '@flatfile/plugin-pdf-extractor', + 'Failed to convert PDF on pdftables.com' + ) return } - fs.writeFile(fileName, response.data, async (err: unknown) => { + const data = await response.text() + + fs.writeFile(fileName, data, async (err: unknown) => { if (err) { if (opts.debug) { - logError('Error writing file to disk') + logError( + '@flatfile/plugin-pdf-extractor', + 'Error writing file to disk' + ) } return @@ -73,33 +82,30 @@ export const run = async ( reader.close() } catch (uploadError: unknown) { if (opts.debug) { - logError('Failed to upload PDF->CSV file') + logError( + '@flatfile/plugin-pdf-extractor', + 'Failed to upload PDF->CSV file' + ) } - logError(JSON.stringify(uploadError, null, 2)) + logError( + '@flatfile/plugin-pdf-extractor', + JSON.stringify(uploadError, null, 2) + ) } }) } catch (convertError: unknown) { - logError(JSON.stringify(convertError, null, 2)) + logError( + '@flatfile/plugin-pdf-extractor', + JSON.stringify(convertError, null, 2) + ) } if (opts.debug) { - logInfo('Done') + logInfo('@flatfile/plugin-pdf-extractor', 'Done') } } const currentEpoch = (): string => { return `${Math.floor(Date.now() / 1000)}` } - -const logError = (msg: string): void => { - console.error('[@flatfile/plugin-pdf-extractor]:[FATAL] ' + msg) -} - -const logInfo = (msg: string): void => { - console.log('[@flatfile/plugin-pdf-extractor]:[INFO] ' + msg) -} - -const logWarn = (msg: string): void => { - console.warn('[@flatfile/plugin-pdf-extractor]:[WARN] ' + msg) -} diff --git a/plugins/webhook-event-forwarder/package.json b/plugins/webhook-event-forwarder/package.json index 4560a315d..d5b3244d6 100644 --- a/plugins/webhook-event-forwarder/package.json +++ b/plugins/webhook-event-forwarder/package.json @@ -29,7 +29,7 @@ "build": "rollup -c", "dev": "rollup -c --watch", "check": "tsc ./**/*.ts --noEmit --esModuleInterop", - "test": "jest ./**/*.spec.ts --config=../../jest.config.js --runInBand" + "test": "TZ=UTC jest ./**/*.spec.ts --config=../../jest.config.js --runInBand" }, "keywords": [], "author": "Morgan Daley", @@ -45,7 +45,7 @@ "homepage": "https://github.com/FlatFilers/flatfile-plugins#readme", "dependencies": { "@flatfile/api": "^1.7.4", - "node-fetch": "^3.3.2" + "cross-fetch": "^4.0.0" }, "peerDependencies": { "@flatfile/listener": "^1.0.1" diff --git a/utils/fetch-schema/package.json b/utils/fetch-schema/package.json index f4a7c99d4..e3de48ed9 100644 --- a/utils/fetch-schema/package.json +++ b/utils/fetch-schema/package.json @@ -28,7 +28,6 @@ "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", - "@flatfile/listener": "^1.0.1", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" } } diff --git a/utils/fetch-schema/src/index.ts b/utils/fetch-schema/src/index.ts index 3dbba99f3..006ffdad4 100644 --- a/utils/fetch-schema/src/index.ts +++ b/utils/fetch-schema/src/index.ts @@ -1,6 +1,5 @@ -import axios from 'axios' - -import { Flatfile } from '@flatfile/api' +import type { Flatfile } from '@flatfile/api' +import fetch from 'cross-fetch' export interface ModelToSheetConfig extends PartialSheetConfig { sourceUrl: string @@ -30,14 +29,19 @@ export async function getSchemas(models?: ModelToSheetConfig[]) { export async function fetchExternalReference(url: string): Promise { try { - const { status, data } = await axios.get(url, { - validateStatus: () => true, - }) - if (status !== 200) - throw new Error(`API returned status ${status}: ${data.statusText}`) + const response = await fetch(url) + if (!response.ok) { + throw new Error( + `API returned status ${response.status}: ${response.statusText}` + ) + } + + const data = await response.json() return data - } catch (error: any) { - throw new Error(`Error fetching external reference: ${error.message}`) + } catch (error) { + throw new Error( + `Error fetching external reference: ${(error as any).message}` + ) } } diff --git a/utils/testing/package.json b/utils/testing/package.json index 1c510e4dc..ba2635c7a 100644 --- a/utils/testing/package.json +++ b/utils/testing/package.json @@ -27,6 +27,6 @@ "@flatfile/listener": "^1.0.1", "@flatfile/listener-driver-pubsub": "^2.0.0", "@jest/globals": "^29.6.4", - "axios": "^1.6.5" + "cross-fetch": "^4.0.0" } -} \ No newline at end of file +} diff --git a/utils/testing/src/test.helpers.ts b/utils/testing/src/test.helpers.ts index 15f3655b0..767dca3e3 100644 --- a/utils/testing/src/test.helpers.ts +++ b/utils/testing/src/test.helpers.ts @@ -1,7 +1,7 @@ import api, { Flatfile } from '@flatfile/api' import { PubSubDriver } from '@flatfile/listener-driver-pubsub' import { afterAll, afterEach, beforeAll, beforeEach } from '@jest/globals' -import axios from 'axios' +import fetch from 'cross-fetch' import { TestListener } from './test.listener' /** @@ -126,23 +126,30 @@ export async function createRecords( sheetId: string, records: Array> ) { - await axios.post( - `${process.env.AGENT_INTERNAL_URL}/v1/sheets/${sheetId}/records`, - - records.map((r) => - Object.keys(r).reduce((acc: Record, k) => { - acc[k] = { value: r[k] } - return acc - }, {}) - ), - - { - headers: { - Authorization: `Bearer ${process.env.FLATFILE_API_KEY}`, - 'X-Force-Hooks': 'true', - }, - } + const url = `${process.env.AGENT_INTERNAL_URL}/v1/sheets/${sheetId}/records` + const modifiedRecords = records.map((r) => + Object.keys(r).reduce((acc: Record, k) => { + acc[k] = { value: r[k] } + return acc + }, {}) ) + + const response = await fetch(url, { + method: 'POST', + body: JSON.stringify(modifiedRecords), + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${process.env.FLATFILE_API_KEY}`, + 'X-Force-Hooks': 'true', + }, + }) + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } else { + const data = await response.json() + return data + } } export async function getFiles(spaceId: string): Promise { From 773a3cdc21b5103eaa2769b2bbc300d2d15011a8 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 11:34:07 -0500 Subject: [PATCH 04/16] move test --- plugins/export-workbook/package.json | 2 +- plugins/export-workbook/src/plugin.spec.ts | 5 ----- .../{tests => src}/forward-webhook.e2e.spec.ts | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 plugins/export-workbook/src/plugin.spec.ts rename plugins/webhook-event-forwarder/{tests => src}/forward-webhook.e2e.spec.ts (97%) diff --git a/plugins/export-workbook/package.json b/plugins/export-workbook/package.json index 292666579..4dd0d0367 100644 --- a/plugins/export-workbook/package.json +++ b/plugins/export-workbook/package.json @@ -16,7 +16,7 @@ "build": "parcel build", "dev": "parcel watch", "check": "tsc ./**/*.ts --noEmit --esModuleInterop", - "test": "jest ./**/*.spec.ts --config=../../jest.config.js --runInBand" + "test": "jest --passWithNoTests" }, "keywords": [], "author": "Flatfile, Inc.", diff --git a/plugins/export-workbook/src/plugin.spec.ts b/plugins/export-workbook/src/plugin.spec.ts deleted file mode 100644 index d2ebbdcd6..000000000 --- a/plugins/export-workbook/src/plugin.spec.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('exportWorkbook', () => { - it('empty test', () => { - expect(true).toBe(true) - }) -}) diff --git a/plugins/webhook-event-forwarder/tests/forward-webhook.e2e.spec.ts b/plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts similarity index 97% rename from plugins/webhook-event-forwarder/tests/forward-webhook.e2e.spec.ts rename to plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts index 750781c1b..9ccf367f7 100644 --- a/plugins/webhook-event-forwarder/tests/forward-webhook.e2e.spec.ts +++ b/plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts @@ -1,4 +1,4 @@ -import { FlatfileEvent } from '@flatfile/listener' +import type { FlatfileEvent } from '@flatfile/listener' import { createRecords, deleteSpace, From d41a7aa82ef60b46b6c58772b8c5b3c63680583f Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 11:36:24 -0500 Subject: [PATCH 05/16] refactor jest config --- jest.config.js | 22 ++++++++----------- plugins/webhook-event-forwarder/package.json | 2 +- .../src/forward-webhook.e2e.spec.ts | 2 +- test/betterConsoleLog.js | 2 ++ .../setup-tests.js => test/dotenv-config.js | 3 --- {testing => test}/setup-global.js | 0 test/unit.cleanup.js | 11 ++++++++++ 7 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 test/betterConsoleLog.js rename testing/setup-tests.js => test/dotenv-config.js (70%) rename {testing => test}/setup-global.js (100%) create mode 100644 test/unit.cleanup.js diff --git a/jest.config.js b/jest.config.js index 7c7a6ca35..859a89467 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,19 +1,15 @@ -const path = require('path') - module.exports = { - verbose: true, + testEnvironment: 'node', + testRegex: '.*\\.(e2e-)?spec\\.ts$', transform: { '^.+\\.tsx?$': 'ts-jest', }, - setupFiles: [path.join(__dirname, './testing/setup-tests.js')], - coverageThreshold: { - global: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, + setupFiles: ['/test/dotenv-config.js'], + setupFilesAfterEnv: [ + '/test/betterConsoleLog.js', + '/test/unit.cleanup.js', + ], testTimeout: 30_000, - globalSetup: './testing/setup-global.js', + globalSetup: '/test/setup-global.js', + forceExit: true, } diff --git a/plugins/webhook-event-forwarder/package.json b/plugins/webhook-event-forwarder/package.json index d5b3244d6..d91fe8515 100644 --- a/plugins/webhook-event-forwarder/package.json +++ b/plugins/webhook-event-forwarder/package.json @@ -29,7 +29,7 @@ "build": "rollup -c", "dev": "rollup -c --watch", "check": "tsc ./**/*.ts --noEmit --esModuleInterop", - "test": "TZ=UTC jest ./**/*.spec.ts --config=../../jest.config.js --runInBand" + "test": "jest ./**/*.spec.ts --config=../../jest.config.js --runInBand" }, "keywords": [], "author": "Morgan Daley", diff --git a/plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts b/plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts index 9ccf367f7..f73eb763a 100644 --- a/plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts +++ b/plugins/webhook-event-forwarder/src/forward-webhook.e2e.spec.ts @@ -7,7 +7,7 @@ import { setupSpace, } from '@flatfile/utils-testing' import fetchMock from 'jest-fetch-mock' -import { webhookEventForward } from '../src' +import { webhookEventForward } from '.' fetchMock.enableMocks() fetchMock.dontMock() diff --git a/test/betterConsoleLog.js b/test/betterConsoleLog.js new file mode 100644 index 000000000..39c00db08 --- /dev/null +++ b/test/betterConsoleLog.js @@ -0,0 +1,2 @@ +console.log = (...msgs) => + msgs.forEach((msg) => process.stdout.write(msg + '\n')) diff --git a/testing/setup-tests.js b/test/dotenv-config.js similarity index 70% rename from testing/setup-tests.js rename to test/dotenv-config.js index 99a0faddd..1d04057f5 100644 --- a/testing/setup-tests.js +++ b/test/dotenv-config.js @@ -8,6 +8,3 @@ const env = dotenv.config({ }) dotenvExpand.expand(env) - -console.log = (...msgs) => - msgs.forEach((msg) => process.stdout.write(msg + '\n')) diff --git a/testing/setup-global.js b/test/setup-global.js similarity index 100% rename from testing/setup-global.js rename to test/setup-global.js diff --git a/test/unit.cleanup.js b/test/unit.cleanup.js new file mode 100644 index 000000000..a7e25df38 --- /dev/null +++ b/test/unit.cleanup.js @@ -0,0 +1,11 @@ +const getHeapSpaceStatistics = require('v8') + +afterAll(() => { + // cleanup mocks and modules and allow the GC to do its thing: + jest.resetModules() + jest.clearAllMocks() + jest.clearAllTimers() + if (process.env['PRINT_V8_STATS'] === 'true') { + console.log(`${JSON.stringify(getHeapSpaceStatistics(), null, 4)}`) + } +}) From aeb3e2c9d51b40389011d997b56a8d677cca5d0e Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 11:36:36 -0500 Subject: [PATCH 06/16] Update package-lock.json --- package-lock.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/package-lock.json b/package-lock.json index 43aa1e7ed..c6cd31de6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14309,6 +14309,24 @@ "version": "0.0.2", "license": "ISC" }, + "plugins/graphql-schema": { + "name": "@flatfile/plugin-graphql-schema", + "version": "0.0.0", + "extraneous": true, + "license": "ISC", + "dependencies": { + "@flatfile/plugin-space-configure": "^0.3.3", + "change-case": "^5.4.3", + "cross-fetch": "^4.0.0", + "graphql": "^16.8.1" + }, + "devDependencies": { + "@flatfile/api": "^1.7.1" + }, + "peerDependencies": { + "@flatfile/listener": "^1.0.1" + } + }, "plugins/job-handler": { "name": "@flatfile/plugin-job-handler", "version": "0.4.1", @@ -14378,6 +14396,17 @@ "@flatfile/listener": "^1.0.1" } }, + "plugins/merge-connection/node_modules/@mergeapi/merge-node-client/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "extraneous": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, "plugins/openapi-schema": { "name": "@flatfile/plugin-convert-openapi-schema", "version": "0.1.2", From 24bc15f810c922b3c6fa4ef45d9be89fb3c6c0d7 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 29 Mar 2024 15:59:00 -0500 Subject: [PATCH 07/16] update node engine to >16 The @flatfile/api@1.7.10 dep uses a NodeJS feature introduced in NodeJS >16 --- plugins/constraints/package.json | 3 +++ plugins/dxp-configure/package.json | 2 +- plugins/record-hook/package.json | 2 +- plugins/xlsx-extractor/package.json | 2 +- support/common-utils/package.json | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/constraints/package.json b/plugins/constraints/package.json index 67111147d..67a568d4a 100644 --- a/plugins/constraints/package.json +++ b/plugins/constraints/package.json @@ -2,6 +2,9 @@ "name": "@flatfile/plugin-constraints", "version": "1.1.7", "description": "A plugin for extending blueprint with external constraints", + "engines": { + "node": ">= 16" + }, "registryMetadata": { "category": "records" }, diff --git a/plugins/dxp-configure/package.json b/plugins/dxp-configure/package.json index c5ce693e4..0e6a33acb 100644 --- a/plugins/dxp-configure/package.json +++ b/plugins/dxp-configure/package.json @@ -6,7 +6,7 @@ "category": "utilities" }, "engines": { - "node": ">= 12" + "node": ">= 16" }, "browserslist": [ "> 0.5%", diff --git a/plugins/record-hook/package.json b/plugins/record-hook/package.json index 0404f78dc..610555ea5 100644 --- a/plugins/record-hook/package.json +++ b/plugins/record-hook/package.json @@ -6,7 +6,7 @@ "category": "records" }, "engines": { - "node": ">= 12" + "node": ">= 16" }, "browserslist": [ "> 0.5%", diff --git a/plugins/xlsx-extractor/package.json b/plugins/xlsx-extractor/package.json index 35c504d83..2969aebf6 100644 --- a/plugins/xlsx-extractor/package.json +++ b/plugins/xlsx-extractor/package.json @@ -6,7 +6,7 @@ "category": "extractors" }, "engines": { - "node": ">= 12" + "node": ">= 16" }, "source": "src/index.ts", "main": "dist/main.js", diff --git a/support/common-utils/package.json b/support/common-utils/package.json index cb4fccf0b..9aee522fd 100644 --- a/support/common-utils/package.json +++ b/support/common-utils/package.json @@ -5,7 +5,7 @@ "keywords": [], "author": "Flatfile", "engines": { - "node": ">= 12" + "node": ">= 16" }, "browserslist": [ "> 0.5%", From ec5bf460d12d85eb17ecbef3e3c238239d9abe31 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Mon, 1 Apr 2024 10:39:42 -0500 Subject: [PATCH 08/16] refactor yaml-schema plugin --- package-lock.json | 18 +-- ...ory.json.spec.ts => setup.factory.spec.ts} | 0 plugins/yaml-schema/package.json | 7 +- plugins/yaml-schema/src/index.ts | 64 +---------- .../exampleData.yml => src/mock/schema.yml} | 0 plugins/yaml-schema/src/setup.factory.spec.ts | 78 +++++++++++++ plugins/yaml-schema/src/setup.factory.ts | 87 +++++++++++++++ .../yaml-schema/tests/yaml-schema.e2e.spec.ts | 104 ------------------ utils/testing/src/index.ts | 1 - utils/testing/src/server.ts | 13 --- 10 files changed, 186 insertions(+), 186 deletions(-) rename plugins/json-schema/src/{setup.factory.json.spec.ts => setup.factory.spec.ts} (100%) rename plugins/yaml-schema/{tests/exampleData.yml => src/mock/schema.yml} (100%) create mode 100644 plugins/yaml-schema/src/setup.factory.spec.ts create mode 100644 plugins/yaml-schema/src/setup.factory.ts delete mode 100644 plugins/yaml-schema/tests/yaml-schema.e2e.spec.ts delete mode 100644 utils/testing/src/server.ts diff --git a/package-lock.json b/package-lock.json index c6cd31de6..0cdebe21a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14208,6 +14208,9 @@ "rollup-plugin-dts": "^6.1.0", "ts-jest": "^29.1.2" }, + "engines": { + "node": ">= 16" + }, "peerDependencies": { "@flatfile/listener": "^1.0.1" } @@ -14265,7 +14268,7 @@ "rollup": "^4.3.0" }, "engines": { - "node": ">= 12" + "node": ">= 16" }, "peerDependencies": { "@flatfile/listener": "^1.0.1" @@ -14507,7 +14510,7 @@ "@flatfile/hooks": "^1.3.1" }, "engines": { - "node": ">= 12" + "node": ">= 16" }, "peerDependencies": { "@flatfile/api": "^1.7.4", @@ -14613,7 +14616,7 @@ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz" }, "engines": { - "node": ">= 12" + "node": ">= 16" }, "peerDependencies": { "@flatfile/listener": "^1.0.1" @@ -14643,12 +14646,13 @@ "@flatfile/api": "^1.7.4", "@flatfile/plugin-convert-json-schema": "^0.2.2", "@flatfile/plugin-space-configure": "^0.3.2", - "@flatfile/util-fetch-schema": "^0.1.2", - "@flatfile/utils-testing": "^0.1.3", + "cross-fetch": "^4.0.0", "js-yaml": "^4.1.0" }, "devDependencies": { - "express": "^4.18.2" + "@flatfile/utils-testing": "^0.1.3", + "express": "^4.18.2", + "jest-fetch-mock": "^3.0.3" }, "engines": { "node": ">= 16" @@ -14697,7 +14701,7 @@ "version": "1.0.1", "license": "ISC", "engines": { - "node": ">= 12" + "node": ">= 16" } }, "utils/common": { diff --git a/plugins/json-schema/src/setup.factory.json.spec.ts b/plugins/json-schema/src/setup.factory.spec.ts similarity index 100% rename from plugins/json-schema/src/setup.factory.json.spec.ts rename to plugins/json-schema/src/setup.factory.spec.ts diff --git a/plugins/yaml-schema/package.json b/plugins/yaml-schema/package.json index 738f519c2..093c66fa5 100644 --- a/plugins/yaml-schema/package.json +++ b/plugins/yaml-schema/package.json @@ -30,14 +30,15 @@ "@flatfile/api": "^1.7.4", "@flatfile/plugin-convert-json-schema": "^0.2.2", "@flatfile/plugin-space-configure": "^0.3.2", - "@flatfile/util-fetch-schema": "^0.1.2", - "@flatfile/utils-testing": "^0.1.3", + "cross-fetch": "^4.0.0", "js-yaml": "^4.1.0" }, "peerDependencies": { "@flatfile/listener": "^1.0.1" }, "devDependencies": { - "express": "^4.18.2" + "@flatfile/utils-testing": "^0.1.3", + "express": "^4.18.2", + "jest-fetch-mock": "^3.0.3" } } diff --git a/plugins/yaml-schema/src/index.ts b/plugins/yaml-schema/src/index.ts index 36a4bf3cf..89049dc18 100644 --- a/plugins/yaml-schema/src/index.ts +++ b/plugins/yaml-schema/src/index.ts @@ -1,52 +1,8 @@ import type { Flatfile } from '@flatfile/api' import type { FlatfileEvent, FlatfileListener } from '@flatfile/listener' -import { generateFields } from '@flatfile/plugin-convert-json-schema' -import { - Setup, - SetupFactory, - configureSpace, -} from '@flatfile/plugin-space-configure' -import type { - ModelToSheetConfig, - PartialWorkbookConfig, -} from '@flatfile/util-fetch-schema' -import { getSchemas } from '@flatfile/util-fetch-schema/src' -import jsYaml from 'js-yaml' - -export async function generateSetup( - models?: ModelToSheetConfig[], - schemas?: any[], - options?: { - workbookConfig?: PartialWorkbookConfig - debug?: boolean - } -): Promise { - const sheets = await Promise.all( - models.map(async (model: ModelToSheetConfig, i) => { - const data = schemas[i] - const fields = await generateFields(data) - return { - name: model?.name || data.title, - ...(data?.description && { description: data.description }), - fields, - ...model, - } - }) - ) - const setup: Setup = { - workbooks: [ - { - name: options?.workbookConfig?.name || 'YAML Schema Workbook', - sheets, - }, - ], - ...options?.workbookConfig, - } - if (options?.debug) { - console.dir(setup, { depth: null }) - } - return setup -} +import { configureSpace } from '@flatfile/plugin-space-configure' +import type { ModelToSheetConfig, PartialWorkbookConfig } from './setup.factory' +import { generateSetup } from './setup.factory' export function configureSpaceWithYamlSchema( models?: ModelToSheetConfig[], @@ -61,16 +17,8 @@ export function configureSpaceWithYamlSchema( ) => any | Promise ) { return async function (listener: FlatfileListener) { - const schemas = await getSchemas(models) - listener.use( - configureSpace( - await generateSetup( - models, - schemas.map((schema) => jsYaml.load(schema)), - options - ), - callback - ) - ) + listener.use(configureSpace(await generateSetup(models, options), callback)) } } + +export * from './setup.factory' diff --git a/plugins/yaml-schema/tests/exampleData.yml b/plugins/yaml-schema/src/mock/schema.yml similarity index 100% rename from plugins/yaml-schema/tests/exampleData.yml rename to plugins/yaml-schema/src/mock/schema.yml diff --git a/plugins/yaml-schema/src/setup.factory.spec.ts b/plugins/yaml-schema/src/setup.factory.spec.ts new file mode 100644 index 000000000..f0d836962 --- /dev/null +++ b/plugins/yaml-schema/src/setup.factory.spec.ts @@ -0,0 +1,78 @@ +import fs from 'fs' +import fetchMock from 'jest-fetch-mock' +import path from 'path' +import { generateSetup } from '.' + +fetchMock.enableMocks() +fetchMock.dontMock() + +describe('configureSpaceWithYamlSchema() e2e', () => { + const expectedResult = { + workbooks: [ + { + name: 'YAML Schema Workbook', + sheets: [ + { + name: 'ExampleData', + description: + 'A basic set of YAML Schema to test data type conversions simply', + fields: [ + { + label: 'stringColumn', + description: 'A column for strings!', + key: 'stringColumn', + type: 'string', + }, + { + label: 'integerColumn', + description: 'A column for integers!', + key: 'integerColumn', + type: 'number', + }, + { + label: 'arrayColumn', + description: 'An enum of Selected Values', + key: 'arrayColumn', + type: 'enum', + config: { options: [] }, + }, + { + label: 'objectColumn_nestedUniqueNumberColumn', + description: 'A column for unique numbers!', + key: 'objectColumn_nestedUniqueNumberColumn', + type: 'number', + }, + { + label: 'objectColumn_nestedStringColumn', + key: 'objectColumn_nestedStringColumn', + type: 'string', + }, + ], + }, + ], + }, + ], + } + + beforeEach(() => { + fetchMock.resetMocks() + }) + + it('should generate a SetupFactory from YAML Schema', async () => { + const schema = fs.readFileSync( + path.resolve(__dirname, 'mock/schema.yml'), + 'utf-8' + ) + fetchMock.doMockIf('http://example.com/schema.yaml', schema, { + status: 200, + }) + + const results = await generateSetup([ + { + sourceUrl: 'http://example.com/schema.yaml', + }, + ]) + + expect(results).toMatchObject(expectedResult) + }) +}) diff --git a/plugins/yaml-schema/src/setup.factory.ts b/plugins/yaml-schema/src/setup.factory.ts new file mode 100644 index 000000000..f5e50b8f6 --- /dev/null +++ b/plugins/yaml-schema/src/setup.factory.ts @@ -0,0 +1,87 @@ +import type { Flatfile } from '@flatfile/api' +import { generateFields } from '@flatfile/plugin-convert-json-schema' +import { Setup, SetupFactory } from '@flatfile/plugin-space-configure' + +import jsYaml from 'js-yaml' + +export interface ModelToSheetConfig extends PartialSheetConfig { + sourceUrl: string +} + +export type PartialSheetConfig = Omit< + Flatfile.SheetConfig, + 'fields' | 'name' +> & { + name?: string +} + +export type PartialWorkbookConfig = Omit< + Flatfile.CreateWorkbookConfig, + 'sheets' | 'name' +> & { + name?: string +} + +export async function generateSetup( + models?: ModelToSheetConfig[], + options?: { + workbookConfig?: PartialWorkbookConfig + debug?: boolean + } +): Promise { + const schemas = await getSchemas(models) + const asdf = schemas.map((schema) => jsYaml.load(schema)) + + const sheets = await Promise.all( + models.map(async (model: ModelToSheetConfig, i) => { + const data = asdf[i] + const fields = await generateFields(data) + delete model.sourceUrl + return { + name: model?.name || data.title, + ...(data?.description && { description: data.description }), + fields, + ...model, + } + }) + ) + const setup: Setup = { + workbooks: [ + { + name: options?.workbookConfig?.name || 'YAML Schema Workbook', + sheets, + }, + ], + ...options?.workbookConfig, + } + if (options?.debug) { + console.dir(setup, { depth: null }) + } + return setup +} + +async function getSchemas(models?: ModelToSheetConfig[]) { + const schemas = models.map(async (model: ModelToSheetConfig) => { + return await fetchExternalReference(model.sourceUrl) + }) + + return await Promise.all(schemas) +} + +async function fetchExternalReference(url: string): Promise { + try { + const response = await fetch(url) + if (!response.ok) { + throw new Error( + `API returned status ${response.status}: ${response.statusText}` + ) + } + + const data = await response.text() + return data + } catch (error) { + throw new Error( + `Error fetching external reference: ${(error as any).message}` + ) + } +} diff --git a/plugins/yaml-schema/tests/yaml-schema.e2e.spec.ts b/plugins/yaml-schema/tests/yaml-schema.e2e.spec.ts deleted file mode 100644 index a02464830..000000000 --- a/plugins/yaml-schema/tests/yaml-schema.e2e.spec.ts +++ /dev/null @@ -1,104 +0,0 @@ -import api from '@flatfile/api' -import { - deleteSpace, - setupListener, - setupSpace, - startServer, - stopServer, -} from '@flatfile/utils-testing' -import express from 'express' -import fs from 'fs' -import path from 'path' -import { configureSpaceWithYamlSchema } from '../src' - -const app = express() -const port = 8080 -const url = `http://localhost:${port}/` - -let server -describe('configureSpaceWithYamlSchema() e2e', () => { - const pureDataSchema = fs.readFileSync( - path.resolve(__dirname, './exampleData.yml'), - 'utf-8' - ) - - const expectedWorkbookData = { - name: 'YAML Schema Workbook', - labels: [], - sheets: [ - { - name: 'ExampleData', - config: { - name: 'ExampleData', - description: - 'A basic set of YAML Schema to test data type conversions simply', - fields: [ - { - type: 'string', - key: 'stringColumn', - label: 'stringColumn', - description: 'A column for strings!', - }, - { - type: 'number', - key: 'integerColumn', - label: 'integerColumn', - description: 'A column for integers!', - }, - { - type: 'enum', - config: { options: [] }, - key: 'arrayColumn', - label: 'arrayColumn', - description: 'An enum of Selected Values', - }, - { - type: 'number', - key: 'objectColumn_nestedUniqueNumberColumn', - label: 'objectColumn_nestedUniqueNumberColumn', - description: 'A column for unique numbers!', - }, - { - type: 'string', - key: 'objectColumn_nestedStringColumn', - label: 'objectColumn_nestedStringColumn', - }, - ], - }, - }, - ], - } - - let spaceId: string - const listener = setupListener() - - beforeAll(async () => { - console.log(`Starting temporary server on port ${port}`) - server = startServer(app, port, pureDataSchema) - console.log('Setting up Space and Retrieving spaceId') - - await listener.use(configureSpaceWithYamlSchema([{ sourceUrl: url }])) - - const space = await setupSpace() - spaceId = space.id - }) - - afterAll(async () => { - stopServer(server) - console.log(`Stopping temporary server on port ${port}`) - await deleteSpace(spaceId) - }) - - it('should configure a space and correctly format and flatten the YAML Schema', async () => { - await listener.waitFor('job:ready', 1, 'space:configure') - - const space = await api.spaces.get(spaceId) - const workspace = await api.workbooks.get(space.data.primaryWorkbookId) - const workspaceData = workspace.data - - expect(workspaceData.name).toBe(expectedWorkbookData.name) - expect(workspaceData.sheets[0].config).toMatchObject( - expectedWorkbookData.sheets[0].config - ) - }) -}) diff --git a/utils/testing/src/index.ts b/utils/testing/src/index.ts index 880f9f897..cea843ffa 100644 --- a/utils/testing/src/index.ts +++ b/utils/testing/src/index.ts @@ -1,3 +1,2 @@ -export { startServer, stopServer } from './server' export * from './test.helpers' export * from './test.listener' diff --git a/utils/testing/src/server.ts b/utils/testing/src/server.ts deleted file mode 100644 index 74fe85025..000000000 --- a/utils/testing/src/server.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const startServer = (app, port, data) => { - app.get('/', (req, res) => { - res.send(data) - }) - - return app.listen(port, () => { - console.log(`Example app listening on port ${port}`) - }) -} - -export const stopServer = (app) => { - app.close() -} From 69763d61bada315622df5890dc86765d19db7ec7 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Mon, 1 Apr 2024 15:02:50 -0500 Subject: [PATCH 09/16] Rollup plugin swap: typescript -> sucrase --- package-lock.json | 143 ++++++++++++-------------- package.json | 2 +- plugins/constraints/package.json | 11 -- plugins/dxp-configure/package.json | 7 +- plugins/json-extractor/package.json | 7 -- plugins/openapi-schema/package.json | 7 -- plugins/record-hook/rollup.config.mjs | 4 +- rollup.config.mjs | 15 ++- 8 files changed, 77 insertions(+), 119 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0cdebe21a..d70ff5f2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,8 +23,8 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-sucrase": "^5.0.2", "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "^11.1.6", "@types/jest": "^29.5.0", "@types/node": "^20.2.5", "dotenv": "^16.3.1", @@ -71,8 +71,9 @@ }, "node_modules/@apidevtools/json-schema-ref-parser": { "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", "dev": true, - "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.6", @@ -82,13 +83,15 @@ }, "node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": { "version": "2.0.1", - "dev": true, - "license": "Python-2.0" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -1117,6 +1120,8 @@ }, "node_modules/@flatfile/blueprint": { "version": "0.0.9", + "resolved": "https://registry.npmjs.org/@flatfile/blueprint/-/blueprint-0.0.9.tgz", + "integrity": "sha512-MfHea4Gp/0pEBaWU91DsrvVa2FFmFCop2WplA1pU6gD1JI8eDqS8+KyJQks07qRSdicifbdOsmQM6C7t3dSuew==", "dev": true, "dependencies": { "openapi-typescript-codegen": "^0.23.0" @@ -1132,8 +1137,9 @@ }, "node_modules/@flatfile/configure": { "version": "0.5.39", + "resolved": "https://registry.npmjs.org/@flatfile/configure/-/configure-0.5.39.tgz", + "integrity": "sha512-J6y7GbfKKWWdT8FciKbYlfKlfaY838q9Sm0+MURuO0UcuBLpM+HQ0D0kWq4tOeODvuKeWsEV28Zvi+4kT9jZ0Q==", "dev": true, - "license": "ISC", "dependencies": { "@flatfile/hooks": "^1.3.1", "@flatfile/schema": "^0.2.16", @@ -1288,6 +1294,8 @@ }, "node_modules/@flatfile/schema": { "version": "0.2.17", + "resolved": "https://registry.npmjs.org/@flatfile/schema/-/schema-0.2.17.tgz", + "integrity": "sha512-zVafqWP/NFyePnfmCyqMK1ahJgKktG+n5v2CHo74lvLa0viilc9B+lX8BF0KMmRuKGOfsGIi3jbv19p6Pp95WQ==", "dev": true, "dependencies": { "@flatfile/blueprint": "^0.0.9" @@ -2082,8 +2090,9 @@ }, "node_modules/@jsdevtools/ono": { "version": "7.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "dev": true }, "node_modules/@lezer/common": { "version": "1.2.1", @@ -4114,20 +4123,20 @@ } } }, - "node_modules/@rollup/plugin-terser": { - "version": "0.4.4", + "node_modules/@rollup/plugin-sucrase": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-sucrase/-/plugin-sucrase-5.0.2.tgz", + "integrity": "sha512-4MhIVH9Dy2Hwose1/x5QMs0XF7yn9jDd/yozHqzdIrMWIolgFpGnrnVhQkqTaK1RALY/fpyrEKmwH/04vr1THA==", "dev": true, - "license": "MIT", "dependencies": { - "serialize-javascript": "^6.0.1", - "smob": "^1.0.0", - "terser": "^5.17.4" + "@rollup/pluginutils": "^5.0.1", + "sucrase": "^3.27.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.0.0||^3.0.0||^4.0.0" + "rollup": "^2.53.1||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -4135,28 +4144,24 @@ } } }, - "node_modules/@rollup/plugin-typescript": { - "version": "11.1.6", + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", "dev": true, "license": "MIT", "dependencies": { - "@rollup/pluginutils": "^5.1.0", - "resolve": "^1.22.1" + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.14.0||^3.0.0||^4.0.0", - "tslib": "*", - "typescript": ">=3.7.0" + "rollup": "^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true - }, - "tslib": { - "optional": true } } }, @@ -4557,8 +4562,9 @@ }, "node_modules/@types/json-schema": { "version": "7.0.15", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true }, "node_modules/@types/jsonfile": { "version": "6.1.4", @@ -5346,8 +5352,9 @@ }, "node_modules/call-me-maybe": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true }, "node_modules/callsites": { "version": "3.1.0", @@ -5400,8 +5407,9 @@ }, "node_modules/case-anything": { "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.13" }, @@ -5955,8 +5963,9 @@ }, "node_modules/date-fns": { "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.21.0" }, @@ -7377,8 +7386,9 @@ }, "node_modules/handlebars": { "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -9846,8 +9856,10 @@ }, "node_modules/json-schema-ref-parser": { "version": "9.0.9", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", + "deprecated": "Please switch to @apidevtools/json-schema-ref-parser", "dev": true, - "license": "MIT", "dependencies": { "@apidevtools/json-schema-ref-parser": "9.0.9" }, @@ -10573,8 +10585,9 @@ }, "node_modules/neo-async": { "version": "2.6.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true }, "node_modules/netmask": { "version": "2.0.2", @@ -10783,8 +10796,9 @@ }, "node_modules/openapi-typescript-codegen": { "version": "0.23.0", + "resolved": "https://registry.npmjs.org/openapi-typescript-codegen/-/openapi-typescript-codegen-0.23.0.tgz", + "integrity": "sha512-gOJXy5g3H3HlLpVNN+USrNK2i2KYBmDczk9Xk34u6JorwrGiDJZUj+al4S+i9TXdfUQ/ZaLxE59Xf3wqkxGfqA==", "dev": true, - "license": "MIT", "dependencies": { "camelcase": "^6.3.0", "commander": "^9.3.0", @@ -10798,8 +10812,9 @@ }, "node_modules/openapi-typescript-codegen/node_modules/camelcase": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -10809,16 +10824,18 @@ }, "node_modules/openapi-typescript-codegen/node_modules/commander": { "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || >=14" } }, "node_modules/openapi-typescript-codegen/node_modules/fs-extra": { "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -10830,8 +10847,9 @@ }, "node_modules/openapi-typescript-codegen/node_modules/jsonfile": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -10841,8 +10859,9 @@ }, "node_modules/openapi-typescript-codegen/node_modules/universalify": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -13693,8 +13712,9 @@ }, "node_modules/uglify-js": { "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, - "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -13943,8 +13963,9 @@ }, "node_modules/wordwrap": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true }, "node_modules/wrap-ansi": { "version": "7.0.0", @@ -14197,17 +14218,6 @@ "@flatfile/api": "^1.7.4", "@flatfile/plugin-record-hook": "^1.4.6" }, - "devDependencies": { - "@flatfile/utils-testing": "^0.1.3", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0", - "rollup-plugin-dts": "^6.1.0", - "ts-jest": "^29.1.2" - }, "engines": { "node": ">= 16" }, @@ -14260,12 +14270,7 @@ "@flatfile/api": "^1.7.4" }, "devDependencies": { - "@flatfile/configure": "^0.5.39", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0" + "@flatfile/configure": "^0.5.39" }, "engines": { "node": ">= 16" @@ -14355,13 +14360,6 @@ "dependencies": { "@flatfile/util-extractor": "^0.5.2" }, - "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0" - }, "engines": { "node": ">= 16" } @@ -14419,13 +14417,6 @@ "@flatfile/plugin-space-configure": "^0.3.2", "cross-fetch": "^4.0.0" }, - "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0" - }, "engines": { "node": ">= 16" }, @@ -14706,7 +14697,7 @@ }, "utils/common": { "name": "@flatfile/util-common", - "version": "1.0.3", + "version": "1.1.0", "license": "ISC", "dependencies": { "@flatfile/api": "^1.7.4", diff --git a/package.json b/package.json index c251e74c4..ca839b4c8 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-sucrase": "^5.0.2", "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "^11.1.6", "@types/jest": "^29.5.0", "@types/node": "^20.2.5", "dotenv": "^16.3.1", diff --git a/plugins/constraints/package.json b/plugins/constraints/package.json index 67a568d4a..d84380e37 100644 --- a/plugins/constraints/package.json +++ b/plugins/constraints/package.json @@ -46,16 +46,5 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" - }, - "devDependencies": { - "@flatfile/utils-testing": "^0.1.3", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0", - "rollup-plugin-dts": "^6.1.0", - "ts-jest": "^29.1.2" } } diff --git a/plugins/dxp-configure/package.json b/plugins/dxp-configure/package.json index 0e6a33acb..566ebd656 100644 --- a/plugins/dxp-configure/package.json +++ b/plugins/dxp-configure/package.json @@ -51,11 +51,6 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { - "@flatfile/configure": "^0.5.39", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0" + "@flatfile/configure": "^0.5.39" } } diff --git a/plugins/json-extractor/package.json b/plugins/json-extractor/package.json index 656073287..7815f62f4 100644 --- a/plugins/json-extractor/package.json +++ b/plugins/json-extractor/package.json @@ -42,12 +42,5 @@ "license": "ISC", "dependencies": { "@flatfile/util-extractor": "^0.5.2" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0" } } diff --git a/plugins/openapi-schema/package.json b/plugins/openapi-schema/package.json index 373f7a6b5..1f71f9346 100644 --- a/plugins/openapi-schema/package.json +++ b/plugins/openapi-schema/package.json @@ -46,12 +46,5 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.5", - "rollup": "^4.3.0" } } diff --git a/plugins/record-hook/rollup.config.mjs b/plugins/record-hook/rollup.config.mjs index d5dcf8d0c..7be76c487 100644 --- a/plugins/record-hook/rollup.config.mjs +++ b/plugins/record-hook/rollup.config.mjs @@ -1,6 +1,6 @@ import { buildConfig } from '../../rollup.config.mjs' -const internal = [ +const umdExternals = [ '@flatfile/api', '@flatfile/hooks', '@flatfile/listener', @@ -9,7 +9,7 @@ const internal = [ const config = buildConfig({ includeUmd: true, - umdConfig: { name: 'PluginRecordHook', internal }, + umdConfig: { name: 'PluginRecordHook', external: umdExternals }, }) export default config diff --git a/rollup.config.mjs b/rollup.config.mjs index 1cc09e8d3..167835c6d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,8 +1,8 @@ import commonjs from '@rollup/plugin-commonjs' import json from '@rollup/plugin-json' import resolve from '@rollup/plugin-node-resolve' +import sucrase from '@rollup/plugin-sucrase' import terser from '@rollup/plugin-terser' -import typescript from '@rollup/plugin-typescript' import { dts } from 'rollup-plugin-dts' import peerDepsExternal from 'rollup-plugin-peer-deps-external' @@ -24,12 +24,9 @@ function commonPlugins(browser, umd = false) { esmExternals: true, }), resolve({ browser, preferBuiltins: !browser }), - typescript({ - tsconfig: '../../tsconfig.json', - declaration: false, - declarationMap: false, - declarationDir: './dist', - exclude: ['**/tests/*', '**/*.spec.ts'], + sucrase({ + exclude: ['node_modules/**'], + transforms: ['typescript'], }), PROD && terser(), ] @@ -39,7 +36,7 @@ export function buildConfig({ external = [], includeBrowser = true, includeUmd = false, - umdConfig = { name: undefined, internal: [] }, + umdConfig = { name: undefined, external: [] }, }) { return [ // Node.js build @@ -103,7 +100,7 @@ export function buildConfig({ }, ], plugins: commonPlugins(true, true), - internal: umdConfig.internal, + external: umdConfig.external, }, ] : []), From bbcdde0014a993d9b9af9861942620ac6fb368df Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Tue, 2 Apr 2024 10:48:57 -0500 Subject: [PATCH 10/16] `interface extends` is slightly faster than `&` https://github.com/microsoft/TypeScript/wiki/Performance#preferring-interfaces-over-intersections --- plugins/json-schema/src/setup.factory.ts | 12 ++++-------- plugins/openapi-schema/src/setup.factory.ts | 12 ++++-------- plugins/sql-ddl-converter/src/setup.factory.ts | 12 ++++-------- plugins/yaml-schema/src/setup.factory.ts | 12 ++++-------- utils/fetch-schema/src/index.ts | 12 ++++-------- 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/plugins/json-schema/src/setup.factory.ts b/plugins/json-schema/src/setup.factory.ts index 111a04320..12b7bc72c 100644 --- a/plugins/json-schema/src/setup.factory.ts +++ b/plugins/json-schema/src/setup.factory.ts @@ -7,17 +7,13 @@ export type JsonSetupFactory = { space?: Partial } -export type PartialWorkbookConfig = Omit< - Flatfile.CreateWorkbookConfig, - 'sheets' -> & { +export interface PartialWorkbookConfig + extends Omit { sheets: PartialSheetConfig[] } -export type PartialSheetConfig = Omit< - Flatfile.SheetConfig, - 'fields' | 'name' -> & { +export interface PartialSheetConfig + extends Omit { name?: string source: object | string | (() => object | Promise) } diff --git a/plugins/openapi-schema/src/setup.factory.ts b/plugins/openapi-schema/src/setup.factory.ts index f2b89fd81..b5a5c0d1d 100644 --- a/plugins/openapi-schema/src/setup.factory.ts +++ b/plugins/openapi-schema/src/setup.factory.ts @@ -8,19 +8,15 @@ export type OpenAPISetupFactory = { debug?: boolean } -export type PartialWorkbookConfig = Omit< - Flatfile.CreateWorkbookConfig, - 'name' | 'sheets' -> & { +export interface PartialWorkbookConfig + extends Omit { name?: string sheets: PartialSheetConfig[] source: string } -export type PartialSheetConfig = Omit< - Flatfile.SheetConfig, - 'fields' | 'name' | 'slug' -> & { +export interface PartialSheetConfig + extends Omit { name?: string slug?: string model: string diff --git a/plugins/sql-ddl-converter/src/setup.factory.ts b/plugins/sql-ddl-converter/src/setup.factory.ts index a7050c921..595351ced 100644 --- a/plugins/sql-ddl-converter/src/setup.factory.ts +++ b/plugins/sql-ddl-converter/src/setup.factory.ts @@ -11,18 +11,14 @@ export type SqlSetupFactory = { space?: Partial } -export type PartialWorkbookConfig = Omit< - Flatfile.CreateWorkbookConfig, - 'sheets' -> & { +export interface PartialWorkbookConfig + extends Omit { sheets: PartialSheetConfig[] source: string //object | string | (() => object | Promise) } -export type PartialSheetConfig = Omit< - Flatfile.SheetConfig, - 'fields' | 'slug' -> & { +export interface PartialSheetConfig + extends Omit { slug: string } diff --git a/plugins/yaml-schema/src/setup.factory.ts b/plugins/yaml-schema/src/setup.factory.ts index f5e50b8f6..45a7d952d 100644 --- a/plugins/yaml-schema/src/setup.factory.ts +++ b/plugins/yaml-schema/src/setup.factory.ts @@ -8,17 +8,13 @@ export interface ModelToSheetConfig extends PartialSheetConfig { sourceUrl: string } -export type PartialSheetConfig = Omit< - Flatfile.SheetConfig, - 'fields' | 'name' -> & { +export interface PartialSheetConfig + extends Omit { name?: string } -export type PartialWorkbookConfig = Omit< - Flatfile.CreateWorkbookConfig, - 'sheets' | 'name' -> & { +export interface PartialWorkbookConfig + extends Omit { name?: string } diff --git a/utils/fetch-schema/src/index.ts b/utils/fetch-schema/src/index.ts index 006ffdad4..c330751c7 100644 --- a/utils/fetch-schema/src/index.ts +++ b/utils/fetch-schema/src/index.ts @@ -5,17 +5,13 @@ export interface ModelToSheetConfig extends PartialSheetConfig { sourceUrl: string } -export type PartialSheetConfig = Omit< - Flatfile.SheetConfig, - 'fields' | 'name' -> & { +export interface PartialSheetConfig + extends Omit { name?: string } -export type PartialWorkbookConfig = Omit< - Flatfile.CreateWorkbookConfig, - 'sheets' | 'name' -> & { +export interface PartialWorkbookConfig + extends Omit { name?: string } From d46b497e54242d22670c23ad2e39b974555c42a2 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Tue, 2 Apr 2024 16:04:00 -0500 Subject: [PATCH 11/16] tighten up includes/excludes --- rollup.config.mjs | 3 ++- tsconfig.json | 9 ++++++++- turbo.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 167835c6d..a70843cdf 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -25,7 +25,8 @@ function commonPlugins(browser, umd = false) { }), resolve({ browser, preferBuiltins: !browser }), sucrase({ - exclude: ['node_modules/**'], + include: ['src/**'], + exclude: ['**/node_modules/**', '**/.*/', '**/*.spec.ts'], transforms: ['typescript'], }), PROD && terser(), diff --git a/tsconfig.json b/tsconfig.json index 0e6550272..2d4131ea2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,16 @@ { "compilerOptions": { "esModuleInterop": true, + "skipLibCheck": true, "isolatedModules": true, "lib": [ "es2015", "dom" ], "target": "es2015", "moduleResolution": "node" - } + }, + "exclude": [ + "**/node_modules/", + "**/dist/", + "**/.*", + "**/*.spec.ts" + ] } diff --git a/turbo.json b/turbo.json index d788cb8ea..b2a6a3cd0 100644 --- a/turbo.json +++ b/turbo.json @@ -6,7 +6,7 @@ "dependsOn": ["^build"] }, "test": { - "inputs": [], + "inputs": ["**/*.spec.ts"], "dependsOn": ["^build"] } } From 43d44a580c92b993f893aac5a1fd8cbd9a037b5c Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Thu, 4 Apr 2024 13:46:28 -0500 Subject: [PATCH 12/16] Increase test workflow timeout --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7befab82e..7e6e8cf01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: test: name: Test - timeout-minutes: 15 + timeout-minutes: 20 runs-on: ubuntu-latest if: ${{ github.head_ref != 'changeset-release/main' }} steps: From a069477b963a147370067b68d355d8937d5681b3 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Thu, 4 Apr 2024 15:22:34 -0500 Subject: [PATCH 13/16] Add changeset --- .changeset/dirty-poets-change.md | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .changeset/dirty-poets-change.md diff --git a/.changeset/dirty-poets-change.md b/.changeset/dirty-poets-change.md new file mode 100644 index 000000000..f5d9c460d --- /dev/null +++ b/.changeset/dirty-poets-change.md @@ -0,0 +1,36 @@ +--- +'@flatfile/plugin-webhook-event-forwarder': patch +'@flatfile/plugin-foreign-db-extractor': patch +'@flatfile/plugin-convert-sql-ddl': patch +'@flatfile/plugin-connect-via-merge': patch +'@flatfile/util-response-rejection': patch +'@flatfile/plugin-export-workbook': patch +'@flatfile/plugin-space-configure': patch +'@flatfile/plugin-json-extractor': patch +'@flatfile/plugin-convert-openapi-schema': patch +'@flatfile/plugin-webhook-egress': patch +'@flatfile/plugin-xlsx-extractor': patch +'@flatfile/plugin-dxp-configure': patch +'@flatfile/plugin-pdf-extractor': patch +'@flatfile/plugin-psv-extractor': patch +'@flatfile/plugin-tsv-extractor': patch +'@flatfile/plugin-xml-extractor': patch +'@flatfile/plugin-zip-extractor': patch +'@flatfile/common-plugin-utils': patch +'@flatfile/plugin-constraints': patch +'@flatfile/plugin-job-handler': patch +'@flatfile/plugin-convert-json-schema': patch +'@flatfile/plugin-record-hook': patch +'@flatfile/plugin-convert-yaml-schema': patch +'@flatfile/util-fetch-schema': patch +'@flatfile/util-file-buffer': patch +'@flatfile/plugin-autocast': patch +'@flatfile/plugin-automap': patch +'@flatfile/util-extractor': patch +'@flatfile/plugin-dedupe': patch +'@flatfile/utils-testing': patch +'@flatfile/util-common': patch +'@flatfile/rollup-config': minor +--- + +This release refactors and optimizes import statements across all plugins and utility files, particularly emphasizing the use of TypeScript's type keyword for type-only imports. Additionally, this release centralizes the Rollup configuration and replaces axios with cross-fetch for HTTP requests. These changes streamline the codebase, enhance type safety, and unify HTTP request handling across the project. From bea34883416d1d6be776f537fda735f6ee51fa0b Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Thu, 4 Apr 2024 16:31:16 -0500 Subject: [PATCH 14/16] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cd613a26b..eddad278d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# flatfile-plugins +# Flatfile Plugins Library of open-source plugins for developing with the Flatfile Platform @@ -9,9 +9,9 @@ To get started building plugins: Additional Commands -There are more commands that you can run on every plugin at the root level. For instance, the release is run by Github so you don't have to do this manually. +There are more commands that you can run on every plugin at the root level. For instance, the release is run by GitHub, so you don't have to do this manually. Each plugin has its own package.json that you can run. -1. `build` command uses what's in index.ts and builds a minified compiled version of the code using tsup. That is what gets published to npm. +1. The `npm run build` command uses what's in index.ts and builds a minified compiled version of the code using Rollup. That is what gets published to npm. From c8d4b329386922164cb08c17dadabb8a1119b331 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 5 Apr 2024 11:06:27 -0500 Subject: [PATCH 15/16] Create @flatfile/rollup-config package --- .../rollup-config/index.mjs | 0 bundlers/rollup-config/package.json | 20 ++++ package-lock.json | 109 +++++++++++------- package.json | 9 +- plugins/autocast/package.json | 3 + plugins/autocast/rollup.config.mjs | 2 +- plugins/constraints/package.json | 3 + plugins/constraints/rollup.config.mjs | 2 +- plugins/dedupe/package.json | 3 +- plugins/dedupe/rollup.config.mjs | 2 +- plugins/dxp-configure/package.json | 3 +- plugins/dxp-configure/rollup.config.mjs | 2 +- plugins/foreign-db-extractor/package.json | 3 + .../foreign-db-extractor/rollup.config.mjs | 2 +- plugins/job-handler/package.json | 1 + plugins/job-handler/rollup.config.mjs | 2 +- plugins/json-extractor/package.json | 3 +- plugins/json-extractor/rollup.config.mjs | 2 +- plugins/openapi-schema/package.json | 3 + plugins/openapi-schema/rollup.config.mjs | 2 +- plugins/record-hook/package.json | 3 +- plugins/record-hook/rollup.config.mjs | 2 +- plugins/space-configure/package.json | 1 + plugins/space-configure/rollup.config.mjs | 2 +- plugins/webhook-egress/package.json | 1 + plugins/webhook-egress/rollup.config.mjs | 2 +- plugins/webhook-event-forwarder/package.json | 1 + .../webhook-event-forwarder/rollup.config.mjs | 2 +- utils/common/package.json | 3 + utils/common/rollup.config.mjs | 2 +- utils/response-rejection/package.json | 3 + utils/response-rejection/rollup.config.mjs | 2 +- 32 files changed, 135 insertions(+), 65 deletions(-) rename rollup.config.mjs => bundlers/rollup-config/index.mjs (100%) create mode 100644 bundlers/rollup-config/package.json diff --git a/rollup.config.mjs b/bundlers/rollup-config/index.mjs similarity index 100% rename from rollup.config.mjs rename to bundlers/rollup-config/index.mjs diff --git a/bundlers/rollup-config/package.json b/bundlers/rollup-config/package.json new file mode 100644 index 000000000..78a8c8921 --- /dev/null +++ b/bundlers/rollup-config/package.json @@ -0,0 +1,20 @@ +{ + "name": "@flatfile/rollup-config", + "version": "0.0.0", + "description": "", + "private": true, + "main": "index.mjs", + "scripts": {}, + "author": "Flatfile, Inc.", + "license": "ISC", + "dependencies": { + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-sucrase": "^5.0.2", + "@rollup/plugin-terser": "^0.4.4", + "rollup": "^4.12.0", + "rollup-plugin-dts": "^6.1.0", + "rollup-plugin-peer-deps-external": "^2.2.4" + } +} diff --git a/package-lock.json b/package-lock.json index d70ff5f2e..f3856d970 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "license": "MIT", "workspaces": [ + "bundlers/*", "flatfilers/*", "plugins/*", "support/*", @@ -20,11 +21,6 @@ "@flatfile/utils-testing": "^0.1.3", "@parcel/packager-ts": "^2.12.0", "@parcel/transformer-typescript-types": "^2.12.0", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-sucrase": "^5.0.2", - "@rollup/plugin-terser": "^0.4.4", "@types/jest": "^29.5.0", "@types/node": "^20.2.5", "dotenv": "^16.3.1", @@ -33,9 +29,6 @@ "jest": "^29.5.0", "parcel": "latest", "prettier": "^2.8.7", - "rollup": "^4.12.0", - "rollup-plugin-dts": "^6.1.0", - "rollup-plugin-peer-deps-external": "^2.2.4", "ts-jest": "^29.1.0", "turbo": "^1.10.2", "typescript": "^5.0.4" @@ -48,6 +41,20 @@ "@rollup/rollup-linux-x64-gnu": "^4.8.0" } }, + "bundlers/rollup-config": { + "version": "0.0.0", + "license": "ISC", + "dependencies": { + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-sucrase": "^5.0.2", + "@rollup/plugin-terser": "^0.4.4", + "rollup": "^4.12.0", + "rollup-plugin-dts": "^6.1.0", + "rollup-plugin-peer-deps-external": "^2.2.4" + } + }, "flatfilers/playground": { "name": "flatfile-playground", "version": "0.0.0", @@ -1292,6 +1299,10 @@ "resolved": "plugins/zip-extractor", "link": true }, + "node_modules/@flatfile/rollup-config": { + "resolved": "bundlers/rollup-config", + "link": true + }, "node_modules/@flatfile/schema": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/@flatfile/schema/-/schema-0.2.17.tgz", @@ -3059,8 +3070,9 @@ }, "node_modules/@parcel/packager-ts": { "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@parcel/packager-ts/-/packager-ts-2.12.0.tgz", + "integrity": "sha512-8wR0BNN2NBD+IIU0tjioK+lRD4p2Qi/fKxDH5ixEW912tRV+Vd4kE8k++U6YQIpSlK4FRnjFod5zYYhNSLuiXg==", "dev": true, - "license": "MIT", "dependencies": { "@parcel/plugin": "2.12.0" }, @@ -3596,8 +3608,9 @@ }, "node_modules/@parcel/transformer-typescript-types": { "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@parcel/transformer-typescript-types/-/transformer-typescript-types-2.12.0.tgz", + "integrity": "sha512-uxF4UBMYvbjiV3zHTWMrZX8cFD92VUvD3ArcGi5WEtuVROUm9Sc47o0mOzxKfMFlJu2KOfZVHYlzK9f/UKA2kQ==", "dev": true, - "license": "MIT", "dependencies": { "@parcel/diagnostic": "2.12.0", "@parcel/plugin": "2.12.0", @@ -3620,8 +3633,9 @@ }, "node_modules/@parcel/ts-utils": { "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@parcel/ts-utils/-/ts-utils-2.12.0.tgz", + "integrity": "sha512-zou+W6dcqnXXUOfN5zGM+ePIWbYOhGp8bVB2jICoNkoKmNAHd4l4zeHl5yQXnbZfynVw88cZVqxtXS8tYebelg==", "dev": true, - "license": "MIT", "dependencies": { "nullthrows": "^1.1.1" }, @@ -4059,7 +4073,6 @@ }, "node_modules/@rollup/plugin-commonjs": { "version": "25.0.7", - "dev": true, "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -4083,7 +4096,6 @@ }, "node_modules/@rollup/plugin-json": { "version": "6.1.0", - "dev": true, "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.1.0" @@ -4127,7 +4139,6 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-sucrase/-/plugin-sucrase-5.0.2.tgz", "integrity": "sha512-4MhIVH9Dy2Hwose1/x5QMs0XF7yn9jDd/yozHqzdIrMWIolgFpGnrnVhQkqTaK1RALY/fpyrEKmwH/04vr1THA==", - "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "sucrase": "^3.27.0" @@ -4146,7 +4157,6 @@ }, "node_modules/@rollup/plugin-terser": { "version": "0.4.4", - "dev": true, "license": "MIT", "dependencies": { "serialize-javascript": "^6.0.1", @@ -4192,7 +4202,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -4205,7 +4214,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -4216,7 +4224,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4230,7 +4237,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -4243,7 +4249,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -4256,7 +4261,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -4269,7 +4273,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -4282,7 +4285,6 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -4307,7 +4309,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -4320,7 +4321,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -4333,7 +4333,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -4346,7 +4345,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -10224,7 +10222,6 @@ }, "node_modules/magic-string": { "version": "0.30.5", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -11682,7 +11679,6 @@ }, "node_modules/randombytes": { "version": "2.1.0", - "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" @@ -12049,7 +12045,6 @@ }, "node_modules/rollup": { "version": "4.12.0", - "devOptional": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.5" @@ -12080,7 +12075,6 @@ }, "node_modules/rollup-plugin-dts": { "version": "6.1.0", - "dev": true, "license": "LGPL-3.0", "dependencies": { "magic-string": "^0.30.4" @@ -12115,7 +12109,6 @@ }, "node_modules/rollup-plugin-peer-deps-external": { "version": "2.2.4", - "dev": true, "license": "MIT", "peerDependencies": { "rollup": "*" @@ -12128,7 +12121,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -12269,7 +12261,6 @@ }, "node_modules/serialize-javascript": { "version": "6.0.2", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" @@ -12523,7 +12514,6 @@ }, "node_modules/smob": { "version": "1.4.1", - "dev": true, "license": "MIT" }, "node_modules/socks": { @@ -13700,7 +13690,6 @@ }, "node_modules/typescript": { "version": "5.3.3", - "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -14184,6 +14173,9 @@ "@flatfile/plugin-record-hook": "^1.4.6", "@flatfile/util-common": "^1.0.3" }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" + }, "engines": { "node": ">= 16" }, @@ -14218,6 +14210,9 @@ "@flatfile/api": "^1.7.4", "@flatfile/plugin-record-hook": "^1.4.6" }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" + }, "engines": { "node": ">= 16" }, @@ -14235,7 +14230,8 @@ "@flatfile/util-common": "^1.0.3" }, "devDependencies": { - "@faker-js/faker": "^7.6.0" + "@faker-js/faker": "^7.6.0", + "@flatfile/rollup-config": "0.0.0" }, "engines": { "node": ">= 16" @@ -14270,7 +14266,8 @@ "@flatfile/api": "^1.7.4" }, "devDependencies": { - "@flatfile/configure": "^0.5.39" + "@flatfile/configure": "^0.5.39", + "@flatfile/rollup-config": "0.0.0" }, "engines": { "node": ">= 16" @@ -14305,6 +14302,9 @@ "cross-fetch": "^4.0.0", "mssql": "^10.0.1" }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" + }, "engines": { "node": ">= 18" }, @@ -14344,6 +14344,7 @@ "@flatfile/util-common": "^1.0.3" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/utils-testing": "^0.1.3" }, "engines": { @@ -14358,6 +14359,7 @@ "version": "0.7.1", "license": "ISC", "dependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/util-extractor": "^0.5.2" }, "engines": { @@ -14417,6 +14419,9 @@ "@flatfile/plugin-space-configure": "^0.3.2", "cross-fetch": "^4.0.0" }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" + }, "engines": { "node": ">= 16" }, @@ -14498,7 +14503,8 @@ "@flatfile/util-common": "^1.0.3" }, "devDependencies": { - "@flatfile/hooks": "^1.3.1" + "@flatfile/hooks": "^1.3.1", + "@flatfile/rollup-config": "0.0.0" }, "engines": { "node": ">= 16" @@ -14517,6 +14523,7 @@ "@flatfile/plugin-job-handler": "^0.4.1" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/utils-testing": "^0.1.3" }, "engines": { @@ -14569,6 +14576,7 @@ "cross-fetch": "^4.0.0" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/utils-testing": "^0.1.3", "jest-fetch-mock": "^3.0.3" }, @@ -14588,6 +14596,7 @@ "cross-fetch": "^4.0.0" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "jest-fetch-mock": "^3.0.3" }, "engines": { @@ -14704,6 +14713,9 @@ "@flatfile/cross-env-config": "^0.0.5", "cross-fetch": "^4.0.0" }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" + }, "engines": { "node": ">= 16" }, @@ -14763,10 +14775,29 @@ "@flatfile/api": "^1.7.4", "@flatfile/util-common": "^1.0.3" }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" + }, "engines": { "node": ">= 16" } }, + "utils/rollup-config": { + "name": "@flatfile/rollup-config", + "version": "0.0.0", + "extraneous": true, + "license": "ISC", + "dependencies": { + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-sucrase": "^5.0.2", + "@rollup/plugin-terser": "^0.4.4", + "rollup": "^4.12.0", + "rollup-plugin-dts": "^6.1.0", + "rollup-plugin-peer-deps-external": "^2.2.4" + } + }, "utils/testing": { "name": "@flatfile/utils-testing", "version": "0.1.3", diff --git a/package.json b/package.json index ca839b4c8..e52f89c80 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "node": ">=16" }, "workspaces": [ + "bundlers/*", "flatfilers/*", "plugins/*", "support/*", @@ -43,11 +44,6 @@ "@flatfile/utils-testing": "^0.1.3", "@parcel/packager-ts": "^2.12.0", "@parcel/transformer-typescript-types": "^2.12.0", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-sucrase": "^5.0.2", - "@rollup/plugin-terser": "^0.4.4", "@types/jest": "^29.5.0", "@types/node": "^20.2.5", "dotenv": "^16.3.1", @@ -56,9 +52,6 @@ "jest": "^29.5.0", "parcel": "latest", "prettier": "^2.8.7", - "rollup": "^4.12.0", - "rollup-plugin-dts": "^6.1.0", - "rollup-plugin-peer-deps-external": "^2.2.4", "ts-jest": "^29.1.0", "turbo": "^1.10.2", "typescript": "^5.0.4" diff --git a/plugins/autocast/package.json b/plugins/autocast/package.json index 27677dd20..764108489 100644 --- a/plugins/autocast/package.json +++ b/plugins/autocast/package.json @@ -52,5 +52,8 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" + }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/autocast/rollup.config.mjs b/plugins/autocast/rollup.config.mjs index 82d8d1319..3a3d7fa35 100644 --- a/plugins/autocast/rollup.config.mjs +++ b/plugins/autocast/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const external = ['@flatfile/plugin-record-hook'] diff --git a/plugins/constraints/package.json b/plugins/constraints/package.json index d84380e37..9a2c9453b 100644 --- a/plugins/constraints/package.json +++ b/plugins/constraints/package.json @@ -46,5 +46,8 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" + }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/constraints/rollup.config.mjs b/plugins/constraints/rollup.config.mjs index 82d8d1319..3a3d7fa35 100644 --- a/plugins/constraints/rollup.config.mjs +++ b/plugins/constraints/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const external = ['@flatfile/plugin-record-hook'] diff --git a/plugins/dedupe/package.json b/plugins/dedupe/package.json index dd84c7375..bf49464e8 100644 --- a/plugins/dedupe/package.json +++ b/plugins/dedupe/package.json @@ -48,6 +48,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { - "@faker-js/faker": "^7.6.0" + "@faker-js/faker": "^7.6.0", + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/dedupe/rollup.config.mjs b/plugins/dedupe/rollup.config.mjs index 82d8d1319..3a3d7fa35 100644 --- a/plugins/dedupe/rollup.config.mjs +++ b/plugins/dedupe/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const external = ['@flatfile/plugin-record-hook'] diff --git a/plugins/dxp-configure/package.json b/plugins/dxp-configure/package.json index 566ebd656..d08d6f9db 100644 --- a/plugins/dxp-configure/package.json +++ b/plugins/dxp-configure/package.json @@ -51,6 +51,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { - "@flatfile/configure": "^0.5.39" + "@flatfile/configure": "^0.5.39", + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/dxp-configure/rollup.config.mjs b/plugins/dxp-configure/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/dxp-configure/rollup.config.mjs +++ b/plugins/dxp-configure/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/plugins/foreign-db-extractor/package.json b/plugins/foreign-db-extractor/package.json index 71df1a304..09af4ba16 100644 --- a/plugins/foreign-db-extractor/package.json +++ b/plugins/foreign-db-extractor/package.json @@ -47,5 +47,8 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" + }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/foreign-db-extractor/rollup.config.mjs b/plugins/foreign-db-extractor/rollup.config.mjs index 5b6d31c35..3ce39000a 100644 --- a/plugins/foreign-db-extractor/rollup.config.mjs +++ b/plugins/foreign-db-extractor/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({ includeBrowser: false }) diff --git a/plugins/job-handler/package.json b/plugins/job-handler/package.json index fc6881d66..d533e3dd5 100644 --- a/plugins/job-handler/package.json +++ b/plugins/job-handler/package.json @@ -48,6 +48,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/utils-testing": "^0.1.3" } } diff --git a/plugins/job-handler/rollup.config.mjs b/plugins/job-handler/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/job-handler/rollup.config.mjs +++ b/plugins/job-handler/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/plugins/json-extractor/package.json b/plugins/json-extractor/package.json index 7815f62f4..21ede231f 100644 --- a/plugins/json-extractor/package.json +++ b/plugins/json-extractor/package.json @@ -41,6 +41,7 @@ }, "license": "ISC", "dependencies": { - "@flatfile/util-extractor": "^0.5.2" + "@flatfile/util-extractor": "^0.5.2", + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/json-extractor/rollup.config.mjs b/plugins/json-extractor/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/json-extractor/rollup.config.mjs +++ b/plugins/json-extractor/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/plugins/openapi-schema/package.json b/plugins/openapi-schema/package.json index 1f71f9346..eb2ef6ba0 100644 --- a/plugins/openapi-schema/package.json +++ b/plugins/openapi-schema/package.json @@ -46,5 +46,8 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" + }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/openapi-schema/rollup.config.mjs b/plugins/openapi-schema/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/openapi-schema/rollup.config.mjs +++ b/plugins/openapi-schema/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/plugins/record-hook/package.json b/plugins/record-hook/package.json index 610555ea5..3ce979c08 100644 --- a/plugins/record-hook/package.json +++ b/plugins/record-hook/package.json @@ -53,6 +53,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { - "@flatfile/hooks": "^1.3.1" + "@flatfile/hooks": "^1.3.1", + "@flatfile/rollup-config": "0.0.0" } } diff --git a/plugins/record-hook/rollup.config.mjs b/plugins/record-hook/rollup.config.mjs index 7be76c487..fc7c877bd 100644 --- a/plugins/record-hook/rollup.config.mjs +++ b/plugins/record-hook/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const umdExternals = [ '@flatfile/api', diff --git a/plugins/space-configure/package.json b/plugins/space-configure/package.json index 6a949b2f2..61986dcfa 100644 --- a/plugins/space-configure/package.json +++ b/plugins/space-configure/package.json @@ -47,6 +47,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/utils-testing": "^0.1.3" } } diff --git a/plugins/space-configure/rollup.config.mjs b/plugins/space-configure/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/space-configure/rollup.config.mjs +++ b/plugins/space-configure/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/plugins/webhook-egress/package.json b/plugins/webhook-egress/package.json index 348eacbc3..3fd663d7f 100644 --- a/plugins/webhook-egress/package.json +++ b/plugins/webhook-egress/package.json @@ -51,6 +51,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "@flatfile/utils-testing": "^0.1.3", "jest-fetch-mock": "^3.0.3" } diff --git a/plugins/webhook-egress/rollup.config.mjs b/plugins/webhook-egress/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/webhook-egress/rollup.config.mjs +++ b/plugins/webhook-egress/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/plugins/webhook-event-forwarder/package.json b/plugins/webhook-event-forwarder/package.json index d91fe8515..f092d7550 100644 --- a/plugins/webhook-event-forwarder/package.json +++ b/plugins/webhook-event-forwarder/package.json @@ -51,6 +51,7 @@ "@flatfile/listener": "^1.0.1" }, "devDependencies": { + "@flatfile/rollup-config": "0.0.0", "jest-fetch-mock": "^3.0.3" } } diff --git a/plugins/webhook-event-forwarder/rollup.config.mjs b/plugins/webhook-event-forwarder/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/plugins/webhook-event-forwarder/rollup.config.mjs +++ b/plugins/webhook-event-forwarder/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/utils/common/package.json b/utils/common/package.json index 562d23cd1..cd253759a 100644 --- a/utils/common/package.json +++ b/utils/common/package.json @@ -43,5 +43,8 @@ }, "peerDependencies": { "@flatfile/listener": "^1.0.1" + }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" } } diff --git a/utils/common/rollup.config.mjs b/utils/common/rollup.config.mjs index 83b706947..fafa813c6 100644 --- a/utils/common/rollup.config.mjs +++ b/utils/common/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const config = buildConfig({}) diff --git a/utils/response-rejection/package.json b/utils/response-rejection/package.json index b4a51f2d3..16941b2c9 100644 --- a/utils/response-rejection/package.json +++ b/utils/response-rejection/package.json @@ -43,5 +43,8 @@ "dependencies": { "@flatfile/api": "^1.7.4", "@flatfile/util-common": "^1.0.3" + }, + "devDependencies": { + "@flatfile/rollup-config": "0.0.0" } } \ No newline at end of file diff --git a/utils/response-rejection/rollup.config.mjs b/utils/response-rejection/rollup.config.mjs index c8c032a43..bee3ee8fa 100644 --- a/utils/response-rejection/rollup.config.mjs +++ b/utils/response-rejection/rollup.config.mjs @@ -1,4 +1,4 @@ -import { buildConfig } from '../../rollup.config.mjs' +import { buildConfig } from '@flatfile/rollup-config' const external = ['@flatfile/util-common'] From 285fc7b50737f5c0a443ce75a47779349b8bc173 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Fri, 5 Apr 2024 12:58:19 -0500 Subject: [PATCH 16/16] node & browser condition branches --- package-lock.json | 1 + plugins/autocast/package.json | 10 ++++++++-- plugins/constraints/package.json | 10 ++++++++-- plugins/dedupe/package.json | 10 ++++++++-- plugins/dxp-configure/package.json | 10 ++++++++-- plugins/foreign-db-extractor/package.json | 10 ++++++++-- plugins/job-handler/package.json | 10 ++++++++-- plugins/json-extractor/package.json | 10 ++++++++-- plugins/openapi-schema/package.json | 10 ++++++++-- plugins/record-hook/package.json | 10 ++++++++-- plugins/space-configure/package.json | 10 ++++++++-- plugins/webhook-egress/package.json | 10 ++++++++-- plugins/webhook-event-forwarder/package.json | 10 ++++++++-- utils/common/package.json | 10 ++++++++-- utils/response-rejection/package.json | 10 ++++++++-- 15 files changed, 113 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3856d970..2b621a504 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ } }, "bundlers/rollup-config": { + "name": "@flatfile/rollup-config", "version": "0.0.0", "license": "ISC", "dependencies": { diff --git a/plugins/autocast/package.json b/plugins/autocast/package.json index 764108489..89429d30f 100644 --- a/plugins/autocast/package.json +++ b/plugins/autocast/package.json @@ -15,8 +15,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/constraints/package.json b/plugins/constraints/package.json index 9a2c9453b..284852a2e 100644 --- a/plugins/constraints/package.json +++ b/plugins/constraints/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/dedupe/package.json b/plugins/dedupe/package.json index bf49464e8..ce4eaa286 100644 --- a/plugins/dedupe/package.json +++ b/plugins/dedupe/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/dxp-configure/package.json b/plugins/dxp-configure/package.json index d08d6f9db..a45d15755 100644 --- a/plugins/dxp-configure/package.json +++ b/plugins/dxp-configure/package.json @@ -19,8 +19,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/foreign-db-extractor/package.json b/plugins/foreign-db-extractor/package.json index 09af4ba16..4c0ff0fc9 100644 --- a/plugins/foreign-db-extractor/package.json +++ b/plugins/foreign-db-extractor/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/job-handler/package.json b/plugins/job-handler/package.json index d533e3dd5..1d1c52a19 100644 --- a/plugins/job-handler/package.json +++ b/plugins/job-handler/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/json-extractor/package.json b/plugins/json-extractor/package.json index 21ede231f..30ad0e83d 100644 --- a/plugins/json-extractor/package.json +++ b/plugins/json-extractor/package.json @@ -15,8 +15,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/openapi-schema/package.json b/plugins/openapi-schema/package.json index eb2ef6ba0..58b0b73c9 100644 --- a/plugins/openapi-schema/package.json +++ b/plugins/openapi-schema/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/record-hook/package.json b/plugins/record-hook/package.json index 3ce979c08..8add951f3 100644 --- a/plugins/record-hook/package.json +++ b/plugins/record-hook/package.json @@ -19,8 +19,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/space-configure/package.json b/plugins/space-configure/package.json index 61986dcfa..9dee4f310 100644 --- a/plugins/space-configure/package.json +++ b/plugins/space-configure/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/webhook-egress/package.json b/plugins/webhook-egress/package.json index 3fd663d7f..8044a14da 100644 --- a/plugins/webhook-egress/package.json +++ b/plugins/webhook-egress/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/plugins/webhook-event-forwarder/package.json b/plugins/webhook-event-forwarder/package.json index f092d7550..99a2642d1 100644 --- a/plugins/webhook-event-forwarder/package.json +++ b/plugins/webhook-event-forwarder/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/utils/common/package.json b/utils/common/package.json index cd253759a..ec5d0099a 100644 --- a/utils/common/package.json +++ b/utils/common/package.json @@ -13,8 +13,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs", diff --git a/utils/response-rejection/package.json b/utils/response-rejection/package.json index 16941b2c9..d8c1ea697 100644 --- a/utils/response-rejection/package.json +++ b/utils/response-rejection/package.json @@ -14,8 +14,14 @@ }, "exports": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "browser": { + "require": "./dist/index.browser.cjs", + "import": "./dist/index.browser.mjs" + }, "default": "./dist/index.mjs" }, "main": "./dist/index.cjs",