From de58ff4979e657381a5adbb8a1e9c05fcc3aad57 Mon Sep 17 00:00:00 2001 From: Brian Burns Date: Fri, 5 Jul 2024 12:17:54 -0500 Subject: [PATCH] wip --- packages/cli/lib/cli.ts | 11 ++++------- packages/cli/lib/services/compile.service.ts | 2 ++ packages/nango-yaml/lib/helpers.ts | 4 +++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/cli/lib/cli.ts b/packages/cli/lib/cli.ts index e570888d79..e0e2b57005 100644 --- a/packages/cli/lib/cli.ts +++ b/packages/cli/lib/cli.ts @@ -7,7 +7,6 @@ import ejs from 'ejs'; import * as dotenv from 'dotenv'; import { spawn } from 'child_process'; import type { ChildProcess } from 'node:child_process'; -import slash from 'slash'; import { NANGO_INTEGRATIONS_NAME, getNangoRootPath, getPkgVersion, printDebug } from './utils.js'; import { loadYamlAndGenerate } from './services/model.service.js'; @@ -238,9 +237,9 @@ export function tscWatch({ fullPath, debug = false }: { fullPath: string; debug? fs.mkdirSync(distDir); } + // filePath is a relative platform path, eg '.nango\\schema.ts' watcher.on('add', async (filePath: string) => { - // filePath = filePath.replace(/\\/g, '/'); - filePath = slash(filePath); + console.log('watcher add', filePath); if (filePath === nangoConfigFile) { return; } @@ -248,8 +247,7 @@ export function tscWatch({ fullPath, debug = false }: { fullPath: string; debug? }); watcher.on('unlink', (filePath: string) => { - // filePath = filePath.replace(/\\/g, '/'); - // filePath = slash(filePath); + console.log('watcher unlink', filePath); if (filePath === nangoConfigFile) { return; } @@ -266,8 +264,7 @@ export function tscWatch({ fullPath, debug = false }: { fullPath: string; debug? }); watcher.on('change', async (filePath: string) => { - // filePath = filePath.replace(/\\/g, '/'); - // filePath = slash(filePath); + console.log('watcher change', filePath); if (filePath === nangoConfigFile) { await compileAllFiles({ fullPath, debug }); return; diff --git a/packages/cli/lib/services/compile.service.ts b/packages/cli/lib/services/compile.service.ts index d0b9587a5e..f26da25383 100644 --- a/packages/cli/lib/services/compile.service.ts +++ b/packages/cli/lib/services/compile.service.ts @@ -262,6 +262,8 @@ export interface ListedFile { baseName: string; } +// fullPath - +// filePath - abs or relative platform path // inputPath - absolute platform path // outputPath - absolute platform path export function getFileToCompile({ fullPath, filePath }: { fullPath: string; filePath: string }): ListedFile { diff --git a/packages/nango-yaml/lib/helpers.ts b/packages/nango-yaml/lib/helpers.ts index dc81082f2c..8787a55e5e 100644 --- a/packages/nango-yaml/lib/helpers.ts +++ b/packages/nango-yaml/lib/helpers.ts @@ -183,9 +183,11 @@ export function shouldQuote(name: string) { // return filepath.split(path.sep); // } +//. filePath is a platform path - relative is okay export function getProviderConfigurationFromPath({ filePath, parsed }: { filePath: string; parsed: NangoYamlParsed }): NangoYamlParsedIntegration | null { - // const pathSegments = filePath.split('/'); + console.log('getProviderConfigurationFromPath', filePath); const pathSegments = filePath.split(path.sep); + console.log('pathSegments', pathSegments); const scriptType = pathSegments.length > 1 ? pathSegments[pathSegments.length - 2] : null; const isNested = scriptType === 'syncs' || scriptType === 'actions' || scriptType === 'post-connection-scripts';