From d4f5b5cfe426fa4be45ed7d536fc6ef603d906cf Mon Sep 17 00:00:00 2001 From: Mario Estrada Date: Sat, 22 Sep 2018 14:27:30 -0600 Subject: [PATCH] feat(cli): change location fixtures service/repository --- packages/cli/generators/service/index.js | 3 - .../cli/test/fixtures/repository/index.js | 89 +++++++ .../models/decoratordefined.model.txt | 17 ++ .../repository/models/defaultmodel.model.txt | 26 ++ .../repository/models/invalid-id.model.txt | 20 ++ .../repository/models/multi-word.model.txt | 20 ++ packages/cli/test/fixtures/service/index.js | 61 +++++ .../generators/repository.integration.js | 243 ++---------------- .../generators/service.integration.js | 103 +------- packages/cli/test/test-utils.js | 2 +- 10 files changed, 260 insertions(+), 324 deletions(-) create mode 100644 packages/cli/test/fixtures/repository/index.js create mode 100644 packages/cli/test/fixtures/repository/models/decoratordefined.model.txt create mode 100644 packages/cli/test/fixtures/repository/models/defaultmodel.model.txt create mode 100644 packages/cli/test/fixtures/repository/models/invalid-id.model.txt create mode 100644 packages/cli/test/fixtures/repository/models/multi-word.model.txt create mode 100644 packages/cli/test/fixtures/service/index.js diff --git a/packages/cli/generators/service/index.js b/packages/cli/generators/service/index.js index c0996b26e920..a040c2d76ae1 100644 --- a/packages/cli/generators/service/index.js +++ b/packages/cli/generators/service/index.js @@ -77,7 +77,6 @@ module.exports = class ServiceGenerator extends ArtifactGenerator { * Ask for Service Name */ async promptArtifactName() { - if (this.shouldExit()) return false; debug('Prompting for service name'); if (this.options.name) { @@ -100,8 +99,6 @@ module.exports = class ServiceGenerator extends ArtifactGenerator { } async promptDataSourceName() { - if (this.shouldExit()) return false; - debug('Prompting for a datasource '); let cmdDatasourceName; let datasourcesList; diff --git a/packages/cli/test/fixtures/repository/index.js b/packages/cli/test/fixtures/repository/index.js new file mode 100644 index 000000000000..b1eb744e9382 --- /dev/null +++ b/packages/cli/test/fixtures/repository/index.js @@ -0,0 +1,89 @@ +const DATASOURCE_APP_PATH = 'src/datasources'; +const MODEL_APP_PATH = 'src/models'; +const CONFIG_PATH = '.'; +const DUMMY_CONTENT = '--DUMMY VALUE--'; +const fs = require('fs'); + +exports.SANDBOX_FILES = [ + { + path: CONFIG_PATH, + file: 'myconfig.json', + content: JSON.stringify({ + datasource: 'dbmem', + model: 'decoratordefined', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'dbkv.datasource.json', + content: JSON.stringify({ + name: 'dbkv', + connector: 'kv-redis', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'dbkv.datasource.ts', + content: DUMMY_CONTENT, + }, + { + path: DATASOURCE_APP_PATH, + file: 'dbmem.datasource.json', + content: JSON.stringify({ + name: 'dbmem', + connector: 'memory', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'dbmem.datasource.ts', + content: DUMMY_CONTENT, + }, + { + path: DATASOURCE_APP_PATH, + file: 'restdb.datasource.json', + content: JSON.stringify({ + name: 'restdb', + connector: 'rest', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'restdb.datasource.ts', + content: DUMMY_CONTENT, + }, + { + path: MODEL_APP_PATH, + file: 'decoratordefined.model.ts', + content: fs.readFileSync( + require.resolve('./models/decoratordefined.model.txt'), + { + encoding: 'utf-8', + }, + ), + }, + { + path: MODEL_APP_PATH, + file: 'defaultmodel.model.ts', + content: fs.readFileSync( + require.resolve('./models/defaultmodel.model.txt'), + { + encoding: 'utf-8', + }, + ), + }, + { + path: MODEL_APP_PATH, + file: 'multi-word.model.ts', + content: fs.readFileSync(require.resolve('./models/multi-word.model.txt'), { + encoding: 'utf-8', + }), + }, + { + path: MODEL_APP_PATH, + file: 'invalid-id.model.ts', + content: fs.readFileSync(require.resolve('./models/invalid-id.model.txt'), { + encoding: 'utf-8', + }), + }, +]; diff --git a/packages/cli/test/fixtures/repository/models/decoratordefined.model.txt b/packages/cli/test/fixtures/repository/models/decoratordefined.model.txt new file mode 100644 index 000000000000..310477c889e1 --- /dev/null +++ b/packages/cli/test/fixtures/repository/models/decoratordefined.model.txt @@ -0,0 +1,17 @@ +import {Entity, model} from '@loopback/repository'; + + @model({ + name: 'Product', + properties: { + thePK: {type: 'number', id: true}, + name: {type: 'string', required: true}, + }, + }) + export class DecoratorDefined extends Entity { + thePK: number; + name: string; + + constructor(data?: Partial) { + super(data); + } + } diff --git a/packages/cli/test/fixtures/repository/models/defaultmodel.model.txt b/packages/cli/test/fixtures/repository/models/defaultmodel.model.txt new file mode 100644 index 000000000000..aa48e75ce124 --- /dev/null +++ b/packages/cli/test/fixtures/repository/models/defaultmodel.model.txt @@ -0,0 +1,26 @@ +import {Entity, model, property} from '@loopback/repository'; + +@model() +export class DefaultModel extends Entity { + @property({ + type: 'number', + id: true, + default: 0, + }) + id?: number; + + @property({ + type: 'string', + }) + desc?: string; + + @property({ + type: 'number', + default: 0, + }) + balance?: number; + + constructor(data?: Partial) { + super(data); + } +} diff --git a/packages/cli/test/fixtures/repository/models/invalid-id.model.txt b/packages/cli/test/fixtures/repository/models/invalid-id.model.txt new file mode 100644 index 000000000000..b8ce23f049c7 --- /dev/null +++ b/packages/cli/test/fixtures/repository/models/invalid-id.model.txt @@ -0,0 +1,20 @@ + import {Entity, model, property} from '@loopback/repository'; + + @model() + export class InvalidID extends Entity { + @property({ + type: 'string', + required: true, + default: 0, + }) + id: string; + + @property({ + type: 'string', + }) + desc?: string; + + constructor(data?: Partial) { + super(data); + } + } diff --git a/packages/cli/test/fixtures/repository/models/multi-word.model.txt b/packages/cli/test/fixtures/repository/models/multi-word.model.txt new file mode 100644 index 000000000000..456f14d25de2 --- /dev/null +++ b/packages/cli/test/fixtures/repository/models/multi-word.model.txt @@ -0,0 +1,20 @@ +import {Entity, model, property} from '@loopback/repository'; + + @model() + export class MultiWord extends Entity { + @property({ + type: 'string', + id: true, + default: 0, + }) + pk?: string; + + @property({ + type: 'string', + }) + desc?: string; + + constructor(data?: Partial) { + super(data); + } + } diff --git a/packages/cli/test/fixtures/service/index.js b/packages/cli/test/fixtures/service/index.js new file mode 100644 index 000000000000..c2ebe4b5d31f --- /dev/null +++ b/packages/cli/test/fixtures/service/index.js @@ -0,0 +1,61 @@ +const DATASOURCE_APP_PATH = 'src/datasources'; +const CONFIG_PATH = '.'; +const DUMMY_CONTENT = '--DUMMY VALUE--'; + +exports.SANDBOX_FILES = [ + { + path: CONFIG_PATH, + file: 'mysoapconfig.json', + content: JSON.stringify({ + name: 'MultiWordService', + datasource: 'myds', + }), + }, + { + path: CONFIG_PATH, + file: 'myrestconfig.json', + content: JSON.stringify({ + name: 'myservice', + datasource: 'restdb', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'myds.datasource.json', + content: JSON.stringify({ + name: 'myds', + connector: 'soap', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'myds.datasource.ts', + content: DUMMY_CONTENT, + }, + { + path: DATASOURCE_APP_PATH, + file: 'dbmem.datasource.json', + content: JSON.stringify({ + name: 'dbmem', + connector: 'memory', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'dbmem.datasource.ts', + content: DUMMY_CONTENT, + }, + { + path: DATASOURCE_APP_PATH, + file: 'restdb.datasource.json', + content: JSON.stringify({ + name: 'restdb', + connector: 'rest', + }), + }, + { + path: DATASOURCE_APP_PATH, + file: 'restdb.datasource.ts', + content: DUMMY_CONTENT, + }, +]; diff --git a/packages/cli/test/integration/generators/repository.integration.js b/packages/cli/test/integration/generators/repository.integration.js index dc8c1e8b6bca..af90ced3ce6f 100644 --- a/packages/cli/test/integration/generators/repository.integration.js +++ b/packages/cli/test/integration/generators/repository.integration.js @@ -14,14 +14,17 @@ const expect = testlab.expect; const TestSandbox = testlab.TestSandbox; const generator = path.join(__dirname, '../../../generators/repository'); - +const SANDBOX_FILES = require('../../fixtures/repository').SANDBOX_FILES; const testUtils = require('../../test-utils'); // Test Sandbox const SANDBOX_PATH = path.resolve(__dirname, '..', '.sandbox'); const sandbox = new TestSandbox(SANDBOX_PATH); -describe('lb4 repository', () => { +describe('lb4 repository', function() { + // tslint:disable-next-line:no-invalid-this + this.timeout(30000); + beforeEach('reset sandbox', async () => { await sandbox.reset(); }); @@ -37,11 +40,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(multiItemPrompt); @@ -97,11 +96,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(multiItemPrompt); @@ -128,11 +123,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('myrepo --datasource dbmem --model MultiWord'); const expectedFile = path.join( @@ -155,11 +146,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('--config myconfig.json'); const expectedFile = path.join( @@ -193,11 +180,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(multiItemPrompt); @@ -230,11 +213,7 @@ describe('lb4 repository', () => { testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(basicPrompt) .withArguments(' --model InvalidModel'), @@ -249,11 +228,7 @@ describe('lb4 repository', () => { testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(basicPrompt), ).to.be.rejectedWith(/You did not select a valid model/); @@ -263,13 +238,7 @@ describe('lb4 repository', () => { return expect( testUtils .executeGenerator(generator) - .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: false}, - SANDBOX_FILES, - ), - ), + .inDir(SANDBOX_PATH, () => testUtils.givenLBProject(SANDBOX_PATH)), ).to.be.rejectedWith(/No datasources found/); }); }); @@ -282,11 +251,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(basicPrompt) .withArguments(' --model Defaultmodel'); @@ -312,11 +277,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('--datasource dbmem --model decoratordefined'); const expectedFile = path.join( @@ -346,11 +307,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('--datasource dbkv --model Defaultmodel'); const expectedFile = path.join( @@ -377,11 +334,7 @@ describe('lb4 repository', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(basicPrompt) .withArguments('--model decoratordefined'); @@ -406,166 +359,6 @@ describe('lb4 repository', () => { }); // Sandbox constants -const DATASOURCE_APP_PATH = 'src/datasources'; -const MODEL_APP_PATH = 'src/models'; -const CONFIG_PATH = '.'; + const REPOSITORY_APP_PATH = 'src/repositories'; const INDEX_FILE = path.join(SANDBOX_PATH, REPOSITORY_APP_PATH, 'index.ts'); -const DUMMY_CONTENT = '--DUMMY VALUE--'; - -const SANDBOX_FILES = [ - { - path: CONFIG_PATH, - file: 'myconfig.json', - content: `{ - "datasource": "dbmem", - "model": "decoratordefined" - }`, - }, - { - path: DATASOURCE_APP_PATH, - file: 'dbkv.datasource.json', - content: JSON.stringify({ - name: 'dbkv', - connector: 'kv-redis', - }), - }, - { - path: DATASOURCE_APP_PATH, - file: 'dbkv.datasource.ts', - content: DUMMY_CONTENT, - }, - { - path: DATASOURCE_APP_PATH, - file: 'dbmem.datasource.json', - content: JSON.stringify({ - name: 'dbmem', - connector: 'memory', - }), - }, - { - path: DATASOURCE_APP_PATH, - file: 'dbmem.datasource.ts', - content: DUMMY_CONTENT, - }, - { - path: DATASOURCE_APP_PATH, - file: 'restdb.datasource.json', - content: JSON.stringify({ - name: 'restdb', - connector: 'rest', - }), - }, - { - path: DATASOURCE_APP_PATH, - file: 'restdb.datasource.ts', - content: DUMMY_CONTENT, - }, - { - path: MODEL_APP_PATH, - file: 'decoratordefined.model.ts', - content: ` - import {Entity, model} from '@loopback/repository'; - - @model({ - name: 'Product', - properties: { - thePK: {type: 'number', id: true}, - name: {type: 'string', required: true}, - }, - }) - export class DecoratorDefined extends Entity { - thePK: number; - name: string; - - constructor(data?: Partial) { - super(data); - } - } - `, - }, - { - path: MODEL_APP_PATH, - file: 'defaultmodel.model.ts', - content: ` - import {Entity, model, property} from '@loopback/repository'; - - @model() - export class DefaultModel extends Entity { - @property({ - type: 'number', - id: true, - default: 0, - }) - id?: number; - - @property({ - type: 'string', - }) - desc?: string; - - @property({ - type: 'number', - default: 0, - }) - balance?: number; - - constructor(data?: Partial) { - super(data); - } - } - `, - }, - { - path: MODEL_APP_PATH, - file: 'multi-word.model.ts', - content: ` - import {Entity, model, property} from '@loopback/repository'; - - @model() - export class MultiWord extends Entity { - @property({ - type: 'string', - id: true, - default: 0, - }) - pk?: string; - - @property({ - type: 'string', - }) - desc?: string; - - constructor(data?: Partial) { - super(data); - } - } - `, - }, - { - path: MODEL_APP_PATH, - file: 'invalid-id.model.ts', - content: ` - import {Entity, model, property} from '@loopback/repository'; - - @model() - export class InvalidID extends Entity { - @property({ - type: 'string', - required: true, - default: 0, - }) - id: string; - - @property({ - type: 'string', - }) - desc?: string; - - constructor(data?: Partial) { - super(data); - } - } - `, - }, -]; diff --git a/packages/cli/test/integration/generators/service.integration.js b/packages/cli/test/integration/generators/service.integration.js index a111dab7eeb7..b16568e5f6e3 100644 --- a/packages/cli/test/integration/generators/service.integration.js +++ b/packages/cli/test/integration/generators/service.integration.js @@ -13,7 +13,7 @@ const expect = testlab.expect; const TestSandbox = testlab.TestSandbox; const generator = path.join(__dirname, '../../../generators/service'); - +const SANDBOX_FILES = require('../../fixtures/service').SANDBOX_FILES; const testUtils = require('../../test-utils'); // Test Sandbox @@ -30,9 +30,7 @@ describe('lb4 service', () => { return expect( testUtils .executeGenerator(generator) - .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), - ), + .inDir(SANDBOX_PATH, () => testUtils.givenLBProject(SANDBOX_PATH)), ).to.be.rejectedWith(/No datasources found/); }); }); @@ -42,11 +40,7 @@ describe('lb4 service', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('myService --datasource myds'); const expectedFile = path.join( @@ -73,11 +67,7 @@ describe('lb4 service', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('--config mysoapconfig.json'); const expectedFile = path.join( @@ -113,11 +103,7 @@ describe('lb4 service', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(multiItemPrompt); @@ -150,11 +136,7 @@ describe('lb4 service', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withPrompts(multiItemPrompt); @@ -181,11 +163,7 @@ describe('lb4 service', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('--config myrestconfig.json'); const expectedFile = path.join( @@ -211,11 +189,7 @@ describe('lb4 service', () => { await testUtils .executeGenerator(generator) .inDir(SANDBOX_PATH, () => - testUtils.givenLBProject( - SANDBOX_PATH, - {includeSandboxFilesFixtures: true}, - SANDBOX_FILES, - ), + testUtils.givenLBProject(SANDBOX_PATH, {}, SANDBOX_FILES), ) .withArguments('myservice --datasource restdb'); const expectedFile = path.join( @@ -241,66 +215,5 @@ describe('lb4 service', () => { }); // Sandbox constants -const DATASOURCE_APP_PATH = 'src/datasources'; -const CONFIG_PATH = '.'; const SERVICE_APP_PATH = 'src/services'; const INDEX_FILE = path.join(SANDBOX_PATH, SERVICE_APP_PATH, 'index.ts'); -const DUMMY_CONTENT = '--DUMMY VALUE--'; - -const SANDBOX_FILES = [ - { - path: CONFIG_PATH, - file: 'mysoapconfig.json', - content: `{ - "name": "MultiWordService", - "datasource": "myds" - }`, - }, - { - path: CONFIG_PATH, - file: 'myrestconfig.json', - content: `{ - "name": "myservice", - "datasource": "restdb" - }`, - }, - { - path: DATASOURCE_APP_PATH, - file: 'myds.datasource.json', - content: JSON.stringify({ - name: 'myds', - connector: 'soap', - }), - }, - { - path: DATASOURCE_APP_PATH, - file: 'myds.datasource.ts', - content: DUMMY_CONTENT, - }, - { - path: DATASOURCE_APP_PATH, - file: 'dbmem.datasource.json', - content: JSON.stringify({ - name: 'dbmem', - connector: 'memory', - }), - }, - { - path: DATASOURCE_APP_PATH, - file: 'dbmem.datasource.ts', - content: DUMMY_CONTENT, - }, - { - path: DATASOURCE_APP_PATH, - file: 'restdb.datasource.json', - content: JSON.stringify({ - name: 'restdb', - connector: 'rest', - }), - }, - { - path: DATASOURCE_APP_PATH, - file: 'restdb.datasource.ts', - content: DUMMY_CONTENT, - }, -]; diff --git a/packages/cli/test/test-utils.js b/packages/cli/test/test-utils.js index 07199292a694..ad3f52e8be94 100644 --- a/packages/cli/test/test-utils.js +++ b/packages/cli/test/test-utils.js @@ -114,7 +114,7 @@ exports.givenLBProject = function(rootDir, options, sandBoxFiles) { fs.writeFileSync(repoPath, '--DUMMY VALUE--'); } - if (options.includeSandboxFilesFixtures && sandBoxFiles.length > 0) { + if (sandBoxFiles.length > 0) { for (let theFile of sandBoxFiles) { const fullPath = path.join(rootDir, theFile.path, theFile.file); if (!fs.existsSync(fullPath)) {