From 2822f169f23160a1f0d51722b22a8b4228e321b6 Mon Sep 17 00:00:00 2001 From: Sai Kambaiyyagari Date: Thu, 15 Jan 2026 10:40:33 +1100 Subject: [PATCH 1/4] Add the manifest generator logic to generate the connector manifest --- packages/zcli-connectors/package.json | 1 + .../lib/manifest-generator/generator.test.ts | 164 ++++++++++++++++++ .../src/lib/manifest-generator/generator.ts | 77 ++++++++ .../src/lib/manifest-generator/types.ts | 30 ++++ yarn.lock | 39 ++++- 5 files changed, 308 insertions(+), 3 deletions(-) create mode 100644 packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts create mode 100644 packages/zcli-connectors/src/lib/manifest-generator/generator.ts create mode 100644 packages/zcli-connectors/src/lib/manifest-generator/types.ts diff --git a/packages/zcli-connectors/package.json b/packages/zcli-connectors/package.json index 0e6818e9..26a8305f 100644 --- a/packages/zcli-connectors/package.json +++ b/packages/zcli-connectors/package.json @@ -32,6 +32,7 @@ "@types/chai": "^4", "@types/mocha": "^9.1.1", "@types/rimraf": "^3.0.2", + "@types/sinon-chai": "^4.0.0", "chai": "^4", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", diff --git a/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts b/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts new file mode 100644 index 00000000..6f17c12b --- /dev/null +++ b/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts @@ -0,0 +1,164 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { expect, test } from '@oclif/test' +import * as fs from 'fs' +import * as path from 'path' +import * as sinon from 'sinon' +import sinonChai from 'sinon-chai' +import { use } from 'chai' +import { ManifestGenerator } from './generator' +import { ConnectorConfig } from './types' + +use(sinonChai) + +describe('ManifestGenerator', () => { + const mockOutputPath = './test/output' + const mockConnectorPath = '/test/output/connector.js' + const mockManifestPath = '/test/output/manifest.json' + + let writeFileSyncStub: sinon.SinonStub + let joinStub: sinon.SinonStub + + beforeEach(() => { + writeFileSyncStub = sinon.stub() + joinStub = sinon.stub() + + // Mock modules + sinon.replace(fs, 'writeFileSync', writeFileSyncStub) + sinon.replace(path, 'join', joinStub) + + joinStub + .withArgs(mockOutputPath, 'connector.js').returns(mockConnectorPath) + .withArgs(mockOutputPath, 'manifest.json').returns(mockManifestPath) + }) + + afterEach(() => { + sinon.restore() + }) + + describe('generateManifest', () => { + const validConnector: ConnectorConfig = { + name: 'test-connector', + title: 'Test Connector', + description: 'A test connector', + author: 'Test Author', + version: '2.0.0', + platform_version: '1.5.0', + default_locale: 'en-US' + } + + test + .stub(ManifestGenerator as any, 'loadConnector', () => Promise.resolve(validConnector)) + .it('should generate manifest with all connector properties', async () => { + await ManifestGenerator.generateManifest({ outputPath: mockOutputPath }) + + const expectedManifest = { + name: 'test-connector', + title: 'Test Connector', + description: 'A test connector', + author: 'Test Author', + version: '2.0.0', + platform_version: '1.5.0', + default_locale: 'en-US', + metadata: { + connection_type: 'test-connector' + } + } + + expect(writeFileSyncStub).to.have.been.calledWith( + mockManifestPath, + JSON.stringify(expectedManifest, null, 2), + 'utf-8' + ) + }) + + test + .stub(ManifestGenerator as any, 'loadConnector', () => Promise.resolve({ + name: 'minimal-connector', + title: 'Minimal Connector', + description: 'A minimal connector' + })) + .it('should use default values when optional properties are missing', async () => { + await ManifestGenerator.generateManifest({ outputPath: mockOutputPath }) + + const expectedManifest = { + name: 'minimal-connector', + title: 'Minimal Connector', + description: 'A minimal connector', + author: undefined, + version: '1.0.0', + platform_version: '1.0.0', + default_locale: 'en-US', + metadata: { + connection_type: 'minimal-connector' + } + } + + expect(writeFileSyncStub).to.have.been.calledWith( + mockManifestPath, + JSON.stringify(expectedManifest, null, 2), + 'utf-8' + ) + }) + + test + .stub(ManifestGenerator as any, 'loadConnector', () => Promise.resolve({ + name: 'test-connector' + })) + .it('should throw error when required properties are missing', async () => { + try { + await ManifestGenerator.generateManifest({ outputPath: mockOutputPath }) + expect.fail('Expected error to be thrown') + } catch (error: any) { + expect(error.message).to.include('Connector is missing required properties: title, description') + } + }) + + test + .stub(ManifestGenerator as any, 'loadConnector', () => Promise.resolve(validConnector)) + .it('should handle connector module with default export', async () => { + await ManifestGenerator.generateManifest({ outputPath: mockOutputPath }) + + // eslint-disable-next-line no-unused-expressions + expect(writeFileSyncStub).to.have.been.calledOnce + }) + }) + + describe('validateConnector', () => { + it('should not throw for valid connector', () => { + const validConnector: ConnectorConfig = { + name: 'test', + title: 'Test', + description: 'Test description', + author: '', + version: '', + default_locale: '', + platform_version: '' + } + + expect(() => { + (ManifestGenerator as any).validateConnector(validConnector) + }).not.to.throw() + }) + + it('should throw for connector missing name', () => { + const invalidConnector = { + title: 'Test', + description: 'Test description' + } as ConnectorConfig + + expect(() => { + (ManifestGenerator as any).validateConnector(invalidConnector) + }).to.throw('Connector is missing required properties: name') + }) + + it('should throw for connector missing multiple properties', () => { + const invalidConnector = { + name: 'test' + } as ConnectorConfig + + expect(() => { + (ManifestGenerator as any).validateConnector(invalidConnector) + }).to.throw('Connector is missing required properties: title, description') + }) + }) +}) diff --git a/packages/zcli-connectors/src/lib/manifest-generator/generator.ts b/packages/zcli-connectors/src/lib/manifest-generator/generator.ts new file mode 100644 index 00000000..40052cd3 --- /dev/null +++ b/packages/zcli-connectors/src/lib/manifest-generator/generator.ts @@ -0,0 +1,77 @@ +import { writeFileSync } from 'fs' +import { join } from 'path' + +import { + ConnectorConfig, + ManifestData, + ManifestGeneratorOptions +} from './types' + +const DEFAULT_VERSION = '1.0.0' +const DEFAULT_LOCALE = 'en-US' +const CORE_PACKAGE_FALLBACK_VERSION = '1.0.0' +export class ManifestGenerator { + static async generateManifest ( + options: ManifestGeneratorOptions + ): Promise { + const { outputPath } = options + + const connector = await this.loadConnector(outputPath) + this.validateConnector(connector) + + const manifest: ManifestData = { + name: connector.name, + title: connector.title, + description: connector.description, + author: connector.author, + version: connector.version || DEFAULT_VERSION, + platform_version: + connector.platform_version || CORE_PACKAGE_FALLBACK_VERSION, + default_locale: DEFAULT_LOCALE, + metadata: connector.metadata || { + connection_type: connector.name + } + } + + this.writeManifestFile(manifest, outputPath) + } + + private static async loadConnector ( + outputPath: string + ): Promise { + const indexPath = join(outputPath, 'connector.js') + + // eslint-disable-next-line @typescript-eslint/no-var-requires + const connectorModule = require(indexPath) + + // Handle both CommonJS (exports.default) and direct exports + return connectorModule.default || connectorModule + } + + private static writeManifestFile ( + manifest: ManifestData, + outputPath: string + ): void { + const manifestPath = join(outputPath, 'manifest.json') + const manifestContent = JSON.stringify(manifest, null, 2) + writeFileSync(manifestPath, manifestContent, 'utf-8') + } + + private static validateConnector (connector: ConnectorConfig): void { + const requiredProperties: (keyof ConnectorConfig)[] = [ + 'name', + 'title', + 'description' + ] + + const missingProperties = requiredProperties.filter( + prop => !connector[prop] + ) + + if (missingProperties.length > 0) { + throw new Error( + `Connector is missing required properties: ${missingProperties.join(', ')}` + ) + } + } +} diff --git a/packages/zcli-connectors/src/lib/manifest-generator/types.ts b/packages/zcli-connectors/src/lib/manifest-generator/types.ts new file mode 100644 index 00000000..0e200858 --- /dev/null +++ b/packages/zcli-connectors/src/lib/manifest-generator/types.ts @@ -0,0 +1,30 @@ +// Simplified connector interface based on ManifestConfig from core package +export interface ConnectorConfig { + name: string; + title: string; + description: string; + author: string; + version: string; + default_locale: string; + platform_version: string; + metadata?: { + connection_type: string; + }; +} + +export interface ManifestData { + name: string; + title: string; + description: string; + author?: string; + version: string; + platform_version: string; + default_locale: string; + metadata?: { + connection_type: string; + }; +} + +export interface ManifestGeneratorOptions { + outputPath: string; +} diff --git a/yarn.lock b/yarn.lock index df09c20d..e4bfadbb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1757,6 +1757,14 @@ "@types/mime" "^1" "@types/node" "*" +"@types/sinon-chai@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-4.0.0.tgz#4d0e540a1498c0e85649088a0c7ed31d7627024f" + integrity sha512-Uar+qk3TmeFsUWCwtqRNqNUE7vf34+MCJiQJR5M2rd4nCbhtE8RgTiHwN/mVwbfCjhmO6DiOel/MgzHkRMJJFg== + dependencies: + "@types/chai" "*" + "@types/sinon" "*" + "@types/sinon@*", "@types/sinon@^10.0.13": version "10.0.13" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.13.tgz#60a7a87a70d9372d0b7b38cc03e825f46981fb83" @@ -7439,7 +7447,16 @@ stdout-stderr@^0.1.9: debug "^4.1.1" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7503,7 +7520,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8069,7 +8093,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -8087,6 +8111,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 16d15877d10fb82d2b7d6c9a7872fb0f9c4998ac Mon Sep 17 00:00:00 2001 From: Sai Kambaiyyagari Date: Thu, 15 Jan 2026 23:39:31 +1100 Subject: [PATCH 2/4] Introduce the connector bundle logic to create the minified JS output --- package.json | 3 +- packages/zcli-connectors/package.json | 10 +- .../src/commands/connectors/bundle.ts | 128 +++- .../zcli-connectors/src/lib/vite/index.ts | 6 + .../src/lib/vite/vite-config.test.ts | 286 +++++++++ .../src/lib/vite/vite-config.ts | 243 ++++++++ .../src/lib/vite/vite-runner.test.ts | 189 ++++++ .../src/lib/vite/vite-runner.ts | 43 ++ .../tests/functional/bundle.test.ts | 165 ++++- packages/zcli-connectors/tsconfig.json | 1 - packages/zcli-core/src/lib/config.test.ts | 31 +- yarn.lock | 580 +++++++++++++++++- 12 files changed, 1643 insertions(+), 42 deletions(-) create mode 100644 packages/zcli-connectors/src/lib/vite/index.ts create mode 100644 packages/zcli-connectors/src/lib/vite/vite-config.test.ts create mode 100644 packages/zcli-connectors/src/lib/vite/vite-config.ts create mode 100644 packages/zcli-connectors/src/lib/vite/vite-runner.test.ts create mode 100644 packages/zcli-connectors/src/lib/vite/vite-runner.ts diff --git a/package.json b/package.json index 2715ee50..ac97e20d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "standard": "^17.0.0", "ts-node": "^10.9.1", "typescript": "~4.7.4", - "yarn-audit-fix": "^10.1.1" + "yarn-audit-fix": "^10.1.1", + "@types/sinon-chai": "^4.0.0" }, "engines": { "node": ">=20.17.0" diff --git a/packages/zcli-connectors/package.json b/packages/zcli-connectors/package.json index 26a8305f..28e2fff1 100644 --- a/packages/zcli-connectors/package.json +++ b/packages/zcli-connectors/package.json @@ -23,7 +23,12 @@ "chalk": "^4.1.2", "fs-extra": "^10.0.0", "rimraf": "^3.0.2", - "tslib": "^2.4.0" + "tslib": "^2.4.0", + "ora": "^5.4.1", + "@rollup/plugin-babel": "^6.0.0", + "@rollup/plugin-commonjs": "^25.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "vite": "7.1.3" }, "devDependencies": { "@oclif/test": "=2.1.0", @@ -39,7 +44,8 @@ "eslint-config-oclif-typescript": "^1.0.2", "lerna": "^5.6.2", "mocha": "^10.8.2", - "sinon": "^14.0.0" + "sinon": "^14.0.0", + "sinon-chai": "^4.0.1" }, "files": [ "/bin", diff --git a/packages/zcli-connectors/src/commands/connectors/bundle.ts b/packages/zcli-connectors/src/commands/connectors/bundle.ts index 29bdda18..dc5e1d9a 100644 --- a/packages/zcli-connectors/src/commands/connectors/bundle.ts +++ b/packages/zcli-connectors/src/commands/connectors/bundle.ts @@ -1,27 +1,125 @@ -import { Command } from '@oclif/core' -import * as path from 'path' +import { Command, Flags } from '@oclif/core' +import { existsSync, mkdirSync } from 'fs' +import { join, resolve } from 'path' import * as chalk from 'chalk' +import { ViteConfigBuilder, ViteRunner } from '../../lib/vite' +import * as ora from 'ora' export default class Bundle extends Command { - static description = 'bundles your connector package (Note: This command is not yet available for customers)' + static examples = [ + '<%= config.bin %> <%= command.id %> ./example-connector', + '<%= config.bin %> <%= command.id %> ./example-connector --output ./bundled', + '<%= config.bin %> <%= command.id %> --input ./dist --output ./bundle' + ] + + static flags = { + help: Flags.help({ char: 'h' }), + input: Flags.string({ + char: 'i', + description: 'input directory containing built connector files', + default: '.' + }), + output: Flags.string({ + char: 'o', + description: 'output directory for bundled files' + }), + verbose: Flags.boolean({ + char: 'v', + description: 'verbose output', + default: false + }), + watch: Flags.boolean({ + char: 'w', + description: 'watch for changes and rebuild', + default: false + }) + } static args = [ - { name: 'connectorDirectory', default: '.', description: 'connector path where configuration exists' } + { + name: 'path', + description: 'path to connector directory (will use dist/ folder inside)' + } ] - static examples = [ - '$ zcli connectors:bundle .', - '$ zcli connectors:bundle ./connector1' - ] + async run (): Promise { + const { args, flags } = await this.parse(Bundle) + + let inputPath: string + if (args.path) { + inputPath = resolve(join(args.path, 'src')) + } else { + inputPath = resolve(flags.input) + } + + const outputPath = flags.output ? resolve(flags.output) : resolve('dist') + if (!existsSync(outputPath)) { + mkdirSync(outputPath, { recursive: true }) + } + + const spinner = ora( + `Bundling connector from ${inputPath} to ${outputPath}...` + ).start() + + try { + await this.generateViteBundle(inputPath, outputPath, flags, spinner) + + if (flags.watch) { + spinner.succeed( + chalk.green('Watching for changes... (Press Ctrl+C to stop)') + ) + } else { + spinner.succeed(chalk.green('Bundle created successfully!')) + } + } catch (error) { + spinner.fail(chalk.red('Failed to bundle the connector')) + + if (error instanceof Error) { + this.log('\n' + chalk.red('Error Details:')) + this.log(error.message) + } + } + } + + private async generateViteBundle ( + inputPath: string, + outputPath: string, + flags: { watch: boolean }, + spinner: ora.Ora + ): Promise { + const { watch } = flags + const viteConfig = ViteConfigBuilder.createConfig( + { + inputPath, + outputPath, + useLocalWorkspace: false, + watch + }, + this + ) + + spinner.text = watch + ? 'Building connector and watching for changes...' + : 'Building connector...' + const stats = await ViteRunner.run(viteConfig) + + if (stats.hasErrors()) { + spinner.fail(chalk.red('Bundle failed with errors!')) - async run () { - const { args } = await this.parse(Bundle) - const { connectorDirectory } = args + const errors = stats.toJson().errors || [] + errors.forEach((error: any) => { + this.log(chalk.red(`Error: ${error.message}`)) + }) - const connectorPath = path.resolve(connectorDirectory) + throw new Error('Connector build failed') + } - this.log(chalk.yellow(`Bundling connector from: ${connectorPath}`)) - // Placeholder for actual bundling logic - this.log(chalk.green('Connector bundle created successfully!')) + if (stats.hasWarnings()) { + const warnings = stats.toJson().warnings || [] + this.log(chalk.yellow('\nWarnings:')) + warnings.forEach((warning: any) => { + this.log(chalk.yellow(` - ${warning.message}`)) + }) + } } } diff --git a/packages/zcli-connectors/src/lib/vite/index.ts b/packages/zcli-connectors/src/lib/vite/index.ts new file mode 100644 index 00000000..99ba4892 --- /dev/null +++ b/packages/zcli-connectors/src/lib/vite/index.ts @@ -0,0 +1,6 @@ +export { + ViteConfigBuilder, + ViteConfigOptions, + createConnectorViteConfig +} from './vite-config' +export { ViteRunner } from './vite-runner' diff --git a/packages/zcli-connectors/src/lib/vite/vite-config.test.ts b/packages/zcli-connectors/src/lib/vite/vite-config.test.ts new file mode 100644 index 00000000..4f245ae7 --- /dev/null +++ b/packages/zcli-connectors/src/lib/vite/vite-config.test.ts @@ -0,0 +1,286 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ +/* eslint-disable no-unused-expressions */ +import { expect, use } from 'chai' +import * as sinon from 'sinon' +import sinonChai from 'sinon-chai' +import * as fs from 'fs' +import { ViteConfigBuilder, createConnectorViteConfig } from './vite-config' +import { ManifestGenerator } from '../manifest-generator/generator' + +use(sinonChai) + +describe('ViteConfigBuilder', () => { + let fsStubs: any + let manifestStub: sinon.SinonStub + let consoleErrorStub: sinon.SinonStub + + beforeEach(() => { + // Properly stub the fs module functions + fsStubs = { + existsSync: sinon.stub(fs, 'existsSync'), + copyFileSync: sinon.stub(fs, 'copyFileSync'), + mkdirSync: sinon.stub(fs, 'mkdirSync'), + readdirSync: sinon.stub(fs, 'readdirSync'), + statSync: sinon.stub(fs, 'statSync') + } + + manifestStub = sinon.stub(ManifestGenerator, 'generateManifest') + consoleErrorStub = sinon.stub(console, 'error') + }) + + afterEach(() => { + sinon.restore() + }) + + describe('createAssetCopyPlugin', () => { + it('should copy assets and translations when writeBundle is called', async () => { + const inputPath = '/input' + const outputPath = '/output' + + // Mock directory structure - use normalized paths + fsStubs.existsSync + .withArgs(sinon.match.string).returns(false) // default + .withArgs(sinon.match(/input.*assets/)).returns(true) + .withArgs(sinon.match(/input.*translations/)).returns(true) + + fsStubs.readdirSync + .withArgs(sinon.match(/input.*assets/)).returns(['file1.png', 'subdir']) + .withArgs(sinon.match(/input.*translations/)).returns(['en.json']) + .withArgs(sinon.match(/input.*assets.*subdir/)).returns(['file2.png']) + + fsStubs.statSync + .withArgs(sinon.match(/file1\.png/)).returns({ isDirectory: () => false }) + .withArgs(sinon.match(/subdir/)).returns({ isDirectory: () => true }) + .withArgs(sinon.match(/en\.json/)).returns({ isDirectory: () => false }) + .withArgs(sinon.match(/file2\.png/)).returns({ isDirectory: () => false }) + + fsStubs.mkdirSync.returns(undefined) + fsStubs.copyFileSync.returns(undefined) + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath, + outputPath + }, { log: () => {} }) + + const assetPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'copy-assets-translations' + ) + + // Execute writeBundle + await assetPlugin.writeBundle() + + // Verify directories were created - use flexible path matching + expect(fsStubs.mkdirSync).to.have.been.calledWith(sinon.match(/assets/), { recursive: true }) + expect(fsStubs.mkdirSync).to.have.been.calledWith(sinon.match(/translations/), { recursive: true }) + expect(fsStubs.mkdirSync).to.have.been.calledWith(sinon.match(/assets.*subdir/), { recursive: true }) + + // Verify files were copied + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/file1\.png/), sinon.match(/file1\.png/)) + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/en\.json/), sinon.match(/en\.json/)) + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/file2\.png/), sinon.match(/file2\.png/)) + }) + + it('should not copy assets or translations if directories do not exist', async () => { + const inputPath = '/input' + const outputPath = '/output' + + fsStubs.existsSync.returns(false) + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath, + outputPath + }, { log: () => {} }) + + const assetPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'copy-assets-translations' + ) + + await assetPlugin.writeBundle() + + expect(fsStubs.copyFileSync).not.to.have.been.called + }) + }) + + describe('createManifestPlugin', () => { + it('should generate manifest and copy to target directory in development mode', async () => { + const outputPath = '/output' + const targetDir = '/target' + + manifestStub.resolves() + + fsStubs.existsSync + .withArgs(sinon.match.string).returns(false) // default + .withArgs(sinon.match(/output/)).returns(true) + + fsStubs.readdirSync.withArgs(sinon.match(/output/)).returns(['manifest.json', 'connector.js']) + fsStubs.statSync + .withArgs(sinon.match(/manifest\.json/)).returns({ isDirectory: () => false }) + .withArgs(sinon.match(/connector\.js/)).returns({ isDirectory: () => false }) + + fsStubs.mkdirSync.returns(undefined) + fsStubs.copyFileSync.returns(undefined) + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath: '/input', + outputPath, + mode: 'development', + targetDir + }, { log: () => {} }) + + const manifestPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'generate-manifest' + ) + + await manifestPlugin.writeBundle() + + expect(manifestStub).to.have.been.calledWith({ outputPath }) + expect(fsStubs.mkdirSync).to.have.been.calledWith(sinon.match(/target/), { recursive: true }) + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/manifest\.json/), sinon.match(/manifest\.json/)) + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/connector\.js/), sinon.match(/connector\.js/)) + }) + + it('should handle manifest generation error', async () => { + const error = new Error('Manifest generation failed') + manifestStub.rejects(error) + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath: '/input', + outputPath: '/output' + }, { log: () => {} }) + + const manifestPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'generate-manifest' + ) + + try { + await manifestPlugin.writeBundle() + expect.fail('Should have thrown error') + } catch (e) { + expect(e).to.equal(error) + expect(consoleErrorStub).to.have.been.calledWith('Failed to generate manifest:', error) + } + }) + + it('should generate manifest without copying in production mode', async () => { + manifestStub.resolves() + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath: '/input', + outputPath: '/output', + mode: 'production' + }, { log: () => {} }) + + const manifestPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'generate-manifest' + ) + + await manifestPlugin.writeBundle() + + expect(manifestStub).to.have.been.calledWith({ outputPath: '/output' }) + expect(fsStubs.mkdirSync).not.to.have.been.called + expect(fsStubs.copyFileSync).not.to.have.been.called + }) + + it('should skip copying if no targetDir specified in development mode', async () => { + manifestStub.resolves() + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath: '/input', + outputPath: '/output', + mode: 'development' + // no targetDir + }, { log: () => {} }) + + const manifestPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'generate-manifest' + ) + + await manifestPlugin.writeBundle() + + expect(manifestStub).to.have.been.called + expect(fsStubs.mkdirSync).not.to.have.been.called + expect(fsStubs.copyFileSync).not.to.have.been.called + }) + }) + + describe('createConnectorViteConfig helper function', () => { + it('should create config using ViteConfigBuilder', () => { + const options = { + useLocalWorkspace: true, + inputPath: '/input', + outputPath: '/output' + } + const logger = { log: sinon.stub() } + + const config = createConnectorViteConfig(options, logger) + + expect(config).to.have.property('build') + expect(config.build).to.have.property('lib') + expect(logger.log).to.have.been.calledWith('[ViteConfigBuilder] Using local workspace configuration') + }) + + it('should create npm config when useLocalWorkspace is false', () => { + const options = { + useLocalWorkspace: false, + inputPath: '/input', + outputPath: '/output' + } + const logger = { log: sinon.stub() } + + const config = createConnectorViteConfig(options, logger) + + expect(config).to.have.property('build') + expect(logger.log).to.have.been.calledWith('[ViteConfigBuilder] Using npm registry configuration (default)') + }) + }) + + describe('recursive directory copying', () => { + it('should handle nested directories when copying to target directory', async () => { + const outputPath = '/output' + const targetDir = '/target' + + manifestStub.resolves() + + fsStubs.existsSync + .withArgs(sinon.match.string).returns(false) // default + .withArgs(sinon.match(/output/)).returns(true) + + fsStubs.readdirSync + .withArgs(sinon.match(/output/)).returns(['subdir', 'file.js']) + .withArgs(sinon.match(/subdir/)).returns(['nested.js']) + + fsStubs.statSync + .withArgs(sinon.match(/subdir/)).returns({ isDirectory: () => true }) + .withArgs(sinon.match(/file\.js/)).returns({ isDirectory: () => false }) + .withArgs(sinon.match(/nested\.js/)).returns({ isDirectory: () => false }) + + fsStubs.mkdirSync.returns(undefined) + fsStubs.copyFileSync.returns(undefined) + + const config = ViteConfigBuilder.createConfig({ + useLocalWorkspace: true, + inputPath: '/input', + outputPath, + mode: 'development', + targetDir + }, { log: () => {} }) + + const manifestPlugin = config.build.rollupOptions.plugins.find( + (p: any) => p.name === 'generate-manifest' + ) + + await manifestPlugin.writeBundle() + + expect(fsStubs.mkdirSync).to.have.been.calledWith(sinon.match(/target/), { recursive: true }) + expect(fsStubs.mkdirSync).to.have.been.calledWith(sinon.match(/target.*subdir/), { recursive: true }) + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/file\.js/), sinon.match(/file\.js/)) + expect(fsStubs.copyFileSync).to.have.been.calledWith(sinon.match(/nested\.js/), sinon.match(/nested\.js/)) + }) + }) +}) diff --git a/packages/zcli-connectors/src/lib/vite/vite-config.ts b/packages/zcli-connectors/src/lib/vite/vite-config.ts new file mode 100644 index 00000000..619186b5 --- /dev/null +++ b/packages/zcli-connectors/src/lib/vite/vite-config.ts @@ -0,0 +1,243 @@ +import babel from '@rollup/plugin-babel' +import commonjs from '@rollup/plugin-commonjs' +import nodeResolve from '@rollup/plugin-node-resolve' +import { existsSync, copyFileSync, mkdirSync, readdirSync, statSync } from 'fs' +import { join } from 'path' +import { ManifestGenerator } from '../manifest-generator/generator' + +export interface ViteConfigOptions { + useLocalWorkspace: boolean; + inputPath: string; + outputPath: string; + watch?: boolean; + mode?: string; + targetDir?: string; +} + +// Minimal Vite config interface +interface ViteUserConfig { + build: { + watch: boolean | object + target: string; + lib: { + entry: string; + fileName: string; + formats: string[]; + }; + outDir: string; + minify: false; + rollupOptions: { + plugins: any[]; + external: (id: string) => boolean; + output: { + inlineDynamicImports: boolean; + format: string; + }; + }; + }; +} + +export class ViteConfigBuilder { + private static createBabelPlugin () { + return babel({ + babelHelpers: 'bundled', + presets: [ + ['@babel/preset-env', { targets: { ie: '11' }, modules: false }] + ], + extensions: ['.js', '.ts'] + }) + } + + /** + * Creates a plugin to copy assets and translations + */ + private static createAssetCopyPlugin (inputPath: string, outputPath: string) { + const copyDirRecursive = (src: string, dest: string) => { + if (!existsSync(dest)) { + mkdirSync(dest, { recursive: true }) + } + + const items = readdirSync(src) + for (const item of items) { + const srcPath = join(src, item) + const destPath = join(dest, item) + + if (statSync(srcPath).isDirectory()) { + copyDirRecursive(srcPath, destPath) + } else { + copyFileSync(srcPath, destPath) + } + } + } + + return { + name: 'copy-assets-translations', + writeBundle () { + // Copy assets + const assetsDir = join(inputPath, 'src/assets') + if (existsSync(assetsDir)) { + const targetAssetsDir = join(outputPath, 'assets') + copyDirRecursive(assetsDir, targetAssetsDir) + } + + // Copy translations + const translationsDir = join(inputPath, 'src/translations') + if (existsSync(translationsDir)) { + const targetTranslationsDir = join(outputPath, 'translations') + copyDirRecursive(translationsDir, targetTranslationsDir) + } + } + } + } + + /** + * Creates a plugin to generate manifest.json + */ + private static createManifestPlugin ( + outputPath: string, + mode = 'production', + targetDir?: string + ) { + return { + name: 'generate-manifest', + async writeBundle () { + try { + await ManifestGenerator.generateManifest({ + outputPath + }) + + // Copy to custom target directory after manifest is generated + if (mode === 'development' && targetDir) { + if (!existsSync(targetDir)) { + mkdirSync(targetDir, { recursive: true }) + } + const copyDirRecursive = (src: string, dest: string) => { + if (!existsSync(dest)) { + mkdirSync(dest, { recursive: true }) + } + + const items = readdirSync(src) + for (const item of items) { + const srcPath = join(src, item) + const destPath = join(dest, item) + + if (statSync(srcPath).isDirectory()) { + copyDirRecursive(srcPath, destPath) + } else { + copyFileSync(srcPath, destPath) + } + } + } + copyDirRecursive(outputPath, targetDir) + } + } catch (error) { + console.error('Failed to generate manifest:', error) + throw error + } + } + } + } + + private static createBaseConfig ( + outputPath: string, + plugins: any[], + externalFn: (id: string) => boolean, + watch?: boolean + ): ViteUserConfig { + return { + build: { + watch: watch ? {} : false, + target: 'es2015', + lib: { + entry: 'src/index.ts', + fileName: 'connector', + formats: ['cjs'] + }, + outDir: outputPath, + minify: false, + rollupOptions: { + plugins, + external: externalFn, + output: { + inlineDynamicImports: true, + format: 'cjs' + } + } + } + } + } + + private static createLocalConfig (options: ViteConfigOptions): ViteUserConfig { + const { inputPath, outputPath, mode, targetDir } = options + + const plugins = [ + nodeResolve({ + extensions: ['.js', '.ts', '.mjs'], + preferBuiltins: true, + exportConditions: ['node'] + }), + commonjs(), + this.createBabelPlugin(), + this.createAssetCopyPlugin(inputPath, outputPath), + this.createManifestPlugin(outputPath, mode, targetDir) + ] + + const external = (id: string) => { + if (id.includes('@zendesk/connector-sdk') || id.includes('core')) { + return false + } + + return !id.startsWith('.') && !id.startsWith('/') && !id.includes('\\') + } + + return this.createBaseConfig(outputPath, plugins, external, options.watch) + } + + private static createNpmConfig (options: ViteConfigOptions): ViteUserConfig { + const { inputPath, outputPath, mode, targetDir } = options + // For npm mode, we only need babel - no nodeResolve or commonjs + const plugins = [ + this.createBabelPlugin(), + this.createAssetCopyPlugin(inputPath, outputPath), + this.createManifestPlugin(outputPath, mode, targetDir) + ] + + const external = (id: string) => { + if (id.includes('@zendesk/connector-sdk') || id.includes('core')) { + return false + } + + return !id.startsWith('.') && !id.startsWith('/') && !id.includes('\\') + } + + return this.createBaseConfig(outputPath, plugins, external, options.watch) + } + + /** + * Main config creation method - uses flag to determine which config to use + */ + static createConfig ( + options: ViteConfigOptions, + logger: { log: (message: string) => void } + ): ViteUserConfig { + const useLocal = options.useLocalWorkspace === true + + if (useLocal) { + logger.log('[ViteConfigBuilder] Using local workspace configuration') + return this.createLocalConfig(options) + } else { + logger.log( + '[ViteConfigBuilder] Using npm registry configuration (default)' + ) + return this.createNpmConfig(options) + } + } +} + +// Export a helper function to create Vite config +export function createConnectorViteConfig ( + options: ViteConfigOptions, + logger: { log: (message: string) => void } +): ViteUserConfig { + return ViteConfigBuilder.createConfig(options, logger) +} diff --git a/packages/zcli-connectors/src/lib/vite/vite-runner.test.ts b/packages/zcli-connectors/src/lib/vite/vite-runner.test.ts new file mode 100644 index 00000000..8cd41710 --- /dev/null +++ b/packages/zcli-connectors/src/lib/vite/vite-runner.test.ts @@ -0,0 +1,189 @@ +/* eslint-disable no-unused-expressions */ + +import { expect, use } from 'chai' +import * as sinon from 'sinon' +import sinonChai from 'sinon-chai' + +use(sinonChai) + +// Simple mock implementation that mimics ViteRunner behavior +class MockViteRunner { + static async run (config: any) { + const buildStub = MockViteRunner._buildStub + + try { + if (buildStub) { + await buildStub(config) + } + + return { + hasErrors: () => false, + hasWarnings: () => false, + toJson: () => ({ + errors: [], + warnings: [], + assets: [] + }) + } + } catch (error: any) { + console.error('Vite build failed:', error) + + return { + hasErrors: () => true, + hasWarnings: () => false, + toJson: () => ({ + errors: [{ message: error instanceof Error ? error.message : String(error) }], + warnings: [], + assets: [] + }) + } + } + } + + static _buildStub: sinon.SinonStub | null = null +} + +describe('ViteRunner', () => { + describe('run', () => { + let consoleErrorStub: sinon.SinonStub + let buildStub: sinon.SinonStub + + beforeEach(() => { + consoleErrorStub = sinon.stub(console, 'error') + buildStub = sinon.stub() + MockViteRunner._buildStub = buildStub + }) + + afterEach(() => { + sinon.restore() + MockViteRunner._buildStub = null + }) + + const mockConfig = { + build: { + lib: { entry: 'src/index.ts' }, + outDir: '/output' + } + } + + it('should run build successfully and return success stats', async () => { + buildStub.resolves() + + const result = await MockViteRunner.run(mockConfig) + + expect(buildStub).to.have.been.calledOnceWith(mockConfig) + expect(result.toJson()).to.deep.equal({ + errors: [], + warnings: [], + assets: [] + }) + }) + + it('should handle build errors and return error stats', async () => { + const buildError = new Error('Build failed') + buildStub.rejects(buildError) + + const result = await MockViteRunner.run(mockConfig) + + expect(buildStub).to.have.been.calledOnceWith(mockConfig) + expect(result.toJson()).to.deep.equal({ + errors: [{ message: 'Build failed' }], + warnings: [], + assets: [] + }) + expect(consoleErrorStub).to.have.been.calledWith('Vite build failed:', buildError) + }) + + it('should return object with required methods', async () => { + buildStub.resolves() + + const result = await MockViteRunner.run(mockConfig) + + expect(result).to.be.an('object') + expect(result).to.have.property('hasErrors').that.is.a('function') + expect(result).to.have.property('hasWarnings').that.is.a('function') + expect(result).to.have.property('toJson').that.is.a('function') + }) + + it('should call hasErrors and return false on successful build', async () => { + buildStub.resolves() + + const result = await MockViteRunner.run(mockConfig) + + expect(result.hasErrors()).to.be.false + }) + + it('should call hasWarnings and return false on successful build', async () => { + buildStub.resolves() + + const result = await MockViteRunner.run(mockConfig) + + expect(result.hasWarnings()).to.be.false + }) + + it('should call hasErrors and return true when build fails', async () => { + const buildError = new Error('Build failed') + buildStub.rejects(buildError) + + const result = await MockViteRunner.run(mockConfig) + + expect(result.hasErrors()).to.be.true + }) + + it('should call hasWarnings and return false when build fails', async () => { + const buildError = new Error('Build failed') + buildStub.rejects(buildError) + + const result = await MockViteRunner.run(mockConfig) + + expect(result.hasWarnings()).to.be.false + }) + + it('should handle Error object in catch block and extract message', async () => { + const errorMessage = 'Detailed build error' + const buildError = new Error(errorMessage) + buildStub.rejects(buildError) + + const result = await MockViteRunner.run(mockConfig) + + const json = result.toJson() + expect(json.errors).to.have.length(1) + expect(json.errors[0].message).to.equal(errorMessage) + }) + + it('should handle non-Error objects in catch block and convert to string', async () => { + const buildError = { code: 'BUILD_FAILED', details: 'Something went wrong' } + buildStub.rejects(buildError) + + const result = await MockViteRunner.run(mockConfig) + + const json = result.toJson() + expect(json.errors).to.have.length(1) + expect(json.errors[0].message).to.equal('[object Object]') + }) + + it('should return consistent structure for successful builds', async () => { + buildStub.resolves() + + const result = await MockViteRunner.run(mockConfig) + const json = result.toJson() + + expect(json).to.have.all.keys('errors', 'warnings', 'assets') + expect(json.errors).to.be.an('array').that.is.empty + expect(json.warnings).to.be.an('array').that.is.empty + expect(json.assets).to.be.an('array').that.is.empty + }) + + it('should return consistent structure for failed builds', async () => { + buildStub.rejects(new Error('test')) + + const result = await MockViteRunner.run(mockConfig) + const json = result.toJson() + + expect(json).to.have.all.keys('errors', 'warnings', 'assets') + expect(json.errors).to.be.an('array').with.length(1) + expect(json.warnings).to.be.an('array').that.is.empty + expect(json.assets).to.be.an('array').that.is.empty + }) + }) +}) diff --git a/packages/zcli-connectors/src/lib/vite/vite-runner.ts b/packages/zcli-connectors/src/lib/vite/vite-runner.ts new file mode 100644 index 00000000..6ba41494 --- /dev/null +++ b/packages/zcli-connectors/src/lib/vite/vite-runner.ts @@ -0,0 +1,43 @@ +import { ViteConfigBuilder } from './vite-config' + +export class ViteRunner { + static async run (config: any): Promise<{ + hasErrors: () => boolean; + hasWarnings: () => boolean; + toJson: () => any; + }> { + try { + // Dynamic import to avoid requiring vite at startup + const { build } = await import('vite') + + await build(config) + + return { + hasErrors: () => false, // Vite throws on errors, so if we reach here, no errors + hasWarnings: () => false, + toJson: () => ({ + errors: [], + warnings: [], + assets: [] + }) + } + } catch (error) { + console.error('Vite build failed:', error) + + // Return error stats + return { + hasErrors: () => true, + hasWarnings: () => false, + toJson: () => ({ + errors: [ + { message: error instanceof Error ? error.message : String(error) } + ], + warnings: [], + assets: [] + }) + } + } + } +} + +export { ViteConfigBuilder } diff --git a/packages/zcli-connectors/tests/functional/bundle.test.ts b/packages/zcli-connectors/tests/functional/bundle.test.ts index e067a7b7..da3bdabe 100644 --- a/packages/zcli-connectors/tests/functional/bundle.test.ts +++ b/packages/zcli-connectors/tests/functional/bundle.test.ts @@ -1,20 +1,163 @@ -import { test } from '@oclif/test' +/* eslint-disable no-unused-expressions */ + +import { expect, use } from 'chai' +import * as sinon from 'sinon' +import sinonChai from 'sinon-chai' +import * as fs from 'fs' import BundleCommand from '../../src/commands/connectors/bundle' +import { ViteConfigBuilder, ViteRunner } from '../../src/lib/vite' + +use(sinonChai) describe('bundle', () => { - describe('with default directory', () => { - test - .it('should run bundle command with default directory', async () => { - await BundleCommand.run(['.']) - // Test passes if no error is thrown + let fsStubs: any + let viteStubs: any + let bundleCommand: BundleCommand + let logStub: sinon.SinonStub + + beforeEach(() => { + fsStubs = { + existsSync: sinon.stub(fs, 'existsSync').returns(true), + mkdirSync: sinon.stub(fs, 'mkdirSync') + } + + viteStubs = { + createConfig: sinon.stub(ViteConfigBuilder, 'createConfig').returns({ + build: { + watch: false, + target: '', + lib: { + entry: '', + fileName: '', + formats: [] + }, + outDir: '', + minify: false, + rollupOptions: { + plugins: [], + external: function (id: string): boolean { + throw new Error('Function not implemented.') + }, + output: { + inlineDynamicImports: false, + format: '' + } + } + } + }), + run: sinon.stub(ViteRunner, 'run').resolves({ + hasErrors: () => false, + hasWarnings: () => false, + toJson: () => ({ errors: [], warnings: [], assets: [] }) }) + } + + sinon.stub(console, 'log') + + // Create a command instance and stub the parse method + bundleCommand = new BundleCommand([], {} as any) + sinon.stub(bundleCommand, 'parse' as any).resolves({ + args: { path: '.' }, + flags: { output: undefined, watch: false, verbose: false } + }) + logStub = sinon.stub(bundleCommand, 'log') + }) + + afterEach(() => { + sinon.restore() }) - describe('with custom directory', () => { - test - .it('should run bundle command with custom directory', async () => { - await BundleCommand.run(['./custom']) - // Test passes if no error is thrown + it('should run bundle command successfully', async () => { + await bundleCommand.run() + + expect(viteStubs.createConfig).to.have.been.called + expect(viteStubs.run).to.have.been.called + }) + + it('should create output directory if it does not exist', async () => { + fsStubs.existsSync.returns(false) + + await bundleCommand.run() + + expect(fsStubs.mkdirSync).to.have.been.called + }) + + it('should handle build errors', async () => { + viteStubs.run.resolves({ + hasErrors: () => true, + hasWarnings: () => false, + toJson: () => ({ + errors: [{ message: 'Build failed' }], + warnings: [], + assets: [] }) + }) + + try { + await bundleCommand.run() + expect.fail('Should have thrown an error') + } catch (error) { + expect(error).to.be.instanceOf(Error) + expect(logStub).to.have.been.calledWith(sinon.match(/Build failed/)) + } + }) + + it('should handle build warnings', async () => { + viteStubs.run.resolves({ + hasErrors: () => false, + hasWarnings: () => true, + toJson: () => ({ + errors: [], + warnings: [{ message: 'Warning message' }], + assets: [] + }) + }) + + await bundleCommand.run() + expect(logStub).to.have.been.calledWith(sinon.match(/Warning message/)) + }) + + it('should handle exceptions', async () => { + const testError = new Error('Test error') + viteStubs.run.rejects(testError) + + try { + await bundleCommand.run() + } catch (error) { + expect(error).to.equal(testError) + } + }) + + it('should pass correct config to ViteConfigBuilder', async () => { + (bundleCommand as any).parse = sinon.stub().resolves({ + args: { path: './test-dir' }, + flags: { output: './output', watch: false, verbose: false } + }) + + await bundleCommand.run() + + expect(viteStubs.createConfig).to.have.been.calledWith( + sinon.match({ + useLocalWorkspace: false, + watch: false + }), + sinon.match.any + ) + }) + + it('should enable watch mode', async () => { + (bundleCommand as any).parse = sinon.stub().resolves({ + args: { path: '.' }, + flags: { output: undefined, watch: true, verbose: false } + }) + + await bundleCommand.run() + + expect(viteStubs.createConfig).to.have.been.calledWith( + sinon.match({ + watch: true + }), + sinon.match.any + ) }) }) diff --git a/packages/zcli-connectors/tsconfig.json b/packages/zcli-connectors/tsconfig.json index e749a317..af350b41 100644 --- a/packages/zcli-connectors/tsconfig.json +++ b/packages/zcli-connectors/tsconfig.json @@ -8,7 +8,6 @@ "strict": true, "target": "es2017", "skipLibCheck": true, - "esModuleInterop": true }, "include": [ "src/**/*" diff --git a/packages/zcli-core/src/lib/config.test.ts b/packages/zcli-core/src/lib/config.test.ts index 56ba2f0f..4b7a2b08 100644 --- a/packages/zcli-core/src/lib/config.test.ts +++ b/packages/zcli-core/src/lib/config.test.ts @@ -5,15 +5,20 @@ import Config from './config' describe('Config', () => { describe('ensureConfigFile', () => { - const outputJsonStub = sinon.stub(fs, 'outputJson').resolves() - const config = new Config() + let outputJsonStub: sinon.SinonStub - beforeEach(() => outputJsonStub.reset()) + beforeEach(() => { + outputJsonStub = sinon.stub(fs, 'outputJson').resolves() + }) + + afterEach(() => { + sinon.restore() + }) test .stub(fs, 'pathExists', () => Promise.resolve(true)) - .stub(fs, 'outputJson', () => outputJsonStub) .it('should not create file, if file exists', async () => { + const config = new Config() await config.ensureConfigFile() expect(outputJsonStub.called).to.equal(false) }) @@ -21,57 +26,61 @@ describe('Config', () => { test .stub(fs, 'pathExists', () => Promise.resolve(false)) .it('should create file, if file does not exists', async () => { + const config = new Config() await config.ensureConfigFile() expect(outputJsonStub.called).to.equal(true) }) }) describe('getConfig', () => { - const config = new Config() const mockConfig = { foo: 'bar' } test - .stub(config, 'ensureConfigFile', () => Promise.resolve()) + .stub(fs, 'pathExists', () => Promise.resolve(true)) .stub(fs, 'readJson', () => Promise.resolve(mockConfig)) .it('should read file and return config key', async () => { + const config = new Config() expect(await config.getConfig('foo')).to.equal('bar') }) test - .stub(config, 'ensureConfigFile', () => Promise.resolve()) + .stub(fs, 'pathExists', () => Promise.resolve(true)) .stub(fs, 'readJson', () => Promise.resolve()) .it('should read file and return undefined if key not found', async () => { + const config = new Config() expect(await config.getConfig('zoo')).to.equal(undefined) }) }) describe('setConfig', () => { - const config = new Config() let mockConfig: object = { foo: 'bar' } test - .stub(config, 'ensureConfigFile', () => Promise.resolve()) + .stub(fs, 'pathExists', () => Promise.resolve(true)) .stub(fs, 'readJson', () => Promise.resolve(mockConfig)) .stub(fs, 'outputJson', (...args) => { mockConfig = (args as object[])[1] + return Promise.resolve() }) .it('should update config with new key value', async () => { + const config = new Config() await config.setConfig('zoo', 'baz') expect(mockConfig).to.deep.equal({ foo: 'bar', zoo: 'baz' }) }) }) describe('removeConfig', () => { - const config = new Config() let mockConfig: object = { foo: 'bar', zoo: 'baz' } test - .stub(config, 'ensureConfigFile', () => Promise.resolve()) + .stub(fs, 'pathExists', () => Promise.resolve(true)) .stub(fs, 'readJson', () => Promise.resolve(mockConfig)) .stub(fs, 'outputJson', (...args) => { mockConfig = (args as object[])[1] + return Promise.resolve() }) .it('should remove key value from config', async () => { + const config = new Config() await config.removeConfig('foo') expect(mockConfig).to.deep.equal({ zoo: 'baz' }) }) diff --git a/yarn.lock b/yarn.lock index e4bfadbb..5176e813 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,6 +19,15 @@ js-tokens "^4.0.0" picocolors "^1.0.0" +"@babel/code-frame@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" + integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== + dependencies: + "@babel/helper-validator-identifier" "^7.28.5" + js-tokens "^4.0.0" + picocolors "^1.1.1" + "@babel/compat-data@^7.26.8": version "7.26.8" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.8.tgz#821c1d35641c355284d4a870b8a4a7b0c141e367" @@ -65,6 +74,17 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" +"@babel/generator@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" + integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== + dependencies: + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/gen-mapping" "^0.3.12" + "@jridgewell/trace-mapping" "^0.3.28" + jsesc "^3.0.2" + "@babel/helper-compilation-targets@^7.26.5": version "7.27.0" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz#de0c753b1cd1d9ab55d473c5a5cf7170f0a81880" @@ -76,6 +96,19 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-globals@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" + integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== + +"@babel/helper-module-imports@^7.18.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" + integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== + dependencies: + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" + "@babel/helper-module-imports@^7.25.9": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" @@ -98,11 +131,21 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.25.9": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== +"@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== + "@babel/helper-validator-option@^7.25.9": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" @@ -123,6 +166,13 @@ dependencies: "@babel/types" "^7.27.0" +"@babel/parser@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" + integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== + dependencies: + "@babel/types" "^7.28.6" + "@babel/template@^7.26.9", "@babel/template@^7.27.0": version "7.27.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.27.0.tgz#b253e5406cc1df1c57dcd18f11760c2dbf40c0b4" @@ -132,6 +182,15 @@ "@babel/parser" "^7.27.0" "@babel/types" "^7.27.0" +"@babel/template@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" + integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + "@babel/traverse@^7.25.9", "@babel/traverse@^7.26.10": version "7.27.0" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.27.0.tgz#11d7e644779e166c0442f9a07274d02cd91d4a70" @@ -145,6 +204,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" + integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" + debug "^4.3.1" + "@babel/types@^7.25.9", "@babel/types@^7.26.10", "@babel/types@^7.27.0": version "7.27.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.27.0.tgz#ef9acb6b06c3173f6632d993ecb6d4ae470b4559" @@ -153,6 +225,14 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" +"@babel/types@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" + integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== + dependencies: + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -160,6 +240,136 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@esbuild/aix-ppc64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz#80fcbe36130e58b7670511e888b8e88a259ed76c" + integrity sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA== + +"@esbuild/android-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz#8aa4965f8d0a7982dc21734bf6601323a66da752" + integrity sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg== + +"@esbuild/android-arm@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz#300712101f7f50f1d2627a162e6e09b109b6767a" + integrity sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg== + +"@esbuild/android-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz#87dfb27161202bdc958ef48bb61b09c758faee16" + integrity sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg== + +"@esbuild/darwin-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz#79197898ec1ff745d21c071e1c7cc3c802f0c1fd" + integrity sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg== + +"@esbuild/darwin-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz#146400a8562133f45c4d2eadcf37ddd09718079e" + integrity sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA== + +"@esbuild/freebsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz#1c5f9ba7206e158fd2b24c59fa2d2c8bb47ca0fe" + integrity sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg== + +"@esbuild/freebsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz#ea631f4a36beaac4b9279fa0fcc6ca29eaeeb2b3" + integrity sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ== + +"@esbuild/linux-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz#e1066bce58394f1b1141deec8557a5f0a22f5977" + integrity sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ== + +"@esbuild/linux-arm@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz#452cd66b20932d08bdc53a8b61c0e30baf4348b9" + integrity sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw== + +"@esbuild/linux-ia32@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz#b24f8acc45bcf54192c7f2f3be1b53e6551eafe0" + integrity sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA== + +"@esbuild/linux-loong64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz#f9cfffa7fc8322571fbc4c8b3268caf15bd81ad0" + integrity sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng== + +"@esbuild/linux-mips64el@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz#575a14bd74644ffab891adc7d7e60d275296f2cd" + integrity sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw== + +"@esbuild/linux-ppc64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz#75b99c70a95fbd5f7739d7692befe60601591869" + integrity sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA== + +"@esbuild/linux-riscv64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz#2e3259440321a44e79ddf7535c325057da875cd6" + integrity sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w== + +"@esbuild/linux-s390x@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz#17676cabbfe5928da5b2a0d6df5d58cd08db2663" + integrity sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg== + +"@esbuild/linux-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz#0583775685ca82066d04c3507f09524d3cd7a306" + integrity sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw== + +"@esbuild/netbsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz#f04c4049cb2e252fe96b16fed90f70746b13f4a4" + integrity sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg== + +"@esbuild/netbsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz#77da0d0a0d826d7c921eea3d40292548b258a076" + integrity sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ== + +"@esbuild/openbsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz#6296f5867aedef28a81b22ab2009c786a952dccd" + integrity sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A== + +"@esbuild/openbsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz#f8d23303360e27b16cf065b23bbff43c14142679" + integrity sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw== + +"@esbuild/openharmony-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz#49e0b768744a3924be0d7fd97dd6ce9b2923d88d" + integrity sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg== + +"@esbuild/sunos-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz#a6ed7d6778d67e528c81fb165b23f4911b9b13d6" + integrity sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w== + +"@esbuild/win32-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz#9ac14c378e1b653af17d08e7d3ce34caef587323" + integrity sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg== + +"@esbuild/win32-ia32@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz#918942dcbbb35cc14fca39afb91b5e6a3d127267" + integrity sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ== + +"@esbuild/win32-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz#9bdad8176be7811ad148d1f8772359041f46c6c5" + integrity sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA== + "@eslint/eslintrc@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" @@ -232,6 +442,14 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== +"@jridgewell/gen-mapping@^0.3.12": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/gen-mapping@^0.3.5": version "0.3.8" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" @@ -256,6 +474,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== +"@jridgewell/sourcemap-codec@^1.5.0", "@jridgewell/sourcemap-codec@^1.5.5": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" @@ -272,6 +495,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.28": + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@lerna/add@5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-5.6.2.tgz#d0e25fd4900b6f8a9548f940cc016ce8a3e2d2ba" @@ -1498,6 +1729,171 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@rollup/plugin-babel@^6.0.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-6.1.0.tgz#5766913722057f28a56365bb6c1ca61306c7e527" + integrity sha512-dFZNuFD2YRcoomP4oYf+DvQNSUA9ih+A3vUqopQx5EdtPGo3WBnQcI/S8pwpz91UsGfL0HsMSOlaMld8HrbubA== + dependencies: + "@babel/helper-module-imports" "^7.18.6" + "@rollup/pluginutils" "^5.0.1" + +"@rollup/plugin-commonjs@^25.0.0": + version "25.0.8" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.8.tgz#c77e608ab112a666b7f2a6bea625c73224f7dd34" + integrity sha512-ZEZWTK5n6Qde0to4vS9Mr5x/0UZoqCxPVR9KRUjU4kA2sO7GEUn1fop0DAwpO6z0Nw/kJON9bDmSxdWxO/TT1A== + 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.30.3" + +"@rollup/plugin-node-resolve@^15.0.0": + version "15.3.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.3.1.tgz#66008953c2524be786aa319d49e32f2128296a78" + integrity sha512-tgg6b91pAybXHJQMAAwW9VuWBO6Thi+q7BCNARLwSqlmsHz0XYURtGvh/AuwSADXSI4h/2uHbs7s4FzlZDGSGA== + dependencies: + "@rollup/pluginutils" "^5.0.1" + "@types/resolve" "1.20.2" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.22.1" + +"@rollup/pluginutils@^5.0.1": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.3.0.tgz#57ba1b0cbda8e7a3c597a4853c807b156e21a7b4" + integrity sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^4.0.2" + +"@rollup/rollup-android-arm-eabi@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz#76e0fef6533b3ce313f969879e61e8f21f0eeb28" + integrity sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg== + +"@rollup/rollup-android-arm64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz#d3cfc675a40bbdec97bda6d7fe3b3b05f0e1cd93" + integrity sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg== + +"@rollup/rollup-darwin-arm64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz#eb912b8f59dd47c77b3c50a78489013b1d6772b4" + integrity sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg== + +"@rollup/rollup-darwin-x64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz#e7d0839fdfd1276a1d34bc5ebbbd0dfd7d0b81a0" + integrity sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ== + +"@rollup/rollup-freebsd-arm64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.55.1.tgz#7ff8118760f7351e48fd0cd3717ff80543d6aac8" + integrity sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg== + +"@rollup/rollup-freebsd-x64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.55.1.tgz#49d330dadbda1d4e9b86b4a3951b59928a9489a9" + integrity sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw== + +"@rollup/rollup-linux-arm-gnueabihf@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.55.1.tgz#98c5f1f8b9776b4a36e466e2a1c9ed1ba52ef1b6" + integrity sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ== + +"@rollup/rollup-linux-arm-musleabihf@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.55.1.tgz#b9acecd3672e742f70b0c8a94075c816a91ff040" + integrity sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg== + +"@rollup/rollup-linux-arm64-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.55.1.tgz#7a6ab06651bc29e18b09a50ed1a02bc972977c9b" + integrity sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ== + +"@rollup/rollup-linux-arm64-musl@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.55.1.tgz#3c8c9072ba4a4d4ef1156b85ab9a2cbb57c1fad0" + integrity sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA== + +"@rollup/rollup-linux-loong64-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.55.1.tgz#17a7af13530f4e4a7b12cd26276c54307a84a8b0" + integrity sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g== + +"@rollup/rollup-linux-loong64-musl@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.55.1.tgz#5cd7a900fd7b077ecd753e34a9b7ff1157fe70c1" + integrity sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw== + +"@rollup/rollup-linux-ppc64-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.55.1.tgz#03a097e70243ddf1c07b59d3c20f38e6f6800539" + integrity sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw== + +"@rollup/rollup-linux-ppc64-musl@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.55.1.tgz#a5389873039d4650f35b4fa060d286392eb21a94" + integrity sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw== + +"@rollup/rollup-linux-riscv64-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.55.1.tgz#789e60e7d6e2b76132d001ffb24ba80007fb17d0" + integrity sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw== + +"@rollup/rollup-linux-riscv64-musl@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.55.1.tgz#3556fa88d139282e9a73c337c9a170f3c5fe7aa4" + integrity sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg== + +"@rollup/rollup-linux-s390x-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.55.1.tgz#c085995b10143c16747a67f1a5487512b2ff04b2" + integrity sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg== + +"@rollup/rollup-linux-x64-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz#9563a5419dd2604841bad31a39ccfdd2891690fb" + integrity sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg== + +"@rollup/rollup-linux-x64-musl@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.55.1.tgz#691bb06e6269a8959c13476b0cd2aa7458facb31" + integrity sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w== + +"@rollup/rollup-openbsd-x64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.55.1.tgz#223e71224746a59ce6d955bbc403577bb5a8be9d" + integrity sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg== + +"@rollup/rollup-openharmony-arm64@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.55.1.tgz#0817e5d8ecbfeb8b7939bf58f8ce3c9dd67fce77" + integrity sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw== + +"@rollup/rollup-win32-arm64-msvc@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.55.1.tgz#de56d8f2013c84570ef5fb917aae034abda93e4a" + integrity sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g== + +"@rollup/rollup-win32-ia32-msvc@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.55.1.tgz#659aff5244312475aeea2c9479a6c7d397b517bf" + integrity sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA== + +"@rollup/rollup-win32-x64-gnu@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.55.1.tgz#2cb09549cbb66c1b979f9238db6dd454cac14a88" + integrity sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg== + +"@rollup/rollup-win32-x64-msvc@4.55.1": + version "4.55.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.55.1.tgz#f79437939020b83057faf07e98365b1fa51c458b" + integrity sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw== + "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -1595,6 +1991,11 @@ resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== +"@types/estree@*", "@types/estree@1.0.8", "@types/estree@^1.0.0": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + "@types/express-serve-static-core@^4.17.18": version "4.17.29" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz#2a1795ea8e9e9c91b4a4bbe475034b20c1ec711c" @@ -1736,6 +2137,11 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== +"@types/resolve@1.20.2": + version "1.20.2" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" + integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== + "@types/rimraf@^3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.2.tgz#a63d175b331748e5220ad48c901d7bbf1f44eef8" @@ -3094,6 +3500,11 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + default-require-extensions@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-3.0.0.tgz#e03f93aac9b2b6443fc52e5e4a37b3ad9ad8df96" @@ -3405,6 +3816,38 @@ es6-error@^4.0.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== +esbuild@^0.25.0: + version "0.25.12" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.12.tgz#97a1d041f4ab00c2fce2f838d2b9969a2d2a97a5" + integrity sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg== + optionalDependencies: + "@esbuild/aix-ppc64" "0.25.12" + "@esbuild/android-arm" "0.25.12" + "@esbuild/android-arm64" "0.25.12" + "@esbuild/android-x64" "0.25.12" + "@esbuild/darwin-arm64" "0.25.12" + "@esbuild/darwin-x64" "0.25.12" + "@esbuild/freebsd-arm64" "0.25.12" + "@esbuild/freebsd-x64" "0.25.12" + "@esbuild/linux-arm" "0.25.12" + "@esbuild/linux-arm64" "0.25.12" + "@esbuild/linux-ia32" "0.25.12" + "@esbuild/linux-loong64" "0.25.12" + "@esbuild/linux-mips64el" "0.25.12" + "@esbuild/linux-ppc64" "0.25.12" + "@esbuild/linux-riscv64" "0.25.12" + "@esbuild/linux-s390x" "0.25.12" + "@esbuild/linux-x64" "0.25.12" + "@esbuild/netbsd-arm64" "0.25.12" + "@esbuild/netbsd-x64" "0.25.12" + "@esbuild/openbsd-arm64" "0.25.12" + "@esbuild/openbsd-x64" "0.25.12" + "@esbuild/openharmony-arm64" "0.25.12" + "@esbuild/sunos-x64" "0.25.12" + "@esbuild/win32-arm64" "0.25.12" + "@esbuild/win32-ia32" "0.25.12" + "@esbuild/win32-x64" "0.25.12" + escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" @@ -3747,6 +4190,11 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -3898,6 +4346,11 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== + figures@3.2.0, figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -4098,6 +4551,11 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1, function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" @@ -4318,7 +4776,7 @@ glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.0.1, glob@^8.1.0: +glob@^8.0.1, glob@^8.0.3, glob@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== @@ -4742,6 +5200,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.16.1: + version "2.16.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" + integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== + dependencies: + hasown "^2.0.2" + is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" @@ -4788,6 +5253,11 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== + is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" @@ -4832,6 +5302,13 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== +is-reference@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -5404,6 +5881,13 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.13.1.tgz#267a81fbd0881327c46a81c5922606a2cfe336c4" integrity sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ== +magic-string@^0.30.3: + version "0.30.21" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.21.tgz#56763ec09a0fa8091df27879fd94d19078c00d91" + integrity sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.5" + make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -5801,6 +6285,11 @@ mz@^2.4.0: object-assign "^4.0.1" thenify-all "^1.0.0" +nanoid@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" + integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== + napi-build-utils@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" @@ -6592,6 +7081,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.2, picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -6632,6 +7126,15 @@ pluralize@^8.0.0: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== +postcss@^8.5.6: + version "8.5.6" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" + integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg== + dependencies: + nanoid "^3.3.11" + picocolors "^1.1.1" + source-map-js "^1.2.1" + prebuild-install@^7.0.1: version "7.1.1" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" @@ -7010,6 +7513,15 @@ resolve@^1.10.0, resolve@^1.10.1, resolve@^1.20.0, resolve@^1.22.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.22.1: + version "1.22.11" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262" + integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ== + dependencies: + is-core-module "^2.16.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^2.0.0-next.3: version "2.0.0-next.4" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" @@ -7044,6 +7556,40 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rollup@^4.43.0: + version "4.55.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.55.1.tgz#4ec182828be440648e7ee6520dc35e9f20e05144" + integrity sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A== + dependencies: + "@types/estree" "1.0.8" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.55.1" + "@rollup/rollup-android-arm64" "4.55.1" + "@rollup/rollup-darwin-arm64" "4.55.1" + "@rollup/rollup-darwin-x64" "4.55.1" + "@rollup/rollup-freebsd-arm64" "4.55.1" + "@rollup/rollup-freebsd-x64" "4.55.1" + "@rollup/rollup-linux-arm-gnueabihf" "4.55.1" + "@rollup/rollup-linux-arm-musleabihf" "4.55.1" + "@rollup/rollup-linux-arm64-gnu" "4.55.1" + "@rollup/rollup-linux-arm64-musl" "4.55.1" + "@rollup/rollup-linux-loong64-gnu" "4.55.1" + "@rollup/rollup-linux-loong64-musl" "4.55.1" + "@rollup/rollup-linux-ppc64-gnu" "4.55.1" + "@rollup/rollup-linux-ppc64-musl" "4.55.1" + "@rollup/rollup-linux-riscv64-gnu" "4.55.1" + "@rollup/rollup-linux-riscv64-musl" "4.55.1" + "@rollup/rollup-linux-s390x-gnu" "4.55.1" + "@rollup/rollup-linux-x64-gnu" "4.55.1" + "@rollup/rollup-linux-x64-musl" "4.55.1" + "@rollup/rollup-openbsd-x64" "4.55.1" + "@rollup/rollup-openharmony-arm64" "4.55.1" + "@rollup/rollup-win32-arm64-msvc" "4.55.1" + "@rollup/rollup-win32-ia32-msvc" "4.55.1" + "@rollup/rollup-win32-x64-gnu" "4.55.1" + "@rollup/rollup-win32-x64-msvc" "4.55.1" + fsevents "~2.3.2" + run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" @@ -7257,6 +7803,11 @@ simple-get@^4.0.0: once "^1.3.1" simple-concat "^1.0.0" +sinon-chai@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-4.0.1.tgz#f70000fe0e4f4ab7ceeb3703d3053f8886e0386b" + integrity sha512-xMKEEV3cYHC1G+boyr7QEqi80gHznYsxVdC9CdjP5JnCWz/jPGuXQzJz3PtBcb0CcHAxar15Y5sjLBoAs6a0yA== + sinon@^14.0.0: version "14.0.0" resolved "https://registry.yarnpkg.com/sinon/-/sinon-14.0.0.tgz#203731c116d3a2d58dc4e3cbe1f443ba9382a031" @@ -7329,6 +7880,11 @@ sort-object-keys@^1.1.3: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -7715,6 +8271,14 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== +tinyglobby@^0.2.14: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -8009,6 +8573,20 @@ vary@^1, vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +vite@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/vite/-/vite-7.1.3.tgz#8d70cb02fd6346b4bf1329a6760800538ef0faea" + integrity sha512-OOUi5zjkDxYrKhTV3V7iKsoS37VUM7v40+HuwEmcrsf11Cdx9y3DIr2Px6liIcZFwt3XSRpQvFpL3WVy7ApkGw== + dependencies: + esbuild "^0.25.0" + fdir "^6.5.0" + picomatch "^4.0.3" + postcss "^8.5.6" + rollup "^4.43.0" + tinyglobby "^0.2.14" + optionalDependencies: + fsevents "~2.3.3" + walk-up-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-1.0.0.tgz#d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e" From dea5d1c60d3a57cf54e4e371a4078153fdd182d4 Mon Sep 17 00:00:00 2001 From: Sai Kambaiyyagari Date: Fri, 16 Jan 2026 11:01:15 +1100 Subject: [PATCH 3/4] Add codeowners --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1bd5dc71..5adc2c52 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,3 +10,6 @@ # Shared yarn.lock @zendesk/wattle @zendesk/vikings + +# Connectors +/packages/zcli-connectors/ @zendesk/vegemite \ No newline at end of file From 5c56bb47bd77496bc32cc344fc16809629d728a1 Mon Sep 17 00:00:00 2001 From: Sai Kambaiyyagari Date: Mon, 19 Jan 2026 13:52:33 +1100 Subject: [PATCH 4/4] Refactor and structure the code --- .github/CODEOWNERS | 2 +- packages/zcli-connectors/package.json | 6 +- .../src/commands/connectors/bundle.ts | 59 +++- .../lib/manifest-generator/generator.test.ts | 23 +- .../src/lib/manifest-generator/generator.ts | 79 ++++- .../src/lib/vite/vite-config.test.ts | 40 +-- .../src/lib/vite/vite-config.ts | 116 +++--- .../src/lib/vite/vite-runner.test.ts | 189 ---------- .../src/lib/vite/vite-runner.ts | 4 - .../tests/functional/bundle.test.ts | 18 +- packages/zcli-connectors/tsconfig.json | 2 +- yarn.lock | 332 +++++++++--------- 12 files changed, 365 insertions(+), 505 deletions(-) delete mode 100644 packages/zcli-connectors/src/lib/vite/vite-runner.test.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5adc2c52..a5674e87 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,4 +12,4 @@ yarn.lock @zendesk/wattle @zendesk/vikings # Connectors -/packages/zcli-connectors/ @zendesk/vegemite \ No newline at end of file +/packages/zcli-connectors/ @zendesk/vegemite diff --git a/packages/zcli-connectors/package.json b/packages/zcli-connectors/package.json index 28e2fff1..b1ade571 100644 --- a/packages/zcli-connectors/package.json +++ b/packages/zcli-connectors/package.json @@ -24,11 +24,10 @@ "fs-extra": "^10.0.0", "rimraf": "^3.0.2", "tslib": "^2.4.0", - "ora": "^5.4.1", "@rollup/plugin-babel": "^6.0.0", "@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-node-resolve": "^15.0.0", - "vite": "7.1.3" + "vite": "^7.1.3" }, "devDependencies": { "@oclif/test": "=2.1.0", @@ -45,7 +44,8 @@ "lerna": "^5.6.2", "mocha": "^10.8.2", "sinon": "^14.0.0", - "sinon-chai": "^4.0.1" + "sinon-chai": "^4.0.1", + "ora": "^5.4.1" }, "files": [ "/bin", diff --git a/packages/zcli-connectors/src/commands/connectors/bundle.ts b/packages/zcli-connectors/src/commands/connectors/bundle.ts index dc5e1d9a..77add248 100644 --- a/packages/zcli-connectors/src/commands/connectors/bundle.ts +++ b/packages/zcli-connectors/src/commands/connectors/bundle.ts @@ -9,14 +9,14 @@ export default class Bundle extends Command { static examples = [ '<%= config.bin %> <%= command.id %> ./example-connector', '<%= config.bin %> <%= command.id %> ./example-connector --output ./bundled', - '<%= config.bin %> <%= command.id %> --input ./dist --output ./bundle' + '<%= config.bin %> <%= command.id %> --input ./src --output ./bundle' ] static flags = { help: Flags.help({ char: 'h' }), input: Flags.string({ char: 'i', - description: 'input directory containing built connector files', + description: 'input directory containing connector source files', default: '.' }), output: Flags.string({ @@ -38,7 +38,7 @@ export default class Bundle extends Command { static args = [ { name: 'path', - description: 'path to connector directory (will use dist/ folder inside)' + description: 'path to connector directory (will use src/ folder inside)' } ] @@ -55,6 +55,16 @@ export default class Bundle extends Command { const outputPath = flags.output ? resolve(flags.output) : resolve('dist') if (!existsSync(outputPath)) { mkdirSync(outputPath, { recursive: true }) + if (flags.verbose) { + this.log(chalk.cyan(`Created output directory: ${outputPath}`)) + } + } + + if (flags.verbose) { + this.log(chalk.cyan('Verbose mode enabled')) + this.log(chalk.cyan(`Resolved Input path: ${inputPath}`)) + this.log(chalk.cyan(`Resolved Output path: ${outputPath}`)) + this.log(chalk.cyan(`Watch mode: ${flags.watch ? 'enabled' : 'disabled'}`)) } const spinner = ora( @@ -74,30 +84,43 @@ export default class Bundle extends Command { } catch (error) { spinner.fail(chalk.red('Failed to bundle the connector')) - if (error instanceof Error) { + const errorMessage = (error instanceof Error) ? error.message : String(error) + if (flags.verbose) { this.log('\n' + chalk.red('Error Details:')) - this.log(error.message) + this.log(errorMessage) } + + this.error(errorMessage, { exit: 1 }) } } private async generateViteBundle ( inputPath: string, outputPath: string, - flags: { watch: boolean }, + flags: { watch: boolean; verbose: boolean }, spinner: ora.Ora ): Promise { - const { watch } = flags + const { watch, verbose } = flags + + if (verbose) { + this.log(chalk.cyan('Creating Vite configuration...')) + } + const viteConfig = ViteConfigBuilder.createConfig( { inputPath, outputPath, - useLocalWorkspace: false, watch - }, - this + } ) + if (verbose) { + spinner.stop() + this.log(chalk.cyan('Vite configuration created successfully')) + this.log(chalk.cyan('Starting build process...')) + spinner.start() + } + spinner.text = watch ? 'Building connector and watching for changes...' : 'Building connector...' @@ -107,6 +130,7 @@ export default class Bundle extends Command { spinner.fail(chalk.red('Bundle failed with errors!')) const errors = stats.toJson().errors || [] + this.log(chalk.cyan(`Found ${errors.length} error(s)`)) errors.forEach((error: any) => { this.log(chalk.red(`Error: ${error.message}`)) }) @@ -114,12 +138,27 @@ export default class Bundle extends Command { throw new Error('Connector build failed') } + if (verbose) { + const buildInfo = stats.toJson() + if (buildInfo.assets && buildInfo.assets.length > 0) { + this.log(chalk.cyan(`Generated ${buildInfo.assets.length} asset(s)`)) + buildInfo.assets.forEach((asset: any) => { + this.log(chalk.cyan(` - ${asset.name} (${(asset.size / 1024).toFixed(2)} KB)`)) + }) + } + } + if (stats.hasWarnings()) { const warnings = stats.toJson().warnings || [] + if (verbose) { + this.log(chalk.cyan(`Found ${warnings.length} warning(s)`)) + } this.log(chalk.yellow('\nWarnings:')) warnings.forEach((warning: any) => { this.log(chalk.yellow(` - ${warning.message}`)) }) + } else if (verbose) { + this.log(chalk.cyan('No warnings found')) } } } diff --git a/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts b/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts index 6f17c12b..0b77b007 100644 --- a/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts +++ b/packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts @@ -22,7 +22,6 @@ describe('ManifestGenerator', () => { writeFileSyncStub = sinon.stub() joinStub = sinon.stub() - // Mock modules sinon.replace(fs, 'writeFileSync', writeFileSyncStub) sinon.replace(path, 'join', joinStub) @@ -118,8 +117,24 @@ describe('ManifestGenerator', () => { .it('should handle connector module with default export', async () => { await ManifestGenerator.generateManifest({ outputPath: mockOutputPath }) - // eslint-disable-next-line no-unused-expressions - expect(writeFileSyncStub).to.have.been.calledOnce + const expectedManifest = { + name: 'test-connector', + title: 'Test Connector', + description: 'A test connector', + author: 'Test Author', + version: '2.0.0', + platform_version: '1.5.0', + default_locale: 'en-US', + metadata: { + connection_type: 'test-connector' + } + } + + expect(writeFileSyncStub).to.have.been.calledWith( + mockManifestPath, + JSON.stringify(expectedManifest, null, 2), + 'utf-8' + ) }) }) @@ -137,7 +152,7 @@ describe('ManifestGenerator', () => { expect(() => { (ManifestGenerator as any).validateConnector(validConnector) - }).not.to.throw() + }).to.not.throw() }) it('should throw for connector missing name', () => { diff --git a/packages/zcli-connectors/src/lib/manifest-generator/generator.ts b/packages/zcli-connectors/src/lib/manifest-generator/generator.ts index 40052cd3..86e6df95 100644 --- a/packages/zcli-connectors/src/lib/manifest-generator/generator.ts +++ b/packages/zcli-connectors/src/lib/manifest-generator/generator.ts @@ -1,5 +1,5 @@ -import { writeFileSync } from 'fs' -import { join } from 'path' +import { writeFileSync, existsSync, realpathSync } from 'fs' +import { join, resolve, normalize } from 'path' import { ConnectorConfig, @@ -39,13 +39,78 @@ export class ManifestGenerator { private static async loadConnector ( outputPath: string ): Promise { - const indexPath = join(outputPath, 'connector.js') + const normalizedOutputPath = normalize(resolve(outputPath)) + const indexPath = join(normalizedOutputPath, 'connector.js') - // eslint-disable-next-line @typescript-eslint/no-var-requires - const connectorModule = require(indexPath) + const resolvedIndexPath = resolve(indexPath) + const resolvedOutputPath = resolve(normalizedOutputPath) - // Handle both CommonJS (exports.default) and direct exports - return connectorModule.default || connectorModule + if (!resolvedIndexPath.startsWith(resolvedOutputPath + '/') && + resolvedIndexPath !== join(resolvedOutputPath, 'connector.js')) { + throw new Error( + `Security violation: Attempted to load file outside of output directory. Path: ${indexPath}` + ) + } + + if (!existsSync(resolvedIndexPath)) { + throw new Error( + `Connector file not found at ${resolvedIndexPath}. Please ensure the connector has been built successfully.` + ) + } + + let realIndexPath: string + try { + realIndexPath = realpathSync(resolvedIndexPath) + if (!realIndexPath.startsWith(resolvedOutputPath + '/') && + realIndexPath !== join(resolvedOutputPath, 'connector.js')) { + throw new Error( + `Security violation: Real path of connector file is outside output directory. Real path: ${realIndexPath}` + ) + } + } catch (error) { + if (error instanceof Error && error.message.includes('Security violation')) { + throw error + } + throw new Error( + `Failed to resolve real path for ${resolvedIndexPath}: ${error instanceof Error ? error.message : String(error)}` + ) + } + + try { + // Clear module cache to ensure fresh loading + delete require.cache[require.resolve(realIndexPath)] + + // eslint-disable-next-line @typescript-eslint/no-var-requires + const connectorModule = require(realIndexPath) + + // Handle both CommonJS (exports.default) and direct exports + const connector = connectorModule.default || connectorModule + + if (!connector || typeof connector !== 'object') { + throw new Error( + `Invalid connector module at ${realIndexPath}. Expected an object but got ${typeof connector}.` + ) + } + + return connector + } catch (error) { + if (error instanceof Error) { + // Re-throw our custom errors as-is + if (error.message.includes('Connector file not found') || + error.message.includes('Invalid connector module') || + error.message.includes('Security violation')) { + throw error + } + // Wrap other errors with more context + throw new Error( + `Failed to load connector from ${realIndexPath}: ${error.message}` + ) + } + // Handle non-Error objects + throw new Error( + `Failed to load connector from ${realIndexPath}: ${String(error)}` + ) + } } private static writeManifestFile ( diff --git a/packages/zcli-connectors/src/lib/vite/vite-config.test.ts b/packages/zcli-connectors/src/lib/vite/vite-config.test.ts index 4f245ae7..62d9d0c5 100644 --- a/packages/zcli-connectors/src/lib/vite/vite-config.test.ts +++ b/packages/zcli-connectors/src/lib/vite/vite-config.test.ts @@ -58,10 +58,9 @@ describe('ViteConfigBuilder', () => { fsStubs.copyFileSync.returns(undefined) const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath, outputPath - }, { log: () => {} }) + }) const assetPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'copy-assets-translations' @@ -88,10 +87,9 @@ describe('ViteConfigBuilder', () => { fsStubs.existsSync.returns(false) const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath, outputPath - }, { log: () => {} }) + }) const assetPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'copy-assets-translations' @@ -123,12 +121,11 @@ describe('ViteConfigBuilder', () => { fsStubs.copyFileSync.returns(undefined) const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath: '/input', outputPath, mode: 'development', targetDir - }, { log: () => {} }) + }) const manifestPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'generate-manifest' @@ -147,10 +144,9 @@ describe('ViteConfigBuilder', () => { manifestStub.rejects(error) const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath: '/input', outputPath: '/output' - }, { log: () => {} }) + }) const manifestPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'generate-manifest' @@ -169,11 +165,10 @@ describe('ViteConfigBuilder', () => { manifestStub.resolves() const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath: '/input', outputPath: '/output', mode: 'production' - }, { log: () => {} }) + }) const manifestPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'generate-manifest' @@ -190,12 +185,11 @@ describe('ViteConfigBuilder', () => { manifestStub.resolves() const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath: '/input', outputPath: '/output', mode: 'development' // no targetDir - }, { log: () => {} }) + }) const manifestPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'generate-manifest' @@ -212,31 +206,14 @@ describe('ViteConfigBuilder', () => { describe('createConnectorViteConfig helper function', () => { it('should create config using ViteConfigBuilder', () => { const options = { - useLocalWorkspace: true, inputPath: '/input', outputPath: '/output' } - const logger = { log: sinon.stub() } - const config = createConnectorViteConfig(options, logger) + const config = createConnectorViteConfig(options) expect(config).to.have.property('build') expect(config.build).to.have.property('lib') - expect(logger.log).to.have.been.calledWith('[ViteConfigBuilder] Using local workspace configuration') - }) - - it('should create npm config when useLocalWorkspace is false', () => { - const options = { - useLocalWorkspace: false, - inputPath: '/input', - outputPath: '/output' - } - const logger = { log: sinon.stub() } - - const config = createConnectorViteConfig(options, logger) - - expect(config).to.have.property('build') - expect(logger.log).to.have.been.calledWith('[ViteConfigBuilder] Using npm registry configuration (default)') }) }) @@ -264,12 +241,11 @@ describe('ViteConfigBuilder', () => { fsStubs.copyFileSync.returns(undefined) const config = ViteConfigBuilder.createConfig({ - useLocalWorkspace: true, inputPath: '/input', outputPath, mode: 'development', targetDir - }, { log: () => {} }) + }) const manifestPlugin = config.build.rollupOptions.plugins.find( (p: any) => p.name === 'generate-manifest' diff --git a/packages/zcli-connectors/src/lib/vite/vite-config.ts b/packages/zcli-connectors/src/lib/vite/vite-config.ts index 619186b5..0417e430 100644 --- a/packages/zcli-connectors/src/lib/vite/vite-config.ts +++ b/packages/zcli-connectors/src/lib/vite/vite-config.ts @@ -6,7 +6,6 @@ import { join } from 'path' import { ManifestGenerator } from '../manifest-generator/generator' export interface ViteConfigOptions { - useLocalWorkspace: boolean; inputPath: string; outputPath: string; watch?: boolean; @@ -49,27 +48,43 @@ export class ViteConfigBuilder { } /** - * Creates a plugin to copy assets and translations + * Recursively copies a directory from source to destination */ - private static createAssetCopyPlugin (inputPath: string, outputPath: string) { - const copyDirRecursive = (src: string, dest: string) => { - if (!existsSync(dest)) { - mkdirSync(dest, { recursive: true }) - } + private static copyDirRecursive (src: string, dest: string): void { + if (!existsSync(dest)) { + mkdirSync(dest, { recursive: true }) + } - const items = readdirSync(src) - for (const item of items) { - const srcPath = join(src, item) - const destPath = join(dest, item) + const items = readdirSync(src) + for (const item of items) { + const srcPath = join(src, item) + const destPath = join(dest, item) - if (statSync(srcPath).isDirectory()) { - copyDirRecursive(srcPath, destPath) - } else { - copyFileSync(srcPath, destPath) - } + if (statSync(srcPath).isDirectory()) { + this.copyDirRecursive(srcPath, destPath) + } else { + copyFileSync(srcPath, destPath) } } + } + /** + * Creates the external function for determining which modules to bundle + */ + private static createExternalFunction (): (id: string) => boolean { + return (id: string) => { + if (id.includes('@zendesk/connector-sdk')) { + return false + } + + return !id.startsWith('.') && !id.startsWith('/') && !id.includes('\\') + } + } + + /** + * Creates a plugin to copy assets and translations + */ + private static createAssetCopyPlugin (inputPath: string, outputPath: string) { return { name: 'copy-assets-translations', writeBundle () { @@ -77,14 +92,14 @@ export class ViteConfigBuilder { const assetsDir = join(inputPath, 'src/assets') if (existsSync(assetsDir)) { const targetAssetsDir = join(outputPath, 'assets') - copyDirRecursive(assetsDir, targetAssetsDir) + ViteConfigBuilder.copyDirRecursive(assetsDir, targetAssetsDir) } // Copy translations const translationsDir = join(inputPath, 'src/translations') if (existsSync(translationsDir)) { const targetTranslationsDir = join(outputPath, 'translations') - copyDirRecursive(translationsDir, targetTranslationsDir) + ViteConfigBuilder.copyDirRecursive(translationsDir, targetTranslationsDir) } } } @@ -111,24 +126,7 @@ export class ViteConfigBuilder { if (!existsSync(targetDir)) { mkdirSync(targetDir, { recursive: true }) } - const copyDirRecursive = (src: string, dest: string) => { - if (!existsSync(dest)) { - mkdirSync(dest, { recursive: true }) - } - - const items = readdirSync(src) - for (const item of items) { - const srcPath = join(src, item) - const destPath = join(dest, item) - - if (statSync(srcPath).isDirectory()) { - copyDirRecursive(srcPath, destPath) - } else { - copyFileSync(srcPath, destPath) - } - } - } - copyDirRecursive(outputPath, targetDir) + ViteConfigBuilder.copyDirRecursive(outputPath, targetDir) } } catch (error) { console.error('Failed to generate manifest:', error) @@ -139,6 +137,7 @@ export class ViteConfigBuilder { } private static createBaseConfig ( + inputPath: string, outputPath: string, plugins: any[], externalFn: (id: string) => boolean, @@ -149,7 +148,7 @@ export class ViteConfigBuilder { watch: watch ? {} : false, target: 'es2015', lib: { - entry: 'src/index.ts', + entry: join(inputPath, 'src', 'index.ts'), fileName: 'connector', formats: ['cjs'] }, @@ -182,15 +181,9 @@ export class ViteConfigBuilder { this.createManifestPlugin(outputPath, mode, targetDir) ] - const external = (id: string) => { - if (id.includes('@zendesk/connector-sdk') || id.includes('core')) { - return false - } - - return !id.startsWith('.') && !id.startsWith('/') && !id.includes('\\') - } + const external = this.createExternalFunction() - return this.createBaseConfig(outputPath, plugins, external, options.watch) + return this.createBaseConfig(inputPath, outputPath, plugins, external, options.watch) } private static createNpmConfig (options: ViteConfigOptions): ViteUserConfig { @@ -202,42 +195,21 @@ export class ViteConfigBuilder { this.createManifestPlugin(outputPath, mode, targetDir) ] - const external = (id: string) => { - if (id.includes('@zendesk/connector-sdk') || id.includes('core')) { - return false - } - - return !id.startsWith('.') && !id.startsWith('/') && !id.includes('\\') - } + const external = this.createExternalFunction() - return this.createBaseConfig(outputPath, plugins, external, options.watch) + return this.createBaseConfig(inputPath, outputPath, plugins, external, options.watch) } - /** - * Main config creation method - uses flag to determine which config to use - */ static createConfig ( - options: ViteConfigOptions, - logger: { log: (message: string) => void } + options: ViteConfigOptions ): ViteUserConfig { - const useLocal = options.useLocalWorkspace === true - - if (useLocal) { - logger.log('[ViteConfigBuilder] Using local workspace configuration') - return this.createLocalConfig(options) - } else { - logger.log( - '[ViteConfigBuilder] Using npm registry configuration (default)' - ) - return this.createNpmConfig(options) - } + return this.createNpmConfig(options) } } // Export a helper function to create Vite config export function createConnectorViteConfig ( - options: ViteConfigOptions, - logger: { log: (message: string) => void } + options: ViteConfigOptions ): ViteUserConfig { - return ViteConfigBuilder.createConfig(options, logger) + return ViteConfigBuilder.createConfig(options) } diff --git a/packages/zcli-connectors/src/lib/vite/vite-runner.test.ts b/packages/zcli-connectors/src/lib/vite/vite-runner.test.ts deleted file mode 100644 index 8cd41710..00000000 --- a/packages/zcli-connectors/src/lib/vite/vite-runner.test.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* eslint-disable no-unused-expressions */ - -import { expect, use } from 'chai' -import * as sinon from 'sinon' -import sinonChai from 'sinon-chai' - -use(sinonChai) - -// Simple mock implementation that mimics ViteRunner behavior -class MockViteRunner { - static async run (config: any) { - const buildStub = MockViteRunner._buildStub - - try { - if (buildStub) { - await buildStub(config) - } - - return { - hasErrors: () => false, - hasWarnings: () => false, - toJson: () => ({ - errors: [], - warnings: [], - assets: [] - }) - } - } catch (error: any) { - console.error('Vite build failed:', error) - - return { - hasErrors: () => true, - hasWarnings: () => false, - toJson: () => ({ - errors: [{ message: error instanceof Error ? error.message : String(error) }], - warnings: [], - assets: [] - }) - } - } - } - - static _buildStub: sinon.SinonStub | null = null -} - -describe('ViteRunner', () => { - describe('run', () => { - let consoleErrorStub: sinon.SinonStub - let buildStub: sinon.SinonStub - - beforeEach(() => { - consoleErrorStub = sinon.stub(console, 'error') - buildStub = sinon.stub() - MockViteRunner._buildStub = buildStub - }) - - afterEach(() => { - sinon.restore() - MockViteRunner._buildStub = null - }) - - const mockConfig = { - build: { - lib: { entry: 'src/index.ts' }, - outDir: '/output' - } - } - - it('should run build successfully and return success stats', async () => { - buildStub.resolves() - - const result = await MockViteRunner.run(mockConfig) - - expect(buildStub).to.have.been.calledOnceWith(mockConfig) - expect(result.toJson()).to.deep.equal({ - errors: [], - warnings: [], - assets: [] - }) - }) - - it('should handle build errors and return error stats', async () => { - const buildError = new Error('Build failed') - buildStub.rejects(buildError) - - const result = await MockViteRunner.run(mockConfig) - - expect(buildStub).to.have.been.calledOnceWith(mockConfig) - expect(result.toJson()).to.deep.equal({ - errors: [{ message: 'Build failed' }], - warnings: [], - assets: [] - }) - expect(consoleErrorStub).to.have.been.calledWith('Vite build failed:', buildError) - }) - - it('should return object with required methods', async () => { - buildStub.resolves() - - const result = await MockViteRunner.run(mockConfig) - - expect(result).to.be.an('object') - expect(result).to.have.property('hasErrors').that.is.a('function') - expect(result).to.have.property('hasWarnings').that.is.a('function') - expect(result).to.have.property('toJson').that.is.a('function') - }) - - it('should call hasErrors and return false on successful build', async () => { - buildStub.resolves() - - const result = await MockViteRunner.run(mockConfig) - - expect(result.hasErrors()).to.be.false - }) - - it('should call hasWarnings and return false on successful build', async () => { - buildStub.resolves() - - const result = await MockViteRunner.run(mockConfig) - - expect(result.hasWarnings()).to.be.false - }) - - it('should call hasErrors and return true when build fails', async () => { - const buildError = new Error('Build failed') - buildStub.rejects(buildError) - - const result = await MockViteRunner.run(mockConfig) - - expect(result.hasErrors()).to.be.true - }) - - it('should call hasWarnings and return false when build fails', async () => { - const buildError = new Error('Build failed') - buildStub.rejects(buildError) - - const result = await MockViteRunner.run(mockConfig) - - expect(result.hasWarnings()).to.be.false - }) - - it('should handle Error object in catch block and extract message', async () => { - const errorMessage = 'Detailed build error' - const buildError = new Error(errorMessage) - buildStub.rejects(buildError) - - const result = await MockViteRunner.run(mockConfig) - - const json = result.toJson() - expect(json.errors).to.have.length(1) - expect(json.errors[0].message).to.equal(errorMessage) - }) - - it('should handle non-Error objects in catch block and convert to string', async () => { - const buildError = { code: 'BUILD_FAILED', details: 'Something went wrong' } - buildStub.rejects(buildError) - - const result = await MockViteRunner.run(mockConfig) - - const json = result.toJson() - expect(json.errors).to.have.length(1) - expect(json.errors[0].message).to.equal('[object Object]') - }) - - it('should return consistent structure for successful builds', async () => { - buildStub.resolves() - - const result = await MockViteRunner.run(mockConfig) - const json = result.toJson() - - expect(json).to.have.all.keys('errors', 'warnings', 'assets') - expect(json.errors).to.be.an('array').that.is.empty - expect(json.warnings).to.be.an('array').that.is.empty - expect(json.assets).to.be.an('array').that.is.empty - }) - - it('should return consistent structure for failed builds', async () => { - buildStub.rejects(new Error('test')) - - const result = await MockViteRunner.run(mockConfig) - const json = result.toJson() - - expect(json).to.have.all.keys('errors', 'warnings', 'assets') - expect(json.errors).to.be.an('array').with.length(1) - expect(json.warnings).to.be.an('array').that.is.empty - expect(json.assets).to.be.an('array').that.is.empty - }) - }) -}) diff --git a/packages/zcli-connectors/src/lib/vite/vite-runner.ts b/packages/zcli-connectors/src/lib/vite/vite-runner.ts index 6ba41494..7faf56c9 100644 --- a/packages/zcli-connectors/src/lib/vite/vite-runner.ts +++ b/packages/zcli-connectors/src/lib/vite/vite-runner.ts @@ -1,5 +1,3 @@ -import { ViteConfigBuilder } from './vite-config' - export class ViteRunner { static async run (config: any): Promise<{ hasErrors: () => boolean; @@ -39,5 +37,3 @@ export class ViteRunner { } } } - -export { ViteConfigBuilder } diff --git a/packages/zcli-connectors/tests/functional/bundle.test.ts b/packages/zcli-connectors/tests/functional/bundle.test.ts index da3bdabe..cc24eb54 100644 --- a/packages/zcli-connectors/tests/functional/bundle.test.ts +++ b/packages/zcli-connectors/tests/functional/bundle.test.ts @@ -117,17 +117,6 @@ describe('bundle', () => { expect(logStub).to.have.been.calledWith(sinon.match(/Warning message/)) }) - it('should handle exceptions', async () => { - const testError = new Error('Test error') - viteStubs.run.rejects(testError) - - try { - await bundleCommand.run() - } catch (error) { - expect(error).to.equal(testError) - } - }) - it('should pass correct config to ViteConfigBuilder', async () => { (bundleCommand as any).parse = sinon.stub().resolves({ args: { path: './test-dir' }, @@ -138,10 +127,8 @@ describe('bundle', () => { expect(viteStubs.createConfig).to.have.been.calledWith( sinon.match({ - useLocalWorkspace: false, watch: false - }), - sinon.match.any + }) ) }) @@ -156,8 +143,7 @@ describe('bundle', () => { expect(viteStubs.createConfig).to.have.been.calledWith( sinon.match({ watch: true - }), - sinon.match.any + }) ) }) }) diff --git a/packages/zcli-connectors/tsconfig.json b/packages/zcli-connectors/tsconfig.json index af350b41..ab6a788c 100644 --- a/packages/zcli-connectors/tsconfig.json +++ b/packages/zcli-connectors/tsconfig.json @@ -7,7 +7,7 @@ "rootDir": "src", "strict": true, "target": "es2017", - "skipLibCheck": true, + "skipLibCheck": true }, "include": [ "src/**/*" diff --git a/yarn.lock b/yarn.lock index 5176e813..e9128c66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -240,135 +240,135 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@esbuild/aix-ppc64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz#80fcbe36130e58b7670511e888b8e88a259ed76c" - integrity sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA== - -"@esbuild/android-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz#8aa4965f8d0a7982dc21734bf6601323a66da752" - integrity sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg== - -"@esbuild/android-arm@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz#300712101f7f50f1d2627a162e6e09b109b6767a" - integrity sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg== - -"@esbuild/android-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz#87dfb27161202bdc958ef48bb61b09c758faee16" - integrity sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg== - -"@esbuild/darwin-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz#79197898ec1ff745d21c071e1c7cc3c802f0c1fd" - integrity sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg== - -"@esbuild/darwin-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz#146400a8562133f45c4d2eadcf37ddd09718079e" - integrity sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA== - -"@esbuild/freebsd-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz#1c5f9ba7206e158fd2b24c59fa2d2c8bb47ca0fe" - integrity sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg== - -"@esbuild/freebsd-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz#ea631f4a36beaac4b9279fa0fcc6ca29eaeeb2b3" - integrity sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ== - -"@esbuild/linux-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz#e1066bce58394f1b1141deec8557a5f0a22f5977" - integrity sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ== - -"@esbuild/linux-arm@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz#452cd66b20932d08bdc53a8b61c0e30baf4348b9" - integrity sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw== - -"@esbuild/linux-ia32@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz#b24f8acc45bcf54192c7f2f3be1b53e6551eafe0" - integrity sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA== - -"@esbuild/linux-loong64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz#f9cfffa7fc8322571fbc4c8b3268caf15bd81ad0" - integrity sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng== - -"@esbuild/linux-mips64el@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz#575a14bd74644ffab891adc7d7e60d275296f2cd" - integrity sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw== - -"@esbuild/linux-ppc64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz#75b99c70a95fbd5f7739d7692befe60601591869" - integrity sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA== - -"@esbuild/linux-riscv64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz#2e3259440321a44e79ddf7535c325057da875cd6" - integrity sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w== - -"@esbuild/linux-s390x@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz#17676cabbfe5928da5b2a0d6df5d58cd08db2663" - integrity sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg== - -"@esbuild/linux-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz#0583775685ca82066d04c3507f09524d3cd7a306" - integrity sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw== - -"@esbuild/netbsd-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz#f04c4049cb2e252fe96b16fed90f70746b13f4a4" - integrity sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg== - -"@esbuild/netbsd-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz#77da0d0a0d826d7c921eea3d40292548b258a076" - integrity sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ== - -"@esbuild/openbsd-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz#6296f5867aedef28a81b22ab2009c786a952dccd" - integrity sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A== - -"@esbuild/openbsd-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz#f8d23303360e27b16cf065b23bbff43c14142679" - integrity sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw== - -"@esbuild/openharmony-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz#49e0b768744a3924be0d7fd97dd6ce9b2923d88d" - integrity sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg== - -"@esbuild/sunos-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz#a6ed7d6778d67e528c81fb165b23f4911b9b13d6" - integrity sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w== - -"@esbuild/win32-arm64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz#9ac14c378e1b653af17d08e7d3ce34caef587323" - integrity sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg== - -"@esbuild/win32-ia32@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz#918942dcbbb35cc14fca39afb91b5e6a3d127267" - integrity sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ== - -"@esbuild/win32-x64@0.25.12": - version "0.25.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz#9bdad8176be7811ad148d1f8772359041f46c6c5" - integrity sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA== +"@esbuild/aix-ppc64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz#521cbd968dcf362094034947f76fa1b18d2d403c" + integrity sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw== + +"@esbuild/android-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz#61ea550962d8aa12a9b33194394e007657a6df57" + integrity sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA== + +"@esbuild/android-arm@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.27.2.tgz#554887821e009dd6d853f972fde6c5143f1de142" + integrity sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA== + +"@esbuild/android-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.27.2.tgz#a7ce9d0721825fc578f9292a76d9e53334480ba2" + integrity sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A== + +"@esbuild/darwin-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz#2cb7659bd5d109803c593cfc414450d5430c8256" + integrity sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg== + +"@esbuild/darwin-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz#e741fa6b1abb0cd0364126ba34ca17fd5e7bf509" + integrity sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA== + +"@esbuild/freebsd-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz#2b64e7116865ca172d4ce034114c21f3c93e397c" + integrity sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g== + +"@esbuild/freebsd-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz#e5252551e66f499e4934efb611812f3820e990bb" + integrity sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA== + +"@esbuild/linux-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz#dc4acf235531cd6984f5d6c3b13dbfb7ddb303cb" + integrity sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw== + +"@esbuild/linux-arm@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz#56a900e39240d7d5d1d273bc053daa295c92e322" + integrity sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw== + +"@esbuild/linux-ia32@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz#d4a36d473360f6870efcd19d52bbfff59a2ed1cc" + integrity sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w== + +"@esbuild/linux-loong64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz#fcf0ab8c3eaaf45891d0195d4961cb18b579716a" + integrity sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg== + +"@esbuild/linux-mips64el@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz#598b67d34048bb7ee1901cb12e2a0a434c381c10" + integrity sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw== + +"@esbuild/linux-ppc64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz#3846c5df6b2016dab9bc95dde26c40f11e43b4c0" + integrity sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ== + +"@esbuild/linux-riscv64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz#173d4475b37c8d2c3e1707e068c174bb3f53d07d" + integrity sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA== + +"@esbuild/linux-s390x@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz#f7a4790105edcab8a5a31df26fbfac1aa3dacfab" + integrity sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w== + +"@esbuild/linux-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz#2ecc1284b1904aeb41e54c9ddc7fcd349b18f650" + integrity sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA== + +"@esbuild/netbsd-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz#e2863c2cd1501845995cb11adf26f7fe4be527b0" + integrity sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw== + +"@esbuild/netbsd-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz#93f7609e2885d1c0b5a1417885fba8d1fcc41272" + integrity sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA== + +"@esbuild/openbsd-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz#a1985604a203cdc325fd47542e106fafd698f02e" + integrity sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA== + +"@esbuild/openbsd-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz#8209e46c42f1ffbe6e4ef77a32e1f47d404ad42a" + integrity sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg== + +"@esbuild/openharmony-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz#8fade4441893d9cc44cbd7dcf3776f508ab6fb2f" + integrity sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag== + +"@esbuild/sunos-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz#980d4b9703a16f0f07016632424fc6d9a789dfc2" + integrity sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg== + +"@esbuild/win32-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz#1c09a3633c949ead3d808ba37276883e71f6111a" + integrity sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg== + +"@esbuild/win32-ia32@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz#1b1e3a63ad4bef82200fef4e369e0fff7009eee5" + integrity sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ== + +"@esbuild/win32-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz#9e585ab6086bef994c6e8a5b3a0481219ada862b" + integrity sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ== "@eslint/eslintrc@^1.3.0": version "1.3.0" @@ -3816,37 +3816,37 @@ es6-error@^4.0.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -esbuild@^0.25.0: - version "0.25.12" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.12.tgz#97a1d041f4ab00c2fce2f838d2b9969a2d2a97a5" - integrity sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg== +esbuild@^0.27.0: + version "0.27.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.27.2.tgz#d83ed2154d5813a5367376bb2292a9296fc83717" + integrity sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw== optionalDependencies: - "@esbuild/aix-ppc64" "0.25.12" - "@esbuild/android-arm" "0.25.12" - "@esbuild/android-arm64" "0.25.12" - "@esbuild/android-x64" "0.25.12" - "@esbuild/darwin-arm64" "0.25.12" - "@esbuild/darwin-x64" "0.25.12" - "@esbuild/freebsd-arm64" "0.25.12" - "@esbuild/freebsd-x64" "0.25.12" - "@esbuild/linux-arm" "0.25.12" - "@esbuild/linux-arm64" "0.25.12" - "@esbuild/linux-ia32" "0.25.12" - "@esbuild/linux-loong64" "0.25.12" - "@esbuild/linux-mips64el" "0.25.12" - "@esbuild/linux-ppc64" "0.25.12" - "@esbuild/linux-riscv64" "0.25.12" - "@esbuild/linux-s390x" "0.25.12" - "@esbuild/linux-x64" "0.25.12" - "@esbuild/netbsd-arm64" "0.25.12" - "@esbuild/netbsd-x64" "0.25.12" - "@esbuild/openbsd-arm64" "0.25.12" - "@esbuild/openbsd-x64" "0.25.12" - "@esbuild/openharmony-arm64" "0.25.12" - "@esbuild/sunos-x64" "0.25.12" - "@esbuild/win32-arm64" "0.25.12" - "@esbuild/win32-ia32" "0.25.12" - "@esbuild/win32-x64" "0.25.12" + "@esbuild/aix-ppc64" "0.27.2" + "@esbuild/android-arm" "0.27.2" + "@esbuild/android-arm64" "0.27.2" + "@esbuild/android-x64" "0.27.2" + "@esbuild/darwin-arm64" "0.27.2" + "@esbuild/darwin-x64" "0.27.2" + "@esbuild/freebsd-arm64" "0.27.2" + "@esbuild/freebsd-x64" "0.27.2" + "@esbuild/linux-arm" "0.27.2" + "@esbuild/linux-arm64" "0.27.2" + "@esbuild/linux-ia32" "0.27.2" + "@esbuild/linux-loong64" "0.27.2" + "@esbuild/linux-mips64el" "0.27.2" + "@esbuild/linux-ppc64" "0.27.2" + "@esbuild/linux-riscv64" "0.27.2" + "@esbuild/linux-s390x" "0.27.2" + "@esbuild/linux-x64" "0.27.2" + "@esbuild/netbsd-arm64" "0.27.2" + "@esbuild/netbsd-x64" "0.27.2" + "@esbuild/openbsd-arm64" "0.27.2" + "@esbuild/openbsd-x64" "0.27.2" + "@esbuild/openharmony-arm64" "0.27.2" + "@esbuild/sunos-x64" "0.27.2" + "@esbuild/win32-arm64" "0.27.2" + "@esbuild/win32-ia32" "0.27.2" + "@esbuild/win32-x64" "0.27.2" escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" @@ -8271,7 +8271,7 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -tinyglobby@^0.2.14: +tinyglobby@^0.2.15: version "0.2.15" resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== @@ -8573,17 +8573,17 @@ vary@^1, vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== -vite@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/vite/-/vite-7.1.3.tgz#8d70cb02fd6346b4bf1329a6760800538ef0faea" - integrity sha512-OOUi5zjkDxYrKhTV3V7iKsoS37VUM7v40+HuwEmcrsf11Cdx9y3DIr2Px6liIcZFwt3XSRpQvFpL3WVy7ApkGw== +vite@^7.1.3: + version "7.3.1" + resolved "https://registry.yarnpkg.com/vite/-/vite-7.3.1.tgz#7f6cfe8fb9074138605e822a75d9d30b814d6507" + integrity sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA== dependencies: - esbuild "^0.25.0" + esbuild "^0.27.0" fdir "^6.5.0" picomatch "^4.0.3" postcss "^8.5.6" rollup "^4.43.0" - tinyglobby "^0.2.14" + tinyglobby "^0.2.15" optionalDependencies: fsevents "~2.3.3"