From 94c04b53ff1eb53064b0bcad292bac738a2aa987 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 16 Apr 2024 12:42:53 -0400 Subject: [PATCH 01/61] fix noOverwriteGlobs issue #1128 --- lib/generator.js | 33 ++++++++++++++------------- lib/renderer/react.js | 52 ++++++++++++++++++++++++++++++------------- 2 files changed, 53 insertions(+), 32 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index c00c2e0be..0c1505447 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -107,6 +107,7 @@ class Generator { this.entrypoint = entrypoint; /** @type {String[]} List of globs to skip when regenerating the template. */ this.noOverwriteGlobs = noOverwriteGlobs || []; + // global.noOverwriteGlobal = this.noOverwriteGlobs; /** @type {Object} Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. */ this.disabledHooks = disabledHooks || {}; /** @type {String} Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. */ @@ -532,7 +533,7 @@ class Generator { arbOptions.registry = providedRegistry; registryUrl = providedRegistry; } - + const domainName = registryUrl.replace(/^https?:\/\//, ''); //doing basic if/else so basically only one auth type is used and token as more secure is primary if (this.registry.token) { @@ -541,7 +542,7 @@ class Generator { } else if (this.registry.auth) { authorizationName = `//${domainName}:_auth`; arbOptions[authorizationName] = this.registry.auth; - } + } //not sharing in logs neither token nor auth for security reasons log.debug(`Using npm registry ${registryUrl} and authorization type ${authorizationName} to handle template installation.`); @@ -556,14 +557,14 @@ class Generator { let pkgPath; let installedPkg; let packageVersion; - + try { installedPkg = getTemplateDetails(this.templateName, PACKAGE_JSON_FILENAME); pkgPath = installedPkg && installedPkg.pkgPath; packageVersion = installedPkg && installedPkg.version; log.debug(logMessage.templateSource(pkgPath)); if (packageVersion) log.debug(logMessage.templateVersion(packageVersion)); - + return { name: installedPkg.name, path: pkgPath @@ -573,38 +574,38 @@ class Generator { // We did our best. Proceed with installation... } } - + const debugMessage = force ? logMessage.TEMPLATE_INSTALL_FLAG_MSG : logMessage.TEMPLATE_INSTALL_DISK_MSG; log.debug(logMessage.installationDebugMessage(debugMessage)); - + if (isFileSystemPath(this.templateName)) log.debug(logMessage.NPM_INSTALL_TRIGGER); - + const arbOptions = { path: ROOT_DIR, }; if (this.registry) { this.initialiseArbOptions(arbOptions); } - + const arb = new Arborist(arbOptions); - + try { const installResult = await arb.reify({ add: [this.templateName], saveType: 'prod', save: false }); - + const addResult = arb[Symbol.for('resolvedAdd')]; if (!addResult) throw new Error('Unable to resolve the name of the added package. It was most probably not added to node_modules successfully'); - + const packageName = addResult[0].name; const packageVersion = installResult.children.get(packageName).version; const packagePath = installResult.children.get(packageName).path; - + if (!isFileSystemPath(this.templateName)) log.debug(logMessage.templateSuccessfullyInstalled(packageName, packagePath)); if (packageVersion) log.debug(logMessage.templateVersion(packageVersion)); - + return { name: packageName, path: packagePath, @@ -834,14 +835,14 @@ class Generator { * @param {String} outputPath Path to the resulting rendered file. * @param {Object} [extraTemplateData] Extra data to pass to the template. */ - async renderAndWriteToFile(asyncapiDocument, templateFilePath, outputpath, extraTemplateData) { + async renderAndWriteToFile(asyncapiDocument, templateFilePath, outputPath, extraTemplateData) { const renderContent = await this.renderFile(asyncapiDocument, templateFilePath, extraTemplateData); if (renderContent === undefined) { return; } else if (isReactTemplate(this.templateConfig)) { - await saveRenderedReactContent(renderContent, outputpath); + await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs); } else { - await writeFile(outputpath, renderContent); + await writeFile(outputPath, renderContent); } } diff --git a/lib/renderer/react.js b/lib/renderer/react.js index ab139254a..65fbd20ba 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -1,5 +1,6 @@ const path = require('path'); const AsyncReactSDK = require('@asyncapi/generator-react-sdk'); +const minimatch = require('minimatch'); const { writeFile } = require('../utils'); @@ -8,7 +9,7 @@ const reactExport = module.exports; /** * Configures React templating system, this handles all the transpilation work. - * + * * @private * @param {string} templateLocation located for thetemplate * @param {string} templateContentDir where the template content are located @@ -23,9 +24,9 @@ reactExport.configureReact = async (templateLocation, templateContentDir, transp /** * Renders the template with react and returns the content and meta data for the file. - * + * * @private - * @param {AsyncAPIDocument} asyncapiDocument + * @param {AsyncAPIDocument} asyncapiDocument * @param {string} filePath path to the template file * @param {Object} extraTemplateData Extra data to pass to the template. * @param {string} templateLocation located for thetemplate @@ -33,44 +34,50 @@ reactExport.configureReact = async (templateLocation, templateContentDir, transp * @param {string} transpiledTemplateLocation folder for the transpiled code * @param {Object} templateParams provided template parameters * @param {boolean} debug flag - * @param {string} originalAsyncAPI + * @param {string} originalAsyncAPI * @return {Promise} */ reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, templateLocation, templateContentDir, transpiledTemplateLocation, templateParams, debug, originalAsyncAPI) => { extraTemplateData = extraTemplateData || {}; filePath = filePath.replace(templateContentDir, path.resolve(templateLocation, transpiledTemplateLocation)); return await AsyncReactSDK.renderTemplate( - filePath, + filePath, { asyncapi: asyncapiDocument, params: templateParams, originalAsyncAPI, ...extraTemplateData - }, + }, debug ); }; /** * Save the single rendered react content based on the meta data available. - * + * * @private * @param {TemplateRenderResult} renderedContent the react content rendered * @param {String} outputPath Path to the file being rendered. + * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -const saveContentToFile = async (renderedContent, outputPath) => { +const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs) => { let filePath = outputPath; - // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. + // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. let permissions = 0o666; const content = renderedContent.content; + // Error handling for undefined content or non-string type if (content === undefined || typeof content !== 'string') { throw Error(`Template file not rendered correctly, was rendered as ${content}`); } + + // Adjust file permissions based on metadata, if available if (renderedContent.metadata !== undefined) { if (renderedContent.metadata.permissions !== undefined) { permissions = renderedContent.metadata.permissions; } + + // Replace the base filename with a new filename from metadata if specified if (renderedContent.metadata.fileName !== undefined) { const newFileName = renderedContent.metadata.fileName.trim(); const basepath = path.basename(filePath); @@ -78,21 +85,34 @@ const saveContentToFile = async (renderedContent, outputPath) => { } } - await writeFile(filePath, content, { - mode: permissions - }); + // get the final file name of the file + const finalFileName = path.basename(filePath); + // check whether the filename should be ignored based on user's inputs + const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); + + // Write the file only if it should not be skipped + if (shouldOverwrite) { + await writeFile(filePath, content, { + mode: permissions + }); + } else { + console.log(`Skipping overwrite for: ${filePath}`); + } }; /** * Save the rendered react content based on the meta data available. - * + * * @private * @param {TemplateRenderResult[] | TemplateRenderResult} renderedContent the react content rendered * @param {String} outputPath Path to the file being rendered. + * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -reactExport.saveRenderedReactContent = async (renderedContent, outputPath) => { +reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs) => { + // If the rendered content is an array, we need to save each file individually if (Array.isArray(renderedContent)) { - return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath))); + return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); } - return saveContentToFile(renderedContent, outputPath); + // Otherwise, we can save the single file + return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); }; From 57ec2eee5ca42f38a9c5a58df6ec424b0c818622 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 16 Apr 2024 12:56:12 -0400 Subject: [PATCH 02/61] give noOverwriteGlobs a default value of [] - give noOverwriteGlobs a default value of [] in saveContentToFile and saveRenderedReactContent --- lib/generator.js | 1 - lib/renderer/react.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 0c1505447..13aa5ae1d 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -107,7 +107,6 @@ class Generator { this.entrypoint = entrypoint; /** @type {String[]} List of globs to skip when regenerating the template. */ this.noOverwriteGlobs = noOverwriteGlobs || []; - // global.noOverwriteGlobal = this.noOverwriteGlobs; /** @type {Object} Object with hooks to disable. The key is a hook type. If key has "true" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. */ this.disabledHooks = disabledHooks || {}; /** @type {String} Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. */ diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 65fbd20ba..f79f41cfc 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -60,7 +60,7 @@ reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs) => { +const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = []) => { let filePath = outputPath; // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. let permissions = 0o666; @@ -108,7 +108,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs) * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs) => { +reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = []) => { // If the rendered content is an array, we need to save each file individually if (Array.isArray(renderedContent)) { return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); From 833360035f83b615e09488e91bbf2502d2c7a667 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 08:55:37 -0400 Subject: [PATCH 03/61] Update integration.test.js --- test/integration.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/integration.test.js b/test/integration.test.js index 73ef591f4..ac63f5b42 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -9,6 +9,7 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); +const {writeFileSync, readFileSync} = require('node:fs'); const mainTestResultPath = 'test/temp/integrationTestResult'; //we do not want to download chromium for html-template if it is not needed process.env['PUPPETEER_SKIP_CHROMIUM_DOWNLOAD'] = true; @@ -48,4 +49,25 @@ describe('Integration testing generateFromFile() to make sure the result of the const file = await readFile(path.join(outputDir, 'index.html'), 'utf8'); expect(file).toMatchSnapshot(); }); + + it('should ignore specified files with noOverwriteGlobs', async () => { + const outputDir = generateFolderName(); + // Manually create a file to test if it's not overwritten + const testFilePath = path.join(outputDir, 'index.html'); + // eslint-disable-next-line sonarjs/no-duplicate-string + writeFileSync(testFilePath, ''); + + // based on the html-template documentation, the default output is index.html + const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { + forceWrite: true, + outFilename: 'index.html', + noOverwriteGlobs: ['**/index.html'] + }); + + generator.generateFromFile(dummySpecPath); + + // Read the file to confirm it was not overwritten + const fileContent = readFileSync(testFilePath, 'utf8'); + expect(fileContent).toBe(''); + }); }); From d46747642b85fe9302819b1cb012262f3ee17854 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 08:59:47 -0400 Subject: [PATCH 04/61] handle "no such file/directory" error --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index ac63f5b42..ea692ca7e 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -9,7 +9,7 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); -const {writeFileSync, readFileSync} = require('node:fs'); +const {writeFileSync, readFileSync} = require('fs'); const mainTestResultPath = 'test/temp/integrationTestResult'; //we do not want to download chromium for html-template if it is not needed process.env['PUPPETEER_SKIP_CHROMIUM_DOWNLOAD'] = true; From 49998859eb94c9c8c8449e9d9b21133a163e22fe Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:09:24 -0400 Subject: [PATCH 05/61] handle output path error --- test/integration.test.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index ea692ca7e..9abc18994 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -10,6 +10,7 @@ const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); const {writeFileSync, readFileSync} = require('fs'); +const {mkdirSync, existsSync} = require('node:fs'); const mainTestResultPath = 'test/temp/integrationTestResult'; //we do not want to download chromium for html-template if it is not needed process.env['PUPPETEER_SKIP_CHROMIUM_DOWNLOAD'] = true; @@ -53,10 +54,17 @@ describe('Integration testing generateFromFile() to make sure the result of the it('should ignore specified files with noOverwriteGlobs', async () => { const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten + if (!existsSync(outputDir)) { + mkdirSync(outputDir, { recursive: true }); + } const testFilePath = path.join(outputDir, 'index.html'); // eslint-disable-next-line sonarjs/no-duplicate-string - writeFileSync(testFilePath, ''); - + try { + const testFilePath = path.join(outputDir, 'index.html'); + writeFileSync(testFilePath, ''); + } catch (error) { + console.error('Failed to write file:', error); + } // based on the html-template documentation, the default output is index.html const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { forceWrite: true, From 19e11df4e8ca4311ecb416f6cff08ae52135cf80 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:16:12 -0400 Subject: [PATCH 06/61] edit package require --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 9abc18994..2fd761a03 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -10,7 +10,7 @@ const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); const {writeFileSync, readFileSync} = require('fs'); -const {mkdirSync, existsSync} = require('node:fs'); +const {mkdirSync, existsSync} = require('fs'); const mainTestResultPath = 'test/temp/integrationTestResult'; //we do not want to download chromium for html-template if it is not needed process.env['PUPPETEER_SKIP_CHROMIUM_DOWNLOAD'] = true; From c0b9ec8d4f945bc44bced79930ed673e7bb3aa0a Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:32:51 -0400 Subject: [PATCH 07/61] edit generator parameter --- test/integration.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 2fd761a03..323651cd3 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -68,7 +68,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // based on the html-template documentation, the default output is index.html const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { forceWrite: true, - outFilename: 'index.html', noOverwriteGlobs: ['**/index.html'] }); From d147b9f05ad83526f25987c2043532580f2a88e0 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:37:14 -0400 Subject: [PATCH 08/61] resolved asynchronous issue --- test/integration.test.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index 323651cd3..e138c4e6a 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -57,14 +57,10 @@ describe('Integration testing generateFromFile() to make sure the result of the if (!existsSync(outputDir)) { mkdirSync(outputDir, { recursive: true }); } - const testFilePath = path.join(outputDir, 'index.html'); // eslint-disable-next-line sonarjs/no-duplicate-string - try { - const testFilePath = path.join(outputDir, 'index.html'); - writeFileSync(testFilePath, ''); - } catch (error) { - console.error('Failed to write file:', error); - } + const testFilePath = path.join(outputDir, 'index.html'); + writeFileSync(testFilePath, ''); + // based on the html-template documentation, the default output is index.html const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { forceWrite: true, From 7dd724f04844b96904dca61cff6f495fe64cf467 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:44:44 -0400 Subject: [PATCH 09/61] solve asynchronous in test --- test/integration.test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index e138c4e6a..44bea063a 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -11,6 +11,7 @@ const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); const {writeFileSync, readFileSync} = require('fs'); const {mkdirSync, existsSync} = require('fs'); +const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; //we do not want to download chromium for html-template if it is not needed process.env['PUPPETEER_SKIP_CHROMIUM_DOWNLOAD'] = true; @@ -54,12 +55,12 @@ describe('Integration testing generateFromFile() to make sure the result of the it('should ignore specified files with noOverwriteGlobs', async () => { const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten - if (!existsSync(outputDir)) { + if (!await exists(outputDir)) { mkdirSync(outputDir, { recursive: true }); } // eslint-disable-next-line sonarjs/no-duplicate-string const testFilePath = path.join(outputDir, 'index.html'); - writeFileSync(testFilePath, ''); + await writeFile(testFilePath, ''); // based on the html-template documentation, the default output is index.html const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { @@ -67,10 +68,10 @@ describe('Integration testing generateFromFile() to make sure the result of the noOverwriteGlobs: ['**/index.html'] }); - generator.generateFromFile(dummySpecPath); + await generator.generateFromFile(dummySpecPath); // Read the file to confirm it was not overwritten - const fileContent = readFileSync(testFilePath, 'utf8'); + const fileContent = readFile(testFilePath, 'utf8'); expect(fileContent).toBe(''); }); }); From 1ff0f22fa6f18cdbd21c090eacb272135905fc1f Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:48:26 -0400 Subject: [PATCH 10/61] make sure read is executed before checking --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 44bea063a..69b022a1d 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -71,7 +71,7 @@ describe('Integration testing generateFromFile() to make sure the result of the await generator.generateFromFile(dummySpecPath); // Read the file to confirm it was not overwritten - const fileContent = readFile(testFilePath, 'utf8'); + const fileContent = await readFile(testFilePath, 'utf8'); expect(fileContent).toBe(''); }); }); From 98a1e71937b8bd63d993714fd021ae3eb4e00b44 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:51:46 -0400 Subject: [PATCH 11/61] delete unused packages --- test/integration.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index 69b022a1d..38ff61e94 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -9,8 +9,7 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); -const {writeFileSync, readFileSync} = require('fs'); -const {mkdirSync, existsSync} = require('fs'); +const {mkdirSync} = require('fs'); const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; //we do not want to download chromium for html-template if it is not needed From e9f5bd07ae61d145e4ef67fead8c4cc89dfe9a1d Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 18 Apr 2024 09:54:10 -0400 Subject: [PATCH 12/61] suppress no-duplicate-string --- test/integration.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration.test.js b/test/integration.test.js index 38ff61e94..3adabcf12 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -27,6 +27,7 @@ describe('Integration testing generateFromFile() to make sure the result of the const outputDir = generateFolderName(); const generator = new Generator('@asyncapi/html-template@0.18.0', outputDir, { forceWrite: true, templateParams: { singleFile: true } }); await generator.generateFromFile(dummySpecPath); + // eslint-disable-next-line sonarjs/no-duplicate-string const file = await readFile(path.join(outputDir, 'index.html'), 'utf8'); expect(file).toMatchSnapshot(); }); From 3bb9e6f3f85f0f976329d97755f980d28fd47de0 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 23 Apr 2024 01:08:32 -0400 Subject: [PATCH 13/61] add log.debug to replace console.log --- lib/renderer/react.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/renderer/react.js b/lib/renderer/react.js index f79f41cfc..6c99aacf5 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -1,6 +1,7 @@ const path = require('path'); const AsyncReactSDK = require('@asyncapi/generator-react-sdk'); const minimatch = require('minimatch'); +const log = require('loglevel'); const { writeFile } = require('../utils'); @@ -96,7 +97,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = mode: permissions }); } else { - console.log(`Skipping overwrite for: ${filePath}`); + log.debug(`Skipping overwrite for: ${filePath}`); } }; From 6aa3b595fbd510f033f4ab8855ba6430b6648dad Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 14 May 2024 10:05:24 -0400 Subject: [PATCH 14/61] add debug parameter --- test/integration.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 3adabcf12..1de300d0e 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -65,7 +65,8 @@ describe('Integration testing generateFromFile() to make sure the result of the // based on the html-template documentation, the default output is index.html const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { forceWrite: true, - noOverwriteGlobs: ['**/index.html'] + noOverwriteGlobs: ['**/index.html'], + debug: true }); await generator.generateFromFile(dummySpecPath); From 380e210d2522d49068fddac704f45315977dcae3 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 14 May 2024 11:05:25 -0400 Subject: [PATCH 15/61] resolve "unresolved names" --- test/integration.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration.test.js b/test/integration.test.js index 1de300d0e..9dcf7ce9b 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -12,6 +12,8 @@ const crypto = require('crypto'); const {mkdirSync} = require('fs'); const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; +const jest = require('jest'); +const { expect, it, describe } = require('@jest/globals'); //we do not want to download chromium for html-template if it is not needed process.env['PUPPETEER_SKIP_CHROMIUM_DOWNLOAD'] = true; From 30bf2f62d572f7add2da28c9756459ee701e09dc Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Wed, 15 May 2024 20:44:18 -0400 Subject: [PATCH 16/61] change index.html to use updated test md --- test/integration.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index 7fb1c4e93..503296202 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -65,13 +65,13 @@ describe('Integration testing generateFromFile() to make sure the result of the mkdirSync(outputDir, { recursive: true }); } // eslint-disable-next-line sonarjs/no-duplicate-string - const testFilePath = path.join(outputDir, 'index.html'); + const testFilePath = path.join(outputDir, testOutputFile); await writeFile(testFilePath, ''); // based on the html-template documentation, the default output is index.html const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { forceWrite: true, - noOverwriteGlobs: ['**/index.html'], + noOverwriteGlobs: ['**/' + testOutputFile], debug: true }); From a7930b856aa4fd38a10028f3117ed6528e597159 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Wed, 15 May 2024 20:47:38 -0400 Subject: [PATCH 17/61] update template used for tests --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 503296202..367985274 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -69,7 +69,7 @@ describe('Integration testing generateFromFile() to make sure the result of the await writeFile(testFilePath, ''); // based on the html-template documentation, the default output is index.html - const generator = new Generator('@asyncapi/html-template@0.28.0', outputDir, { + const generator = new Generator(reactTemplate, outputDir, { forceWrite: true, noOverwriteGlobs: ['**/' + testOutputFile], debug: true From 2e8dda68ce393b814f9dee433ef5f1a09f933e6d Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Wed, 15 May 2024 20:51:43 -0400 Subject: [PATCH 18/61] use the right way of writing string with variables in javascript --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 367985274..c5f5188f3 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -71,7 +71,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // based on the html-template documentation, the default output is index.html const generator = new Generator(reactTemplate, outputDir, { forceWrite: true, - noOverwriteGlobs: ['**/' + testOutputFile], + noOverwriteGlobs: [`**/${testOutputFile}`], debug: true }); From 1047cda4b717cd73fcc3ce8518ae97c132bc4086 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 09:52:55 -0400 Subject: [PATCH 19/61] Update comments in test/integration.test.js Co-authored-by: Lukasz Gornicki --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index c5f5188f3..01af7d313 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -60,7 +60,7 @@ describe('Integration testing generateFromFile() to make sure the result of the it('should ignore specified files with noOverwriteGlobs', async () => { const outputDir = generateFolderName(); - // Manually create a file to test if it's not overwritten + // Manually create an output first, before generation, with additional custom file to validate if later it is still there, not overwritten if (!await exists(outputDir)) { mkdirSync(outputDir, { recursive: true }); } From a3c0a86dde5f4417fdc6d8f73c65e958934411e7 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 10:36:22 -0400 Subject: [PATCH 20/61] change comments; add log check; store content in variable --- test/integration.test.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index 01af7d313..575562a04 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -60,15 +60,17 @@ describe('Integration testing generateFromFile() to make sure the result of the it('should ignore specified files with noOverwriteGlobs', async () => { const outputDir = generateFolderName(); - // Manually create an output first, before generation, with additional custom file to validate if later it is still there, not overwritten + // Manually create a file to test if it's not overwritten if (!await exists(outputDir)) { mkdirSync(outputDir, { recursive: true }); } + // Create a variable to store the file content + const testContent = ''; // eslint-disable-next-line sonarjs/no-duplicate-string const testFilePath = path.join(outputDir, testOutputFile); - await writeFile(testFilePath, ''); + await writeFile(testFilePath, testContent); - // based on the html-template documentation, the default output is index.html + // Manually create an output first, before generation, with additional custom file to validate if later it is still there, not overwritten const generator = new Generator(reactTemplate, outputDir, { forceWrite: true, noOverwriteGlobs: [`**/${testOutputFile}`], @@ -79,6 +81,9 @@ describe('Integration testing generateFromFile() to make sure the result of the // Read the file to confirm it was not overwritten const fileContent = await readFile(testFilePath, 'utf8'); - expect(fileContent).toBe(''); + // Check if the files have been overwritten + expect(fileContent).toBe(testContent); + // Check if the log message was printed + expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); }); }); From 95d44f8eabf9d127f1458d240c0d8c63815a8f6a Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 10:40:34 -0400 Subject: [PATCH 21/61] change log variable --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 575562a04..e50448d66 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -84,6 +84,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testOutputFile}`); }); }); From 2e6cd81189e078906bce071280d0244dfee70e61 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 10:43:52 -0400 Subject: [PATCH 22/61] change output variable --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index e50448d66..575562a04 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -84,6 +84,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testOutputFile}`); + expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); }); }); From 36815ce26d88855f4e8c5fd62c96d1415a5284d3 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 10:49:21 -0400 Subject: [PATCH 23/61] comment out log for test --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 575562a04..519c24f9f 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -84,6 +84,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + // expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); }); }); From 655d39b4aa2b286c56b7cb6f162bb4650ad2f603 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 10:53:29 -0400 Subject: [PATCH 24/61] uncomment log test --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 519c24f9f..575562a04 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -84,6 +84,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - // expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); }); }); From e075fff75d583f2d8cb17849c3e3c49a64a27869 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Thu, 16 May 2024 11:03:12 -0400 Subject: [PATCH 25/61] mock console.log function --- test/integration.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 575562a04..74bf43663 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -59,6 +59,10 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { + // mock the console.log for testing + const log = jest.fn(); + console.log = log; + const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten if (!await exists(outputDir)) { @@ -84,6 +88,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(console.log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + expect(log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); }); }); From a94fd00ff200abeb5103a019a583e9421bcf1381 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 11:15:45 -0400 Subject: [PATCH 26/61] comment log --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 74bf43663..1e200b791 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -88,6 +88,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + // expect(log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); }); }); From cd22f3e0cdaa76fe21510f98ead22ede0c03fb77 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 11:20:25 -0400 Subject: [PATCH 27/61] update Integration.test - Add beforeAll() to check whether the reactTemplate exists in the specified location - Use jest.spyOn instead of jest.fn() for mocking console.log --- test/integration.test.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index 1e200b791..56eaf13a4 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -24,6 +24,12 @@ describe('Integration testing generateFromFile() to make sure the result of the jest.setTimeout(60000); const testOutputFile = 'test-file.md'; + beforeAll(() => { + if (!existsSync(path.join(reactTemplate, 'package.json'))) { + throw new Error(`React template not found at ${reactTemplate}`); + } + }); + it('generated using Nunjucks template', async () => { const outputDir = generateFolderName(); const generator = new Generator(nunjucksTemplate, outputDir, { @@ -60,8 +66,7 @@ describe('Integration testing generateFromFile() to make sure the result of the it('should ignore specified files with noOverwriteGlobs', async () => { // mock the console.log for testing - const log = jest.fn(); - console.log = log; + const log = jest.spyOn(console, 'log').mockImplementation(() => {}); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten @@ -88,6 +93,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - // expect(log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + expect(log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + log.mockRestore(); }); }); From 211714730d45940163bc5e865590091dd695d985 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 11:24:14 -0400 Subject: [PATCH 28/61] add existSync --- test/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 56eaf13a4..ba492ffd1 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -2,7 +2,7 @@ * @jest-environment node */ -const { readFile } = require('fs').promises; +const { readFile, existsSync } = require('fs').promises; const path = require('path'); const Generator = require('../lib/generator'); const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); From 6ae0b80cc27b19767a01c4f2d5a601578833c3ef Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 11:26:08 -0400 Subject: [PATCH 29/61] update existsSync --- test/integration.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index ba492ffd1..114dec27c 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -2,7 +2,8 @@ * @jest-environment node */ -const { readFile, existsSync } = require('fs').promises; +const { readFile } = require('fs').promises; +const { existsSync } = require('fs'); const path = require('path'); const Generator = require('../lib/generator'); const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); From 33eb3e530c254f628fdac495cd82cd6066f864b4 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 11:51:15 -0400 Subject: [PATCH 30/61] update logMessages, generator, and integration test - update shouldOverwriteFile() in generator with logging method - update logMessages with a function that is used when noOverwriteGlobs has values. - update integration.test.js with a more descriptive log information expected. --- lib/generator.js | 6 +++++- lib/logMessages.js | 4 ++++ test/integration.test.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index de176fa4f..11ae2c96c 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -963,7 +963,11 @@ class Generator { const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; - return !this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp)); + if (this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp))) { + log.debug(logMessage.fileNotOverwritten(filePath)); + return false; + } + return true; } /** diff --git a/lib/logMessages.js b/lib/logMessages.js index 40a0e77ce..1c767ab5e 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -38,6 +38,10 @@ function relativeSourceFileNotGenerated(relativeSourceFile , subject) { return `${relativeSourceFile} was not generated because ${subject} specified in template configuration in conditionalFiles was not found in provided AsyncAPI specification file.`; } +function fileNotOverwritten(relativeSourceFile) { + return `${relativeSourceFile} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`; +} + function conditionalFilesMatched(relativeSourceFile) { return `${relativeSourceFile} was not generated because condition specified for this file in template configuration in conditionalFiles matched.`; } diff --git a/test/integration.test.js b/test/integration.test.js index 114dec27c..144eb1487 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -94,7 +94,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(log).toHaveBeenCalledWith(`Skipping overwrite for ${testFilePath}`); + expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); log.mockRestore(); }); }); From ca4071050443475ea8b17dfa3991b8a50c674271 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 12:12:56 -0400 Subject: [PATCH 31/61] update generator and integration.test - use fullPath to file in generator.js instead of relative - modify integration test so it prints all the log calls. --- lib/generator.js | 6 +++++- test/integration.test.js | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/generator.js b/lib/generator.js index 11ae2c96c..10bccd3e6 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -959,12 +959,16 @@ class Generator { * @return {Promise} */ async shouldOverwriteFile(filePath) { + // Additional logging for debugging purposes + log.debug(`Checking if file should be overwritten: ${filePath}`); + if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; if (this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp))) { - log.debug(logMessage.fileNotOverwritten(filePath)); + fullPath = path.resolve(this.targetDir, filePath); + log.debug(logMessage.fileNotOverwritten(fullPath)); return false; } return true; diff --git a/test/integration.test.js b/test/integration.test.js index 144eb1487..c0402d6ca 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -95,6 +95,13 @@ describe('Integration testing generateFromFile() to make sure the result of the expect(fileContent).toBe(testContent); // Check if the log message was printed expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); + console.log('All console.log calls:'); + + // Print all console.log calls + log.mock.calls.forEach((call, index) => { + console.log(`${index + 1}:`, call); + }); + log.mockRestore(); }); }); From 332a4ed995a2b920fc66a15a50ba6cae2982e749 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 12:34:40 -0400 Subject: [PATCH 32/61] update generator and integration.test - change the fullPath in log.debug() to be filePath - add awaits to expect test in integration.test - change path.join to be path.resolve() in integration test --- lib/generator.js | 3 +-- test/integration.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 10bccd3e6..3041526c5 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -967,8 +967,7 @@ class Generator { if (!fileExists) return true; if (this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp))) { - fullPath = path.resolve(this.targetDir, filePath); - log.debug(logMessage.fileNotOverwritten(fullPath)); + log.debug(logMessage.fileNotOverwritten(filePath)); return false; } return true; diff --git a/test/integration.test.js b/test/integration.test.js index c0402d6ca..ecf777283 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -77,7 +77,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Create a variable to store the file content const testContent = ''; // eslint-disable-next-line sonarjs/no-duplicate-string - const testFilePath = path.join(outputDir, testOutputFile); + const testFilePath = path.resolve(outputDir, testOutputFile); await writeFile(testFilePath, testContent); // Manually create an output first, before generation, with additional custom file to validate if later it is still there, not overwritten @@ -92,13 +92,13 @@ describe('Integration testing generateFromFile() to make sure the result of the // Read the file to confirm it was not overwritten const fileContent = await readFile(testFilePath, 'utf8'); // Check if the files have been overwritten - expect(fileContent).toBe(testContent); + await expect(fileContent).toBe(testContent); // Check if the log message was printed - expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); + await expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); console.log('All console.log calls:'); // Print all console.log calls - log.mock.calls.forEach((call, index) => { + await log.mock.calls.forEach((call, index) => { console.log(`${index + 1}:`, call); }); From 214387a16816cb7bda8549dac62396a912714952 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 12:38:37 -0400 Subject: [PATCH 33/61] update logMessages - export fileNotOverwritten --- lib/logMessages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/logMessages.js b/lib/logMessages.js index 1c767ab5e..4bbcd82c1 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -58,6 +58,7 @@ module.exports = { installationDebugMessage, templateSuccessfullyInstalled, relativeSourceFileNotGenerated, - conditionalFilesMatched + conditionalFilesMatched, + fileNotOverwritten }; \ No newline at end of file From e5db0f6c0d57820439fe194bc8f898b2f9c5ed5e Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 12:48:00 -0400 Subject: [PATCH 34/61] update logMessages and integration - delete variable to test if the problem lies in variable --- lib/logMessages.js | 2 +- test/integration.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logMessages.js b/lib/logMessages.js index 4bbcd82c1..4e1468480 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -39,7 +39,7 @@ function relativeSourceFileNotGenerated(relativeSourceFile , subject) { } function fileNotOverwritten(relativeSourceFile) { - return `${relativeSourceFile} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`; + return ` was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`; } function conditionalFilesMatched(relativeSourceFile) { diff --git a/test/integration.test.js b/test/integration.test.js index ecf777283..a4e4d558f 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -94,7 +94,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); // Check if the log message was printed - await expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); + await expect(log).toHaveBeenCalledWith(` was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); console.log('All console.log calls:'); // Print all console.log calls From 3505053979e7dd9336b5e8403ec1a65672b6f514 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 13:04:10 -0400 Subject: [PATCH 35/61] update logMessages & integration.test - revert changes to log messages - add a new log test to see if the shouldOverwrite() is called --- lib/logMessages.js | 2 +- test/integration.test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/logMessages.js b/lib/logMessages.js index 4e1468480..4bbcd82c1 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -39,7 +39,7 @@ function relativeSourceFileNotGenerated(relativeSourceFile , subject) { } function fileNotOverwritten(relativeSourceFile) { - return ` was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`; + return `${relativeSourceFile} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`; } function conditionalFilesMatched(relativeSourceFile) { diff --git a/test/integration.test.js b/test/integration.test.js index a4e4d558f..174509294 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -93,8 +93,9 @@ describe('Integration testing generateFromFile() to make sure the result of the const fileContent = await readFile(testFilePath, 'utf8'); // Check if the files have been overwritten await expect(fileContent).toBe(testContent); + await expect(log).toHaveBeenCalledWith(`Checking if file should be overwritten: ${testFilePath}`); // Check if the log message was printed - await expect(log).toHaveBeenCalledWith(` was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); + await expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); console.log('All console.log calls:'); // Print all console.log calls From c4f29c2df54a650f9bec66b4dcf8b561eccc57b0 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 13:06:12 -0400 Subject: [PATCH 36/61] delete variables --- lib/generator.js | 2 +- test/integration.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 3041526c5..24f556c4e 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -960,7 +960,7 @@ class Generator { */ async shouldOverwriteFile(filePath) { // Additional logging for debugging purposes - log.debug(`Checking if file should be overwritten: ${filePath}`); + log.debug(`Checking if file should be overwritten:`); if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); diff --git a/test/integration.test.js b/test/integration.test.js index 174509294..74db36f3c 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -93,7 +93,7 @@ describe('Integration testing generateFromFile() to make sure the result of the const fileContent = await readFile(testFilePath, 'utf8'); // Check if the files have been overwritten await expect(fileContent).toBe(testContent); - await expect(log).toHaveBeenCalledWith(`Checking if file should be overwritten: ${testFilePath}`); + await expect(log).toHaveBeenCalledWith(`Checking if file should be overwritten:`); // Check if the log message was printed await expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); console.log('All console.log calls:'); From 038c130d06716c645ad53d15e45e18cc623b3922 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 13:17:32 -0400 Subject: [PATCH 37/61] update generator.js and integration test - generator.js: add a log to test if the conditional is ever true - generator.js: add a variable to a log.debug() to check if the file path is correct - integration test: add a new expect log test --- lib/generator.js | 4 +++- test/integration.test.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/generator.js b/lib/generator.js index 24f556c4e..34960df5a 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -959,14 +959,16 @@ class Generator { * @return {Promise} */ async shouldOverwriteFile(filePath) { + const fullPath = path.resolve(this.targetDir, filePath); // Additional logging for debugging purposes - log.debug(`Checking if file should be overwritten:`); + log.debug(`Checking if file should be overwritten: ${fullPath}`); if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; if (this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp))) { + log.debug("file shouldn't be overwritten"); log.debug(logMessage.fileNotOverwritten(filePath)); return false; } diff --git a/test/integration.test.js b/test/integration.test.js index 74db36f3c..97aab9b97 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -94,6 +94,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); await expect(log).toHaveBeenCalledWith(`Checking if file should be overwritten:`); + await expect(log).toHaveBeenCalledWith("file shouldn't be overwritten"); // Check if the log message was printed await expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); console.log('All console.log calls:'); From 15629dcd45394d4c0b1987c3179296c617955842 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 20 May 2024 14:59:16 -0400 Subject: [PATCH 38/61] update to full path --- lib/generator.js | 2 +- test/integration.test.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 34960df5a..16731fe1a 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -969,7 +969,7 @@ class Generator { if (this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp))) { log.debug("file shouldn't be overwritten"); - log.debug(logMessage.fileNotOverwritten(filePath)); + log.debug(logMessage.fileNotOverwritten(fullPath)); return false; } return true; diff --git a/test/integration.test.js b/test/integration.test.js index 97aab9b97..08f1e52e1 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -15,6 +15,7 @@ const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; const reactTemplate = 'test/test-templates/react-template'; const nunjucksTemplate = 'test/test-templates/nunjucks-template'; +const log = require('loglevel'); describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => { const generateFolderName = () => { @@ -66,8 +67,7 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { - // mock the console.log for testing - const log = jest.spyOn(console, 'log').mockImplementation(() => {}); + log.debug = jest.fn(); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten @@ -91,7 +91,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Read the file to confirm it was not overwritten const fileContent = await readFile(testFilePath, 'utf8'); - // Check if the files have been overwritten + // Check if the files have been overwritte await expect(fileContent).toBe(testContent); await expect(log).toHaveBeenCalledWith(`Checking if file should be overwritten:`); await expect(log).toHaveBeenCalledWith("file shouldn't be overwritten"); @@ -104,6 +104,5 @@ describe('Integration testing generateFromFile() to make sure the result of the console.log(`${index + 1}:`, call); }); - log.mockRestore(); }); }); From 5e49121ff86cac147b0b236b43bcd1af7c4a65ef Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 21 May 2024 10:47:20 -0400 Subject: [PATCH 39/61] update generator.js, react.js, integration.test.js - delete the log debug in shouldOverwriteFile - in react, add a log debug to see if the problem is with variable - mock imported log instead of console.log --- lib/generator.js | 8 +------- lib/renderer/react.js | 1 + package.json | 2 +- test/integration.test.js | 12 ++++++------ 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 16731fe1a..8bd649a80 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -961,18 +961,12 @@ class Generator { async shouldOverwriteFile(filePath) { const fullPath = path.resolve(this.targetDir, filePath); // Additional logging for debugging purposes - log.debug(`Checking if file should be overwritten: ${fullPath}`); if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; - if (this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp))) { - log.debug("file shouldn't be overwritten"); - log.debug(logMessage.fileNotOverwritten(fullPath)); - return false; - } - return true; + return !this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp)); } /** diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 6c99aacf5..2e15288d8 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -97,6 +97,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = mode: permissions }); } else { + log.debug(`noOverwriteGlobs matched`); log.debug(`Skipping overwrite for: ${filePath}`); } }; diff --git a/package.json b/package.json index 781d1bf03..d00d0b012 100644 --- a/package.json +++ b/package.json @@ -79,8 +79,8 @@ "devDependencies": { "eslint": "^6.8.0", "eslint-plugin-jest": "^23.8.2", - "eslint-plugin-sonarjs": "^0.5.0", "eslint-plugin-react": "^7.34.1", + "eslint-plugin-sonarjs": "^0.5.0", "jest": "^25.5.0", "jsdoc-to-markdown": "^7.1.1", "markdown-toc": "^1.2.0", diff --git a/test/integration.test.js b/test/integration.test.js index 08f1e52e1..c56ba623a 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -67,7 +67,7 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { - log.debug = jest.fn(); + const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten @@ -91,12 +91,11 @@ describe('Integration testing generateFromFile() to make sure the result of the // Read the file to confirm it was not overwritten const fileContent = await readFile(testFilePath, 'utf8'); - // Check if the files have been overwritte + // Check if the files have been overwritten await expect(fileContent).toBe(testContent); - await expect(log).toHaveBeenCalledWith(`Checking if file should be overwritten:`); - await expect(log).toHaveBeenCalledWith("file shouldn't be overwritten"); - // Check if the log message was printed - await expect(log).toHaveBeenCalledWith(`${testFilePath} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`); + // Check if the log debug message was printed + await expect(logSpyDebug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); + await expect(logSpyDebug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); console.log('All console.log calls:'); // Print all console.log calls @@ -104,5 +103,6 @@ describe('Integration testing generateFromFile() to make sure the result of the console.log(`${index + 1}:`, call); }); + log.mockRestore(); }); }); From a23636ae39af7f0270653e7566b89cf1ed5553bb Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 21 May 2024 11:45:33 -0400 Subject: [PATCH 40/61] update generator.js and integration.test - generator.js: setLogLevel in the construction of the generator - integration.test: use log.debug = jest.fn() and expect(log.debug) --- lib/generator.js | 5 ++++- test/integration.test.js | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 8bd649a80..b21fc11ac 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -144,6 +144,8 @@ class Generator { } }); }); + // PR 1162: set log level during construction to avoid asynchronous issues + this.setLogLevel(); } /** @@ -196,7 +198,8 @@ class Generator { async generate(asyncapiDocument, parseOptions = {}) { this.validateAsyncAPIDocument(asyncapiDocument); await this.setupOutput(); - this.setLogLevel(); + // PR 1162: always set log level during construction to avoid asynchronous issues + // this.setLogLevel(); await this.installAndSetupTemplate(); await this.configureTemplateWorkflow(parseOptions); diff --git a/test/integration.test.js b/test/integration.test.js index c56ba623a..7b0fb8452 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -67,7 +67,8 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { - const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); + // const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); + log.debug = jest.fn(); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten @@ -94,8 +95,8 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); // Check if the log debug message was printed - await expect(logSpyDebug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); - await expect(logSpyDebug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); + await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); + await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); console.log('All console.log calls:'); // Print all console.log calls From 55f9ae778bff60e11b52d2507245b42bd60cc3eb Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Wed, 22 May 2024 09:45:52 -0400 Subject: [PATCH 41/61] update filtersRegistry, generator, integration.test add await --- lib/filtersRegistry.js | 4 ++-- lib/generator.js | 1 + test/integration.test.js | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/filtersRegistry.js b/lib/filtersRegistry.js index 15b23f0be..5a55cd938 100644 --- a/lib/filtersRegistry.js +++ b/lib/filtersRegistry.js @@ -12,7 +12,7 @@ const { isAsyncFunction } = require('./utils'); */ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, filtersDir) => { await registerLocalFilters(nunjucks, templateDir, filtersDir); - registerConfigFilters(nunjucks, templateDir, templateConfig); + await registerConfigFilters(nunjucks, templateDir, templateConfig); }; /** @@ -22,7 +22,7 @@ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, f * @param {String} templateDir Directory where template is located. * @param {String} filtersDir Directory where local filters are located. */ -function registerLocalFilters(nunjucks, templateDir, filtersDir) { +async function registerLocalFilters(nunjucks, templateDir, filtersDir) { return new Promise((resolve, reject) => { const localFilters = path.resolve(templateDir, filtersDir); diff --git a/lib/generator.js b/lib/generator.js index b21fc11ac..2e9ff3dce 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -9,6 +9,7 @@ const log = require('loglevel'); const Arborist = require('@npmcli/arborist'); const Config = require('@npmcli/config'); const requireg = require('requireg'); +console.log("requireg.resolve('npm'): ", requireg.resolve('npm')); const npmPath = requireg.resolve('npm').replace('index.js',''); const { isAsyncAPIDocument } = require('@asyncapi/parser/cjs/document'); diff --git a/test/integration.test.js b/test/integration.test.js index 7b0fb8452..90f30de30 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -97,12 +97,12 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the log debug message was printed await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); - console.log('All console.log calls:'); + // await console.log('All console.log calls:'); - // Print all console.log calls - await log.mock.calls.forEach((call, index) => { - console.log(`${index + 1}:`, call); - }); + // // Print all console.log calls + // await log.mock.calls.forEach((call, index) => { + // console.log(`${index + 1}:`, call); + // }); log.mockRestore(); }); From 900faa962f02e67e4e52a1b99cec34aca1875519 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 15:15:51 -0400 Subject: [PATCH 42/61] check whether a file path should be overwritten --- lib/generator.js | 3 --- lib/renderer/react.js | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 2e9ff3dce..c55657b57 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -963,9 +963,6 @@ class Generator { * @return {Promise} */ async shouldOverwriteFile(filePath) { - const fullPath = path.resolve(this.targetDir, filePath); - // Additional logging for debugging purposes - if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 2e15288d8..268fe2cfd 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -89,7 +89,9 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = // get the final file name of the file const finalFileName = path.basename(filePath); // check whether the filename should be ignored based on user's inputs - const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); + // const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); + // reuse methods from the generator.js to check if the file should be overwritten + const shouldOverwrite = await reactExport.shouldOverwriteFile(filePath, noOverwriteGlobs); // Write the file only if it should not be skipped if (shouldOverwrite) { From 3e7afe70ad13f4cdfacf5211e8d6c433f75f24b4 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:14:57 -0400 Subject: [PATCH 43/61] fixed logging issue --- jest.config.js | 1 + lib/generator.js | 8 ++++---- lib/logMessages.js | 7 ++++++- lib/renderer/react.js | 15 ++++++--------- package.json | 4 ++-- test/integration.test.js | 19 +++++++------------ 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/jest.config.js b/jest.config.js index b3451c7c6..39544262b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,6 @@ module.exports = { clearMocks: true, + modulePathIgnorePatterns: ["./__mocks__(?!/loglevel.js)"], moduleNameMapper: { '^nimma/legacy$': '/node_modules/nimma/dist/legacy/cjs/index.js', '^nimma/(.*)': '/node_modules/nimma/dist/cjs/$1', diff --git a/lib/generator.js b/lib/generator.js index c55657b57..1d9941c62 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -145,8 +145,8 @@ class Generator { } }); }); - // PR 1162: set log level during construction to avoid asynchronous issues - this.setLogLevel(); + // // PR 1162: set log level during construction to avoid asynchronous issues + // this.setLogLevel(); } /** @@ -200,7 +200,7 @@ class Generator { this.validateAsyncAPIDocument(asyncapiDocument); await this.setupOutput(); // PR 1162: always set log level during construction to avoid asynchronous issues - // this.setLogLevel(); + this.setLogLevel(); await this.installAndSetupTemplate(); await this.configureTemplateWorkflow(parseOptions); @@ -856,7 +856,7 @@ class Generator { if (renderContent === undefined) { return; } else if (isReactTemplate(this.templateConfig)) { - await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs); + await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs, this); } else { await writeFile(outputPath, renderContent); } diff --git a/lib/logMessages.js b/lib/logMessages.js index 4bbcd82c1..d3be3f20b 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -46,6 +46,10 @@ function conditionalFilesMatched(relativeSourceFile) { return `${relativeSourceFile} was not generated because condition specified for this file in template configuration in conditionalFiles matched.`; } +function skipOverwriting(filePath) { + return `Skipping overwrite for: ${filePath}`; +} + module.exports = { TEMPLATE_INSTALL_FLAG_MSG, TEMPLATE_INSTALL_DISK_MSG, @@ -59,6 +63,7 @@ module.exports = { templateSuccessfullyInstalled, relativeSourceFileNotGenerated, conditionalFilesMatched, - fileNotOverwritten + fileNotOverwritten, + skipOverwriting }; \ No newline at end of file diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 268fe2cfd..45213e544 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -2,6 +2,7 @@ const path = require('path'); const AsyncReactSDK = require('@asyncapi/generator-react-sdk'); const minimatch = require('minimatch'); const log = require('loglevel'); +const logMessages = require('../logMessages'); const { writeFile } = require('../utils'); @@ -61,7 +62,7 @@ reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = []) => { +const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { let filePath = outputPath; // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. let permissions = 0o666; @@ -86,12 +87,8 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = } } - // get the final file name of the file - const finalFileName = path.basename(filePath); - // check whether the filename should be ignored based on user's inputs - // const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); // reuse methods from the generator.js to check if the file should be overwritten - const shouldOverwrite = await reactExport.shouldOverwriteFile(filePath, noOverwriteGlobs); + const shouldOverwrite = await generator.shouldOverwriteFile(filePath); // Write the file only if it should not be skipped if (shouldOverwrite) { @@ -100,7 +97,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = }); } else { log.debug(`noOverwriteGlobs matched`); - log.debug(`Skipping overwrite for: ${filePath}`); + log.debug(logMessages.skipOverwriting(filePath)); } }; @@ -112,11 +109,11 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = []) => { +reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { // If the rendered content is an array, we need to save each file individually if (Array.isArray(renderedContent)) { return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); } // Otherwise, we can save the single file - return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); + return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs, generator); }; diff --git a/package.json b/package.json index d00d0b012..567e9c6cf 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "test": "npm run test:unit && npm run test:integration && npm run test:cli", "test:unit": "jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project", "test:dev": "npm run test:unit -- --watchAll", - "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'", - "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'", + "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'", + "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'", "test:cli": "node cli.js ./test/docs/dummy.yml ./test/test-templates/react-template -o test/output --force-write --debug && test -e test/output/test-file.md", "test:cleanup": "rimraf \"test/temp\"", "docs": "jsdoc2md --partial docs/jsdoc2md-handlebars/custom-sig-name.hbs docs/jsdoc2md-handlebars/main.hbs docs/jsdoc2md-handlebars/docs.hbs docs/jsdoc2md-handlebars/header.hbs docs/jsdoc2md-handlebars/defaultvalue.hbs docs/jsdoc2md-handlebars/link.hbs docs/jsdoc2md-handlebars/params-table.hbs --files lib/generator.js > docs/api.md", diff --git a/test/integration.test.js b/test/integration.test.js index 90f30de30..407ee33bd 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -15,6 +15,7 @@ const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; const reactTemplate = 'test/test-templates/react-template'; const nunjucksTemplate = 'test/test-templates/nunjucks-template'; +const logMessage = require('../lib/logMessages'); const log = require('loglevel'); describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => { @@ -67,12 +68,12 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { - // const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); - log.debug = jest.fn(); + const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); + // log.debug = jest.fn(); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten - if (!await exists(outputDir)) { + if (!existsSync(outputDir)) { mkdirSync(outputDir, { recursive: true }); } // Create a variable to store the file content @@ -95,15 +96,9 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); // Check if the log debug message was printed - await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); - await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); - // await console.log('All console.log calls:'); + // await expect(logSpyDebug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); + await expect(logSpyDebug).toHaveBeenCalledWith(logMessage.skipOverwriting(testFilePath)); - // // Print all console.log calls - // await log.mock.calls.forEach((call, index) => { - // console.log(`${index + 1}:`, call); - // }); - - log.mockRestore(); + logSpyDebug.mockRestore(); }); }); From b3b29a1a61763813eb1413c6eb8b8d5c355acc87 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:31:40 -0400 Subject: [PATCH 44/61] update generator.js and react.js - don't reuse methods from generator for now --- lib/generator.js | 5 +---- lib/renderer/react.js | 9 +++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 1d9941c62..ab50cd75a 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -145,8 +145,6 @@ class Generator { } }); }); - // // PR 1162: set log level during construction to avoid asynchronous issues - // this.setLogLevel(); } /** @@ -199,7 +197,6 @@ class Generator { async generate(asyncapiDocument, parseOptions = {}) { this.validateAsyncAPIDocument(asyncapiDocument); await this.setupOutput(); - // PR 1162: always set log level during construction to avoid asynchronous issues this.setLogLevel(); await this.installAndSetupTemplate(); @@ -856,7 +853,7 @@ class Generator { if (renderContent === undefined) { return; } else if (isReactTemplate(this.templateConfig)) { - await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs, this); + await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs); } else { await writeFile(outputPath, renderContent); } diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 45213e544..68cde621a 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -62,7 +62,7 @@ reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { +const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = []) => { let filePath = outputPath; // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. let permissions = 0o666; @@ -88,7 +88,8 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = } // reuse methods from the generator.js to check if the file should be overwritten - const shouldOverwrite = await generator.shouldOverwriteFile(filePath); + // const shouldOverwrite = await generator.shouldOverwriteFile(filePath); + const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(filePath, globExp)) // Write the file only if it should not be skipped if (shouldOverwrite) { @@ -109,11 +110,11 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { +reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = []) => { // If the rendered content is an array, we need to save each file individually if (Array.isArray(renderedContent)) { return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); } // Otherwise, we can save the single file - return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs, generator); + return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); }; From 6854f6b45af1c0af481ab15f35dcc0f098498d98 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:34:47 -0400 Subject: [PATCH 45/61] Revert "update generator.js and react.js" This reverts commit b3b29a1a61763813eb1413c6eb8b8d5c355acc87. --- lib/generator.js | 5 ++++- lib/renderer/react.js | 9 ++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index ab50cd75a..1d9941c62 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -145,6 +145,8 @@ class Generator { } }); }); + // // PR 1162: set log level during construction to avoid asynchronous issues + // this.setLogLevel(); } /** @@ -197,6 +199,7 @@ class Generator { async generate(asyncapiDocument, parseOptions = {}) { this.validateAsyncAPIDocument(asyncapiDocument); await this.setupOutput(); + // PR 1162: always set log level during construction to avoid asynchronous issues this.setLogLevel(); await this.installAndSetupTemplate(); @@ -853,7 +856,7 @@ class Generator { if (renderContent === undefined) { return; } else if (isReactTemplate(this.templateConfig)) { - await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs); + await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs, this); } else { await writeFile(outputPath, renderContent); } diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 68cde621a..45213e544 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -62,7 +62,7 @@ reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = []) => { +const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { let filePath = outputPath; // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. let permissions = 0o666; @@ -88,8 +88,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = } // reuse methods from the generator.js to check if the file should be overwritten - // const shouldOverwrite = await generator.shouldOverwriteFile(filePath); - const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(filePath, globExp)) + const shouldOverwrite = await generator.shouldOverwriteFile(filePath); // Write the file only if it should not be skipped if (shouldOverwrite) { @@ -110,11 +109,11 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = []) => { +reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { // If the rendered content is an array, we need to save each file individually if (Array.isArray(renderedContent)) { return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); } // Otherwise, we can save the single file - return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); + return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs, generator); }; From fbd41c828fc20b0f6f3ce74a073c0b4f3d0e62dc Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:35:10 -0400 Subject: [PATCH 46/61] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 567e9c6cf..d00d0b012 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "test": "npm run test:unit && npm run test:integration && npm run test:cli", "test:unit": "jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project", "test:dev": "npm run test:unit -- --watchAll", - "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'", - "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'", + "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'", + "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'", "test:cli": "node cli.js ./test/docs/dummy.yml ./test/test-templates/react-template -o test/output --force-write --debug && test -e test/output/test-file.md", "test:cleanup": "rimraf \"test/temp\"", "docs": "jsdoc2md --partial docs/jsdoc2md-handlebars/custom-sig-name.hbs docs/jsdoc2md-handlebars/main.hbs docs/jsdoc2md-handlebars/docs.hbs docs/jsdoc2md-handlebars/header.hbs docs/jsdoc2md-handlebars/defaultvalue.hbs docs/jsdoc2md-handlebars/link.hbs docs/jsdoc2md-handlebars/params-table.hbs --files lib/generator.js > docs/api.md", From 09e78823a00a214045809f940942a774076a353a Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:35:44 -0400 Subject: [PATCH 47/61] Revert "fixed logging issue" This reverts commit 3e7afe70ad13f4cdfacf5211e8d6c433f75f24b4. --- jest.config.js | 1 - lib/generator.js | 8 ++++---- lib/logMessages.js | 7 +------ lib/renderer/react.js | 15 +++++++++------ test/integration.test.js | 19 ++++++++++++------- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/jest.config.js b/jest.config.js index 39544262b..b3451c7c6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,5 @@ module.exports = { clearMocks: true, - modulePathIgnorePatterns: ["./__mocks__(?!/loglevel.js)"], moduleNameMapper: { '^nimma/legacy$': '/node_modules/nimma/dist/legacy/cjs/index.js', '^nimma/(.*)': '/node_modules/nimma/dist/cjs/$1', diff --git a/lib/generator.js b/lib/generator.js index 1d9941c62..c55657b57 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -145,8 +145,8 @@ class Generator { } }); }); - // // PR 1162: set log level during construction to avoid asynchronous issues - // this.setLogLevel(); + // PR 1162: set log level during construction to avoid asynchronous issues + this.setLogLevel(); } /** @@ -200,7 +200,7 @@ class Generator { this.validateAsyncAPIDocument(asyncapiDocument); await this.setupOutput(); // PR 1162: always set log level during construction to avoid asynchronous issues - this.setLogLevel(); + // this.setLogLevel(); await this.installAndSetupTemplate(); await this.configureTemplateWorkflow(parseOptions); @@ -856,7 +856,7 @@ class Generator { if (renderContent === undefined) { return; } else if (isReactTemplate(this.templateConfig)) { - await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs, this); + await saveRenderedReactContent(renderContent, outputPath, this.noOverwriteGlobs); } else { await writeFile(outputPath, renderContent); } diff --git a/lib/logMessages.js b/lib/logMessages.js index d3be3f20b..4bbcd82c1 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -46,10 +46,6 @@ function conditionalFilesMatched(relativeSourceFile) { return `${relativeSourceFile} was not generated because condition specified for this file in template configuration in conditionalFiles matched.`; } -function skipOverwriting(filePath) { - return `Skipping overwrite for: ${filePath}`; -} - module.exports = { TEMPLATE_INSTALL_FLAG_MSG, TEMPLATE_INSTALL_DISK_MSG, @@ -63,7 +59,6 @@ module.exports = { templateSuccessfullyInstalled, relativeSourceFileNotGenerated, conditionalFilesMatched, - fileNotOverwritten, - skipOverwriting + fileNotOverwritten }; \ No newline at end of file diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 45213e544..268fe2cfd 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -2,7 +2,6 @@ const path = require('path'); const AsyncReactSDK = require('@asyncapi/generator-react-sdk'); const minimatch = require('minimatch'); const log = require('loglevel'); -const logMessages = require('../logMessages'); const { writeFile } = require('../utils'); @@ -62,7 +61,7 @@ reactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { +const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = []) => { let filePath = outputPath; // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. let permissions = 0o666; @@ -87,8 +86,12 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = } } + // get the final file name of the file + const finalFileName = path.basename(filePath); + // check whether the filename should be ignored based on user's inputs + // const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); // reuse methods from the generator.js to check if the file should be overwritten - const shouldOverwrite = await generator.shouldOverwriteFile(filePath); + const shouldOverwrite = await reactExport.shouldOverwriteFile(filePath, noOverwriteGlobs); // Write the file only if it should not be skipped if (shouldOverwrite) { @@ -97,7 +100,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = }); } else { log.debug(`noOverwriteGlobs matched`); - log.debug(logMessages.skipOverwriting(filePath)); + log.debug(`Skipping overwrite for: ${filePath}`); } }; @@ -109,11 +112,11 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = * @param {String} outputPath Path to the file being rendered. * @param {String[]} noOverwriteGlobs globs to check for files that should not be overwritten. */ -reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = [], generator) => { +reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOverwriteGlobs = []) => { // If the rendered content is an array, we need to save each file individually if (Array.isArray(renderedContent)) { return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); } // Otherwise, we can save the single file - return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs, generator); + return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); }; diff --git a/test/integration.test.js b/test/integration.test.js index 407ee33bd..90f30de30 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -15,7 +15,6 @@ const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; const reactTemplate = 'test/test-templates/react-template'; const nunjucksTemplate = 'test/test-templates/nunjucks-template'; -const logMessage = require('../lib/logMessages'); const log = require('loglevel'); describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => { @@ -68,12 +67,12 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { - const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); - // log.debug = jest.fn(); + // const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); + log.debug = jest.fn(); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten - if (!existsSync(outputDir)) { + if (!await exists(outputDir)) { mkdirSync(outputDir, { recursive: true }); } // Create a variable to store the file content @@ -96,9 +95,15 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); // Check if the log debug message was printed - // await expect(logSpyDebug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); - await expect(logSpyDebug).toHaveBeenCalledWith(logMessage.skipOverwriting(testFilePath)); + await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); + await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); + // await console.log('All console.log calls:'); - logSpyDebug.mockRestore(); + // // Print all console.log calls + // await log.mock.calls.forEach((call, index) => { + // console.log(`${index + 1}:`, call); + // }); + + log.mockRestore(); }); }); From 49c8952147be87bb89e633670b35d13111e981d0 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:35:56 -0400 Subject: [PATCH 48/61] Revert "check whether a file path should be overwritten" This reverts commit 900faa962f02e67e4e52a1b99cec34aca1875519. --- lib/generator.js | 3 +++ lib/renderer/react.js | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index c55657b57..2e9ff3dce 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -963,6 +963,9 @@ class Generator { * @return {Promise} */ async shouldOverwriteFile(filePath) { + const fullPath = path.resolve(this.targetDir, filePath); + // Additional logging for debugging purposes + if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 268fe2cfd..2e15288d8 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -89,9 +89,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = // get the final file name of the file const finalFileName = path.basename(filePath); // check whether the filename should be ignored based on user's inputs - // const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); - // reuse methods from the generator.js to check if the file should be overwritten - const shouldOverwrite = await reactExport.shouldOverwriteFile(filePath, noOverwriteGlobs); + const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp)); // Write the file only if it should not be skipped if (shouldOverwrite) { From eebca77e0795b302bd201c12b3d1435a3c3ec99e Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:35:59 -0400 Subject: [PATCH 49/61] Revert "update filtersRegistry, generator, integration.test" This reverts commit 55f9ae778bff60e11b52d2507245b42bd60cc3eb. --- lib/filtersRegistry.js | 4 ++-- lib/generator.js | 1 - test/integration.test.js | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/filtersRegistry.js b/lib/filtersRegistry.js index 5a55cd938..15b23f0be 100644 --- a/lib/filtersRegistry.js +++ b/lib/filtersRegistry.js @@ -12,7 +12,7 @@ const { isAsyncFunction } = require('./utils'); */ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, filtersDir) => { await registerLocalFilters(nunjucks, templateDir, filtersDir); - await registerConfigFilters(nunjucks, templateDir, templateConfig); + registerConfigFilters(nunjucks, templateDir, templateConfig); }; /** @@ -22,7 +22,7 @@ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, f * @param {String} templateDir Directory where template is located. * @param {String} filtersDir Directory where local filters are located. */ -async function registerLocalFilters(nunjucks, templateDir, filtersDir) { +function registerLocalFilters(nunjucks, templateDir, filtersDir) { return new Promise((resolve, reject) => { const localFilters = path.resolve(templateDir, filtersDir); diff --git a/lib/generator.js b/lib/generator.js index 2e9ff3dce..b21fc11ac 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -9,7 +9,6 @@ const log = require('loglevel'); const Arborist = require('@npmcli/arborist'); const Config = require('@npmcli/config'); const requireg = require('requireg'); -console.log("requireg.resolve('npm'): ", requireg.resolve('npm')); const npmPath = requireg.resolve('npm').replace('index.js',''); const { isAsyncAPIDocument } = require('@asyncapi/parser/cjs/document'); diff --git a/test/integration.test.js b/test/integration.test.js index 90f30de30..7b0fb8452 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -97,12 +97,12 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the log debug message was printed await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); - // await console.log('All console.log calls:'); + console.log('All console.log calls:'); - // // Print all console.log calls - // await log.mock.calls.forEach((call, index) => { - // console.log(`${index + 1}:`, call); - // }); + // Print all console.log calls + await log.mock.calls.forEach((call, index) => { + console.log(`${index + 1}:`, call); + }); log.mockRestore(); }); From 2f3a3efaeea18ec7181e94c7ab4bea987e9d9a07 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:36:15 -0400 Subject: [PATCH 50/61] Reapply "update filtersRegistry, generator, integration.test" This reverts commit eebca77e0795b302bd201c12b3d1435a3c3ec99e. --- lib/filtersRegistry.js | 4 ++-- lib/generator.js | 1 + test/integration.test.js | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/filtersRegistry.js b/lib/filtersRegistry.js index 15b23f0be..5a55cd938 100644 --- a/lib/filtersRegistry.js +++ b/lib/filtersRegistry.js @@ -12,7 +12,7 @@ const { isAsyncFunction } = require('./utils'); */ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, filtersDir) => { await registerLocalFilters(nunjucks, templateDir, filtersDir); - registerConfigFilters(nunjucks, templateDir, templateConfig); + await registerConfigFilters(nunjucks, templateDir, templateConfig); }; /** @@ -22,7 +22,7 @@ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, f * @param {String} templateDir Directory where template is located. * @param {String} filtersDir Directory where local filters are located. */ -function registerLocalFilters(nunjucks, templateDir, filtersDir) { +async function registerLocalFilters(nunjucks, templateDir, filtersDir) { return new Promise((resolve, reject) => { const localFilters = path.resolve(templateDir, filtersDir); diff --git a/lib/generator.js b/lib/generator.js index b21fc11ac..2e9ff3dce 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -9,6 +9,7 @@ const log = require('loglevel'); const Arborist = require('@npmcli/arborist'); const Config = require('@npmcli/config'); const requireg = require('requireg'); +console.log("requireg.resolve('npm'): ", requireg.resolve('npm')); const npmPath = requireg.resolve('npm').replace('index.js',''); const { isAsyncAPIDocument } = require('@asyncapi/parser/cjs/document'); diff --git a/test/integration.test.js b/test/integration.test.js index 7b0fb8452..90f30de30 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -97,12 +97,12 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the log debug message was printed await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); - console.log('All console.log calls:'); + // await console.log('All console.log calls:'); - // Print all console.log calls - await log.mock.calls.forEach((call, index) => { - console.log(`${index + 1}:`, call); - }); + // // Print all console.log calls + // await log.mock.calls.forEach((call, index) => { + // console.log(`${index + 1}:`, call); + // }); log.mockRestore(); }); From f5a625185580bfae40e13550ede2ea901c7abb17 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:39:36 -0400 Subject: [PATCH 51/61] update package.json & integration.test.js - use spyOn instead of jest.fn() in integration.test.js - use regex (?!\\/loglevel\\.js$) in package.json --- package.json | 4 ++-- test/integration.test.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d00d0b012..567e9c6cf 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "test": "npm run test:unit && npm run test:integration && npm run test:cli", "test:unit": "jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project", "test:dev": "npm run test:unit -- --watchAll", - "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'", - "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'", + "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'", + "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'", "test:cli": "node cli.js ./test/docs/dummy.yml ./test/test-templates/react-template -o test/output --force-write --debug && test -e test/output/test-file.md", "test:cleanup": "rimraf \"test/temp\"", "docs": "jsdoc2md --partial docs/jsdoc2md-handlebars/custom-sig-name.hbs docs/jsdoc2md-handlebars/main.hbs docs/jsdoc2md-handlebars/docs.hbs docs/jsdoc2md-handlebars/header.hbs docs/jsdoc2md-handlebars/defaultvalue.hbs docs/jsdoc2md-handlebars/link.hbs docs/jsdoc2md-handlebars/params-table.hbs --files lib/generator.js > docs/api.md", diff --git a/test/integration.test.js b/test/integration.test.js index 90f30de30..0e1d3581e 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -67,8 +67,8 @@ describe('Integration testing generateFromFile() to make sure the result of the }); it('should ignore specified files with noOverwriteGlobs', async () => { - // const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); - log.debug = jest.fn(); + const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); + // log.debug = jest.fn(); const outputDir = generateFolderName(); // Manually create a file to test if it's not overwritten @@ -95,8 +95,8 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); // Check if the log debug message was printed - await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); - await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); + await expect(logSpyDebug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); + await expect(logSpyDebug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); // await console.log('All console.log calls:'); // // Print all console.log calls @@ -104,6 +104,6 @@ describe('Integration testing generateFromFile() to make sure the result of the // console.log(`${index + 1}:`, call); // }); - log.mockRestore(); + logSpyDebug.mockRestore(); }); }); From 0385f26edba7e6665866c66fc3b5a5581215fc6f Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 17:50:21 -0400 Subject: [PATCH 52/61] eliminated unnecessary comments and codes; --- lib/generator.js | 4 ---- lib/logMessages.js | 6 +++--- lib/renderer/react.js | 4 ++-- test/integration.test.js | 11 +++-------- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 2e9ff3dce..8e122d39e 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -9,7 +9,6 @@ const log = require('loglevel'); const Arborist = require('@npmcli/arborist'); const Config = require('@npmcli/config'); const requireg = require('requireg'); -console.log("requireg.resolve('npm'): ", requireg.resolve('npm')); const npmPath = requireg.resolve('npm').replace('index.js',''); const { isAsyncAPIDocument } = require('@asyncapi/parser/cjs/document'); @@ -963,9 +962,6 @@ class Generator { * @return {Promise} */ async shouldOverwriteFile(filePath) { - const fullPath = path.resolve(this.targetDir, filePath); - // Additional logging for debugging purposes - if (!Array.isArray(this.noOverwriteGlobs)) return true; const fileExists = await exists(path.resolve(this.targetDir, filePath)); if (!fileExists) return true; diff --git a/lib/logMessages.js b/lib/logMessages.js index 4bbcd82c1..472659d8a 100644 --- a/lib/logMessages.js +++ b/lib/logMessages.js @@ -38,8 +38,8 @@ function relativeSourceFileNotGenerated(relativeSourceFile , subject) { return `${relativeSourceFile} was not generated because ${subject} specified in template configuration in conditionalFiles was not found in provided AsyncAPI specification file.`; } -function fileNotOverwritten(relativeSourceFile) { - return `${relativeSourceFile} was not generated because it already exists and noOverwriteGlobs configuration in template configuration matched.`; +function skipOverwrite(testFilePath) { + return `Skipping overwrite for: ${testFilePath}`; } function conditionalFilesMatched(relativeSourceFile) { @@ -59,6 +59,6 @@ module.exports = { templateSuccessfullyInstalled, relativeSourceFileNotGenerated, conditionalFilesMatched, - fileNotOverwritten + skipOverwrite }; \ No newline at end of file diff --git a/lib/renderer/react.js b/lib/renderer/react.js index 2e15288d8..a9d508b14 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -1,6 +1,7 @@ const path = require('path'); const AsyncReactSDK = require('@asyncapi/generator-react-sdk'); const minimatch = require('minimatch'); +const logMessage = require('../logMessages.js'); const log = require('loglevel'); const { writeFile @@ -97,8 +98,7 @@ const saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = mode: permissions }); } else { - log.debug(`noOverwriteGlobs matched`); - log.debug(`Skipping overwrite for: ${filePath}`); + log.debug(logMessage.skipOverwrite(filePath)); } }; diff --git a/test/integration.test.js b/test/integration.test.js index 0e1d3581e..ea2f9ef09 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -15,6 +15,7 @@ const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; const reactTemplate = 'test/test-templates/react-template'; const nunjucksTemplate = 'test/test-templates/nunjucks-template'; +const logMessage = require('../lib/logMessages.js'); const log = require('loglevel'); describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => { @@ -95,15 +96,9 @@ describe('Integration testing generateFromFile() to make sure the result of the // Check if the files have been overwritten await expect(fileContent).toBe(testContent); // Check if the log debug message was printed - await expect(logSpyDebug).toHaveBeenCalledWith(`noOverwriteGlobs matched`); - await expect(logSpyDebug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`); - // await console.log('All console.log calls:'); - - // // Print all console.log calls - // await log.mock.calls.forEach((call, index) => { - // console.log(`${index + 1}:`, call); - // }); + await expect(logSpyDebug).toHaveBeenCalledWith(logMessage.skipOverwrite(testFilePath)); + // Clean up logSpyDebug.mockRestore(); }); }); From be28dea1fe1e2d3ab7f549be43ba0d8657f39856 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 18:01:44 -0400 Subject: [PATCH 53/61] normalize file path in integration test --- test/integration.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index ea2f9ef09..a1a35df31 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -20,8 +20,10 @@ const log = require('loglevel'); describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => { const generateFolderName = () => { - //you always want to generate to new directory to make sure test runs in clear environment - return path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex')); + // you always want to generate to new directory to make sure test runs in clear environment + // normalize the path for cross-platform compatibility + return path.normalize(path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex'))); + // return path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex')); }; jest.setTimeout(60000); From 12ada05913340619981b6773faf3ae60fff773ce Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Fri, 24 May 2024 18:28:35 -0400 Subject: [PATCH 54/61] normalize testFilePath in integration.test --- test/integration.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index a1a35df31..cb21cee6b 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -22,8 +22,8 @@ describe('Integration testing generateFromFile() to make sure the result of the const generateFolderName = () => { // you always want to generate to new directory to make sure test runs in clear environment // normalize the path for cross-platform compatibility - return path.normalize(path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex'))); - // return path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex')); + // return path.normalize(path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex'))); + return path.resolve(mainTestResultPath, crypto.randomBytes(4).toString('hex')); }; jest.setTimeout(60000); @@ -81,7 +81,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // Create a variable to store the file content const testContent = ''; // eslint-disable-next-line sonarjs/no-duplicate-string - const testFilePath = path.resolve(outputDir, testOutputFile); + const testFilePath = path.normalize(path.resolve(outputDir, testOutputFile)); await writeFile(testFilePath, testContent); // Manually create an output first, before generation, with additional custom file to validate if later it is still there, not overwritten From 06848d454ab9dde909befd1e04c8656333cdf154 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 28 May 2024 14:23:01 -0400 Subject: [PATCH 55/61] Update integration.test.js Add console.log for all the spied method calls --- test/integration.test.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index cb21cee6b..8f21b983e 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -29,11 +29,11 @@ describe('Integration testing generateFromFile() to make sure the result of the jest.setTimeout(60000); const testOutputFile = 'test-file.md'; - beforeAll(() => { - if (!existsSync(path.join(reactTemplate, 'package.json'))) { - throw new Error(`React template not found at ${reactTemplate}`); - } - }); + // beforeAll(() => { + // if (!existsSync(path.join(reactTemplate, 'package.json'))) { + // throw new Error(`React template not found at ${reactTemplate}`); + // } + // }); it('generated using Nunjucks template', async () => { const outputDir = generateFolderName(); @@ -74,7 +74,7 @@ describe('Integration testing generateFromFile() to make sure the result of the // log.debug = jest.fn(); const outputDir = generateFolderName(); - // Manually create a file to test if it's not overwritten + // // Manually create a file to test if it's not overwritten if (!await exists(outputDir)) { mkdirSync(outputDir, { recursive: true }); } @@ -95,10 +95,16 @@ describe('Integration testing generateFromFile() to make sure the result of the // Read the file to confirm it was not overwritten const fileContent = await readFile(testFilePath, 'utf8'); + + // check what it has been called with + logSpyDebug.mock.calls.forEach((call, index) => { + console.log(`Call ${index + 1}:`, call); + }); + // Check if the files have been overwritten - await expect(fileContent).toBe(testContent); + expect(fileContent).toBe(testContent); // Check if the log debug message was printed - await expect(logSpyDebug).toHaveBeenCalledWith(logMessage.skipOverwrite(testFilePath)); + expect(logSpyDebug).toHaveBeenCalledWith(logMessage.skipOverwrite(testFilePath)); // Clean up logSpyDebug.mockRestore(); From 1ec96a4a11d1d3346d512ca31c26f1939b1f5448 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 28 May 2024 14:25:57 -0400 Subject: [PATCH 56/61] Update integration.test.js delete unused existsSync --- test/integration.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration.test.js b/test/integration.test.js index 8f21b983e..d90d5f2e0 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -3,7 +3,6 @@ */ const { readFile } = require('fs').promises; -const { existsSync } = require('fs'); const path = require('path'); const Generator = require('../lib/generator'); const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); From 61d795a2d6edf7f3f3f6da67c236b175a8b8b18d Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 28 May 2024 18:05:03 -0400 Subject: [PATCH 57/61] Update integration.test.js delete console.log() and use readFileSync --- test/integration.test.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index d90d5f2e0..cfcc9d546 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -9,7 +9,7 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); -const {mkdirSync} = require('fs'); +const {mkdirSync, readFileSync} = require('fs'); const {exists, writeFile} = require('../lib/utils'); const mainTestResultPath = 'test/temp/integrationTestResult'; const reactTemplate = 'test/test-templates/react-template'; @@ -93,13 +93,7 @@ describe('Integration testing generateFromFile() to make sure the result of the await generator.generateFromFile(dummySpecPath); // Read the file to confirm it was not overwritten - const fileContent = await readFile(testFilePath, 'utf8'); - - // check what it has been called with - logSpyDebug.mock.calls.forEach((call, index) => { - console.log(`Call ${index + 1}:`, call); - }); - + const fileContent = readFileSync(testFilePath, 'utf8'); // Check if the files have been overwritten expect(fileContent).toBe(testContent); // Check if the log debug message was printed From f5180b77481d2b8c292215f481be927f87c4b4f1 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Mon, 10 Jun 2024 16:13:10 -0400 Subject: [PATCH 58/61] add await to saveContentToFile --- lib/renderer/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/renderer/react.js b/lib/renderer/react.js index a9d508b14..b4175739b 100644 --- a/lib/renderer/react.js +++ b/lib/renderer/react.js @@ -116,5 +116,5 @@ reactExport.saveRenderedReactContent = async (renderedContent, outputPath, noOve return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath, noOverwriteGlobs))); } // Otherwise, we can save the single file - return saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); + return await saveContentToFile(renderedContent, outputPath, noOverwriteGlobs); }; From 4305a9cf7329ef99bde5ea746ef8241421a0d524 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 11 Jun 2024 16:32:15 -0400 Subject: [PATCH 59/61] used fspromise --- test/integration.test.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index cfcc9d546..cce377fe5 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -3,6 +3,7 @@ */ const { readFile } = require('fs').promises; +const { promises: fsPromise } = require('fs'); const path = require('path'); const Generator = require('../lib/generator'); const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); @@ -36,7 +37,7 @@ describe('Integration testing generateFromFile() to make sure the result of the it('generated using Nunjucks template', async () => { const outputDir = generateFolderName(); - const generator = new Generator(nunjucksTemplate, outputDir, { + const generator = new Generator(nunjucksTemplate, outputDir, { forceWrite: true, templateParams: { version: 'v1', mode: 'production' } }); @@ -47,7 +48,7 @@ describe('Integration testing generateFromFile() to make sure the result of the it('generate using React template', async () => { const outputDir = generateFolderName(); - const generator = new Generator(reactTemplate, outputDir, { + const generator = new Generator(reactTemplate, outputDir, { forceWrite: true , templateParams: { version: 'v1', mode: 'production' } }); @@ -70,18 +71,16 @@ describe('Integration testing generateFromFile() to make sure the result of the it('should ignore specified files with noOverwriteGlobs', async () => { const logSpyDebug = jest.spyOn(log, 'debug').mockImplementation(() => {}); - // log.debug = jest.fn(); + // log.debug = jest.fn(); const outputDir = generateFolderName(); - // // Manually create a file to test if it's not overwritten - if (!await exists(outputDir)) { - mkdirSync(outputDir, { recursive: true }); - } + // Manually create a file to test if it's not overwritten + await fsPromise.mkdir(outputDir, { recursive: true }); // Create a variable to store the file content const testContent = ''; // eslint-disable-next-line sonarjs/no-duplicate-string const testFilePath = path.normalize(path.resolve(outputDir, testOutputFile)); - await writeFile(testFilePath, testContent); + await fsPromise.writeFile(testFilePath, testContent); // Manually create an output first, before generation, with additional custom file to validate if later it is still there, not overwritten const generator = new Generator(reactTemplate, outputDir, { From 2ee44dbb63dcd2787970048ae4ac28031ba064ed Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 11 Jun 2024 16:58:26 -0400 Subject: [PATCH 60/61] test again --- .turbo/cookies/1.cookie | 0 .turbo/cookies/2.cookie | 0 .turbo/cookies/3.cookie | 0 .turbo/cookies/4.cookie | 0 .../01d1f58aa0a715cf-turbo.log.2024-06-11 | 839 ++++++++++++++++++ apps/generator/.turbo/turbo-test.log | 415 +++++++++ 6 files changed, 1254 insertions(+) create mode 100644 .turbo/cookies/1.cookie create mode 100644 .turbo/cookies/2.cookie create mode 100644 .turbo/cookies/3.cookie create mode 100644 .turbo/cookies/4.cookie create mode 100644 .turbo/daemon/01d1f58aa0a715cf-turbo.log.2024-06-11 create mode 100644 apps/generator/.turbo/turbo-test.log diff --git a/.turbo/cookies/1.cookie b/.turbo/cookies/1.cookie new file mode 100644 index 000000000..e69de29bb diff --git a/.turbo/cookies/2.cookie b/.turbo/cookies/2.cookie new file mode 100644 index 000000000..e69de29bb diff --git a/.turbo/cookies/3.cookie b/.turbo/cookies/3.cookie new file mode 100644 index 000000000..e69de29bb diff --git a/.turbo/cookies/4.cookie b/.turbo/cookies/4.cookie new file mode 100644 index 000000000..e69de29bb diff --git a/.turbo/daemon/01d1f58aa0a715cf-turbo.log.2024-06-11 b/.turbo/daemon/01d1f58aa0a715cf-turbo.log.2024-06-11 new file mode 100644 index 000000000..6b667ef5d --- /dev/null +++ b/.turbo/daemon/01d1f58aa0a715cf-turbo.log.2024-06-11 @@ -0,0 +1,839 @@ +2024-06-11T20:57:07.298358Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.300810Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.301446Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.301527Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.316720Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.317044Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.321758Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.324535Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.326160Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.326521Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.431164Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.431737Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.432426Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.433398Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.434620Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.434843Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.442466Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.443445Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.443750Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.464416Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.466299Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.472115Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.475466Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.490137Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.493421Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.493428Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.494330Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.494924Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.495735Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.496731Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.497187Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.497771Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.498453Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.498959Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.499530Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.499608Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.500353Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.500445Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.500966Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.501817Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502455Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502458Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502459Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502460Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502461Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502462Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502463Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502464Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502465Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502466Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.502543Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.503032Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.503043Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.503601Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.503674Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.504164Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.504725Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.505491Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.506046Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.506601Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.507149Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.507496Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.509237Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.510114Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.510831Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.511475Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.512137Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.512799Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.514467Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.515297Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.519208Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.519919Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.520755Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.521323Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.521890Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.522461Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.522958Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.527512Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.528074Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.528092Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.528243Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.529151Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.530258Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.531271Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.532186Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.533225Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.535851Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.537065Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.537813Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.539036Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.540281Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.540367Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.541061Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.541827Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.542579Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.542913Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.542917Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.544326Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.545415Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.546214Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.547198Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.548476Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.549338Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.550667Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.551417Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.552503Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.553354Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.553877Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.556807Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.558654Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.560935Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.561188Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.563811Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.567268Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.571069Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.571396Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.572236Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.573088Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.573782Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.574653Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.574740Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.575396Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.575992Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.577115Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.578059Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.578894Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.579641Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.580817Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.581929Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.582888Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.583673Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.584662Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.585212Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.585524Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.586416Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.587200Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.588454Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.589271Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.589857Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.590922Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.591809Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.592664Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.593307Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.593389Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.594127Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.594167Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.595069Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.596137Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.597011Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.597965Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.598472Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.600466Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.601839Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.602443Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.603266Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.604110Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.604697Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.606183Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.606773Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.607579Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.608363Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.609179Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.610261Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.611129Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.611275Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.613401Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.614233Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.614357Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.615234Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.616417Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.616421Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.617085Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.617089Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.618281Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.618285Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.618360Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.619171Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.620333Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.621470Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.622189Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.622267Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.623124Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.623892Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.623896Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.624083Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.625130Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.625918Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.626314Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.638537Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.641882Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.642948Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.643793Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.644809Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.644814Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.644888Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.645878Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.646850Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.648025Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.648808Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.649415Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.649924Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.650003Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.650710Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.651286Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.651794Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.652639Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.652644Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.652646Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.652649Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.652650Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.653213Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.653994Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.654562Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.655120Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.656074Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.656607Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.664657Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.665626Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.666497Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.667588Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.668343Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.669451Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.670848Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.671152Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.686757Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.686832Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.687469Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.688674Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.689236Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.689737Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.690573Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.690724Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.707555Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.708592Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.709737Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.710434Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.711472Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.712339Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.714518Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.715345Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.715505Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.716239Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.717040Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.718065Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.719020Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.720539Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.722530Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.722534Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.723260Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.723345Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.726049Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.727566Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.728208Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.728792Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.729487Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.729577Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.730414Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.731440Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.731745Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.731749Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.738355Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.739388Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.739968Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.740468Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.741036Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.741537Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.742487Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.754898Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.755770Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.758865Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.759339Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.767828Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.769700Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.771930Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.772705Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.773156Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.773160Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.774092Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.774173Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.777023Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.780362Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.784113Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.796129Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.797453Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.800193Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.802106Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.803405Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.804540Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.804842Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.807342Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.808546Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.810369Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.811111Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.812388Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.813490Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.814062Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.814627Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.815202Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.815281Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.816243Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.817200Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.818598Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.819779Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.821562Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.821845Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.821921Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.822653Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.822656Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.823553Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.824656Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.825794Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.826778Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.829260Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.838693Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.839631Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.840560Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.840641Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.841679Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.842672Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.843716Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.844148Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.854924Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.854927Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.856367Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.856646Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.857364Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.858362Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.859277Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.861636Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.861845Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.864224Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.866040Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.866431Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.877208Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.878807Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.879913Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.880880Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.880960Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.881848Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.882803Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.883678Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.883773Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.889625Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.895398Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.897369Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.901392Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.901697Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.902864Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.905795Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.906952Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.907819Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.911586Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.913026Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.914207Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.916710Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.918474Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.921029Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.921750Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.922622Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.923509Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.923802Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.924651Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.925551Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.926509Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.927602Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.928252Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.928983Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.929789Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.930930Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.930932Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.930933Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.930934Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.932032Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.933113Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.933116Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.933117Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.933261Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.933680Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.940451Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.942050Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.942613Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.943303Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.943921Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.944548Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.960411Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.962782Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.964132Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.964908Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.964990Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.965924Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.969954Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.971435Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.971713Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.972199Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.972203Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.972229Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.972232Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.972465Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.976393Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.986866Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:07.990156Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.018507Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.019485Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.020822Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.032780Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.034247Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.036878Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.039116Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.041949Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.042026Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.043803Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.044972Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.045525Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.045530Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.045882Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.052919Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.053914Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.054911Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.055085Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.062856Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.063855Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.065717Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.067174Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.067426Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.075016Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.075772Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.076714Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.078136Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.079237Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.081175Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.084887Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.084893Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.086862Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.088253Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.090755Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.092680Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.095128Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.096138Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.097347Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.097825Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.104879Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.105219Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.105221Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.105223Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.105225Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.112862Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.112878Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.114727Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.115284Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.115706Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.117136Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.117493Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.125037Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.126432Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.127281Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.127445Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.128439Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.128530Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.136250Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.137417Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.139213Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.140664Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.144657Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.145715Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.146746Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.147760Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.148940Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.149200Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.155414Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.157311Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.158187Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.158327Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.159059Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.159639Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.159769Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.160304Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.160395Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.166280Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.167023Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.167139Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.168293Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.169184Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.170070Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.170147Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.170965Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.171064Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.172179Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.181992Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.183249Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.184108Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.184925Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.185932Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.186923Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.187083Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.206181Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.206893Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.209819Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.213056Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.215592Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.219258Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.219568Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.219719Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.221275Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.222092Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.222172Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.224227Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.224231Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.224762Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.226807Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.228695Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.228700Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.229977Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.230064Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.231185Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.231189Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.231193Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.231270Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.231348Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.231917Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.232900Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.232983Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.233863Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.234636Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.235669Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.235750Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.236718Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237844Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237851Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237852Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237854Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237855Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237856Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237857Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237858Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237861Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.237862Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.239961Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.240042Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.240633Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.251047Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.251993Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.253127Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.254565Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.255499Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.256479Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.257428Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.257866Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.258801Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.260032Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.261344Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.261915Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.268416Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.270426Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.274009Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.275275Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.275841Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.275842Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.276641Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.277220Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.277249Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.277253Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.277751Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278338Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278339Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278340Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278341Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278343Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278347Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278348Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278349Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278358Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278360Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.278585Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.287493Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.288277Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.288281Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.288282Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.288285Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.288286Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.289097Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.289830Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.290460Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.291082Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.291706Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.292358Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.293630Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.294489Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.294525Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.295340Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302229Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302238Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302242Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302254Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302824Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302842Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.302844Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.303624Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.304571Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.305525Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.305600Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.306104Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.306912Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.306997Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.307662Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.316090Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.317317Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.318348Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.319897Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.320796Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.321854Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.322214Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.330192Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.330208Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.330354Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.331801Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.333130Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.334153Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.335517Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.338103Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.339027Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.342127Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.344541Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.346154Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.348864Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.350269Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.352983Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.353061Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.354161Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.354678Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.354756Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.360818Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.361795Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.361827Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.361829Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.362792Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.363681Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.364657Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.364660Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.367189Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.369083Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.369086Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.370270Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.371727Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.375054Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.376198Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.377653Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.378684Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.378687Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.378752Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.379819Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.380853Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.382476Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.382704Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.399915Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.402214Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.403581Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.405124Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.406051Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.406127Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.407288Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.407469Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.418143Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.418149Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.419941Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.422035Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.423960Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.424766Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.425805Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.427555Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.428652Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.428734Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.431988Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.433214Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.435431Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.440300Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.442585Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.442671Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.448279Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.448360Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.449445Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.449522Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.450471Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.450474Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.451360Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.453767Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.454569Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.455512Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.457670Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.458746Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.459618Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.460181Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.461200Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.461727Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.462848Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.463684Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.463689Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.463690Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.463691Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.463768Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.464336Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.465048Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.465691Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.466419Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.467093Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.467581Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.467601Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.468663Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.468669Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.468889Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.477552Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.479304Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.481306Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.482419Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.482504Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.483764Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.483768Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.483769Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.484829Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.485441Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.491844Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.498696Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.500660Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.500665Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.500668Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.500697Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.503359Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.503363Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.504388Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.504391Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.504471Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.506592Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.507567Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.508750Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.512725Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518195Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518705Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518707Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518708Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518714Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518717Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518723Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.518725Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.519679Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.519755Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.520225Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.520888Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.521365Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.521373Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.521375Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.522016Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.523405Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.523485Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.523969Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.524529Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.525555Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.525701Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.526418Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.526424Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.527818Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.528373Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.528882Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.531411Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.532122Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.532206Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.533031Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.533332Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.535312Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.536321Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.538545Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.543335Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.544177Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.544297Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.549238Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.551153Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.552161Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.552995Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.553894Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.554603Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.555130Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.565464Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.566337Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.567588Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.567662Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.569254Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.569331Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.570054Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.571080Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.572328Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.573193Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.595040Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.595963Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.595966Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.596041Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.596530Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.597169Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.597761Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.597842Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.598089Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.600694Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.602187Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.603078Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.603752Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.603839Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.604495Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.605080Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.605778Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.606345Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.606363Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.607554Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.608911Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.609135Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.614479Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.615286Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.616804Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.618124Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.618838Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.640353Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.641632Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.642259Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.642877Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.643460Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.644569Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.645211Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.645851Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.645929Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.646427Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.646430Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.646445Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.647596Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.648374Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.649499Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.649792Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.662166Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:08.799960Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:09.818494Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:09.819147Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:09.819780Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:09.820495Z WARN turborepo_lib::package_changes_watcher: file event lagged +2024-06-11T20:57:09.820573Z WARN turborepo_lib::package_changes_watcher: file event lagged diff --git a/apps/generator/.turbo/turbo-test.log b/apps/generator/.turbo/turbo-test.log new file mode 100644 index 000000000..bc69acf9c --- /dev/null +++ b/apps/generator/.turbo/turbo-test.log @@ -0,0 +1,415 @@ +npm verb cli /Users/yuanyuan/.nvm/versions/node/v18.18.0/bin/node /Users/yuanyuan/.nvm/versions/node/v18.18.0/bin/npm +npm info using npm@9.8.1 +npm info using node@v18.18.0 +npm info found workspace root at /Users/yuanyuan/workspace/generator +npm verb title npm run test +npm verb argv "run" "test" +npm verb logfile logs-max:10 dir:/Users/yuanyuan/.npm/_logs/2024-06-11T20_49_56_306Z- +npm verb logfile /Users/yuanyuan/.npm/_logs/2024-06-11T20_49_56_306Z-debug-0.log + +> @asyncapi/generator@2.0.1 test +> npm run test:unit && npm run test:integration && npm run test:cli + +npm verb cli /Users/yuanyuan/.nvm/versions/node/v18.18.0/bin/node /Users/yuanyuan/.nvm/versions/node/v18.18.0/bin/npm +npm info using npm@9.8.1 +npm info using node@v18.18.0 +npm info found workspace root at /Users/yuanyuan/workspace/generator +npm verb title npm run test:unit +npm verb argv "run" "test:unit" +npm verb logfile logs-max:10 dir:/Users/yuanyuan/.npm/_logs/2024-06-11T20_49_56_470Z- +npm verb logfile /Users/yuanyuan/.npm/_logs/2024-06-11T20_49_56_470Z-debug-0.log + +> @asyncapi/generator@2.0.1 test:unit +> jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project + +Determining test suites to run... + +Test Suites: 0 of 5 total +Tests: 0 total +Snapshots: 0 total +Time: 0 s, estimated 4 s +████████████████████████████████████████             + +Test Suites: 0 of 5 total +Tests: 0 total +Snapshots: 0 total +Time: 0 s, estimated 4 s +████████████████████████████████████████             + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/renderer.test.js + RUNS  test/generator.test.js + +Test Suites: 0 of 5 total +Tests: 0 total +Snapshots: 0 total +Time: 0 s, estimated 4 s +████████████████████████████████████████                       PASS  test/renderer.test.js + + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/renderer.test.js + RUNS  test/generator.test.js + +Test Suites: 0 of 5 total +Tests: 0 total +Snapshots: 0 total +Time: 0 s, estimated 4 s +████████████████████████████████████████                       + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/renderer.test.js + RUNS  test/generator.test.js + +Test Suites: 0 of 5 total +Tests: 0 total +Snapshots: 0 total +Time: 0 s, estimated 4 s +████████████████████████████████████████                       + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/generator.test.js + +Test Suites: 1 passed, 1 of 5 total +Tests: 4 passed, 4 total +Snapshots: 0 total +Time: 0 s, estimated 4 s +████████████████████████████████████████                     + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/generator.test.js + +Test Suites: 1 passed, 1 of 5 total +Tests: 4 passed, 4 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                     + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/generator.test.js + +Test Suites: 1 passed, 1 of 5 total +Tests: 11 passed, 11 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                     + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/generator.test.js + +Test Suites: 1 passed, 1 of 5 total +Tests: 26 passed, 26 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                     + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/generator.test.js + +Test Suites: 1 passed, 1 of 5 total +Tests: 29 passed, 29 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                     PASS  test/templateConfigValidator.test.js + + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/templateConfigValidator.test.js + RUNS  test/generator.test.js + +Test Suites: 1 passed, 1 of 5 total +Tests: 29 passed, 29 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                     + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/generator.test.js + +Test Suites: 2 passed, 2 of 5 total +Tests: 34 passed, 34 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                   PASS  test/utils.test.js + + RUNS  test/parser.test.js + RUNS  test/utils.test.js + RUNS  test/generator.test.js + +Test Suites: 2 passed, 2 of 5 total +Tests: 34 passed, 34 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                   + RUNS  test/parser.test.js + RUNS  test/generator.test.js + +Test Suites: 3 passed, 3 of 5 total +Tests: 40 passed, 40 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                 + RUNS  test/parser.test.js + RUNS  test/generator.test.js + +Test Suites: 3 passed, 3 of 5 total +Tests: 53 passed, 53 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                 PASS  test/parser.test.js + + RUNS  test/parser.test.js + RUNS  test/generator.test.js + +Test Suites: 3 passed, 3 of 5 total +Tests: 53 passed, 53 total +Snapshots: 0 total +Time: 1 s, estimated 4 s +████████████████████████████████████████                 + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 54 passed, 54 total +Snapshots: 0 total +Time: 2 s, estimated 4 s +████████████████████████████████████████              /Users/yuanyuan/workspace/generator/node_modules/@jest/expect/node_modules/expect/build/index.js:314 + throw error; + ^ + +JestAssertionError: expect(jest.fn()).toHaveBeenCalledTimes(expected) + +Expected number of calls: 1 +Received number of calls: 0 + at Timeout.toHaveBeenCalledTimes [as _onTimeout] (/Users/yuanyuan/workspace/generator/apps/generator/test/generator.test.js:361:36) + at listOnTimeout (node:internal/timers:569:17) + at processTimers (node:internal/timers:512:7) { + matcherResult: { + message: '\x1B[2mexpect(\x1B[22m\x1B[31mjest.fn()\x1B[39m\x1B[2m).\x1B[22mtoHaveBeenCalledTimes\x1B[2m(\x1B[22m\x1B[32mexpected\x1B[39m\x1B[2m)\x1B[22m\n' + + '\n' + + 'Expected number of calls: \x1B[32m1\x1B[39m\n' + + 'Received number of calls: \x1B[31m0\x1B[39m', + pass: false + } +} + +Node.js v18.18.0 + + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 54 passed, 54 total +Snapshots: 0 total +Time: 2 s, estimated 4 s +████████████████████████████████████████               + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 84 passed, 84 total +Snapshots: 0 total +Time: 2 s, estimated 4 s +████████████████████████████████████████               + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 84 passed, 84 total +Snapshots: 0 total +Time: 3 s, estimated 4 s +████████████████████████████████████████               + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 96 passed, 96 total +Snapshots: 0 total +Time: 3 s, estimated 4 s +████████████████████████████████████████              /Users/yuanyuan/workspace/generator/node_modules/@jest/expect/node_modules/expect/build/index.js:314 + throw error; + ^ + +JestAssertionError: expect(jest.fn()).toHaveBeenCalledTimes(expected) + +Expected number of calls: 1 +Received number of calls: 0 + at Timeout.toHaveBeenCalledTimes [as _onTimeout] (/Users/yuanyuan/workspace/generator/apps/generator/test/generator.test.js:361:36) + at listOnTimeout (node:internal/timers:569:17) + at processTimers (node:internal/timers:512:7) { + matcherResult: { + message: '\x1B[2mexpect(\x1B[22m\x1B[31mjest.fn()\x1B[39m\x1B[2m).\x1B[22mtoHaveBeenCalledTimes\x1B[2m(\x1B[22m\x1B[32mexpected\x1B[39m\x1B[2m)\x1B[22m\n' + + '\n' + + 'Expected number of calls: \x1B[32m1\x1B[39m\n' + + 'Received number of calls: \x1B[31m0\x1B[39m', + pass: false + } +} + +Node.js v18.18.0 + + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 96 passed, 96 total +Snapshots: 0 total +Time: 3 s, estimated 4 s +████████████████████████████████████████               + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 126 passed, 126 total +Snapshots: 0 total +Time: 3 s, estimated 4 s +████████████████████████████████████████               + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 126 passed, 126 total +Snapshots: 0 total +Time: 4 s             + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 126 passed, 126 total +Snapshots: 0 total +Time: 5 s             + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 138 passed, 138 total +Snapshots: 0 total +Time: 5 s            /Users/yuanyuan/workspace/generator/node_modules/@jest/expect/node_modules/expect/build/index.js:314 + throw error; + ^ + +JestAssertionError: expect(jest.fn()).toHaveBeenCalledTimes(expected) + +Expected number of calls: 1 +Received number of calls: 0 + at Timeout.toHaveBeenCalledTimes [as _onTimeout] (/Users/yuanyuan/workspace/generator/apps/generator/test/generator.test.js:361:36) + at listOnTimeout (node:internal/timers:569:17) + at processTimers (node:internal/timers:512:7) { + matcherResult: { + message: '\x1B[2mexpect(\x1B[22m\x1B[31mjest.fn()\x1B[39m\x1B[2m).\x1B[22mtoHaveBeenCalledTimes\x1B[2m(\x1B[22m\x1B[32mexpected\x1B[39m\x1B[2m)\x1B[22m\n' + + '\n' + + 'Expected number of calls: \x1B[32m1\x1B[39m\n' + + 'Received number of calls: \x1B[31m0\x1B[39m', + pass: false + } +} + +Node.js v18.18.0 + + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 138 passed, 138 total +Snapshots: 0 total +Time: 5 s             + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 168 passed, 168 total +Snapshots: 0 total +Time: 5 s             + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 168 passed, 168 total +Snapshots: 0 total +Time: 6 s             + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 168 passed, 168 total +Snapshots: 0 total +Time: 7 s             + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 180 passed, 180 total +Snapshots: 0 total +Time: 7 s            /Users/yuanyuan/workspace/generator/node_modules/@jest/expect/node_modules/expect/build/index.js:314 + throw error; + ^ + +JestAssertionError: expect(jest.fn()).toHaveBeenCalledTimes(expected) + +Expected number of calls: 1 +Received number of calls: 0 + at Timeout.toHaveBeenCalledTimes [as _onTimeout] (/Users/yuanyuan/workspace/generator/apps/generator/test/generator.test.js:361:36) + at listOnTimeout (node:internal/timers:569:17) + at processTimers (node:internal/timers:512:7) { + matcherResult: { + message: '\x1B[2mexpect(\x1B[22m\x1B[31mjest.fn()\x1B[39m\x1B[2m).\x1B[22mtoHaveBeenCalledTimes\x1B[2m(\x1B[22m\x1B[32mexpected\x1B[39m\x1B[2m)\x1B[22m\n' + + '\n' + + 'Expected number of calls: \x1B[32m1\x1B[39m\n' + + 'Received number of calls: \x1B[31m0\x1B[39m', + pass: false + } +} + +Node.js v18.18.0 + + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 180 passed, 180 total +Snapshots: 0 total +Time: 7 s             FAIL  test/generator.test.js + + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 180 passed, 180 total +Snapshots: 0 total +Time: 7 s             ● Test suite failed to run + + Jest worker encountered 4 child process exceptions, exceeding retry limit + + at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:21) + + + RUNS  test/generator.test.js + +Test Suites: 4 passed, 4 of 5 total +Tests: 180 passed, 180 total +Snapshots: 0 total +Time: 7 s            -----------------------------|---------|----------|---------|---------|------------------------------------------------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------------------------|---------|----------|---------|---------|------------------------------------------------------------- +All files  |  32.17 |  22.31 |  20.68 |  33.81 |   + lib  |  29.6 |  20.9 |  18.38 |  31.11 |   + filtersRegistry.js  |  10.41 |  0 |  0 |  11.11 | 14-118  + generator.js  |  10.44 |  0 |  0 |  11.62 | 55,58,99-1083  + hooksRegistry.js  |  8.51 |  0 |  0 |  9.3 | 13-120  + logMessages.js  |  40 |  0 |  12.5 |  40 | 10-14,22-42  + parser.js  |  50.68 |  43.47 |  35.71 |  54.54 | 59,62,67,70,74-75,92-144  + templateConfigValidator.js |  100 |  95.55 |  100 |  100 | 100,148  + utils.js  |  70.51 |  47.82 |  25 |  70.51 | 42,55-59,69-70,80,90-92,104,114-115,124,134,157,196,217-222 + lib/renderer  |  74.41 |  50 |  55.55 |  77.5 |   + nunjucks.js  |  30.76 |  0 |  0 |  36.36 | 12-15,31-39  + react.js  |  93.33 |  64.28 |  100 |  93.1 | 68,72  +-----------------------------|---------|----------|---------|---------|------------------------------------------------------------- +Test Suites: 1 failed, 4 passed, 5 total +Tests: 42 passed, 42 total +Snapshots: 0 total +Time: 7.383 s +Ran all test suites. +npm ERR! Lifecycle script `test:unit` failed with error: +npm ERR! Error: command failed +npm ERR!  in workspace: @asyncapi/generator@2.0.1 +npm ERR!  at location: /Users/yuanyuan/workspace/generator/apps/generator +npm verb exit 1 +npm verb code 1 +npm ERR! Lifecycle script `test` failed with error: +npm ERR! Error: command failed +npm ERR!  in workspace: @asyncapi/generator@2.0.1 +npm ERR!  at location: /Users/yuanyuan/workspace/generator/apps/generator +npm verb exit 1 +npm verb code 1 + From 2d77e3c90a45faa9f99de5c8a447839b278cc8a5 Mon Sep 17 00:00:00 2001 From: lmgyuan Date: Tue, 25 Jun 2024 10:46:31 -0400 Subject: [PATCH 61/61] delete unnecessary declarations in integration test --- test/integration.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index cce377fe5..a2a66e816 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -10,8 +10,7 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); -const {mkdirSync, readFileSync} = require('fs'); -const {exists, writeFile} = require('../lib/utils'); +const { readFileSync} = require('fs'); const mainTestResultPath = 'test/temp/integrationTestResult'; const reactTemplate = 'test/test-templates/react-template'; const nunjucksTemplate = 'test/test-templates/nunjucks-template';